the death of a script.
June 9th 2003, 02:20 AM

bdjnk


the following script should kill it's sprite and itself in the process, forever.
void main( void )
{
Freeze(1);
say_stop("`7bla bla", 1);
unfreeze(1);
int &die = sp_editor_num(¤t_sprite);
editor_type(&die, 1);
}
but it doesn't (I have tried about six other ways as well, with no luck). every time I enter the screen the sprite with the script are up and running. any ideas what I am doing wrong? how should I permanently kill this sprite?
void main( void )
{
Freeze(1);
say_stop("`7bla bla", 1);
unfreeze(1);
int &die = sp_editor_num(¤t_sprite);
editor_type(&die, 1);
}
but it doesn't (I have tried about six other ways as well, with no luck). every time I enter the screen the sprite with the script are up and running. any ideas what I am doing wrong? how should I permanently kill this sprite?
well... if you use the if statment
if (&story == 0)
}
say("bla bla.", 1);
&story = 1;
{
if (&story == 1)
}
say("bla bla again.", 1);
{
well...the script will not actualy die but i have changed the story so dink said bla bla again now if you make the story to equal to 2 in another script then dink wouldnt say somthing when you enter that screen
i hope that helps a litle bit
if (&story == 0)
}
say("bla bla.", 1);
&story = 1;
{
if (&story == 1)
}
say("bla bla again.", 1);
{
well...the script will not actualy die but i have changed the story so dink said bla bla again now if you make the story to equal to 2 in another script then dink wouldnt say somthing when you enter that screen
i hope that helps a litle bit

I always use this piece of code, feel free to copy it (It will go away immediately).:
//Removes a sprite permanently from the map
int &hold = sp_editor_num(&target);
if (&hold != 0)
{
editor_type(&hold, 3);
}
sp_brain(&target, 5);
sp_notouch(&target, 1);
sp_nohit(&target, 1);
sp_hard(&target, 1);
draw_hard_sprite(&target);
sp_nodraw(&target, 1);
kill_this_task();
It should work...
//Removes a sprite permanently from the map
int &hold = sp_editor_num(&target);
if (&hold != 0)
{
editor_type(&hold, 3);
}
sp_brain(&target, 5);
sp_notouch(&target, 1);
sp_nohit(&target, 1);
sp_hard(&target, 1);
draw_hard_sprite(&target);
sp_nodraw(&target, 1);
kill_this_task();
It should work...