Item - IsaacMulcahy/RPG-AI-SYSTEM-WIKI GitHub Wiki

Overview

This is used to define what a Resource is used in finding objects within the world. It uses the enum ITEMS and ITEMS_TYPES as well as a boolean to whether the item is InUse which is used to prevent NPCs from using the same objects.

Properties

Name Description
Item Name A value of enum ITEMS which is what this item is
Type A value of enum ITEM_TYPES which is the larger group the item is part of
Size How big the item is, low to big
Quantity How many of the item there is (used in carrying system)
In Use This is used to highlight if the current item is actively being used by an agent. This can be used to trigger animations and other effects from the item.
Reserved Tell other agents that the item is going to be used by another agent. This is designed to stop more than one agent trying to use the same item
Interaction This is used to allow for more complex behaviours and ties into the Item object. More details below
Handle Point Vector3 Offset which is used to offset this item when it is used in a 'Using' Slot on the Agent
Storage Point Vector3 Offset which is used to offset this item when it is being carried
Animator Reference to Animator which will be triggered when the item becomes 'In Use'

Interactor

This is used to allow for more complex behaviours and ties into the Item object.

Setup

Setup by adding the component to an Item and adding the object you wish to be affected by the change to the ‘candidate’ variable. Enable the behaviours you want to take place when the object it’s on changes ‘In Use’ state and the Interactor is all setup.

Modes

Set Active

This enables and disable the candidate object

Spawn Item

This is used to spawn in an item either on an item being used or on the finish on a use (This is controlled by the 'On Active' variable). The item being spawned in is set using the 'Item' variable.