|
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 void | EnableDamageSystemOnFrame () |
| Call to enable damage system's on frame. | |
| proto external void | DisableDamageSystemOnFrame () |
| Call to disable damage system's on frame. | |
| proto external void | SetMovementDamage (float damage) |
| Sets the movement damage modifier. | |
| proto external float | GetMovementDamage () |
| Returns the movement damage modifier. | |
| proto external void | SetAimingDamage (float damage) |
| Sets the aiming damage modifier. | |
| proto external float | GetAimingDamage () |
| Returns aiming damage modifier. | |
| 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 void | SetAndReplicateInstigator (notnull Instigator instigator) |
| Sets the instigator and broadcasts the change to clients DO NOT USE THIS METHOD UNLESS YOU KNOW EXACTLY WHEN TO USE IT IF YOU ARE USING THIS YOU PROBABLY SHOULD BE DEALING DAMAGE TO THE PLAYER TO KILL THEM. | |
| 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 | GetHitZoneByName (string hitZoneName) |
| Get the HitZone that matches the provided collider name. | |
| proto external HitZone | GetHitZoneByColliderID (int colliderID) |
| Get the HitZone that matches the provided collider ID. | |
| 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 | CountAllHitZones () |
| Counts the number of hitzones in this entity. | |
| proto external int | CountAllHitZonesInHierarchy () |
| Counts the number of hitzones in this entity and its children. | |
| 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 | DiagOnlyIfPossessedByPlayerController (notnull IEntity owner) |
| Use this to run diag for the character who is currently possessed by player controller. | |
| void | OnHandleFallDamage (EFallDamageType fallDamageType, vector velocityVector) |
| Called when fall related damage is relevant. | |
| void | OnHealthSet () |
| Called when SetHealth() is used on default hitzone. | |
| void | OnMaxHealthChanged () |
| Called when SetMaxHealth() is used on default hitzone. | |
| 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 newState, EDamageState previousDamageState, bool isJIP) |
| Called when the damagestate changes. | |
| void | OnPostInit (IEntity owner) |
| Called after all components are initialized. | |
| 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 | HasDataToReplicate () |
| Use it to save bandwidth in some default conditions. Use it if Save and Load are overriden. | |
| 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. |
|
protected |
Use this to run diag for the character who is currently possessed by player controller.
| owner | owner entity |
| proto external void DamageManagerComponent.DisableDamageSystemOnFrame | ( | ) |
Call to disable damage system's on frame.
| proto external void DamageManagerComponent.EnableDamageHandling | ( | bool | enable | ) |
| proto external void DamageManagerComponent.EnableDamageSystemOnFrame | ( | ) |
Call to enable damage system's on frame.
| 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_DamageManagerComponent, SCR_DestructionDamageManagerComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.
| proto external float DamageManagerComponent.GetAimingDamage | ( | ) |
Returns aiming damage modifier.
| 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 | ( | ) |
Returns the movement damage modifier.
| 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_DamageManagerComponent, SCR_DestructibleBuildingComponent, and SCR_MineDamageManager.
| 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_DamageManagerComponent, SCR_DestructibleBuildingComponent, SCR_HelicopterDamageManagerComponent, SCR_MineDamageManager, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.
|
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_DestructibleBuildingComponent, SCR_DestructionDamageManagerComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.
|
protected |
Called during EOnFrame.
| owner | Entity this component is attached to. |
| timeSlice | Delta time since last update. |
Implemented in SCR_DestructibleBuildingComponent, SCR_DestructionTireComponent, and SCR_VehicleDamageManagerComponent.
|
protected |
Called when fall related damage is relevant.
Implemented in SCR_CharacterDamageManagerComponent.
|
protected |
Called when SetHealth() is used on default hitzone.
|
protected |
Called when SetMaxHealth() is used on default hitzone.
|
protected |
Called after all components are initialized.
| owner | Entity this component is attached to. |
Implemented in SCR_CharacterDamageManagerComponent, SCR_DestructibleBuildingComponent, SCR_DestructionDamageManagerComponent, SCR_DestructionTireComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.
| 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 | ) |
Sets the aiming damage modifier.
| proto external void DamageManagerComponent.SetAndReplicateInstigator | ( | notnull Instigator | instigator | ) |
Sets the instigator and broadcasts the change to clients DO NOT USE THIS METHOD UNLESS YOU KNOW EXACTLY WHEN TO USE IT IF YOU ARE USING THIS YOU PROBABLY SHOULD BE DEALING DAMAGE TO THE PLAYER TO KILL THEM.
This method is currently only used to set the instigator of people neutralized through GM, because GM uses SetHealth(0) instead of dealing damage. In this REALLY SPECIFIC case it makes sense, because the player might have damage handling disabled and GM SHOULD be able to kill invulnerable people. This will completely bypass ShouldOverrideInstigator, method won't even be called.
| 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 | ) |
Sets the movement damage modifier.
| 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_DamageManagerComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.