Zones

<Done>

Overview

Zones are Triggers that Enable Logics on the Animal, like Jump, Actions, Deaths... etc. Once an animal Enters a Zone it can be activated via Input or Automatically.

So far a zone can be only used by an animal at a time. On future Updates we will work on making multiple Animal use the same zone simultaneously.

Requirements

  • A zone requires any type of collider set as Trigger.

  • The Layer set on the GameObject must be different from the Layers set on the Ground Layer in the Animal Controller. Usually is set as Ignore Layer

The Animal needs to have any type of collider to interact with the zone

Properties

Zone Type

A zone can modify a Mode, State or change the Stance on an animal, depending the Action set in the Zone.

Type: State

When the Zone is set to State, The animal will automatically make an State Action if it enters the Zone Trigger.

State ID

ID of the State to modify.

State Action: Activate

Activate a State on an Animal.

Horse dies (Activates Death) when it touches the Death Zone Trigger

Action: Allow Exit

Some States cannot exit on their on because some conditions may need to be completed. Calling the Method: State.AllowExit() on the Animal permits the state to exit and other states with lower priority to try to activate themselves.

For Example: A character is Flying; then enters A Fly State Zone with Allow Exit set, this will allow other States like Fall to be activated since the Fly State is allowing lower priority states to be active.

The Dragon Exit Fly when entering the Fly Zone with (AllowExit), allowing Fall State to be activated.

Action: Force Activate

Some States cannot be activated on their on, because it may require some conditions to be completed. This action forces any state to be Active.

E.g.: The Swim State can only be Activated if the animal touches the water. but it can be forced using this action.

Action: Disable

Disable a State on an Animal.

E.g.: you can have a Jump State Zone to Disable the Jump State when a character enters a room.

Action: Enable

If a State on an animal is Disabled, it will enable it back.

E.g.: you can have a Jump State Zone to Enable the Jump State when a character exits a room.

Type: Stance

When the Zone is set to Stance, The animal will automatically make an Stance Action if it enters the Zone Trigger.

Stance ID

ID of the Stance to modify.

Action: Stay

It will set the Zone Stance ID. on the Animal Current Stance while Animal remains inside the Zone Trigger. As soon as he exit the zone.. it will go back to the Default Stance value.

Action: Enter

On Entering the Trigger Zone: the Current Stance on the Animal will be equal to the Zone Stance ID.

Action: Exit

On Exiting the Trigger Zone: the Current Stance on the Animal will be equal to the Zone Stance ID.

Action: Toggle

On Entering the Trigger Zone: the Current Stance on the Animal will be toggled between the to the Zone Stance ID. and the Default Stance.

Type: Mode

When the Zone is set to Mode, The Zone set the Animal to Play a Mode by changing the Active Ability Index if it enters the Zone Trigger.

The Active Ability Index changes to 2 when entering the Eat Zone.

If Automatic is true, it will Play the Mode as soon as the Animal Touches the Zone Trigger.

ModeID

Int ID value of the mode you want to play on the animal.

Ability Index

Ability Inside the Mode you want to play on the Animal

When the Mode is Set to Action, the Ability Index Parameter it will automatically change to Action ID to help you better which Action Index to play on the Animal

Remove Animal on Active

When an animal Enters a Zone.. this zone stores it, to know who is currently using it. if the zone is Activated and this Option is true: it will remove the Stored Animal.

Head Only

When this option true, the zone only will check for gameobjects with colliders that has the name <Head Name>

Head Name

Name of the GameObject that represents the Head.

This is useful for zones that only can be enabled when certain collider enters the zone.

It can be used not Only for the head, but for any bone.

Automatic

It will activate the Zone as soon as the Animal touches the trigger

Disable

It will Disable the zone after is activated for <x> seconds.

Stat Modifiers

​Modifies a Stat of an Animal using the Zone

On Enter

Modifies a Stat when the Animal Enters the Zone Trigger.

On Exit

Modifies a Stat when the Animal Exits the Zone Trigger.

On Active

Modifies a Stat when the Animal Activate the Zone.

Events

On Animal Enter

Invoked when the Animal Enters the Zone Trigger

On Animal Exit

Invoked when the Animal Exits the Zone Trigger

On Zone Active

Invoked when the Animal Activates the Zone