DayZ Enforce
Script API
Private Types | Private Member Functions | Private Attributes | List of all members
CGame Class Reference

#include <gameplay.h>

Inheritance diagram for CGame:
DayZGame

Private Types

enum   HiveEventPriority { EVENT_PRIORITY_ERROR, EVENT_PRIORITY_WARNING, EVENT_PRIORITY_INFO }
 

Private Member Functions

void  CGame ()
 
void  OnEvent (EventType eventTypeId, Param params)
  Called when some system event occur. More...
 
void  OnAfterCreate ()
  Called after creating of CGame instance. More...
 
void  OnUpdate (bool doSim, float timeslice)
  Called on World update. More...
 
void  OnKeyPress (int key)
  Called when key is pressed. More...
 
void  OnKeyRelease (int key)
  Called when key is released. More...
 
void  OnMouseButtonPress (int button)
  Called when mouse button is pressed. More...
 
void  OnMouseButtonRelease (int button)
  Called when mouse button is released. More...
 
UIScriptedMenu  CreateScriptedMenu (int id)
  create custom main menu part (submenu) More...
 
void  OnRPC (Object target, int rpc_type, ParamsReadContext ctx)
  Called after remote procedure call is recieved for this object. More...
 
proto void  RequestExit (int code)
  Sets exit code and quits in the right moment. More...
 
proto void  RequestRestart (int code)
  Sets exit code and restart in the right moment. More...
 
proto int  ConnectLastSession (UIScriptedMenu parent)
  Connects to last success network session. More...
 
proto void  DisconnectSession ()
  Disconnects from current multiplayer session. More...
 
proto void  GetProfileStringList (string name, out TStringArray values)
  Gets array of strings from profile variable. More...
 
proto bool  GetProfileString (string name, out string value)
  Gets string from profile variable. More...
 
proto void  SetProfileStringList (string name, TStringArray values)
  Sets array of strings to profile variable. More...
 
proto void  SetProfileString (string name, string value)
  Sets string to profile variable. More...
 
proto void  SaveProfile ()
  Saves profile on disk. More...
 
proto void  GetPlayerName (out string name)
  Gets current player name. More...
 
proto void  SetPlayerName (string name)
  Sets current player name. More...
 
proto bool  ConfigGetText (string path, out string value)
  Get string value from config on path. More...
 
string  ConfigGetTextOut (string path)
  Get string value from config on path. More...
 
proto float  ConfigGetFloat (string path)
  Get float value from config on path. More...
 
proto vector  ConfigGetVector (string path)
  Get vector value from config on path. More...
 
proto int  ConfigGetInt (string path)
  Get int value from config on path. More...
 
proto int  ConfigGetType (string path)
  Returns type of config value. More...
 
proto void  ConfigGetTextArray (string path, out TStringArray values)
  Get array of strings from config on path. More...
 
proto void  ConfigGetFloatArray (string path, out TFloatArray values)
  Get array of floats from config on path. More...
 
proto void  ConfigGetIntArray (string path, out TIntArray values)
  Get array of integers from config on path. More...
 
proto bool  ConfigGetChildName (string path, int index, out string name)
  Get name of subclass in config class on path. More...
 
proto bool  ConfigGetBaseName (string path, out string base_name)
  Get name of base class of config class on path. More...
 
proto int  ConfigGetChildrenCount (string path)
  Get count of subclasses in config class on path. More...
 
proto bool  ConfigIsExisting (string path)
 
proto void  ConfigGetFullPath (string path, out TStringArray full_path)
 
proto void  ConfigGetObjectFullPath (Object obj, out TStringArray full_path)
 
string  ConfigPathToString (TStringArray array_path)
  Converts array of strings into single string. More...
 
proto bool  CommandlineGetParam (string name, out string value)
  Get command line parameter value. More...
 
proto void  CopyToClipboard (string text)
 
proto void  CopyFromClipboard (out string text)
 
proto void  BeginOptionsVideo ()
 
proto void  EndOptionsVideo ()
 
proto bool  PreloadObject (string type, float distance)
  Preload objects with certain type in certain distance from camera. More...
 
proto Object  CreateObject (string type, vector pos, bool create_local=false, bool init_ai=false)
  Creates object of certain type. More...
 
proto SoundOnVehicle  CreateSoundOnObject (Object source, string sound_name, float distance, bool looped)
 
proto void  ObjectDelete (Object obj)
 
proto int  ObjectRelease (Object obj)
 
proto void  ObjectGetType (Object obj, out string type)
 
proto void  ObjectGetDisplayName (Object obj, out string name)
 
proto void  ObjectSetAnimationPhase (Entity obj, string animation, float phase)
 
proto float  ObjectGetAnimationPhase (Entity obj, string animation)
 
proto vector  ObjectGetSelectionPosition (Object obj, string name)
 
proto vector  ObjectModelToWorld (Object obj, vector modelPos)
 
proto vector  ObjectWorldToModel (Object obj, vector worldPos)
 
proto bool  IsObjectAccesible (EntityAI item, Man player)
  returns true if player can access item's cargo/attachments (check only distance) More...
 
proto bool  IsInventoryTreeLocked (EntityAI item, EntityAI player)
  returns true if player can access item's cargo/attachments (check only inventory conditions) More...
 
proto Input  GetInput ()
 
proto void  ExecuteSQF (string expression)
  Executes SQF expression, if there is an error, is printed into the script console. More...
 
proto bool  ExecuteEnforceScript (string expression, string mainFnName)
  Executes Enforce Script expression, if there is an error, is printed into the script console. More...
 
proto bool  ScriptTest ()
 
proto void  GetDiagModeNames (out TStringArray diag_names)
  Get list of all debug modes. More...
 
proto void  SetDiagModeEnable (int diag_mode, bool enabled)
  Set specific debug mode. More...
 
proto bool  GetDiagModeEnable (int diag_mode)
  Gets state of specific debug mode. More...
 
proto void  GetDiagDrawModeNames (out TStringArray diag_names)
  Get list of all debug draw modes. More...
 
proto void  SetDiagDrawMode (int diag_draw_mode)
  Set debug draw mode. More...
 
proto int  GetDiagDrawMode ()
  Gets current debug draw mode. More...
 
proto void  GetInventoryItemSize (InventoryItem item, out int width, out int height)
 
proto void  GetObjectsAtPosition (vector pos, float radius, Man inPlayerSight, out array< Object > objects, out array< Cargo > proxyCargos)
  Returns list of all objects in radius "radius" around position "pos". More...
 
proto World  GetWorld ()
 
proto void  GetWorldName (out string world_name)
 
proto vector  SnapToGround (vector pos)
 
proto void  FormatString (string format, string params[], out string output)
 
proto void  HtmlToPlain (string text)
 
proto void  GetVersion (out string version)
 
proto UIManager  GetUIManager ()
 
proto Man  GetPlayer ()
 
proto void  GetPlayers (out array< Man > players)
 
EntityScriptedActivity  CreateActivity (Object target, Man man, int activity_type)
 
proto void  PerformAction (Man player, Action action)
 
proto void  GetActionMenuActions (out TActionRefArray actions)
 
proto void  UpdateActionMenuActions ()
  Updates action menu items, call UpdateCursorTarget prior this to update aiming target. More...
 
proto void  UpdateCursorTarget ()
  Updates target of player aiming. More...
 
proto vector  GetCursorPos ()
  Returns world position where player aims, call UpdateCursorTarget to refresh this data. More...
 
proto Object  GetCursorObject ()
  Returns object on which player aims, call UpdateCursorTarget to refresh this data. More...
 
proto void  GetCursorObjectComponentName (out string component_name)
  Returns name of component/selection on which player aims, call UpdateCursorTarget to refresh this data. The object must have View Geometry or Fire Geometry. View Geometry has priority. More...
 
proto vector  GetPointerDirection ()
  Returns the direction where the mouse points, from the camera view. More...
 
proto vector  GetPlayerCursorPos (Man man)
  Returns world position where player aims (works only on server) More...
 
proto Object  GetPlayerCursorObject (Man man)
  Returns object on which player aims,(works only on server) More...
 
proto void  GetPlayerCursorObjectComponentName (Man man, out string component_name)
  Returns name of component/selection on which player aims (works only on server) More...
 
proto void  RPC (Object target, int rpc_type, array< Param > params, Man recipient=NULL)
  Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on server, RPC is executed on all clients. More...
 
void  RPCSingleParam (Object target, int rpc_type, Param param, Man recipient=NULL)
  see CGame.RPC More...
 
proto void  ProfilerStart (string name)
  Use for profiling code from start to stop, they must match have same name, look wiki pages for more info: https://confluence.bistudio.com/display/EN/Profiler. More...
 
proto void  ProfilerStop (string name)
  Use for profiling code from start to stop, they must match have same name, look wiki pages for more info: https://confluence.bistudio.com/display/EN/Profiler. More...
 
proto void  RecipesGet (Man player, EntityAI item1, EntityAI item2, out TStringArray recipe_names)
  Returns list of names of recipes for certain player and items combination. More...
 
proto bool  RecipesHas (Man player, EntityAI item1, EntityAI item2)
  Returns true, if items has any recipes for certain player. More...
 
proto void  RecipeProcess (string recipe_name, Man player, EntityAI item1, EntityAI item2)
  Process recipe. More...
 
proto void  RecipeGetDescription (string recipe_name, Man player, EntityAI item1, EntityAI item2, out string text)
  Generate description for recipe for certain player and items combination. More...
 
proto void  Chat (string text, string colorClass)
  Prints text into game chat. More...
 
proto void  ChatMP (Man recipient, string text, string colorClass)
 
proto void  ChatPlayer (ChatChannel channel, string text)
 
proto ChatChannel  ChatGetChannel ()
  Returns current chat channel. More...
 
proto void  Say3D (Object source, string sound_name, float distance)
  Unit or object will say given sound in 3D Space. This allows broadcasting of positional music or sound from a source, without having to script a fade sound or music command. Sound is defined in CfgSound of the Description.ext. More...
 
proto Mission  GetMission ()
 
proto void  SetMission (Mission mission)
 
proto void  PlayMission (string path)
  Starts mission (equivalent for SQF playMission). You MUST use double slash \. More...
 
proto protected void  CreateMission (string path)
  Create only enforce script mission, used for mission script reloading. More...
 
proto void  RestartMission ()
 
proto void  AbortMission ()
 
proto void  RespawnPlayer ()
 
proto bool  CanRespawnPlayer ()
 
proto int  RetryMission ()
 
proto bool  IsMultiplayer ()
 
proto bool  IsClient ()
 
proto bool  IsServer ()
 
proto bool  IsDebug ()
 
bool  IsParamUserActions ()
 
bool  IsDebugActions ()
 
bool  IsNewPlayer ()
 
bool  IsNewUI ()
 
bool  IsPlayerDiag ()
 
bool  IsNoLogs ()
 
proto void  GetPlayerIndentities (out array< PlayerIdentity > identities)
 
proto float  SurfaceY (float x, float z)
 
proto float  SurfaceRoadY (float x, float z)
 
proto void  SurfaceGetType (float x, float z, out string type)
 
proto vector  SurfaceGetNormal (float x, float z)
 
proto float  SurfaceGetSeaLevel ()
 
proto bool  SurfaceIsSea (float x, float z)
 
proto bool  SurfaceIsPond (float x, float z)
 
proto bool  IsBoxColliding (vector center, vector orientation, vector edgeLength, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
 
proto bool  Raycast (vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, out set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0)
  Raycasts world by given parameters. More...
 
proto float  GetOvercast ()
  Returns actual sky overcast in range <0, 1> where 0 means no cloud in the sky at all. More...
 
proto float  GetOvercastForecast ()
  Returns overcast value towards the weather is heading. More...
 
proto void  SetOvercast (float overcast, float time=0, float minDuration=0)
  Sets the overcast forecast. More...
 
proto float  GetFog ()
  Returns actual fog density in range <0, 1> where 0 means no fog. More...
 
proto float  GetFogForecast ()
  Returns fog density towards the weather is heading. More...
 
proto void  SetFog (float fog, float time=0, float minDuration=0)
  Sets the fog density forecast. More...
 
proto float  GetRain ()
  Returns actual rain density in range <0, 1> where 0 means no rain. More...
 
proto float  GetRainForecast ()
  Returns rain density towards the weather is heading. More...
 
proto float  GetRainNextChange ()
  Returns remaining time in seconds until next rain forecast will be computed. More...
 
proto void  SetRain (float density, float time=0, float minDuration=0)
  Sets the rain forecast. More...
 
proto void  SetRainNextChange (float time)
  Sets the time in seconds from now when next rain forecast should be computed. More...
 
proto void  SetStorm (float density, float timeOut)
  Sets the properties of thunderstorms. More...
 
proto float  GetWindForce ()
  Returns actual wind force in range <0, 1> where 0 means no wind and 1 means strong wind. More...
 
proto vector  GetWind ()
  Returns wind vector (direction and speed as length of the vector). More...
 
proto void  SetWindForce (float wind)
  Sets the actual wind force in range <0, 1> where 0 means no wind and 1 means strong wind (current maximum wind speed is 35 m/s). More...
 
proto void  SetWind (vector direction, bool force=false)
  Sets the wind vector (direction and speed as length of the vector). More...
 
proto float  GetWeatherTime ()
  Returns actual time from start of a server (how many seconds elapsed from server start). More...
 
proto float  GetNextWeatherChange ()
  Returns remaining time in seconds until next weather forecast will be computed. More...
 
proto void  SetNextWeatherChange (float time)
  Sets the time in seconds from now when next weather forecast should be computed. More...
 
proto void  ResetWeather ()
 
proto float  GetAirTemperature ()
  Returns actual air temperature in degrees Celsius. More...
 
proto bool  DBStats (Object target, string name, float counter)
  Update stats data, return false if failed. More...
 
proto bool  StatInvokeUpdate ()
  Update stats data, return false if failed. More...
 
proto bool  StatRequestPlayerData ()
  Update player stats data during gameplay. More...
 
proto int  StatGetItemCount ()
  Return staticstics data count. More...
 
proto void  StatGetItem (int index, out string name, out string value)
  Return statistics data item by index. More...
 
proto float  StatGetCounter (Object target, string name)
  Return statistics data counter by name. More...
 
proto void  StatGetLastErrorText (out string error_text)
  Return text of the last error (use after StatInvokeUpdate failed) More...
 
proto bool  AddEvent (HiveEventPriority priority, string msg_text, int timeout=-1)
  Add hive event with given data. More...
 
proto bool  CheckHiveEvents ()
  Check if any hive event is pending. More...
 
proto void  GetLastHiveEvent (out string msg_text, out int value, out int priority)
  Return text and seconds of the pending event. More...
 
bool  IsKindOf (string cfg_class_name, string cfg_parent_name)
  Returns is class name inherited from parent class name. More...
 
bool  ObjectIsKindOf (Object object, string cfg_parent_name)
  Returns is object inherited from parent class name. More...
 
int  ConfigFindClassIndex (string config_path, string searched_member)
 
proto int  GetTime ()
  returns mission time in milliseconds More...
 
CallQueue  GetCallQueue (int call_category)
 
TimerQueue  GetTimerQueue (int call_category)
 
DragQueue  GetDragQueue ()
 
bool  IsInventoryOpen ()
 

Private Attributes

bool  m_ParamUserActions
 
bool  m_DebugActions
 
bool  m_ParamNewPlayer
 
bool  m_ParamPlayerDiag
 
bool m_ParamNoLogs ScriptModule  GameScript
 
private autoptr array< Param m_ParamCache
 

Detailed Description

Game Class provide most "world" or global engine API functions.

Member Enumeration Documentation

Enumerator
EVENT_PRIORITY_ERROR 
EVENT_PRIORITY_WARNING 
EVENT_PRIORITY_INFO 

Constructor & Destructor Documentation

void CGame::CGame ( )
private

References m_ParamCache.

Member Function Documentation

void CGame::OnEvent ( EventType  eventTypeId,
Param  params 
)
private

Called when some system event occur.

Parameters
eventTypeId event type.
params Param object, cast to specific param class to get parameters for particular event.
void CGame::OnAfterCreate ( )
private

Called after creating of CGame instance.

void CGame::OnUpdate ( bool  doSim,
float  timeslice 
)
private

Called on World update.

Parameters
doSim False when simulation is paused, True otherwise
timeslice time elapsed from last call
void CGame::OnKeyPress ( int  key )
private

Called when key is pressed.

Parameters
key direct input key code (DIK)
void CGame::OnKeyRelease ( int  key )
private

Called when key is released.

Parameters
key direct input key code (DIK)
void CGame::OnMouseButtonPress ( int  button )
private

Called when mouse button is pressed.

Parameters
button - number of button Mouse
void CGame::OnMouseButtonRelease ( int  button )
private

Called when mouse button is released.

Parameters
button - number of button Mouse
UIScriptedMenu CGame::CreateScriptedMenu ( int  id )
private

create custom main menu part (submenu)

void CGame::OnRPC ( Object  target,
int  rpc_type,
ParamsReadContext  ctx 
)
private

Called after remote procedure call is recieved for this object.

Parameters
target object on which remote procedure is called, when NULL, RPC is evaluated by CGame as global
rpc_type user defined identification of RPC
ctx read context for params
proto void CGame::RequestExit ( int  code )
private

Sets exit code and quits in the right moment.

proto void CGame::RequestRestart ( int  code )
private

Sets exit code and restart in the right moment.

proto int CGame::ConnectLastSession ( UIScriptedMenu  parent )
private

Connects to last success network session.

Returns
true on success, false if there is no previous session
proto void CGame::DisconnectSession ( )
private

Disconnects from current multiplayer session.

proto void CGame::GetProfileStringList ( string  name,
out TStringArray  values 
)
private

Gets array of strings from profile variable.

Parameters
name of the variable
values output values
usage:
autoptr TStringArray lastInventoryArray = new TStringArray;
GetGame().GetProfileStringList("lastInventory", lastInventoryArray);
proto bool CGame::GetProfileString ( string  name,
out string  value 
)
private

Gets string from profile variable.

Parameters
name of the variable
value output value
Returns
true when successful

Referenced by OptionsMenu::ApplyFn().

proto void CGame::SetProfileStringList ( string  name,
TStringArray  values 
)
private

Sets array of strings to profile variable.

Parameters
name of the variable
values to set
proto void CGame::SetProfileString ( string  name,
string  value 
)
private

Sets string to profile variable.

Parameters
name of the variable
value to set

Referenced by MissionGameplay::OnMissionFinish(), and SetProfileValueBool().

proto void CGame::SaveProfile ( )
private

Saves profile on disk.

Referenced by OptionsMenu::ApplyFn().

proto void CGame::GetPlayerName ( out string  name )
private

Gets current player name.

Parameters
name output value
proto void CGame::SetPlayerName ( string  name )
private

Sets current player name.

Parameters
name
proto bool CGame::ConfigGetText ( string  path,
out string  value 
)
private

Get string value from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value output
Returns
true on success

Referenced by ActionDigTile::CanDo(), ActionDigSoil::CanDo(), ConfigGetTextOut(), EN5C_SeedPackBase::EmptySeedPack(), EN5C_PlantBase::EN5C_PlantBase(), ComponentElectricDevice::Event_OnAwake(), ModuleHorticulture::GetPlantType(), ModuleHorticulture::LoadFromCfg(), ModuleExperience::LoadFromCfg(), and PrintConfigTree().

string CGame::ConfigGetTextOut ( string  path )
private

Get string value from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
Returns
value output string

References ConfigGetText().

Referenced by ModuleLifespan::LoadFromCfg().

proto float CGame::ConfigGetFloat ( string  path )
private

Get float value from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
Returns
value

Referenced by ActionDigTile::CanDo(), ActionDigSoil::CanDo(), ComponentElectricDevice::Event_OnAwake(), EN5C_DiggedSoil::Fertilize(), EN5C_DiggedSoil::FertilizeBit(), PlayerBase::GetProtectionLevel(), Hologram::GetTargetPosition(), ModuleExperience::LoadFromCfg(), and PowerGenerator::OnInitElectricity().

proto vector CGame::ConfigGetVector ( string  path )
private

Get vector value from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
Returns
value
proto int CGame::ConfigGetInt ( string  path )
private

Get int value from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
Returns
value

Referenced by FoodManager::ChangeFoodStage(), EN5C_SeedPackBase::EmptySeedPack(), EN5C_PlantBase::EN5C_PlantBase(), EN5C_DiggedSoil::Fertilize(), FoodStage::FoodStage(), and ModuleExperience::LoadFromCfg().

proto int CGame::ConfigGetType ( string  path )
private

Returns type of config value.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
Returns
one of constants CT_INT, CT_FLOAT, CT_STRING, CT_ARRAY, CT_CLASS, CT_OTHER

Referenced by ModuleConfigViewer::ContainsFirstClass(), ModuleConfigViewer::GetConfigRecursive(), ModuleExperience::GetLevel(), ModuleExperience::LoadFromCfg(), and PrintConfigTree().

proto void CGame::ConfigGetTextArray ( string  path,
out TStringArray  values 
)
private

Get array of strings from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value output
usage :
autoptr TStringArray characterAnimations = new TStringArray;
GetGate().ConfigGetTextArray("CfgMovesMaleSdr2 States menu_idleUnarmed0 variantsPlayer", characterAnimations);

Referenced by GardenBase::DigSoil(), EN5C_DiggedSoil::Fertilize(), FoodStage::FoodStage(), ModuleConfigViewer::GetConfigRecursive(), FoodManager::GetNextFoodStageName(), ModuleLifespan::LoadFromCfg(), and FoodManager::RefreshVisual().

proto void CGame::ConfigGetFloatArray ( string  path,
out TFloatArray  values 
)
private

Get array of floats from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value output

Referenced by FoodManager::ChangeFoodStage(), FoodStage::FoodStage(), ChatLine::Set(), and Cooking::UpdateCookingState().

proto void CGame::ConfigGetIntArray ( string  path,
out TIntArray  values 
)
private

Get array of integers from config on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
value output

Referenced by ComponentElectricDevice::Event_OnAwake().

proto bool CGame::ConfigGetChildName ( string  path,
int  index,
out string  name 
)
private

Get name of subclass in config class on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
index of subclass in class
name output
Returns
true on success, false if path or child is not found

Referenced by ConfigFindClassIndex(), ModuleConfigViewer::ContainsFirstClass(), ComponentElectricDevice::Event_OnAwake(), ModuleConfigViewer::GetConfig(), ModuleConfigViewer::GetConfigRecursive(), ModuleExperience::GetLevel(), ModuleLifespan::LoadFromCfg(), ModuleHorticulture::LoadFromCfg(), ModuleExperience::LoadFromCfg(), and PrintConfigTree().

proto bool CGame::ConfigGetBaseName ( string  path,
out string  base_name 
)
private

Get name of base class of config class on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
name output
Returns
true on success, false if path or base is not exists

Referenced by ModuleConfigViewer::GetConfigRecursive().

proto int CGame::ConfigGetChildrenCount ( string  path )
private

Get count of subclasses in config class on path.

Parameters
path of value, classes are delimited by empty space. You can specify config file by using "configFile" or "missionConfigFile" as a first class name.
index of parameter in class
name output
Returns
true on success, false if path or child is not found

Referenced by ConfigFindClassIndex(), ModuleConfigViewer::ContainsFirstClass(), ComponentElectricDevice::Event_OnAwake(), ModuleConfigViewer::GetConfig(), ModuleConfigViewer::GetConfigRecursive(), ModuleLifespan::LoadFromCfg(), ModuleHorticulture::LoadFromCfg(), and PrintConfigTree().

proto bool CGame::ConfigIsExisting ( string  path )
private
proto void CGame::ConfigGetFullPath ( string  path,
out TStringArray  full_path 
)
private
proto void CGame::ConfigGetObjectFullPath ( Object  obj,
out TStringArray  full_path 
)
private

Referenced by ObjectIsKindOf().

string CGame::ConfigPathToString ( TStringArray  array_path )
private

Converts array of strings into single string.

Parameters
Array of strings like {"All", "AllVehicles", "Land"}
Returns
Converts given array into something lile "All AllVehicles Land".
???
proto bool CGame::CommandlineGetParam ( string  name,
out string  value 
)
private

Get command line parameter value.

Parameters
name of parameter
value output
Returns
true when parameter exists, false otherwise
usage :
// you run e.g.: DayZInt.exe -scriptDebug=true
string value;
if (GetGame().CommandlineGetParam("scriptDebug", value) && value == "true")
{
Print("Script debugging on!");
}

Referenced by DayZGame::DayZGame().

proto void CGame::CopyToClipboard ( string  text )
private
proto void CGame::CopyFromClipboard ( out string  text )
private
proto void CGame::BeginOptionsVideo ( )
private

Referenced by OptionsMenu::Init().

proto void CGame::EndOptionsVideo ( )
private
proto bool CGame::PreloadObject ( string  type,
float  distance 
)
private

Preload objects with certain type in certain distance from camera.

Parameters
type of objects which should be preloaded
distance from camera in which objects should be preloaded
Returns
true on success
proto Object CGame::CreateObject ( string  type,
vector  pos,
bool  create_local = false,
bool  init_ai = false 
)
private
proto SoundOnVehicle CGame::CreateSoundOnObject ( Object  source,
string  sound_name,
float  distance,
bool  looped 
)
private
proto void CGame::ObjectDelete ( Object  obj )
private
proto int CGame::ObjectRelease ( Object  obj )
private

Referenced by Object::Release().

proto void CGame::ObjectGetType ( Object  obj,
out string  type 
)
private
proto void CGame::ObjectGetDisplayName ( Object  obj,
out string  name 
)
private
proto void CGame::ObjectSetAnimationPhase ( Entity  obj,
string  animation,
float  phase 
)
private
proto float CGame::ObjectGetAnimationPhase ( Entity  obj,
string  animation 
)
private
proto vector CGame::ObjectGetSelectionPosition ( Object  obj,
string  name 
)
private
proto vector CGame::ObjectModelToWorld ( Object  obj,
vector  modelPos 
)
private

Referenced by Object::ModelToWorld().

proto vector CGame::ObjectWorldToModel ( Object  obj,
vector  worldPos 
)
private

Referenced by Object::WorldToModel().

proto bool CGame::IsObjectAccesible ( EntityAI  item,
Man  player 
)
private

returns true if player can access item's cargo/attachments (check only distance)

Referenced by CanShowItemInInventory(), InventoryMenu::PerformRefreshInventory(), and InventoryMenu::Refresh().

proto bool CGame::IsInventoryTreeLocked ( EntityAI  item,
EntityAI  player 
)
private

returns true if player can access item's cargo/attachments (check only inventory conditions)

proto Input CGame::GetInput ( )
private
proto void CGame::ExecuteSQF ( string  expression )
private

Executes SQF expression, if there is an error, is printed into the script console.

Referenced by ScriptConsole::ApplySQF(), SqfDebugWatcher::Execute(), EN5C_FireplaceBase::RefreshFireIntensityVisual(), and EN5C_FireplaceBase::RefreshFireVisual().

proto bool CGame::ExecuteEnforceScript ( string  expression,
string  mainFnName 
)
private

Executes Enforce Script expression, if there is an error, is printed into the script console.

Referenced by ScriptConsole::RunEnscript().

proto bool CGame::ScriptTest ( )
private

Referenced by InGameMenu::OnClick().

proto void CGame::GetDiagModeNames ( out TStringArray  diag_names )
private

Get list of all debug modes.

Referenced by ScriptConsole::Init().

proto void CGame::SetDiagModeEnable ( int  diag_mode,
bool  enabled 
)
private

Set specific debug mode.

Referenced by ScriptConsole::OnClick().

proto bool CGame::GetDiagModeEnable ( int  diag_mode )
private

Gets state of specific debug mode.

Referenced by ScriptConsole::OnClick().

proto void CGame::GetDiagDrawModeNames ( out TStringArray  diag_names )
private

Get list of all debug draw modes.

Referenced by ScriptConsole::Init().

proto void CGame::SetDiagDrawMode ( int  diag_draw_mode )
private

Set debug draw mode.

Referenced by ScriptConsole::OnClick().

proto int CGame::GetDiagDrawMode ( )
private

Gets current debug draw mode.

proto void CGame::GetInventoryItemSize ( InventoryItem  item,
out int  width,
out int  height 
)
private
proto void CGame::GetObjectsAtPosition ( vector  pos,
float  radius,
Man  inPlayerSight,
out array< Object objects,
out array< Cargo proxyCargos 
)
private

Returns list of all objects in radius "radius" around position "pos".

Parameters
pos
radius
inPlayerSight if inPlayerSight is not NULL, function raycast every object if is visible by player "inPlayerSight" (heavy performance load!)
objects output array

Referenced by BaseBuildingBase::GetNearbyStructuresWithAWire(), EN5C_FireplaceBase::TransferHeatToNearObjects(), and InventoryContainerVicinity::UpdateItems().

proto World CGame::GetWorld ( )
private
proto void CGame::GetWorldName ( out string  world_name )
private
proto vector CGame::SnapToGround ( vector  pos )
private

Referenced by PlayerBase::DropItem().

proto void CGame::FormatString ( string  format,
string  params[],
out string  output 
)
private
proto void CGame::HtmlToPlain ( string  text )
private

Referenced by Consumable_Paper::OnRPC().

proto void CGame::GetVersion ( out string  version )
private

Referenced by InGameMenu::Init().

proto UIManager CGame::GetUIManager ( )
private

Referenced by InventoryViewHands::AlignToBottom(), DayZGame::CheckDialogs(), MissionGameplay::CloseAllMenus(), MissionGameplay::Continue(), MissionGameplay::DestroyAllMenus(), InventoryManager::Drop(), InventoryManager::DropItem(), ModuleSceneEditor::EditorToggle(), PlayerBase::EEItemIntoHands(), PlayerBase::EEItemOutOfHands(), EnfReadNote(), EnfWriteNote(), ModuleSceneEditor::FreeCameraControlDisable(), ModuleSceneEditor::FreeCameraControlEnable(), MissionGameplay::HideInventory(), ScriptConsoleRenamePresetDialog::Init(), InventoryManager::InspectItem(), IsInConsole(), IsIngame(), DayZGame::IsInventoryOpen(), MissionGameplay::IsPaused(), UIScriptedMenu::LockControls(), InGameMenu::OnClick(), ScriptConsoleNewPresetDialog::OnClick(), ScriptConsoleRenamePresetDialog::OnClick(), MissionGameplay::OnEvent(), InventoryContainer::OnItemDoubleClick(), MissionGameplay::OnItemUsed(), MissionMainMenu::OnMissionFinish(), MissionGameplay::OnMissionFinish(), ContextMenu::OnMouseButtonDown(), InventoryManager::OnPerformAction(), ActivityGear::OnSimulate(), MissionMainMenu::OnUpdate(), MissionGameplay::OnUpdate(), MissionGameplay::Pause(), InventoryMenu::PerformRefreshInventory(), UIPopupScript::PopupBack(), UIPopupScript::PopupOpen(), DispatcherCaller::ScriptConsoleAddPrint(), DispatcherCaller::ScriptConsoleGetSqfCommandWatcher(), DispatcherCaller::ScriptConsoleGetSqfCommandWatcherResult(), DispatcherCaller::ScriptConsoleHistoryBack(), DispatcherCaller::ScriptConsoleHistoryForward(), InventoryManager::ShowActionMenu(), InventoryManager::ShowActionMenuCombine(), SpawnFromClipboard(), UIScriptedMenu::UnlockControls(), InventoryManager::UpdateEntityActions(), and UpdateSqfDebugWatchers().

proto Man CGame::GetPlayer ( )
private

Referenced by IngameHud::DisplayPresence(), HudDebugCharStatus::GetCharValue(), HudDebugCharValue::GetCharValue(), BaseBuildingBase::GetNearbyStructuresWithAWire(), ModuleSceneEditor::GetPlayer(), InventoryQuickbar::GetQuickbarItemColor(), InGameMenu::Init(), EN5C_FishingRod_Base::Init(), InventoryContainerHands::InventoryContainerHands(), InventoryManager::InventoryManager(), InventoryViewBase::MoveItem(), InventoryView::MoveItem(), ScriptConsole::OnClick(), InventoryMenu::OnDoubleClick(), InventoryMenu::OnDraggingOver(), InventoryMenu::OnDropReceived(), InventoryContainerVicinity::OnDropReceived(), InventoryContainerHands::OnDropReceived(), MissionGameplay::OnEvent(), InventoryContainer::OnItemDoubleClick(), InventoryQuickbar::OnItemDrag(), InventoryView::OnItemDraggingOver(), InventoryQuickbar::OnItemDraggingOver(), InventoryQuickbar::OnItemDrop(), InventoryView::OnItemDropReceived(), InventoryQuickbar::OnItemDropReceived(), InventoryViewBase::OnItemRightClick(), InventoryViewGrid::OnItemRightClick(), InventoryView::OnItemRightClick(), MissionGameplay::OnMissionFinish(), OnRPCFreeCameraSend(), EntityDebugSync::OnSynchronize(), MissionGameplay::OnUpdate(), ActionMenu::PerformAction(), InventoryMenu::PerformRefreshInventory(), ItemBase::QuantitySplit(), ScriptConsole::RefreshPlayerPosEditBoxes(), InventoryQuickbar::Remove(), ScriptConsole::SetPreset(), SpawnFromClipboard(), EN5C_FireplaceBase::StartCooling(), EN5C_FireplaceBase::StartFire(), EN5C_FireplaceBase::StartHeating(), EN5C_FireplaceBase::StopCooling(), EN5C_FireplaceBase::StopFire(), EN5C_FireplaceBase::StopHeating(), TeleportAtCursor(), HudDebugWinCharDebug::Update(), ActionMenu::UpdateActions(), Cooking::UpdateCookingState(), UpdateItemInfoWetness(), InventoryContainerVicinity::UpdateItems(), InventoryQuickbar::UpdateItems(), and ActionMenu::UpdateWidgets().

proto void CGame::GetPlayers ( out array< Man players )
private

Referenced by SendServerLogToClient().

EntityScriptedActivity CGame::CreateActivity ( Object  target,
Man  man,
int  activity_type 
)
private

References Print().

proto void CGame::PerformAction ( Man  player,
Action  action 
)
private
proto void CGame::GetActionMenuActions ( out TActionRefArray  actions )
private
proto void CGame::UpdateActionMenuActions ( )
private

Updates action menu items, call UpdateCursorTarget prior this to update aiming target.

Referenced by MissionGameplay::OnUpdate().

proto void CGame::UpdateCursorTarget ( )
private

Updates target of player aiming.

Referenced by TrapSpawnBase::IsPlaceable(), and MissionGameplay::OnUpdate().

proto vector CGame::GetCursorPos ( )
private

Returns world position where player aims, call UpdateCursorTarget to refresh this data.

Referenced by SpawnFromClipboard(), and TeleportAtCursor().

proto Object CGame::GetCursorObject ( )
private

Returns object on which player aims, call UpdateCursorTarget to refresh this data.

proto void CGame::GetCursorObjectComponentName ( out string  component_name )
private

Returns name of component/selection on which player aims, call UpdateCursorTarget to refresh this data. The object must have View Geometry or Fire Geometry. View Geometry has priority.

proto vector CGame::GetPointerDirection ( )
private

Returns the direction where the mouse points, from the camera view.

proto vector CGame::GetPlayerCursorPos ( Man  man )
private

Returns world position where player aims (works only on server)

proto Object CGame::GetPlayerCursorObject ( Man  man )
private

Returns object on which player aims,(works only on server)

Referenced by ManBase::GetCursorObject().

proto void CGame::GetPlayerCursorObjectComponentName ( Man  man,
out string  component_name 
)
private
proto void CGame::RPC ( Object  target,
int  rpc_type,
array< Param params,
Man  recipient = NULL 
)
private

Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on server, RPC is executed on all clients.

Parameters
target object on which remote procedure is called, when NULL, RPC is evaluated by CGame as global
rpc_type user defined identification of RPC
params custom params array
recipient specified client to send RPC to. If NULL, RPC will be send to all clients (specifying recipient increase security and decrease network traffic)
const int RPC_LOW_BLOOD_PRESSURE_EFFECT = 0;
...
// on server side, after blood pressure of player is low...
autoptr Param1<float> p = new Param1<float>(m_blood_pressure);
autoptr array<param> params = new array<param>;
params.Insert(p);
GetGame().RPC(player, RPC_LOW_BLOOD_PRESSURE_EFFECT, params);
// or shortcut
GetGame().RPCSingleParam(player, RPC_LOW_BLOOD_PRESSURE_EFFECT, p);
...
// on client
{
// override OnRPC function
void OnRPC(int rpc_type, ParamsReadContext ctx)
{
// dont forget to propagate this call trough class hierarchy!
super.OnRPC(rpc_type, ctx);
switch(rpc_type)
{
case RPC_LOW_BLOOD_PRESSURE_EFFECT:
autoptr Param1<float> p = Param1<float>(0);
if (ctx.Read(p))
{
float blood_pressure = p.param1;
float effect_intensity = 1.0 - blood_pressure;
ShowFancyScreenEffect(effect_intensity);
}
break;
}
}
}

Referenced by Object::RPC(), RPCSingleParam(), DisplayStatus::SendRPC(), PlayerStats::SyncVars(), and ModuleRecipes::TransmitRecipe().

void CGame::RPCSingleParam ( Object  target,
int  rpc_type,
Param  param,
Man  recipient = NULL 
)
private

see CGame.RPC

References m_ParamCache, and RPC().

Referenced by Object::RPCSingleParam().

proto void CGame::ProfilerStart ( string  name )
private
proto void CGame::ProfilerStop ( string  name )
private
proto void CGame::RecipesGet ( Man  player,
EntityAI  item1,
EntityAI  item2,
out TStringArray  recipe_names 
)
private

Returns list of names of recipes for certain player and items combination.

Parameters
player
item1
item2
recipe_names output, results are inserted here

Referenced by InventoryManager::ShowActionMenuCombine().

proto bool CGame::RecipesHas ( Man  player,
EntityAI  item1,
EntityAI  item2 
)
private

Returns true, if items has any recipes for certain player.

Parameters
player
item1
item2

Referenced by InventoryManager::GetCombinationFlags().

proto void CGame::RecipeProcess ( string  recipe_name,
Man  player,
EntityAI  item1,
EntityAI  item2 
)
private

Process recipe.

Parameters
recipe_name name of recipe (you can get recipe names using RecipesGet function)
player
item1
item2

Referenced by InventoryManager::OnPerformCraft().

proto void CGame::RecipeGetDescription ( string  recipe_name,
Man  player,
EntityAI  item1,
EntityAI  item2,
out string  text 
)
private

Generate description for recipe for certain player and items combination.

Parameters
recipe_name name of recipe (you can get recipe names using RecipesGet function)
player
item1
item2
text final description is outputted here

Referenced by InventoryManager::ShowActionMenuCombine().

proto void CGame::Chat ( string  text,
string  colorClass 
)
private

Prints text into game chat.

Parameters
text to print
colorClass ??
usage :
GetGame().Chat("Item splitted", "colorAction");

Referenced by PlayerBase::Message().

proto void CGame::ChatMP ( Man  recipient,
string  text,
string  colorClass 
)
private

Referenced by PlayerBase::Message().

proto void CGame::ChatPlayer ( ChatChannel  channel,
string  text 
)
private

Referenced by ChatInputMenu::OnChange().

proto ChatChannel CGame::ChatGetChannel ( )
private

Returns current chat channel.

proto void CGame::Say3D ( Object  source,
string  sound_name,
float  distance 
)
private

Unit or object will say given sound in 3D Space. This allows broadcasting of positional music or sound from a source, without having to script a fade sound or music command. Sound is defined in CfgSound of the Description.ext.

Parameters
unit Object - position of sound is taken from position of this object
sound String - classname. Defined in Description.ext
distance float - how far is dound hearable

Referenced by Trap_TripWire::MakeNoise().

proto Mission CGame::GetMission ( )
private
proto void CGame::SetMission ( Mission  mission )
private
proto void CGame::PlayMission ( string  path )
private

Starts mission (equivalent for SQF playMission). You MUST use double slash \.

Referenced by MissionEditor::OnClick(), and MainMenu::OnClick().

proto protected void CGame::CreateMission ( string  path )
private

Create only enforce script mission, used for mission script reloading.

Referenced by DayZGame::ReloadMission().

proto void CGame::RestartMission ( )
private
proto void CGame::AbortMission ( )
private
proto void CGame::RespawnPlayer ( )
private
proto bool CGame::CanRespawnPlayer ( )
private
proto int CGame::RetryMission ( )
private
proto bool CGame::IsMultiplayer ( )
private
proto bool CGame::IsClient ( )
private
proto bool CGame::IsServer ( )
private

Referenced by PlayerBase::PlayerBase().

proto bool CGame::IsDebug ( )
private

Referenced by DayZGame::DayZGame().

bool CGame::IsParamUserActions ( )
private

References m_ParamUserActions.

bool CGame::IsDebugActions ( )
private
bool CGame::IsNewPlayer ( )
private
bool CGame::IsNewUI ( )
private

References UseNewUI().

bool CGame::IsPlayerDiag ( )
private

References m_ParamPlayerDiag.

bool CGame::IsNoLogs ( )
private
proto void CGame::GetPlayerIndentities ( out array< PlayerIdentity identities )
private
proto float CGame::SurfaceY ( float  x,
float  z 
)
private
proto float CGame::SurfaceRoadY ( float  x,
float  z 
)
private
proto void CGame::SurfaceGetType ( float  x,
float  z,
out string  type 
)
private
proto vector CGame::SurfaceGetNormal ( float  x,
float  z 
)
private
proto float CGame::SurfaceGetSeaLevel ( )
private
proto bool CGame::SurfaceIsSea ( float  x,
float  z 
)
private
proto bool CGame::SurfaceIsPond ( float  x,
float  z 
)
private
proto bool CGame::IsBoxColliding ( vector  center,
vector  orientation,
vector  edgeLength,
array< Object excludeObjects,
array< Object collidedObjects = NULL 
)
private
proto bool CGame::Raycast ( vector  begPos,
vector  endPos,
out vector  contactPos,
out vector  contactDir,
out int  contactComponent,
out set< Object results = NULL,
Object  with = NULL,
Object  ignore = NULL,
bool  sorted = false,
bool  ground_only = false,
int  iType = ObjIntersectView,
float  radius = 0.0 
)
private

Raycasts world by given parameters.

Parameters
begPos vector
endPos vector
contactPos vector out, world position of first contact
contactDir vector out, direction of first contact (available only when object is hitted)
contactComponent int out, object component index (available only when object is hitted)
results set<Object> out, set of objects hitted by raycast. Can be NULL if not needed
with Object
ignore Object
sorted bool
ground_only raycasts only ground (ignores all objects)
iType int, type of intersection, possible values ObjIntersect
radius float
Returns
bool return true if raycast hits ground or object
// raycast test
if (player)
{
vector from = player.GetPosition();
vector to = from + (player.GetDirection() * 100);
vector contactPos;
vector contactDir;
int contactComponent;
if ( GetGame().Raycast(from, to, contactPos, contactDir, contactComponent) )
{
Print(contactPos);
Print(contactDir);
Print(contactComponent);
}
}

Referenced by Environment::CheckRoof(), PlayerBase::GetAimPosition(), GardenBase::GetFreeSlotIndex(), EN5C_FireplaceBase::LineHit(), and OnRPCFreeCameraSend().

proto float CGame::GetOvercast ( )
private

Returns actual sky overcast in range <0, 1> where 0 means no cloud in the sky at all.

proto float CGame::GetOvercastForecast ( )
private

Returns overcast value towards the weather is heading.

proto void CGame::SetOvercast ( float  overcast,
float  time = 0,
float  minDuration = 0 
)
private

Sets the overcast forecast.

Parameters
overcast Desired overcast value that should be met in given time.
time A time of the next change (how long it takes in seconds to interpolate to given value).
minDuration A minimal time in seconds the change will last.
proto float CGame::GetFog ( )
private

Returns actual fog density in range <0, 1> where 0 means no fog.

proto float CGame::GetFogForecast ( )
private

Returns fog density towards the weather is heading.

proto void CGame::SetFog ( float  fog,
float  time = 0,
float  minDuration = 0 
)
private

Sets the fog density forecast.

Parameters
fog Desired fog density that should be met in given time.
time A time of the next change (how long it takes in seconds to get to given value).
minDuration A minimal time in seconds the change will last.
proto float CGame::GetRain ( )
private

Returns actual rain density in range <0, 1> where 0 means no rain.

Referenced by EN5C_FireplaceBase::Cooling(), EN5C_FireplaceBase::Heating(), and GardenBase::PlantSeed().

proto float CGame::GetRainForecast ( )
private

Returns rain density towards the weather is heading.

Note
Keep in mind that if the overcast value is small, rain values are not updated. So rain forecast and its next time change can be misleading.
proto float CGame::GetRainNextChange ( )
private

Returns remaining time in seconds until next rain forecast will be computed.

proto void CGame::SetRain ( float  density,
float  time = 0,
float  minDuration = 0 
)
private

Sets the rain forecast.

Parameters
rain Desired rain density that should be met in given time.
time A time of the next change (how long it takes in seconds to get to given value).
minDuration A minimal time in seconds the change will last.
proto void CGame::SetRainNextChange ( float  time )
private

Sets the time in seconds from now when next rain forecast should be computed.

proto void CGame::SetStorm ( float  density,
float  timeOut 
)
private

Sets the properties of thunderstorms.

Parameters
density A value in <0, 1> range where 0 means no thunderstorms at all and 1 means thunderstorm every time it gets cloudy.
timeOut A minimal time in seconds before next thunder can be created.
proto float CGame::GetWindForce ( )
private

Returns actual wind force in range <0, 1> where 0 means no wind and 1 means strong wind.

Note
Wind is changing very often in the game, so the returned value may not stand for too long if not forced.
proto vector CGame::GetWind ( )
private

Returns wind vector (direction and speed as length of the vector).

Referenced by EN5C_FireplaceBase::CheckWind().

proto void CGame::SetWindForce ( float  wind )
private

Sets the actual wind force in range <0, 1> where 0 means no wind and 1 means strong wind (current maximum wind speed is 35 m/s).

Note
Wind is changing very often in the game, so the set value may not stand for too long if not forced.
proto void CGame::SetWind ( vector  direction,
bool  force = false 
)
private

Sets the wind vector (direction and speed as length of the vector).

Parameters
direction Wind vector (direction and speed as length of the vector).
force If true forces the wind to keep the given props (turns off updating).
Note
Wind is changing very often in the game, so the set value may not stand for too long if not forced.
proto float CGame::GetWeatherTime ( )
private

Returns actual time from start of a server (how many seconds elapsed from server start).

proto float CGame::GetNextWeatherChange ( )
private

Returns remaining time in seconds until next weather forecast will be computed.

proto void CGame::SetNextWeatherChange ( float  time )
private

Sets the time in seconds from now when next weather forecast should be computed.

proto void CGame::ResetWeather ( )
private
proto float CGame::GetAirTemperature ( )
private

Returns actual air temperature in degrees Celsius.

proto bool CGame::DBStats ( Object  target,
string  name,
float  counter 
)
private

Update stats data, return false if failed.

Referenced by MissionServer::UpdatePlayersStats().

proto bool CGame::StatInvokeUpdate ( )
private

Update stats data, return false if failed.

Referenced by MainMenu::UpdateStats().

proto bool CGame::StatRequestPlayerData ( )
private

Update player stats data during gameplay.

Referenced by MissionServer::UpdatePlayersStats().

proto int CGame::StatGetItemCount ( )
private

Return staticstics data count.

Referenced by MainMenu::UpdateStats().

proto void CGame::StatGetItem ( int  index,
out string  name,
out string  value 
)
private

Return statistics data item by index.

Referenced by MainMenu::UpdateStats().

proto float CGame::StatGetCounter ( Object  target,
string  name 
)
private

Return statistics data counter by name.

Referenced by PlayerBase::ShavePlayer(), and ModuleLifespan::UpdateLifespanLevelAuto().

proto void CGame::StatGetLastErrorText ( out string  error_text )
private

Return text of the last error (use after StatInvokeUpdate failed)

Referenced by MainMenu::UpdateStats().

proto bool CGame::AddEvent ( HiveEventPriority  priority,
string  msg_text,
int  timeout = -1 
)
private

Add hive event with given data.

proto bool CGame::CheckHiveEvents ( )
private

Check if any hive event is pending.

proto void CGame::GetLastHiveEvent ( out string  msg_text,
out int  value,
out int  priority 
)
private

Return text and seconds of the pending event.

Referenced by MissionBase::CheckNotification().

bool CGame::IsKindOf ( string  cfg_class_name,
string  cfg_parent_name 
)
private

Returns is class name inherited from parent class name.

Parameters
cfg_class_name Config Class name ("Animal_CervusElaphus")
cfg_parent_name Parent Config Class name ("DZ_LightAI")
Returns
bool is class name inherited from parent class name
bool is_kind = GetGame().IsKindOf( "Animal_CervusElaphus", "DZ_LightAI");
>> 1

References ConfigGetFullPath(), and strlower().

Referenced by RecipeBase::CheckIngredientMatch(), PlayerBase::SpawnItem(), and ComponentElectricDevice::UpdatePlugState().

bool CGame::ObjectIsKindOf ( Object  object,
string  cfg_parent_name 
)
private

Returns is object inherited from parent class name.

Parameters
object Object
cfg_parent_name Parent Config Class name ("DZ_LightAI")
Returns
bool is object inherited from parent class name
bool is_kind = GetGame().IsKindOf( my_animal, "DZ_LightAI");
>> 1

References ConfigGetObjectFullPath(), and strlower().

Referenced by Object::IsKindOf().

int CGame::ConfigFindClassIndex ( string  config_path,
string  searched_member 
)
private
proto int CGame::GetTime ( )
private
CallQueue CGame::GetCallQueue ( int  call_category )
private

Returns CallQueue for certain category

Parameters
call_category call category, valid values are:
CALL_CATEGORY_SYSTEM - calls & timers in this queue are processed every time without any restrictions
CALL_CATEGORY_GUI - calls & timers in this queue are processed when GUI is enabled (even during pase game)
CALL_CATEGORY_GAMEPLAY - calls & timers in this queue are processed only during mission, when game is not paused
usage:
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Refresh"); // calls "Refresh" function on "this" with no arguments
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "Show", new Param1<bool>(true)); // calls "Show" function on "this" with one bool argument
GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(this, "SetPos", new Param2<float, float>(0.2, 0.5)); // calls "SetPos" function on "this" with two float arguments

Referenced by Object::AddDamage(), LoadingScreen::Dec(), EntityAI::Delete(), EnableFreeCamera(), Crafting_WoodenStick::OnAction(), InGameMenu::OnClick(), MainMenu::OnClick(), OptionsMenu::OnClick(), InventoryMenu::OnDoubleClick(), DayZGame::OnEvent(), InGameMenu::OnModalResult(), OptionsMenu::OnModalResult(), ContextMenu::OnMouseButtonDown(), ModuleSceneEditor::OnUIEditorOpened(), ChatInputMenu::~ChatInputMenu(), DayZIntroScene::~DayZIntroScene(), InGameMenu::~InGameMenu(), InspectMenu::~InspectMenu(), MainMenu::~MainMenu(), MissionBase::~MissionBase(), and OptionsMenu::~OptionsMenu().

TimerQueue CGame::GetTimerQueue ( int  call_category )
private

Returns TimerQueue for certain category

Parameters
call_category call category, valid values are:
CALL_CATEGORY_SYSTEM - calls & timers in this queue are processed every time without any restrictions
CALL_CATEGORY_GUI - calls & timers in this queue are processed when GUI is enabled (even during pase game)
CALL_CATEGORY_GAMEPLAY - calls & timers in this queue are processed only during mission, when game is not paused
DragQueue CGame::GetDragQueue ( )
private
bool CGame::IsInventoryOpen ( )
private

Member Data Documentation

bool CGame::m_ParamUserActions
private
bool CGame::m_DebugActions
private
bool CGame::m_ParamNewPlayer
private

Referenced by DayZGame::DayZGame(), and IsNewPlayer().

bool CGame::m_ParamPlayerDiag
private

Referenced by IsPlayerDiag().

bool m_ParamNoLogs ScriptModule CGame::GameScript
private
private autoptr array<Param> CGame::m_ParamCache
private

Referenced by CGame(), and RPCSingleParam().


The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)