[Tutorial] Adding Costumes to items without LUA⚓︎
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:
1 2 3 4 5 6 7 |
|
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!
1 2 3 4 5 6 7 8 |
|
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.
costumes2.xml⚓︎
Define a null costume in the "costumes2.xml" file by setting the type to "none". DONT set an ID!
1 2 3 |
|
main.lua⚓︎
Get the automatically generated CostumeID of the null-Costume, and then apply it to the player
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Special thanks to Piber20 and JSG for figuring out these methods!