The Dink Network

Finding a sprite number

May 5th 2010, 12:59 PM
dinkdead.gif
How would I find out if a sprite exists and then manipulate it? Like "is there a sprite at x/y and if there is then move it around".

The only way that comes to mind is shooting a missile at that x/y and then using &missile_target but that seems a bit messy, not to mention prone to bugs. Is there an easier way?
May 5th 2010, 02:24 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
You could give it a unique brain and use get_sprite_with_this_brain() to check for it.
May 5th 2010, 02:58 PM
dinkdead.gif
Trouble is that it's a random sprite to start with and also keeps changing so I can't keep track of it with anything like that.
May 5th 2010, 03:14 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
I would spawn an invisible missile with only one frame at that area as you suggested.
May 5th 2010, 05:49 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
You could let a loop check all the brains you want to check for and compare their X/Y coordinates. Definitely a much more suitable solution than the missile
May 6th 2010, 03:09 AM
death.gif
HypaH
Peasant He/Him Netherlands
What makes you think you won't burn in hell? 
How is the sprite conceived? You could add a global variable for the sprite and then tell the main script for the random sprite to put &current_sprite into the global, which you can then use anywhere.