Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Global Class Reference

Static Protected Member Functions

static void SetHierarchyChildVelocity (notnull IEntity ent, vector newVelocity, bool recursive=true)
 Called from SetHierarchyVelocity.
static void SetHierarchyVelocity (notnull IEntity ent, vector newVelocity)
 Set linear velocity for whole hierarchy.
static void SetHierarchyChildAngularVelocity (notnull IEntity ent, vector newAngularVelocity, IEntity entFrom, bool recursive=true)
 Called from SetHierarchyAngularVelocity.
static void SetHierarchyAngularVelocity (notnull IEntity ent, vector newAngularVelocity)
 Set angular velocity for whole hierarchy.
static void SetHierarchyChildBodyActive (notnull IEntity ent, ActiveState activeState, bool recursive=true, bool resetVelocity=false)
 Called from SetHierarchyBodyActive.
static void SetHierarchyBodyActive (notnull IEntity ent, ActiveState activeState, bool resetVelocity=false)
 Sets physics active state for whole hierarchy.
static bool IsAnyInherited (notnull IEntity entity, array< typename > typenames)
 Returns true if the given entity is inherited from list of typesnames given as argument.
static bool ApplyDamage (IEntity entity, IEntity weapon, float dmg, EDamageType dmgType, string hitZone, SurfaceProperties surface, int nodeIdx)
static ActionsManagerComponent FindActionsManagerComponent (IEntity entity, bool activeOnly=true)
static SCR_EditorActionsManagerComponent FindEditorActionsManagerComponent (IEntity entity)
static bool GetModelAndRemapFromResource (ResourceName resourcePath, out ResourceName modelPath, out string remap)
 Read the input resource and returns whether a model was successfully found, filling the output model and remap paths.
static bool GetResourceContainsComponent (ResourceName resourcePath, string componentClassName, out bool isPrefab)
 Read the input resource and returns whether it contains a component on input name, filling whether the resource is a prefab.
static bool IsEditMode ()
static bool IsEditMode (notnull IEntity entity)
static vector ProjWorldEditorMouseScreenToWorld (GenericEntity referenceEntity)
static bool TeleportLocalPlayer (vector worldPosition, SCR_EPlayerTeleportedReason teleportReason=SCR_EPlayerTeleportedReason.DEFAULT)
static bool TeleportPlayer (int playerId, vector worldPosition, SCR_EPlayerTeleportedReason teleportReason=SCR_EPlayerTeleportedReason.DEFAULT)
static void DrawMatrix (vector matrix[4], float scale=1, ShapeFlags flags=ShapeFlags.ONCE|ShapeFlags.NOZBUFFER, int colorX=Color.RED, int colorY=Color.GREEN, int colorZ=Color.BLUE)
static void DrawTrace (TraceParam trace, float traceCoef=-1, ShapeFlags flags=ShapeFlags.ONCE|ShapeFlags.NOZBUFFER|ShapeFlags.NOOUTLINE, int colorEnd=Color.BLACK, int colorIntersect=Color.PINK)
static void SetMaterial (IEntity entity, ResourceName material, bool recursively=true)
static bool IsChangedMouseAndKeyboard (EInputDeviceType oldDevice, EInputDeviceType newDevice)
static ResourceName GetRootWorld (ResourceName worldPath=ResourceName.Empty)
static ResourceName GetResourceName (string path)
static int GetFrequencies (SCR_GadgetManagerComponent gadgetManager, out notnull set< int > outFrequencies)
static bool IsAdminRole (EPlayerRole role)
static bool IsAdmin (int playerID)
static bool IsAdmin ()
static ResourceName GetPrefabAttributeResource (notnull IEntity entity, string containerType, string attributeName)
static bool IsPositionWithinTerrainBounds (vector pos)

Detailed Description

SCR_Global Class

Contains various useful global script functions

Definition at line 6 of file Functions.c.

Member Function Documentation

◆ ApplyDamage()

bool SCR_Global::ApplyDamage ( IEntity entity,
IEntity weapon,
float dmg,
EDamageType dmgType,
string hitZone,
SurfaceProperties surface,
int nodeIdx )
inlinestaticprotected

Keep that as the last check

check if the entity has the damage manager component

no hitzone given, use the default one if exist

Definition at line 1347 of file Functions.c.

◆ DrawMatrix()

void SCR_Global::DrawMatrix ( vector matrix[4],
float scale = 1,
ShapeFlags flags = ShapeFlags.ONCE | ShapeFlags.NOZBUFFER,
int colorX = Color.RED,
int colorY = Color.GREEN,
int colorZ = Color.BLUE )
inlinestaticprotected

Draw lines representing transformation matrix.

Parameters
matrixTransformation matrix in world space
scaleLength of lines in meters
flagsShape flags
colorXColor of longitudinal line
colorYColor of vertical line
colorZColor of lateral line

Definition at line 1747 of file Functions.c.

◆ DrawTrace()

void SCR_Global::DrawTrace ( TraceParam trace,
float traceCoef = -1,
ShapeFlags flags = ShapeFlags.ONCE | ShapeFlags.NOZBUFFER | ShapeFlags.NOOUTLINE,
int colorEnd = Color.BLACK,
int colorIntersect = Color.PINK )
inlinestaticprotected

Draw lines representing trace param.

Parameters
traceTrace param
traceCoefTrace coef calculated e.g., by BaseWorld.TraceMove
flagsShape flags
colorEndColor of the line going from intersection point to TraceParam.End
colorIntersectColor of the line going from TraceParam.Start to intersection point

Definition at line 1768 of file Functions.c.

◆ FindActionsManagerComponent()

ActionsManagerComponent SCR_Global::FindActionsManagerComponent ( IEntity entity,
bool activeOnly = true )
inlinestaticprotected

Check whether entity has actions manager and return it if it exists.

Parameters
entityThe entity to find the actions manager component on.
Returns
True when actions manager is present, false otherwise.

Definition at line 1417 of file Functions.c.

◆ FindEditorActionsManagerComponent()

SCR_EditorActionsManagerComponent SCR_Global::FindEditorActionsManagerComponent ( IEntity entity)
inlinestaticprotected

Check whether entity has editor actions manager and return it if it exists.

Parameters
entityThe entity to find the actions manager component on.
Returns
True when actions manager is present, false otherwise.

Definition at line 1440 of file Functions.c.

◆ GetFrequencies()

int SCR_Global::GetFrequencies ( SCR_GadgetManagerComponent gadgetManager,
out notnull set< int > outFrequencies )
inlinestaticprotected

Get all frequencies entity with given gadget manager listens to.

Parameters
gadgetManagerGadget manager
[out]outFrequenciesList to be filled with unique frequencies
Returns
Number of frequencies

Definition at line 1884 of file Functions.c.

◆ GetModelAndRemapFromResource()

bool SCR_Global::GetModelAndRemapFromResource ( ResourceName resourcePath,
out ResourceName modelPath,
out string remap )
inlinestaticprotected

Read the input resource and returns whether a model was successfully found, filling the output model and remap paths.

Definition at line 1455 of file Functions.c.

◆ GetPrefabAttributeResource()

ResourceName SCR_Global::GetPrefabAttributeResource ( notnull IEntity entity,
string containerType,
string attributeName )
inlinestaticprotected

Get attribute resourceName from a specified component of the entity's prefab

Parameters
entityEntity to get resourceName for
containerTypeName of the container, for example "MeshObject"
attributeNameName of the attribute, for example "Object"
Returns
resourceName Path to resource

Definition at line 1953 of file Functions.c.

◆ GetResourceContainsComponent()

bool SCR_Global::GetResourceContainsComponent ( ResourceName resourcePath,
string componentClassName,
out bool isPrefab )
inlinestaticprotected

Read the input resource and returns whether it contains a component on input name, filling whether the resource is a prefab.

Definition at line 1522 of file Functions.c.

◆ GetResourceName()

ResourceName SCR_Global::GetResourceName ( string path)
inlinestaticprotected

Get resource name of a file on given path. The file must exist and have meta file, otherwise empty string is returned!

Parameters
pathFile path
Returns
Resource name with GUID

Definition at line 1866 of file Functions.c.

◆ GetRootWorld()

ResourceName SCR_Global::GetRootWorld ( ResourceName worldPath = ResourceName.Empty)
inlinestaticprotected

Get path to the root world. If the world is a sub-scene, it will go through all its ancestors to find the root.

Parameters
worldPathChecked world. When empty, current world will be used.
Returns
Resource name with GUID

Definition at line 1841 of file Functions.c.

◆ IsAdmin() [1/2]

bool SCR_Global::IsAdmin ( )
inlinestaticprotected

Check if local player is an admin.

Returns
True when player with given ID is an admin.

Definition at line 1938 of file Functions.c.

◆ IsAdmin() [2/2]

bool SCR_Global::IsAdmin ( int playerID)
inlinestaticprotected

Check if given player is an admin.

Parameters
playerIDID of queried player
Returns
True when player with given ID is an admin.

Definition at line 1927 of file Functions.c.

◆ IsAdminRole()

bool SCR_Global::IsAdminRole ( EPlayerRole role)
inlinestaticprotected

Check if given player role has admin rights.

Parameters
rolePlayer role
Returns
True when the role has admin rights

Definition at line 1916 of file Functions.c.

◆ IsAnyInherited()

bool SCR_Global::IsAnyInherited ( notnull IEntity entity,
array< typename > typenames )
inlinestaticprotected

Returns true if the given entity is inherited from list of typesnames given as argument.

Definition at line 1335 of file Functions.c.

◆ IsChangedMouseAndKeyboard()

bool SCR_Global::IsChangedMouseAndKeyboard ( EInputDeviceType oldDevice,
EInputDeviceType newDevice )
inlinestaticprotected

Check if the change triggered by GetGame().OnInputDeviceUserChangedInvoker() is only between mouse and keyboard. Used in scripts which need to reset some variables when switching from mouse+keyboard and gamepad, but not when switching just between mouse and keyboard.

Parameters
oldDevicePreviously active device
newDeviceCurrently active device
Returns
True when the change is from mouse to keyboard or vice versa

Definition at line 1829 of file Functions.c.

◆ IsEditMode() [1/2]

bool SCR_Global::IsEditMode ( )
inlinestaticprotected

Check if the game is running in edit mode.

Returns
true during edit mode in Workbench or if GetGame() is null

Definition at line 1566 of file Functions.c.

◆ IsEditMode() [2/2]

bool SCR_Global::IsEditMode ( notnull IEntity entity)
inlinestaticprotected

Check if the entity is running in edit mode.

Parameters
entityEntity whose world will be checked
Returns
True during edit mode in Workbench

Definition at line 1576 of file Functions.c.

◆ IsPositionWithinTerrainBounds()

bool SCR_Global::IsPositionWithinTerrainBounds ( vector pos)
inlinestaticprotected

Checks if provided position is within terrain bounds and over the terrain surface

Parameters
[in]posposition in world space
Returns
true if it is, otherwise false

Definition at line 1981 of file Functions.c.

◆ ProjWorldEditorMouseScreenToWorld()

vector SCR_Global::ProjWorldEditorMouseScreenToWorld ( GenericEntity referenceEntity)
inlinestaticprotected

Calculates the world direction of the mouse cursor projected into world space in the World Editor

Parameters
referenceEntityEntity to get the world, camera, and editor API from
Returns
Direction in world space

Definition at line 1586 of file Functions.c.

◆ SetHierarchyAngularVelocity()

void SCR_Global::SetHierarchyAngularVelocity ( notnull IEntity ent,
vector newAngularVelocity )
inlinestaticprotected

Set angular velocity for whole hierarchy.

Definition at line 1262 of file Functions.c.

◆ SetHierarchyBodyActive()

void SCR_Global::SetHierarchyBodyActive ( notnull IEntity ent,
ActiveState activeState,
bool resetVelocity = false )
inlinestaticprotected

Sets physics active state for whole hierarchy.

Definition at line 1306 of file Functions.c.

◆ SetHierarchyChildAngularVelocity()

void SCR_Global::SetHierarchyChildAngularVelocity ( notnull IEntity ent,
vector newAngularVelocity,
IEntity entFrom,
bool recursive = true )
inlinestaticprotected

Called from SetHierarchyAngularVelocity.

Definition at line 1233 of file Functions.c.

◆ SetHierarchyChildBodyActive()

void SCR_Global::SetHierarchyChildBodyActive ( notnull IEntity ent,
ActiveState activeState,
bool recursive = true,
bool resetVelocity = false )
inlinestaticprotected

Called from SetHierarchyBodyActive.

Definition at line 1278 of file Functions.c.

◆ SetHierarchyChildVelocity()

void SCR_Global::SetHierarchyChildVelocity ( notnull IEntity ent,
vector newVelocity,
bool recursive = true )
inlinestaticprotected

Called from SetHierarchyVelocity.

Definition at line 1194 of file Functions.c.

◆ SetHierarchyVelocity()

void SCR_Global::SetHierarchyVelocity ( notnull IEntity ent,
vector newVelocity )
inlinestaticprotected

Set linear velocity for whole hierarchy.

Definition at line 1214 of file Functions.c.

◆ SetMaterial()

void SCR_Global::SetMaterial ( IEntity entity,
ResourceName material,
bool recursively = true )
inlinestaticprotected

Set material to an entity.

Parameters
entityAffected entity
materialMaterial to be applied
recursivelyTrue to apply the material also to children

Definition at line 1793 of file Functions.c.

◆ TeleportLocalPlayer()

bool SCR_Global::TeleportLocalPlayer ( vector worldPosition,
SCR_EPlayerTeleportedReason teleportReason = SCR_EPlayerTeleportedReason.DEFAULT )
inlinestaticprotected

Teleport local player to given position.

Parameters
worldPositionWorld position
teleportReasonDictates the notifcation the player gets when teleported. DEFAULT reason has no notification associated with it
Returns
True if the operation was performed successfully

Definition at line 1625 of file Functions.c.

◆ TeleportPlayer()

bool SCR_Global::TeleportPlayer ( int playerId,
vector worldPosition,
SCR_EPlayerTeleportedReason teleportReason = SCR_EPlayerTeleportedReason.DEFAULT )
inlinestaticprotected

Teleport player to given position.

Parameters
playerIdID of teleported player
worldPositionWorld position
teleportReasonDictates the notifcation the player gets when teleported. DEFAULT reason has no notification associated with it
Returns
True if the operation was performed successfully

Definition at line 1638 of file Functions.c.


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