C
chimericalCharlatan
Guest
I'm working on a dialogue system and everything is working just fine except for the text blips that play every time a character is typed - I'd like to delay each blip so it doesn't sound so weird. I know GM 8.1 had a wait() function but I can't think of a replacement for that that doesn't involve an alarm or a step timer.
Here's my code on my text writing object:
and here's the code for my script scr_playblip that plays the text blip:
Here's my code on my text writing object:
Code:
if (characters < message_length)
{
characters_old = characters
hold = keyboard_check(ord("Z"));
characters += increase * (1 + hold);
message_draw = string_copy(message[message_current], 0, characters);
if round(characters) > characters_old scr_playblip(snd_textblip)
}
else
{
if (keyboard_check_pressed(ord("Z")))
{
if (message_current < global.message_end)
{
message_current += 1;
message_length = string_length(message[message_current]);
characters = 0;
message_draw = "";
}
else {
instance_destroy();
}
}
}
Code:
if audio_is_playing(argument0)
{
audio_stop_sound(argument0)
audio_play_sound(argument0,0, false)
}
else
audio_play_sound(argument0,0, false)