The Dink Network

How do you create sprites in scripts

November 27th 2005, 05:43 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
How do you create a sprite in a script? And how do you make it repeat itself?
November 27th 2005, 06:56 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
int &newsprite = create_sprite(&x, &y, &brain, &seq, &frame);

&x and &y are the coordinates you want the sprite to appear.
&brain is the brain it should have
&seq and &frame is the picture you want the sprite to have

Brain 6 is the "repeat sequence" brain. You might also need to set

sp_seq(&newsprite, &seq);

after the create_sprite.

From now on you can reference to the created sprite with &newsprite, until you overrule it with something else.

say_stop("Hey, I've just been created", &newsprite);

works, for example.
November 27th 2005, 06:58 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
How do you create a sprite in a script?

int &crap = create_sprite(x, y, brain, seq, frame);

And then you can use &crap in other commands, like move or say.
November 27th 2005, 11:06 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
It works! thanks!
July 22nd 2006, 01:25 PM
pq_knight.gif
ThaDude
Peasant He/Him United States
"WHAT IS STFU?! " - VaultDweller 
But, how do you know what you are creating?
July 22nd 2006, 02:32 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
That's determined by the brain,seq,frame part... That determines it's brain, it's sequence and it's frame.
July 22nd 2006, 05:05 PM
pq_knight.gif
ThaDude
Peasant He/Him United States
"WHAT IS STFU?! " - VaultDweller 
No, what creature will you be creating?
July 22nd 2006, 05:20 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Like I said that's determined by the sequence and the frame you tell it to create. When creating a creature the frame should typically be 1. And which kind of creature will be determined by the sequence, like 531 will create a bonca and 297 will create a knight.
July 22nd 2006, 05:28 PM
pq_knight.gif
ThaDude
Peasant He/Him United States
"WHAT IS STFU?! " - VaultDweller 
Ok, i understand that, but my brother and i are trying to put our own sprite in the game.
July 23rd 2006, 05:21 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
Then you'll have to give up the sequence number of your sprite, which you defined earlier in Dink.ini.

Go look in the development/miscellaneous sections of this site for examples and tutorials on how to add sprites, scripts for new sprites/enemies, and dink.ini.