Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_DestructionBaseComponent.c File Reference

Go to the source code of this file.

Data Structures

class  SCR_DestructionDamageManagerComponentClass
 
class  SCR_HitInfo
 Class to temporarily store information about the last hit that dealt damage. More...
 
class  SCR_Spawnable_SmallDebrisTitle
 
class  SCR_Spawnable_ParticleTitle
 
class  SCR_DebrisSpawnable
 

Macros

#define ENABLE_BASE_DESTRUCTION
 

Functions

protected notnull SCR_DestructionBaseData GetDestructionBaseData ()
 
private int AllocateDestructionBaseData ()
 
private void FreeDestructionBaseData (int index)
 
ScriptInvoker GetOnDamageInvoker ()
 Returns the on damage script invoker if one exists, otherwise creates one and returns it. More...
 
SCR_DestructionHitInfo GetDestructionHitInfo (bool createNew=false)
 
bool ShouldDestroyParent ()
 
bool GetDisablePhysicsOnDestroy ()
 
bool GetUndamaged ()
 
bool GetDestroyed ()
 
void RPC_DoSpawnAllDestroyEffects ()
 Spawns destroy objects of children as well as own. More...
 
void DeleteParentWithEffects ()
 
void DeleteDestructible ()
 Used in cases where we don't care about effects or anything, e. g. building destruction. More...
 
void SetHitZoneHealth (float baseHealth, bool clearDamage=true)
 
void SetHitZoneDamage (float damage)
 
void CreateDestructionHitInfo (bool totalDestruction, float lastHealth, float hitDamage, EDamageType damageType, vector hitPosition, vector hitDirection, vector hitNormal)
 
bool GetCanBeDamaged ()
 Called when the object receives damage, return false if damage should be ignored. More...
 
void QueueDestroy ()
 Called when the object should be destroyed and various effects or other things need to be performed (actual destruction handled HandleDestruction()) More...
 
void SpawnDestroyObjects (SCR_HitInfo hitInfo)
 
void RegenerateNavmeshDelayed ()
 
void HandleDestruction ()
 Handle destruction. More...
 
void InitDestruction ()
 Initialise destruction. More...
 
void NetReceiveHitData (int hitIndex, EDamageType damageType, float damage, vector hitPosition, vector hitDirection)
 
void NetReadInit (ScriptBitReader reader)
 
void NetWriteInit (ScriptBitWriter writer)
 
void PlaySound ()
 Plays sounds upon destruction. More...
 
void SetModel (ResourceName model)
 
void ReplicateDestructibleState (bool forceUpdate=false)
 
private void RPC_QueueDestroy (bool totalDestruction, float lastHealth, float hitDamage, EDamageType damageType, vector hitPosition, vector hitDirection, vector hitNormal)
 Queue destruction on clients. More...
 
protected RplComponent FindParentRplComponent ()
 
protected void PassDamageToChildren (notnull BaseDamageContext damageContext)
 
bool IsProxy ()
 Checks if this entity is locally owned. More...
 
void UpdateResponseIndex ()
 
override bool OnContact (IEntity owner, IEntity other, Contact contact)
 
override void OnDamage (notnull BaseDamageContext damageContext)
 
bool IsDestructionQueued ()
 
float GetTotalDestructionThreshold ()
 
override void OnPostInit (IEntity owner)
 Called on PostInit when all components are added. More...
 
void ~SCR_DestructionDamageManagerComponent ()
 
SCR_Spawnable_SmallDebrisTitle BaseContainerCustomTitle _WB_GetCustomTitle (BaseContainer source, out string title)
 
SCR_Spawnable_ParticleTitle BaseContainerCustomTitle BaseContainerProps ()] class SCR_BaseSpawnable
 
override IEntity Spawn (IEntity owner, Physics parentPhysics, SCR_HitInfo hitInfo, bool snapToTerrain=false)
 

Variables

SCR_DestructionDamageManagerComponentClass s_OnDestructibleDestroyed = new ScriptInvoker()
 Base destruction component, destruction types extend from this. More...
 
private int m_iDestructionBaseDataIndex = -1
 
class SCR_HitInfo m_TotalDestruction
 Class to temporarily store information about the last hit that caused destruction. More...
 
ref array< ResourceName > m_ModelPrefabs
 
float m_fMass
 
float m_fLifetimeMin
 
float m_fLifetimeMax
 
float m_fDistanceMax
 
int m_fPriority
 
float m_fDamageToImpulse
 
float m_fMaxDamageToSpeedMultiplier
 
float m_fRandomVelocityLinear
 
float m_fRandomVelocityAngular
 
SCR_EMaterialSoundTypeDebris m_eMaterialSoundType
 

Macro Definition Documentation

◆ ENABLE_BASE_DESTRUCTION

#define ENABLE_BASE_DESTRUCTION

Definition at line 1 of file SCR_DestructionBaseComponent.c.

Function Documentation

◆ _WB_GetCustomTitle()

SCR_Spawnable_SmallDebrisTitle BaseContainerCustomTitle _WB_GetCustomTitle ( BaseContainer  source,
out string  title 
)

Definition at line 720 of file SCR_DestructionBaseComponent.c.

◆ AllocateDestructionBaseData()

private int AllocateDestructionBaseData ( )

Definition at line 73 of file SCR_DestructionBaseComponent.c.

◆ BaseContainerProps()

SCR_Spawnable_ParticleTitle BaseContainerCustomTitle BaseContainerProps ( )

Calculates the spawn tranformation matrix for the object

Parameters
[in]owner
[out]outMat
[in]localCoords

Spawns the object

Parameters
[in]owner
[in]parentPhysics
[in]hitInfo
[in]snapToTerrain
Returns

Definition at line 736 of file SCR_DestructionBaseComponent.c.

◆ CreateDestructionHitInfo()

void CreateDestructionHitInfo ( bool  totalDestruction,
float  lastHealth,
float  hitDamage,
EDamageType  damageType,
vector  hitPosition,
vector  hitDirection,
vector  hitNormal 
)

Creates and fills destruction hit info for the object

Parameters
[in]totalDestruction
[in]lastHealth
[in]hitDamage
[in]damageType
[in]hitPosition
[in]hitDirection
[in]hitNormal

Definition at line 238 of file SCR_DestructionBaseComponent.c.

◆ DeleteDestructible()

void DeleteDestructible ( )

Used in cases where we don't care about effects or anything, e. g. building destruction.

Definition at line 183 of file SCR_DestructionBaseComponent.c.

◆ DeleteParentWithEffects()

void DeleteParentWithEffects ( )

Definition at line 170 of file SCR_DestructionBaseComponent.c.

◆ FindParentRplComponent()

protected RplComponent FindParentRplComponent ( )

Definition at line 396 of file SCR_DestructionBaseComponent.c.

◆ FreeDestructionBaseData()

private void FreeDestructionBaseData ( int  index)

Definition at line 90 of file SCR_DestructionBaseComponent.c.

◆ GetCanBeDamaged()

bool GetCanBeDamaged ( )

Called when the object receives damage, return false if damage should be ignored.

Definition at line 253 of file SCR_DestructionBaseComponent.c.

◆ GetDestroyed()

bool GetDestroyed ( )
Returns
whether the object is destroyed

Definition at line 142 of file SCR_DestructionBaseComponent.c.

◆ GetDestructionBaseData()

protected notnull SCR_DestructionBaseData GetDestructionBaseData ( )

Definition at line 64 of file SCR_DestructionBaseComponent.c.

◆ GetDestructionHitInfo()

SCR_DestructionHitInfo GetDestructionHitInfo ( bool  createNew = false)
Parameters
[in]createNew
Returns

Definition at line 107 of file SCR_DestructionBaseComponent.c.

◆ GetDisablePhysicsOnDestroy()

bool GetDisablePhysicsOnDestroy ( )
Returns
whether the object should disable physics on destruction (before being deleted or changed)

Definition at line 125 of file SCR_DestructionBaseComponent.c.

◆ GetOnDamageInvoker()

ScriptInvoker GetOnDamageInvoker ( )

Returns the on damage script invoker if one exists, otherwise creates one and returns it.

Definition at line 99 of file SCR_DestructionBaseComponent.c.

◆ GetTotalDestructionThreshold()

float GetTotalDestructionThreshold ( )
Returns
damage threshold, or 3000 if no component has been found

Definition at line 614 of file SCR_DestructionBaseComponent.c.

◆ GetUndamaged()

bool GetUndamaged ( )
Returns
whether the object is undamaged

Definition at line 132 of file SCR_DestructionBaseComponent.c.

◆ HandleDestruction()

void HandleDestruction ( )

Handle destruction.

Definition at line 303 of file SCR_DestructionBaseComponent.c.

◆ InitDestruction()

void InitDestruction ( )

Initialise destruction.

Definition at line 315 of file SCR_DestructionBaseComponent.c.

◆ IsDestructionQueued()

bool IsDestructionQueued ( )
Returns

Definition at line 607 of file SCR_DestructionBaseComponent.c.

◆ IsProxy()

bool IsProxy ( )

Checks if this entity is locally owned.

Definition at line 434 of file SCR_DestructionBaseComponent.c.

◆ NetReadInit()

void NetReadInit ( ScriptBitReader  reader)

Called when Item is initialized from replication stream. Carries the data from Master.

Parameters
[in]reader

Definition at line 333 of file SCR_DestructionBaseComponent.c.

◆ NetReceiveHitData()

void NetReceiveHitData ( int  hitIndex,
EDamageType  damageType,
float  damage,
vector  hitPosition,
vector  hitDirection 
)

Receive encoded hit data from server

Parameters
[in]hitIndex
[in]damageType
[in]damage
[in]hitPosition
[in]hitDirection

Definition at line 326 of file SCR_DestructionBaseComponent.c.

◆ NetWriteInit()

void NetWriteInit ( ScriptBitWriter  writer)

Called when Item is getting replicated from Master to Slave connection.

Parameters
[in]writer

Definition at line 340 of file SCR_DestructionBaseComponent.c.

◆ OnContact()

override bool OnContact ( IEntity  owner,
IEntity  other,
Contact  contact 
)

Definition at line 457 of file SCR_DestructionBaseComponent.c.

◆ OnDamage()

override void OnDamage ( notnull BaseDamageContext  damageContext)

Definition at line 545 of file SCR_DestructionBaseComponent.c.

◆ PassDamageToChildren()

protected void PassDamageToChildren ( notnull BaseDamageContext  damageContext)

Definition at line 410 of file SCR_DestructionBaseComponent.c.

◆ PlaySound()

void PlaySound ( )

Plays sounds upon destruction.

Definition at line 346 of file SCR_DestructionBaseComponent.c.

◆ QueueDestroy()

void QueueDestroy ( )

Called when the object should be destroyed and various effects or other things need to be performed (actual destruction handled HandleDestruction())

Definition at line 260 of file SCR_DestructionBaseComponent.c.

◆ RegenerateNavmeshDelayed()

void RegenerateNavmeshDelayed ( )

Definition at line 285 of file SCR_DestructionBaseComponent.c.

◆ ReplicateDestructibleState()

void ReplicateDestructibleState ( bool  forceUpdate = false)
Parameters
[in]forceUpdate

Definition at line 379 of file SCR_DestructionBaseComponent.c.

◆ RPC_DoSpawnAllDestroyEffects()

void RPC_DoSpawnAllDestroyEffects ( )

Spawns destroy objects of children as well as own.

Definition at line 153 of file SCR_DestructionBaseComponent.c.

◆ RPC_QueueDestroy()

private void RPC_QueueDestroy ( bool  totalDestruction,
float  lastHealth,
float  hitDamage,
EDamageType  damageType,
vector  hitPosition,
vector  hitDirection,
vector  hitNormal 
)

Queue destruction on clients.

Definition at line 386 of file SCR_DestructionBaseComponent.c.

◆ SetHitZoneDamage()

void SetHitZoneDamage ( float  damage)

Sets damage of the hit zone (does not trigger destruction)

Parameters
[in]damage

Definition at line 220 of file SCR_DestructionBaseComponent.c.

◆ SetHitZoneHealth()

void SetHitZoneHealth ( float  baseHealth,
bool  clearDamage = true 
)

Sets the base health value of the hit zone (does not trigger destruction)

Parameters
[in]baseHealth
[in]clearDamage

Definition at line 208 of file SCR_DestructionBaseComponent.c.

◆ SetModel()

void SetModel ( ResourceName  model)

Sets the model of the object

Parameters
[in]model

Definition at line 353 of file SCR_DestructionBaseComponent.c.

◆ ShouldDestroyParent()

bool ShouldDestroyParent ( )
Returns
whether or not the parent must be destroyed when this is destroyed

Definition at line 117 of file SCR_DestructionBaseComponent.c.

◆ Spawn()

override IEntity BaseContainerProps::Spawn ( IEntity  owner,
Physics  parentPhysics,
SCR_HitInfo  hitInfo,
bool  snapToTerrain = false 
)

Definition at line 815 of file SCR_DestructionBaseComponent.c.

◆ SpawnDestroyObjects()

void SpawnDestroyObjects ( SCR_HitInfo  hitInfo)

Spawns objects that are meant to be created when the object is destroyed (particles, debris, etc)

Parameters
[in]hitInfo

Definition at line 267 of file SCR_DestructionBaseComponent.c.

◆ UpdateResponseIndex()

void UpdateResponseIndex ( )

Definition at line 442 of file SCR_DestructionBaseComponent.c.

◆ ~SCR_DestructionDamageManagerComponent()

void ~SCR_DestructionDamageManagerComponent ( )

Definition at line 644 of file SCR_DestructionBaseComponent.c.

Variable Documentation

◆ m_eMaterialSoundType

SCR_EMaterialSoundTypeDebris m_eMaterialSoundType

Definition at line 728 of file SCR_DestructionBaseComponent.c.

◆ m_fDamageToImpulse

float m_fDamageToImpulse

Definition at line 716 of file SCR_DestructionBaseComponent.c.

◆ m_fDistanceMax

float m_fDistanceMax

Definition at line 710 of file SCR_DestructionBaseComponent.c.

◆ m_fLifetimeMax

float m_fLifetimeMax

Definition at line 707 of file SCR_DestructionBaseComponent.c.

◆ m_fLifetimeMin

float m_fLifetimeMin

Definition at line 704 of file SCR_DestructionBaseComponent.c.

◆ m_fMass

float m_fMass

Definition at line 701 of file SCR_DestructionBaseComponent.c.

◆ m_fMaxDamageToSpeedMultiplier

float m_fMaxDamageToSpeedMultiplier

Definition at line 719 of file SCR_DestructionBaseComponent.c.

◆ m_fPriority

int m_fPriority

Definition at line 713 of file SCR_DestructionBaseComponent.c.

◆ m_fRandomVelocityAngular

float m_fRandomVelocityAngular

Definition at line 725 of file SCR_DestructionBaseComponent.c.

◆ m_fRandomVelocityLinear

float m_fRandomVelocityLinear

Definition at line 722 of file SCR_DestructionBaseComponent.c.

◆ m_iDestructionBaseDataIndex

private int m_iDestructionBaseDataIndex = -1

Definition at line 39 of file SCR_DestructionBaseComponent.c.

◆ m_ModelPrefabs

ref array<ResourceName> m_ModelPrefabs

Definition at line 698 of file SCR_DestructionBaseComponent.c.

◆ m_TotalDestruction

class SCR_HitInfo m_TotalDestruction

Class to temporarily store information about the last hit that caused destruction.

◆ s_OnDestructibleDestroyed

SCR_DestructionDamageManagerComponentClass s_OnDestructibleDestroyed = new ScriptInvoker()

Base destruction component, destruction types extend from this.