Skip to content

How to create a new Item

Simon edited this page Mar 29, 2020 · 2 revisions

Follow these steps to create a new item. All code adjustments are done in the core project:

  1. Add a new enum value to the Item enum in the Item.kt file
  2. Add a new configuration for the enum value that you have created in step 1 within the loadItemConfigurations method of the Item.kt file. Let's say that you have added the value POTION_GAIN_STRENGTH to the enum then a new configuration might look like this:
    cfg(Item.POTION_GAIN_STRENGTH, "potion_strength_plus") {
        lifeBonus = 25
    }
    To see all possible options for a configuration, refer to the ItemCfg class of the Item.kt file
  3. Finally, to link your new item to the correct graphic go to the graphics_raw/gameObjects folder of the root project.
  4. Add your graphic to this folder, start the graphicsTexPackProject.tpproj texture packer project located in the graphics_raw folder and repack the gameObjects atlas.
    The file name must match the name that you used for the regionKey of the ItemCfg