File "pocketitems.xml"⚓︎
Resource-Folder: Using this file in a resource folder of a mod will replace the original file.
Content-Folder: Using this file in a content folder will add new cards and pill effects.
pocketitems.xml
is used for two significantly different purposes: Adding cards, and adding pill effects. These have different xml syntaxes, seen below.
Cards & Runes⚓︎
Cards are marked by <card ... />
, like so:
1 |
|
<rune ... />
or the type equal rune
. In the vanilla files, all runes except the soul stones use the <rune>
tag and type. Soul stones use the <card>
tag and the rune
type, but seem to act the same as other runes regardless. An example for a rune would be:
1 |
|
In both Afterbirth+ and Repentance, when adding a custom card you must include the hud
tag, and an anm2 in your mod's content/gfx/
folder called ui_cardfronts.anm2
. This anm2 must contain an animation with the same name as specified in the hud
tag, which will be displayed in the HUD as your card's front. Once you've added a card to the game, you'll be able to get its id through lua by using the Isaac.GetCardIdByName(string cardHudName)
function, which takes the name specified in the hud
tag.
If the card uses the same backside as an already existing pickup, you should set pickup
to the subtype of the existing pickup and not worry about entities2.xml
. Otherwise, you can use the pickup
tag in Repentance, to set the card's HUD and pickup visuals through a single anm2. In order to use it, you must add a matching entities2.xml
entry with the tarot card type and variant (5.300), using the subtype specified in the pickup
tag, as seen below:
In pocketitems.xml
:
1 |
|
In content/entities2.xml
:
1 2 3 4 5 |
|
The anm2 specified in entities2.xml
should have the animations HUD and HUDSmall, alongside general pickup animations. See gfx/05.301_tarot card.anm2
in the vanilla resources for an example! Even if you put the entities2.xml
in the content
directory, you should add the anm2
file in the resources
directory, otherwise the game won't find it. For example, with the provided entities2.xml
, you would need to place the animation file at resources/gfx/custom_object.anm2
.
Note that the subtype used in entities2.xml
and the pickup
tag cannot be used to spawn your card, and will instead crash the game. You must spawn / give your card via the card id, which you can obtain from Isaac.GetCardIdByName(string cardHudName)
as described above. You can also check your card's current ID easily in the console by typing g kID
and checking autocomplete; the last base game card is k97
, the Soul of Jacob, so modded ids will start at k98
.
Unlike in Afterbirth+, cards added in pocketitems.xml
get automatically added to the card pool.
Pill Effects⚓︎
Pill effects are significantly easier to add than cards, and are also automatically added to the pill pool when created. They are marked by <pilleffect ... />
, like so:
1 |
|
Example of a pocketitems.xml
file that adds one new card and one new pill effect:
1 2 3 4 |
|