ID:142155
 
Code:
mob/verb
BlackCoffin(mob/M in view(6))
M.canmove=0
flick('smallbox.dmi',M.overlay)


Problem description:

M'kay, well, obviously this doesn't work, but I was curious as to if flicking an overlay is possible.
BUProductions wrote:
Code:
> mob/verb
> BlackCoffin(mob/M in view(6))
> M.canmove=0
> flick('smallbox.dmi',M.overlay)
>

Problem description:

M'kay, well, obviously this doesn't work, but I was curious as to if flicking an overlay is possible.

Likely the best you could do is create a temporary object for this purpose and do something like the following:

mob/verb/BlackCoffin(mob/m in oview(6))
var/obj/smallbox/o = new
m.overlays += o
spawn(35) m.overlays -= o
In response to Mobius Evalon
For some reason it wouldn't recognize o
In response to BUProductions
My guess is instead of reading his post and absorbing the information necessary to even use his code, you copied and pasted the code and it returned an error telling you that obj/smallbox is an undefined type path. Would I be correct in guessing this?
In response to Glarfugus
No.

obj
smallbox
icon='smallbox.dmi'

mob/verb
BlackCoffin(mob/M in view(6))
M.canmove=0
var/obj/smallbox = new
M.overlays += smallbox
spawn(40) M.overlays -= smallbox
M.canmove=1


This is what's in my code, but it still doesn't work.
In response to BUProductions
Does it return a compile-time error? If so, what error?
In response to Glarfugus
Well, now that I took out the /o, it doesn't have any errors.

It still doesn't work, however. I'm using view(6) instead of oview(6) so I can test it out on myself, but it still doesn't do anything.
In response to BUProductions
var/obj/smallbox means you have a variable smallbox of type /obj. Put the /o back in and give me the error so I can help you.
In response to Glarfugus
For some reason it works now. >_>

I must have mistyped it.

BUT!!!

It's an underlay, for some reason.

mob/verb
BlackCoffin(mob/M in view(6))
M.canmove=0
var/obj/smallbox/o = new
M.overlays += o
M.canmove=1


Should I bump up the layer in the obj part?


[EDIT]

Bwahaha, that worked. Thanks man ^^;
In response to BUProductions
Actually, there's another problem -_-

The icon state doesn't begin at the beginning... it begins like at the end, then replays through to where it started.
If you use flick() on an atom that has overlays, all its overlays will flick() that same icon_state as well. It may very well be suitable for you.