Re: Script help (Deleting Sprites)
I need help. How do you delete/kill a sprite so it doesn't come back. I want the person to run a sequence then dissapear.
I'd say position him off-screen, then kill him. Or kill him, then redraw the screen. (I forgot what the functions were, sorry, but these are two ways to do it.)
EDIT: woops, it shouldn't come back? Well, there was a special function to set the kill properties of someone... I don't remember what that was either, though.
EDIT: woops, it shouldn't come back? Well, there was a special function to set the kill properties of someone... I don't remember what that was either, though.

Let me redefine the question. I had to type it quick cause school was about to start.
You may have seen my thread about the graphics thing where I wanted a skeleton? Well, I got that (PQ enemy pack). And I want to know how to get rid of sprites. I was planning to have the spell so you use it, and about 5 skeletons raise from the ground. I've got all that, then after they attack about 3 times, they go back into the ground. I've made some graphics of the ground opening up and closing, and I modified the skeleton graphics to go down into the ground, and I just need to know, how to delete the sprite after running another sequence.
So, I want to run a sequence, then destroy the sprite. I couldn't find anything in the dinkc.chm. Any help you be greatly appreciated!
You may have seen my thread about the graphics thing where I wanted a skeleton? Well, I got that (PQ enemy pack). And I want to know how to get rid of sprites. I was planning to have the spell so you use it, and about 5 skeletons raise from the ground. I've got all that, then after they attack about 3 times, they go back into the ground. I've made some graphics of the ground opening up and closing, and I modified the skeleton graphics to go down into the ground, and I just need to know, how to delete the sprite after running another sequence.
So, I want to run a sequence, then destroy the sprite. I couldn't find anything in the dinkc.chm. Any help you be greatly appreciated!
So that will just destroy the sprite, make it dissapear? If so, thanks!
Use this as well:
sp_nodraw(¤t_sprite, 1);
So it actually disappears. The previous one just renders the sprite useless. It doesn't actually make the sprite disappear.
sp_nodraw(¤t_sprite, 1);
So it actually disappears. The previous one just renders the sprite useless. It doesn't actually make the sprite disappear.
It does make it invisible actually. You don't need the sp_nodraw() command at all for this...
sp_active() destroys the sprite completely. It removes it from the sprite list, deletes it from screen and clears its sp() number for use by other sprites (such as those created by create_sprite() ).
That's exactly what I want. I want the skeleton to dissapear forever until you use the spell again, but then it just creates another one.
So, I've got another question, I only want the skeletons to rise from their grave if there are enemies on the screen. What script command can you use to see if there's any enemies on a screen. If there aren't any I'll just have Dink say "There's no monsters around now.". Anyone? I know this function was used with a few of the spells in Pilgrim's Quest.
So, I've got another question, I only want the skeletons to rise from their grave if there are enemies on the screen. What script command can you use to see if there's any enemies on a screen. If there aren't any I'll just have Dink say "There's no monsters around now.". Anyone? I know this function was used with a few of the spells in Pilgrim's Quest.
Well, you can check whether there are any sprites with either brain 9 or 10 on the screen. Those are usually the enemy brains, so I would recommend something like this:
int &present = get_sprite_with_this_brain(10,1);
if (&present != 0)
goto present;
&present = get_sprite_with_this_brain(9,1);
if (&present != 0)
goto present;
say_stop("No monsters on this screen...",1);
return;
present:
//execute spell here.
(Maybe this isn't the cleanest way... But it's 0:56 here, so that might just impale my ability to think clearly.)
int &present = get_sprite_with_this_brain(10,1);
if (&present != 0)
goto present;
&present = get_sprite_with_this_brain(9,1);
if (&present != 0)
goto present;
say_stop("No monsters on this screen...",1);
return;
present:
//execute spell here.
(Maybe this isn't the cleanest way... But it's 0:56 here, so that might just impale my ability to think clearly.)
Oh yeah. Brain 9 or 10. Forgot about that. Anyway, thanks! Is there an easier way? If so, anyone?