The Dink Network

I need help in storing a sprite

May 6th 2009, 04:00 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
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
May 6th 2009, 04:29 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
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(&current_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...
May 6th 2009, 04:34 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Well, I knew those 2 things already, but was thinking that is there an actual way to save the sprite. But I just might use these styles.

Thanks, anyways, Metatarasal.