8 ref PresetSpawnBase m_PresetObj;
14 return PluginDeveloper.Cast(
GetPlugin( PluginDeveloper ) );
64 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND:
68 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID:
72 case ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR:
76 case ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY:
80 case ERPCs.DEV_RPC_CLEAR_INV:
84 case ERPCs.DEV_RPC_SEND_SERVER_LOG:
88 case ERPCs.RPC_SYNC_SCENE_OBJECT:
92 case ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG:
96 case ERPCs.DEV_RPC_SPAWN_PRESET:
100 case ERPCs.DEV_RPC_SET_TIME:
116 Param1<string> msg_p =
new Param1<string>(msg_log);
129 for (
int i = 0; i < players.Count(); ++i )
131 Param1<string> param =
new Param1<string>( msg );
132 Man player = players.Get(i);
134 if ( player && player.HasNetworkID() )
136 player.RPCSingleParam(
ERPCs.DEV_RPC_SEND_SERVER_LOG, param,
true, player.GetIdentity());
144 Param3<string, EntityAI, Param> par =
new Param3<string, EntityAI, Param>(
"", NULL,
new Param );
146 if ( ctx.
Read( par ) )
148 PluginSceneManager module_scene_editor = PluginSceneManager.Cast(
GetPlugin( PluginSceneManager ) );
149 SceneData scene_data = module_scene_editor.GetLoadedScene();
159 if (pluginDZCreatureDebug)
161 pluginDZCreatureDebug.OnRpc(player, rpc_type, ctx);
169 Param5<int,int,int,int,int> p5 =
new Param5<int,int,int,int,int>(0,0,0,0,0);
171 if ( ctx.
Read( p5 ) )
176 int year = p5.param1;
177 int month = p5.param2;
179 int hour = p5.param4;
180 int minute = p5.param5;
202 player.m_PresetSpawned =
true;
209 m_PresetObj = PresetSpawnBase.Cast(type.Spawn());
214 m_PresetObj.Init(player);
225 Param1<string> param =
new Param1<string>(
"" );
227 if ( ctx.
Read(param) && param.param1 !=
"" )
241 Param6<string, float, float, float, bool, string> p =
new Param6<string, float, float, float, bool, string>(
"", 0, 0, 0,
false,
"");
250 Param4<string, float, float, vector> p =
new Param4<string, float, float, vector>(
"", 0, 0,
"0 0 0");
259 auto p =
new Param8<string,int, float, float, int, int, float, float>(
"",0,0,0,0,0,0,0);
268 Param5<string, float, float,bool, string> p =
new Param5<string, float, float, bool, string>(
"", 0, 0,
false,
"");
274 if (player.m_PresetSpawned)
276 player.m_PresetSpawned =
false;
277 player.m_PresetItems.Clear();
281 player.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);
331 entity.OnDebugSpawn();
345 float columnDist = 0;
347 vector playerPos = player.GetPosition();
348 vector camDirForward = player.GetDirection();
351 for (
int i = 0; i < rows; i++)
353 vector posRow = playerPos + camDirForward * rowDist;
356 for (
int j = 0; j < columns; j++)
358 offsetSide = camDirRight * columnDist;
359 vector placement = posRow + offsetSide;
360 float hlth = health * MiscGameplayFunctions.GetTypeMaxGlobalHealth( item_name );
362 ent.PlaceOnSurface();
364 if (countLoop == count)
368 columnDist += gapColumn;
375 auto params =
new Param8<string, int, float, float, int, int, float, float>(item_name, count, health, quantity, rows, columns, gapRow, gapColumn);
376 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND_PATTERN_GRID, params,
true);
394 EntityAI entity = player.SpawnEntityOnGroundPos(item_name, pos);
403 Param4<string, float, float, vector> params =
new Param4<string, float, float, vector>(item_name, health, quantity, pos);
404 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_GROUND, params,
true);
422 EntityAI entity = player.SpawnEntityOnGroundOnCursorDir(item_name, distance);
426 if ( !entity.
IsBuilding() && health < 0 && entity.GetMaxHealth() > 0)
428 health = entity.GetMaxHealth();
439 Param6<string, float, float, float, bool, string> params =
new Param6<string, float, float, float, bool, string>(item_name, quantity, distance, health, special, presetName);
440 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_ON_CURSOR, params,
true);
461 if (
GetGame().IsKindOf(item_name,
"Transport"))
472 player.SetGetInVehicleDebug(car);
480 if (player.GetInventory() && player.GetInventory().FindFirstFreeLocationForNewEntity(item_name,
FindInventoryLocationType.ANY, il))
486 vector pos = player.GetPosition();
488 Magazine mag_gnd = Magazine.Cast(eai_gnd);
489 if (mag_gnd && player.GetWeaponManager().CanAttachMagazine(wpn, mag_gnd))
491 player.GetWeaponManager().AttachMagazine(mag_gnd);
498 if ( eai && eai.IsInherited(
ItemBase) )
502 health = eai.GetMaxHealth();
519 Param5<string, float, float, bool, string> params =
new Param5<string, float, float, bool, string>(item_name, health, quantity, special, presetName );
520 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_IN_INVENTORY, params,
true);
554 EntityAI eai = parent.GetInventory().CreateAttachment(att_name);
572 Param3<string, float, float> params =
new Param3<string, float, float>(att_name, health, quantity);
573 player.RPCSingleParam(
ERPCs.DEV_RPC_SPAWN_ITEM_AS_ATTACHMENT, params,
true);
582 if ( menu_curr == NULL )
587 if ( !
GetGame().GetWorld().Is3rdPersonDisabled() )
589 player.SetIsInThirdPerson(!player.IsInThirdPerson());
592 vector pos_player = player.GetPosition();
607 clipboard.
Split(
",", items );
609 foreach(
string item:items)
625 player.ClearInventory();
629 Param1<int> params =
new Param1<int>(0);
630 player.RPCSingleParam(
ERPCs.DEV_RPC_CLEAR_INV, params,
true);
636 if (
g_Game.GetUIManager().GetMenu() == NULL )
642 g_Game.GetUIManager().Back();
650 if (
g_Game.GetUIManager().GetMenu() == NULL )
657 g_Game.GetUIManager().Back();
692 if ( menu_curr == NULL )
715 string pivot = arr.Get( left );
725 if ( i > right || arr.Get(i) > pivot )
734 if ( arr.Get(j) <= pivot )
746 arr.Set( i, arr.Get(j) );
750 temp = arr.Get( left );
751 arr.Set( left, arr.Get(j) );
799 mid2.RegisterDebugItem(entity, player);
802 SetDebugDeveloper_item(entity);
812 FreeDebugCamera debugCam = FreeDebugCamera.GetInstance();
813 if (debugCam && debugCam.GetCurrentCamera())
815 entity = debugCam.GetCrosshairObject();
820 if (player && player.GetActionManager())
822 ActionTarget at = player.GetActionManager().FindActionTarget();
823 entity = at.GetObject();
class ActionTargets ActionTarget
const int ECE_IN_INVENTORY
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)
class OptionSelectorMultistate extends OptionSelector class_name
void PluginDayZCreatureAIDebug()
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
proto native Mission GetMission()
proto void CopyFromClipboard(out string text)
proto native Input GetInput()
proto native void GetPlayers(out array< Man > players)
override ScriptCallQueue GetCallQueue(int call_category)
proto native World GetWorld()
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native UIManager GetUIManager()
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 ...
static ref Param1< string > PARAM1_STRING
static void ReceivedLogMessageFromServer(string message)
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 OnSetFreeCameraEvent(PlayerBase player, FreeDebugCamera camera)
static void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
static void TeleportAtCursorEx()
static void SetPlayerPosition(PlayerBase player, vector position, bool breakSync=false)
override bool IsBuilding()
script counterpart to engine's class Inventory
EntityAI CreateInInventory(string type)
creates entity somewhere in 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...
int QuickSortPartition(TStringArray arr, int left, int right)
UIScriptedMenu m_ScriptConsole
bool IsEnabledFreeCamera()
void ToggleMissionLoader()
void HandleSetTime(PlayerBase player, ParamsReadContext ctx)
void OnRPCClearInventory(PlayerBase player)
void OnRPCSpawnEntityOnCursorDir(PlayerBase player, ParamsReadContext ctx)
void OnRPCSpawnEntity(PlayerBase player, ParamsReadContext ctx)
static PluginDeveloper GetInstance()
EntityAI SpawnEntityOnGroundPos(PlayerBase player, string item_name, float health, float quantity, vector pos)
spawns entity on exact position
EntityAI SpawnEntityOnCursorDir(PlayerBase player, string item_name, float quantity, float distance, float health=-1, bool special=false, string presetName="")
spawns entity in direction of cursor at specified distance
void SortStringArray(TStringArray arr)
void OnSetFreeCameraEvent(PlayerBase player, FreeDebugCamera camera)
private bool IsInConsole()
private void ScriptHistoryBack()
void TeleportAtCursor()
Set Player position at his cursor position in the world.
void OnRPCSpawnEntityOnGroundPatternGrid(PlayerBase player, ParamsReadContext ctx)
void QuickSort(TStringArray arr, int left, int right)
void PrintLogClient(string msg_log)
EntityAI SpawnEntityAsAttachment(PlayerBase player, EntityAI parent, string att_name, float health, float quantity)
tries to spawn item as attachment
void OnRPCSpawnEntityOnGround(PlayerBase player, ParamsReadContext ctx)
void Teleport(PlayerBase player, vector position)
Teleport player at position.
void ToggleScriptConsole()
void OnRPCServerLogRecieved(ParamsReadContext ctx)
void ClearInventory(PlayerBase player)
void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
protected int m_FeaturesMask
void HandlePresetSpawn(PlayerBase player, ParamsReadContext ctx)
static void SetDeveloperItemClientEx(notnull Object entity, bool getFocus=false)
void ToggleFreeCameraBackPos()
Enable / Disable Free camera (Fly mod)
void SendServerLogToClient(string msg)
protected bool m_IsWinHolding
void OnSpawnErrorReport(string name)
void ToggleFreeCamera()
Enable / Disable Free camera (Fly mod) - disable of camera will teleport player at current free camer...
void SpawnEntityOnGroundPatternGrid(PlayerBase player, string item_name, int count, float health, float quantity, int rows, int columns, float gapRow=1, float gapColumn=1)
void SetDeveloperItemClient()
EntityAI SpawnFromClipboard()
void SetupSpawnedEntity(PlayerBase player, EntityAI entity, float health, float quantity=-1, bool special=false, string presetName="")
EntityAI SpawnEntityInInventory(PlayerBase player, string item_name, float health, float quantity, bool special=false, string presetName="")
tries to spawn item somewhere in inventory
void OnRPCSyncSceneObject(ParamsReadContext ctx)
private void ScriptHistoryNext()
void OnRPCPluginDayzCreatureDebug(PlayerBase player, int rpc_type, ParamsReadContext ctx)
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 ...
Serialization general interface. Serializer API works with:
proto bool Read(void value_in)
void ShowUICursor(bool visible)
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
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 ...
proto native CGame GetGame()
array< string > TStringArray
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
bool Contains(string sample)
Returns true if sample is substring of string.