Code:
mob var tmp/village/village verb AssignVillageTest(var/v as text) var/list/l[0] l["Name"] = v l["Squad"] = v l["Mouse"] = v l["Chat"] = v l["Limit"] = 0 l["Chuunin Items"] = list("1") world << "LOADED: [v]" src.village = new(l) var list village = list(
"Leaf" = new/village(list("Name" = "Konohagakure", "Squad" = "Konoha", "Mouse" = "Konoha", "Chat" = "Konoha", "Limit" = null, "Chuunin Items" = list("1"))), "Mist" = new/village(list("Name" = "Kirigakure", "Squad" = "Kiri", "Mouse" = "Kiri", "Chat" = "Kiri", "Limit" = null, "Chuunin Items" = list("2"))), "Sand" = new/village(list("Name" = "Sunagakure", "Squad" = "Suna", "Mouse" = "Suna", "Chat" = "Suna", "Limit" = null, "Chuunin Items" = list("3"))),
)
village var name squad
mouse_icon chat_icon
limit
chuunin_items[0]
New(list/village_info)
if(!islist(village_info)) return null
. = ..()
name = village_info["Name"] squad = village_info["Squad"]
mouse_icon = village_info["Mouse"] chat_icon = village_info["Chat"]
limit = village_info["Limit"]
var/chuunin_num = 1
if(village_info["Chuunin Items"]) for(var/v in village_info["Chuunin Items"])
if(!istext(v)) continue
village_info["Chuunin Items"][chuunin_num] = text2num(v)
chuunin_items[chuunin_num] = village_info["Chuunin Items"][chuunin_num] chuunin_num++
|
Problem description:
So, I'm not sure why, but say I assign one of the villages above to a mob's 'village' variable upon logging in, the game won't recognize that it's created (or otherwise, anything that references the player's 'village' variable will cause a null run-time error). On the other hand, if I say, assign a completely new village (not one of the defaults) using an in-game verb (like the 'AssignVillageTest' verb above) to the mob's 'village' variable, it works fine.
Pretty odd problem really. I've never had this issue before [until recently] and it's getting pretty annoying. I'm sure whatever the problem is, it's simple haha.
Any thoughts?