Making a sprite dissapear later...
Is there a way to make a sprite vanish from the screen once a variable has reached a value, for exampl, 3?
And this means forever, so even if you leave the screen and come back, it's not there
And this means forever, so even if you leave the screen and come back, it's not there
Use visions.
If you don't know how to use them, basically you give a screen a script. Then in the script, write:
void main(void)
{
if (&yourstuffhere > certain number here) //You can use == or < instead of the > too
&vision = your number here;
else
&vision = your number here;
}

If you don't know how to use them, basically you give a screen a script. Then in the script, write:
void main(void)
{
if (&yourstuffhere > certain number here) //You can use == or < instead of the > too
&vision = your number here;
else
&vision = your number here;
}
Ok, so I create the sprite out of scripts and say if visions are a given value, then it will not be there? thanks.
RobJ has a good video tutorial on visions, check it out.
Then afterwards it will make sense how to use scripts with it, like Skull's example.
EDIT: Actually, I'm not 100% sure any of the video tutorials cover it. In any case, if you're using WDE+ you can place sprites on a different vision by first pressing V then entering a number. If you place something on vision 1, it will not show on default vision 0. However, if you then change the vision to 1 through a script, the sprite will appear after you change screens or redraw/load the screen through a script.
Then afterwards it will make sense how to use scripts with it, like Skull's example.
EDIT: Actually, I'm not 100% sure any of the video tutorials cover it. In any case, if you're using WDE+ you can place sprites on a different vision by first pressing V then entering a number. If you place something on vision 1, it will not show on default vision 0. However, if you then change the vision to 1 through a script, the sprite will appear after you change screens or redraw/load the screen through a script.
If you have a lot of sprites you want to disappear, or you want to have the sprites reappear at some point, visions are indeed a good way to go.
If it's just one sprite you want to kill off, though, it's simpler to do something like this:
// I am the sprite that is going to die
void main()
{
if (&story == 3)
{
int &dido = sp_editor_num(¤t_sprite);
if (&dido != 0)
editor_type(&dido,1);
sp_active(&urrent_sprite,0);
}
}
If it's just one sprite you want to kill off, though, it's simpler to do something like this:
// I am the sprite that is going to die
void main()
{
if (&story == 3)
{
int &dido = sp_editor_num(¤t_sprite);
if (&dido != 0)
editor_type(&dido,1);
sp_active(&urrent_sprite,0);
}
}
Scratcher's solution is basically a means to kill off a sprite forever inside the save file. It will remove the sprite completely from the saved map data and it can never be retrieved again afterwards.
I thought as much. I'll use visions, since I'll maybe put the sprite back. Thanks muchly for the info though.
I was going to suggest just killing the sprite, but I would have had to open up the D-Mod and look up the script, cause for some reason I just can't memorize that piece of crap codeline!

It took me a while too.
And I still sometimes accidentally write that as:

int &dido = sp_editor_num(¤t_sprite); if (&dido != 0) editor_type(¤t_sprite,1);
One of the reasons I decided to use visions
Anyway, will this script work to make Dink stop from goin to an area until a variables changes?
void touch(void)
{
if (&story == 3)
{
move_stop (1, x, y);
say ("Not yet", 1);
kill_this_task;
}
if (&story == 4)
{
kill_this_task;
}

Anyway, will this script work to make Dink stop from goin to an area until a variables changes?
void touch(void)
{
if (&story == 3)
{
move_stop (1, x, y);
say ("Not yet", 1);
kill_this_task;
}
if (&story == 4)
{
kill_this_task;
}
Don't use kill_this_task(), and it should work. kill_this_task() will kill the script, and it won't work the next time Dink runs at the barrier.
If you want the script to stop running after Dink says "not yet!", use return(); instead.
You also need to give the barrier an sp_touch_damage of -1. You can do that in the editor, but I usually always do it in the script:
void main()
{
sp_touch_damage(¤t_sprite,-1);
}
If you want the script to stop running after Dink says "not yet!", use return(); instead.
You also need to give the barrier an sp_touch_damage of -1. You can do that in the editor, but I usually always do it in the script:
void main()
{
sp_touch_damage(¤t_sprite,-1);
}
That should work. You want to freeze him before you move him though, and then unfreeze him again after he's done moving. Also, remove the kill_this_task(); lines.
Also, I don't think the whole (&story == 4) thing is required at all.
Before the void touch(void), remember to add
void main(void)
{
sp_touch_damage(¤t_sprite, -1);
}
Also, I don't think the whole (&story == 4) thing is required at all.
Before the void touch(void), remember to add
void main(void)
{
sp_touch_damage(¤t_sprite, -1);
}
oh, OK. Tanks muchly.
Can sp_seq be used to make it look like a sprite died? like,
sp_seq(¤t_sprite, sprites death seq);
Hm?
Can sp_seq be used to make it look like a sprite died? like,
sp_seq(¤t_sprite, sprites death seq);
Hm?

Yeah, but it's a little more complicated than that... If it's a moving, talking sprite, making it look dead can be downright annoying. Something like this:
// this is so the sprite stops moving around
sp_brain(¤t_sprite,0);
// this is so the sprite stops animating
sp_seq(¤t_sprite,0);
// this changes the sprite's sequence to the death sequence (235 is one of the dead girls, I think)
sp_pseq(¤t_sprite,235);
// this gives the sprite the right frame (usually the first one)
sp_pframe(¤t_sprite,1);
// this is so the sprite stops moving around
sp_brain(¤t_sprite,0);
// this is so the sprite stops animating
sp_seq(¤t_sprite,0);
// this changes the sprite's sequence to the death sequence (235 is one of the dead girls, I think)
sp_pseq(¤t_sprite,235);
// this gives the sprite the right frame (usually the first one)
sp_pframe(¤t_sprite,1);