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);
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;
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.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();
324 entity.SetOrientation(ori);
328 player.m_PresetItems.Insert(entity);
333 auto debugParams = DebugSpawnParams.WithPlayer(player);
334 entity.OnDebugSpawnEx(debugParams);
340 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)
349 float columnDist = 0;
351 vector playerPos = player.GetPosition();
352 vector camDirForward = player.GetDirection();
355 for (
int i = 0; i < rows; i++)
357 vector posRow = playerPos + camDirForward * rowDist;
360 for (
int j = 0; j < columns; j++)
362 offsetSide = camDirRight * columnDist;
363 vector placement = posRow + offsetSide;
364 float hlth = health * MiscGameplayFunctions.GetTypeMaxGlobalHealth( item_name );
366 ent.PlaceOnSurface();
370 item.ThrowPhysically(null,
"0 0 0");
373 if (countLoop == count)
377 columnDist += gapColumn;
384 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);
385 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID, params,
true);
389 void SpawnItemOnCrosshair(notnull
PlayerBase player,
string itemName,
float health,
float quantity,
float maxDist = 100,
bool allowFreeflight =
false,
bool special =
false,
bool withPhysics =
false)
392 if (allowFreeflight && FreeDebugCamera.GetInstance().IsActive())
394 from = FreeDebugCamera.GetInstance().GetPosition();
395 to = from + FreeDebugCamera.GetInstance().GetDirection() * maxDist;
432 EntityAI entity = player.SpawnEntityOnGroundPos(item_name, pos);
440 item.ThrowPhysically(null,
"0 0 0");
446 Param6<string, float, float, vector, bool, bool> params =
new Param6<string, float, float, vector, bool, bool>(item_name, health, quantity, pos, special, withPhysics);
447 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND, params,
true);
465 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
469 if ( !entity.
IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)
471 health = entity.GetMaxHealth();
480 item.ThrowPhysically(null,
"0 0 0");
487 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);
488 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params,
true);
504 if (target.IsPlayer())
511 if (target.GetInventory() && target.GetInventory().FindFirstFreeLocationForNewEntity(className,
FindInventoryLocationType.ANY, il))
514 if ( eai && eai.IsInherited(
ItemBase) )
518 health = eai.GetMaxHealth();
524 auto debugParams = DebugSpawnParams.WithPlayer(null);
525 eai.OnDebugSpawnEx(debugParams);
547 if (!
GetGame().IsMultiplayer())
548 player.DropItem(player.GetItemInHands());
550 player.ServerDropEntity(player.GetItemInHands());
559 if (
GetGame().IsKindOf(item_name,
"Transport"))
562 auto debugParams = DebugSpawnParams.WithPlayer(player);
563 vehicle.OnDebugSpawnEx(debugParams);
571 player.SetGetInVehicleDebug(vehicle);
579 if (player.GetInventory() && player.GetInventory().FindFirstFreeLocationForNewEntity(item_name, locationType, il))
585 vector pos = player.GetPosition();
587 Magazine mag_gnd = Magazine.Cast(eai_gnd);
588 if (mag_gnd && player.GetWeaponManager().CanAttachMagazine(wpn, mag_gnd))
590 player.GetWeaponManager().AttachMagazine(mag_gnd);
597 if ( eai && eai.IsInherited(
ItemBase) )
601 health = eai.GetMaxHealth();
607 auto debugParams2 = DebugSpawnParams.WithPlayer(player);
608 eai.OnDebugSpawnEx(debugParams2);
622 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY, params,
true);
656 EntityAI eai = parent.GetInventory().CreateAttachment(att_name);
675 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_AS_ATTACHMENT, params,
true);
684 if ( menu_curr == NULL )
689 if ( !
GetGame().GetWorld().Is3rdPersonDisabled() )
691 player.SetIsInThirdPerson(!player.IsInThirdPerson());
694 vector pos_player = player.GetPosition();
711 clipboard.
Split(
",", items );
713 foreach (
string item:items)
733 entity.ClearInventory();
737 Param1<int> params =
new Param1<int>(0);
738 entity.RPCSingleParam(
ERPCs.DEV_RPC_CLEAR_INV, params,
true);
744 if (
g_Game.GetUIManager().GetMenu() == NULL )
750 g_Game.GetUIManager().Back();
758 if (
g_Game.GetUIManager().GetMenu() == NULL )
764 g_Game.GetUIManager().Back();
775 g_Game.GetUIManager().Back();
780 if (
g_Game.GetUIManager().GetMenu() )
781 g_Game.GetUIManager().GetMenu().Close();
812 if ( menu_curr == NULL )
835 string pivot = arr.Get( left );
845 if ( i > right || arr.Get(i) > pivot )
854 if ( arr.Get(j) <= pivot )
866 arr.Set( i, arr.Get(j) );
870 temp = arr.Get( left );
871 arr.Set( left, arr.Get(j) );
919 mid2.RegisterDebugItem(entity, player);
922 SetDebugDeveloper_item(entity);
932 FreeDebugCamera debugCam = FreeDebugCamera.GetInstance();
933 if (debugCam && debugCam.GetCurrentCamera())
935 entity = debugCam.GetCrosshairObject();
940 if (player && player.GetActionManager())
942 ActionTarget at = player.GetActionManager().FindActionTarget();
943 entity = at.GetObject();
class ActionTargets ActionTarget
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)
proto native UIManager GetUIManager()
proto native void GetPlayers(out array< Man > players)
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
proto native DayZPlayer GetPlayer()
proto native vector GetCurrentCameraPosition()
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 ...
proto native vector GetCurrentCameraDirection()
proto void CopyFromClipboard(out string text)
proto native Input GetInput()
proto native Mission GetMission()
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)
override bool IsBuilding()
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 int GetSlot()
returns slot id if current type is Attachment
provides access to slot configuration
void AddActiveInputExcludes(array< string > excludes)
void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
deprecated
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 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 SpawnItemOnCrosshair(notnull PlayerBase player, string itemName, float health, float quantity, float maxDist=100, bool allowFreeflight=false, bool special=false, bool withPhysics=false)
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)
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)
spawns entity on exact position
void OnRPCServerLogRecieved(ParamsReadContext ctx)
void TeleportAtCursor()
Set Player position at his cursor position in the world.
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()
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)
SceneObject GetSceneObjectByEntityAI(EntityAI e)
proto void CallByName(Class obj, string fnName, Param params=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Read(void value_in)
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
void ShowUICursor(bool visible)
proto native void SetDate(int year, int month, int day, int hour, int minute)
Sets actual ingame world time.
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
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< string > TStringArray
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
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'.