Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
game.c
Go to the documentation of this file.
1
4
5static int GAME_STORAGE_VERSION = 142;
6
7class CGame
8{
9 // enableDebugMonitor in server config
11
13
14 //Obsolete, port [Obsolete()] as well, maybe?
16
17 //analytics
21
22 #ifdef DIAG_DEVELOPER
23 ref array<ComponentEnergyManager> m_EnergyManagerArray;
24 void EnableEMPlugs(bool enable)
25 {
26 for (int i = 0; i < g_Game.m_EnergyManagerArray.Count(); ++i)
27 {
28 if (g_Game.m_EnergyManagerArray[i])
29 g_Game.m_EnergyManagerArray[i].SetDebugPlugs(enable);
30 }
31 }
32 #endif
33
34 void CGame()
35 {
36 Math.Randomize(-1);
37
39
41 m_ParamCache.Insert(null);
42
43 //analytics
46
47 //m_CharacterData = new MenuCharacrerData;
48
49 // actual script version - increase by one when you make changes
51
52 #ifdef DIAG_DEVELOPER
53 m_EnergyManagerArray = new array<ComponentEnergyManager>;
54 #endif
55
56 if (!IsDedicatedServer())
57 {
61 if (!IsMultiplayer())
62 {
64 }
65 }
66 else
67 {
69 }
70 }
71
72 private void ~CGame()
73 {
74 // Clean these up even if it is dedicated server, just to be safe
78
79 // Is initialized in StartupEvent
80 ParticleManager.CleanupInstance();
81 g_Game = null;
82 }
83
86
88
93 void OnEvent(EventType eventTypeId, Param params)
94 {
95 }
96
97 //PLM Type: 0 == RESUMED, 1 == SUSPENDED
98 void OnProcessLifetimeChanged(int plmtype)
99 {
100
101 }
102
104 {
105
106 }
107
112 {
113 }
114
119 {
120 }
121
126 {
127 }
128
133 {
134 return false;
135 }
136
141 {
142 }
143
149 void OnUpdate(bool doSim, float timeslice)
150 {
151 }
152
158 void OnPostUpdate(bool doSim, float timeslice)
159 {
160 }
161
166 void OnKeyPress(int key)
167 {
168 }
169
174 void OnKeyRelease(int key)
175 {
176 }
177
182 void OnMouseButtonPress(int button)
183 {
184 }
185
190 void OnMouseButtonRelease(int button)
191 {
192 }
193
198
203
210 void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
211 {
212 }
213
217 proto native void RequestExit( int code );
218
222 proto native void RequestRestart(int code);
223
227 proto native bool IsAppActive();
228
232 proto bool GetHostAddress( out string address, out int port );
233
237 proto owned string GetHostName();
238
243
251 proto native int Connect( UIScriptedMenu parent , string IpAddress, int port, string password );
256 proto native int ConnectLastSession( UIScriptedMenu parent , int selectedCharacter = -1 );
260 proto native void DisconnectSession();
261
265 proto native void DisconnectSessionForce();
266
267 // profile functions
278 proto native void GetProfileStringList(string name, out TStringArray values);
279
286 proto bool GetProfileString(string name, out string value);
287
293 proto native void SetProfileStringList(string name, TStringArray values);
294
300 proto native void SetProfileString(string name, string value);
301
305 proto native void SaveProfile();
306
311 proto void GetPlayerName(out string name);
312
318 proto void GetPlayerNameShort(int maxLength, out string name);
319
324 proto native void SetPlayerName(string name);
325
331 proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec);
332
339 proto native void SelectPlayer(PlayerIdentity identity, Object player);
340
348 proto void GetPlayerNetworkIDByIdentityID( int playerIdentityID, out int networkIdLowBits, out int networkIdHightBits );
349
355 proto native Object GetObjectByNetworkId( int networkIdLowBits, int networkIdHighBits );
356
362 proto native bool RegisterNetworkStaticObject(Object object);
363
370 proto native bool IsNetworkInputBufferFull();
371
378 proto native void SelectSpectator(PlayerIdentity identity, string spectatorObjType, vector position);
379
384 proto native void UpdateSpectatorPosition(vector position);
385
392 proto native void SendLogoutTime(Object player, int time);
393
398 proto native void DisconnectPlayer(PlayerIdentity identity, string uid = "");
399
405 proto native void AddToReconnectCache(PlayerIdentity identity);
406
412 proto native void RemoveFromReconnectCache(string uid);
413
418 proto native void ClearReconnectCache();
419
420
424 proto native void StorageVersion( int iVersion );
425
429 proto native int LoadVersion();
430
434 proto native int SaveVersion();
435
439 proto native float GetDayTime();
440
441 // config functions
448 proto bool ConfigGetText(string path, out string value);
449
457 proto bool ConfigGetTextRaw(string path, out string value);
458
464 string ConfigGetTextOut(string path)
465 {
466 string ret_s;
467 ConfigGetText(path, ret_s);
468 return ret_s;
469 }
470
476 bool FormatRawConfigStringKeys(inout string value)
477 {
478 int ret;
479 ret = value.Replace("$STR_","#STR_");
480 return ret > 0;
481 }
482
489 {
490 if ( class_name != "" )
491 {
492 string cfg = "CfgVehicles " + class_name + " model";
493 string model_path;
494 if ( g_Game.ConfigGetText(cfg, model_path) )
495 {
496 int to_substring_end = model_path.Length() - 4; // -4 to leave out the '.p3d' suffix
497 int to_substring_start = 0;
498
499 // 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
500 for (int i = to_substring_end; i > 0; i--)
501 {
502 string sign = model_path.Get(i);
503 if ( sign == "\\" )
504 {
505 to_substring_start = i + 1;
506 break
507 }
508 }
509
510 string model_name = model_path.Substring(to_substring_start, to_substring_end - to_substring_start);
511 return model_name;
512 }
513 }
514
515 return "UNKNOWN_P3D_FILE";
516 }
517
523 proto native float ConfigGetFloat(string path);
524
525
531 proto native vector ConfigGetVector(string path);
532
538 proto native int ConfigGetInt(string path);
539
545 proto native int ConfigGetType(string path);
546
557 proto native void ConfigGetTextArray(string path, out TStringArray values);
558
570 proto native void ConfigGetTextArrayRaw(string path, out TStringArray values);
571
577 proto native void ConfigGetFloatArray(string path, out TFloatArray values);
578
584 proto native void ConfigGetIntArray(string path, out TIntArray values);
585
593 proto bool ConfigGetChildName(string path, int index, out string name);
594
601 proto bool ConfigGetBaseName(string path, out string base_name);
602
610 proto native int ConfigGetChildrenCount(string path);
611 proto native bool ConfigIsExisting(string path);
612
613 proto native void ConfigGetFullPath(string path, out TStringArray full_path);
614 proto native void ConfigGetObjectFullPath(Object obj, out TStringArray full_path);
615
616 proto native void GetModInfos(notnull out array<ref ModInfo> modArray);
617 proto native bool GetModToBeReported();
618
628 {
629 string return_path = "";
630 int count = array_path.Count();
631
632 for (int i = 0; i < count; i++)
633 {
634 return_path += array_path.Get(i);
635
636 if ( i < count - 1 )
637 {
638 return_path += " ";
639 }
640 }
641
642 return return_path;
643 }
644
660 proto bool CommandlineGetParam(string name, out string value);
661
662 proto native void CopyToClipboard(string text);
663 proto void CopyFromClipboard(out string text);
664
665 proto native void BeginOptionsVideo();
666 proto native void EndOptionsVideo();
667
668 proto native void AdminLog(string text);
669
670 // entity functions
677 proto native bool PreloadObject( string type, float distance );
678
679 proto native Object CreateStaticObjectUsingP3D(string p3dFilename, vector position, vector orientation, float scale = 1.0, bool createLocal = false);
680
690 proto native Object CreateObject( string type, vector pos, bool create_local = false, bool init_ai = false, bool create_physics = true );
691 proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local = false);
692 proto native SoundWaveOnVehicle CreateSoundWaveOnObject(Object source, SoundObject soundObject, AbstractWave soundWave);
693
702 proto native Object CreateObjectEx( string type, vector pos, int iFlags, int iRotation = RF_DEFAULT );
703
704 proto native void ObjectDelete( Object obj );
705 proto native void ObjectDeleteOnClient( Object obj );
706 proto native void RemoteObjectDelete( Object obj );
707 proto native void RemoteObjectTreeDelete( Object obj );
708 proto native void RemoteObjectCreate( Object obj );
709 proto native void RemoteObjectTreeCreate( Object obj );
710 proto native int ObjectRelease( Object obj );
711 proto void ObjectGetType( Object obj, out string type );
712 proto void ObjectGetDisplayName( Object obj, out string name );
713 proto native vector ObjectGetSelectionPosition(Object obj, string name);
717 proto native vector ObjectModelToWorld(Object obj, vector modelPos);
718 proto native vector ObjectWorldToModel(Object obj, vector worldPos);
720 proto native bool IsObjectAccesible(EntityAI item, Man player);
721
722#ifdef DIAG_DEVELOPER
723 proto native void ReloadShape(Object obj);
724#endif
725
726 // input
727 proto native Input GetInput();
728
729 // camera
732
733 // sound
735
736 // noise
738
739 // inventory
740 proto native bool AddInventoryJuncture(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms, Managed userData = null);
741
742 bool AddInventoryJunctureEx(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms, Managed userData = null)
743 {
744 bool result = AddInventoryJuncture(player, item, dst, test_dst_occupancy, timeout_ms/*10000000*/, userData);
745 #ifdef ENABLE_LOGGING
747 {
748 Debug.InventoryReservationLog("STS = " + player.GetSimulationTimeStamp() + " result: " + result + " item:" + item + " dst: " + InventoryLocation.DumpToStringNullSafe(dst), "n/a" , "n/a", "AddInventoryJuncture",player.ToString() );
749 }
750 #endif
751 //Print("Juncture - STS = " + player.GetSimulationTimeStamp() + " item:" + item + " dst: " + InventoryLocation.DumpToStringNullSafe(dst));
752 return result;
753 }
754
755 //Has inventory juncture for any player
756 proto native bool HasInventoryJunctureItem(notnull EntityAI item);
757 proto native bool HasInventoryJuncture(Man player, notnull EntityAI item);
758 proto native bool HasInventoryJunctureDestination(Man player, notnull InventoryLocation dst);
759 proto native bool AddActionJuncture(Man player, notnull EntityAI item, int timeout_ms, Managed userData = null);
760 proto native bool ExtendActionJuncture(Man player, notnull EntityAI item, int timeout_ms);
761 proto native bool ClearJuncture(Man player, notnull EntityAI item);
762
763 bool ClearJunctureEx(Man player, notnull EntityAI item)
764 {
765 #ifdef ENABLE_LOGGING
767 {
768 Debug.InventoryReservationLog("STS = " + player.GetSimulationTimeStamp()+ " item:" + item, "n/a" , "n/a", "ClearJuncture",player.ToString() );
769 }
770 #endif
771 return ClearJuncture( player, item);
772 }
773
774 // support
776 proto native bool ExecuteEnforceScript(string expression, string mainFnName);
778 proto native void DumpInstances(bool csvFormatting);
779
780 proto native bool ScriptTest();
782 proto native void GetDiagModeNames(out TStringArray diag_names);
784 proto native void SetDiagModeEnable(int diag_mode, bool enabled);
786 proto native bool GetDiagModeEnable(int diag_mode);
787
789 proto native void GetDiagDrawModeNames(out TStringArray diag_names);
791 proto native void SetDiagDrawMode(int diag_draw_mode);
793 proto native int GetDiagDrawMode();
794
796 proto native bool IsPhysicsExtrapolationEnabled();
797
801 [Obsolete("Use GizmoApi.GetCount")]
802 proto native int GizmoGetCount();
803
807 [Obsolete("Use GizmoApi.GetInstance")]
808 proto native Class GizmoGetInstance(int index);
809
813 [Obsolete("Use GizmoApi.GetTracker")]
814 proto native Managed GizmoGetTracker(int index);
815
819 [Obsolete("Use GizmoApi.FindByTracker")]
820 proto native int GizmoFindByTracker(Managed tracker);
821
825 [Obsolete("Use GizmoApi.Deselect")]
826 proto native void GizmoClear(int index);
827
831 [Obsolete("Use GizmoApi.DeselectAll")]
832 proto native void GizmoClearAll();
833
839 [Obsolete("Use GizmoApi.SelectObject")]
840 proto native void GizmoSelectObject(Object object);
841
849 [Obsolete("Use GizmoApi.SelectPhysics")]
850 proto native void GizmoSelectPhysics(Physics physics);
851
859 [Obsolete("Use GizmoApi.SelectUser")]
860 proto native void GizmoSelectUser(Managed instance);
861
866 proto native float GetFps();
867
872 proto native float GetLastFPS();
873
879 proto native float GetAvgFPS(int nFrames = 64);
880
886 proto native float GetMinFPS(int nFrames = 64);
887
893 proto native float GetMaxFPS(int nFrames = 64);
894
902 void GetFPSStats(out float min, out float max, out float avg, int nFrames = 64)
903 {
904 min = GetMinFPS(nFrames);
905 max = GetMaxFPS(nFrames);
906 avg = GetAvgFPS(nFrames);
907 }
908
913 proto native float GetTickTime();
914
915 proto void GetInventoryItemSize(InventoryItem item, out int width, out int height);
922 proto native void GetObjectsAtPosition(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargos);
929 proto native void GetObjectsAtPosition3D(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargos);
930 proto native World GetWorld();
931 proto void GetWorldName( out string world_name );
932
934 {
935 string world_name;
936 g_Game.GetWorldName(world_name);
937 return world_name;
938 }
939
940 proto native bool VerifyWorldOwnership( string sWorldName );
941 proto native bool GoBuyWorldDLC( string sWorldName );
942
943 proto void FormatString( string format, string params[], out string output);
944 proto void GetVersion( out string version );
945 proto native UIManager GetUIManager();
946 proto native DayZPlayer GetPlayer();
947 proto native void GetPlayers( out array<Man> players );
949 {
950 array<Man> players();
951 GetPlayers(players);
952 if (index >= players.Count())
953 return null;
954 return DayZPlayer.Cast(players[index]);
955 }
956
958 proto native void StoreLoginData(ParamsWriteContext ctx);
959
965 proto native vector GetScreenPos(vector world_pos);
967 proto native vector GetScreenPosRelative(vector world_pos);
968
970 proto native MenuData GetMenuData();
1013 proto native void RPC(Object target, int rpcType, notnull array<ref Param> params, bool guaranteed,PlayerIdentity recipient = null);
1015 proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient = null);
1017 proto native void RPCSelf(Object target, int rpcType, notnull array<ref Param> params);
1018 proto native void RPCSelfSingleParam(Object target, int rpcType, Param param);
1019
1021 proto native void ProfilerStart(string name);
1023 proto native void ProfilerStop(string name);
1024
1025
1035 proto native void Chat(string text, string colorClass);
1036 proto native void ChatMP(Man recipient, string text, string colorClass);
1037 proto native void ChatPlayer(string text);
1043 proto native void MutePlayer(string muteUID, string playerUID, bool mute);
1044
1050 proto native void MuteAllPlayers(string listenerId, bool mute);
1051
1057 proto native void EnableVoN(Object player, bool enable);
1058
1065 proto native void SetVoiceEffect(Object player, int effect, bool enable);
1066
1071 proto native void SetVoiceLevel(int level);
1072
1076 proto native int GetVoiceLevel(Object player = null);
1077
1082 proto native void EnableMicCapture(bool enable);
1083
1087 proto native bool IsMicCapturing();
1088
1092 proto native bool IsInPartyChat();
1093
1094 // mission
1095 proto native Mission GetMission();
1096 proto native void SetMission(Mission mission);
1097
1098
1100 proto native void StartRandomCutscene(string world);
1102 proto native void PlayMission(string path);
1103
1105 proto protected native void CreateMission(string path);
1106 proto native void RestartMission();
1108 proto native void AbortMission();
1109 proto native void RespawnPlayer();
1110 proto native bool CanRespawnPlayer();
1111 proto native void SetLoginTimerFinished();
1112
1113 proto native void SetMainMenuWorld(string world);
1114 proto native owned string GetMainMenuWorld();
1115
1117 proto native void LogoutRequestTime();
1118 proto native void LogoutRequestCancel();
1119
1120 proto native bool IsMultiplayer();
1121 proto native bool IsClient();
1122 proto native bool IsServer();
1127 proto native bool IsDedicatedServer();
1128
1130 proto native int ServerConfigGetInt(string name);
1131
1132 // Internal build
1133 proto native bool IsDebug();
1134
1135//#ifdef PLATFORM_XBOX
1136 static bool IsDigitalCopy()
1137 {
1138 return OnlineServices.IsGameActive(false);
1139 }
1140//#endif
1141
1142 /*bool IsNewMenu()
1143 {
1144 return m_ParamNewMenu;
1145 }*/
1146
1148 {
1149 m_DebugMonitorEnabled = value;
1150 }
1151
1153 {
1154 return IsServer() && m_DebugMonitorEnabled;
1155 }
1156
1157 proto native void GetPlayerIndentities( out array<PlayerIdentity> identities );
1158
1161
1162 proto native float SurfaceY(float x, float z);
1163 proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd = RoadSurfaceDetection.LEGACY);
1164 proto native float SurfaceRoadY3D(float x, float y, float z, RoadSurfaceDetection rsd);
1166 proto float SurfaceGetType(float x, float z, out string type);
1168 proto float SurfaceGetType3D(float x, float y, float z, out string type);
1169 proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType);
1170 proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType);
1171 proto void SurfaceUnderObjectByBone(notnull Object object, int boneType, out string type, out int liquidType);
1172 proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex);
1173 proto native vector SurfaceGetNormal(float x, float z);
1174 proto native float SurfaceGetSeaLevelMin();
1175 proto native float SurfaceGetSeaLevelMax();
1176 proto native float SurfaceGetSeaLevel();
1178 proto native float SurfaceGetSeaWaveMax();
1180 proto native float SurfaceGetSeaWaveCurrent();
1181 proto native bool SurfaceIsSea(float x, float z);
1182 proto native bool SurfaceIsPond(float x, float z);
1183 proto native float GetWaterDepth(vector posWS);
1185 proto native float GetWaterSurfaceHeightNoFakeWave(vector posWS);
1188
1189 proto native void UpdatePathgraphRegion(vector regionMin, vector regionMax);
1190
1193 {
1194 float high = -9999999;
1195 float low = 99999999;
1196
1197 for (int i = 0; i < positions.Count(); i++)
1198 {
1199 vector pos = positions.Get(i);
1200 pos[1] = SurfaceRoadY( pos[0], pos[2]);
1201 float y = pos[1];
1202
1203 if ( y > high )
1204 high = y;
1205
1206 if ( y < low )
1207 low = y;
1208
1209 ;
1210 }
1211
1212 return high - low;
1213 }
1214
1217 {
1218 vector normal = g_Game.SurfaceGetNormal(x, z);
1219 vector angles = normal.VectorToAngles();
1220 angles[1] = angles[1]+270; // This fixes rotation of item so it stands vertically. Feel free to change, but fix existing use cases.
1221
1222 //Hack because setorientation and similar functions break and flip stuff upside down when using exactly this vector ¯\_(ツ)_/¯ (note: happens when surface is flat)
1223 if (angles == "0 540 0")
1224 angles = "0 0 0";
1225 return angles;
1226 }
1227
1229 bool IsSurfaceDigable(string surface)
1230 {
1231 return ConfigGetInt("CfgSurfaces " + surface + " isDigable");
1232 }
1233
1234 bool GetSurfaceDigPile(string surface, out string result)
1235 {
1236 return ConfigGetText("CfgSurfaces " + surface + " digPile", result);
1237 }
1238
1240 bool IsSurfaceFertile(string surface)
1241 {
1242 return ConfigGetInt("CfgSurfaces " + surface + " isFertile");
1243 }
1244
1245 int CorrectLiquidType(int liquidType)
1246 {
1247 if (liquidType == -1)
1248 return LIQUID_NONE;
1249
1250 if (liquidType == 0)
1251 return LIQUID_SALTWATER;
1252
1253 return liquidType;
1254 }
1255
1256 void SurfaceUnderObjectCorrectedLiquid(notnull Object object, out string type, out int liquidType)
1257 {
1258 SurfaceUnderObject(object, type, liquidType);
1259 liquidType = CorrectLiquidType(liquidType);
1260 }
1261 void SurfaceUnderObjectExCorrectedLiquid(notnull Object object, out string type, out string impact, out int liquidType)
1262 {
1263 SurfaceUnderObjectEx(object, type, impact, liquidType);
1264 liquidType = CorrectLiquidType(liquidType);
1265 }
1266 void SurfaceUnderObjectByBoneCorrectedLiquid(notnull Object object, int boneType, out string type, out int liquidType)
1267 {
1268 SurfaceUnderObjectByBone(object, boneType, type, liquidType);
1269 liquidType = CorrectLiquidType(liquidType);
1270 }
1271
1273 {
1274 if ( object )
1275 {
1276 vector pos = object.GetPosition();
1277 vector min_max[2];
1278 float radius = object.ClippingInfo ( min_max );
1279 vector min = Vector ( pos[0] - radius, pos[1], pos[2] - radius );
1280 vector max = Vector ( pos[0] + radius, pos[1], pos[2] + radius );
1281 UpdatePathgraphRegion( min, max );
1282 }
1283 }
1284
1312 proto native bool IsBoxColliding(vector center, vector orientation, vector edgeLength, array<Object> excludeObjects, array<Object> collidedObjects = NULL);
1313
1344 proto native bool IsBoxCollidingGeometry(vector center, vector orientation, vector edgeLength, int iPrimaryType, int iSecondaryType, array<Object> excludeObjects, array<Object> collidedObjects = NULL);
1345
1346 proto native bool IsBoxCollidingGeometryProxy(notnull BoxCollidingParams params, array<Object> excludeObjects, array<ref BoxCollidingResult> collidedObjects = NULL);
1347
1349 proto native Weather GetWeather();
1350
1352 proto native void SetEVUser(float value);
1353
1354 proto native void OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset);
1355
1356 proto native void AddPPMask(float ndcX, float ndcY, float ndcRadius, float ndcBlur);
1357
1358 proto native void ResetPPMask();
1359
1367 proto native void OverrideInventoryLights(vector diffuse, vector ambient, vector ground, vector dir);
1368
1374 proto native void NightVissionLightParams(float lightIntensityMul, float noiseIntensity);
1375
1376
1377 proto native void OpenURL(string url);
1378
1380 proto native void InitDamageEffects(Object effect);
1381
1382//-----------------------------------------------------------------------------
1383// persitence
1384//-----------------------------------------------------------------------------
1385
1388
1396 proto native EntityAI GetEntityByPersitentID( int b1, int b2, int b3, int b4 );
1397
1398//-----------------------------------------------------------------------------
1399
1412 bool IsKindOf(string cfg_class_name, string cfg_parent_name)
1413 {
1414 TStringArray full_path = new TStringArray;
1415
1416 ConfigGetFullPath("CfgVehicles " + cfg_class_name, full_path);
1417
1418 if (full_path.Count() == 0)
1419 {
1420 ConfigGetFullPath("CfgAmmo " + cfg_class_name, full_path);
1421 }
1422
1423 if (full_path.Count() == 0)
1424 {
1425 ConfigGetFullPath("CfgMagazines " + cfg_class_name, full_path);
1426 }
1427
1428 if (full_path.Count() == 0)
1429 {
1430 ConfigGetFullPath("cfgWeapons " + cfg_class_name, full_path);
1431 }
1432
1433 if (full_path.Count() == 0)
1434 {
1435 ConfigGetFullPath("CfgNonAIVehicles " + cfg_class_name, full_path);
1436 }
1437
1438 cfg_parent_name.ToLower();
1439 int nFullPath = full_path.Count();
1440 for (int i = 0; i < nFullPath; i++)
1441 {
1442 string tmp = full_path.Get(i);
1443 tmp.ToLower();
1444 if (tmp == cfg_parent_name)
1445 {
1446 return true;
1447 }
1448 }
1449
1450 return false;
1451 }
1452
1465 bool ObjectIsKindOf(Object object, string cfg_parent_name)
1466 {
1467 TStringArray full_path = new TStringArray;
1468 ConfigGetObjectFullPath(object, full_path);
1469
1470 cfg_parent_name.ToLower();
1471
1472 int nFullPath = full_path.Count();
1473 for (int i = 0; i < nFullPath; i++)
1474 {
1475 string tmp = full_path.Get(i);
1476 tmp.ToLower();
1477 if (tmp == cfg_parent_name)
1478 {
1479 return true;
1480 }
1481 }
1482
1483 return false;
1484 }
1485
1494 int ConfigFindClassIndex(string config_path, string searched_member)
1495 {
1496 int class_count = ConfigGetChildrenCount(config_path);
1497 for (int index = 0; index < class_count; index++)
1498 {
1499 string found_class = "";
1500 ConfigGetChildName(config_path, index, found_class);
1501 if (found_class == searched_member)
1502 {
1503 return index;
1504 }
1505 }
1506 return -1;
1507 }
1508
1510 proto int GetTime();
1511
1525 ScriptCallQueue GetCallQueue(int call_category) {}
1526
1527 ScriptInvoker GetUpdateQueue(int call_category) {}
1528
1529 ScriptInvoker GetPostUpdateQueue(int call_category) {}
1537 TimerQueue GetTimerQueue(int call_category) {}
1538
1542 DragQueue GetDragQueue() {}
1543
1546
1549
1552
1554 {
1555 }
1556
1558
1561
1564 {
1565 return (g_Game.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU);
1566 }
1567
1569 {
1570 //Print("GetMenuDefaultCharacterData");
1571 //DumpStack();
1572 //if used on server, creates an empty container to be filled by received data
1573 if (!m_CharacterData)
1574 {
1576 if (fill_data && !g_Game.IsDedicatedServer())
1577 GetMenuData().RequestGetDefaultCharacterData(); //fills the structure
1578 }
1579 return m_CharacterData;
1580 }
1581
1582 //Analytics Manager
1587
1592
1593 /*
1594 Returns the value set in server config for the length of the exit button timeout after cancelling the previous logout attempt (consoles only)
1595 */
1597};
const int RF_DEFAULT
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Static data holder for certain ammo config values.
Definition ammoeffects.c:6
static void Init()
Initialize the containers: this is done this way, to have these not exist on server.
static void Cleanup()
Clean up the data.
Class that holds parameters to feed into CGame.IsBoxCollidingGeometryProxy.
void OnPostUpdate(bool doSim, float timeslice)
Called on World update after simulation of entities.
Definition game.c:158
proto native void RemoveFromReconnectCache(string uid)
Remove player from reconnect cache.
UIScriptedMenu CreateScriptedMenu(int id)
create custom main menu part (submenu)
Definition game.c:197
proto native void RemoteObjectDelete(Object obj)
proto native bool RegisterNetworkStaticObject(Object object)
Static objects cannot be replicated by default (there are too many objects on the map).
proto native bool IsAppActive()
Returns if the application is focused on PC, returns true always on console.
proto void SurfaceUnderObject(notnull Object object, out string type, out int liquidType)
proto native void RespawnPlayer()
proto native void RPCSelfSingleParam(Object target, int rpcType, Param param)
proto void GetVersion(out string version)
proto native bool PreloadObject(string type, float distance)
Preload objects with certain type in certain distance from camera.
proto native void ObjectDelete(Object obj)
proto native void SetEVUser(float value)
Sets custom camera camera EV. range: -50.0..50.0? //TODO.
proto native void SetVoiceLevel(int level)
Set voice level of VoN (only on client) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
proto native void SetVoiceEffect(Object player, int effect, bool enable)
Enable/disable VoN effect (only on server).
proto void GetWorldName(out string world_name)
proto native float GetDayTime()
Returns current daytime on server.
proto native bool SurfaceIsPond(float x, float z)
proto native vector GetCurrentCameraDirection()
string GetWorldName()
Definition game.c:933
proto native int LoadVersion()
Returns actual storage version - loading.
proto native vector ConfigGetVector(string path)
Get vector value from config on path.
proto native void RemoteObjectTreeDelete(Object obj)
RemoteObjectDelete - deletes only remote object (unregisters from network). do not use if not sure wh...
proto native void GetDiagModeNames(out TStringArray diag_names)
Get list of all debug modes.
proto native bool VerifyWorldOwnership(string sWorldName)
proto native vector ObjectGetSelectionPosition(Object obj, string name)
void OnAfterCreate()
Called after creating of CGame instance.
Definition game.c:111
proto native void AddToReconnectCache(PlayerIdentity identity)
Add player to reconnect cache to be able to rejoin character still existing in the world.
proto native vector ObjectGetSelectionPositionWS(Object obj, string name)
proto native bool IsDedicatedServer()
Robust check which is preferred than the above, as it is valid much sooner.
TimerQueue GetTimerQueue(int call_category)
Returns TimerQueue for certain category.
Definition game.c:1537
proto native void SelectSpectator(PlayerIdentity identity, string spectatorObjType, vector position)
Creates spectator object (mostly cameras).
proto native int ServerConfigGetInt(string name)
Server config parsing. Returns 0 if not found.
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
proto native vector ObjectWorldToModel(Object obj, vector worldPos)
proto native bool IsBoxCollidingGeometryProxy(notnull BoxCollidingParams params, array< Object > excludeObjects, array< ref BoxCollidingResult > collidedObjects=NULL)
proto native float GetWaterDepth(vector posWS)
proto native void UpdateSpectatorPosition(vector position)
Updates spectator position on server = position of network bubble.
proto native Mission GetMission()
proto native void EndOptionsVideo()
bool IsInventoryOpen()
Definition game.c:1553
float GetHighestSurfaceYDifference(array< vector > positions)
Returns the largest height difference between the given positions.
Definition game.c:1192
AnalyticsManagerServer GetAnalyticsServer()
Definition game.c:1583
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native void SetLoginTimerFinished()
proto native void RPC(Object target, int rpcType, notnull array< ref Param > params, bool guaranteed, PlayerIdentity recipient=null)
Initiate remote procedure call.
proto native void InitDamageEffects(Object effect)
Initialization of damage effects.
proto native void ChatPlayer(string text)
void OnMouseButtonPress(int button)
Called when mouse button is pressed.
Definition game.c:182
ScriptInvoker GetPostUpdateQueue(int call_category)
Definition game.c:1529
proto native vector SurfaceGetNormal(float x, float z)
proto void SurfaceUnderObjectEx(notnull Object object, out string type, out string impact, out int liquidType)
proto native bool GetModToBeReported()
proto native void MuteAllPlayers(string listenerId, bool mute)
Mute all players for listenerId.
proto native bool IsNetworkInputBufferFull()
Returns the state of the buffer for network inputs (UAInterface).
proto native int GetLogoutAfterCancelTimeout()
proto bool GetHostAddress(out string address, out int port)
Gets the server address.
proto native void Chat(string text, string colorClass)
Prints text into game chat.
proto void CopyFromClipboard(out string text)
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native float SurfaceGetSeaLevel()
proto native void StartRandomCutscene(string world)
Starts intro.
proto native bool ClearJuncture(Man player, notnull EntityAI item)
proto native float GetWaterSurfaceHeightWithFakeWave(vector posWS)
Get the nearest water or object surface under a point, ignoring land (with the fake wave that's on to...
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
Definition game.c:1568
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
proto void GetPlayerNameShort(int maxLength, out string name)
Gets current player name.
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
proto native void DisconnectSessionForce()
Forces disconnect from current multiplayer session even if not yet in the game.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto bool ConfigGetBaseName(string path, out string base_name)
Get name of base class of config class on path.
proto native int ConnectLastSession(UIScriptedMenu parent, int selectedCharacter=-1)
Connects to last success network session.
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 int GizmoFindByTracker(Managed tracker)
Returned index is invalid if any other Gizmo function is called.
proto native int Connect(UIScriptedMenu parent, string IpAddress, int port, string password)
Connects to IsServer.
proto native float SurfaceGetSeaWaveCurrent()
Get current sea wave height.
proto native Object CreateStaticObjectUsingP3D(string p3dFilename, vector position, vector orientation, float scale=1.0, bool createLocal=false)
void SurfaceUnderObjectExCorrectedLiquid(notnull Object object, out string type, out string impact, out int liquidType)
Definition game.c:1261
proto native vector ObjectGetSelectionPositionMS(Object obj, string name)
DayZPlayer GetPlayerByIndex(int index=0)
Definition game.c:948
proto native void CopyToClipboard(string text)
proto native int SaveVersion()
Returns actual storage version - saving.
ref AnalyticsManagerClient m_AnalyticsManagerClient
Definition game.c:19
ScriptInvoker GetUpdateQueue(int call_category)
Definition game.c:1527
proto native Input GetInput()
proto native void SetPlayerName(string name)
Sets current player name.
proto native float SurfaceGetSeaLevelMin()
bool IsSurfaceDigable(string surface)
Checks if the surface is digable.
Definition game.c:1229
proto native void ConfigGetIntArray(string path, out TIntArray values)
Get array of integers from config on path.
proto native void OverrideInventoryLights(vector diffuse, vector ambient, vector ground, vector dir)
override inventory light
proto native void SelectPlayer(PlayerIdentity identity, Object player)
Selects player's controlled object.
proto native bool ScriptTest()
static bool IsDigitalCopy()
Definition game.c:1136
proto native void GetPlayers(out array< Man > players)
proto native void StorageVersion(int iVersion)
Set actual storage version - for next save.
proto native void GizmoClearAll()
Clear all gizmos.
proto void FormatString(string format, string params[], out string output)
string CreateDefaultPlayer()
returns class name of first valid survivor (TODO address confusing naming?)
Definition game.c:1545
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.
string ConfigPathToString(TStringArray array_path)
Converts array of strings into single string.
Definition game.c:627
proto native AbstractSoundScene GetSoundScene()
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...
bool IsMissionMainMenu()
Returns true when current mission is Main Menu.
Definition game.c:1563
proto native void SetMission(Mission mission)
proto native WorkspaceWidget GetLoadingWorkspace()
proto native DayZPlayer GetPlayer()
proto native void GetProfileStringList(string name, out TStringArray values)
Gets array of strings from profile variable.
string GetModelName(string class_name)
Get name of the p3d file of the given class name.
Definition game.c:488
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native float SurfaceGetSeaLevelMax()
string CreateRandomPlayer()
returns class name of random survivor (TODO address confusing naming?)
Definition game.c:1548
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
void OnUpdate(bool doSim, float timeslice)
Called on World update.
Definition game.c:149
proto native ContentDLC GetContentDLCService()
Return DLC service (service for entitlement keys for unlock content).
bool AddInventoryJunctureEx(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms, Managed userData=null)
Definition game.c:742
proto native void GizmoClear(int index)
Clear the gizmo.
proto native float GetAvgFPS(int nFrames=64)
Returns average framerate over last n frames.
proto native void RequestExit(int code)
Sets exit code and quits in the right moment.
void OnLicenseChanged()
Definition game.c:103
proto native void SetProfileString(string name, string value)
Sets string to profile variable.
proto native void GetPlayerIndentities(out array< PlayerIdentity > identities)
proto native void ConfigGetObjectFullPath(Object obj, out TStringArray full_path)
proto void GetPlayerName(out string name)
Gets current player name.
proto native float SurfaceRoadY3D(float x, float y, float z, RoadSurfaceDetection rsd)
proto native bool ExtendActionJuncture(Man player, notnull EntityAI item, int timeout_ms)
proto native bool SurfaceIsSea(float x, float z)
proto native void AddPPMask(float ndcX, float ndcY, float ndcRadius, float ndcBlur)
void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
Called after remote procedure call is recieved for this object.
Definition game.c:210
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
AnalyticsManagerClient GetAnalyticsClient()
Definition game.c:1588
proto native void BeginOptionsVideo()
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 void DisconnectPlayer(PlayerIdentity identity, string uid="")
Destroy player info and disconnect.
ScriptCallQueue GetCallQueue(int call_category)
Returns CallQueue for certain category.
Definition game.c:1525
proto native MenuData GetMenuData()
Return singleton of MenuData class - at main menu contains characters played with current profile.
proto native void MutePlayer(string muteUID, string playerUID, bool mute)
Mutes voice of source player to target player.
int m_DebugMonitorEnabled
Definition game.c:10
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native float GetMinFPS(int nFrames=64)
Returns minimum framerate over last n frames.
proto native float GetMaxFPS(int nFrames=64)
Returns maximum framerate over last n frames.
ref AnalyticsManagerServer m_AnalyticsManagerServer
Definition game.c:18
int CorrectLiquidType(int liquidType)
Definition game.c:1245
proto native void GizmoSelectObject(Object object)
Applies impulses to set the position when dynamic, otherwise sets the transform in the physics scene.
proto native float GetFps()
Returns average FPS of last 16 frames.
void GetFPSStats(out float min, out float max, out float avg, int nFrames=64)
Outputs framerate statistics.
Definition game.c:902
proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex)
void OnDeviceReset()
Called when inputs is not possible (Steam overlay active or something), all internal script variables...
Definition game.c:140
proto native bool GetDiagModeEnable(int diag_mode)
Gets state of specific debug mode.
proto native Object GetObjectByNetworkId(int networkIdLowBits, int networkIdHighBits)
Returns entity identified by network id.
proto native World GetWorld()
bool IsDebugMonitor()
Definition game.c:1152
proto bool GetProfileString(string name, out string value)
Gets string from profile variable.
proto native void GetDiagDrawModeNames(out TStringArray diag_names)
Get list of all debug draw modes.
proto native bool ConfigIsExisting(string path)
proto void SurfaceUnderObjectByBone(notnull Object object, int boneType, out string type, out int liquidType)
int ConfigFindClassIndex(string config_path, string searched_member)
Searches given config path (config_path) for the given member (searched_member) and returns its index...
Definition game.c:1494
proto native bool IsObjectAccesible(EntityAI item, Man player)
returns true if player can access item's cargo/attachments (check only distance)
proto native float GetLastFPS()
Returns current framerate.
bool OnInitialize()
Called once before game update loop starts, ret value indicates if init was done in scripts,...
Definition game.c:132
proto native void SetDiagModeEnable(int diag_mode, bool enabled)
Set specific debug mode.
void SurfaceUnderObjectCorrectedLiquid(notnull Object object, out string type, out int liquidType)
Definition game.c:1256
ref MenuDefaultCharacterData m_CharacterData
Definition game.c:20
proto native bool AddInventoryJuncture(Man player, notnull EntityAI item, InventoryLocation dst, bool test_dst_occupancy, int timeout_ms, Managed userData=null)
proto native bool IsClient()
proto native bool IsServer()
proto native vector ObjectGetSelectionPositionLS(Object obj, string name)
void OnKeyPress(int key)
Called when key is pressed.
Definition game.c:166
proto native void RemoteObjectCreate(Object obj)
RemoteObjectDelete - deletes only remote object tree (unregisters from network). do not use if not su...
proto native Managed GizmoGetTracker(int index)
Return the tracker passed in for the gizmo.
proto native bool GoBuyWorldDLC(string sWorldName)
void OnKeyRelease(int key)
Called when key is released.
Definition game.c:174
proto native bool AddActionJuncture(Man player, notnull EntityAI item, int timeout_ms, Managed userData=null)
proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd=RoadSurfaceDetection.LEGACY)
proto native void EnableVoN(Object player, bool enable)
Enable/disable VoN for target player.
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
Definition game.c:1412
void SetDebugMonitorEnabled(int value)
Definition game.c:1147
bool ObjectIsKindOf(Object object, string cfg_parent_name)
Returns is object inherited from parent class name.
Definition game.c:1465
proto native int GetDiagDrawMode()
Gets current debug draw mode.
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 void RestartMission()
proto native int ObjectRelease(Object obj)
RemoteObjectTreeCreate - postponed registration of network object tree (and creation of remote object...
proto native bool IsMicCapturing()
Returns whether mic is currently capturing audio from user.
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 void ClearReconnectCache()
Remove all player from reconnect cache.
bool FormatRawConfigStringKeys(inout string value)
Changes localization key format to script-friendly format.
Definition game.c:476
bool ClearJunctureEx(Man player, notnull EntityAI item)
Definition game.c:763
proto native void UpdatePathgraphRegion(vector regionMin, vector regionMax)
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native void GizmoSelectUser(Managed instance)
Scripted controls, requires the following methods to be implemented in the class void Gizmo_SetWorldT...
proto bool CommandlineGetParam(string name, out string value)
Get command line parameter value.
proto native void DisconnectSession()
Disconnects from current multiplayer session.
proto native SoundWaveOnVehicle CreateSoundWaveOnObject(Object source, SoundObject soundObject, AbstractWave soundWave)
proto native bool GetSurface(SurfaceDetectionParameters params, SurfaceDetectionResult result)
API for surface detection.
native void CreateMission(string path)
Create only enforce script mission, used for mission script reloading.
proto native void SendLogoutTime(Object player, int time)
Inform client about logout time (creates logout screen on specified client).
bool GetSurfaceDigPile(string surface, out string result)
Definition game.c:1234
proto native void AdminLog(string text)
proto native int GizmoGetCount()
Return the number of gizmos.
proto native bool IsMultiplayer()
proto native BiosUserManager GetUserManager()
proto native void ResetPPMask()
proto native void NightVissionLightParams(float lightIntensityMul, float noiseIntensity)
set night vission parameters (set to zero when to disable it)
proto native owned string GetMainMenuWorld()
proto native bool HasInventoryJuncture(Man player, notnull EntityAI item)
proto void ObjectGetType(Object obj, out string type)
DragQueue GetDragQueue()
Returns DragQueue.
Definition game.c:1542
void OnActivateMessage()
Called when recieving focus (windows).
Definition game.c:118
proto native vector ObjectModelToWorld(Object obj, vector modelPos)
void UpdatePathgraphRegionByObject(Object object)
Definition game.c:1272
proto native vector GetPointerDirection()
Returns the direction where the mouse points, from the camera view.
proto native void OpenURL(string url)
proto native void ConfigGetTextArrayRaw(string path, out TStringArray values)
Get array of raw strings from config on path.
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).
UIScriptedWindow CreateScriptedWindow(int id)
create custom window part
Definition game.c:202
proto native UIManager GetUIManager()
void OnEvent(EventType eventTypeId, Param params)
Called when some system event occur.
Definition game.c:93
proto void GetPlayerNetworkIDByIdentityID(int playerIdentityID, out int networkIdLowBits, out int networkIdHightBits)
returns player's network id from identity id in out parameters
void DayZGame()
Definition dayzgame.c:994
proto native Weather GetWeather()
Returns weather controller object.
proto native void RequestRestart(int code)
Sets exit code and restart in the right moment.
proto native vector GetCurrentCameraPosition()
void CGame()
Definition game.c:34
void OnDeactivateMessage()
Called when loosing focus (windows).
Definition game.c:125
proto native void GizmoSelectPhysics(Physics physics)
Applies impulses to set the position when dynamic, otherwise sets the transform in the physics scene.
void SurfaceUnderObjectByBoneCorrectedLiquid(notnull Object object, int boneType, out string type, out int liquidType)
Definition game.c:1266
proto native void ChatMP(Man recipient, string text, string colorClass)
proto native void DumpInstances(bool csvFormatting)
Delevoper only: Dump all script allocations.
proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec)
Assign player entity to client (in multiplayer).
proto native void RemoteObjectTreeCreate(Object obj)
RemoteObjectCreate - postponed registration of network object (and creation of remote object)....
proto native float GetWaterSurfaceHeightNoFakeWave(vector posWS)
Get the nearest water or object surface under a point, ignoring land (without the fake wave that's on...
proto GetServersResultRow GetHostData()
Gets the server data.
proto float SurfaceGetType(float x, float z, out string type)
Returns: Y position the surface was found.
proto native void LogoutRequestTime()
Logout methods.
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 ConfigGetFullPath(string path, out TStringArray full_path)
proto native bool HasInventoryJunctureDestination(Man player, notnull InventoryLocation dst)
proto native WorkspaceWidget GetWorkspace()
proto native float SurfaceY(float x, float z)
void ~CGame()
Definition game.c:72
proto native void SaveProfile()
Saves profile on disk.
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 CanRespawnPlayer()
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:1216
proto native NoiseSystem GetNoiseSystem()
proto native float SurfaceGetSeaWaveMax()
Get max sea wave height.
proto native void SetProfileStringList(string name, TStringArray values)
Sets array of strings to profile variable.
string ConfigGetTextOut(string path)
Get string value from config on path.
Definition game.c:464
TStringArray ListAvailableCharacters()
outputs array of all valid survivor class names
Definition game.c:1551
proto native void SetDiagDrawMode(int diag_draw_mode)
Set debug draw mode.
proto native void OverrideDOF(bool enable, float focusDistance, float focusLength, float focusLengthNear, float blur, float focusDepthOffset)
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
bool IsSurfaceFertile(string surface)
Checks if the surface is fertile.
Definition game.c:1240
ref array< ref Param > m_ParamCache
Definition game.c:15
proto native void StoreLoginData(ParamsWriteContext ctx)
Stores login userdata as parameters which are sent to server.
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 native bool ExecuteEnforceScript(string expression, string mainFnName)
Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script ...
proto native EntityAI GetEntityByPersitentID(int b1, int b2, int b3, int b4)
Returns EntityAI by its persistent ID parts or null if entity with given persistent ID does not exist...
proto owned string GetHostName()
Gets the server name.
proto native void ObjectDeleteOnClient(Object obj)
proto native bool IsInPartyChat()
Returns whether user is currently in a voice party (currently only supported on xbox).
void OnProcessLifetimeChanged(int plmtype)
Definition game.c:98
proto void ObjectGetDisplayName(Object obj, out string name)
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 native void PlayMission(string path)
Starts mission (equivalent for SQF playMission). You MUST use double slash \.
proto native bool IsPhysicsExtrapolationEnabled()
If physics extrapolation is enabled, always true on retail release builds.
proto native bool HasInventoryJunctureItem(notnull EntityAI item)
proto native void SetMainMenuWorld(string world)
proto native void LogoutRequestCancel()
proto float SurfaceGetType3D(float x, float y, float z, out string type)
Y input: Maximum Y to trace down from; Returns: Y position the surface was found.
proto native float GetTickTime()
Returns current time from start of the game.
proto native int ConfigGetType(string path)
Returns type of config value.
proto int GetTime()
returns mission time in milliseconds
proto native bool IsDebug()
ScriptModule GameScript
Definition game.c:12
proto native int GetVoiceLevel(Object player=null)
Get voice level of VoN (on both client and server) (VoiceLevelWhisper = 0, VoiceLevelNormal = 1,...
proto native vector GetScreenPosRelative(vector world_pos)
Transforms position in world to position in screen in percentage (0.0 - 1.0) as x,...
void OnMouseButtonRelease(int button)
Called when mouse button is released.
Definition game.c:190
proto native Class GizmoGetInstance(int index)
Return the instance passed in for the gizmo.
proto native void EnableMicCapture(bool enable)
Enable microphone to locally capture audio from user.
Super root of all classes in Enforce script.
Definition enscript.c:11
ContentDLC is for query installed DLC (only as entitlement keys, not content).
Definition contentdlc.c:11
Definition debug.c:2
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:202
Definition camera.c:2
GetServersResultRow the output structure of the GetServers operation that represents one game server.
Definition input.c:11
InventoryLocation.
static string DumpToStringNullSafe(InventoryLocation loc)
static void Init()
Definition debug.c:706
static bool IsInventoryReservationLogEnable()
Definition debug.c:756
TODO doc.
Definition enscript.c:118
Definition enmath.c:7
proto bool RequestGetDefaultCharacterData()
Mission class.
Definition gameplay.c:686
static bool IsGameActive(bool sim)
Base Param Class with no parameters.
Definition param.c:12
The class that will be instanced (moddable).
Definition gameplay.c:389
Manager class for managing Effect (EffectParticle, EffectSound).
static void Init()
Initialize the containers.
static void Cleanup()
Cleanup method to properly clean up the static data.
static void InitServer()
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
Parameters for detecting the surface.
Definition surfaceinfo.c:75
Output of surface detection.
Xbox menu.
Definition dayzgame.c:64
Manager class which handles Voice-over-network functionality while player is connected to a server.
Definition vonmanager.c:299
static void Init()
Initializes VONManager, runs when user first connects to a server.
Definition vonmanager.c:314
static void CleanupInstance()
Uninitializes VONManager, runs when user disconnects from server.
Definition vonmanager.c:323
Weather controller.
Definition weather.c:168
Definition world.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
DayZGame g_Game
Definition dayzgame.c:3942
Mission mission
Serializer ParamsReadContext
Definition gameplay.c:15
Serializer ParamsWriteContext
Definition gameplay.c:16
static int GAME_STORAGE_VERSION
Game Class provide most "world" or global engine API functions.
Definition game.c:5
array< float > TFloatArray
Definition enscript.c:713
array< string > TStringArray
Definition enscript.c:712
array< int > TIntArray
Definition enscript.c:714
void Obsolete(string msg="")
Definition enscript.c:371
const int LIQUID_NONE
Definition constants.c:532
const int LIQUID_SALTWATER
Definition constants.c:553
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.
void AbstractWave()
Definition sound.c:167
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto string Get(int index)
Gets n-th character from string.
proto int ToLower()
Changes string to lowercase.
proto native int Length()
Returns length of string.
TypeID EventType
Definition enwidgets.c:55
Icon x
Icon y
class OptionSelectorMultistate extends OptionSelector class_name
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor).