Skip to content

ESE Class

NarcoMarshDev edited this page Sep 28, 2022 · 4 revisions

Category: Static
Path: scripts/Game/ESE.c

Base class for generic ESE static methods that don't fit into more specific classes.

Overview

Most of the methods in this class are here because they either are unsuited to any other ESE class, or are shortened quality of life methods to help reduce the number of long one-liners like GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(IEntity ent); instead making them ESE.GetPlayerId(IEntity ent)

Methods

Name⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ Return⠀⠀⠀⠀⠀ Description
GetAllChildren (IEntity ent) array<IEntity> Returns array of all child entities of a given IEntity, children must have Hierarchy component to be found by this method.
GetAllChildrenByType (IEntity ent, typename childClass) array<IEntity> Same as GetAllChildren() but only returns children that inherit from the given type.
GetPlayerEntity (int playerId) ChimeraCharacter Finds player character from given player id, returns null is no entity is found.
GetLocalPlayerEntity () ChimeraCharacter Returns current controlled player character on local machine, returns null if no entity is found.
GetPlayerId (IEntity ent) int Returns integer player id from given controlled entity.
GetCurrentWeapon (ChimeraCharacter player) BaseWeaponComponent Returns currently equipped weapon of given player, returns null if no weapon or weapon is holstered.
HolsterCurrentWeapon (ChimeraCharacter player) void Sets given player's current weapon to null, holstering it or doing nothing if no weapon is equipped.
FetchMagazines (ChimeraCharacter char, BaseWeaponComponent wep, inout array<MagazineComponent> mags) void (inout) Finds and outputs all valid magazines matching the given weapon in the inventory of the given character into an array.
GetAllSiblings (IEntity ent, notnull inout array allSiblings) void (inout) Finds and outputs all siblings of a given entity to an array, Hierarchy component needed on siblings to be found. WIP AND CURRENTLY DISABLED BY DEFAULT
Clone this wiki locally