The Dink Network

Attaching scripts to sprite numbers

July 30th 2002, 09:43 AM
fairy.gif
Arik
Peasant He/Him
 
Possible? I know you can change sprite attributes, but my attempts to attach a script have so far failed miserably.
July 30th 2002, 10:02 AM
knightg.gif
WC
Peasant He/Him United States
Destroying noobs since 1999. 
Here is how to do it.

Lets say you wana attach a script called temp.c to a sprite.

DinkEdit:

Pick up the sprite a hit shift-5 and type 'temp' (not temp.c) in the box, hit enter, DONE

WinDinkEdit:

Go into the sprite properties and just type 'temp' in the box next to the word script.
July 30th 2002, 10:08 AM
fairy.gif
Arik
Peasant He/Him
 
Well, if I didn't know how to do that, how would I have done any of CC?

No, what I want to be able to do is attach a script to a map sprite from within another script. Possible?
July 30th 2002, 10:32 AM
wizardg.gif
Paul
Peasant He/Him United States
 
: Well, if I didn't know how to do that, how would I have done any of CC?

: No, what I want to be able to do is attach a script to a map sprite from within another script. Possible?

Sure. Here's how:

int &temp = sp(YourSpriteNumberHere);

sp_script(&temp, "YourScripthere");
July 30th 2002, 10:43 AM
fairy.gif
Arik
Peasant He/Him
 
: : Well, if I didn't know how to do that, how would I have done any of CC?

: : No, what I want to be able to do is attach a script to a map sprite from within another script. Possible?

: Sure. Here's how:

: int &temp = sp(YourSpriteNumberHere);

: sp_script(&temp, "YourScripthere");

Hmm, that's what I was trying. Ho hum, I'll just have to try it again, check for errors etc.
July 30th 2002, 02:30 PM
stonegiant.gif
anyone ever tried making an animated map screen?? now THAT would be cool...
July 30th 2002, 03:02 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
Let me know if you get it to work (I dont' think I did sp(&current_sprite) though. My work around was to use another sprite to find the first sprite by brain (I think) and use a global to control it...
July 31st 2002, 02:52 AM
fairy.gif
Arik
Peasant He/Him
 
: : Well, if I didn't know how to do that, how would I have done any of CC?

: : No, what I want to be able to do is attach a script to a map sprite from within another script. Possible?

: Sure. Here's how:

: int &temp = sp(YourSpriteNumberHere);

: sp_script(&temp, "YourScripthere");

Heh, it worked! I have no idea what I was doing wrong before, but the copy and paste of this worked perfectly. Many thanks