I need help in storing a sprite
Hey folks!
So, I've done a cut-scene where there's a sprite named "&knight". Then I make the sprite turn into a script "s1-fakeknight2", it works just fine, but I've ran into problem.
As soon as I leave the screen and come back, the knight is gone.
So, I would need some help as to how to save the knight -sprite, even if I leave the screen.
So, I think what I need help in, is called "saving a sprite".
Thanks,
Skull
So, I've done a cut-scene where there's a sprite named "&knight". Then I make the sprite turn into a script "s1-fakeknight2", it works just fine, but I've ran into problem.
As soon as I leave the screen and come back, the knight is gone.
So, I would need some help as to how to save the knight -sprite, even if I leave the screen.
So, I think what I need help in, is called "saving a sprite".
Thanks,
Skull
You can't directly store a sprite if it isn't placed in the editor. I can offer you two workarounds:
1) Attach a script to the screen the knight is on, and re-create the sprite when you re-enter the screen. Something like this:
void main()
{
if (cutscene has happened)
{
int &knight = create_sprite();
sp_script();
}
}
2) Place the knight in the editor and make it only active if the cutscene has happened. Something like this:
void main()
{
if (cutscene has not happened)
{
sp_active(¤t_sprite,0);
}
}
And you're sure it worked? I thought that if you used an sp_script() command the name of the scriptfile shouldn't be longer than 9 characters. That's what the DinkC reference tells me anyway...
1) Attach a script to the screen the knight is on, and re-create the sprite when you re-enter the screen. Something like this:
void main()
{
if (cutscene has happened)
{
int &knight = create_sprite();
sp_script();
}
}
2) Place the knight in the editor and make it only active if the cutscene has happened. Something like this:
void main()
{
if (cutscene has not happened)
{
sp_active(¤t_sprite,0);
}
}
And you're sure it worked? I thought that if you used an sp_script() command the name of the scriptfile shouldn't be longer than 9 characters. That's what the DinkC reference tells me anyway...








