The Dink Network

Can this be done?

September 19th 2006, 01:23 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
I have a boss guy, and when I hit him, there will randomly spawn guards that will attack me.
Now to the problem When the boss guy dies, I don't want the others to live! Is there anyway to kill them all once the boss is dead?
September 19th 2006, 02:01 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
Yeah, just add this in it's die procedure(Assuming that the guards have a brain of 9).

int &guards;
deathloop:
&guards = get_sprite_with_this_brain(9,0);
if(&guards > 0)
{
sp_active(&guards,0);
goto deathloop;
}

If this won't work, it's probably because the boss die too quick. If so, put that in the main procedure of a script(let's name it "clear.c"), then in the boss' die proc, use
spawn("clear");
September 19th 2006, 05:24 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Hmm... I believe that should work in the die procedure. The die procedure stops working when it gets to any kind of wait command (like wait, say_stop, move_stop, etc).
September 20th 2006, 04:44 AM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
When I hit him randomly he will spawn guards, I use this to spawn them:
int &guard = create_sprite(&303, &387, 9, 297, 1);
sp_script(&guard, "EN-QGUARD");

They doesnt spawn there I want they spawn in the left corner!! So does the boss when he dies, like teleported to the left corner! Why does this happen?
September 20th 2006, 06:18 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Don't use the & before numbers.

int &guard = create_sprite(303, 387, 9, 297, 1);
sp_script(&guard, "EN-QGUARD");
September 20th 2006, 11:13 AM
custom_marpro.png
marpro
Peasant He/Him bloop
 
Do'h! How could I miss a thing like that!?! Anyway... When the boss dies he'steleported to the left upper corner... Why?
September 20th 2006, 04:55 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
We can only tell you if you show us the script. You might consider checking it with DinkC Editor before, still. He would have told you about the ampersand in front of the numbers.
September 21st 2006, 10:10 AM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
cypry i did that exact same thing in a script i wrote except i put a wait command in there. that way if something like appears at the same time as the guy dies IE you hit the guy and he dies but hitting him creates another monster a lag between the monster creating and the die script running wont keep another monster alive and also if it messes up into an infinite loop it wont crash

but here is mine it gives a little fancier visual effect

int &ass;
int &ass1;
int &ass2;
int &blow;
redo:
int &ass = get_sprite_with_this_brain(9,0);
if (&ass != 0)
{
&ass1 = sp_x(&ass,-1);
&ass2 = sp_y(&ass,-1);
sp_active(&ass,0);
&blow = create_sprite(&ass1,&ass2,7,167,1);
sp_seq(&blow,167);
wait(30);
goto redo;
}
September 21st 2006, 10:36 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Left upper corner? Maybe your coordinates are messed up? I was working with something that was supposed to create a sprite at a certain location, but due to an error in my scripting, it wasn't given the coordinates at all and it ended up in the left upper corner. Maybe check where you give the coordinates for an error?
September 21st 2006, 10:49 AM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Ok, I'll take a look if thats the error.