Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_AISettingsBaseComponent Interface Reference

Base class for storing settings individual AI Agents. More...

Inheritance diagram for SCR_AISettingsBaseComponent:
SCR_AICharacterSettingsComponent SCR_AIGroupSettingsComponent

Public Member Functions

override void OnPostInit (IEntity owner)
 
bool AddSetting (notnull SCR_AISettingBase setting, bool createCopy, bool removeSameTypeAndOrigin=false)
 Adds setting object.
 
bool RemoveSetting (notnull SCR_AISettingBase setting)
 
bool RemoveChildSettingsOfParent (notnull SCR_AISettingBase parentSetting)
 Removes setting which has provided setting object as parent.
 
void RemoveSettingsWithFlag (SCR_EAISettingFlags f)
 Iterates all settings, removes all which have given flag.
 
void RemoveSettingsOfTypeAndOrigin (TypeName t, SCR_EAISettingOrigin origin)
 typename t - must be one of those returned by GetCategorizationType
 
SCR_AISettingBase GetCurrentSetting (TypeName settingType)
 Returns current setting based on type and cause value of current action typename settingType - must be one of those returned by GetCategorizationType.
 
SCR_AISettingBase GetCurrentSetting (TypeName settingType, int currentActionCause)
 Returns current setting based on type and cause value typename settingType - must be one of those returned by GetCategorizationType.
 
void GetAllSettings (notnull array< SCR_AISettingBase > outSettings)
 Returns all setting objects held by this component.
 

Protected Member Functions

void OnSettingRemoved (notnull SCR_AISettingBase setting)
 
void OnSettingAdded (notnull SCR_AISettingBase setting)
 

Protected Attributes

ref map< TypeName, ref array< ref SCR_AISettingBase > > m_mSettings = new map<TypeName, ref array<ref SCR_AISettingBase>>()
 
AIBaseUtilityComponent m_UtilityComp
 

Detailed Description

Base class for storing settings individual AI Agents.

It solves following tasks:

  • It stores setting objects.
  • Setting objects are categorized by their type, for easier lookup.
  • Setting objects of each type are sorted by their priority. This allows multiple game systems provide their value of same type of AI settings, without affecting value provided by other game systems. For example, AI Commanding, Scenario Framework and Editor both might want to affect AI stance setting.
  • Underlying AI systems are supposed to call GetCurrentSetting to find currently active AI setting of given type.
  • Alternatively it can work the opposite way: setting objects can propagate data into underlying parts of AI. It depends on how Setting class is configured.

Member Function Documentation

◆ AddSetting()

bool SCR_AISettingsBaseComponent.AddSetting ( notnull SCR_AISettingBase setting,
bool createCopy,
bool removeSameTypeAndOrigin = false )

Adds setting object.

Depending on createCopy value, from now on it will be owned by this component, or it will create a copy which will be owned by this component. It's protected. Instead use Add...Setting of derived class. createCopy - when true, a copy of the setting object will be created. When false, this component takes ownership of passed setting object. If you want to add same setting to many agents, always add it with createCopy=true, or make a copy yourself. removeSameTypeAndOrigin - if true, removes all settings which have same categorization type and origin.

Implemented in SCR_AICharacterSettingsComponent.

◆ GetAllSettings()

void SCR_AISettingsBaseComponent.GetAllSettings ( notnull array< SCR_AISettingBase > outSettings)

Returns all setting objects held by this component.

◆ GetCurrentSetting() [1/2]

SCR_AISettingBase SCR_AISettingsBaseComponent.GetCurrentSetting ( TypeName settingType)

Returns current setting based on type and cause value of current action typename settingType - must be one of those returned by GetCategorizationType.

◆ GetCurrentSetting() [2/2]

SCR_AISettingBase SCR_AISettingsBaseComponent.GetCurrentSetting ( TypeName settingType,
int currentActionCause )

Returns current setting based on type and cause value typename settingType - must be one of those returned by GetCategorizationType.

◆ OnPostInit()

override void SCR_AISettingsBaseComponent.OnPostInit ( IEntity owner)

◆ OnSettingAdded()

void SCR_AISettingsBaseComponent.OnSettingAdded ( notnull SCR_AISettingBase setting)
protected

◆ OnSettingRemoved()

void SCR_AISettingsBaseComponent.OnSettingRemoved ( notnull SCR_AISettingBase setting)
protected

◆ RemoveChildSettingsOfParent()

bool SCR_AISettingsBaseComponent.RemoveChildSettingsOfParent ( notnull SCR_AISettingBase parentSetting)

Removes setting which has provided setting object as parent.

◆ RemoveSetting()

bool SCR_AISettingsBaseComponent.RemoveSetting ( notnull SCR_AISettingBase setting)

◆ RemoveSettingsOfTypeAndOrigin()

void SCR_AISettingsBaseComponent.RemoveSettingsOfTypeAndOrigin ( TypeName t,
SCR_EAISettingOrigin origin )

typename t - must be one of those returned by GetCategorizationType

◆ RemoveSettingsWithFlag()

void SCR_AISettingsBaseComponent.RemoveSettingsWithFlag ( SCR_EAISettingFlags f)

Iterates all settings, removes all which have given flag.

Member Data Documentation

◆ m_mSettings

ref map<TypeName, ref array<ref SCR_AISettingBase> > SCR_AISettingsBaseComponent.m_mSettings = new map<TypeName, ref array<ref SCR_AISettingBase>>()
protected

◆ m_UtilityComp

AIBaseUtilityComponent SCR_AISettingsBaseComponent.m_UtilityComp
protected

The documentation for this interface was generated from the following file: