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

Base class for all AI settings. More...

Inheritance diagram for SCR_AISettingBase:
SCR_AICharacterSetting SCR_AIGroupSetting SCR_AICharacterSettingWithCause SCR_AIGroupCharactersMovementSpeedSettingBase SCR_AIGroupCombatModeSettingBase SCR_AIGroupFormationSettingBase SCR_AIGroupSettingWithCause SCR_AICharacterLightInteractionSettingBase SCR_AICharacterMovementSpeedSettingBase SCR_AICharacterStanceSettingBase SCR_AIGroupCharactersMovementSpeedSetting SCR_AIGroupCombatModeSetting SCR_AIGroupFormationSetting SCR_AICharacterLightInteractionSetting SCR_AICharacterMovementSpeedSetting SCR_AICharacterMovementSpeedSetting_Range SCR_AICharacterStanceSetting SCR_AICharacterStanceSetting_Range

Public Member Functions

int GetPriority ()
 
SCR_EAISettingOrigin GetOrigin ()
 
SCR_AISettingBase GetParentSetting ()
 
SCR_EAISettingFlags GetFlags ()
 
bool HasFlag (SCR_EAISettingFlags f)
 
int GetMaxActionCause ()
 Returns action cause value to which this setting applies.
 
SCR_AISettingBase CreateCopy ()
 This method must make a deep copy of data describing this setting.
 
void Internal_InitCopyFrom (SCR_AISettingBase from)
 Called right after this setting object was created as copy from elsewhere.
 
void Internal_ConstructedAtProperty (SCR_EAISettingOrigin origin, SCR_EAISettingFlags flagsToSet)
 Must be called if the setting is part of some property.
 
void Internal_SetFlag (SCR_EAISettingFlags flagsToSet)
 
TypeName GetCategorizationType ()
 Returns type which is used for identification of setting type.
 
void OnAdded (SCR_AISettingsBaseComponent settingsComp)
 Called after the setting was added to SCR_AISettingsBaseComponent.
 
void OnRemoved (SCR_AISettingsBaseComponent settingsComp)
 Called after the setting was removed from SCR_AISettingsBaseComponent.
 
void ApplyEffects (SCR_AISettingsBaseComponent settingsComp)
 This is meant for settings which apply some permanent effect to AI (like setting skill), instead of some other system to look up current settings through GetCurrentSetting call.
 
string GetDebugText ()
 

Static Public Attributes

const int ACTION_CAUSE_NOT_SUPPORTED = int.MAX
 

Protected Member Functions

void Init (SCR_EAISettingOrigin origin)
 Must be called from the factory method, if setting is created dynamically.
 

Protected Attributes

SCR_AISettingBase m_ParentSetting
 
SCR_EAISettingOrigin m_eOrigin
 
SCR_EAISettingFlags m_eFlags
 
int m_iPriority
 

Static Protected Attributes

static ref SCR_AISettingOriginPriorityTable s_OriginPriorityTable = new SCR_AISettingOriginPriorityTable()
 

Detailed Description

Base class for all AI settings.

When making own settings classes, following parts must be done:

  • Override GetCategorizationType There must be a base class according to which settings affecting same aspect of AI are categorized. For example: there is one base class for all settings which restrict AI stance, and thus GetCategorizationType returns typename of that class. Underlying AI systems also use that class to find if currently there is a setting which restricts AI stance. Several final classes might inherit from that base class, and implement their own way to restrict stance: restrict to one value, to range of values, etc.
  • Decide if the setting works 'contextually', depending on Cause value of current action, or it always dictates some value to AI. Depending on that decide from which class the new setting class must inherit. There are several classes for that. For character settings: SCR_AICharacterSetting and SCR_AICharacterSettingWithCause. For group settings: SCR_AIGroupSetting and SCR_AIGroupSettingWithCause.
  • Override ApplyEffects, if setting does not work with action Cause value.
  • Override CreateCopy, if setting class holds non-trivial data (reference to something else).

Member Function Documentation

◆ ApplyEffects()

void SCR_AISettingBase.ApplyEffects ( SCR_AISettingsBaseComponent settingsComp)

This is meant for settings which apply some permanent effect to AI (like setting skill), instead of some other system to look up current settings through GetCurrentSetting call.

The method is called when addition or removal of this or another setting causes this setting to be the one with highest priority among those of same categorization type. Keep in mind that now it might get called several times, and also we can't know if our setting unbecame highest priority. So here we should just propagate our values 'downwards' and do nothing else.

Implemented in SCR_AIGroupCombatModeSettingBase.

◆ CreateCopy()

SCR_AISettingBase SCR_AISettingBase.CreateCopy ( )

This method must make a deep copy of data describing this setting.

Data aquired after application of the setting to Agent should be omitted. !!! This must be implemented in derived class if data of the setting is non-trivial.

◆ GetCategorizationType()

TypeName SCR_AISettingBase.GetCategorizationType ( )

Returns type which is used for identification of setting type.

There might be settings which inherit some base setting class and should be categorized according to that parent class. For instance, some specific classes of movement restriction can be categorized according to their base class of movement restriction.

Implemented in SCR_AICharacterLightInteractionSettingBase, SCR_AICharacterMovementSpeedSettingBase, SCR_AICharacterStanceSettingBase, SCR_AIGroupCharactersMovementSpeedSettingBase, SCR_AIGroupCombatModeSettingBase, and SCR_AIGroupFormationSettingBase.

◆ GetDebugText()

◆ GetFlags()

SCR_EAISettingFlags SCR_AISettingBase.GetFlags ( )

◆ GetMaxActionCause()

int SCR_AISettingBase.GetMaxActionCause ( )

Returns action cause value to which this setting applies.

Must be implemented in derived class. The returned value means: this setting applies to this action cause and all below it. For instance, setting applies to combat cause and all below it. If ACTION_CAUSE_NOT_SUPPORTED is returned, the setting is always active as long as it has highest priority, since some settings can't be active or inactive based on current action. For instance settings related to AI skills.

Implemented in SCR_AICharacterSetting, SCR_AICharacterSettingWithCause, SCR_AIGroupSetting, and SCR_AIGroupSettingWithCause.

◆ GetOrigin()

SCR_EAISettingOrigin SCR_AISettingBase.GetOrigin ( )

◆ GetParentSetting()

SCR_AISettingBase SCR_AISettingBase.GetParentSetting ( )

◆ GetPriority()

int SCR_AISettingBase.GetPriority ( )

◆ HasFlag()

bool SCR_AISettingBase.HasFlag ( SCR_EAISettingFlags f)

◆ Init()

void SCR_AISettingBase.Init ( SCR_EAISettingOrigin origin)
protected

Must be called from the factory method, if setting is created dynamically.

◆ Internal_ConstructedAtProperty()

void SCR_AISettingBase.Internal_ConstructedAtProperty ( SCR_EAISettingOrigin origin,
SCR_EAISettingFlags flagsToSet )

Must be called if the setting is part of some property.

Call this if you declare property with AI settings somewhere.

◆ Internal_InitCopyFrom()

void SCR_AISettingBase.Internal_InitCopyFrom ( SCR_AISettingBase from)

Called right after this setting object was created as copy from elsewhere.

◆ Internal_SetFlag()

void SCR_AISettingBase.Internal_SetFlag ( SCR_EAISettingFlags flagsToSet)

◆ OnAdded()

void SCR_AISettingBase.OnAdded ( SCR_AISettingsBaseComponent settingsComp)

Called after the setting was added to SCR_AISettingsBaseComponent.

Can be overridden in child classes. OnAdded call does not mean that this setting now has highest priority, as there can be other settings of same type but with different priority. For that see function ApplyEffects.

◆ OnRemoved()

void SCR_AISettingBase.OnRemoved ( SCR_AISettingsBaseComponent settingsComp)

Called after the setting was removed from SCR_AISettingsBaseComponent.

Can be overridden in child classes.

Member Data Documentation

◆ ACTION_CAUSE_NOT_SUPPORTED

const int SCR_AISettingBase.ACTION_CAUSE_NOT_SUPPORTED = int.MAX
static

◆ m_eFlags

SCR_EAISettingFlags SCR_AISettingBase.m_eFlags
protected

◆ m_eOrigin

SCR_EAISettingOrigin SCR_AISettingBase.m_eOrigin
protected

◆ m_iPriority

int SCR_AISettingBase.m_iPriority
protected

◆ m_ParentSetting

SCR_AISettingBase SCR_AISettingBase.m_ParentSetting
protected

◆ s_OriginPriorityTable

ref SCR_AISettingOriginPriorityTable SCR_AISettingBase.s_OriginPriorityTable = new SCR_AISettingOriginPriorityTable()
staticprotected

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