mob/player
Move()
.=..()
var/skill/kidou/TigerCannon/t = locate()
for(var/image/i in image_list)
if(t)
usr << "found"
t.run_animation = 0
// t.overlays -= t.tiger_cannon
// t.refresh(src.dir) */
skill
parent_type = /atom/movable
var
level // skill level?
kidou
TigerCannon
name = "tiger_cannon"
var
image/tiger_cannon
damage = 0
run_animation = 1
New(var/newDir,var/mob/player/m)
.=..()
refresh(newDir,m)
m.add(tiger_cannon)
proc
refresh(var/newDir,var/mob/player/m)
usr << "refreshing"
switch(newDir)
if(1) tiger_cannon = image('spells/TigerCannon/TigerCannonNORTH.dmi',pixel_x = -32, pixel_y = 32, layer=FLY_LAYER)
if(2) tiger_cannon = image('spells/TigerCannon/TigerCannon.dmi',pixel_x = 0, pixel_y = -128, layer=FLY_LAYER)
if(4) tiger_cannon = image('spells/TigerCannon/TigerCannonEAST.dmi',pixel_x = 0, pixel_y = 0, layer=FLY_LAYER)
if(8) tiger_cannon = image('spells/TigerCannon/TigerCannonWEST.dmi',pixel_x = -128, pixel_y = -16, layer=FLY_LAYER)
overlays += tiger_cannon
remove()
overlays -= tiger_cannon
animation(var/mob/m)
while( run_animation == 1 )
icon_state = "start"
m.overlays += src
sleep(5)
m.overlays -= src
usr << run_animation
icon_state = "charge"
m.overlays += src
sleep(10)
m.overlays -= src
usr << run_animation
icon_state = "finish"
m.overlays += src
sleep(3)
m.overlays -= src
usr << run_animation
run_animation = 0
m.overlays -= src
/////////////////////////SPELLS//////////////
zz()
set category = "Keys"
set hidden = TRUE
if( state == STATE_NORMAL || state == STATE_RUNNING )
var/skill/kidou/TigerCannon/t = new /skill/kidou/TigerCannon(dir,src)
src << "triggered"
overlays += t
changeState( STATE_SPELL )
changeIconState( "spell" )
t.animation(src)
spawn(10)
changeState( STATE_NORMAL )
changeIconState( "" )
overlays -= t
remove(t)
Problem description:
Im trying to stop a running proc from an outside procedure. Move() attempts to stop animation via use of run_animation var. The loop seems to exit but the icon will still play. Yes "found" displays. And in 'usr << stop_animation', it outputs 1, but when the var becomes 0. It does not output. So the loop is working. But the icon doesn't play.
This should happen:
animation()
runs animation
Move()
stops skill.animation()
Again what makes things difficult: images. My end goal is for this spell to move with the player when they walk (an energy ball they can run with, then explodes into a crazy beam trail at the end).
I see usr a significant amount of times while you are using a datum, and when you have a mob variable defined. As well, occasionally you just throw out "overlays" without attaching a reference to it, so it automatically assumes src - but src is a datum, and can't display it's overlays on a map, in this case.
As for your actual problem, I've been having an issue with this recently too, specifically with image() overlays as well...
If you un-comment this line:
If you do that (and fix it, unless I'm missing something here), does the image() stay on the screen, even though you removed it and even if you attempt to delete it? If so, when you use t.refresh(), does it just place that image on top of the previous one? So it just looks like a cluttered arrangement of overlay images?