The Dink Network

Reply to Re: Ineracting sprites

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
January 24th 2014, 05:52 PM
peasantm.gif
shevek
Peasant They/Them Netherlands
Never be afraid to ask, but don't demand an answer 
Yes, no problem at all. What you need is the sprite number. Then you can just use that in sp_frame.

Getting the sprite number may be done in several ways. If your sprite doesn't need a special brain, you can use that as was suggested. If it does, then you can use the target sprite's main function to store its ¤t_sprite into a global, which you then use in your other script.

Finally, what I would do, is use sp() on the editor number of the sprite. However, this requires you to know the editor number, and I'm not sure how constant that is with other editors. In my editor, it is not constant at all, but I can refer to the sprite by name, and it will fill in whatever editor number it has generated for it (as in sp_frame (sp ("chest"), 4); ) . AFAIK in other editors doing something similar would be very fragile, but I might be wrong about that. Actually, I'm sure that in regular dinkedit it would work fine; it will not rearrange the sprite editor numbers, so it isn't fragile at all; just unreadable. But that's DinkC for you.