Create a Container Object

Containers are destructible item entities that can drop another item when broken.

Goal

Create a breakable object such as a crate, barrel, box, or scenery prop.

Prerequisites

  • A source mod under Editor.
  • Sprites for the intact object and, optionally, breaking debris.
  • A target item to drop, such as food, points, a weapon, or a custom item.

Steps

  1. Open the mod in the in-game editor menu.
  2. Launch the Character Editor.
  3. Choose Mod mode and the Items filter.
  4. Create a new item entity for the container.
  5. Import the container sprites.
  6. Build the idle/intact animation and the break animation.
  7. Set body boxes so attacks can hit the container.
  8. Set item or reference behavior for a breakable container.
  9. Configure the contained item: target mod, item name, and any mode or spawn settings the behavior requires.
  10. Save the container.
  11. Open the Level Editor and place the container in a test level.

Testing

  • Hit the container from both directions.
  • Confirm it breaks once, plays the expected animation and sound, and drops the expected item.
  • Confirm the dropped item can be picked up or used.
  • Test several containers on screen at once.
  • Test with alternate palettes if the container uses palette effects.