The Dink Network

About creating a sprite from a script attached to the screen

March 23rd 2003, 01:24 AM
duck.gif
I'm just a beginner, don't shoot me! But I've got this little question when you create a sprite (eg. a knight).
Can you attach a script to this sprite?
Because I want to be able to talk with him. Please do help me!
Thx
Stefanie
March 23rd 2003, 02:03 AM
wizardb.gif
Phoenix
Peasant He/Him Norway
Back from the ashes 
Depends on the method you make him.. if you make him in DinkEdit, you pick up the sprite, as if you're gonna move it, then hold down SHIFT and click 5, then it asks for the script name, say you have a script called "knight.c", then you enter "knight" (without the .c), and it should work.

If you made the knight with the create_sprite(); command, you must do something like so:

int &knight = create_sprite(values);
sp_script(&knight, "knight");

I think. My DinkC is getting a little rusty, but I think that is how you do it. And if you don't understand what I've just babbled about, I'd suggest you read the txt files in the dink smallwood folder through first.
March 23rd 2003, 05:21 AM
duck.gif
Thanks, the sp_script command was what I was looking for! thanks for your help
Stefanie