ID:148964
 
I am attempting to make verbless stat panels by placing icons for players to click on instead of verbs, so I used a list proc to do this, but how can I add more to the list without getting duplicate definitions errors?

mob/Stat()
..()
statpanel("Actions")
stat(actions)

mob/var/list/actions = list(new/obj/Attack)


~Ray~
Stimulus wrote:
I am attempting to make verbless stat panels by placing icons for players to click on instead of verbs, so I used a list proc to do this, but how can I add more to the list without getting duplicate definitions errors?

mob/Stat()
..()
statpanel("Actions")
stat(actions)

mob/var/list/actions = list(new/obj/Attack)

Well, you can't use new like that; that needs to be newlist(), not list(new ...). The proper form would look like this:
mob
var/list/actions = newlist(/obj/Attack, /obj/Jump, ...)

However, bear in mind that everyone will have the same list this way, and it's probably not what you want. Instead, I'd define the actions list in New(), or Login():
mob
var/list/actions

Login()
..()
if(!actions)
actions=newlist(/obj/Attack,/obj/Jump,...)

Lummox JR