Error with Sound Files
I'm fairly new to GameSalad and apps in general so I hope this isn't a dumb question.
I started following an online tutorial about making a sample game. I am running into an issue however.
I added the condition Touch to an actor I'm using as a button on the title menu. I added the Change Scene and Play Sound (I chose a file called CartoonBoing) behaviors to the actor. The first time I previewed, it didn't play the sound, but it changed the scene. Afterwards, every time I try to run the preview, it keeps giving me the following Error message:
"Error copying file. Please make sure you don't have any of the files below open in another program and retry. Would you like to retry now?"
It says that the process cannot access the file because it's being used by another process, but I have nothing else open besides the tutorial video on Youtube and GameSalad.
I tried choosing a different Sound File (all of them are OGG files), I turned off the Play Sound behavior but I still get the same error message, but specifically in reference to the previous CartoonBoing sound file. When closed and re-opened the file, I had the same issue: the first time around it didn't play, and afterwards it kept giving me the error message.
What is the issue here?
Comments
The tutorial UKDv12 is referring to is the 2nd video of Matt P.'s 'Gamesalad Windows tutorial' series.
I followed along, step by step and ran into the same issue, so I tried to troubleshoot this myself (I'm using the Windows Creator v0.10.5).
I created a new project and imported my own original sound and image files. These were the only two assets in the project. The project had two scenes, the "initial scene" and "my_scene_name".
I created an Actor and assigned the image to it with the following behavior:
When All of the Following are happening:
Touch > is pressed
Do:
Play Sound: test_mysound.ogg (and yes, I did check the "Run to Completion" option)
This worked as intended; pressing the actor played my sound.
When I added the behavior "change scene" to the "do" list, the scene changed, but the sound didn't play.
It didn't matter whether the change scene was placed before or after the play sound behavior, in both cases, the scene changed without playing a sound.
From what I've read on another thread, while music can play from one scene to the next, apparently sounds can't. Unfortunately, while multiple sounds can play simultaneously, only one music track can play at once. Therefore, you can't get around this by using the Play Music behavior.
Keep in mind that when this video was published in February, 2014. That latest build available at that time was 0.10.4.x, so what may have worked in previous versions of Windows Creator could be broken (or fixed depending on how you look at it) in 0.10.5 (released in June, 2014).
I took a look at the release notes for Windows Creator 0.10.5, but they didn't mention anything about the Play Sound behavior, although this may have been a contributor to the stability issues present in previous versions.
That leaves two options:
I haven't tested the later either, nor am I experienced enough with GameSalad to know how to do that. Again, this merely conjecture, but I hope that it will help either point you in the right direction, or encourage a more seasoned Windows Creator user to chime in.
Thanks!
After doing some more research, I came across a similar post that discussed a possible work-around.
In this example, the user inserted the Change Scene behavior inside a Timer behavior and set the time to the same length as his sound effect. Any shorter and the change scene would simply chop off the sound as soon as the Timer duration completed.
Could the problem be the "Run to Completion" checkbox isn't working?
I was able to setup my Actor to play a sound, then change scenes (but not both as shown in the YouTube video). Here's how I had to do it:
As you can see, the Play Sound > run to completion is selected, but the scene change overrides it, regardless of whether it comes first or not.
So instead dropping the scene change into the "Do" list, I dropped a timer in and set it to "After" 3 seconds (the duration of my sound, but you could adjust to whatever duration your sound is).
While this work-around will allow you to complete both actions, it has to be setup to do one, then the other, but not both simultaneously. That's shame really as this is more complicated (and clunky) than just dropping the sound in and letting it bleed into the next scene.
In fairness, there may be performance/stability reasons for this, or it might be a bug. I'd welcome any feedback from advanced GameSalad users with regard to best practices or suggestions in this matter.
Thanks!
In working out another issue, I came across a more elegant solution for this. Here's what you do:
Create an actor in the next scene, and give it the "play sound" behavior, then drag it onto the scene and place it somewhere out of sight (or change it's color to transparent).
It's not as straight forward as the tutorial video, but it works!