1typedef Param7<EntityAI, string, float, float, bool, string, FindInventoryLocationType>
DevSpawnItemParams;
66 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND:
70 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID:
74 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR:
78 case ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY:
82 case ERPCs.DEV_RPC_CLEAR_INV:
86 case ERPCs.DEV_RPC_SEND_SERVER_LOG:
90 case ERPCs.RPC_SYNC_SCENE_OBJECT:
94 case ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG:
98 case ERPCs.DEV_RPC_SPAWN_PRESET:
102 ctx.
Read(presetName);
108 case ERPCs.DEV_RPC_SET_TIME:
123 Param1<string> msg_p =
new Param1<string>(msg_log);
134 g_Game.GetPlayers( players );
136 for (
int i = 0; i < players.Count(); ++i )
138 Param1<string> param =
new Param1<string>( msg );
139 Man player = players.Get(i);
141 if ( player && player.HasNetworkID() )
143 player.RPCSingleParam(
ERPCs.DEV_RPC_SEND_SERVER_LOG, param,
true, player.GetIdentity());
153 if ( ctx.
Read( par ) )
156 SceneData scene_data = module_scene_editor.GetLoadedScene();
166 if (pluginDZCreatureDebug)
168 pluginDZCreatureDebug.OnRpc(player, rpc_type, ctx);
175 Param5<int,int,int,int,int> p5 =
new Param5<int,int,int,int,int>(0,0,0,0,0);
178 int year = p5.param1;
179 int month = p5.param2;
181 int hour = p5.param4;
182 int minute = p5.param5;
184 g_Game.GetWorld().SetDate(year,month, day, hour, minute);
202 targetPlayer.m_PresetSpawned =
true;
208 PresetSpawnBase presetObj = PresetSpawnBase.Cast(type.Spawn());
212 presetObj.Init(targetPlayer);
223 Param1<string> param =
new Param1<string>(
"" );
225 if ( ctx.
Read(param) && param.param1 !=
"" )
239 Param7<string, float, float, float, bool, string, bool> p =
new Param7<string, float, float, float, bool, string, bool>(
"", 0, 0, 0,
false,
"",
false);
248 Param6<string, float, float, vector, bool, bool> p =
new Param6<string, float, float, vector, bool, bool>(
"", 0, 0,
"0 0 0",
false,
false);
257 auto p =
new Param10<string,int, float, float, int, int, float, float, bool, bool>(
"",0,0,0,0,0,0,0,
false,
false);
260 SpawnEntityOnGroundPatternGrid(player, p.param1, p.param2, p.param3, p.param4, p.param5, p.param6, p.param7, p.param8, p.param9, p.param10);
273 if (playerTarget && p.param5)
275 if (playerTarget.m_PresetSpawned)
277 playerTarget.m_PresetSpawned =
false;
278 playerTarget.m_PresetItems.Clear();
282 playerTarget.m_PresetItems.Insert(ent);
296 PrintString(
"PluginDeveloper.SpawnEntity() Warning- Cant spawn object: " +
name);
298 PrintString(
"PluginDeveloper.SpawnEntity() Warning END");
304 if (presetName && player && player.m_PresetSpawned)
306 player.m_PresetItems.Clear();
307 player.m_PresetSpawned =
false;
312 plr.OnSpawnedFromConsole();
314 else if ( entity.IsInherited(
ItemBase) )
319 else if (entity.IsInherited(
House))
321 entity.PlaceOnSurface();
322 vector pos = entity.GetPosition();
323 vector ori =
g_Game.GetSurfaceOrientation(pos[0], pos[2]);
324 entity.SetOrientation(ori);
326 if (player && presetName)
328 player.m_PresetItems.Insert(entity);
335 auto debugParamsPlayer = DebugSpawnParams.WithPlayer(player);
336 entity.OnDebugSpawnEx(debugParamsPlayer);
340 auto debugParamsNone = DebugSpawnParams.None();
341 entity.OnDebugSpawnEx(debugParamsNone);
348 void SpawnEntityOnGroundPatternGrid(
PlayerBase player,
string item_name,
int count,
float health,
float quantity,
int rows,
int columns,
float gapRow = 1,
float gapColumn = 1,
bool special=
false,
bool withPhysics =
false)
357 float columnDist = 0;
366 for (
int i = 0; i < rows; i++)
368 vector posRow = playerPos + camDirForward * rowDist;
371 for (
int j = 0; j < columns; j++)
373 offsetSide = camDirRight * columnDist;
374 vector placement = posRow + offsetSide;
375 float hlth = health * MiscGameplayFunctions.GetTypeMaxGlobalHealth( item_name );
377 ent.PlaceOnSurface();
381 item.ThrowPhysically(null,
"0 0 0");
384 if (countLoop == count)
388 columnDist += gapColumn;
395 auto params =
new Param10<string, int, float, float, int, int, float, float, bool, bool>(item_name, count, health, quantity, rows, columns, gapRow, gapColumn, special, withPhysics);
396 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID, params,
true);
402 bool is_ai =
g_Game.IsKindOf(object_name,
"DZ_LightAI");
412 position =
g_Game.GetCurrentCameraPosition();
413 direction =
g_Game.GetCurrentCameraDirection();
415 if ((
g_Game.IsDedicatedServer() || allowFreeflight) && FreeDebugCamera.GetInstance().IsActive())
417 position = FreeDebugCamera.GetInstance().GetPosition();
418 direction = FreeDebugCamera.GetInstance().GetDirection();
422 if (player && !allowFreeflight)
424 position = player.GetPosition();
425 direction = player.GetDirection();
433 return player.SpawnEntityOnGroundPos(object_name, pos);
436 bool is_AI =
g_Game.IsKindOf(object_name,
"DZ_LightAI");
439 return SpawnAI(object_name, pos);
451 if (
g_Game.IsKindOf(object_name,
"Boat"))
461 void SpawnItemOnCrosshair(
PlayerBase player,
string itemName,
float health,
float quantity,
float maxDist = 100,
bool allowFreeflight =
false,
bool special =
false,
bool withPhysics =
false)
465 to = from + (dir * maxDist);
504 item.ThrowPhysically(null,
"0 0 0");
510 Param6<string, float, float, vector, bool, bool> params =
new Param6<string, float, float, vector, bool, bool>(item_name, health, quantity, pos, special, withPhysics);
511 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND, params,
true);
529 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
533 if ( !entity.IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)
535 health = entity.GetMaxHealth();
544 item.ThrowPhysically(null,
"0 0 0");
551 Param7<string, float, float, float, bool, string, bool> params =
new Param7<string, float, float, float, bool, string, bool>(item_name, quantity, distance, health, special, presetName, withPhysics);
552 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params,
true);
568 if (target.IsPlayer())
575 if (target.GetInventory() && target.GetInventory().FindFirstFreeLocationForNewEntity(className,
FindInventoryLocationType.ANY, il))
578 if ( eai && eai.IsInherited(
ItemBase) )
582 health = eai.GetMaxHealth();
588 auto debugParams = DebugSpawnParams.WithPlayer(null);
589 eai.OnDebugSpawnEx(debugParams);
598 g_Game.GetPlayer().RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY, params,
true,
g_Game.GetPlayer().GetIdentity());
611 if (!
g_Game.IsMultiplayer())
612 player.DropItem(player.GetItemInHands());
614 player.ServerDropEntity(player.GetItemInHands());
623 if (
g_Game.IsKindOf(item_name,
"Transport"))
626 auto debugParams = DebugSpawnParams.WithPlayer(player);
627 vehicle.OnDebugSpawnEx(debugParams);
629 if (
g_Game.IsMultiplayer())
635 player.SetGetInVehicleDebug(vehicle);
643 if (player.GetInventory() && player.GetInventory().FindFirstFreeLocationForNewEntity(item_name, locationType, il))
649 vector pos = player.GetPosition();
651 Magazine mag_gnd = Magazine.Cast(eai_gnd);
652 if (mag_gnd && player.GetWeaponManager().CanAttachMagazine(wpn, mag_gnd))
654 player.GetWeaponManager().AttachMagazine(mag_gnd);
661 if ( eai && eai.IsInherited(
ItemBase) )
665 health = eai.GetMaxHealth();
671 auto debugParams2 = DebugSpawnParams.WithPlayer(player);
672 eai.OnDebugSpawnEx(debugParams2);
686 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY, params,
true);
720 EntityAI eai = parent.GetInventory().CreateAttachment(att_name);
739 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_AS_ATTACHMENT, params,
true);
748 if ( menu_curr == NULL )
752 if ( player && !
g_Game.GetWorld().Is3rdPersonDisabled() )
754 player.SetIsInThirdPerson(!player.IsInThirdPerson());
757 vector pos_player, pos_direction;
762 g_Game.CopyFromClipboard(clipboard);
775 clipboard.
Split(
",", items );
777 foreach (
string item:items)
796 entity.ClearInventory();
800 Param1<int> params =
new Param1<int>(0);
801 entity.RPCSingleParam(
ERPCs.DEV_RPC_CLEAR_INV, params,
true);
807 if (
g_Game.GetUIManager().GetMenu() == NULL )
813 g_Game.GetUIManager().Back();
821 if (
g_Game.GetUIManager().GetMenu() == NULL )
827 g_Game.GetUIManager().Back();
828 g_Game.GetMission().RemoveActiveInputExcludes({
"menu"},
true);
838 g_Game.GetUIManager().Back();
839 g_Game.GetMission().RemoveActiveInputExcludes({
"menu"},
true);
843 if (
g_Game.GetUIManager().GetMenu() )
844 g_Game.GetUIManager().GetMenu().Close();
847 g_Game.GetMission().AddActiveInputExcludes({
"menu"});
875 if ( menu_curr == NULL )
898 string pivot = arr.Get( left );
908 if ( i > right || arr.Get(i) > pivot )
917 if ( arr.Get(j) <= pivot )
929 arr.Set( i, arr.Get(j) );
933 temp = arr.Get( left );
934 arr.Set( left, arr.Get(j) );
961 g_Game.GetMission().ResetGUI();
971 g_Game.GetInput().ChangeGameFocus(1);
972 g_Game.GetUIManager().ShowUICursor(
true);
975 if (
g_Game.IsMultiplayer())
977 g_Game.RPCSingleParam(
g_Game.GetPlayer(),
ERPCs.DEV_SET_DEV_ITEM,
new Param1<Object>(entity),
true,
g_Game.GetPlayer().GetIdentity());
982 mid2.RegisterDebugItem(entity, player);
985 SetDebugDeveloper_item(entity);
995 FreeDebugCamera debugCam = FreeDebugCamera.GetInstance();
996 if (debugCam && debugCam.GetCurrentCamera())
998 entity = debugCam.GetCrosshairObject();
1003 if (player && player.GetActionManager())
1005 ActionTarget at = player.GetActionManager().FindActionTarget();
1006 entity = at.GetObject();
class ActionTargets ActionTarget
const int ECE_EQUIP_ATTACHMENTS
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
const CallID CALL_ID_SCR_CNSL_HISTORY_NEXT
const CallID CALL_ID_SCR_CNSL_HISTORY_BACK
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Param CallMethod(CallID call_id, Param params)
FindInventoryLocationType
flags for searching locations in inventory
void SetupSpawnedItem(ItemBase item, float health, float quantity)
override void ClearInventory()
class OptionSelectorMultistate extends OptionSelector class_name
void PluginDayZCreatureAIDebug()
Param7< EntityAI, string, float, float, bool, string, FindInventoryLocationType > DevSpawnItemParams
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
Super root of all classes in Enforce script.
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static void ReceivedLogMessageFromServer(string message)
static void OnSetFreeCameraEvent(PlayerBase player, FreeDebugCamera camera)
static bool IsFreeCameraEnabled()
static void FreeCameraToggle(PlayerBase player, bool teleport_player=false)
Enable / Disable Free camera (Fly mod) - disable of camera will teleport player at current free camer...
static void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
static void TeleportAtCursorEx()
static void SetPlayerDirection(PlayerBase player, vector direction)
static void SetPlayerPosition(PlayerBase player, vector position, bool breakSync=false)
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
script counterpart to engine's class Inventory
proto native EntityAI GetParent()
returns parent of current inventory location
proto native vector GetPos()
returns position of item in world if type is Ground
proto native int GetSlot()
returns slot id if current type is Attachment
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
provides access to slot configuration
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
EntityAI SpawnEntityAsAttachment(PlayerBase player, EntityAI parent, string att_name, float health, float quantity)
tries to spawn item as attachment
void ToggleFreeCamera()
Enable / Disable Free camera (Fly mod) - disable of camera will teleport player at current free camer...
EntityAI SpawnEntityOnCursorDir(PlayerBase player, string item_name, float quantity, float distance, float health=-1, bool special=false, string presetName="", bool withPhysics=false)
spawns entity in direction of cursor at specified distance
EntityAI SpawnEntityInInventory(notnull EntityAI target, string className, float health, float quantity, bool special=false, string presetName="", FindInventoryLocationType locationType=FindInventoryLocationType.ANY)
tries to spawn item somewhere in inventory
void HandlePresetSpawn(PlayerBase player, string presetName, EntityAI target)
void OnRPCSpawnEntityOnCursorDir(PlayerBase player, ParamsReadContext ctx)
void SpawnItemOnCrosshair(PlayerBase player, string itemName, float health, float quantity, float maxDist=100, bool allowFreeflight=false, bool special=false, bool withPhysics=false)
void PrintLogClient(string msg_log)
void ToggleScriptConsole()
void OnSpawnErrorReport(string name)
void OnRPCSyncSceneObject(ParamsReadContext ctx)
int QuickSortPartition(TStringArray arr, int left, int right)
EntityAI SpawnFromClipboard()
void SortStringArray(TStringArray arr)
void SpawnEntityOnGroundPatternGrid(PlayerBase player, string item_name, int count, float health, float quantity, int rows, int columns, float gapRow=1, float gapColumn=1, bool special=false, bool withPhysics=false)
void SetDirection(PlayerBase player, vector direction)
Set player direction.
void OnSetFreeCameraEvent(PlayerBase player, FreeDebugCamera camera)
void PluginSceneManager()
void HandleSetTime(PlayerBase player, ParamsReadContext ctx)
void ToggleFreeCameraBackPos()
Enable / Disable Free camera (Fly mod)
UIScriptedMenu m_ScriptConsole
EntityAI SpawnEntityInPlayerInventory(PlayerBase player, string item_name, float health, float quantity, bool special=false, string presetName="", FindInventoryLocationType locationType=FindInventoryLocationType.ANY)
static PluginDeveloper GetInstance()
void OnRPCSpawnEntity(PlayerBase player, ParamsReadContext ctx)
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string object_name, vector pos)
void OnRPCSpawnEntityOnGroundPatternGrid(PlayerBase player, ParamsReadContext ctx)
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string item_name, float health, float quantity, vector pos, bool special=false, bool withPhysics=false)
void OnRPCServerLogRecieved(ParamsReadContext ctx)
void TeleportAtCursor()
Set Player position at his cursor position in the world.
void GetCameraDirections(Man player, bool allowFreeflight, out vector position, out vector direction)
void OnRPCSpawnEntityOnGround(PlayerBase player, ParamsReadContext ctx)
static void SetDeveloperItemClientEx(notnull Object entity, bool getFocus=false)
void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
void OnRPCPluginDayzCreatureDebug(PlayerBase player, int rpc_type, ParamsReadContext ctx)
void ToggleMissionLoader()
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")
void ClearInventory(EntityAI entity)
void SetDeveloperItemClient()
EntityAI SpawnAI(string object_name, vector pos)
bool IsEnabledFreeCamera()
void OnRPCClearInventory(PlayerBase player)
void SendServerLogToClient(string msg)
void Teleport(PlayerBase player, vector position)
Teleport player at position.
void QuickSort(TStringArray arr, int left, int right)
Plugin interface for controlling of agent pool system.
SceneObject GetSceneObjectByEntityAI(EntityAI e)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
vector Perpend()
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector ...
Serializer ParamsReadContext
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< string > TStringArray
class array< Class T > PrintString
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
bool Contains(string sample)
Returns true if sample is substring of string.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.