Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
dp88_AI_Objective Class Reference

AI Objective. More...

#include <dp88_customAI.h>

Public Member Functions

float GetPriority (GameObject *obj, float distance_modifier)
 

Static Public Member Functions

static dp88_AI_ObjectiveGetBestObjective (GameObject *obj, unsigned int objective_type, float distance_modifier, DynamicVectorClass< int > ignoredObjectives)
 
static int CountObjectives (int team, unsigned int objective_type)
 
static int CountUnitObjectives (int team, unsigned int objective_type, GameObject *obj, float distance_modifier)
 
static bool IsValidObjective (dp88_AI_Objective *pObjective)
 

Protected Member Functions

unsigned char GetUnitType (GameObject *obj)
 

Detailed Description

Author
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk)

This script should be attached to any object which offensive AI scripts should treat as a mission objective, for example a building. Compatible scripts include dp88_AI_Tank_Offensive. Note that the objective is used as a go-to location rather than a target to shoot at, so the behaviour of the unit when it arrives at an objective depends upon the script being used and its configuration.

Parameters
TeamWhich team this objective applies to. 0 for Nod/Soviets, 1 for GDI/Allies and 2 for both
TypeWhat type of objective this is, valid values are 1 (Offensive), 2 (Defensive) or 3 (Engineering)
RangeThe target distance from this objective the unit will try to achieve. Be careful not to set this too low or the AI might be unable to calculate a successful route. Upon arrival units will roam within this area until the objective is accomplished or a new objective takes priority
Priority_SoldierObjective priority for soldiers, or 0 is this objective is not suitable for soldiers
Priority_Light_VehicleObjective priority for light vehicles, or 0 is this objective is not suitable for light vehicles
Priority_Heavy_VehicleObjective priority for heavy vehicles, or 0 is this objective is not suitable for heavy vehicles
Priority_AircraftObjective priority for aircraft, or 0 is this objective is not suitable for aircraft

Member Function Documentation

◆ CountObjectives()

int dp88_AI_Objective::CountObjectives ( int team,
unsigned int objective_type )
static

Counts the existing objectives of a given type for the specified team

◆ CountUnitObjectives()

int dp88_AI_Objective::CountUnitObjectives ( int team,
unsigned int objective_type,
GameObject * obj,
float distance_modifier )
static

Counts the existing valid objectives of a given type for the specified unit

◆ GetBestObjective()

dp88_AI_Objective * dp88_AI_Objective::GetBestObjective ( GameObject * obj,
unsigned int objective_type,
float distance_modifier,
DynamicVectorClass< int > ignoredObjectives )
static

Finds the most suitable objective of a given type for the specified unit, based on the distance to the objective and their distance modifier

◆ GetPriority()

float dp88_AI_Objective::GetPriority ( GameObject * obj,
float distance_modifier )

Get the priority of this objective for the specified AI unit

◆ GetUnitType()

unsigned char dp88_AI_Objective::GetUnitType ( GameObject * obj)
protected

Get the unit type of the specified unit

◆ IsValidObjective()

bool dp88_AI_Objective::IsValidObjective ( dp88_AI_Objective * pObjective)
static

Checks if the specified objective is still valid