-
Problems with sound
Heya,
I'm using vocal narration for my in game tutorial. I want it to be able to play the sound once the player has collected 2 items. The first thing I tried was to have: Once item 1 + Item 2 are destroyed play sound which would not work at all.
So I then tried using the counter. Once each item is picked up by the player +1 is added to the counter. So when the counter was equal to 2 the sound would play, however when the sound started to play it sounded robotic and slow and would constantly loop as the value was always 2.
Anyone have any ideas how I could get around this?
Thanks a lot.
-
There are many ways to do this....but lets go with what you have..
Think about it for a moment......you say that once the counter was equal to 2 the sound would "constantly loop as the value was always 2" (which is true)
Have you tried to add 1 to the counter once the sound plays?....then it would not be equal to 2 anymore.
Item 1 is picked up
-Add 1 to counter
Item 2 is picked up
-Add 1 to counter
Counter=2
-Add 1 to counter
- play sound
-
The problem to that is I have a condition already for when the counter is 3 but I guess adding a different counter altogether would work well. Pretty simple really I should've though of that lol thanks a lot!
-
You could make another counter or add a "run once" command.As you say, the reason why it sounds strange is because the counter is always on 2. This should rectify the issue.
ie
run this event once+
counter=2
--->play sound
-
How do you do a run once command? I didn't realise there was such a thing.
Thanks
-
in the event editor - add a new event.
right mouse click the computer (special conditions) then choose limit conditions. You can now select run this event once.
You will notice other options as well, like "only one action when event loops" etc
-
Ah that's perfect thank you very much! Wish I knew this sooner would've saved me a lot of trouble in the past :)
-
no problem glad to be of assistance.
-
Keep in mind that if you use the "Run this event once" condition, it will do just that....It will only run it once while the frame is active.
So lets say for example you had a tutorial with Previous and Next buttons and the user clicks on the Previous button and in your events you had it set up to subtract from the counter.
Now the counter =2 again so you expect the sound to play over....well it wont because of the "Run this event once" condition you used. The only way that the condition can be true again (triggered) is if you restarted the frame.
Just a heads up!
-
Thanks Gerald, I've had to use a mix both of them to get it to work.