Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MultiPartDeployableItemComponent.c File Reference

Go to the source code of this file.

Classes

class  SCR_MultiPartDeployableItemComponentClass

Functions

bool IsUsingPartPositionAndRotation ()
vector GetAdditionaPlacementOffset ()
vector GetAdditionaPlacementRotation ()
bool GetFrontTowardPlayer ()
float GetReplacementPrefabHealthScaled ()
void SetReplacmentPrefabHealthScaled (float newHealthValue)
 0-1 scaled amount of health that replacement prefab will have upon deployment
bool FetchVariantData (int variant)
void ClearCache ()
 Clears the information about currently handled variant.
int GetCurrentlyCachedVariantId ()
bool CheckSurfaceTilt (vector up, bool useDataFromOwnerPosition=false)
bool IsSurfaceValid (IEntity surfaceEnt, vector worldPosition, vector surfaceNorm, int nodeIndex, int colliderIndex, SurfaceProperties surfaceProps, string surfaceMaterial, string colliderName)
bool FindRequiredElements (out string failReason, vector position=-vector.One)
bool EvaluateFoundEntity (IEntity ent)
bool CheckAvailableSpace (inout vector transform[4], vector direction=vector.Zero, out LocalizedString reason=string.Empty)
bool CheckIfPositionIsIndoors (inout vector transform[4])
 Method that is meant to be called by clients to check if spawn position will be under something.
void VisualizeReplacementEntity (inout vector transform[4], vector direction=vector.Zero)
void SetPreviewState (SCR_EPreviewState state)
bool FilterTracedEntities (notnull IEntity e, vector start="0 0 0", vector dir="0 0 0")
void Deploy (int variantId, IEntity userEntity=null, vector direction=vector.Zero, bool reload=false, bool state=true)
void SurfaceMonitoringInit (notnull IEntity surface)
void StopMonitoringSurface (IEntity ent, SCR_HitZone observedHitZone=null, SCR_BaseDeployableInventoryItemComponent deployableComp=null)
void ExecuteObservationBehaviour (SCR_ESurfaceMonitoringBehaviour beaviour=-1)
void OnMonitoredSurfaceDamageStateChanged (SCR_HitZone damagedHitZone)
void OnMonitoredSurfaceDismantled (bool newState, SCR_BaseDeployableInventoryItemComponent component)
void OnMonitoredSurfaceDeleted (IEntity deletedEntity)
void ComputeTransform (inout vector transform[4], vector direction)
void DeleteParts ()
void TransferDamageValues ()
 Method meant to be used to transfer information about health between this entity and deployed entity.
void DelayedDeletion ()
 Method used to delte this entity but after some delay to ensure that other logic can execute correctly especially for proxy.
override void OnDelete (IEntity owner)
override void RPC_PlaySoundOnDeployBroadcast (bool deploy)
override bool RplSave (ScriptBitWriter writer)
override bool RplLoad (ScriptBitReader reader)

Variables

SCR_MultiPartDeployableItemComponentClass m_VariantContainer
ref array< ref SCR_RequiredDeployablePartm_aFoundElements
float m_fReplacementPrefabHealthScaled = 1
int m_iCurrentVariant = -1

Function Documentation

◆ CheckAvailableSpace()

bool CheckAvailableSpace ( inout vector transform[4],
vector direction = vector.Zero,
out LocalizedString reason = string.Empty )
protected

Method that is meant to be called by clients to check if there is enough space for deployed entity

Parameters
[in,out]transformmatrix with position which is going to be checked - marked as inout as operations done on static arrays are done through the pointers thus will impact what is passed into the method
[in]directionin which spawned entity should be aligned to
[out]reasonof what is obstructing the space
Returns
true if there are no obstacles

Definition at line 533 of file SCR_MultiPartDeployableItemComponent.c.

◆ CheckIfPositionIsIndoors()

bool CheckIfPositionIsIndoors ( inout vector transform[4])
protected

Method that is meant to be called by clients to check if spawn position will be under something.

Definition at line 602 of file SCR_MultiPartDeployableItemComponent.c.

◆ CheckSurfaceTilt()

bool CheckSurfaceTilt ( vector up,
bool useDataFromOwnerPosition = false )
protected

Method used to check ground on the deployment position is not tilted too much for currently used variant

Parameters
[in]upvector of the surface
[in]useDataFromOwnerPositionwhen ture, then value up is overriden by a result of a trace at the position of the owner of this component
Returns
true if tilt is within spec for current variant

Definition at line 409 of file SCR_MultiPartDeployableItemComponent.c.

◆ ClearCache()

void ClearCache ( )
protected

Clears the information about currently handled variant.

Definition at line 391 of file SCR_MultiPartDeployableItemComponent.c.

◆ ComputeTransform()

void ComputeTransform ( inout vector transform[4],
vector direction )
protected

Transform to have the right direction

Parameters
[in,out]transformmatrix with position - marked as inout as operations done on static arrays are done through the pointers thus will impact what is passed into the method
[in]directionin which spawned entity should be aligned to

Definition at line 984 of file SCR_MultiPartDeployableItemComponent.c.

◆ DelayedDeletion()

void DelayedDeletion ( )
protected

Method used to delte this entity but after some delay to ensure that other logic can execute correctly especially for proxy.

Definition at line 1145 of file SCR_MultiPartDeployableItemComponent.c.

◆ DeleteParts()

void DeleteParts ( )
protected

Method for deleting elements that are marked for Deletion If f.e. you would want to get damage value of a tire to pass it to assembled entity (f.e. bicycle) then override this

Definition at line 1012 of file SCR_MultiPartDeployableItemComponent.c.

◆ Deploy()

void Deploy ( int variantId,
IEntity userEntity = null,
vector direction = vector.Zero,
bool reload = false,
bool state = true )
protected

Gets called when deploy action is executed by player

Parameters
[in]userEntityplayer who deployed it
[in]directionin which it should be deployed
[in]reload
[in]stateshould the resulting state be considered as deployed

Definition at line 753 of file SCR_MultiPartDeployableItemComponent.c.

◆ EvaluateFoundEntity()

bool EvaluateFoundEntity ( IEntity ent)
protected

Callback method used to filter found elements and store all required parts

Parameters
[in]ententity that was found with the query
Returns
true if query should continue fetching more entities

Definition at line 495 of file SCR_MultiPartDeployableItemComponent.c.

◆ ExecuteObservationBehaviour()

void ExecuteObservationBehaviour ( SCR_ESurfaceMonitoringBehaviour beaviour = -1)
protected

Method used to execute reactionary behaviour on the changes made to the surface on which this object was deployed

Parameters
[in]beaviouroverride of the behaviour that was defined for this prefab

Definition at line 908 of file SCR_MultiPartDeployableItemComponent.c.

◆ FetchVariantData()

bool FetchVariantData ( int variant)
protected

Method used to find and cache the data about the variant

Parameters
[int]variant id that is meant to be found
Returns
true if such variant was found, otherwise false

Definition at line 378 of file SCR_MultiPartDeployableItemComponent.c.

◆ FilterTracedEntities()

bool FilterTracedEntities ( notnull IEntity e,
vector start = "0 0 0",
vector dir = "0 0 0" )
protected

Callback method used to filter out things that shouldnt prevent deployment

Parameters
[in]e
[in]start
[in]dir
Returns

Definition at line 724 of file SCR_MultiPartDeployableItemComponent.c.

◆ FindRequiredElements()

bool FindRequiredElements ( out string failReason,
vector position = -vector.One )
protected

Method used to check if there are required partes within the area of deployment

Parameters
[out]failReasonstring containing the text about missing item with their name
[in]positionfrom which script will search for required elements. If position == -vector.One then owner origin will be used
Returns
true if all required elements were found

Definition at line 456 of file SCR_MultiPartDeployableItemComponent.c.

◆ GetAdditionaPlacementOffset()

vector GetAdditionaPlacementOffset ( )
protected
Returns

Definition at line 331 of file SCR_MultiPartDeployableItemComponent.c.

◆ GetAdditionaPlacementRotation()

vector GetAdditionaPlacementRotation ( )
protected
Returns

Definition at line 341 of file SCR_MultiPartDeployableItemComponent.c.

◆ GetCurrentlyCachedVariantId()

int GetCurrentlyCachedVariantId ( )
protected
Returns

Definition at line 399 of file SCR_MultiPartDeployableItemComponent.c.

◆ GetFrontTowardPlayer()

bool GetFrontTowardPlayer ( )
protected
Returns
true if forward vector should face toward the player

Definition at line 351 of file SCR_MultiPartDeployableItemComponent.c.

◆ GetReplacementPrefabHealthScaled()

float GetReplacementPrefabHealthScaled ( )
protected
Returns
0-1 scaled amount of health that replacement prefab will have upon deployment

Definition at line 362 of file SCR_MultiPartDeployableItemComponent.c.

◆ IsSurfaceValid()

bool IsSurfaceValid ( IEntity surfaceEnt,
vector worldPosition,
vector surfaceNorm,
int nodeIndex,
int colliderIndex,
SurfaceProperties surfaceProps,
string surfaceMaterial,
string colliderName )
protected

Validates if provided entity can be considered as a valid surface for deployment

Parameters
[in]surfaceEntentity on which the item is going to be deployed
[in]worldPositionposition in world space
[in]surfaceNormnormal of the face on which the item is going to be deployed
[in]nodeIndexbone id to which is attached the collider on which the item is going to be deployed
[in]colliderIndexcollider id on which the item is going to be deployed
[in]surfacePropsproperties of the surface on which the item is going to be deployed
[in]surfaceMaterialname of the material of the surface on which the item is going to be deployed
[in]colliderNamename of the collider on which the item is going to be deployed
Returns
true if item can be deployed on this surface, otherwise false

Definition at line 443 of file SCR_MultiPartDeployableItemComponent.c.

◆ IsUsingPartPositionAndRotation()

bool IsUsingPartPositionAndRotation ( )
protected
Returns

Definition at line 324 of file SCR_MultiPartDeployableItemComponent.c.

◆ OnDelete()

override void OnDelete ( IEntity owner)
protected

Definition at line 1151 of file SCR_MultiPartDeployableItemComponent.c.

◆ OnMonitoredSurfaceDamageStateChanged()

void OnMonitoredSurfaceDamageStateChanged ( SCR_HitZone damagedHitZone)
protected

Callback method used to update this entity when surface on which it was deployed changed its damage state

Parameters
[in]damagedHitZone

Definition at line 953 of file SCR_MultiPartDeployableItemComponent.c.

◆ OnMonitoredSurfaceDeleted()

void OnMonitoredSurfaceDeleted ( IEntity deletedEntity)
protected

Callback method used to update this entity when surface on which it was deployed got deleted

Parameters
[in]deletedEntity

Definition at line 975 of file SCR_MultiPartDeployableItemComponent.c.

◆ OnMonitoredSurfaceDismantled()

void OnMonitoredSurfaceDismantled ( bool newState,
SCR_BaseDeployableInventoryItemComponent component )
protected

Callback method used to update this entity when surface on which it was deployed changed its deployment state

Parameters
[in]newState
[in]component

Definition at line 966 of file SCR_MultiPartDeployableItemComponent.c.

◆ RPC_PlaySoundOnDeployBroadcast()

override void RPC_PlaySoundOnDeployBroadcast ( bool deploy)
protected

Definition at line 1170 of file SCR_MultiPartDeployableItemComponent.c.

◆ RplLoad()

override bool RplLoad ( ScriptBitReader reader)
protected

Definition at line 1216 of file SCR_MultiPartDeployableItemComponent.c.

◆ RplSave()

override bool RplSave ( ScriptBitWriter writer)
protected

Definition at line 1205 of file SCR_MultiPartDeployableItemComponent.c.

◆ SetPreviewState()

void SetPreviewState ( SCR_EPreviewState state)
protected
Parameters
[in]state

Definition at line 681 of file SCR_MultiPartDeployableItemComponent.c.

◆ SetReplacmentPrefabHealthScaled()

void SetReplacmentPrefabHealthScaled ( float newHealthValue)
protected

0-1 scaled amount of health that replacement prefab will have upon deployment

Definition at line 369 of file SCR_MultiPartDeployableItemComponent.c.

◆ StopMonitoringSurface()

void StopMonitoringSurface ( IEntity ent,
SCR_HitZone observedHitZone = null,
SCR_BaseDeployableInventoryItemComponent deployableComp = null )
protected

Callback method used to update this entity when surface on which it was deployed changed its damage state

Parameters
[in]entthat was being monitored
[in]observedHitZonewhich damage state was monitored
[in]deployableCompwhich deployment state was monitored

Definition at line 882 of file SCR_MultiPartDeployableItemComponent.c.

◆ SurfaceMonitoringInit()

void SurfaceMonitoringInit ( notnull IEntity surface)
protected

Method used to initialize monitoring of the surface on which this object was deployed

Parameters
[in]surfacethat will be monitored

Definition at line 853 of file SCR_MultiPartDeployableItemComponent.c.

◆ TransferDamageValues()

void TransferDamageValues ( )
protected

Method meant to be used to transfer information about health between this entity and deployed entity.

Definition at line 1051 of file SCR_MultiPartDeployableItemComponent.c.

◆ VisualizeReplacementEntity()

void VisualizeReplacementEntity ( inout vector transform[4],
vector direction = vector.Zero )
protected

Creates or updates preview entity used by this deployable entity as a visualisation of final product

Parameters
[in,out]transform- marked as inout as operations done on static arrays are done through the pointers thus will impact what is passed into the method
[in]direction

Definition at line 622 of file SCR_MultiPartDeployableItemComponent.c.

Variable Documentation

◆ m_aFoundElements

ref array<ref SCR_RequiredDeployablePart> m_aFoundElements
protected

Definition at line 194 of file SCR_MultiPartDeployableItemComponent.c.

◆ m_fReplacementPrefabHealthScaled

float m_fReplacementPrefabHealthScaled = 1
protected

Definition at line 195 of file SCR_MultiPartDeployableItemComponent.c.

◆ m_iCurrentVariant

int m_iCurrentVariant = -1
protected

Definition at line 196 of file SCR_MultiPartDeployableItemComponent.c.

◆ m_VariantContainer