Arma Reforger Script API
|
Public Member Functions | |
IEntity | GetHeldGadget () |
Get held (currently in hand) gadget. | |
bool | GetIsGadgetADS () |
Get is player in gadget ADS. | |
SCR_GadgetComponent | GetHeldGadgetComponent () |
Get held (currently in hand) gadget component. | |
void | SetGadgetMode (IEntity gadget, EGadgetMode targetMode, bool doFocus=false) |
Set mode of a gadget When changing mode FROM EGadgetMode.IN_HAND to inventory, target should be EGadgetMode.IN_STORAGE -> it will do EGadgetMode.IN_SLOT automatically if it is slotted. | |
void | RemoveHeldGadget () |
Remove gadget held in hand. | |
void | ToggleHeldGadget (bool state) |
Toggle held gadget on/off. | |
array< SCR_GadgetComponent > | GetGadgetsByType (EGadgetType type) |
Get all owned gadgets by type | |
IEntity | GetGadgetByType (EGadgetType type) |
Get first owned gadget by type. | |
IEntity | GetQuickslotGadgetByType (EGadgetType type) |
Get first owned gadget assigned in quickslot by type. | |
bool | IsGadgetOwned (SCR_GadgetComponent gadgetComp) |
Check whether gadget is owned by this entity. | |
void | HandleInput (IEntity gadget, float inputVal) |
Additonal pre SetGadgetMode logic for local player, modfying the behavior based on input used & current held gadget state. | |
void | OnItemAdded (IEntity item, BaseInventoryStorageComponent storageOwner) |
SCR_InventoryStorageManagerComponent, called on every add to slot, not only to inventory. | |
void | OnItemRemoved (IEntity item, BaseInventoryStorageComponent storageOwner) |
SCR_InventoryStorageManagerComponent, called on every remove from slot, not only from inventory. | |
void | OnPlayerDeath (SCR_CharacterControllerComponent charController, IEntity instigatorEntity, notnull Instigator instigator) |
SCR_CharacterControllerComponent event. | |
void | OnControlledByPlayer (IEntity owner, bool controlled) |
SCR_CharacterControllerComponent event. | |
void | OnGadgetStateChanged (IEntity gadget, bool isInHand, bool isOnGround) |
CharacterControllerComponent event. | |
void | OnGadgetFocusStateChanged (IEntity gadget, bool isFocused) |
CharacterControllerComponent event, used only for local character. | |
void | OnEditorOpened () |
SCR_EditorManagerEntity event //TODO we shouldnt need this, probably needs to be dependent on camera instead. | |
void | SetGadgetADS (bool gadgetADS) |
API for setting raised gadget mode. | |
void | CancelADSInput () |
Cancel weapon and turret ADS input state. | |
void | AskToggleGadget (SCR_GadgetComponent gadgetComp, bool state) |
Ask method for toggle synchronization called from individual gadgets. | |
override void | OnDelete (IEntity owner) |
void | Update (float timeSlice) |
Runs only on local client. | |
override void | OnPostInit (IEntity owner) |
Static Public Member Functions | |
static ScriptInvoker | GetOnGadgetInitDoneInvoker () |
static SCR_GadgetManagerComponent | GetGadgetManager (IEntity entity) |
Get gadget manager of entity. | |
static bool | ValidController (IEntity owner) |
static void | SetGadgetModeStashed (SCR_GadgetComponent gadgetComp, EGadgetMode targetMode) |
Static method for setting gadgets to ground/storage modes for containers such as vehicles which do not have gadget manager. | |
Public Attributes | |
int | m_iRadiosFlags = EGadgetType.RADIO | EGadgetType.RADIO_BACKPACK |
ref ScriptInvoker< SCR_GadgetComponent > | m_OnGadgetAdded = new ScriptInvoker() |
ref ScriptInvoker< SCR_GadgetComponent > | m_OnGadgetRemoved = new ScriptInvoker() |
Protected Member Functions | |
void | OnActivateHeldGadget () |
Activate held gadget. | |
bool | CanChangeGadgetMode (IEntity gadget, SCR_GadgetComponent gadgetComp, EGadgetMode targetMode) |
Rules for gadget mode change. | |
void | UpdateHeldGadget (IEntity gadget) |
Update currently held(in hand) gadget. | |
void | ClearToggleState () |
Clear toggle state for cases where it needs to be done without waiting for animation. | |
void | OnGadgetInput (float value, EActionTrigger reason) |
Input action callback. | |
void | ActionFlashlightToggle (float value, EActionTrigger reason) |
Explicit flashlight toggle action. | |
void | OnPauseMenu () |
Input action callback. | |
void | OnGadgetADS () |
Input action callback. | |
void | OnGadgetADSHold (float value, EActionTrigger reason) |
Input action callback. | |
void | RegisterInitialGadgets (IEntity character) |
Gather initial gadgets. | |
void | RegisterVONEntries () |
Register radio gadgets into the VON system as entries. | |
void | UnregisterVONEntries () |
void | RegisterInputs () |
Register input actions. | |
void | UnregisterInputs () |
Register input actions. | |
EGadgetType | GetGadgetInputAction () |
Convert invoked input to gadget type. | |
void | InitComponent (IEntity owner) |
Initialise component. | |
void | RPC_AskToggleGadget (RplId id, bool state) |
Ask RPC to server for gadget toggle. | |
void | RPC_DoToggleGadget (RplId id, bool state) |
Do RPC to clients for gadget toggle. | |
void | ConnectToGadgetsManagerSystem () |
void | DisconnectFromGadgetsManagerSystem () |
Protected Member Functions inherited from ScriptGameComponent | |
bool | OnTicksOnRemoteProxy () |
Protected Attributes | |
bool | m_bIsGadgetADS |
IEntity | m_HeldGadget |
SCR_GadgetComponent | m_HeldGadgetComponent |
SCR_GadgetComponent | m_HiddenGadgetComponent |
InputManager | m_InputManager |
SCR_InventoryStorageManagerComponent | m_InventoryStorageMgr |
SCR_CharacterControllerComponent | m_Controller |
SCR_VONController | m_VONController |
ref SCR_GadgetInvokersInitState | m_pInvokersState = new SCR_GadgetInvokersInitState(this) |
ref array< ref array< SCR_GadgetComponent > > | m_aInventoryGadgetTypes = {} |
ref map< EGadgetType, int > | m_aGadgetArrayMap = new map<EGadgetType, int> |
SCR_GadgetComponent | m_LastHeldGadgetComponent |
Static Protected Attributes | |
static ref ScriptInvoker< IEntity, SCR_GadgetManagerComponent > | s_OnGadgetInitDone = new ScriptInvoker() |
|
protected |
Explicit flashlight toggle action.
[in] | value | |
[in] | reason |
void SCR_GadgetManagerComponent.AskToggleGadget | ( | SCR_GadgetComponent | gadgetComp, |
bool | state | ||
) |
Ask method for toggle synchronization called from individual gadgets.
[in] | gadgetComp | is gadget component |
[in] | state | is desired toggle state, true: active |
void SCR_GadgetManagerComponent.CancelADSInput | ( | ) |
Cancel weapon and turret ADS input state.
|
protected |
Rules for gadget mode change.
[in] | gadget | is the subject |
[in] | gadgetComp | is the subjects gadget component |
[in] | targetMode | is the wanted mode |
|
protected |
Clear toggle state for cases where it needs to be done without waiting for animation.
|
protected |
|
protected |
IEntity SCR_GadgetManagerComponent.GetGadgetByType | ( | EGadgetType | type | ) |
Get first owned gadget by type.
[in] | type | is the type of gadget being searched |
|
protected |
Convert invoked input to gadget type.
|
static |
Get gadget manager of entity.
array< SCR_GadgetComponent > SCR_GadgetManagerComponent.GetGadgetsByType | ( | EGadgetType | type | ) |
Get all owned gadgets by type
[in] | type | is the type of gadget being searched |
IEntity SCR_GadgetManagerComponent.GetHeldGadget | ( | ) |
Get held (currently in hand) gadget.
SCR_GadgetComponent SCR_GadgetManagerComponent.GetHeldGadgetComponent | ( | ) |
Get held (currently in hand) gadget component.
bool SCR_GadgetManagerComponent.GetIsGadgetADS | ( | ) |
Get is player in gadget ADS.
|
static |
IEntity SCR_GadgetManagerComponent.GetQuickslotGadgetByType | ( | EGadgetType | type | ) |
Get first owned gadget assigned in quickslot by type.
[in] | type | is the type of gadget being searched |
void SCR_GadgetManagerComponent.HandleInput | ( | IEntity | gadget, |
float | inputVal | ||
) |
Additonal pre SetGadgetMode logic for local player, modfying the behavior based on input used & current held gadget state.
[in] | gadget | is the subject |
[in] | inputVal | determines type of input we want to execute, click/hold version |
|
protected |
Initialise component.
[in] | owner | the owner entity |
bool SCR_GadgetManagerComponent.IsGadgetOwned | ( | SCR_GadgetComponent | gadgetComp | ) |
Check whether gadget is owned by this entity.
[in] | gadgetComp |
|
protected |
Activate held gadget.
void SCR_GadgetManagerComponent.OnControlledByPlayer | ( | IEntity | owner, |
bool | controlled | ||
) |
SCR_CharacterControllerComponent event.
[in] | owner | |
[in] | controlled |
override void SCR_GadgetManagerComponent.OnDelete | ( | IEntity | owner | ) |
void SCR_GadgetManagerComponent.OnEditorOpened | ( | ) |
SCR_EditorManagerEntity event //TODO we shouldnt need this, probably needs to be dependent on camera instead.
|
protected |
Input action callback.
|
protected |
Input action callback.
[in] | value | |
[in] | reason |
void SCR_GadgetManagerComponent.OnGadgetFocusStateChanged | ( | IEntity | gadget, |
bool | isFocused | ||
) |
CharacterControllerComponent event, used only for local character.
[in] | gadget | |
[in] | isFocused |
|
protected |
Input action callback.
[in] | value | |
[in] | reason |
void SCR_GadgetManagerComponent.OnGadgetStateChanged | ( | IEntity | gadget, |
bool | isInHand, | ||
bool | isOnGround | ||
) |
CharacterControllerComponent event.
[in] | gadget | |
[in] | isInHand | |
[in] | isOnGround |
void SCR_GadgetManagerComponent.OnItemAdded | ( | IEntity | item, |
BaseInventoryStorageComponent | storageOwner | ||
) |
SCR_InventoryStorageManagerComponent, called on every add to slot, not only to inventory.
[in] | item | |
[in] | storageOwner |
void SCR_GadgetManagerComponent.OnItemRemoved | ( | IEntity | item, |
BaseInventoryStorageComponent | storageOwner | ||
) |
SCR_InventoryStorageManagerComponent, called on every remove from slot, not only from inventory.
[in] | item | |
[in] | storageOwner |
|
protected |
Input action callback.
void SCR_GadgetManagerComponent.OnPlayerDeath | ( | SCR_CharacterControllerComponent | charController, |
IEntity | instigatorEntity, | ||
notnull Instigator | instigator | ||
) |
SCR_CharacterControllerComponent event.
[in] | charController | |
[in] | instigatorEntity | |
[in] | instigator |
override void SCR_GadgetManagerComponent.OnPostInit | ( | IEntity | owner | ) |
|
protected |
Gather initial gadgets.
[in] | character | is the query target |
|
protected |
Register input actions.
|
protected |
Register radio gadgets into the VON system as entries.
void SCR_GadgetManagerComponent.RemoveHeldGadget | ( | ) |
Remove gadget held in hand.
|
protected |
Ask RPC to server for gadget toggle.
[in] | id | is unique Rpl id of the gadget |
[in] | state | is desired toggle state, true: active |
|
protected |
Do RPC to clients for gadget toggle.
[in] | id | is unique Rpl id of the gadget |
[in] | state | is desired toggle state, true: active |
void SCR_GadgetManagerComponent.SetGadgetADS | ( | bool | gadgetADS | ) |
API for setting raised gadget mode.
[in] | gadgetADS |
void SCR_GadgetManagerComponent.SetGadgetMode | ( | IEntity | gadget, |
EGadgetMode | targetMode, | ||
bool | doFocus = false |
||
) |
Set mode of a gadget When changing mode FROM EGadgetMode.IN_HAND to inventory, target should be EGadgetMode.IN_STORAGE -> it will do EGadgetMode.IN_SLOT automatically if it is slotted.
[in] | gadget | is the subject |
[in] | targetMode | is the mode being switched into |
[in] | doFocus | determines whether the gadget will becomes focused straight away |
|
static |
Static method for setting gadgets to ground/storage modes for containers such as vehicles which do not have gadget manager.
[in] | gadgetComp | is the subject component |
[in] | targetMode | is the mode being switched into |
void SCR_GadgetManagerComponent.ToggleHeldGadget | ( | bool | state | ) |
Toggle held gadget on/off.
[in] | state | true = ON / false = OFF |
|
protected |
Register input actions.
|
protected |
void SCR_GadgetManagerComponent.Update | ( | float | timeSlice | ) |
Runs only on local client.
[in] | timeSlice |
|
protected |
Update currently held(in hand) gadget.
[in] | gadget | is the subject |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
int SCR_GadgetManagerComponent.m_iRadiosFlags = EGadgetType.RADIO | EGadgetType.RADIO_BACKPACK |
|
protected |
ref ScriptInvoker<SCR_GadgetComponent> SCR_GadgetManagerComponent.m_OnGadgetAdded = new ScriptInvoker() |
ref ScriptInvoker<SCR_GadgetComponent> SCR_GadgetManagerComponent.m_OnGadgetRemoved = new ScriptInvoker() |
|
protected |
|
protected |
|
staticprotected |