ID:2310740
 
Code:
obj/Bullets
density=1
smbomb
name="Grenade"
icon='Bomb.dmi'
icon_state="bomb"
Reload_Sounds=SOUND_bomb1

Bumped(atom/a)
if(istype(a,/mob/NPC))
for(a in range(src,1))
var/damage = 100
a.health -= damage
// flick('explosion.dmi',src)
// flick("boom",a)
// a.overlays += 'explosion.dmi'
if(a.health<=1)
if(src.owner)
src.owner.kills++
a.Death()
range(src)<<sound(src.Reload_Sounds,0,volume=40)

else
if(istype(a,/turf/Walls))
for(a in range(src,1))
a.health -= src.damage
if(a.health<=1)

a.Death()
range(src)<<sound(src.Reload_Sounds,0,volume=40)
'


Problem description:


i am having trouble displaying an overlay or flick animation upon the contact with the target. when i throw the grenade it still does damage and kills npc's and damages/destroys the turfs that are within its range after contact. but there is no animation or overlay.
i tried a few different variations and i have had no success, so i'm looking for advice or some kinda help.
You need to make sure you aren't flick()ing an object that's being deleted right after you show the animation. Either create a temporary visual effect where the object was as its own object and flick that, or prevent the object from being deleted until the animation is done showing.
i see what you mean. thanks for the help.