Spielerando

Equipment Slots

Equipment slots are named places on a character, such as head, body, two hands and two rings, and each takes only one kind of item. Equipping sends the old piece back to the bag. A two-handed weapon needs both hands. If the bag has no room for the swap, nothing happens and nothing is lost.

Also called: Equipment, Paper doll, Gear slots, Worn items.

A tall heron knight grips a huge two-handed hammer in both wings while its round shield flies off into an open satchel, glowing sockets floating around its head, chest and hands.
Quillowmere, an invented sticker-art knight adventure. Invented game, image generated with AI.

Paste this to your AI

Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.

Add "Equipment Slots" to my game.

What it should do: Slots turn a pile of gear into a set of choices: one helmet, one weapon, a pair of rings. The player decides what to wear, and the game always knows what is worn and where everything else is.

Use these starting values:
- bagSlots: 10

Watch out for these common mistakes:
- The old item has nowhere to go: Tell your AI: work out everything that has to leave first, check the bag can take all of it, and only then change anything. If not, refuse the whole swap.
- Two-handed weapon with a shield: Tell your AI: a two-handed weapon always clears the off hand, and a shield always clears a two-handed weapon from the main hand. Both come back to the bag.
- A swap that needs no spare room: Tell your AI: the place the new item leaves counts as free. Only refuse when more items come off than there are places.
- Two rings: Tell your AI: when no slot is chosen, use a free matching slot first. Only when all are taken, replace the first.
- An item put in the wrong slot: Tell your AI: check the item's kind against the slot before anything moves, and say the slot does not fit.
- Gear in the bag counts as worn: Tell your AI: add up the worn slots only.

Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

What it does

Slots turn a pile of gear into a set of choices: one helmet, one weapon, a pair of rings. The player decides what to wear, and the game always knows what is worn and where everything else is.

Good starting values

ValueStart withWhat it changes
bagSlots10How many places the bag has. Ten leaves room for a few spares and still fills up. With one place, a plain swap still works because the new item leaves its place for the old one.

What usually goes wrong

The old item has nowhere to go

The bag is full and the player swaps a big weapon in. If the game puts the new item on and then looks for room, the shield that had to come off disappears.

Fix: Tell your AI: work out everything that has to leave first, check the bag can take all of it, and only then change anything. If not, refuse the whole swap.

Two-handed weapon with a shield

The player holds a shield and equips a two-handed weapon. If only the main hand is checked, the character swings a greatsword and holds a shield at once.

Fix: Tell your AI: a two-handed weapon always clears the off hand, and a shield always clears a two-handed weapon from the main hand. Both come back to the bag.

A swap that needs no spare room

The bag is completely full and the player swaps one helmet for another. A check that wants one free place refuses a swap that would work fine.

Fix: Tell your AI: the place the new item leaves counts as free. Only refuse when more items come off than there are places.

Two rings

With two ring slots, the game always uses the left one. The second ring replaces the first one, and the right slot is never used.

Fix: Tell your AI: when no slot is chosen, use a free matching slot first. Only when all are taken, replace the first.

An item put in the wrong slot

A dropped item or a clicked slot says body, but the item is a ring. A game that trusts the slot puts a ring on the body and the power adds up wrongly.

Fix: Tell your AI: check the item's kind against the slot before anything moves, and say the slot does not fit.

Gear in the bag counts as worn

The total power is summed over the whole bag by mistake, so the player gets stronger just by carrying a better sword.

Fix: Tell your AI: add up the worn slots only.

How to check it works

Works well with

Needs: Inventory System.

Variations: Hotbar.

Common questions

what do i tell my ai to add equipment slots

Paste this: Add equipment slots for head, body, two hands and two rings. Each slot takes one kind of item. Equipping sends the old item to the bag, a two-handed weapon clears the off hand, and if the bag has no room for what comes off, refuse and change nothing.

how do equipment slots avoid losing items

Treat a swap as one step. First work out what must come off, then check the bag can take it all, and only then change anything. An item is always either in the bag or on the character.

how many equipment slots should a game have

Fewer than you think. Every slot is a choice the player must make again with each new find. Four to six is plenty for most games, and more slots only help if each one changes how the character plays.

can two items go in the same slot

Not unless you build it on purpose. The usual way to get two weapons is two slots, or a quick swap between two sets, so each place still holds exactly one item.

Where it comes from

We could not find a reliable origin for this one yet.

Where this mechanic comes from has not been researched yet.

Games are named only as references. Names and marks belong to their owners, and nothing here is endorsed by them.

What was checked

This is what separates the blueprint from a catalogue entry: the values on this page come from code that runs.

Your AI gets the code

Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it