ID:168861
 
mob/verb/DEBUG1()
flick("rawr",usr)


This only changes/flicks my players icon. How can I get it to flick the overlays as well? (Yes, they are named 'rawr' also.(The icon states for the overlays)).
Subtract the original overlay, add the new one.
usr.overlays-=/obj/rawr
usr.overlays+=new/obj/rawr2
In response to Sinoflife
Sinoflife wrote:
Subtract the original overlay, add the new one.
> usr.overlays-=/obj/rawr
> usr.overlays+=new/obj/rawr2
>



I shouldn't have to do that. flick() should work and do what it's supposed to.
The icon_state of each and every one of an atom.overlays is equal to atom.icon_state. You can't change the icon_state of an atom without changing the icon_state of its overlays. I asked this same question when I first started on BYOND.
In response to Branks
Basically meaning(for those of you who didn't catch it), changing the icon_state changes the state of all overlays to the same state. I much prefer changing icon_state than using flick as it can be tested. Like if(icon_state=="state"). After changing the state you can just use spawn to set a delay before returning to the calling state.

Hiead
In response to Branks
Branks wrote:
The icon_state of each and every one of an atom.overlays is equal to atom.icon_state. You can't change the icon_state of an atom without changing the icon_state of its overlays. I asked this same question when I first started on BYOND.

Gee, that sounds familiar: [link].

Branks, when you copy and paste text from somebody else's post, you need to cite it. Otherwise, you're plagiarizing.
In response to Wizkidd0123
Wizkidd0123 wrote:
Branks, when you copy and paste text from somebody else's post, you need to cite it. Otherwise, you're plagiarizing.

A coincidence!

Heh, it could happen ;p

Hiead