var/tmp/obj/attack/ThunderBolt/tbolt = new()
tbolt.icon_state = "spell"
target.overlays += tbolt
sleep(10)
target.overlays -= tbolt
del(tbolt)
Problem description:
First problem is, this overlays my icon (an animated bolt of lightning) onto my target but with no animation, just the last frame is displayed. I've set the animation to play once. I've tried to use flick but for some reason flick("spell",tbolt) doesn't produce any icon. The icon by the way is 51x250 pixels.
Second problem is when I change my code to:
var/tmp/obj/attack/ThunderBolt/tbolt = new()
tbolt.icon_state = "spell"
tbolt.Move(target)
sleep(10)
del(tbolt)
... The animation plays correctly but the icon now randomly shows up in any grid control, there is no other code that would cause the grid to update. I have an inventory and a belt both are grids and randomly whenever I launch my tbolt attack, the icon is displayed in the grid aswell as on the desired location. It's as if I've Move()d the obj into my inventory.
Target by the way is whatever the mouse is hovering over as to cast a spell I use macros, I get the location using:
client
MouseEntered(object,location,control,params)
usr.lasttarget = location
Any ideas?
now this works:
This now gets the animation to play as an overlay over mobs and objs, however annoyingly not over turfs. Any ideas greatly appreciated!
Thanks :D