DayZ 1.24
Loading...
Searching...
No Matches
Game.c
Go to the documentation of this file.
1
5static int GAME_STORAGE_VERSION = 135;
6
7class CGame
8{
9 // enableDebugMonitor in server config
11
13
15
16 //analytics
20
21#ifdef DIAG_DEVELOPER
23 void EnableEMPlugs(bool enable)
24 {
25 for (int i = 0; i < GetGame().m_EnergyManagerArray.Count(); ++i)
26 {
27 if (GetGame().m_EnergyManagerArray[i])
28 GetGame().m_EnergyManagerArray[i].SetDebugPlugs(enable);
29 }
30 }
31#endif
32
33 void CGame()
34 {
35 Math.Randomize(-1);
36
39 m_ParamCache.Insert(null);
40
41 //analytics
44
45 //m_CharacterData = new MenuCharacrerData;
46
47 // actual script version - increase by one when you make changes
49
50#ifdef DIAG_DEVELOPER
52#endif
53
54 if (!IsDedicatedServer())
55 {
59 }
60 }
61
62 private void ~CGame()
63 {
64 // Clean these up even if it is dedicated server, just to be safe
68
69 // Is initialized in StartupEvent
70 ParticleManager.CleanupInstance();
71 }
72
75
77
85
86 //PLM Type: 0 == RESUMED, 1 == SUSPENDED
88 {
89
90 }
91
93 {
94
95 }
96
101 {
102 }
103
108 {
109 }
110
115 {
116 }
117
122 {
123 return false;
124 }
125
130 {
131 }
132
138 void OnUpdate(bool doSim, float timeslice)
139 {
140 }
141
147 void OnPostUpdate(bool doSim, float timeslice)
148 {
149 }
150
155 void OnKeyPress(int key)
156 {
157 }
158
164 {
165 }
166
172 {
173 }
174
180 {
181 }
182
187
192
202
207
212
217
222
227
232
240 proto native int Connect(UIScriptedMenu parent, string IpAddress, int port, string password);
250
255
256 // profile functions
268
275 proto bool GetProfileString(string name, out string value);
276
283
289 proto native void SetProfileString(string name, string value);
290
295
301
308
314
320 proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec);
321
329
338
345
352
360
366
374
380
387
394
400
401
406
411
416
421
422 // config functions
429 proto bool ConfigGetText(string path, out string value);
430
438 proto bool ConfigGetTextRaw(string path, out string value);
439
445 string ConfigGetTextOut(string path)
446 {
447 string ret_s;
449 return ret_s;
450 }
451
458 {
459 int ret;
460 ret = value.Replace("$STR_", "#STR_");
461 return ret > 0;
462 }
463
470 {
471 if (class_name != "")
472 {
473 string cfg = "CfgVehicles " + class_name + " model";
474 string model_path;
476 {
477 int to_substring_end = model_path.Length() - 4; // -4 to leave out the '.p3d' suffix
478 int to_substring_start = 0;
479
480 // Currently we have model path. To get the name out of it we need to parse this string from the end and stop at the first found '\' sign
481 for (int i = to_substring_end; i > 0; i--)
482 {
483 string sign = model_path.Get(i);
484 if (sign == "\\")
485 {
486 to_substring_start = i + 1;
487 break
488 }
489 }
490
492 return model_name;
493 }
494 }
495
496 return "UNKNOWN_P3D_FILE";
497 }
498
505
506
513
520
527
539
552
559
566
574 proto bool ConfigGetChildName(string path, int index, out string name);
575
583
593
596
599
609 {
610 string return_path = "";
611 int count = array_path.Count();
612
613 for (int i = 0; i < count; i++)
614 {
615 return_path += array_path.Get(i);
616
617 if (i < count - 1)
618 return_path += " ";
619 }
620
621 return return_path;
622 }
623
639 proto bool CommandlineGetParam(string name, out string value);
640
643
646
647 proto native void AdminLog(string text);
648
649 // entity functions
656 proto native bool PreloadObject(string type, float distance);
657
659
669 proto native Object CreateObject(string type, vector pos, bool create_local = false, bool init_ai = false, bool create_physics = true);
672
682
690 proto void ObjectGetType(Object obj, out string type);
700
701 // input
703
704 // camera
707
708 // sound
710
711 // noise
713
714 // inventory
716
718 {
720#ifdef DEVELOPER
722 Debug.InventoryReservationLog("STS = " + player.GetSimulationTimeStamp() + " result: " + result + " item:" + item + " dst: " + InventoryLocation.DumpToStringNullSafe(dst), "n/a", "n/a", "AddInventoryJuncture", player.ToString());
723#endif
724 //Print("Juncture - STS = " + player.GetSimulationTimeStamp() + " item:" + item + " dst: " + InventoryLocation.DumpToStringNullSafe(dst));
725 return result;
726 }
727
728 //Has inventory juncture for any player
730
735
737 {
738#ifdef DEVELOPER
740 Debug.InventoryReservationLog("STS = " + player.GetSimulationTimeStamp() + " item:" + item, "n/a", "n/a", "ClearJuncture", player.ToString());
741#endif
742 return ClearJuncture(player, item);
743 }
744
745 // support
750
758
765
768
774
780
798
800 {
801 string world_name;
802 g_Game.GetWorldName(world_name);
803 return world_name;
804 }
805
808
809 proto void FormatString(string format, string params[], out string output);
810 proto void GetVersion(out string version);
815 {
818 if (index >= players.Count())
819 return null;
820 return DayZPlayer.Cast(players[index]);
821 }
822
825
834
893
898
899
909 proto native void Chat(string text, string colorClass);
910 proto native void ChatMP(Man recipient, string text, string colorClass);
917 proto native void MutePlayer(string muteUID, string playerUID, bool mute);
918
925
932
940
946
951
957
962
967
968 // mission
971
972
977
979 proto protected native void CreateMission(string path);
986
989
993
1002
1005
1006 // Internal build
1008
1009 //#ifdef PLATFORM_XBOX
1010 static bool IsDigitalCopy()
1011 {
1012 return OnlineServices.IsGameActive(false);
1013 }
1014 //#endif
1015
1016 /*bool IsNewMenu()
1017 {
1018 return m_ParamNewMenu;
1019 }*/
1020
1025
1027 {
1028 return IsServer() && m_DebugMonitorEnabled;
1029 }
1030
1032
1033 proto native float SurfaceY(float x, float z);
1035 proto native float SurfaceRoadY3D(float x, float y, float z, RoadSurfaceDetection rsd);
1036 proto void SurfaceGetType(float x, float z, out string type);
1037 proto void SurfaceGetType3D(float x, float y, float z, out string type);
1038 proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType);
1039 proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType);
1044 proto native bool SurfaceIsSea(float x, float z);
1045 proto native bool SurfaceIsPond(float x, float z);
1047
1049
1052 {
1053 float high = -9999999;
1054 float low = 99999999;
1055
1056 for (int i = 0; i < positions.Count(); i++)
1057 {
1058 vector pos = positions.Get(i);
1059 pos[1] = SurfaceRoadY(pos[0], pos[2]);
1060 float y = pos[1];
1061
1062 if (y > high)
1063 high = y;
1064
1065 if (y < low)
1066 low = y;
1067
1068 ;
1069 }
1070
1071 return high - low;
1072 }
1073
1076 {
1077 vector normal = GetGame().SurfaceGetNormal(x, z);
1078 vector angles = normal.VectorToAngles();
1079 angles[1] = angles[1] + 270; // This fixes rotation of item so it stands vertically. Feel free to change, but fix existing use cases.
1080
1081 //Hack because setorientation and similar functions break and flip stuff upside down when using exactly this vector ¯\_(ツ)_/¯ (note: happens when surface is flat)
1082 if (angles == "0 540 0")
1083 angles = "0 0 0";
1084 return angles;
1085 }
1086
1088 bool IsSurfaceDigable(string surface)
1089 {
1090 return ConfigGetInt("CfgSurfaces " + surface + " isDigable");
1091 }
1092
1094 bool IsSurfaceFertile(string surface)
1095 {
1096 return ConfigGetInt("CfgSurfaces " + surface + " isFertile");
1097 }
1098
1100 {
1101 if (object)
1102 {
1103 vector pos = object.GetPosition();
1104 vector min_max[2];
1105 float radius = object.ClippingInfo(min_max);
1106 vector min = Vector(pos[0] - radius, pos[1], pos[2] - radius);
1107 vector max = Vector(pos[0] + radius, pos[1], pos[2] + radius);
1109 }
1110 }
1111
1140
1172
1174
1177
1180
1182
1183 proto native void AddPPMask(float ndcX, float ndcY, float ndcRadius, float ndcBlur);
1184
1186
1195
1202
1203
1204 proto native void OpenURL(string url);
1205
1208
1209 //-----------------------------------------------------------------------------
1210 // persitence
1211 //-----------------------------------------------------------------------------
1212
1215
1224
1225 //-----------------------------------------------------------------------------
1226
1240 {
1242
1243 ConfigGetFullPath("CfgVehicles " + cfg_class_name, full_path);
1244
1245 if (full_path.Count() == 0)
1247
1248 if (full_path.Count() == 0)
1249 ConfigGetFullPath("CfgMagazines " + cfg_class_name, full_path);
1250
1251 if (full_path.Count() == 0)
1252 ConfigGetFullPath("cfgWeapons " + cfg_class_name, full_path);
1253
1254 if (full_path.Count() == 0)
1255 ConfigGetFullPath("CfgNonAIVehicles " + cfg_class_name, full_path);
1256
1257 cfg_parent_name.ToLower();
1258 for (int i = 0; i < full_path.Count(); i++)
1259 {
1260 string tmp = full_path.Get(i);
1261 tmp.ToLower();
1262 if (tmp == cfg_parent_name)
1263 return true;
1264 }
1265
1266 return false;
1267 }
1268
1282 {
1285
1286 cfg_parent_name.ToLower();
1287
1288 for (int i = 0; i < full_path.Count(); i++)
1289 {
1290 string tmp = full_path.Get(i);
1291 tmp.ToLower();
1292 if (tmp == cfg_parent_name)
1293 return true;
1294 }
1295
1296 return false;
1297 }
1298
1308 {
1310 for (int index = 0; index < class_count; index++)
1311 {
1312 string found_class = "";
1315 return index;
1316 }
1317 return -1;
1318 }
1319
1322
1337
1339
1348 TimerQueue GetTimerQueue(int call_category) {}
1349
1353 DragQueue GetDragQueue() {}
1354
1357
1360
1363
1365 {
1366 }
1367
1369
1372
1375 {
1376 return (g_Game.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU);
1377 }
1378
1380 {
1381 //Print("GetMenuDefaultCharacterData");
1382 //DumpStack();
1383 //if used on server, creates an empty container to be filled by received data
1384 if (!m_CharacterData)
1385 {
1387 if (fill_data)
1388 GetGame().GetMenuData().RequestGetDefaultCharacterData(); //fills the structure
1389 }
1390 return m_CharacterData;
1391 }
1392
1393 //Analytics Manager
1398
1403};
const int RF_DEFAULT
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Definition DayZGame.c:3528
Mission mission
static int GAME_STORAGE_VERSION
Definition Game.c:5
Icon x
Icon y
class OptionSelectorMultistate extends OptionSelector class_name
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
enum WaveKind AbstractSoundScene()
Definition Sound.c:18
class SoundObjectBuilder SoundObject(SoundParams soundParams)
Static data holder for certain ammo config values.
Definition AmmoEffects.c:6
static void Cleanup()
Clean up the data.
static void Init()
Initialize the containers: this is done this way, to have these not exist on server.
Class that holds parameters to feed into CGame.IsBoxCollidingGeometryProxy.
proto void ObjectGetDisplayName(Object obj, out string name)
proto native UIManager GetUIManager()
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
proto native void ConfigGetTextArrayRaw(string path, out TStringArray values)
Get array of raw strings from config on path.
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native void GetObjectsAtPosition(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in circle "radius" around position "pos".
proto GetServersResultRow GetHostData()
Gets the server data. (from client)
float GetHighestSurfaceYDifference(array< vector > positions)
Returns the largest height difference between the given positions.
Definition Game.c:1051
proto native void MuteAllPlayers(string listenerId, bool mute)
Mute all players for listenerId.
proto void SurfaceUnderObjectByBone(notnull Object object, int boneType, out string type, out int liquidType)
proto native void CopyToClipboard(string text)
void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
Called after remote procedure call is recieved for this object.
Definition Game.c:199
proto native void ConfigGetFullPath(string path, out TStringArray full_path)
proto native int GetDiagDrawMode()
Gets current debug draw mode.
proto native void RestartMission()
proto native bool AddInventoryJuncture(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms)
proto native void ResetPPMask()
proto native bool IsBoxCollidingGeometry(vector center, vector orientation, vector edgeLength, int iPrimaryType, int iSecondaryType, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
Finds all objects with geometry iType that are in choosen oriented bounding box (OBB)
proto native bool IsMicCapturing()
Returns whether mic is currently capturing audio from user.
proto native NoiseSystem GetNoiseSystem()
proto native bool HasInventoryJunctureDestination(Man player, notnull InventoryLocation dst)
proto native int LoadVersion()
Returns actual storage version - loading.
proto native vector ConfigGetVector(string path)
Get vector value from config on path.
proto native bool IsInPartyChat()
Returns whether user is currently in a voice party (currently only supported on xbox)
proto void GetWorldName(out string world_name)
proto native float SurfaceY(float x, float z)
proto native float GetTickTime()
Returns current time from start of the game.
proto native void GetObjectsAtPosition3D(vector pos, float radius, out array< Object > objects, out array< CargoBase > proxyCargos)
Returns list of all objects in sphere "radius" around position "pos".
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
proto native bool VerifyWorldOwnership(string sWorldName)
proto native void AddPPMask(float ndcX, float ndcY, float ndcRadius, float ndcBlur)
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native float SurfaceGetSeaLevel()
proto native void GetPlayers(out array< Man > players)
proto native void EnableVoN(Object player, bool enable)
Enable/disable VoN for target player.
proto native float GetWaterDepth(vector posWS)
proto native void GetPlayerIndentities(out array< PlayerIdentity > identities)
proto native WorkspaceWidget GetLoadingWorkspace()
proto owned string GetHostName()
Gets the server name. (from client)
void OnMouseButtonPress(int button)
Called when mouse button is pressed.
Definition Game.c:171
proto native void PlayMission(string path)
Starts mission (equivalent for SQF playMission). You MUST use double slash \.
void OnPostUpdate(bool doSim, float timeslice)
Called on World update after simulation of entities.
Definition Game.c:147
proto native void SetVoiceEffect(Object player, int effect, bool enable)
Enable/disable VoN effect (only on server)
proto native void SelectPlayer(PlayerIdentity identity, Object player)
Selects player's controlled object.
proto native void ProfilerStop(string name)
Use for profiling code from start to stop, they must match have same name, look wiki pages for more i...
void OnAfterCreate()
Called after creating of CGame instance.
Definition Game.c:100
string CreateDefaultPlayer()
returns class name of first valid survivor (TODO address confusing naming?)
Definition Game.c:1356
proto native void SetPlayerName(string name)
Sets current player name.
proto native void SetProfileString(string name, string value)
Sets string to profile variable.
proto native void AddToReconnectCache(PlayerIdentity identity)
Add player to reconnect cache to be able to rejoin character still existing in the world.
proto native World GetWorld()
void CGame()
Definition Game.c:33
string ConfigPathToString(TStringArray array_path)
Converts array of strings into single string.
Definition Game.c:608
proto native void ConfigGetIntArray(string path, out TIntArray values)
Get array of integers from config on path.
proto native vector GetScreenPos(vector world_pos)
Transforms position in world to position in screen in pixels as x, y component of vector,...
proto native Object CreateObject(string type, vector pos, bool create_local=false, bool init_ai=false, bool create_physics=true)
Creates object of certain type.
proto native bool GoBuyWorldDLC(string sWorldName)
proto native vector ObjectGetSelectionPositionMS(Object obj, string name)
proto native void BeginOptionsVideo()
proto void SurfaceGetType3D(float x, float y, float z, out string type)
proto native vector GetWorldDirectionFromScreen(vector world_pos)
Transforms position in world to position in screen in pixels as x, y component of vector,...
proto native bool IsBoxCollidingGeometryProxy(notnull BoxCollidingParams params, array< Object > excludeObjects, array< ref BoxCollidingResult > collidedObjects=NULL)
proto native bool IsMultiplayer()
string GetModelName(string class_name)
Get name of the p3d file of the given class name.
Definition Game.c:469
proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd=RoadSurfaceDetection.LEGACY)
proto native void MutePlayer(string muteUID, string playerUID, bool mute)
Mutes voice of source player to target player.
proto native void RequestRestart(int code)
Sets exit code and restart in the right moment.
DayZPlayer GetPlayerByIndex(int index=0)
Definition Game.c:814
proto native bool SurfaceIsSea(float x, float z)
proto native vector ObjectGetSelectionPositionWS(Object obj, string name)
DragQueue GetDragQueue()
Definition Game.c:1353
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
Definition Game.c:1239
proto native int SaveVersion()
Returns actual storage version - saving.
proto bool GetHostAddress(out string address, out int port)
Gets the server address. (from client)
proto native SoundWaveOnVehicle CreateSoundWaveOnObject(Object source, SoundObject soundObject, AbstractWave soundWave)
proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec)
Assign player entity to client (in multiplayer)
proto native void UpdateSpectatorPosition(vector position)
Updates spectator position on server = position of network bubble.
void OnKeyPress(int key)
Called when key is pressed.
Definition Game.c:155
void SetDebugMonitorEnabled(int value)
Definition Game.c:1021
proto native void GetProfileStringList(string name, out TStringArray values)
Gets array of strings from profile variable.
ref array< ref Param > m_ParamCache
Definition Game.c:14
proto native void SelectSpectator(PlayerIdentity identity, string spectatorObjType, vector position)
Creates spectator object (mostly cameras)
proto native BiosUserManager GetUserManager()
proto native void DumpInstances(bool csvFormatting)
Delevoper only: Dump all script allocations.
proto native bool IsDebug()
proto native void ConfigGetObjectFullPath(Object obj, out TStringArray full_path)
string ConfigGetTextOut(string path)
Get string value from config on path.
Definition Game.c:445
bool IsSurfaceFertile(string surface)
Checks if the surface is fertile.
Definition Game.c:1094
proto native void GetDiagModeNames(out TStringArray diag_names)
Get list of all debug modes.
ScriptCallQueue GetCallQueue(int call_category)
Definition Game.c:1336
proto native void GetModInfos(notnull out array< ref ModInfo > modArray)
proto bool ConfigGetTextRaw(string path, out string value)
Get raw string value from config on path.
proto native bool GetModToBeReported()
proto native vector SurfaceGetNormal(float x, float z)
proto native void SetMainMenuWorld(string world)
proto native bool IsBoxColliding(vector center, vector orientation, vector edgeLength, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
Finds all objects that are in choosen oriented bounding box (OBB)
void RPCSelfSingleParam(Object target, int rpcType, Param param)
Definition Game.c:888
proto native void RequestExit(int code)
Sets exit code and quits in the right moment.
void OnLicenseChanged()
Definition Game.c:92
bool ClearJunctureEx(Man player, notnull EntityAI item)
Definition Game.c:736
proto native vector GetPointerDirection()
Returns the direction where the mouse points, from the camera view.
bool ObjectIsKindOf(Object object, string cfg_parent_name)
Returns is object inherited from parent class name.
Definition Game.c:1281
proto native void ClearReconnectCache()
Remove all player from reconnect cache.
bool FormatRawConfigStringKeys(inout string value)
Changes localization key format to script-friendly format.
Definition Game.c:457
proto native MenuData GetMenuData()
Return singleton of MenuData class - at main menu contains characters played with current profile.
proto native bool ConfigIsExisting(string path)
proto native AbstractSoundScene GetSoundScene()
proto native void ChatMP(Man recipient, string text, string colorClass)
proto native vector ObjectGetSelectionPositionLS(Object obj, string name)
proto native bool AddActionJuncture(Man player, notnull EntityAI item, int timeout_ms)
proto native void RemoteObjectTreeDelete(Object obj)
RemoteObjectDelete - deletes only remote object (unregisters from network). do not use if not sure wh...
proto native void UpdatePathgraphRegion(vector regionMin, vector regionMax)
void OnProcessLifetimeChanged(int plmtype)
Definition Game.c:87
proto native void InitDamageEffects(Object effect)
Initialization of damage effects.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native bool IsServer()
proto native void DisconnectPlayer(PlayerIdentity identity, string uid="")
Destroy player info and disconnect.
proto native void SetMission(Mission mission)
void OnActivateMessage()
Called when recieving focus (windows)
Definition Game.c:107
bool IsSurfaceDigable(string surface)
Checks if the surface is digable.
Definition Game.c:1088
UIScriptedMenu CreateScriptedMenu(int id)
create custom main menu part (submenu)
Definition Game.c:186
proto native void ObjectDeleteOnClient(Object obj)
proto bool ConfigGetBaseName(string path, out string base_name)
Get name of base class of config class on path.
proto native bool RegisterNetworkStaticObject(Object object)
Static objects cannot be replicated by default (there are too many objects on the map)....
void UpdatePathgraphRegionByObject(Object object)
Definition Game.c:1099
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native bool IsPhysicsExtrapolationEnabled()
If physics extrapolation is enabled, always true on retail release builds.
proto native bool ClearJuncture(Man player, notnull EntityAI item)
proto void FormatString(string format, string params[], out string output)
proto native void AdminLog(string text)
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
bool IsDebugMonitor()
Definition Game.c:1026
bool IsMissionMainMenu()
Returns true when current mission is Main Menu.
Definition Game.c:1374
proto native void OverrideInventoryLights(vector diffuse, vector ambient, vector ground, vector dir)
proto native void LogoutRequestTime()
Logout methods.
proto native bool SurfaceIsPond(float x, float z)
proto native void LogoutRequestCancel()
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
void DayZGame()
Definition DayZGame.c:947
proto bool GetProfileString(string name, out string value)
Gets string from profile variable.
proto native void Chat(string text, string colorClass)
Prints text into game chat.
void ~CGame()
Definition Game.c:62
int m_DebugMonitorEnabled
Definition Game.c:10
ScriptInvoker GetUpdateQueue(int call_category)
Definition Game.c:1338
proto native float GetFps()
Returns average FPS of last 16 frames.
void OnEvent(EventType eventTypeId, Param params)
Called when some system event occur.
Definition Game.c:82
proto native owned string GetMainMenuWorld()
proto native bool ScriptTest()
proto native void RPC(Object target, int rpcType, notnull array< ref Param > params, bool guaranteed, PlayerIdentity recipient=null)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto native DayZPlayer GetPlayer()
proto native void StorageVersion(int iVersion)
Set actual storage version - for next save.
proto native void ProfilerStart(string name)
Use for profiling code from start to stop, they must match have same name, look wiki pages for more i...
proto native WorkspaceWidget GetWorkspace()
UIScriptedWindow CreateScriptedWindow(int id)
create custom window part
Definition Game.c:191
proto native void RemoteObjectDelete(Object obj)
bool IsInventoryOpen()
Definition Game.c:1364
proto native void EndOptionsVideo()
proto native void OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
proto native void SendLogoutTime(Object player, int time)
Inform client about logout time (creates logout screen on specified client)
AnalyticsManagerServer GetAnalyticsServer()
Definition Game.c:1394
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
proto void SurfaceGetType(float x, float z, out string type)
proto native void SaveProfile()
Saves profile on disk.
bool AddInventoryJunctureEx(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms)
Definition Game.c:717
proto native Weather GetWeather()
Returns weather controller object.
proto native void EnableMicCapture(bool enable)
Enable microphone to locally capture audio from user. Audio heard does NOT automatically get transmit...
TimerQueue GetTimerQueue(int call_category)
Definition Game.c:1348
proto native bool IsDedicatedServer()
Robust check which is preferred than the above, as it is valid much sooner.
proto native bool IsAppActive()
Returns if the application is focused on PC, returns true always on console.
proto native vector GetCurrentCameraPosition()
void OnKeyRelease(int key)
Called when key is released.
Definition Game.c:163
proto native bool IsObjectAccesible(EntityAI item, Man player)
returns true if player can access item's cargo/attachments (check only distance)
proto void GetPlayerNameShort(int maxLength, out string name)
Gets current player name. If length of player name is grater than maxLength, then it is omitted and a...
proto native float SurfaceRoadY3D(float x, float y, float z, RoadSurfaceDetection rsd)
proto int GetTime()
returns mission time in milliseconds
bool OnInitialize()
Called once before game update loop starts, ret value indicates if init was done in scripts,...
Definition Game.c:121
proto native void SetVoiceLevel(int level)
Set voice level of VoN (only on client) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
proto native void NightVissionLightParams(float lightIntensityMul, float noiseIntensity)
proto native bool IsClient()
proto native int ObjectRelease(Object obj)
RemoteObjectTreeCreate - postponed registration of network object tree (and creation of remote object...
proto native int ConfigGetType(string path)
Returns type of config value.
proto native vector ObjectWorldToModel(Object obj, vector worldPos)
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
proto native Object CreateStaticObjectUsingP3D(string p3dFilename, vector position, vector orientation, float scale=1.0, bool createLocal=false)
ScriptModule GameScript
Definition Game.c:12
proto native void SetDiagModeEnable(int diag_mode, bool enabled)
Set specific debug mode.
proto native void RespawnPlayer()
vector GetSurfaceOrientation(float x, float z)
Returns tilt of the ground on the given position in degrees, so you can use this value to rotate any ...
Definition Game.c:1075
proto native int Connect(UIScriptedMenu parent, string IpAddress, int port, string password)
Connects to IsServer.
proto native void SetProfileStringList(string name, TStringArray values)
Sets array of strings to profile variable.
proto native void RemoveFromReconnectCache(string uid)
Remove player from reconnect cache.
native void CreateMission(string path)
Create only enforce script mission, used for mission script reloading.
proto native void DisconnectSessionForce()
Forces disconnect from current multiplayer session even if not yet in the game.
AnalyticsManagerClient GetAnalyticsClient()
Definition Game.c:1399
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
Definition Game.c:881
proto native int ConnectLastSession(UIScriptedMenu parent, int selectedCharacter=-1)
Connects to last success network session.
proto native void RemoteObjectTreeCreate(Object obj)
RemoteObjectCreate - postponed registration of network object (and creation of remote object)....
proto native void SetDiagDrawMode(int diag_draw_mode)
Set debug draw mode.
void OnDeactivateMessage()
Called when loosing focus (windows)
Definition Game.c:114
proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex)
proto void GetPlayerName(out string name)
Gets current player name.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
ref AnalyticsManagerServer m_AnalyticsManagerServer
Definition Game.c:17
proto native vector GetCurrentCameraDirection()
proto void GetVersion(out string version)
string GetWorldName()
Definition Game.c:799
proto native bool ExecuteEnforceScript(string expression, string mainFnName)
Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script ...
void OnUpdate(bool doSim, float timeslice)
Called on World update.
Definition Game.c:138
proto native bool HasInventoryJunctureItem(notnull EntityAI item)
proto native EntityAI GetEntityByPersitentID(int b1, int b2, int b3, int b4)
proto native void OpenURL(string url)
proto bool CommandlineGetParam(string name, out string value)
Get command line parameter value.
string CreateRandomPlayer()
returns class name of random survivor (TODO address confusing naming?)
Definition Game.c:1359
static bool IsDigitalCopy()
Definition Game.c:1010
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
void OnDeviceReset()
Called when inputs is not possible (Steam overlay active or something), all internal script variables...
Definition Game.c:129
void OnMouseButtonRelease(int button)
Called when mouse button is released.
Definition Game.c:179
proto native float GetDayTime()
Returns current daytime on server.
proto void CopyFromClipboard(out string text)
proto native void SetLoginTimerFinished()
int ConfigFindClassIndex(string config_path, string searched_member)
Definition Game.c:1307
proto native void SetEVUser(float value)
Sets custom camera camera EV. range: -50.0..50.0? //TODO.
proto native bool PreloadObject(string type, float distance)
Preload objects with certain type in certain distance from camera.
ref AnalyticsManagerClient m_AnalyticsManagerClient
Definition Game.c:18
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
proto native int ServerConfigGetInt(string name)
Server config parsing. Returns 0 if not found.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType)
proto native void ChatPlayer(string text)
proto native vector ObjectGetSelectionPosition(Object obj, string name)
proto native bool GetDiagModeEnable(int diag_mode)
Gets state of specific debug mode.
proto void GetPlayerNetworkIDByIdentityID(int playerIdentityID, out int networkIdLowBits, out int networkIdHightBits)
returns player's network id from identity id in out parameters
proto native Input GetInput()
proto native ContentDLC GetContentDLCService()
Return DLC service (service for entitlement keys for unlock content)
proto native void StartRandomCutscene(string world)
Starts intro.
proto native bool ExtendActionJuncture(Man player, notnull EntityAI item, int timeout_ms)
ScriptInvoker GetPostUpdateQueue(int call_category)
Definition Game.c:1340
proto native Mission GetMission()
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
Definition Game.c:1379
TStringArray ListAvailableCharacters()
outputs array of all valid survivor class names
Definition Game.c:1362
proto native Object GetObjectByNetworkId(int networkIdLowBits, int networkIdHighBits)
Returns entity identified by network id.
proto native bool CanRespawnPlayer()
proto native void DisconnectSession()
Disconnects from current multiplayer session.
proto native void ObjectDelete(Object obj)
proto native void RemoteObjectCreate(Object obj)
RemoteObjectDelete - deletes only remote object tree (unregisters from network). do not use if not su...
proto void ObjectGetType(Object obj, out string type)
proto native vector ObjectModelToWorld(Object obj, vector modelPos)
proto native void RPCSelf(Object target, int rpcType, notnull array< ref Param > params)
Not actually an RPC, as it will send it only to yourself.
proto native void GetDiagDrawModeNames(out TStringArray diag_names)
Get list of all debug draw modes.
ref MenuDefaultCharacterData m_CharacterData
Definition Game.c:19
proto native void StoreLoginData(ParamsWriteContext ctx)
Stores login userdata as parameters which are sent to server.
ContentDLC is for query installed DLC (only as entitlement keys, not content)
Definition ContentDLC.c:11
Definition Debug.c:14
static void InventoryReservationLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:173
Definition Camera.c:2
Definition input.c:11
InventoryLocation.
static string DumpToStringNullSafe(InventoryLocation loc)
static void Init()
Definition Debug.c:689
static bool IsInventoryReservationLogEnable()
Definition Debug.c:739
Definition EnMath.c:7
Mission class.
Definition gameplay.c:668
static bool IsGameActive(bool sim)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
The class that will be instanced (moddable)
Definition gameplay.c:376
Manager class for managing Effect (EffectParticle, EffectSound)
static void Cleanup()
Cleanup method to properly clean up the static data.
static void Init()
Initialize the containers.
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
Definition tools.c:53
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
Module containing compiled scripts.
Definition EnScript.c:131
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
Manager class which handles Voice-over-network functionality while player is connected to a server.
Definition VONManager.c:242
static void CleanupInstance()
Uninitializes VONManager, runs when user disconnects from server.
Definition VONManager.c:266
static void Init()
Initializes VONManager, runs when user first connects to a server.
Definition VONManager.c:257
Definition World.c:2
proto native CGame GetGame()
array< string > TStringArray
Definition EnScript.c:666
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto int Randomize(int seed)
Sets the seed for the random number generator.