Arma Reforger Script API
|
Public Member Functions | |
proto external int | ComputeStruckHitZones (out notnull array< HitZone > struckHitZones, notnull BaseDamageContext damageContext) |
Clears and fills struckHitZones array with all HZs that should get damaged by this BaseDamageContext. | |
proto external void | EnableDamageHandling (bool enable) |
proto external bool | IsDamageHandlingEnabled () |
proto external float | GetMovementDamage () |
proto external float | GetAimingDamage () |
proto external void | SetMovementDamage (float damage) |
proto external void | SetAimingDamage (float damage) |
proto external float | GetHealthScaled () |
proto external bool | SetHealthScaled (float health) |
proto external float | GetHealth () |
proto external float | GetMaxHealth () |
proto external EDamageState | GetState () |
proto external bool | IsDestroyed () |
proto external void | SetInstigatorEntity (IEntity instigator) |
proto external void | SetInstigator (notnull Instigator instigator) |
proto external notnull Instigator | GetInstigator () |
proto external int | GetAttachedColliderIDs (out notnull array< int > outAttachedColliderIDs) |
Fills colliderIDs with all the colliders attached to hitzones this dmg manager owns. | |
proto external void | HandleDamage (notnull BaseDamageContext damageContext) |
proto external bool | IsDamagedOverTime (EDamageType dType) |
proto external float | GetDamageOverTime (EDamageType dType) |
proto external void | RemoveDamageOverTime (EDamageType dType) |
Removes DOT of provided damageType from all currently affected HitZones. | |
bool | ShouldOverrideInstigator (notnull Instigator currentInstigator, notnull Instigator newInstigator) |
Called whenever an instigator is going to be set. | |
GameMaterial | OverrideHitMaterial (HitZone struckHitzone) |
Not all armors are physical so the surface that gets struck by projectiles will not be the one the armor, but the hitzone. | |
bool | FilterContact (IEntity owner, IEntity other, Contact contact) |
Event when physics engine registered contact with other RigidBody. | |
bool | HijackDamageHandling (notnull BaseDamageContext damageContext) |
Called when this DamageManager is about to handle damage. | |
bool | ShouldCountAsHit (notnull BaseDamageContext damageContext) |
Called after HijackDamageHandling. | |
Public Member Functions inherited from HitZoneContainerComponent | |
proto external IEntity | GetOwner () |
proto external HitZone | GetDefaultHitZone () |
proto external HitZone | GetHitZoneByColliderID (int colliderID) |
proto external int | GetHitZonesByColliderIDs (out notnull array< HitZone > outHitZones, notnull array< int > colliderIDs) |
Clears and fills the specified outHitZones array with all HZs that are attached to colliderIDs. | |
proto external HitZone | GetHitZone (string colliderName) |
proto external int | GetAllHitZones (out notnull array< HitZone > outHitZones) |
Clears and fills the specified outHitZones array with all HZs in this entity Returns the count of elements that were filled into the array. | |
proto external int | GetAllHitZonesInHierarchy (out notnull array< HitZone > outHitZones) |
Clears and fills the specified outHitZones array with all HZs in this entity and its children. | |
proto external HitZoneContainerComponent | GetParentHitZoneContainer () |
Public Member Functions inherited from GameComponent | |
bool | OnTicksOnRemoteProxy () |
Protected Member Functions | |
void | OnDamageOverTimeAdded (EDamageType dType, float dps, HitZone hz) |
Invoked every time the DoT is added to certain hitzone. | |
void | OnDamageOverTimeRemoved (EDamageType dType, HitZone hz) |
Invoked when provided damage type is removed from certain hitzone. | |
void | OnDamageStateChanged (EDamageState state) |
Called when the damagestate changes. | |
void | OnPostInit (IEntity owner) |
Called after all components are initialized. | |
void | OnInit (IEntity owner) |
Called during EOnInit. | |
void | OnDelete (IEntity owner) |
void | OnFrame (IEntity owner, float timeSlice) |
Called during EOnFrame. | |
void | OnFilteredContact (IEntity owner, IEntity other, Contact contact) |
Only called if FilterContact returned true. | |
void | OnDiag (IEntity owner, float timeSlice) |
Called during EOnDiag. | |
void | OnDamage (notnull BaseDamageContext damageContext) |
Protected Member Functions inherited from HitZoneContainerComponent | |
bool | OnRplSave (ScriptBitWriter writer) |
bool | OnRplLoad (ScriptBitReader reader) |
proto external int DamageManagerComponent.ComputeStruckHitZones | ( | out notnull array< HitZone > | struckHitZones, |
notnull BaseDamageContext | damageContext | ||
) |
Clears and fills struckHitZones array with all HZs that should get damaged by this BaseDamageContext.
This function uses BaseDamageContext.colliderID to find the struck hitzones. If no hitzones are attached to the colliderID, it will return default hitzone. Use this to call HandleDamage individually on each of the affected hitzones. Dont call this if: -The DamageManager has been destroyed, struckHitZones will be empty. -DamageContext.struckHitZone is known. It will only return that hitzone.
struckHitZones | array of hitzones that were struck |
damageContext | Information about the damage. Only BaseDamageContext.struckHitZone and BaseDamageContext.colliderID are relevant. |
proto external void DamageManagerComponent.EnableDamageHandling | ( | bool | enable | ) |
bool DamageManagerComponent.FilterContact | ( | IEntity | owner, |
IEntity | other, | ||
Contact | contact | ||
) |
Event when physics engine registered contact with other RigidBody.
owner | The owner entity |
other | Other Entity who contacted us |
contact | Structure describing the contact |
Implemented in SCR_ArmorDamageManagerComponent, SCR_CharacterDamageManagerComponent, SCR_RotorDamageManagerComponent, SCR_VehicleDamageManagerComponent, SCR_DestructionDamageManagerComponent, and SCR_DamageManagerComponent.
proto external float DamageManagerComponent.GetAimingDamage | ( | ) |
proto external int DamageManagerComponent.GetAttachedColliderIDs | ( | out notnull array< int > | outAttachedColliderIDs | ) |
Fills colliderIDs with all the colliders attached to hitzones this dmg manager owns.
proto external float DamageManagerComponent.GetDamageOverTime | ( | EDamageType | dType | ) |
proto external float DamageManagerComponent.GetHealth | ( | ) |
proto external float DamageManagerComponent.GetHealthScaled | ( | ) |
proto external notnull Instigator DamageManagerComponent.GetInstigator | ( | ) |
proto external float DamageManagerComponent.GetMaxHealth | ( | ) |
proto external float DamageManagerComponent.GetMovementDamage | ( | ) |
proto external EDamageState DamageManagerComponent.GetState | ( | ) |
proto external void DamageManagerComponent.HandleDamage | ( | notnull BaseDamageContext | damageContext | ) |
bool DamageManagerComponent.HijackDamageHandling | ( | notnull BaseDamageContext | damageContext | ) |
Called when this DamageManager is about to handle damage.
Any modifications done to the damageContext will persist for the rest of the damage handling process return false if damage handling should proceed with the changes done to the DamageContext. return true if damage should be discarded / was fully hijacked and should no longer be applied on this damage manager (e.g.: damage was passed to another dmg manager, so we dont handle damage on this manager ).
Implemented in SCR_ArmorDamageManagerComponent, SCR_CharacterDamageManagerComponent, SCR_MineDamageManager, and SCR_DamageManagerComponent.
proto external bool DamageManagerComponent.IsDamagedOverTime | ( | EDamageType | dType | ) |
proto external bool DamageManagerComponent.IsDamageHandlingEnabled | ( | ) |
proto external bool DamageManagerComponent.IsDestroyed | ( | ) |
|
protected |
|
protected |
Invoked every time the DoT is added to certain hitzone.
Implemented in SCR_DamageManagerComponent.
|
protected |
Invoked when provided damage type is removed from certain hitzone.
Implemented in SCR_DamageManagerComponent.
|
protected |
Called when the damagestate changes.
Implemented in SCR_CharacterDamageManagerComponent, SCR_HelicopterDamageManagerComponent, SCR_RotorDamageManagerComponent, SCR_VehicleDamageManagerComponent, SCR_MineDamageManager, SCR_DestructibleBuildingComponent, and SCR_DamageManagerComponent.
|
protected |
|
protected |
Called during EOnDiag.
owner | Entity this component is attached to. |
timeSlice | Delta time since last update. |
|
protected |
Only called if FilterContact returned true.
owner | The owner entity |
other | Other Entity who contacted us |
contact | Structure describing the contact |
Implemented in SCR_CharacterDamageManagerComponent, SCR_RotorDamageManagerComponent, SCR_VehicleDamageManagerComponent, SCR_DestructibleBuildingComponent, and SCR_DestructionDamageManagerComponent.
|
protected |
Called during EOnFrame.
owner | Entity this component is attached to. |
timeSlice | Delta time since last update. |
Implemented in SCR_DestructibleBuildingComponent, and SCR_DestructionTireComponent.
|
protected |
Called during EOnInit.
owner | Entity this component is attached to. |
Implemented in SCR_CharacterDamageManagerComponent, and SCR_RotorDamageManagerComponent.
|
protected |
Called after all components are initialized.
owner | Entity this component is attached to. |
Implemented in SCR_CharacterDamageManagerComponent, SCR_VehicleDamageManagerComponent, SCR_DestructibleBuildingComponent, SCR_DestructionDamageManagerComponent, SCR_DestructionMultiPhaseComponent, and SCR_DestructionTireComponent.
GameMaterial DamageManagerComponent.OverrideHitMaterial | ( | HitZone | struckHitzone | ) |
Not all armors are physical so the surface that gets struck by projectiles will not be the one the armor, but the hitzone.
This is a workaround to solve that issue. It gets called every time a projectile strikes a hitzone We can override material of the hit with the corresponding one from the armor (if needed)
Implemented in SCR_CharacterDamageManagerComponent.
proto external void DamageManagerComponent.RemoveDamageOverTime | ( | EDamageType | dType | ) |
Removes DOT of provided damageType from all currently affected HitZones.
proto external void DamageManagerComponent.SetAimingDamage | ( | float | damage | ) |
proto external bool DamageManagerComponent.SetHealthScaled | ( | float | health | ) |
proto external void DamageManagerComponent.SetInstigator | ( | notnull Instigator | instigator | ) |
proto external void DamageManagerComponent.SetInstigatorEntity | ( | IEntity | instigator | ) |
proto external void DamageManagerComponent.SetMovementDamage | ( | float | damage | ) |
bool DamageManagerComponent.ShouldCountAsHit | ( | notnull BaseDamageContext | damageContext | ) |
Called after HijackDamageHandling.
If it returns true, damage will be dealt. If it returns false, damage will not be handled. Use this to introduce randomness on hit chances (e.g.: moving helicopter rotors)
Implemented in SCR_RotorDamageManagerComponent.
bool DamageManagerComponent.ShouldOverrideInstigator | ( | notnull Instigator | currentInstigator, |
notnull Instigator | newInstigator | ||
) |
Called whenever an instigator is going to be set.
currentInstigator | This damage manager's last instigator |
newInstigator | The new instigator for this damage manager |
Implemented in SCR_CharacterDamageManagerComponent, SCR_VehicleDamageManagerComponent, and SCR_DamageManagerComponent.