The Dink Network

Dieing Ducks and Pigs

July 26th 2004, 01:12 PM
duckdie.gif
Please help me with a script that allows ducks and pigs to die.

I would like for them to say something on the first hit - if possible.

Thank you for your scripting.

David
July 26th 2004, 03:20 PM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
Attach this script to a duck:

//Duck script

void main( void )
{
sp_brain(&current_sprite, 3);
sp_base_walk(&current_sprite, 20);
sp_speed(&current_sprite, 1);
sp_timing(&current_sprite, 33);
sp_hitpoints(&current_sprite, 1);
preload_seq(21);
preload_seq(23);
preload_seq(24);
preload_seq(26);
preload_seq(27);
preload_seq(29);
preload_seq(111);
preload_seq(113);
preload_seq(117);
preload_seq(119);
preload_seq(121);
preload_seq(121);
preload_seq(121);
preload_seq(121);
}

void die( void )
{
say("`%Quack!", &current_sprite);
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 6);
}

Replace the "`%Quack!" with whatever you want.
July 26th 2004, 03:41 PM
anon.gif
MiloBones
Ghost They/Them
 
Why editor type 6?
July 26th 2004, 03:49 PM
spike.gif
so the duck'll come back after 6 minutes. I'd put there 1 though, I hate respawning.
July 26th 2004, 06:59 PM
duckdie.gif
Thank you, I will go with 6.
July 27th 2004, 07:34 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
In original Dink the ducks have editor type 6.
July 27th 2004, 09:42 AM
anon.gif
Milo Bones
Ghost They/Them
 
But they never came back... I guess they would if you left 'em running around bloody. I'm too lazy to test.
July 27th 2004, 04:04 PM
duckdie.gif
So I don't need 6 for ducks?

What is the script for pigs?????

Mind, I can get a moving duck and a moving pig, but nothing happens to them when I hit them.

July 27th 2004, 04:38 PM
anon.gif
Milo Bones
Ghost They/Them
 
Stalker's script should work... I'm baffled if it doesn't.
July 28th 2004, 05:46 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
It should, at least it has worked with all my D-Mods.

BTW, Easy DinkC says that the proc duckdie(); is run when the duck's head is cut off. Does it call both duckdie(); and die(); at the same time?
July 28th 2004, 06:24 AM
spike.gif
duckdie(); is the procedure run when you completely demolish the duck.
July 29th 2004, 07:14 PM
duckdie.gif
Great ducks wrok, What is the script for Pigs?

I assume pigs changing into ducks means something is wrong?
July 30th 2004, 06:15 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
//Piggie

void main( void )
{
sp_brain(&current_sprite, 4);
sp_base_walk(&current_sprite, 40);
sp_speed(&current_sprite, 1);
sp_timing(&current_sprite, 66);
sp_hitpoints(&current_sprite, 5);
}

void die( void )
{
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);
}
July 30th 2004, 08:46 AM
duckdie.gif
Thank you for the scripts, both work well.

Cheers