How do you create sprites in scripts
How do you create a sprite in a script? And how do you make it repeat itself?
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.
&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.
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.
int &crap = create_sprite(x, y, brain, seq, frame);
And then you can use &crap in other commands, like move or say.
But, how do you know what you are creating?
That's determined by the brain,seq,frame part... That determines it's brain, it's sequence and it's frame.
No, what creature will you be creating?
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.
Ok, i understand that, but my brother and i are trying to put our own sprite in the game.
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.
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.