Next: , Previous: , Up: AI   [Contents][Index]


2.2 Guard Module

Component: GuardModule

Add to an object representing an AI guard or cannon fodder. This should be an empty object with a 3D model of a guard parented to it. By "Guard" we mean an AI that should stay in a given area or near a given object, and attack enemies that provoke it. To use this effectively, we recommend also adding a NavModule or similar, since this guard will probably need to get around. Also, add some sort of combat component, or attach a turret so it can do harm.

Field of GuardModule: GameObject objective

What are we trying to guard?

Field of GuardModule: float objectiveSearchTime

How often do we search for our objective by tag? (Only occurs if a Guard Objective Tag is defined)

Default value: 2

Field of GuardModule: GameObject killTarget

Who you wan’ me kill? (Assigns a target that already exists in the scene, good for scripted events)

Line Of Sight

Field of GuardModule: LayerMask obstructionMask

When we’re looking for our target, what collision layers can block our view?

Behavior Modifiers

Field of GuardModule: float guardRange

How far from my objective can I travel?

Default value: 30.0f

Field of GuardModule: float guardingRotation

How far do I turn, in degrees, while guarding a position?

Default value: 30.0f

Field of GuardModule: float rotationVariance

How varied, in degrees, is that rotation?

Default value: 15.0f

Field of GuardModule: float wanderInterval

How many seconds between patrol times?

Default value: 15.0f

Field of GuardModule: float wanderWalkTime

How long do I walk for?

Default value: 3.0f

Field of GuardModule: bool autoLookAround

Do I change orientation automatically?

Default value: true

Field of GuardModule: bool wander

Do I wander about the area?

Default value: true

Field of GuardModule: bool debug

Should I output information to the console?

Default value: false

Available Messages

Message on GuardModule: Hunt ()

Enables hunting mode, where we will try to go to the target’s last known position

Message on GuardModule: StopHunting ()

Disables hunting mode, so normal target following behavior willbe used instead

Message on GuardModule: Wander ()

Causes the Guard Module to immediately begin wandering to a new location.

Message on GuardModule: ChangeOrientation ()

Causes the Guard Module to immediately randomize it’s orientation based on the parameters supplied on the component.

Message on GuardModule: ClearTarget ()

Instantly clear’s the Guard Module’s objective and kill target.

Message on GuardModule: TargetNearest (string)

If an object with the given tag is found, target that!

Argument: The tag of the object you wish to target.

Field of GuardModule: GameObject objective

What are we trying to guard?

Field of GuardModule: float objectiveSearchTime

How often do we search for our objective by tag? (Only occurs if a Guard Objective Tag is defined)

Default value: 2

Field of GuardModule: GameObject killTarget

Who you wan’ me kill? (Assigns a target that already exists in the scene, good for scripted events)

Line Of Sight

Field of GuardModule: LayerMask obstructionMask

When we’re looking for our target, what collision layers can block our view?

Behavior Modifiers

Field of GuardModule: float guardRange

How far from my objective can I travel?

Default value: 30.0f

Field of GuardModule: float guardingRotation

How far do I turn, in degrees, while guarding a position?

Default value: 30.0f

Field of GuardModule: float rotationVariance

How varied, in degrees, is that rotation?

Default value: 15.0f

Field of GuardModule: float wanderInterval

How many seconds between patrol times?

Default value: 15.0f

Field of GuardModule: float wanderWalkTime

How long do I walk for?

Default value: 3.0f

Field of GuardModule: bool autoLookAround

Do I change orientation automatically?

Default value: true

Field of GuardModule: bool wander

Do I wander about the area?

Default value: true

Field of GuardModule: bool debug

Should I output information to the console?

Default value: false

Available Messages

Message on GuardModule: Hunt ()

Enables hunting mode, where we will try to go to the target’s last known position

Message on GuardModule: StopHunting ()

Disables hunting mode, so normal target following behavior willbe used instead

Message on GuardModule: Wander ()

Causes the Guard Module to immediately begin wandering to a new location.

Message on GuardModule: ChangeOrientation ()

Causes the Guard Module to immediately randomize it’s orientation based on the parameters supplied on the component.

Message on GuardModule: ClearTarget ()

Instantly clear’s the Guard Module’s objective and kill target.

Message on GuardModule: TargetNearest (string)

If an object with the given tag is found, target that!

Argument: The tag of the object you wish to target.


Next: , Previous: , Up: AI   [Contents][Index]