EquippableItemTemplate - jimdroberts/FishMMO GitHub Wiki
Abstract base class for equippable item templates, defining slot, attributes, and model data. Used for equipment items such as armor and weapons.
-
public ItemSlot Slot
The equipment slot this item can be equipped to (e.g., head, chest, weapon).
-
public int MaxItemAttributes
The maximum number of attributes the item will have when it's generated.
-
public ItemAttributeTemplateDatabase[] RandomAttributeDatabases
The databases of random item attributes that can be added to the item when it's generated.
-
public uint ModelSeed
The seed value used for model randomization and selection.
-
public int[] ModelPools
Pools of models for different model variations. Used to select different visual models for the item.
- Inherit from EquippableItemTemplate to create custom equipment item templates (e.g., armor, weapons).
- Assign the Slot field to specify where the item can be equipped.
- Set MaxItemAttributes and assign RandomAttributeDatabases for attribute generation.
- Configure ModelSeed and ModelPools for model selection and randomization.
// Example 1: Creating a custom armor template
public class MyArmorTemplate : EquippableItemTemplate {
// Custom logic or additional fields
}
// Example 2: Accessing slot and attributes
EquippableItemTemplate template = ...;
ItemSlot slot = template.Slot;
int maxAttrs = template.MaxItemAttributes;
ItemAttributeTemplateDatabase[] dbs = template.RandomAttributeDatabases;
- Assign the correct ItemSlot for each equipment item to ensure proper equipping logic.
- Use RandomAttributeDatabases to provide variety and replayability for generated items.
- Document the intended use and configuration of each field in the asset's Inspector description.
- Use ModelSeed and ModelPools to diversify item appearance and avoid visual repetition.