mob
proc
updateStats()
var/list/statsList = typesof(/obj/stats/)
statsList -= /obj/stats/
var/list/finalStatsList = new/list()
for(var/stats in statsList)
finalStatsList.Add(new stats)
var i
for(i=1, i<=finalStatsList.len, i++)
winset(src,"statsGrid","current-cell=[i]")
src << output(finalStatsList[i], "statsGrid")
var/list/userStats = typesof(/var/stats/)
userStats -= /var/stats/
var a
for(a=1, a<=userStats.len, a++)
if(findtext("[statsList[a]]","[userStats[a]]"))
statList[a].icon_state = usr.userStats[a]
I'm looking to do some sort of typesof() for variables. Since I can't get it to work I assume that the typesof() doesnt work with them, so is there another function?
Also, I want to change the icon_state of an object in a list. I had this for for me in BYOND 3.5 when I used a bunch of for()'s for each obj, so I assume there is a way to do it in 4.0 and hopefully with a nice little list.
Any help is greatly appreciated!
Of course it doesn't work for them, it's for types - for "typesof() for vars" doesn't even make sense. You'll need to describe in detail what you want to do with vars here. A shot in the dark - maybe you're looking for the vars list?
You'd have to be more specific here for a worthwhile answer to be given as well. At any case you're going to obviously need to access the obj in the list in order to effect it, be it by manually looping through the list or not.