ID:171682
 
How would i get a verb to call this proc

proc
statesearch(icon as icon, string as text)
var/icon/I = new(icon)
var/list/L = list()

L += I.IconStates()

if(L.Find(string))
return 1

else
return 0
mob/verb/call_statesearch(icon as icon, string as text)
statesearch(icon, string)
In response to Loduwijk
ITs supose to come up with a list box showing the names of the states in the icon u are currently using. like in Icon Chatterz
In response to ElderKain
The IconStates function will return a list of the icon states in an icon for you. Have the user select from that list with the input function.
In response to Loduwijk
Well when i used the Verb u gave, it came up with an open file windo, then after chosing the file, it got all screwy and asks u type the name of the icon state. that wasn't what i was asking for.
In response to ElderKain
If you just want the player to be able to select one of the icon states that are in the mob's icon, you could just do something like the following.
mob/verb/change_icon_state()
var/icon/I=icon(icon)
var/list/L=I.IconStates()
var/list/states=list()
for(var/string in L)
//did it this way so players can choose an empty string if the icon has one, as input doesn't show them
if(string=="")
states["Default icon state"]=""
else
states[string]=string
var/state=input("Select an icon state.")in null|states
if(state==null)return
icon_state=states[state] //using the handy associative list ability

That should be self explanitory.