Module: npc_ai

Non-player character add-on. Provides animated moves for NPC with a specified behavior.

Summary

Members

Methods

Type Definitions

Detailed Description

Members

NT_FLYING

NPC movement type - flying.
Type:
  • number
Source:

NT_SWIMMING

NPC movement type - swimming.
Type:
  • number
Source:

NT_WALKING

NPC movement type - walking.
Type:
  • number
Source:

Methods

disable_animation()

Removes all sensors attached to animated objects and stops animation
Source:

enable_animation()

Attaches sensors to characters and runs elapsed_cb every frame.
Source:

new_event_track(graph)

Creates a new event track based on a given graph.
Parameters:
Name Type Description
graph Object Animation graph with a number of movement params.
Properties
Name Type Description
path Array A list of [x,y,z] points NPC will be moving around.
delay number Time delay before each path step.
actions GraphActions Actions for every movement type (move, idle, etc).
obj Object3D Animated object.
rig Object3D Armature object.
collider Object3D Collider object which will be used for collision detection. Should be a valid physics object.
speed number Movement speed.
rot_speed number Rotation speed.
random boolean Determines whether the object will perform random moves or not.
type number NPC movement type (NT_WALKING, NT_FLYING, etc).
Source:

Type Definitions

GraphActions

An object containing actions for every movement type.
Type:
  • Object
Properties:
Name Type Description
idle Array An array of "idle" animations.
move Array An array of "move" animations.
move_start Array An array of "move_start" animations.
move_blends Array An array of "move_blends" animations.
Source: