[Tutorial] Adding Costumes to items without LUA
:fontawesome-solid-code: Example mod & code can be found here:
→ Download the example mod for this Tutorial ←
Default costume types
Defining items
Before adding a costume to an item or trinket, we first need to define items. This can be done by creating an empty "items.xml" file in your mods "content" folder. If that folder does not exist already, create it.
Then add the desired amount of items to your items.xml file. It could then look like this:
Note that we also defined IDs for each item. Those IDs are used to assign the Items to their costume!
IDs located in a "content/items.xml" file are only locally used by the mod. They dont affect other mods and will NOT override existing vanilla items! They will also not define their ingame ID!
Defining the costumes
Now that we defined some items, we now define our costumes in a "costumes2.xml" file.
IMPORTANT: The costume ID and costume Type must be equal to the item id and item type!
Effects of the item type to the costume:
Itemtype | Effect |
passive | Costume gets added when the pickup animation is finished playing. Costumes gets removed, when the item is removed. |
active | Costume gets added when the item is used. It gets removed when you change the room. |
trinket | Costume gets added when the pickup animation is finished playing. Costumes gets removed, when the trinket is removed. |
familiar | Costume gets added when the pickup animation is finished playing. Costumes gets removed, when the item is removed. |
Further Informations:
If a costumeID can't be associated with an itemid, the game crashes.
Transformations still must be added using the Null Costume method (LUA-based)
Costumes of type none actually have a null item associated with it. These Nullcostumes can be added using LUA.
Adding Nullcostumes
Nullcostumes are costumes that dont have an actual item attached to them. Therefore, they can be used to add temporary costumes like for example Transformations.
The following code adds a nullcostume to the player in two different ways. Choose the one that fits your neededs.
:fontawesome-solid-code: costumes2.xml {: .subHeader .example_code}
Define a null costume in the "costumes2.xml" file by setting the type to "none". DONT set an ID!
:fontawesome-solid-code: main.lua {: .subHeader .example_code}
Get the automatically generated CostumeID of the null-Costume, and then apply it to the player
Special thanks to Piber20 and JSG for figuring out these methods!
Last updated