Items - Passives
Author(s): benevolusgoatTags:
Crash course table of contents
The crash course is still a work in progress!
- Creating a mod.
- Creating a passive item.
- Creating an active item.
- Adding to item pools.
- Making costumes.
- Making a new character.
- Creating entities.
- Creating effects.
- Creating enemies.
- Creating a familiar.
- Creating a projectile variant.
- Creating a tear variant.
- Adding sounds.
- Adding music.
- Making pocket items.
- Creating custom pills.
- Creating custom cards.
- Creating custom runes.
- Creating custom objects.
- Creating challenges.
- Creating new curses.
- Structuring your mod.
- Conclusion.
Items are an integral part of the gameplay of The Binding of Isaac. This tutorial covers how to create passive items.
Video tutorial⚓︎
Creating your item⚓︎
Creating an item is relatively simple. You need only an items.xml
file and an entry for your item within it.
1 2 3 |
|
For every XML file, there is a tag that goes from the start of the file to the end of the file, and multiple "child tags" that act as the individual entries. In this instance, items.xml entries will start with <items>
and end with </items>
, while individual item entries have multiple different options depending on the type of item you're creating. The available tag types are passive
, active
, familiar
, and trinket
. For the purposes of this tutorial, we will be covering the use of passive
.
Root items
tag variables
Note
The variables in the items tag can be changed, but should never be removed.
Variable Name | Possible Values | Description |
---|---|---|
gfxroot | string | Root path of all item sprites, set to gfx/items/ by default. The game will automatically use the appropriate subdirectory at this location based on the type of item it is. Passive and active items will be located in the collectibles folder (ex: gfx/items/collectibles/ ). Used with the gfx variable. |
version | string | The version of the items.xml format. This must always stay equal to 1. |
deathanm2 | string | Optional. Root path of the anm2 file used for the miniature sketch sprites (sometimes known as "death portraits") of the item seen in Isaac's Last Will, the Collection Page on the main menu, and on the pause menu. Items without a death portrait will be represented with a question mark inside of a box. |
passive
tag variables
Note
Only a name
is required to create an item, but all items should be created with a description
, gfx
, and quality
.
Variable Name | Possible Values | Description |
---|---|---|
id | int | Used for associating costumes and death portrait/collection page sprites with an item. |
cache | string | The game keeps track of Isaac's stats with a cache so that they don't need to be recalculated constantly. Put in names for different caches with a space between to tell the game to trigger a re-evaluation for those caches when this item is collected or lost. Possible values: [firedelay, damage, speed, range, tearcolor, tearflag, color, size, shotspeed, all, luck, flying, weapon, familiars]. |
name | string | Name of the item. Also used as an identifier for your item. |
description | string | Description of the item as it appears when collected by Isaac. |
gfx | string | Path to the item image. Must be a .png saved at a bit-depth of 32 bits. |
tags | string | Tags that are used to flag items with certain properties or categories. Multiple tags must be separated with a space; see here for possible values and descriptions. |
bombs | int | Number of added bombs upon pickup. |
keys | int | Number of added keys upon pickup. |
coins | int | Number of added coins upon pickup. |
hearts | int | Number of added red hearts upon pickup. Will fill heart containers, not grant them (1 = half heart). |
soulhearts | int | Number of added soul hearts upon pickup (1 = half soul heart). |
blackhearts | int | Number of added black hearts upon pickup (1 = half black heart). |
maxhearts | int | Number of added empty heart containers upon pickup (1 = heart container, half heart containers can only be filled halfway). |
cooldown | int | Number of frames until this item's associated CollectibleEffect is auto-removed if granted. CollectibleEffects are automatically granted by active items on use. |
special | bool | Retired mechanic since Repentance. Used to mark the item as "special", which would have a chance of being rerolled if you saw another special item earlier in the run. |
devilprice | int | Full heart container cost of the item to purchase in a devil deal. Possible values: ["1", "2"] |
shopprice | int | Cent cost of the item to purchase in a shop. |
addcostumeonpickup | bool | True if your item adds a costume upon pickup. This is set automatically if you attach a costume to your item. |
persistent | bool | Determines whether the item's associated CollectibleEffect is retained when transitioning between rooms, or across save & continue. CollectibleEffects are automatically granted by active items on use. false by default. |
achievement | int | Vanilla achievement id to lock the item behind. |
quality | int | Quality is a mechanic used by a few items and Tainted Lost's item filter. The "strongest" items in this game are generally around quality 3 or 4, while the "weaker" ones are around 0, 1, or 2, although how "powerful" your item should be considered is subjective to the mod developer. This should be within 0 to 4 in order to work with Repentance+'s Abyss changes, but can technically go to 5 and above. |
craftquality | int | Bag of Crafting uses its own version of item quality in order to decide what item it should give Isaac. A value of -1 prevents this item from appearing in Bag of Crafting. |
hidden | bool | Prevents the item from appearing in the Death Certificate dimension, or on the collection menu. |
cleareffectsonremove | bool | Clears any effects of the item upon removal. Note: This is currently not used by any vanilla item. |
REPENTOGON adds its own set of item
tag variables.
REPENTOGON-exclusive item
tag variables
Variable Name | Possible Values | Description |
---|---|---|
achievement | int or string | Ties the item/trinket to be unlocked by an achievement, but now allows modded achievements. For modded achievements, use the corresponding name xml attribute value. |
customtags | string | Defines an arbitrary tag, or set of tags, that can be used in a similar fashion to the vanilla game's item tags. Explanation on how to use them can be found here. |
Obtaining your item through the debug console⚓︎
Your item now exists in the game, but is unobtainable through any legitimate means. You must give yourself the item through the debug console, either by granting it to Isaac directly or spawning a pedestal. We will cover how to do both methods.
Non-REPENTOGON⚓︎
The debug console is not enabled by default without REPENTOGON.
- Open the debug console. It can be opened with the tilde (~) key, though this may differ depending on your keyboard's language and layout. If it's not enabled, you can navigate to
Documents/My Games/Binding of Isaac Repentance
(orBinding of Isaac Repentance+
for Repentance+ users) and open "options.ini". FindEnableDebugConsole
and change the 0 to 1 to enable the console. Remember to save the file afterwards. You'll need to restart the game for the changes to take effect.
- With the debug console open, type
g
orgiveitem
followed by a space, then the name of your item. All collectibles in the console start with the letterc
, followed by their internal ID number, then their name. Once it appears as the first option in the list, hit ENTER. Hitting ENTER again or ESC will close the debug console. Isaac should now have your new item.
- For spawning the item, note the internal ID number from earlier. Open the console again and type the command
spawn 5.100.
followed by the ID number. The collectible should spawn.
- As an additional note, if there is ever a case where you cannot give yourself the item via name due to the names of other items taking priority, you can type out
g c
followed by the the ID number as a reliable alternative.
REPENTOGON⚓︎
With REPENTOGON, the debug console is automatically enabled and more convenient to use.
- Open the debug console. It can be opened with the tilde (~) key. The debug console window will pop up.
- Select the text box, type
g
orgiveitem
followed by a space, then the name of your item. Hit TAB or select the autofill entry, then hit ENTER. Hitting ENTER again or ESC will close the debug console. Isaac should now have your new item.
- For spawning the item, the process is the exact same, except start the command with
spawn
instead ofg
.
Coding your item Lua with Lua⚓︎
There are lots of capabilities with a passive item that cannot be accomplished in the items.xml
entry. This will require Lua. Although how to use Lua will not be covered here, below is a small snippet of code as an example of how to only execute code if Isaac has your item.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
For the above example to work, make sure you have added damage
to the cache
attribute in your item's items.xml
entry (ex: cache="damage"
).
Below is a list of links to helpful pages with more information on some of the code used in this snippet: