How do I play audio from a specific folder in the sounds folder

  • In the sounds folder i have the following structure:

    Sounds/player_1/[all the sound files]

    Sounds/player_2/[all the sound files]

    When the user selects the character they want to play with i set a global variable to either 1 or 2

    How do i then in my event sheet play the sounds for that specific selection.

    For example:

    at game over, if the character selected is player_1...i want to play the sounds located at Sounds/player_1/gameover.wav

    Any help would be greatly appreciated.

    I dont get the roles of folders in there if all the sounds appear in one big dropdown when adding a play audio action.

    Thank you.

    Tagged:

  • The folders are for organising objects in the editor, not for referencing in events.

  • wow, thats a real shame. Thank you so much for the answer plinkie

  • It's easy to do with events though and shouldn't take too much longer with conditions, if player=1 play a sound, if player=2 player another sound.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I know, i just wanted to have the sounds named the same for both players, and then just have one instance of the play sound action based on the selected player. It would of been easier and cleaner from an event sheet point of view. Especially when dealing with a lot of sounds.

  • You should be able to do that, for example if you have GameOver1 and GameOver2, you can Play(by name), "GameOver"&player

  • Yes, that si true. I was referring mainly to having them player1/running.mp3 and player2/running.mp3.

    It was me just being lazy renaming about 50 sound files :) It would be nice to be able to take advantage of the folder structure. But i guess its not something that you need that much and only in very specific cases.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)