Skip to content

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
local numEntries = XMLData.GetNumEntries(XMLNode.ENTITY)
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
print("Red Monstro's suffix:", XMLData.GetBossColorByTypeVarSub(20,0,1).suffix)

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
print("Monstro's BossID:", XMLData.GetEntityByTypeVarSub(20).bossid)
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
print("Sad Onion's description:", XMLData.GetEntryById(XMLNode.ITEM, 1).description)
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
print("Sad Onion's description:", XMLData.GetEntryByName(XMLNode.ITEM, "The Sad Onion").description)
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
print("Sad Onion's description:", XMLData.GetEntryByOrder(XMLNode.ITEM, 1).description)
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
print("Player's birthright:", XMLData.GetEntryFromEntity(Isaac.GetPlayer()).birthright)
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
print("Car's mod name:", XMLData.GetModById("2788006730").name)
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.