The Dink Network

Dink/Guard Hit Sequence

August 31st 2004, 12:07 PM
pig.gif
sjoerdje
Peasant He/Him Netherlands
Lava pig to the rescue! 
Yup, it's me again.. I'm sorry for all the questioning but I really want to make a good dmod so I need some help.

I want Dink to hit something in a certain cutscene. That means I must make him play the hit sequence once, but the problem is, it won't. Do I have to make dink invicible and make an other dink which has to move somewhere, then disappear, create a dink hitting sequence, let him appear again, do the rest of the cutscene and in the end delete that one and draw dink back? Is that the only way? Or is there another way? Please tell me!
Regards, Sjoerdje
August 31st 2004, 12:16 PM
spike.gif
haha, hell no! just paste these lines from item-fst.c to wherever in your script you want Dink to hit in.

&basehit = sp_dir(1, -1);
&basehit += 100; //100 is the 'base' for the hit animations, we just add
//the direction
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(1);
playsound(8, 8000,0,0,0);
September 1st 2004, 07:27 AM
pig.gif
sjoerdje
Peasant He/Him Netherlands
Lava pig to the rescue! 
But where is the direction noted? Cause that's not really working you know... how do I make him hit right for instance...
September 1st 2004, 07:32 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
You can do that with just this:

sp_seq(1, 106);

In case you didn't know, 2 is down, 4 is left, 6 is right, 8 is up. Look at the numpad on your keyboard.
September 1st 2004, 07:39 AM
pig.gif
sjoerdje
Peasant He/Him Netherlands
Lava pig to the rescue! 
Yes I did know that and I did use that, but it just doesn't work...

Edit: Ow dang, it seems I was editing the wrong part of the script sorry I was editing something at the &basehit. Thanks Dan!

Ah well while I'm at it:
There is no such file for a knight right? So for a knight I do have to int. different characters to make him hit right?
September 2nd 2004, 11:05 AM
pig.gif
sjoerdje
Peasant He/Him Netherlands
Lava pig to the rescue! 
Anyone??? *dog eyes*

move(&pim, 4, 450, 1);
move_stop(&sla, 6, 400, 1);

sp_seq(&pim, 724);
sp_pframe(&pim, 1);
sp_nocontrol(&pim, 1);

This is the current script but he just won't hit... scratcher says you can stop him first or something? How? And is that needed?
September 2nd 2004, 01:11 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Strange. Try this:

sp_pframe(&pim, 1);
sp_seq(&pim, 724);

Setting the game after you give it the sequence seems like it might stop it from playing.
September 2nd 2004, 01:42 PM
spike.gif
if that doesn't help you can always just kill the sprite, create an exact copy at it's place and make him do

sp_seq(&pim, 724);
sp_pframe(&pim, 1);

I've noticed that when making moving sprites perform sequences they don't always play.
It might be just me though.
September 2nd 2004, 08:44 PM
sob_scorpy.gif
Tyrsis
Peasant She/Her Russia
 
It's not just you. Sometimes you need to preload a sequence to make the sprite perform it.
September 3rd 2004, 06:11 AM
pig.gif
sjoerdje
Peasant He/Him Netherlands
Lava pig to the rescue! 
Well I did the following. I made pim inactive and did this:

int &pi = create_sprite(450, 315, 0, 291, 1);

sp_pframe(&pi, 1);
sp_seq(&pi, 724);
sp_frame(&pm, 1); / sp_frame(1, 1);
sp_kill_wait(1);
sp_nocontrol(&pm, 1)
wait(1);
playsound(8, 8000,0,0,0);
}

but now, he will hit, but you won't hear it neither will he bend back after he struck his axe in the ground... howcome?