The Dink Network

Re: Herb Boots with normal punch speed script

October 22nd 2013, 03:23 PM
goblins.gif
I figure someone could get some use out of this if you (like me) think the super fast attack speed of the herb boots is extremely overpowered, but still wish to have the herb boots movement speed in there. And best of all you can still attack, but it won't be extremely fast.

Here is the script, in two different versions:

Juggle variable version (only works if you have &jug called in Main.c):

//herb boots except punches at roughly Dink's normal attack speed
//so it's almost twice as slow as normal herb boots.

void use( void )
{
	//don't attack fast
	sp_frame_delay(1, 0);
	
	&jug = sp_dir(1, -1);
        //setting dir to itself prevents delay before punching when idle
	sp_dir(1, &jug);
	//disallow diagonal punches
	
	if (sp_dir(1, -1) == 1)
		sp_dir(1, 2);
	if (sp_dir(1, -1) == 3)
		sp_dir(1, 2);
	if (sp_dir(1, -1) == 7)
		sp_dir(1, 8);
	if (sp_dir(1, -1) == 9)
		sp_dir(1, 8);
	
	&jug = sp_dir(1, -1);
	&jug += 100; //100 is the 'base' for the hit animations, we just add
	//the direction
	sp_seq(1, &jug);
	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!
	playsound(8, 8000,0,0,0);
	
	wait(300);
	sp_frame_delay(1, 30);
}

void disarm(void)
{
	set_dink_speed(3);
	sp_frame_delay(1, 0);
	debug("Disarming boots");
	kill_this_task();
}

void arm(void)
{
	sp_attack_hit_sound(1, 0);
	set_dink_speed(2);
	sp_frame_delay(1, 30);
	debug("arming boots");
	
	init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9");
	init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9");
	init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9");
	init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9");
	
	init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9");
	init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10");
	init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9");
	init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9");
	
	init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9");
	init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9");
	init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9");
	init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9");
	
	init("load_sequence_now graphics\dink\hit\normal\ds-h2- 102 75 60 72 -19 -9 19 9");
	init("load_sequence_now graphics\dink\hit\normal\ds-h4- 104 75 61 73 -19 -10 19 10");
	init("load_sequence_now graphics\dink\hit\normal\ds-h6- 106 75 58 71 -18 -10 18 10");
	init("load_sequence_now graphics\dink\hit\normal\ds-h8- 108 75 61 71 -19 -10 19 10");
}

void pickup(void)
{
	Debug("Player now owns this item.");
	kill_this_task();
}

void drop(void)
{
	Debug("Item dropped.");
	kill_this_task();
}


Int version (uses an int, but can be used without calling any juggle variables):

//herb boots except punches at roughly Dink's normal attack speed
//so it's almost twice as slow as normal herb boots.

void use( void )
{
        int &junk;
	//don't attack fast
	sp_frame_delay(1, 0);
	
	&junk = sp_dir(1, -1);
        //setting dir to itself prevents delay before punching when idle
	sp_dir(1, &junk);
	//disallow diagonal punches
	
	if (sp_dir(1, -1) == 1)
		sp_dir(1, 2);
	if (sp_dir(1, -1) == 3)
		sp_dir(1, 2);
	if (sp_dir(1, -1) == 7)
		sp_dir(1, 8);
	if (sp_dir(1, -1) == 9)
		sp_dir(1, 8);
	
	&junk = sp_dir(1, -1);
	&junk += 100; //100 is the 'base' for the hit animations, we just add
	//the direction
	sp_seq(1, &junk);
	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!
	playsound(8, 8000,0,0,0);
	
	wait(300);
	sp_frame_delay(1, 30);
}

void disarm(void)
{
	set_dink_speed(3);
	sp_frame_delay(1, 0);
	debug("Disarming boots");
	kill_this_task();
}

void arm(void)
{
	sp_attack_hit_sound(1, 0);
	set_dink_speed(2);
	sp_frame_delay(1, 30);
	debug("arming boots");
	
	init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9");
	init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9");
	init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9");
	init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9");
	
	init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9");
	init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10");
	init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9");
	init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9");
	
	init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9");
	init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9");
	init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9");
	init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9");
	
	init("load_sequence_now graphics\dink\hit\normal\ds-h2- 102 75 60 72 -19 -9 19 9");
	init("load_sequence_now graphics\dink\hit\normal\ds-h4- 104 75 61 73 -19 -10 19 10");
	init("load_sequence_now graphics\dink\hit\normal\ds-h6- 106 75 58 71 -18 -10 18 10");
	init("load_sequence_now graphics\dink\hit\normal\ds-h8- 108 75 61 71 -19 -10 19 10");
}

void pickup(void)
{
	Debug("Player now owns this item.");
	kill_this_task();
}

void drop(void)
{
	Debug("Item dropped.");
	kill_this_task();
}


Let me know if you have any problems with these scripts.

By the way, using the method in this script to adjust frame delay, you can actually make your own attack speed for weapons. Very useful information for adding some spice to a DMOD. Also, I don't think I've seen it done before, although correct me if there is a DMOD that has variable attack speed weapons besides the herb boots.
October 23rd 2013, 08:43 AM
peasantm.gif
shevek
Peasant They/Them Netherlands
Never be afraid to ask, but don't demand an answer 
I think your second script is identical to the first one. At least it doesn't use an int as you promised.

I've seen at least one DMod with a high-speed sword: it works like herb boots, but while wielding a sword. Wasn't there one in Historical Hero 2? Anyway, this wasn't done using a "custom" speed, but just by speeding Dink up entirely, like with the herb boots. Or at least that's what it looked like.
October 23rd 2013, 08:55 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
I borrowed the high-speed sword script from CC2, cause it basically already did exactly what I wanted.
October 24th 2013, 04:37 PM
goblins.gif
Ah yes, but I meant an attack speed other than the two attack speed already used (herb boots speed, and normal fist speed). I haven't seen a weapon in a DMOD use any attack speed besides those two, even though it's possible to make pretty much any attack speed.
October 24th 2013, 04:42 PM
custom_coco.gif
cocomonkey
Bard He/Him United States
Please Cindy, say the whole name each time. 
I think I may use this script; it just makes good sense and is a much better solution than taking away the attack. Thanks.
October 24th 2013, 04:52 PM
spike.gif
I don't recall any that manipulated frame delay or the ini lines directly, either, although there's some variance in attack speeds by default. The sword is slower than fists (the animation has more frames), while FIAT's buttstomp was somewhat faster than fists... I think some dmods have also used the spellcasting graphics for firefists, which are blazingly fast.

EDIT: Regarding the script, other than both of those being the same one, you also have a totally redundant checkset... This one:
&jug = sp_dir(1, -1);
sp_dir(1, &jug);

I hate redundancy!
October 24th 2013, 06:12 PM
goblins.gif
&jug = sp_dir(1, -1);
sp_dir(1, &jug);


It looks redundant however it (I think) restarts Dink's idle animation, which prevents the delay that Dink has before you attack sometimes when standing idle. You can remove it to make it consistent with other unmodified weapons or you can leave it to make the punch react a little better with when you press the attack button. I'll add a comment to the scripts in the original post to make it more clear what it's there for.

I think I may use this script; it just makes good sense and is a much better solution than taking away the attack. Thanks.

You're welcome Cocomonkey.

Edit:

Oh crap they were both the same! I must have been in too big a hurry and copied the wrong one. It should be fixed now though, thank you.

I don't recall any that manipulated frame delay or the ini lines directly, either, although there's some variance in attack speeds by default. The sword is slower than fists (the animation has more frames), while FIAT's buttstomp was somewhat faster than fists... I think some dmods have also used the spellcasting graphics for firefists, which are blazingly fast.

That's true, I had forgot about the number of frames changing the attack speed. And about that buttstomp which was pretty cool other than the glitch that made it where you couldn't attack sometimes.
October 24th 2013, 07:18 PM
spike.gif
Ah, I remember you mentioning that in your script improvement thing now. I looked carefully, but didn't see any fathomable reason to have that there whatsover. Very clever! (Stupid DinkC...)