ID:266525
 
How would I add an icon state verb to use if i load an icon with my custom icon command. I think it would be something to do with text lol.
Just add I_state as text.
mob
verb
Choose_Icon(I as icon, I_state as text)
usr.icon = I
usr.icon_state = I_state


hope i helped

-Rcet
In response to Rcet
Rcet wrote:
Just add I_state as text.
> mob
> verb
> Choose_Icon(I as icon, I_state as text)
> usr.icon = I
> usr.icon_state = I_state
> <dm>
>
> hope i helped
>
> -Rcet

That would allow people to enter icon states that don't exist in that icon.

Do this instead:

mob/verb/choose_icon()
icon_state = input("Choose a look for yourself.", "Icon State") in icon_states(icon)

This will show you a list of existing icon states, and let you choose one.
In response to Skysaw
thats a cool code but im curious, could you do the same thing for adding "add underlay","del underlay", "addover lay","del overlay"? if not, can you tell me how please thanks
In response to Migzor
yup, but i think the only way over and underlays support icon states is if they are objects..

-Rcet
In response to Migzor
Migzor wrote:
thats a cool code but im curious, could you do the same thing for adding "add underlay","del underlay", "addover lay","del overlay"? if not, can you tell me how please thanks

You could kluge this, no problem. You need to select the icon states from an existing object, then offer them as overlays. If you wanted to use the icon states of the mob itself, it would be quite simple:

mob/verb/choose_icon()
overlays += input("Choose a an overlay for yourself.", "Overlay") in icon_states(icon)
In response to Rcet
what i meant was a code that lets you add any type of over lay...but as a separate code, not attached to the icon state. so like for example: you add a glow around soemone...it doesnt have to be Mario, it could be Ugachoga
In response to Migzor
Migzor wrote:
what i meant was a code that lets you add any type of over lay...but as a separate code, not attached to the icon state. so like for example: you add a glow around soemone...it doesnt have to be Mario, it could be Ugachoga

I'm sure if you think about it, you can adapt the code I gave you. As a start, you can create an icon that contains a bunch of different overlays as icon states. Then you can reference your "effects" object overlay one of its icon states. You could reference the object from any of your mobs, so it won't matter who needs the overlay.
In response to Skysaw
Hey skysaw, i changed the code like this, and it works the way I want, thanks for the help --->

//overlay code
mob
verb
add_overlay(I as icon)
usr.icon = I
overlays += input("Choose a an overlay for yourself.", "Overlay")



i need help deleting the overlay though...because when i tried it doesnt do a thing
In response to Rcet
Rcet wrote:
yup, but i think the only way over and underlays support icon states is if they are objects..

-Rcet