Items in the game serve as interactive objects that units can hold, use, or equip. They play a crucial role in defining weapons, consumables, armor, and tools that enhance gameplay mechanics.
There is a distinction between Item and Item Type that applies to all entities:
- Item: An individual instance of an object that exists in the game world (e.g., a health potion held by a player).
- Item Type: The template or definition that specifies the properties of all instances of that item (e.g., the health potion's effects, stack limits, and description).
By defining an Item Type, you create a reusable blueprint that dictates how each spawned instance behaves.
To create an item:
- Navigate to Entities → Items.
- Click on "Add Entity" to define a new Item Type.
- Choose an Asset Selection (determines item behavior).
- Configure attributes, states, animations, and body types.
When creating a new Item Type, you can choose from different default behaviors:
| Option | Description |
|---|---|
| Unusable Item | An Unusable Item that is used as the base for all items. |
| Rotating Weapon | A weapon that rotates to face the mouse cursor. |
| Ranged Weapon | A rotating weapon that fires projectiles (like a bow). |
| Melee Weapon | A close-range weapon with a hitbox for attacks. |
| Consumable | An item that is used and disappears (e.g., health potion). |
Each item has core settings that define its appearance, behavior, and inventory interaction.
| Property | Description |
|---|---|
| Name | The name of the item type for reference. |
| Sprite | The visual representation of the item. |
| Inventory Icon | Overrides the default sprite when displayed in the UI. |
| Description | A short text explaining what the item does. |
| Default Quantity | The starting amount when spawned (e.g., ammo count). |
| Max Quantity | The limit for how many can be stacked together. |
| Setting | Description |
|---|---|
| Permitted Inventory Slots | Limits which slots the item can be placed in. |
| Unit Cannot Drop This Item | Prevents the item from being discarded. |
| Can Merge | Allows stacking with similar items. |
| Backpack Allowed | Determines if the item can go into a backpack. |
| Setting | Description |
|---|---|
| Flip Sprite Horizontally | Flips texture based on direction. |
| Rotate to Face Cursor | Rotates the item to align with mouse aim. |
| Setting | Description |
|---|---|
| Passive Effects | Items that grant passive bonuses when equipped. |
| Player Attributes | Changes specific stats for the player. |
| Unit Attributes | Adjusts stats for a unit (e.g., +10% movement speed). |
| Disabled in Backpack | Determines whether the effect is active inside the inventory. |
Items can activate effects when used.
| Effect Type | Example |
|---|---|
| On Use | Healing effect when consuming a potion. |
| On Hit | Apply fire damage on weapon strikes. |
| On Equip | Grants a speed boost when holding a specific item. |
Effects can be linked to states, ensuring they only trigger under the right conditions.
When selecting the Consumable item type, a new tab opens to configure its settings.
| Setting | Description |
|---|---|
| Delay Before Use | Time before the item can be used after selection. |
| Cooldown (Fire Rate) | The delay before the item can be used again. |
When selecting Weapon (Melee or Ranged), a specialized tab appears for configuring its behavior.
| Property | Description |
|---|---|
| Type | Choose between Melee or Ranged weapon. |
| Damage Hitbox | Defines the area where melee attacks apply damage. |
| Cooldown (Fire Rate) | Controls how fast the weapon can attack. |
| Bullet Type (for Ranged) | Defines the projectile type the weapon shoots. |
| Recoil Force (for Ranged) | Determines knockback effect when shooting. |
| Deploy Method | Specifies how bullets appear when fired. |
- Items are essential for gameplay, defining weapons, consumables, and tools.
- Attributes and Variables allow dynamic item behaviors.
- States and Animations ensure items visually change based on use.
- Weapons have unique physics and projectile settings.
- Effects can be triggered when used, equipped, or interacted with.
With these detailed configurations, you can create complex and dynamic items for your game! 🚀
| Setting | Description |
|---|---|
| Projectile Stream Mode | Controls how projectiles are synced online. |
| Lifespan When Dropped | Determines how long an item stays on the ground. |
| Remove When Empty | Whether an item disappears when depleted. |
| Is Used on Pickup | Triggers instant use upon collection. |
Example: A health pack might heal instantly when a player walks over it.