User Tools

Site Tools


gettingstarted:createentity

Creating Entities

RAIN provides the Entity component as a way to encapsulate attributes, properties or characteristics of the game object it is associated with. This can be done by defining one to many custom elements and/or aspects.

Theory

You add Entity elements to any game object you want your AI to detect through its Sensor element. Once detected, the entity can provide the AI with attribute information that describes the game object.

In this next section we will take a look at the work flow for:

  1. Adding Entities to a game object.
  2. Defining attributes about the object through the use of Aspects.
  3. Editing the properties of Entity Aspects through the EntityRig.

Usage

From the RAIN menu:

  1. Select your character or game object in the hierarchy panel of which you like to describe its characteristics.
  2. Select RAIN » Create Entity. This will add the entity component to your selected game object.
  3. Select this newly added Entity component in your hierarchy and view the EntityRig component in the inspector panel.
  4. Note the Entity Name property defaults to the parent object this Entity is associated with.
  5. The Entities Form property also defaults to the parent game object.

Note: You can show/hide advanced settings by clicking the small gear icon in the upper right portion of the EntityRig.

For more on Entity review Entity.

Adding an Aspect:

  1. Entity Aspects are added from the EntityRig in the inspector.
  2. Click the dropdown next the Add Aspect to select the type of Aspect to use.

NOTE: There are two types Visual and Audio. It is important to select the type you will be looking for or Detecting with Sensors. We'll talk a little more about sensors later. Basically, if you are detecting an aspect of visual characteristics you would select Visual and later when adding the sensor to sense this aspect you would again choose Visual. See AI Sensors for more on working with Sensors.

  1. Once you add the Aspect you can set the Name property. This is the property you reference in your behavior tree or code when detecting with your sensor.
  2. You can also specify a Mount Point to associate the Aspect with. For example, if the Aspect were used to describe the type of weapon an enemy might have, you could create an Aspect to describe the weapon and mount the Aspect on the characters hand bone.
  3. With Advanced settings turn on, you have a few additional properties you can define.

Next Steps

See Also

Read the Entity section for more information.

Check out Entities of the Environment

Check out Aspects of the Environment and Custom Element

gettingstarted/createentity.txt · Last modified: 2022/08/13 18:13 (external edit)