1
actor hierarchy
Bruno Carneiro edited this page 2026-02-13 18:25:50 -03:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Actor Hierarchy and Damage

Actors are game objects: persons (crew), carts (vehicles, aircraft), and groups. All share AiActor; AiPerson and AiCart extend it. Damage events use AiDamageInitiator, AiDamageTool, DamagerScore, and AiLimbDamage. AiWayPoint and AiGroup are used for movement and formation; AiBridge for bridges. CrewFunction identifies crew roles.


AiActor

Kind: interface

Base interface for all game objects (units, vehicles, aircraft, groups).

Member Type Description
Tag object Get/set; mission script can store arbitrary data.
bool IsValid() bool Whether the actor reference is still valid.
bool IsAlive() bool Whether the actor is alive.
bool IsTaskComplete() bool Whether the actors task is complete.
int Army() int Army index.
string Name() string Full name (e.g. "missionNumber:shortName").
AiGroup Group() AiGroup Group this actor belongs to; null if none.
Point3d Pos() Point3d Position.

AiPerson

Kind: interface (extends AiActor)

Represents a person (pilot, gunner, etc.) in the world.

Member Type Description
Id string Get/set identifier.
Health float Current health.
AiCart Cart() AiCart Cart (vehicle) the person is in; null if none.
int Place() int Place (seat) index in the cart.
Player Player() Player Player controlling this person; null if AI.
void SayNiceKill() Trigger “nice kill” feedback.

AiCart

Kind: interface (extends AiActor)

Represents a vehicle or aircraft that has places (seats) and can have crew.

Member Type Description
int Carter() int Carter (driver/pilot) place index.
int Places() int Number of places (seats).
CrewFunction CrewFunctionPlace(int place) CrewFunction Role at the given place.
bool ExistCabin(int place) bool Whether the place has a cabin.
AiPerson Person(int place) AiPerson Person at the place; null if empty.
Player Player(int place) Player Player at the place; null if AI or empty.
void Destroy() Destroy the cart.
string InternalTypeName() string Internal type name.

AiGroup

Kind: interface (extends AiActor)

Group of actors with shared waypoints.

Member Type Description
Idle bool Get/set idle flag.
AiActor[] GetItems() AiActor[] Members of the group.
AiWayPoint[] GetWay() AiWayPoint[] Current waypoints.
int GetCurrentWayPoint() int Index of current waypoint.
void SetWay(AiWayPoint[] way) Set new waypoints.

AiWayPoint

Kind: class

Single waypoint: position and speed.

Member Type Description
P Point3d Position.
Speed double Speed.
AiWayPoint(ref Point3d p, double speed) constructor Build waypoint.

Base for AiAirWayPoint and AiGroundWayPoint (see Air, Ground).


AiBridge

Kind: interface (extends AiActor)

Bridge actor; can notify life state change.

Member Type Description
void LifeChanged(bool bLive) Notify that the bridge is now live or not.

AiDamageToolType

Kind: enum

Type of damage tool.

Value Description
Unknown 0
Cannon Cannon.
Ordance Bomb/ordnance.
Collision Collision.

AiDamageTool

Kind: class

Identifies the tool that caused damage (e.g. cannon, bomb).

Member Type Description
Type AiDamageToolType Kind of tool.
Name string Tool name.
AiDamageTool(AiDamageToolType Type, string Name) constructor Construct.

AiDamageInitiator

Kind: class

Describes who or what caused damage: actor, person, player, and tool. Passed in damage callbacks (e.g. OnActorDamaged, OnActorDead, OnAircraftKilled).

Member Type Description
Actor AiActor Actor that caused damage; can be null.
Person AiPerson Person (e.g. gunner); can be null.
Player Player Player; can be null.
Tool AiDamageTool Tool used; can be null.
static string DamageNameById(NamedDamageTypes DamageId) string Name for a damage type.

DamagerScore

Kind: class

Score entry for a damager (e.g. in OnActorDead).

Member Type Description
initiator AiDamageInitiator Who caused damage.
score double Score value.
time double Time of damage.

Overrides Equals and GetHashCode based on initiator identity.


AiLimbDamage

Kind: class

Describes limb damage (used in OnAircraftLimbDamaged and AiAircraft limb APIs).

Member Type Description
Initiator AiDamageInitiator Who caused the damage.
LimbId LimbNames Limb identifier.
OuterIntegrity float Outer integrity.
InnerIntegrity float Inner integrity.
static string LimbNameById(LimbNames LimbId) string Name for limb.

CrewFunction

Kind: enum

Crew role at a place.

Value Description
Nil 0
Pilot, CoPilot Pilot / co-pilot.
Bombardier, Radioman, Engineer, Observer Other crew.
Gunner, NoseGunner, TopGunner, WaistGunner, VentralGunner, RearGunner Gunners.

Use with AiCart.CrewFunctionPlace(int place).