User Tools

Site Tools


api:comp_agent

COMP_AGENT

Category: Component

Parent class: COMPONENT

Properties


BehaviorTree

Serialized, Savegame


BehaviorMessage

Runtime only, Savegame

  • Type: string
  • Expected: string value

ActivityMessage

Runtime only, Savegame

  • Type: string
  • Expected: string value

IsDying

Runtime only, Savegame

  • Type: boolean
  • Expected: boolean value
  • Default value: false

Gender

Runtime only, Savegame

  • Type: GENDER
  • Expected: enum value
  • Default value: GENDER.MALE

WalkOnPlatform

Serialized

  • Type: boolean
  • Expected: boolean value
  • Default value: true

RoadPaintSpeed

Serialized

  • Type: float
  • Expected: float value
  • Default value: 0.1f

Model

Serialized, Savegame

Functions


setAnimation

void setAnimation(animation [, speed])

Name Type Description
animation AGENT_ANIMATION
speed float

setActivityMessage

void setActivityMessage(message)

Deprecated since version 1.8; use ActivityMessage property instead

Name Type Description
message string

setBehaviorMessage

void setBehaviorMessage(message)

Deprecated since version 1.8; use BehaviorMessage property instead

Name Type Description
message string

setIsRoadTracingEnabled

void setIsRoadTracingEnabled(enabled)

Name Type Description
enabled boolean

isOnWater

boolean isOnWater()


setProfile

void setProfile(profile)

Name Type Description
profile AGENT_PROFILE

getProfile

AGENT_PROFILE getProfile()


setVehicle

void setVehicle(vehicle)

Assign the vehicle to the agent. This does not destroy previously assigned vehicle.

Name Type Description
vehicle COMP_VEHICLE

getVehicle

COMP_VEHICLE getVehicle()


isOnBoat

boolean isOnBoat()


die

void die()

This will make the agent die during his next update().

Events


ON_DYING

ON_DYING()


ON_VEHICLE_CHANGED

ON_VEHICLE_CHANGED(COMP_VEHICLE previousVehicle, COMP_VEHICLE newVehicle)

api/comp_agent.txt · Last modified: 2023/10/02 13:54 (external edit)