Step 1: Create a new ItemDefinitionSO Scriptable Object

In the folder Assets/Asset Identifier SOs/Items/ create a new Item Definition Scriptable Object. This is found in the Create menu under Items/. Fill in the item information.

  • itemDisplayName - Item name to be shown in-game.
  • description - Item description.
  • icon - Sprite to be shown in-game. The design team will handle this.
  • maxStacks - The maximum stack amount this item is allowed to have. If unspecified, set to 999.
  • itemRarity - set to Common, Rare, Legendary or Cursed.
  • Stack:
    • |stackType - The values that the stacking formula scales, eg. Damage Amount, Target Count etc.
    • |stackFormula - The formula used to apply the stack count logic.
    • A - formula value A.
    • B - formula value B.
  • itemEffectConfigs - An array of ItemEffectConfigs. These are the actual effect of the item. Every item needs at least 1.

Now you need to add an effect to your item. In the ItemEffectConfig section, check what Item Effects are already created. If the one that you need hasn’t been created you will need to make it with the next steps.

Step 2: Create an ItemEffect script

In Assets/Scripts/Item System/Effects/ create a new script inheriting from ItemEffect. Before the class is defined, make sure you have this line, replacing EffectName with the name of your effect:

[CreateAssetMenu(fileName = “EffectName”, menuName = “Items/Item Effects/Effect Name”)]

All the code for your effect will be done in the Execute() method. Any parameters that you will need for scaling or other unique values are done with the effect parameters. These are in the EffectParameters.cs file. If the parameter you need doesn’t exist here, create a new parameter in this file. Assign it to the ItemEffect in the Inspector window.

Step 3: Create an ItemEffect ScriptableObject

In Assets/ItemsEffects/ create a new ItemEffect ScriptableObject by selecting Create/Items/ItemEffects/EffectName.

Step 4: Item Effect Config

In the inspector, fill in your ItemEffectConfig. You will need one ItemEffect for each effect the item has.

  • effectSO - Insert the ItemEffect ScriptableObject of the effect you need.
  • isMandatory - If this is true, this effect will always fire when the item is activated, regardless of proc chance or other conditions.
  • notifyOtherProcs - If true, this item will trigger relevant procs eg. if this item has a DamageEffect, the OnHit proc that it produces will trigger all OnHit proc items on the target and source.
  • range - The cell range used by certain effects. Default value is 1.
  • triggerType - Which proc type activates this effect.
  • procChancePercentage - A value between 0 and 1 (where 0 = 0% and 1 = 100%) that determines the chance of the item effect executing when the relevant proc fires.
  • effectCondition - An optional condition that must be passed for the item effect to execute. If you need to create one not present in the game already, refer to the Effect Conditions section in the document below.
  • effectParameters - Extra data values that can be used in ItemEffects to modify certain data points from the inspector. These values are unique for each ItemEffectConfig, so an item can contain two ItemEffects using the same type of effectParameters and have different values in each.

Step 5: Put Item in the Item Catalogue

In the folder Assets/Catalogues/ select the Item Catalogue. Under Auto-Fill Catalogue in the Inspector window, select Items from the categories dropdown menu and then click the green ‘Fill with items’ button. This will add your new item to the catalogue and allow it to be accessed by the game.

Effect Conditions

Effect Conditions are conditions that must be passed for an item to trigger. Not every item needs one, and the field can be left blank if this is the case. To create a new Effect Condition, create a new script in Assets/Scripts/Item System/Conditions/ with the format NameCondition. This script must inherit from the EffectCondition class and implement an Initialize() and CheckCondition() function. At the top of the script it must contain the line:

[CreateAssetMenu(fileName = “NameCondition”, menuName = “Items/Conditions/Name Condition”)]

Then, in Assets/Conditions/ create a new ScriptableObject under the menu Conditions/Name Condition. Then assign this to your item in the effectCondition value.