Arma Reforger Script API
Loading...
Searching...
No Matches
DamageManagerComponent Interface Reference
Inheritance diagram for DamageManagerComponent:
HitZoneContainerComponent GameComponent SCR_DamageManagerComponent ExtendedDamageManagerComponent SCR_ArmorDamageManagerComponent SCR_DestructibleBuildingComponent SCR_DestructionDamageManagerComponent SCR_MineDamageManager SCR_RotorDamageManagerComponent SCR_VehicleDamageManagerComponent SCR_ExtendedDamageManagerComponent SCR_DestructionFractalComponent SCR_DestructionMultiPhaseComponent SCR_HelicopterDamageManagerComponent SCR_WheeledDamageManagerComponent SCR_CharacterDamageManagerComponent SCR_DestructionTireComponent

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)
 

Member Function Documentation

◆ ComputeStruckHitZones()

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.

Parameters
struckHitZonesarray of hitzones that were struck
damageContextInformation about the damage. Only BaseDamageContext.struckHitZone and BaseDamageContext.colliderID are relevant.
Returns
Returns the count of elements that were filled into the array.

◆ DiagOnlyIfPossessedByPlayerController()

void DamageManagerComponent.DiagOnlyIfPossessedByPlayerController ( notnull IEntity owner)
protected

Use this to run diag for the character who is currently possessed by player controller.

Parameters
ownerowner entity

◆ DisableDamageSystemOnFrame()

proto external void DamageManagerComponent.DisableDamageSystemOnFrame ( )

Call to disable damage system's on frame.

◆ EnableDamageHandling()

proto external void DamageManagerComponent.EnableDamageHandling ( bool enable)

◆ EnableDamageSystemOnFrame()

proto external void DamageManagerComponent.EnableDamageSystemOnFrame ( )

Call to enable damage system's on frame.

◆ FilterContact()

bool DamageManagerComponent.FilterContact ( IEntity owner,
IEntity other,
Contact contact )

Event when physics engine registered contact with other RigidBody.

Parameters
ownerThe owner entity
otherOther Entity who contacted us
contactStructure describing the contact
Returns
If it returns false, contact gets discarded and DamageManagerComponent.OnFilteredContact will not be called

Implemented in SCR_ArmorDamageManagerComponent, SCR_CharacterDamageManagerComponent, SCR_DamageManagerComponent, SCR_DestructionDamageManagerComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.

◆ GetAimingDamage()

proto external float DamageManagerComponent.GetAimingDamage ( )

Returns aiming damage modifier.

Warning
Only usable by ChimeraCharacters.

◆ GetAttachedColliderIDs()

proto external int DamageManagerComponent.GetAttachedColliderIDs ( out notnull array< int > outAttachedColliderIDs)

Fills colliderIDs with all the colliders attached to hitzones this dmg manager owns.

◆ GetDamageOverTime()

proto external float DamageManagerComponent.GetDamageOverTime ( EDamageType dType)
Returns
total DPS inflicted by all DoTs of specified type.

◆ GetHealth()

proto external float DamageManagerComponent.GetHealth ( )

◆ GetHealthScaled()

proto external float DamageManagerComponent.GetHealthScaled ( )

◆ GetInstigator()

proto external notnull Instigator DamageManagerComponent.GetInstigator ( )

◆ GetMaxHealth()

proto external float DamageManagerComponent.GetMaxHealth ( )

◆ GetMovementDamage()

proto external float DamageManagerComponent.GetMovementDamage ( )

Returns the movement damage modifier.

Warning
Only usable by ChimeraCharacters and Vehicles.

◆ GetState()

proto external EDamageState DamageManagerComponent.GetState ( )

◆ HandleDamage()

proto external void DamageManagerComponent.HandleDamage ( notnull BaseDamageContext damageContext)

◆ HijackDamageHandling()

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.

◆ IsDamagedOverTime()

proto external bool DamageManagerComponent.IsDamagedOverTime ( EDamageType dType)
Returns
true if there is active DOT of specified type.

◆ IsDamageHandlingEnabled()

proto external bool DamageManagerComponent.IsDamageHandlingEnabled ( )

◆ IsDestroyed()

proto external bool DamageManagerComponent.IsDestroyed ( )

◆ OnDamage()

void DamageManagerComponent.OnDamage ( notnull BaseDamageContext damageContext)
protected

◆ OnDamageOverTimeAdded()

void DamageManagerComponent.OnDamageOverTimeAdded ( EDamageType dType,
float dps,
HitZone hz )
protected

Invoked every time the DoT is added to certain hitzone.

Implemented in SCR_DamageManagerComponent.

◆ OnDamageOverTimeRemoved()

void DamageManagerComponent.OnDamageOverTimeRemoved ( EDamageType dType,
HitZone hz )
protected

Invoked when provided damage type is removed from certain hitzone.

Implemented in SCR_DamageManagerComponent.

◆ OnDamageStateChanged()

void DamageManagerComponent.OnDamageStateChanged ( EDamageState newState,
EDamageState previousDamageState,
bool isJIP )
protected

◆ OnDelete()

void DamageManagerComponent.OnDelete ( IEntity owner)
protected

◆ OnDiag()

void DamageManagerComponent.OnDiag ( IEntity owner,
float timeSlice )
protected

Called during EOnDiag.

Parameters
ownerEntity this component is attached to.
timeSliceDelta time since last update.

◆ OnFilteredContact()

void DamageManagerComponent.OnFilteredContact ( IEntity owner,
IEntity other,
Contact contact )
protected

Only called if FilterContact returned true.

Parameters
ownerThe owner entity
otherOther Entity who contacted us
contactStructure describing the contact

Implemented in SCR_CharacterDamageManagerComponent, SCR_DestructibleBuildingComponent, SCR_DestructionDamageManagerComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.

◆ OnFrame()

void DamageManagerComponent.OnFrame ( IEntity owner,
float timeSlice )
protected

Called during EOnFrame.

Parameters
ownerEntity this component is attached to.
timeSliceDelta time since last update.

Implemented in SCR_DestructibleBuildingComponent, SCR_DestructionTireComponent, and SCR_VehicleDamageManagerComponent.

◆ OnHandleFallDamage()

void DamageManagerComponent.OnHandleFallDamage ( EFallDamageType fallDamageType,
vector velocityVector )
protected

Called when fall related damage is relevant.

Implemented in SCR_CharacterDamageManagerComponent.

◆ OnHealthSet()

void DamageManagerComponent.OnHealthSet ( )
protected

Called when SetHealth() is used on default hitzone.

◆ OnMaxHealthChanged()

void DamageManagerComponent.OnMaxHealthChanged ( )
protected

Called when SetMaxHealth() is used on default hitzone.

◆ OnPostInit()

void DamageManagerComponent.OnPostInit ( IEntity owner)
protected

◆ OverrideHitMaterial()

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.

◆ RemoveDamageOverTime()

proto external void DamageManagerComponent.RemoveDamageOverTime ( EDamageType dType)

Removes DOT of provided damageType from all currently affected HitZones.

◆ SetAimingDamage()

proto external void DamageManagerComponent.SetAimingDamage ( float damage)

Sets the aiming damage modifier.

Warning
Only usable by ChimeraCharacters.

◆ SetAndReplicateInstigator()

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.

◆ SetHealthScaled()

proto external bool DamageManagerComponent.SetHealthScaled ( float health)

◆ SetInstigator()

proto external void DamageManagerComponent.SetInstigator ( notnull Instigator instigator)

◆ SetInstigatorEntity()

proto external void DamageManagerComponent.SetInstigatorEntity ( IEntity instigator)

◆ SetMovementDamage()

proto external void DamageManagerComponent.SetMovementDamage ( float damage)

Sets the movement damage modifier.

Warning
Only usable by ChimeraCharacters and Vehicles.

◆ ShouldCountAsHit()

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.

◆ ShouldOverrideInstigator()

bool DamageManagerComponent.ShouldOverrideInstigator ( notnull Instigator currentInstigator,
notnull Instigator newInstigator )

Called whenever an instigator is going to be set.

Parameters
currentInstigatorThis damage manager's last instigator
newInstigatorThe new instigator for this damage manager
Returns
If it returns true, newInstigator will become the new current instigator for the damage manager and it will receive kill credit.

Implemented in SCR_CharacterDamageManagerComponent, SCR_DamageManagerComponent, SCR_RotorDamageManagerComponent, and SCR_VehicleDamageManagerComponent.


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