Punch sequence and sound
Okay, so I'm trying to make Dink punch someone and the pun ch sound to come, but althought the rest of the script works, Dink neither puncheds nor the sound comes.
void main(void) { fade_down(); freeze(1); sp_dir(1, 8); wait(1000); say_stop_xy("`%bla", 0, 200); say_stop_xy("`%bla bla bla, bla bla", 0, 200); fade_up(); say_stop("bla bla, bla bla bla, bla bla", 1); wait(100); say_stop("`5bla!", ¤t_sprite); wait(50); say_stop("bla bla!", 1); sp_seq (1, 528); playsound("punch.wav"); say_stop("`5bla", ¤t_sprite); sp_seq(1, 528); playsound("punch.wav); &update_status = 1; draw_status(); unfreeze(1); }
The problem here is that you are using the "playsound" command wrong, and you have the wrong sequence for dink's "play_seq", you are using the sequence of dink throwing seed, rather than his hit procedure. The sequence you should be using is "108"... now if you look in Windinkedit (or whatever editor your using), you will notice the sequence loaded there is dink hitting with his sword.. but this changes in-game, depending on the weapon the player has selected (the weapons script loads the different hit sequences on the fly using the init command).
The "playsound" command works by playing the sound number loaded into "start.c" with the "load_sound" command.
In "Start.c" the "punch.wav" is loaded into the number 9.. if you open it and look you will see lots of "load_sound" commands, and among them is - load_sound("PUNCH.WAV", 9);
So:
The "playsound" command works by playing the sound number loaded into "start.c" with the "load_sound" command.
In "Start.c" the "punch.wav" is loaded into the number 9.. if you open it and look you will see lots of "load_sound" commands, and among them is - load_sound("PUNCH.WAV", 9);
So:
void main(void) { fade_down(); freeze(1); sp_dir(1, 8); wait(1000); say_stop_xy("`%bla", 0, 200); say_stop_xy("`%bla bla bla, bla bla", 0, 200); fade_up(); say_stop("bla bla, bla bla bla, bla bla", 1); wait(100); say_stop("`5bla!", ¤t_sprite); wait(50); say_stop("bla bla!", 1); sp_seq (1, 108); //Play dinks hit sequence sp_frame(1, 1); //Reset sequence to frame 1 sp_kill_wait(1); //This will make Dink hit right away wait(25); playsound(9, 22050, 0, 0, 0); say_stop("`5bla", ¤t_sprite); sp_seq (1, 108); //Play dinks hit sequence sp_frame(1, 1); //Reset sequence to frame 1 sp_kill_wait(1); //This will make Dink hit right away wait(25); playsound(9, 22050, 0, 0, 0); &update_status = 1; draw_status(); unfreeze(1); }
Thanks. I'll see if it works as soon as I get my hands on the computer.
I used the feed sequence and didn't set it to go back xD.
I put in 'bla' to hide the dialogue
I used the feed sequence and didn't set it to go back xD.
I put in 'bla' to hide the dialogue
Still not working out.
Game crashes while loading wav file, sequences don't play.
Game crashes while loading wav file, sequences don't play.
void main(void) { fade_down(); freeze(1); sp_dir(1, 8); wait(1000); say_stop_xy("`%bla", 0, 200); say_stop_xy("`%bla bla", 0, 200); fade_up(); say_stop("bla?!", 1); wait(100); say_stop("`5bla!", ¤t_sprite); wait(50); say_stop("bla!", 1); sp_seq (1, 108); sp_frame(1, 2); sp_kill_wait(1); wait(25); playsound("9, 22050, 0, 0, 0);"); say_stop("`5bla", ¤t_sprite); sp_seq(1, 108); sp_frame(1, 1); sp_kill_wait(1); wait(25) playsound(9, 22050, 0, 0, 0); wait(40); sp_seq(1, 108); sp_frame(1, 1); sp_kill_wait(1); wait(25) playsound(9, 22050, 0, 0, 0); sp_seq(¤t_sprite, 765); sp_frame(¤t_sprite,1); wait(500); say_stop("Oh.", 1); say_stop("bla.", 1); wait(250); say_stop("bla?", 1); wait(200); say_stop("bla!", 1); wait(200); say_stop("bla.", 1); &update_status = 1; draw_status(); unfreeze(1); }
Hmm... works for me
The only reason I can think of that the wav file crashes is that it isn't actually loaded into that number.. open your Start.c, and make sure "punch.wav", is loaded into number 9.
The only reason I can think of that the wav file crashes is that it isn't actually loaded into that number.. open your Start.c, and make sure "punch.wav", is loaded into number 9.
It is. Hmm. Maybe I'll just delete the script and start it over again
also, directly after: sp_kill_wait(1);
you need to add this line too: sp_nocontrol(1, 1);
Thats why the hit sequence isn't playing
But I don't know why it's crashing, doesnt crash for me.
you need to add this line too: sp_nocontrol(1, 1);
Thats why the hit sequence isn't playing
But I don't know why it's crashing, doesnt crash for me.
Deleted the whole script and did it again, and now it works after adding nocontrol.
Me adding your name to credits. XD
Me adding your name to credits. XD