proc
LoadPrototypes()
var/XML/Element/root = xmlRootFromPath()
world.log << "Loading prototypes"
for(var/XML/Element/ParentType in root.ChildElements())
var/parent_id = ParentType.Attribute("parent_id")
var/atomtype = ParentType.Attribute("atomtype")
world.log << "Loading prototypes of parent_id \"[parent_id]\""
for(var/XML/Element/Child in ParentType.ChildElements())
var/proto_id = parent_id + ": " + Child.Attribute("id")
var/prototype/proto = new(proto_id, atomtype)
//if(proto)
// world.log << "Created prototype with id \"[proto.id]\""
for(var/XML/Element/ChildVars in Child.ChildElements())
//proto.properties += ChildVars.Tag()
world.log << "Adding \"[ChildVars.Tag()]\" with a value \"[ChildVars.Text()]\" to properties of \"[proto.id]\""
proto.properties["[ChildVars.Tag()]"] = ChildVars.Text() /*Error on this line*/
prototype
var
id
atomtype
list/properties = list()
//there are more procs underneath but I don't want to overcrowd this post
Problem description:
Inspired by Ter13's tutorial on not using subtypes for everything, I decided that a good idea would be to load in the parameters for objects from an XML with the aid of Deadron's XML library. However I'm getting a "bad index" error at runtime on the line noted above, where I am trying to set the properties.
That description was probably clear as mud, but I am willing to elaborate more if there are specific questions.