|
Arma Reforger Script API
|
This object splits incoming events into sectors based on direction. More...
Public Member Functions | |
| void | SCR_AISectorThreatFilter (IEntity myEntity) |
| void | GetActiveSectors (out int outSectorMajor, out int outSectorMinor) |
| Returns sectors to outside. Can return -1 if the sector is inactive. | |
| vector | GetSectorPos (int sectorId) |
| float | GetSectorDanger (int sectorId) |
| SCR_EAIThreatSectorFlags | GetSectorFlags (int sectorId) |
| bool | IsSectorActive (int sectorId) |
| SCR_AIThreatSector | GetSector (int sectorId) |
| Primarily used for save/load. Do not call unless you know what you are doing! | |
| ScriptInvokerBase< SCR_AISectorThreatFilter_OnEscalation > | GetOnEscalationInvoker () |
| See m_OnEscalation. | |
| ScriptInvokerBase< SCR_AISectorThreatFilter_OnMajorSectorChanged > | GetOnMajorSectorChangedInvoker () |
| See m_OnMajorSectorChanged. | |
| ScriptInvokerBase< SCR_AISectorThreatFilter_OnDamageTaken > | GetOnDamageTaken () |
| See m_OnDamageTaken. | |
| void | Update (float timeSlice_s) |
| Must be called periodically Udpates state of each sector Selects which sector is more relevant (major sector) and the other one (minor sector) | |
| void | OnShotsFired (vector eventPos, int count, bool isFlyby) |
| Must be called from gunshot event. | |
| void | OnDamageTaken (vector eventPos) |
| void | OnExplosion (vector eventPos) |
| Must be called from explosion event. | |
| void | EOnDiag (float timeSlice) |
Static Public Attributes | |
| const int | SECTOR_COUNT = 2 |
| const float | REFERENCE_RATE_OF_FIRE = 10.8333 |
| const float | REFERENCE_DISTANCE_INV = 0.01 |
| const float | DANGER_MULT_ZERO = 7 |
| const float | GUNSHOT_DANGER_CONST_C = 1.0 / (DANGER_MULT_ZERO - 1.0) |
| const float | GUNSHOT_DANGER_CONST_A = (DANGER_MULT_ZERO / (DANGER_MULT_ZERO - 1.0)) / REFERENCE_RATE_OF_FIRE |
| const float | DANGER_MULT_FLYBY = 20 |
| const float | DAMAGE_TAKEN_DANGER_BUMP_TO = 20 |
Protected Member Functions | |
| void | AddNewEventsToSector (int sectorId, vector eventPos, float dangerDeltaPerEvent, int eventCount, float bumpDangerTo, SCR_EAIThreatSectorFlags flagsToAdd=0) |
| There are two ways which can be used to 'bump' danger values in sector. | |
| int | FindSectorForEvent (vector eventPos) |
| Finds closest (by angle) sector for event, or returns index of an inactive sector, if there's one. | |
| vector | GetMyPos () |
Protected Attributes | |
| ref SCR_AIThreatSector | m_aSectors [SECTOR_COUNT] |
| int | m_iSectorMajor = -1 |
| int | m_iSectorMinor = -1 |
| IEntity | m_MyEntity |
| ref ScriptInvokerBase< SCR_AISectorThreatFilter_OnEscalation > | m_OnEscalation = new ScriptInvokerBase<SCR_AISectorThreatFilter_OnEscalation>() |
| ref ScriptInvokerBase< SCR_AISectorThreatFilter_OnMajorSectorChanged > | m_OnMajorSectorChanged = new ScriptInvokerBase<SCR_AISectorThreatFilter_OnMajorSectorChanged>() |
| ref ScriptInvokerBase< SCR_AISectorThreatFilter_OnDamageTaken > | m_OnDamageTaken = new ScriptInvokerBase<SCR_AISectorThreatFilter_OnDamageTaken>() |
Static Protected Attributes | |
| static const float | COS_SECTOR_HALF_ANGLE = 0.5 |
| static const float | SECTOR_FORGET_S = 45.0 |
| static const float | SECTOR_URGENT_S = 1.5 |
| static const float | URGENT_SECTOR_PRIORITY_MULTIPLIER = 10 |
| static const float | ACCUMULATOR_DROP_RATE = 0.05 |
| static const float | NEXT_ESCALATION_MULTIPLIER = 1.8 |
This object splits incoming events into sectors based on direction.
It can maintain up to SECTOR_COUNT sectors. This class meant to solve soldier's awarenes of danger events around him, by tracking not only amount of danger, but also direction to danger. This is designed to be used for very numerous events, such as gunshots.
| void SCR_AISectorThreatFilter.SCR_AISectorThreatFilter | ( | IEntity | myEntity | ) |
|
protected |
There are two ways which can be used to 'bump' danger values in sector.
Both ways can be used in same call as well.
| void SCR_AISectorThreatFilter.EOnDiag | ( | float | timeSlice | ) |
|
protected |
Finds closest (by angle) sector for event, or returns index of an inactive sector, if there's one.
| void SCR_AISectorThreatFilter.GetActiveSectors | ( | out int | outSectorMajor, |
| out int | outSectorMinor ) |
Returns sectors to outside. Can return -1 if the sector is inactive.
|
protected |
| ScriptInvokerBase< SCR_AISectorThreatFilter_OnDamageTaken > SCR_AISectorThreatFilter.GetOnDamageTaken | ( | ) |
See m_OnDamageTaken.
| ScriptInvokerBase< SCR_AISectorThreatFilter_OnEscalation > SCR_AISectorThreatFilter.GetOnEscalationInvoker | ( | ) |
See m_OnEscalation.
| ScriptInvokerBase< SCR_AISectorThreatFilter_OnMajorSectorChanged > SCR_AISectorThreatFilter.GetOnMajorSectorChangedInvoker | ( | ) |
See m_OnMajorSectorChanged.
| SCR_AIThreatSector SCR_AISectorThreatFilter.GetSector | ( | int | sectorId | ) |
Primarily used for save/load. Do not call unless you know what you are doing!
| float SCR_AISectorThreatFilter.GetSectorDanger | ( | int | sectorId | ) |
| SCR_EAIThreatSectorFlags SCR_AISectorThreatFilter.GetSectorFlags | ( | int | sectorId | ) |
| vector SCR_AISectorThreatFilter.GetSectorPos | ( | int | sectorId | ) |
| bool SCR_AISectorThreatFilter.IsSectorActive | ( | int | sectorId | ) |
| void SCR_AISectorThreatFilter.OnDamageTaken | ( | vector | eventPos | ) |
| void SCR_AISectorThreatFilter.OnExplosion | ( | vector | eventPos | ) |
Must be called from explosion event.
| void SCR_AISectorThreatFilter.OnShotsFired | ( | vector | eventPos, |
| int | count, | ||
| bool | isFlyby ) |
Must be called from gunshot event.
| void SCR_AISectorThreatFilter.Update | ( | float | timeSlice_s | ) |
Must be called periodically Udpates state of each sector Selects which sector is more relevant (major sector) and the other one (minor sector)
|
staticprotected |
|
staticprotected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
static |
|
static |
|
static |
|
staticprotected |
|
staticprotected |
|
staticprotected |