Global variable string plays audio file by name? its possible? SOLVED

0 favourites
  • 11 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Hello guys, i have Audio file, for example: Narg1.webm

    so for global variable NAME

    i set this GV default to 'Narg'

    in events i try play audio typing in audio file name field NAME&"1" or NAME&1 so should recognize audio file name as Narg1 right? but dont work

    So when NAME&1 or NAME&"1" is finally "Narg1" why this audio Narg1.webm dont want play?

  • Have you tried appending .webm to the name parameter?

  • Have you tried appending .webm to the name parameter?

    i try play sound

    by audio: play (by name)

    but i try indicate name from Global String

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are trying to play Narg1. Narg1 does not exist, so it does not play. You want to play Narg1.webm.

  • You are trying to play Narg1. Narg1 does not exist, so it does not play. You want to play Narg1.webm.

    Why you say that?

    When you want play audio by file name you need to type only "Narg1" not "Narg1.webm"

    so my Global string says its Narg&1 so its 'Narg1' just like 'Narg1.webm' should work

  • I'm not totally sure, but I believe you have to include the folder name if the sound file is in a folder

  • Ashley ahh its a bug

    here i reproduce all steps. When i try play sound using file name audio dont want play from subfolder!

    youtube.com/watch

  • You need to use folderName/soundName.

    Or set the project to flat mode in the advanced project settings.

  • You need to use folderName/soundName.

    Or set the project to flat mode in the advanced project settings.

    Its not possible to choose subfolder from menu

    About flat mode You have right.

    When i choose simple play audio by picking FILE from menu and this file has been in subfolder, this works. So that confused me, and i ask myself why play sound by FILE NAME dont work with subfolders.

    So maybe its not a bug (or maybe is, depends what effect Ashley want to receive) but could be more intuitive in the future

  • It's not a bug. If the project file structure setting is "Folders" (which is the new default), then the audio filename of a file in a folder must be the string "folder/audiofile", not just "audiofile".

  • It's not a bug. If the project file structure setting is "Folders" (which is the new default), then the audio filename of a file in a folder must be the string "folder/audiofile", not just "audiofile".

    got it, i learn something new about construct 3

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