Arma Reforger Script API
|
Main game instance. More...
Public Member Functions | |
void | ~ArmaReforgerScripted () |
IEntity | SpawnEntityPrefabEx (ResourceName prefab, bool randomizeEditableVariant, BaseWorld world=null, EntitySpawnParams params=null) |
Spawn entity or potential entity variant. | |
SCR_DataCollectorComponent | GetDataCollector () |
SCR_ResourceGrid | GetResourceGrid () |
SCR_ResourceSystemSubscriptionManager | GetResourceSystemSubscriptionManager () |
void | RegisterDataCollector (SCR_DataCollectorComponent instance) |
void | UnregisterBuildingDestructionManager (notnull SCR_BuildingDestructionManagerComponent manager) |
void | RegisterBuildingDestructionManager (notnull SCR_BuildingDestructionManagerComponent manager) |
SCR_BuildingDestructionManagerComponent | GetBuildingDestructionManager () |
SCR_LoadoutManager | GetLoadoutManager () |
Returns currently registered SCR_LoadoutManager if any is present. | |
void | RegisterSoundManagerEntity (SCR_SoundManagerEntity instance) |
SCR_SoundManagerEntity | GetSoundManagerEntity () |
SCR_SettingsManager | GetSettingsManager () |
SCR_ProfaneFilter | GetProfanityFilter () |
SCR_SaveManagerCore | GetSaveManager () |
bool | GetHasKeyboard () |
ScriptCallQueue | GetCallqueue () |
ScriptInvoker | OnUserSettingsChangedInvoker () |
ScriptInvoker | OnInputDeviceUserChangedInvoker () |
ScriptInvoker | OnInputDeviceIsGamepadInvoker () |
ScriptInvoker | OnWorldSimulatePhysicsInvoker () |
ScriptInvoker | OnWindowResizeInvoker () |
override void | OnCinematicStart () |
override void | OnCinematicEnd () |
override void | OnCinematicBlending (float blendFactor, vector cameraPosition) |
bool | GetFullKickReason (KickCauseCode kickCode, out KickCauseGroup2 groupInt, out int reasonInt, out string group, out string reason) |
Convert KickCauseCode into proper kick reason variables. | |
bool | GetGameStarted () |
EGameFlags | GetGameFlags () |
void | SetGameFlags (EGameFlags newGameFlags, bool shouldInvoke) |
bool | AreGameFlagsObtained () |
You should normally register to GetOnObtainedGameFlagsInvoker() but this is available for cases where registration is not possible. | |
bool | AreGameFlagsSet (EGameFlags checkGameFlags) |
Can check for multiple bits at the same time. | |
ScriptInvoker | GetOnObtainedGameFlagsInvoker () |
override TypeName | GetMenuPreset () |
Important for menu manager to work. | |
override LoadingAnim | CreateLoadingAnim (WorkspaceWidget workspaceWidget) |
override void | OnAfterInit (BaseWorld world) |
Called after full initialization of Game instance. | |
override bool | OnGameStart () |
override void | OnGameEnd () |
override void | OnUserSettingsChangedEvent () |
override void | OnInputDeviceUserChangedEvent (EInputDeviceType oldDevice, EInputDeviceType newDevice) |
Event which is called when input device binded to user changed. | |
override void | OnInputDeviceIsGamepadEvent (bool isGamepad) |
override void | OnWorldSimulatePhysics (float timeSlice) |
override void | OnWindowResize (int w, int h, bool windowed) |
void | AddActionListeners () |
void | RemoveActionListeners () |
override void | OnUpdate (BaseWorld world, float timeslice) |
void | ShutdownBackend () |
void | SetHUDManager (SCR_HUDManagerComponent hud) |
void | LoadSave (string fileName) |
void | RegisterLoadoutManager (SCR_LoadoutManager instance) |
Registers provided loadout manager as the one used by the game. | |
void | UnregisterLoadoutManager (SCR_LoadoutManager instance) |
Unregisters provided loadout manager. | |
SCR_HUDManagerComponent | GetHUDManager () |
override string | GetMissionName () |
Called when DS downloads required addons and is ready to run a world FIXME: I'm not named properly! | |
override void | PlayGameConfig (ResourceName sResource, string addonsList) |
override void | HostGameConfig () |
override Managed | ReadGameConfig (string sResource) |
override array< ResourceName > | GetDefaultGameConfigs () |
Get a list of all missions, featured, tutorial, recommended ones. | |
bool | IsPlatformGameConsole () |
override void | OnGamepadConnectionStatus (bool isConnected) |
Open gamepad disconnected warning dialog. | |
override void | OnUserSignedOut () |
Called whenever user is signed out while being in main menu game state. | |
Public Member Functions inherited from ChimeraGame | |
proto external bool | IsExperimentalBuild () |
Is the game experimental build. | |
proto external ScriptWorldClock | GetClock () |
Returns the world clock. | |
proto external GameSignalsManager | GetSignalsManager () |
returns the global signals manager | |
proto external PlayerController | GetPlayerController () |
returns entity holding info about player | |
proto external PlayerManager | GetPlayerManager () |
PlayerManager holding info about players who joined MP. It always returns a valid instance. | |
proto external PerceptionManager | GetPerceptionManager () |
proto external FactionManager | GetFactionManager () |
returns entity holding info about factions | |
proto external BaseChatEntity | GetChat () |
Returns the chat entity. | |
proto external CameraManager | GetCameraManager () |
Returns the camera manager. | |
proto external BaseGameMode | GetGameMode () |
Returns the game mode. | |
proto external MapEntity | GetMapManager () |
Returns the map manager entity. | |
proto external void | SetViewDistance (float viewDistance) |
Sets view distance in meters (far clipping plane of cameras) | |
proto external float | GetViewDistance () |
Returns view distance in meters (far clipping plane of cameras) | |
proto external float | GetMaximumViewDistance () |
Returns absolute maximum view distance per platform as defined by global chimera settings. | |
proto external float | GetMinimumViewDistance () |
Returns absolute minimum view distance per platform as defined by global chimera settings. | |
proto external void | SetGrassDistance (int grassDistance) |
Sets grass distance in meters. | |
proto external int | GetGrassDistance () |
Returns grass distance in meters. | |
proto external int | GetMaximumGrassDistance () |
Returns absolute maximum grass distance. | |
proto external int | GetMinimumGrassDistance () |
Returns absolute minimum grass distance. | |
proto external float | GetViewDistanceServerLimit () |
Returns the maximum view distance set by server (never relevant to client) set via ServerConfig. | |
proto external bool | IsVONUIDisabledByServer () |
Returns true if the VON UI is disabled by the server. | |
proto external bool | IsVONDirectSpeechUIDisabledByServer () |
Returns true if the VON direct speech UI is disabled by the server. | |
proto external bool | GetVONCanTransmitCrossFaction () |
Returns true if the VONCanTransmitCrossFaction is enabled by the server. | |
proto external MissionHeader | GetMissionHeader () |
Returns currently active mission or null if none. | |
proto external AIWorld | GetAIWorld () |
Returns the AI World. | |
proto external GameStatsApi | GetStatsApi () |
Returns analytics Api. | |
proto external ServerInfo | GetServerInfo () |
Returns game ServerInfo or null if not available. | |
proto external bool | IsCrossPlayEnabled () |
Tells if the cross-play is enabled based on curent platform and user settings. | |
proto external bool | SetCrossPlay (bool enabled) |
Sets the cross-play option with respect to the platform specific requirements. | |
proto external void | LogFPS (int msec) |
Enable or disable the logging of FPS. | |
proto external IEntity | SpawnEntityPrefabLocal (notnull Resource templateResource, BaseWorld world=null, EntitySpawnParams params=null) |
Spawns a prefab which will exist only on local machine. | |
void | OnCrossPlayChanged () |
void | OnUserSignedOut () |
Called whenever user is signed out while being in main menu game state. | |
void | OnCinematicStart () |
void | OnCinematicEnd () |
void | OnCinematicBlending (float blendFactor, vector cameraPosition) |
Static Public Member Functions | |
static void | OnShowPlayerList () |
static void | OnShowGroupMenu () |
static void | OpenPauseMenu (bool hideParentMenu=true, bool fadeBackground=false) |
static SCR_PlayerListMenu | OpenPlayerList () |
static SCR_GroupMenu | OpenGroupMenu () |
static SCR_2DPIPSightsComponent | GetCurrentPIPSights () |
static bool | IsScreenPointInPIPSights (vector screenPosition, SCR_2DPIPSightsComponent sightsComponent) |
Returns whether screen position is in located within the sights radius. | |
Static Public Member Functions inherited from ChimeraGame | |
static proto bool | CanSpawnEntityPrefab (notnull Resource templateResource, EntitySpawnParams params=null) |
Checks is a prefab can be spawned localy. | |
Public Attributes | |
ref ScriptInvoker | m_OnMissionSetInvoker = new ScriptInvoker() |
ref RplSessionErrorHandler | m_SessionErrorHandler |
bool | m_bIsMainMenuOpen = false |
Static Public Attributes | |
const string | CONFIG_CORES_PATH = "Configs/Core/" |
Protected Member Functions | |
override void | OnMissionSet (MissionHeader mission) |
Called when a mission header is set (to both a valid one or to null as well) | |
override void | OnKickedFromGame (KickCauseCode kickCode) |
Called after player was kicked from game back to main menu, providing reason for the kick. | |
void | AddRejoinAttempt () |
override void | OnWorldPostProcess (World world) |
override void | ShowErrorMessage (string msg) |
Push an error message to the error message stack. | |
void | ShowNextErrorDialog () |
If no error dialogue is currently shown try to pop it from the error stack and display it as an error dialogue. | |
void | InvokeGameFlags () |
override ref Managed | GetPlayerDataStats (int playerID) |
Called when the player data is requested. | |
void | InsertNewScenario (ResourceName scenario, inout array< ResourceName > resources) |
Check that scenario isn't in list when adding new scenario. | |
void | OnMissionSet (MissionHeader mission) |
Called when a mission header is set (to both a valid one or to null as well) | |
void | OnKickedFromGame (KickCauseCode kickCode) |
Called after player was kicked from game back to main menu, providing reason for the kick. | |
void | ShowErrorMessage (string msg) |
Shows dialog with a provided string. | |
ref Managed | GetPlayerDataStats (int playerID) |
Called when the player data is requested. | |
string | GetMissionName () |
Called when DS downloads required addons and is ready to run a world FIXME: I'm not named properly! | |
Static Protected Member Functions | |
static void | OnMenuOpen () |
static bool | CheckMissionHeader (MissionWorkshopItem mission) |
Protected Attributes | |
EGameFlags | m_eGameFlags |
Game Flags specific for current game mode, or for the game mode which is going to be played when it is a host/server side. | |
bool | m_bAreGameFlagsObtained |
ref ScriptInvoker | Event_OnObtainedGameFlags = new ScriptInvoker() |
SCR_HUDManagerComponent | m_HUDManager |
ScriptedChatEntity | m_ChatEntity |
ref SCR_GameCoresManager | m_CoresManager |
ref SCR_SettingsManager | m_SettingsManager |
ref SCR_ProfaneFilter | m_ProfanityFilter |
SCR_SaveManagerCore | m_SaveManagerCore |
SCR_BuildingDestructionManagerComponent | m_BuildingDestructionManager |
SCR_SpawnerAIGroupManagerComponent | m_SpawnerAIGroupManager |
bool | m_bHasKeyboard |
SCR_LoadoutManager | m_pLoadoutManager |
Object responsible for managing and providing game modes with list of available loadouts. | |
SCR_DataCollectorComponent | m_DataCollectorComponent |
Object responsible for tracking and connecting to the database for Career Profile. | |
SCR_SoundManagerEntity | m_SoundManagerEntity |
Object responsible for managing sounds trigged in script. | |
ref SCR_Stack< SCR_GameErrorMessage > | m_aErrorStack = new SCR_Stack<SCR_GameErrorMessage>() |
Stack of queued error messages. All messages are popped one by one as user closes them and only in the main menu. | |
ref ScriptInvoker | m_OnChangeUserSettingsInvoker = new ScriptInvoker() |
ref ScriptInvoker | m_OnInputDeviceUserChangedInvoker = new ScriptInvoker() |
ref ScriptInvoker | m_OnInputDeviceIsGamepadInvoker = new ScriptInvoker() |
ref ScriptInvoker | m_OnWorldSimulatePhysicsInvoker = new ScriptInvoker() |
ref ScriptInvoker< int, int, bool > | m_OnWindowResizeInvoker = new ScriptInvoker() |
ref ScriptCallQueue | m_Callqueue = new ScriptCallQueue() |
ref SCR_ResourceGrid | m_ResourceGrid |
ref SCR_ResourceSystemSubscriptionManager | m_ResourceSystemSubscriptionManager |
Main game instance.
Created when the game starts (not when a world starts!) and persists until the game is closed.
void ArmaReforgerScripted.~ArmaReforgerScripted | ( | ) |
void ArmaReforgerScripted.AddActionListeners | ( | ) |
|
protected |
bool ArmaReforgerScripted.AreGameFlagsObtained | ( | ) |
You should normally register to GetOnObtainedGameFlagsInvoker() but this is available for cases where registration is not possible.
bool ArmaReforgerScripted.AreGameFlagsSet | ( | EGameFlags | checkGameFlags | ) |
Can check for multiple bits at the same time.
[in] | checkGameFlags |
|
staticprotected |
[in] | mission | cannot be null |
override LoadingAnim ArmaReforgerScripted.CreateLoadingAnim | ( | WorkspaceWidget | workspaceWidget | ) |
SCR_BuildingDestructionManagerComponent ArmaReforgerScripted.GetBuildingDestructionManager | ( | ) |
ScriptCallQueue ArmaReforgerScripted.GetCallqueue | ( | ) |
|
static |
SCR_DataCollectorComponent ArmaReforgerScripted.GetDataCollector | ( | ) |
override array< ResourceName > ArmaReforgerScripted.GetDefaultGameConfigs | ( | ) |
Get a list of all missions, featured, tutorial, recommended ones.
bool ArmaReforgerScripted.GetFullKickReason | ( | KickCauseCode | kickCode, |
out KickCauseGroup2 | groupInt, | ||
out int | reasonInt, | ||
out string | group, | ||
out string | reason | ||
) |
Convert KickCauseCode into proper kick reason variables.
[in] | kickCode | Kick code to convert |
[out] | groupInt | |
[out] | reasonInt | |
[out] | group | |
[out] | reason |
EGameFlags ArmaReforgerScripted.GetGameFlags | ( | ) |
bool ArmaReforgerScripted.GetGameStarted | ( | ) |
bool ArmaReforgerScripted.GetHasKeyboard | ( | ) |
SCR_HUDManagerComponent ArmaReforgerScripted.GetHUDManager | ( | ) |
SCR_LoadoutManager ArmaReforgerScripted.GetLoadoutManager | ( | ) |
Returns currently registered SCR_LoadoutManager if any is present.
override TypeName ArmaReforgerScripted.GetMenuPreset | ( | ) |
Important for menu manager to work.
Specify presets in ChimeraMenuPreset enum and add them in chimeraMenus.conf configuration file.
override string ArmaReforgerScripted.GetMissionName | ( | ) |
Called when DS downloads required addons and is ready to run a world FIXME: I'm not named properly!
Implements ChimeraGame.
ScriptInvoker ArmaReforgerScripted.GetOnObtainedGameFlagsInvoker | ( | ) |
|
protected |
Called when the player data is requested.
Implements ChimeraGame.
SCR_ProfaneFilter ArmaReforgerScripted.GetProfanityFilter | ( | ) |
SCR_ResourceGrid ArmaReforgerScripted.GetResourceGrid | ( | ) |
SCR_ResourceSystemSubscriptionManager ArmaReforgerScripted.GetResourceSystemSubscriptionManager | ( | ) |
SCR_SaveManagerCore ArmaReforgerScripted.GetSaveManager | ( | ) |
SCR_SettingsManager ArmaReforgerScripted.GetSettingsManager | ( | ) |
SCR_SoundManagerEntity ArmaReforgerScripted.GetSoundManagerEntity | ( | ) |
override void ArmaReforgerScripted.HostGameConfig | ( | ) |
|
protected |
Check that scenario isn't in list when adding new scenario.
[in] | scenario | |
[in,out] | resources |
|
protected |
bool ArmaReforgerScripted.IsPlatformGameConsole | ( | ) |
|
static |
Returns whether screen position is in located within the sights radius.
[in] | screenPosition | Point on screen |
[in] | sightsComponent | Picture in picture sights to use as reference |
void ArmaReforgerScripted.LoadSave | ( | string | fileName | ) |
[in] | fileName |
override void ArmaReforgerScripted.OnAfterInit | ( | BaseWorld | world | ) |
Called after full initialization of Game instance.
[in] | world |
override void ArmaReforgerScripted.OnCinematicBlending | ( | float | blendFactor, |
vector | cameraPosition | ||
) |
Implements ChimeraGame.
override void ArmaReforgerScripted.OnCinematicEnd | ( | ) |
Implements ChimeraGame.
override void ArmaReforgerScripted.OnCinematicStart | ( | ) |
Implements ChimeraGame.
override void ArmaReforgerScripted.OnGameEnd | ( | ) |
override void ArmaReforgerScripted.OnGamepadConnectionStatus | ( | bool | isConnected | ) |
Open gamepad disconnected warning dialog.
[in] | isConnected | is false on disconnection, true on re-connection. |
override bool ArmaReforgerScripted.OnGameStart | ( | ) |
override void ArmaReforgerScripted.OnInputDeviceIsGamepadEvent | ( | bool | isGamepad | ) |
ScriptInvoker ArmaReforgerScripted.OnInputDeviceIsGamepadInvoker | ( | ) |
override void ArmaReforgerScripted.OnInputDeviceUserChangedEvent | ( | EInputDeviceType | oldDevice, |
EInputDeviceType | newDevice | ||
) |
Event which is called when input device binded to user changed.
[in] | oldDevice | |
[in] | newDevice |
ScriptInvoker ArmaReforgerScripted.OnInputDeviceUserChangedInvoker | ( | ) |
|
protected |
Called after player was kicked from game back to main menu, providing reason for the kick.
Implements ChimeraGame.
|
staticprotected |
|
protected |
Called when a mission header is set (to both a valid one or to null as well)
mission | can be passed in as null when mission is cleared, make sure to nullptr check! |
Implements ChimeraGame.
|
static |
|
static |
override void ArmaReforgerScripted.OnUpdate | ( | BaseWorld | world, |
float | timeslice | ||
) |
override void ArmaReforgerScripted.OnUserSettingsChangedEvent | ( | ) |
ScriptInvoker ArmaReforgerScripted.OnUserSettingsChangedInvoker | ( | ) |
override void ArmaReforgerScripted.OnUserSignedOut | ( | ) |
Called whenever user is signed out while being in main menu game state.
Implements ChimeraGame.
override void ArmaReforgerScripted.OnWindowResize | ( | int | w, |
int | h, | ||
bool | windowed | ||
) |
ScriptInvoker ArmaReforgerScripted.OnWindowResizeInvoker | ( | ) |
|
protected |
override void ArmaReforgerScripted.OnWorldSimulatePhysics | ( | float | timeSlice | ) |
ScriptInvoker ArmaReforgerScripted.OnWorldSimulatePhysicsInvoker | ( | ) |
|
static |
|
static |
[in] | hideParentMenu | |
[in] | fadeBackground |
|
static |
override void ArmaReforgerScripted.PlayGameConfig | ( | ResourceName | sResource, |
string | addonsList | ||
) |
override Managed ArmaReforgerScripted.ReadGameConfig | ( | string | sResource | ) |
[in] | sResource |
void ArmaReforgerScripted.RegisterBuildingDestructionManager | ( | notnull SCR_BuildingDestructionManagerComponent | manager | ) |
[in] | manager |
void ArmaReforgerScripted.RegisterDataCollector | ( | SCR_DataCollectorComponent | instance | ) |
[in] | instance |
void ArmaReforgerScripted.RegisterLoadoutManager | ( | SCR_LoadoutManager | instance | ) |
Registers provided loadout manager as the one used by the game.
Multiple registrations are not supported and will log an error.
[in] | instance | Instance to register. |
void ArmaReforgerScripted.RegisterSoundManagerEntity | ( | SCR_SoundManagerEntity | instance | ) |
[in] | instance |
void ArmaReforgerScripted.RemoveActionListeners | ( | ) |
void ArmaReforgerScripted.SetGameFlags | ( | EGameFlags | newGameFlags, |
bool | shouldInvoke | ||
) |
[in] | newGameFlags | |
[in] | shouldInvoke |
void ArmaReforgerScripted.SetHUDManager | ( | SCR_HUDManagerComponent | hud | ) |
[in] | hud |
|
protected |
|
protected |
If no error dialogue is currently shown try to pop it from the error stack and display it as an error dialogue.
void ArmaReforgerScripted.ShutdownBackend | ( | ) |
IEntity ArmaReforgerScripted.SpawnEntityPrefabEx | ( | ResourceName | prefab, |
bool | randomizeEditableVariant, | ||
BaseWorld | world = null , |
||
EntitySpawnParams | params = null |
||
) |
Spawn entity or potential entity variant.
[in] | prefab | Entity prefab to spawn |
[in] | randomizeEditableVariant | If true and the entity has the SCR_EditableEntityComponent, then it will try and get a random variant if it has any assigned (More performance heavy) |
[in] | world | |
[in] | params | Entity spawn params |
void ArmaReforgerScripted.UnregisterBuildingDestructionManager | ( | notnull SCR_BuildingDestructionManagerComponent | manager | ) |
[in] | manager |
void ArmaReforgerScripted.UnregisterLoadoutManager | ( | SCR_LoadoutManager | instance | ) |
Unregisters provided loadout manager.
Wrong unregistrations will log an error.
[in] | instance | Instance to unregister. |
|
static |
|
protected |
|
protected |
Stack of queued error messages. All messages are popped one by one as user closes them and only in the main menu.
|
protected |
|
protected |
bool ArmaReforgerScripted.m_bIsMainMenuOpen = false |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Object responsible for tracking and connecting to the database for Career Profile.
|
protected |
Game Flags specific for current game mode, or for the game mode which is going to be played when it is a host/server side.
|
protected |
|
protected |
|
protected |
|
protected |
ref ScriptInvoker ArmaReforgerScripted.m_OnMissionSetInvoker = new ScriptInvoker() |
|
protected |
|
protected |
|
protected |
Object responsible for managing and providing game modes with list of available loadouts.
|
protected |
|
protected |
|
protected |
|
protected |
ref RplSessionErrorHandler ArmaReforgerScripted.m_SessionErrorHandler |
|
protected |
|
protected |
Object responsible for managing sounds trigged in script.
|
protected |