Global Class "XMLData"⚓︎
Info
A public table containing all the functions related to gathering XML attributes accross the different XMLs with updated values to match the real values.
You can get this class by using the XMLData
global table.
Note that to call these functions, you must use a .
(period) instead of a :
(colon)!
Example Code
1 |
|
Warning
XML attributes are converted to lowercase when being parsed by REPENTOGON! This eliminates capitializtion inconsistency in vanilla tags, but might result in not being able to find attributes if they're looked up by their name as definined in the XML (e.g bossID
will return nil
, so use bossid
instead.)
Functions⚓︎
GetBossColorByTypeVarSub ()⚓︎
table GetBossColorByTypeVarSub ( EntityType Type, int Variant , int SubType)⚓︎
Returns a table containing the attributes of the bosscolor on bosscolors.xml that match the given type variant and subtype.
Table usage
1 |
|
GetEntityByTypeVarSub ()⚓︎
table GetEntityByTypeVarSub ( EntityType Type, int Variant = 0 , int SubType = 0, boolean Strict = false)⚓︎
Returns a table containing the attributes of the entity on entities2.xml that match the given type and/or variant and/or subtype. The strict parameter determines if it should only return a value when all 3 attributes(type, var and sub) match or return whatever matches the type and take the rest as maybes.
Table usage
1 |
|
child nodes
Child nodes are returned as tables alongside the rest of the attributes. For example, if you want to access the samples of a sound entry, you can use soundentry.sample[1]
.
GetEntryById ()⚓︎
table GetEntryById ( XMLNode NodeType, int Idx )⚓︎
Returns a table containing the attributes of the corresponding xml, the matching NodeType(Ex: XMLNode.TRINKET returns trinket nodes from pocketitems.xml) and match the given unique id.
Table usage
1 |
|
child nodes
Child nodes are returned as tables alongside the rest of the attributes. For example, if you want to access the samples of a sound entry, you can use soundentry.sample[1]
.
id?
The Id usually matches the actual id of the node in question, with the exception of cases like the entities.xml where ids are not unique, on those cases, the id is the order of the node and wont correspond with the actual id. On the cases of XMLs without ids, its just the order again.
GetEntryByName ()⚓︎
table GetEntryByName ( XMLNode NodeType, string Name )⚓︎
Returns a table containing the attributes of the corresponding xml, the matching NodeType (Ex: XMLNode.TRINKET returns trinket nodes from pocketitems.xml) and match the given name parameter.
Table usage
1 |
|
child nodes
Child nodes are returned as tables alongside the rest of the attributes. For example, if you want to access the samples of a sound entry, you can use soundentry.sample[1]
.
GetEntryByOrder ()⚓︎
table GetEntryByOrder ( XMLNode NodeType, int Order )⚓︎
Similar to GetByName or GetById, but it returns the node based on the order in which it appears on the xmls (1 will return the first node, 2 the second one and so on). Useful to iterate through xmls in combination with GetNumEntries, specially for redundant xmls like entities.xml.
Table usage
1 |
|
child nodes
Child nodes are returned as tables alongside the rest of the attributes. For example, if you want to access the samples of a sound entry, you can use soundentry.sample[1]
.
id?
The Id usually matches the actual id of the node in question, with the exception of cases like the entities.xml where ids are not unique, on those cases, the id is the order of the node and wont correspond with the actual id. On the cases of XMLs without ids, its just the order again.
GetEntryFromEntity ()⚓︎
table GetEntryFromEntity ( Entity Entity, boolean AutoXMLPick = true, boolean Strict)⚓︎
Returns a table containing the attributes of the provided entity. The AutoXMLPick
parameter determines if only entities2.xml should be used or if it should pick the xml that matches the EntityType (Ex: items.xml for pedestal collectibles) . The strict parameter determines if it should only return a value when the type,variant and subtype attributes match or return whatever matches the type and take the rest as maybes.
Table usage
1 |
|
child nodes
Child nodes are returned as tables alongside the rest of the attributes. For example, if you want to access the samples of a sound entry, you can use soundentry.sample[1]
.
GetModById ()⚓︎
table GetModById ( string modId )⚓︎
Returns a table containing the attributes of the metdata xml of the matching mod id.
Table usage
1 |
|
id?
The Id usually matches the actual id of the mod in the workshop, with the exception of cases where the mod was downloaded illegally and tampered with or if its an indev mod. If the mod doesnt have an id, then the directory is used as an id.
GetNumEntries ()⚓︎
int GetNumEntries ( XMLNode NodeType)⚓︎
Returns the number of entries a given XMLNode structure has.