ID:175528
 
I think I have asked this, and several times. I still don't know quite how that works.

How do you flick overlays? Just as an example someone casts a spell on a monster, and the monster should have an icon_state overlay for the spell effect, which is ten frames long, from beginning to end. How can this be done? Just adding the overlay doesn't always begin and end the sequence from frames 1 to 10, respectively.

Flicking overlays...one of byond's many mysteries..

-Dagolar
Dagolar wrote:
I think I have asked this, and several times. I still don't know quite how that works.

How do you flick overlays? Just as an example someone casts a spell on a monster, and the monster should have an icon_state overlay for the spell effect, which is ten frames long, from beginning to end. How can this be done? Just adding the overlay doesn't always begin and end the sequence from frames 1 to 10, respectively.

Flicking overlays...one of byond's many mysteries..

-Dagolar

I made a procedure for this specific reason;
proc
v_flick(var/N,atom/A,var/Delay as num)
if(isfile(N))
var/obj/O = new()
O.icon = N
A.overlays += O
spawn(Delay) A.overlays -= O
else if(istext(N))
var/obj/O = new()
O.icon = A.icon
O.icon_state = N
A.overlays += O
spawn(Delay) A.overlays -= O
else return 0

Though you may come across a time where you remove objects from the users overlays. Just change the var/obj/O to a special type. (Such as /obj/overlay_flick/)

It may not be perfect, but it'll get the job done!

~>Volte
In response to Volte
wow....something so simple takes so much to put in. Will Dantom ever come out with a simple form of this? Like:

flick_overlays

Thanks though...

-Dagolar
In response to Dagolar
Dagolar wrote:
wow....something so simple takes so much to put in. Will Dantom ever come out with a simple form of this? Like:

flick_overlays

Thanks though...

-Dagolar

D'oh! I forgot to provide syntax. You probably would figure it out, but here it is anyway;
<code> v_flick(Icon,Target,Duration) Icon: An icon file, or icon state or Target's icon. Target: The target mob to flick the overlay on. Duration: How long to keep the overlay on Target. Examples: mob/verb Sleep() v_flick("sleeping",src,15) src.health+=10 Attack(mob/M as mob in oview(1)) M.health-=10 v_flick('slash.dmi',M,5) </code>

Enjoy!

~>Volte
In response to Volte
Add it to the bwicki?
In response to Maz
I'll throw in my two gil here and say it should be added. Well that's it. *Goes back to searching the forums and workingon his code*