• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Help, im trying to add sound to my dialog!

ive been following this video and ive reached a road block...i want it to play a sound as it goes down the line. similar to Undertale or Other RPGs!
I just made all of my characters voices i just dont know how to implement it. ive been trying for a while.
if someone can help me find a easy solution that would be great! (im a noob.)
 

samspade

Member
What have you tried? Also, what do your sound effects sound like? Are they typing sound, people speaking sounds, something else?

One possible solution would be to start playing a sound until you hit the full message length and then stop the sound (this might work for some typing sounds). Another would be to have a sound (regardless of message length) that plays on create or it looks like whenever you hit enter in the else if section (this might work for some speaking sounds).
 
What have you tried? Also, what do your sound effects sound like? Are they typing sound, people speaking sounds, something else?

One possible solution would be to start playing a sound until you hit the full message length and then stop the sound (this might work for some typing sounds). Another would be to have a sound (regardless of message length) that plays on create or it looks like whenever you hit enter in the else if section (this might work for some speaking sounds).
Yeah im trying to do a typewriter sound! im just trying to figure out how to code that so it stops when it hits the full message length XD
 

samspade

Member
Save the id returned by audio_play_sound(index, priority, loop); to a variable, then when the message hits the full loop (which I believe happens when messageChar is greater than string length), check to see if that sound is still playing with audio_is_playing, and if it is, stop it using audio_stop_sound. It looks like you would need to add another if else as well to account for that as currently the only to conditions are if the messsage is still going or the message is over and the player has pressed enter.
 
Top