The Dink Network

Kill them all! Help me out

March 20th 2006, 04:37 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
Could someone give me a hand? I'm kinda stuck.
I've created a boss room, the boss creates more enemy sprites during the fight but when the fight's over I want them to die too. That's the problem. Anyone know a script I can use to kill all enemy sprites in the boss room while the boss is dead?
March 20th 2006, 05:03 PM
spike.gif
This isn't a very nice way to do it IMO, but it's the first/simplest one I thought of. If you want to kill them in some specific way, say so.

loop:
int &thong = get_sprite_with_this_brain(9,-1) == 1)
if (&thong != 0)
{
hurt(&thong, 9999);
wait(10);
goto loop;
}
March 20th 2006, 05:13 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
This should work...

//sample

int &sprite = 0;

getsprite:
wait(1);
&sprite = get_next_sprite_with_this_brain(9, 0, &sprite);
if (&sprite > 0)
{
int &junk = is_script_attached(&sprite);
if (&junk > 0)
{
sp_kill(&sprite, 1);
//or the hurt thing might work well too
}

&sprite += 1;
goto getsprite;
}

March 20th 2006, 05:31 PM
custom_marpro.png
Marpro
Peasant He/Him bloop
 
okay, thanks, I'll try your scripts