The Dink Network

Punch sequence and sound

August 26th 2011, 03:55 AM
duckdie.gif
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!", &current_sprite);
wait(50);
say_stop("bla bla!", 1);
sp_seq (1, 528);
playsound("punch.wav");
say_stop("`5bla", &current_sprite);
sp_seq(1, 528);
playsound("punch.wav);
&update_status = 1;
draw_status();
unfreeze(1);
}
August 26th 2011, 04:31 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
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:

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!", &current_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", &current_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);
}
August 26th 2011, 04:58 AM
duckdie.gif
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
August 26th 2011, 06:23 AM
duckdie.gif
Still not working out.
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);
}

August 26th 2011, 07:10 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
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.
August 26th 2011, 07:13 AM
duckdie.gif
It is. Hmm. Maybe I'll just delete the script and start it over again
August 26th 2011, 07:19 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
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.
August 26th 2011, 07:26 AM
duckdie.gif
Deleted the whole script and did it again, and now it works after adding nocontrol.
Me adding your name to credits. XD