DayZ 1.24
Loading...
Searching...
No Matches
CentralEconomy.c File Reference

Go to the source code of this file.

Classes

class  EconomyLogCategories
 Categories for CEApi.EconomyLog. More...
 
class  EconomyOutputStrings
 Special strings for CEApi.EconomyOutput. More...
 
class  CEItemProfile
 

Functions

class EconomyLogCategories EconomyMapStrings ()
 Special strings for CEApi.EconomyMap.
 
void EconomyLogCategories ()
 
void ~EconomyLogCategories ()
 
void ~EconomyMapStrings ()
 
static string Category (string category)
 Generates string that will make CEApi.EconomyMap use all items with this category.
 
static string Tag (string tag)
 Generates string that will make CEApi.EconomyMap use all items with this tag.
 
void EconomyOutputStrings ()
 
void ~EconomyOutputStrings ()
 
void ~CEApi ()
 
proto native void ExportSpawnData ()
 Regenerates "storage/spawnpoints.bin" if necessary.
 
proto native void ExportProxyData (vector vCenter=vector.Zero, float fRadius=0)
 Generates "storage/export/mapgrouppos.xml".
 
proto native void ExportClusterData ()
 Generates "storage/export/mapgroupcluster.xml".
 
proto native void ExportProxyProto ()
 Generates "storage/export/mapgroupproto.xml".
 
proto native void MarkCloseProxy (float fRadius, bool bAllSelections)
 Invalidates loot spawn points which are closer than the radius supplied.
 
proto native void RemoveCloseProxy ()
 Removes all invalid points.
 
proto native void ListCloseProxy (float fRadius)
 Outputs a list of all loot points closer than specified radius.
 
proto native bool SpawnAnalyze (string sClassName)
 Will emulate the spawning of the item which is being looked at and generate images (.tga) in storage/lmap and output logs.
 
proto native void TimeShift (float fShift)
 Subtracts the supplied value from the current lifetime of all items in the world.
 
proto native void OverrideLifeTime (float fLifeTime)
 Fills in the Debug Lifetime, which will be used for any new DE spawned.
 
proto native Entity SpawnGroup (string sGroupName, vector vPos, float fAngle=-1)
 Force spawn specific prototype group + loot at position.
 
proto native void SpawnDE (string sEvName, vector vPos, float fAngle=-1)
 Force spawn specific dynamic event.
 
proto native void SpawnDEEx (string sEvName, vector vPos, float fAngle, int uFlags)
 Force spawn specific dynamic event.
 
proto native void SpawnLoot (string sEvName, vector vPos, float fAngle, int iCount=1, float fRange=1)
 Spawn an item through CE.
 
proto native void SpawnDynamic (vector vPos, bool bShowCylinders=true, float fDefaultDistance=0)
 Spawn all entities with dynamic category through CE.
 
proto native void SpawnVehicles (vector vPos, bool bShowCylinders=false, float fDefaultDistance=20)
 Spawn all entities with vehicles category through CE.
 
proto native void SpawnBuilding (vector vPos, bool bShowCylinders=false, float fDefaultDistance=20)
 Spawn all entities with building category through CE.
 
proto native void SpawnEntity (string sClassName, vector vPos, float fRange, int iCount)
 Spawn an entity through CE.
 
proto native Object SpawnSingleEntity (string sClassName, vector vPos)
 Spawn an entity through CE.
 
proto native void SpawnRotation (string sClassName, vector vPos, float fRange, int iCount, int iFlags)
 Spawn an entity through CE.
 
proto native void SpawnPerfTest (string sClassName, int iCount)
 Spawn an entity through CE, x amount of times in a grid.
 
proto native void CleanMap ()
 Queue up the depleting of lifetime of everything in the world.
 
proto native void EconomyLog (string sLogType)
 Outputs debug file to storage/log/*.csv.
 
proto native void EconomyMap (string sMapType)
 Outputs debug file to storage/lmap/*.tga showing the current places this is spawned.
 
proto native void EconomyOutput (string sOutputType, float fRange)
 Outputs debug logs into server log or rpt.
 
proto native void RadiusLifetimeIncrease (vector vCenter, float fRadius, float fValue)
 Process lifetime increase within radius by value (sec)
 
proto native void RadiusLifetimeDecrease (vector vCenter, float fRadius, float fValue)
 Process lifetime decrease within radius by value (sec)
 
proto native void RadiusLifetimeReset (vector vCenter, float fRadius)
 Process lifetime reset to default value from DB within radius.
 
Globals API

Get values from globals.xml

proto native int GetCEGlobalInt (string varName)
 Get int from globals.xml.
 
proto native float GetCEGlobalFloat (string varName)
 Get float from globals.xml.
 
proto native string GetCEGlobalString (string varName)
 Get string from globals.xml.
 
Avoidance API

Optimized internal methods that the CE uses to avoid spawning DE within certain distances

proto native bool AvoidPlayer (vector vPos, float fDistance)
 Check if there is a player within a radius.
 
proto native bool AvoidVehicle (vector vPos, float fDistance, string sDEName="")
 Check if there is a vehicle within a radius.
 
proto native int CountPlayersWithinRange (vector vPos, float fRange)
 Check if there is a vehicle within a radius.
 
CE Debug menu Script API

DIAG ONLY: These options are available from the in-game debug menu on Diag exe (Game > Central Economy), documentation can be found on wiki

proto native void LootSetSpawnVolumeVisualisation (ESpawnVolumeVis mode)
 "Spawn Volume Vis"
 
proto native void LootToggleSpawnSetup (bool mode)
 "Setup Vis"
 
proto native void LootToggleVolumeEditing (bool mode)
 "Edit Volume"
 
proto native void LootRetraceGroupPoints ()
 "Re-Trace Group Points"
 
proto native void LootExportGroup ()
 "Export Group >>"
 
proto native void LootExportAllGroups ()
 "Export All Groups >>>>" / GetCEApi.ExportProxyProto();
 
proto native void LootExportMap ()
 "<<< Export Map" / GetCEApi.ExportProxyData(vector.Zero, 0);
 
proto native void LootExportClusters ()
 "<<< Export Clusters" / GetCEApi().ExportClusterData()
 
proto native void LootDepleteLifetime ()
 "Deplete Lifetime"
 
proto native void LootSetDamageToOne ()
 "Set Damage = 1.0"
 
proto native void LootDepleteAndDamage ()
 "Damage + Deplete"
 
proto native void InfectedToggleVisualisation (bool mode)
 "Infected Vis"
 
proto native void InfectedToggleZoneInfo (bool mode)
 "Infected Zone Info"
 
proto native void InfectedSpawn ()
 "Infected Spawn"
 
proto native void InfectedResetCleanup ()
 "Reset Cleanup"
 
proto native void AnimalToggleVisualisation (bool mode)
 "Animal Vis"
 
proto native void AnimalSpawn ()
 "Animal Spawn"
 
proto native void AnimalAmbientSpawn ()
 "Ambient Spawn"
 
proto native void ToggleVehicleAndWreckVisualisation (bool mode)
 "Vehicle&Wreck Vis"
 
proto native void ToggleLootVisualisation (bool mode)
 "Loot Vis"
 
proto native void ToggleClusterVisualisation (bool mode)
 "Cluster Vis"
 
proto native void ToggleDynamicEventStatus (bool mode)
 "Dynamic Events Status"
 
proto native void ToggleDynamicEventVisualisation (bool mode)
 "Dynamic Events Vis"
 
proto native void DynamicEventSpawn ()
 "Dynamic Events Spawn"
 
proto native void DynamicEventExport ()
 "Export Dyn Event >>"
 
proto native void ToggleOverallStats (bool mode)
 "Overall Stats"
 

Variables

const int ECE_NONE = 0
 
const int ECE_SETUP = 2
 
const int ECE_TRACE = 4
 
const int ECE_CENTER = 8
 
const int ECE_UPDATEPATHGRAPH = 32
 
const int ECE_ROTATIONFLAGS = 512
 
const int ECE_CREATEPHYSICS = 1024
 
const int ECE_INITAI = 2048
 
const int ECE_AIRBORNE = 4096
 
const int ECE_EQUIP_ATTACHMENTS = 8192
 
const int ECE_EQUIP_CARGO = 16384
 
const int ECE_EQUIP = 24576
 
const int ECE_EQUIP_CONTAINER = 2097152
 
const int ECE_LOCAL = 1073741824
 
const int ECE_NOSURFACEALIGN = 262144
 
const int ECE_KEEPHEIGHT = 524288
 
const int ECE_NOLIFETIME = 4194304
 
const int ECE_NOPERSISTENCY_WORLD = 8388608
 
const int ECE_NOPERSISTENCY_CHAR = 16777216
 
const int ECE_DYNAMIC_PERSISTENCY = 33554432
 
const int ECE_IN_INVENTORY = 787456
 
const int ECE_PLACE_ON_SURFACE = 1060
 
const int ECE_OBJECT_SWAP = 787488
 
const int ECE_FULL = 25126
 
const int RF_NONE = 0
 
const int RF_FRONT = 1
 
const int RF_TOP = 2
 
const int RF_LEFT = 4
 
const int RF_RIGHT = 8
 
const int RF_BACK = 16
 
const int RF_BOTTOM = 32
 
const int RF_ALL = 63
 
const int RF_IGNORE = 64
 
const int RF_TOPBOTTOM = 34
 
const int RF_LEFTRIGHT = 12
 
const int RF_FRONTBACK = 17
 
const int RF_RANDOMROT = 64
 
const int RF_ORIGINAL = 128
 
const int RF_DECORRECTION = 256
 
const int RF_DEFAULT = 512
 
const string Economy = "economy"
 
const string EconomyRespawn = "economy_respawn"
 
const string RespawnQueue = "respawn_queue"
 
const string Container = "container"
 
const string Matrix = "matrix"
 
const string UniqueLoot = "uniqueloot"
 
const string Bind = "bind"
 
const string SetupFail = "setupfail"
 
const string Storage = "storage"
 
const string Classes = "class"
 
const string Category = "category"
 
const string Tag = "tag"
 
const string SCategory = "s_category"
 
const string STag = "s_tag"
 
const string SAreaflags = "s_areaflags"
 
const string SCrafted = "s_crafted"
 
const string MapGroup = "map_group"
 
const string MapComplete = "map_complete"
 
const string InfectedZone = "infected_zone"
 
const string ALL_ALL = "all:all"
 Everything.
 
const string ALL_LOOT = "all:loot"
 All loot.
 
const string ALL_VEHICLE = "all:vehicle"
 All vehicles.
 
const string ALL_INFECTED = "all:infected"
 All infected.
 
const string ALL_ANIMAL = "all:animal"
 All animals.
 
const string ALL_PLAYER = "all:player"
 All players.
 
const string ALL_PROXY = "all:proxy"
 All proxies.
 
const string ALL_PROXY_STATIC = "all:proxystatic"
 All static loot spawns.
 
const string ALL_PROXY_DYNAMIC = "all:proxydynamic"
 All dynamic loot spawns.
 
const string ALL_PROXY_ABANDONED = "all:proxyabandoned"
 All abandoned loot spawns.
 
class EconomyOutputStrings OFF = 0
 
class EconomyOutputStrings ADAPTIVE = 0
 
class EconomyOutputStrings VOLUME = 0
 
class EconomyOutputStrings OCCUPIED = 0
 
const string LINKS = "links"
 Lists stats regarding which loot spawn) that are linked together and how many there are.
 
const string SUSPICIOUS = "suspicious"
 Lists loot spawns that have more loot than their maximum + 4.
 
const string DE_CLOSE_POINT = "declosepoint"
 Lists DE spawns that have positions that are within supplied range (< fRange, not equal)
 
const string ABANDONED = "abandoned"
 Lists loot spawns that have been marked as abandoned.
 
const string EMPTY = "empty"
 Lists loot spawns that are not abandoned but have no loot.
 
const string CLOSE = "close"
 Lists loot spawns that are not abandoned and within the supplied range (< fRange, not equal)
 
const string WORLD = "world"
 Lists the number of objects inside of categories.
 
const string STATUS = "status"
 Lists overall CE stats.
 
const string LOOT_SIZE = "lootsize"
 Lists the maxlootsize of all CE items.
 

DEPRECATED/LEGACY

These don't do anything anymore but are left for backwards compatibility

class CEItemProfile CEApi () = 0
 API to interact with Central Economy.
 
proto native void PlatformStatTest ()
 
proto native void LootToggleProxyEditing (bool mode)
 
proto native void OnUpdate ()
 
proto native CEApi GetCEApi ()
 Get the CE API.
 

Function Documentation

◆ AnimalAmbientSpawn()

proto native void AnimalAmbientSpawn ( )
private

"Ambient Spawn"

◆ AnimalSpawn()

proto native void AnimalSpawn ( )
private

"Animal Spawn"

◆ AnimalToggleVisualisation()

proto native void AnimalToggleVisualisation ( bool mode)
private

"Animal Vis"

◆ AvoidPlayer()

proto native bool AvoidPlayer ( vector vPos,
float fDistance )
private

Check if there is a player within a radius.

Parameters
vPosvector The center point
fDistancefloat The radius around the center point
Returns
bool Returns false when there is a player inside supplied area, true when it successfully avoided players
GetCEApi().AvoidPlayer(Vector(500, 0, 500), 20);
proto native CEApi GetCEApi()
Get the CE API.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Referenced by ItemBase::SpawnCatch().

◆ AvoidVehicle()

proto native bool AvoidVehicle ( vector vPos,
float fDistance,
string sDEName = "" )
private

Check if there is a vehicle within a radius.

Parameters
vPosvector The center point
fDistancefloat The radius around the center point
sDENamestring A specific DE to avoid, if left empty, will avoid all vehicles
Returns
bool Returns false when there is a vehicle inside supplied area, true when it successfully avoided vehicles
GetCEApi().AvoidVehicle(Vector(500, 0, 500), 500, "VehicleCivilianSedan");

◆ Category()

static string Category ( string category)
staticprivate

Generates string that will make CEApi.EconomyMap use all items with this category.

Note
This is refering to the CE categories of loot defined in cfglimitsdefinition.xml
Warning
This is persistent per session, when you set it, it will persist until it is set to something else
Parameters
categorystring The desired loot category
Returns
string The string to pass into CEApi.EconomyMap
GetCEApi().EconomyMap(EconomyMapStrings.Category("food"));
class EconomyLogCategories EconomyMapStrings()
Special strings for CEApi.EconomyMap.

Definition at line 112 of file CentralEconomy.c.

113 {
114 return string.Format("category:%1", category);
115 }

◆ CleanMap()

proto native void CleanMap ( )
private

Queue up the depleting of lifetime of everything in the world.

Note
DEVELOPER/DIAG ONLY
GetCEApi().CleanMap();

◆ CountPlayersWithinRange()

proto native int CountPlayersWithinRange ( vector vPos,
float fRange )
private

Check if there is a vehicle within a radius.

Parameters
vPosvector The center point
fRangefloat The radius around the center point
Returns
int The amoutn of players inside supplied area
GetCEApi().CountPlayersWithinRange(Vector(500, 0, 500), 500);

◆ DynamicEventExport()

proto native void DynamicEventExport ( )
private

"Export Dyn Event >>"

◆ DynamicEventSpawn()

proto native void DynamicEventSpawn ( )
private

"Dynamic Events Spawn"

◆ EconomyLog()

proto native void EconomyLog ( string sLogType)
private

Outputs debug file to storage/log/*.csv.

Note
DEVELOPER/DIAG ONLY
Parameters
sLogTypestring The type of log (EconomyLogCategories)
Categories for CEApi.EconomyLog.

◆ EconomyLogCategories()

void EconomyMapStrings::EconomyLogCategories ( )
private

◆ EconomyMap()

proto native void EconomyMap ( string sMapType)
private

Outputs debug file to storage/lmap/*.tga showing the current places this is spawned.

Note
DEVELOPER/DIAG ONLY
This works best when you have an image of the map to overlay the tga with afterwards
Parameters
sMapTypestring The type of lmap, can be just a class name or a special string
Note
There are several prefixes and sets of strings that can be passed in here, see EconomyMapStrings
// To check only a specific item
GetCEApi().EconomyMap("Deagle");

◆ EconomyMapStrings()

class EconomyLogCategories EconomyMapStrings ( )

Special strings for CEApi.EconomyMap.

◆ EconomyOutput()

proto native void EconomyOutput ( string sOutputType,
float fRange )
private

Outputs debug logs into server log or rpt.

Note
DEVELOPER/DIAG ONLY
Parameters
sOutputTypestring One of the strings specified in EconomyOutputStrings
fRangefloat Range parameter used for some of the options
GetCEApi().EconomyOutput(EconomyOutputStrings.CLOSE, 3);
Special strings for CEApi.EconomyOutput.
const string CLOSE
Lists loot spawns that are not abandoned and within the supplied range (< fRange, not equal)

◆ EconomyOutputStrings()

void CEApi::EconomyOutputStrings ( )
private

◆ ExportClusterData()

proto native void ExportClusterData ( )
private

Generates "storage/export/mapgroupcluster.xml".

GetCEApi().ExportClusterData();

◆ ExportProxyData()

proto native void ExportProxyData ( vector vCenter = vector.Zero,
float fRadius = 0 )
private

Generates "storage/export/mapgrouppos.xml".

Parameters
vCentervector Center of area to generate from
Note
When using a zero vector, this will automatically get the world center
Parameters
fRadiusfloat Radius in meters of area to generate from
Note
When 0, this will automatically get a radius covering the map
// Export for whole map
GetCEApi().ExportProxyData();

◆ ExportProxyProto()

proto native void ExportProxyProto ( )
private

Generates "storage/export/mapgroupproto.xml".

GetCEApi().ExportProxyProto();

◆ ExportSpawnData()

proto native void ExportSpawnData ( )
private

Regenerates "storage/spawnpoints.bin" if necessary.

Note
Already happens automatically when server starts before it is loaded in
GetCEApi().ExportSpawnData();

◆ GetCEApi()

proto native CEApi GetCEApi ( )
private

Get the CE API.

Warning
Only exists when the game has CE enabled
Note
This means that this will work on anything which is running a mission with an initialized Hive
Client does not have Hive when connected to a server, only the server does if it was set up in the init.c

Referenced by BaseBuildingBase::AfterStoreLoad(), CGame::GlobalsInit(), HandlePlayerBody(), BaseBuildingBase::InitRefresherData(), Entity::MaxLifetimeRefreshCalc(), BaseBuildingBase::OnCEUpdate(), DayZPlayerCommandDeathCallback::OnSimulationEnd(), BaseBuildingBase::SetRefresherActive(), ItemBase::SpawnCatch(), and BaseBuildingBase::TerritoryFlag().

◆ GetCEGlobalFloat()

proto native float GetCEGlobalFloat ( string varName)
private

Get float from globals.xml.

Note
type="1"
Parameters
varNamestring The name of the entry
Returns
float The value or float.MIN if not found/not a float

◆ GetCEGlobalInt()

proto native int GetCEGlobalInt ( string varName)
private

Get int from globals.xml.

Note
type="0"
Parameters
varNamestring The name of the entry
Returns
int The value or int.MIN if not found/not an int

◆ GetCEGlobalString()

proto native string GetCEGlobalString ( string varName)
private

Get string from globals.xml.

Note
type="2"
Parameters
varNamestring The name of the entry
Returns
string The value or empty string if not found/not a string

◆ InfectedResetCleanup()

proto native void InfectedResetCleanup ( )
private

"Reset Cleanup"

◆ InfectedSpawn()

proto native void InfectedSpawn ( )
private

"Infected Spawn"

◆ InfectedToggleVisualisation()

proto native void InfectedToggleVisualisation ( bool mode)
private

"Infected Vis"

◆ InfectedToggleZoneInfo()

proto native void InfectedToggleZoneInfo ( bool mode)
private

"Infected Zone Info"

◆ ListCloseProxy()

proto native void ListCloseProxy ( float fRadius)
private

Outputs a list of all loot points closer than specified radius.

Note
This will automatically be checking all points against all points
This is a better way of handling it than the above two methods, as it can be then be removed manually from the xmls
Is the same as CEApi.EconomyOutput(EconomyOutputStrings.CLOSE, fRadius)
Parameters
fRadiusfloat The minimum desired distance in meters between loot spawn points
GetCEApi().ListCloseProxy(0.3);

◆ LootDepleteAndDamage()

proto native void LootDepleteAndDamage ( )
private

"Damage + Deplete"

◆ LootDepleteLifetime()

proto native void LootDepleteLifetime ( )
private

"Deplete Lifetime"

◆ LootExportAllGroups()

proto native void LootExportAllGroups ( )
private

"Export All Groups >>>>" / GetCEApi.ExportProxyProto();

◆ LootExportClusters()

proto native void LootExportClusters ( )
private

"<<< Export Clusters" / GetCEApi().ExportClusterData()

◆ LootExportGroup()

proto native void LootExportGroup ( )
private

"Export Group >>"

◆ LootExportMap()

proto native void LootExportMap ( )
private

"<<< Export Map" / GetCEApi.ExportProxyData(vector.Zero, 0);

◆ LootRetraceGroupPoints()

proto native void LootRetraceGroupPoints ( )
private

"Re-Trace Group Points"

◆ LootSetDamageToOne()

proto native void LootSetDamageToOne ( )
private

"Set Damage = 1.0"

◆ LootSetSpawnVolumeVisualisation()

proto native void LootSetSpawnVolumeVisualisation ( ESpawnVolumeVis mode)
private

"Spawn Volume Vis"

◆ LootToggleProxyEditing()

proto native void LootToggleProxyEditing ( bool mode)
private

◆ LootToggleSpawnSetup()

proto native void LootToggleSpawnSetup ( bool mode)
private

"Setup Vis"

◆ LootToggleVolumeEditing()

proto native void LootToggleVolumeEditing ( bool mode)
private

"Edit Volume"

◆ MarkCloseProxy()

proto native void MarkCloseProxy ( float fRadius,
bool bAllSelections )
private

Invalidates loot spawn points which are closer than the radius supplied.

Note
Will output a message indicating how many points were invalidated
Parameters
fRadiusfloat The minimum desired distance in meters between loot spawn points
Note
When 0 it will use a radius of 0.5
Parameters
bAllSelectionsbool When false, will only check the points within a container against each other, when true will against all points
// Example: I want there to be a minimum distance of 0.3m between any loot spawn point
GetCEApi().MarkCloseProxy(0.3, true);

◆ OverrideLifeTime()

proto native void OverrideLifeTime ( float fLifeTime)
private

Fills in the Debug Lifetime, which will be used for any new DE spawned.

Parameters
fLifeTimefloat The lifetime for any DE spawned after this call
Note
When this is set back to 0, it will stop using the Debug Lifetime
// Any DE spawned after this call will have a lifetime of 300 seconds
GetCEApi().OverrideLifeTime(300);

◆ PlatformStatTest()

proto native void PlatformStatTest ( )
private

◆ RadiusLifetimeDecrease()

proto native void RadiusLifetimeDecrease ( vector vCenter,
float fRadius,
float fValue )
private

Process lifetime decrease within radius by value (sec)

Note
Will automatically clamp result between min and max lifetime [3, 316224000] (3 seconds to 10 years)
Parameters
vCentervector The center point
fRadiusfloat The radius around the center point
fValuefloat The value to decrease the lifetime by
GetCEApi().RadiusLifetimeDecrease(Vector(500, 0, 500), 3, 500);

◆ RadiusLifetimeIncrease()

proto native void RadiusLifetimeIncrease ( vector vCenter,
float fRadius,
float fValue )
private

Process lifetime increase within radius by value (sec)

Note
Will automatically clamp result between min and max lifetime [3, 316224000] (3 seconds to 10 years)
Parameters
vCentervector The center point
fRadiusfloat The radius around the center point
fValuefloat The value to increase the lifetime by
Note
When 0, this will reset it to default instead (but it's better to use RadiusLifetimeReset still)
GetCEApi().RadiusLifetimeIncrease(Vector(500, 0, 500), 3, 500);

◆ RadiusLifetimeReset()

proto native void RadiusLifetimeReset ( vector vCenter,
float fRadius )
private

Process lifetime reset to default value from DB within radius.

Parameters
vCentervector The center point
fRadiusfloat The radius around the center point
GetCEApi().RadiusLifetimeReset(Vector(500, 0, 500), 3);

◆ RemoveCloseProxy()

proto native void RemoveCloseProxy ( )
private

Removes all invalid points.

Note
Is best paired with a MarkCloseProxy call first to invalidate unwanted points
Will output a message indicating the amount of deleted points
GetCEApi().RemoveCloseProxy();

◆ SpawnAnalyze()

proto native bool SpawnAnalyze ( string sClassName)
private

Will emulate the spawning of the item which is being looked at and generate images (.tga) in storage/lmap and output logs.

Note
DEVELOPER/DIAG ONLY
This will only work if the loot spawner is active
Parameters
sClassNamestring The class name of the desired item to analyze
Note
When using "*" as class name, instead of generating images, it will generate a .csv in storage/log containing the output of all spawnable items
Returns
bool Whether the operation was successful, it might fail in certain scenarios if the CE doesn't update in time
GetCEApi().SpawnAnalyze("FlatCap_Grey");

◆ SpawnBuilding()

proto native void SpawnBuilding ( vector vPos,
bool bShowCylinders = false,
float fDefaultDistance = 20 )
private

Spawn all entities with building category through CE.

Note
DEVELOPER/DIAG ONLY
Will print additional logs to RPT
Parameters
vPosvector The position to spawn the Entities at
Note
This will be the starting position, the items will be split into segments by CE BBox size (smallest to largest)
Parameters
bShowCylindersbool Whether to draw the CE BBox with debug shapes
Note
Red: Invalid BBox; Yellow: Not in DB; Green: All ok
These will most likely just always be red
Parameters
fDefaultDistancefloat The default distance to use when the entity does not have a CE BBox
Note
This means that all the ones with invalid CE BBoxes will be piled up at the starting position when this is 0
GetCEApi().SpawnBuilding(Vector(5, 10, 5), true);

◆ SpawnDE()

proto native void SpawnDE ( string sEvName,
vector vPos,
float fAngle = -1 )
private

Force spawn specific dynamic event.

Note
DEVELOPER/DIAG ONLY
Versatile, can be used for Animal, Infected, Static, Item and Vehicle
Is the only one capable of spawning DE's that have DE Groups
Is the same as the next one, but has ECE_FULL flags and a hidden flag which overrides herd limit
This is also FORCE spawn, so it will bypass any limit and avoidance checks
Parameters
sEvNamestring The DE to spawn
vPosvector The position to spawn the Entity at
fAnglefloat Angle to spawn the Entity with in degrees [0, 360]
Note
When a negative value, will pick a random one
Returns
bool Whether the spawn was successful
GetCEApi().SpawnDE("StaticHeliCrash", Vector(5, 10, 5));

◆ SpawnDEEx()

proto native void SpawnDEEx ( string sEvName,
vector vPos,
float fAngle,
int uFlags )
private

Force spawn specific dynamic event.

Note
DEVELOPER/DIAG ONLY
Is the same one as above but with the possibility of custom flags
Parameters
sEvNamestring The DE to spawn
vPosvector The position to spawn the Entity at
fAnglefloat Angle to spawn the Entity with in degrees [0, 360]
Note
When a negative value, will pick a random one
Parameters
uFlagsint ECE flags to apply while spawning the DE
Returns
bool Whether the spawn was successful
GetCEApi().SpawnDEEx("StaticHeliCrash", Vector(5, 10, 5), ECE_FULL);
const int ECE_FULL

◆ SpawnDynamic()

proto native void SpawnDynamic ( vector vPos,
bool bShowCylinders = true,
float fDefaultDistance = 0 )
private

Spawn all entities with dynamic category through CE.

Note
DEVELOPER/DIAG ONLY
Will print additional logs to RPT
Parameters
vPosvector The position to spawn the Entities at
Note
This will be the starting position, the items will be split into segments by CE BBox size (smallest to largest)
Parameters
bShowCylindersbool Whether to draw the CE BBox with debug shapes
Note
Red: Invalid BBox; Yellow: Not in DB; Green: All ok
Parameters
fDefaultDistancefloat The default distance to use when the entity does not have a CE BBox
Note
This means that all the ones with invalid CE BBoxes will be piled up at the starting position when this is 0
GetCEApi().SpawnDynamic(Vector(5, 10, 5), true);

◆ SpawnEntity()

proto native void SpawnEntity ( string sClassName,
vector vPos,
float fRange,
int iCount )
private

Spawn an entity through CE.

Note
DEVELOPER/DIAG ONLY
Is similar to SpawnLoot, but works better on Animal/Infected/Vehicle
Parameters
sClassNamestring The entity to spawn
vPosvector The position to spawn the Entity at
fRangefloat Circle radius
Note
When iCount is larger than 1, changing this will make it so that they are spawned in a circle around vPos
Parameters
iCountint The amount of items
GetCEApi().SpawnEntity("Deagle", Vector(5, 10, 5), 1, 9);

Referenced by DayZPlayer::CommandHandlerDebug(), HandleStoreCartridge(), SelectStoreCartridge(), PluginBase::SpawnEntityInInventory(), PluginBase::SpawnEntityInPlayerInventory(), Entity::SpawnEntityOnGround(), and Entity::SpawnEntityOnGroundPos().

◆ SpawnGroup()

proto native Entity SpawnGroup ( string sGroupName,
vector vPos,
float fAngle = -1 )
private

Force spawn specific prototype group + loot at position.

Note
DEVELOPER/DIAG ONLY
This can also spawn in other CE & DE related objects, but is best used exclusively for testing prototype groups
Parameters
sGroupNamestring The group name to spawn
vPosvector The position to spawn the Entity at
fAnglefloat Angle to spawn the Entity with in degrees [0, 360]
Note
When a negative value, will pick a random one
Returns
Entity The spawned Entity or null if unsuccessful
GetCEApi().SpawnGroup("Land_Shed_M1", Vector(5, 10, 5));

◆ SpawnLoot()

proto native void SpawnLoot ( string sEvName,
vector vPos,
float fAngle,
int iCount = 1,
float fRange = 1 )
private

Spawn an item through CE.

Note
DEVELOPER/DIAG ONLY
Parameters
sEvNamestring The DE to spawn
vPosvector The position to spawn the Entity at
fAnglefloat Angle to spawn the Entity with in degrees [0, 360]
Note
When a negative value, will pick a random one
Parameters
iCountint The amount of items
fRangefloat Circle radius
Note
When iCount is larger than 1, changing this will make it so that they are spawned in a circle around vPos
GetCEApi().SpawnLoot("Deagle", Vector(5, 10, 5), 0, 9, 1);

◆ SpawnPerfTest()

proto native void SpawnPerfTest ( string sClassName,
int iCount )
private

Spawn an entity through CE, x amount of times in a grid.

Note
DEVELOPER/DIAG ONLY
The name may imply it does something else, but a profiler is needed to actually benchmark it
The position starts at 0 0 0
Parameters
sClassNamestring The entity to spawn
iCountint The amount of items
GetCEApi().SpawnPerfTest("Deagle", 30);

◆ SpawnRotation()

proto native void SpawnRotation ( string sClassName,
vector vPos,
float fRange,
int iCount,
int iFlags )
private

Spawn an entity through CE.

Note
DEVELOPER/DIAG ONLY
Is the same as SpawnEntity, under the hood it just defaults to RF_ORIGINAL
Parameters
sClassNamestring The entity to spawn
vPosvector The position to spawn the Entity at
fRangefloat Circle radius
Note
When iCount is larger than 1, changing this will make it so that they are spawned in a circle around vPos
Parameters
iCountint The amount of items
iFlagsint The rotation flags to apply
GetCEApi().SpawnRotation("Deagle", Vector(5, 10, 5), 1, 9, RF_ALL);
const int RF_ALL

◆ SpawnSingleEntity()

proto native Object SpawnSingleEntity ( string sClassName,
vector vPos )
private

Spawn an entity through CE.

Note
DEVELOPER/DIAG ONLY
Is the same as SpawnEntity, but spawns only one and returns the spawned Object
Parameters
sClassNamestring The entity to spawn
vPosvector The position to spawn the Entity at
Returns
Object The spawned Object
GetCEApi().SpawnSingleEntity("Deagle", Vector(5, 10, 5));

◆ SpawnVehicles()

proto native void SpawnVehicles ( vector vPos,
bool bShowCylinders = false,
float fDefaultDistance = 20 )
private

Spawn all entities with vehicles category through CE.

Note
DEVELOPER/DIAG ONLY
Will print additional logs to RPT
Parameters
vPosvector The position to spawn the Entities at
Note
This will be the starting position, vehicles spawn with 20m spacing
Make sure you do it on a surface as flat and open as possible, they need a lot of space
Parameters
bShowCylindersbool Does nothing for Vehicles, left for backwards compat
fDefaultDistancefloat The default distance to use when the entity does not have a CE BBox
Note
This means that all the ones with invalid CE BBoxes will be piled up at the starting position when this is 0
GetCEApi().SpawnVehicles(Vector(5, 10, 5));

◆ Tag()

static string Tag ( string tag)
staticprivate

Generates string that will make CEApi.EconomyMap use all items with this tag.

Note
This is refering to the CE tags of loot defined in cfglimitsdefinition.xml
Warning
This is persistent per session, when you set it, it will persist until it is set to something else
Parameters
categorystring The desired loot tag
Returns
string The string to pass into CEApi.EconomyMap
GetCEApi().EconomyMap(EconomyMapStrings.Tag("floor"));

Definition at line 127 of file CentralEconomy.c.

128 {
129 return string.Format("tag:%1", tag);
130 }

◆ TimeShift()

proto native void TimeShift ( float fShift)
private

Subtracts the supplied value from the current lifetime of all items in the world.

Note
Uses RadiusLifetimeDecrease under the hood and then calculates the parameters to fit the world
Will automatically clamp result between min and max lifetime [3, 316224000] (3 seconds to 10 years)
Parameters
fShiftfloat The value in seconds which will be subtracted from the current lifetimes
// Shortens the lifetimes of all items in the world by 3 seconds
GetCEApi().TimeShift(3);

◆ ToggleClusterVisualisation()

proto native void ToggleClusterVisualisation ( bool mode)
private

"Cluster Vis"

◆ ToggleDynamicEventStatus()

proto native void ToggleDynamicEventStatus ( bool mode)
private

"Dynamic Events Status"

◆ ToggleDynamicEventVisualisation()

proto native void ToggleDynamicEventVisualisation ( bool mode)
private

"Dynamic Events Vis"

◆ ToggleLootVisualisation()

proto native void ToggleLootVisualisation ( bool mode)
private

"Loot Vis"

◆ ToggleOverallStats()

proto native void ToggleOverallStats ( bool mode)
private

"Overall Stats"

◆ ToggleVehicleAndWreckVisualisation()

proto native void ToggleVehicleAndWreckVisualisation ( bool mode)
private

"Vehicle&Wreck Vis"

◆ ~CEApi()

void ~CEApi ( )
private

Definition at line 228 of file CentralEconomy.c.

228{}

◆ ~EconomyLogCategories()

void EconomyMapStrings::~EconomyLogCategories ( )
private

◆ ~EconomyMapStrings()

void ~EconomyMapStrings ( )
private

◆ ~EconomyOutputStrings()

void CEApi::~EconomyOutputStrings ( )
private

Variable Documentation

◆ ABANDONED

const string ABANDONED = "abandoned"
private

Lists loot spawns that have been marked as abandoned.

Note
In logs: "[autotest:ListAbandonedGroups]"

Definition at line 250 of file CentralEconomy.c.

◆ ADAPTIVE

class EconomyOutputStrings ADAPTIVE = 0
private

◆ ALL_ALL

const string ALL_ALL = "all:all"
private

Everything.

Definition at line 134 of file CentralEconomy.c.

◆ ALL_ANIMAL

const string ALL_ANIMAL = "all:animal"
private

All animals.

Definition at line 142 of file CentralEconomy.c.

◆ ALL_INFECTED

const string ALL_INFECTED = "all:infected"
private

All infected.

Definition at line 140 of file CentralEconomy.c.

◆ ALL_LOOT

const string ALL_LOOT = "all:loot"
private

All loot.

Definition at line 136 of file CentralEconomy.c.

◆ ALL_PLAYER

const string ALL_PLAYER = "all:player"
private

All players.

Definition at line 144 of file CentralEconomy.c.

◆ ALL_PROXY

const string ALL_PROXY = "all:proxy"
private

All proxies.

Definition at line 146 of file CentralEconomy.c.

◆ ALL_PROXY_ABANDONED

const string ALL_PROXY_ABANDONED = "all:proxyabandoned"
private

All abandoned loot spawns.

Definition at line 152 of file CentralEconomy.c.

◆ ALL_PROXY_DYNAMIC

const string ALL_PROXY_DYNAMIC = "all:proxydynamic"
private

All dynamic loot spawns.

Definition at line 150 of file CentralEconomy.c.

◆ ALL_PROXY_STATIC

const string ALL_PROXY_STATIC = "all:proxystatic"
private

All static loot spawns.

Definition at line 148 of file CentralEconomy.c.

◆ ALL_VEHICLE

const string ALL_VEHICLE = "all:vehicle"
private

All vehicles.

Definition at line 138 of file CentralEconomy.c.

◆ Bind

const string Bind = "bind"
private

Definition at line 9 of file CentralEconomy.c.

◆ Category

const string Category = "category"
private

Definition at line 13 of file CentralEconomy.c.

◆ CEApi

class EconomyOutputStrings CEApi ( ) = 0
private

API to interact with Central Economy.

Note
Accessible through GetCEApi, make sure to read the documentation for that as well
Any mention of 'storage/' means the '$mission:storage_#' folder

Definition at line 152 of file CentralEconomy.c.

227{}

◆ Classes

const string Classes = "class"
private

Definition at line 12 of file CentralEconomy.c.

◆ CLOSE

const string CLOSE = "close"
private

Lists loot spawns that are not abandoned and within the supplied range (< fRange, not equal)

Note
In logs: "[autotest:ListCloseGroups]"
Is the same as CEApi.ListCloseProxy

Definition at line 261 of file CentralEconomy.c.

◆ Container

const string Container = "container"
private

Definition at line 6 of file CentralEconomy.c.

◆ DE_CLOSE_POINT

const string DE_CLOSE_POINT = "declosepoint"
private

Lists DE spawns that have positions that are within supplied range (< fRange, not equal)

Note
In logs: "[ClosePosition]"

Definition at line 245 of file CentralEconomy.c.

◆ ECE_AIRBORNE

const int ECE_AIRBORNE = 4096

Definition at line 18 of file CentralEconomy.c.

◆ ECE_CENTER

const int ECE_CENTER = 8

Definition at line 11 of file CentralEconomy.c.

◆ ECE_CREATEPHYSICS

◆ ECE_DYNAMIC_PERSISTENCY

◆ ECE_EQUIP

const int ECE_EQUIP = 24576

Definition at line 22 of file CentralEconomy.c.

◆ ECE_EQUIP_ATTACHMENTS

const int ECE_EQUIP_ATTACHMENTS = 8192

Definition at line 20 of file CentralEconomy.c.

Referenced by ManBase::SpawnAI(), and PluginBase::SpawnNewInfectedEntity().

◆ ECE_EQUIP_CARGO

const int ECE_EQUIP_CARGO = 16384

Definition at line 21 of file CentralEconomy.c.

◆ ECE_EQUIP_CONTAINER

const int ECE_EQUIP_CONTAINER = 2097152

Definition at line 23 of file CentralEconomy.c.

◆ ECE_FULL

const int ECE_FULL = 25126

Definition at line 40 of file CentralEconomy.c.

◆ ECE_IN_INVENTORY

◆ ECE_INITAI

const int ECE_INITAI = 2048

Definition at line 17 of file CentralEconomy.c.

Referenced by ManBase::SpawnAI(), and PluginBase::SpawnNewInfectedEntity().

◆ ECE_KEEPHEIGHT

◆ ECE_LOCAL

◆ ECE_NOLIFETIME

const int ECE_NOLIFETIME = 4194304

Definition at line 29 of file CentralEconomy.c.

Referenced by ObjectSpawnerHandler::SpawnObject().

◆ ECE_NONE

◆ ECE_NOPERSISTENCY_CHAR

const int ECE_NOPERSISTENCY_CHAR = 16777216

Definition at line 31 of file CentralEconomy.c.

◆ ECE_NOPERSISTENCY_WORLD

const int ECE_NOPERSISTENCY_WORLD = 8388608

Definition at line 30 of file CentralEconomy.c.

◆ ECE_NOSURFACEALIGN

const int ECE_NOSURFACEALIGN = 262144

Definition at line 26 of file CentralEconomy.c.

◆ ECE_OBJECT_SWAP

◆ ECE_PLACE_ON_SURFACE

const int ECE_PLACE_ON_SURFACE = 1060

Definition at line 37 of file CentralEconomy.c.

Referenced by FireplaceBase::AfterStoreLoad(), ItemBase::CreateConstructionKit(), CreateItemBasePiles(), CreateMagazinePiles(), CreateMagazinePilesFromBullet(), Managed::CreateNewCharacter(), ReplaceItemWithNewLambdaBase::CreateNewEntity(), ReplaceAndDestroyLambdaEx::CreateNewEntity(), CreateOrgan(), CAContinuousMineWood::CreatePrimaryItems(), ItemBase::CreateRope(), CAContinuousMineWood::CreateSecondaryItems(), Weapon::CreateWeaponWithAmmo(), EffectAreaLoader::CreateZones(), KitBase::DisassembleKit(), DropNonUsableMaterialsServer(), FlammableBase::EEItemDetached(), HeadGear_Base::EEItemLocationChanged(), Mask_Base::EEItemLocationChanged(), Inventory_Base::EmptySeedPack(), HandleFishingResultSuccess(), ItemBase::Harvest(), Hologram::Hologram(), FireplaceBase::IgniteEntityAsFireplace(), FishingRod_Base_New::OnDebugSpawn(), ActionPickupChicken::OnExecuteServer(), ActionCreateIndoorFireplace::OnExecuteServer(), ActionCreateIndoorOven::OnExecuteServer(), ActionDigInStash::OnFinishProgressServer(), ActionDigWorms::OnFinishProgressServer(), ActionSawPlanks::OnFinishProgressServer(), ActionStripCarrierVest::OnFinishProgressServer(), ActionUnpackGift::OnFinishProgressServer(), FireplaceBase::OnIgnitedThis(), GardenBase::OnPlacementComplete(), KitBase::OnPlacementComplete(), OnPlacementComplete(), TentBase::OnPlacementComplete(), GardenBase::OnStoreLoad(), ItemBase::OnStoreLoad(), UnboxLambda::OnSuccess(), OnSuccess(), ItemBase::RemovePlant(), ItemBase::RemovePlantEx(), Managed::SetAttachment(), ActionSortAmmoPile::SortAmmo(), ManBase::SpawnAI(), TrapSpawnBase::SpawnCatch(), Entity::SpawnEntityOnGround(), Entity::SpawnEntityOnGroundPos(), ManBase::SpawnEntityOnGroundPos(), ContaminatedArea_Dynamic::SpawnItems(), TentBase::SpawnKit(), PluginBase::SpawnNewInfectedEntity(), InventoryItem::SplitIntoStackMax(), and FlammableBase::TryTransformIntoStick().

◆ ECE_ROTATIONFLAGS

const int ECE_ROTATIONFLAGS = 512

Definition at line 15 of file CentralEconomy.c.

◆ ECE_SETUP

const int ECE_SETUP = 2

◆ ECE_TRACE

const int ECE_TRACE = 4

Definition at line 10 of file CentralEconomy.c.

Referenced by Hologram::Hologram(), and ScriptConsoleItemsTab::SetPreviewObject().

◆ ECE_UPDATEPATHGRAPH

const int ECE_UPDATEPATHGRAPH = 32

Definition at line 13 of file CentralEconomy.c.

Referenced by CreateItemBasePiles(), and ObjectSpawnerHandler::SpawnObject().

◆ Economy

const string Economy = "economy"
private

Definition at line 3 of file CentralEconomy.c.

◆ EconomyRespawn

const string EconomyRespawn = "economy_respawn"
private

Definition at line 4 of file CentralEconomy.c.

◆ EMPTY

const string EMPTY = "empty"
private

Lists loot spawns that are not abandoned but have no loot.

Note
In logs: "[autotest:ListEmptyGroups]"

Definition at line 255 of file CentralEconomy.c.

◆ InfectedZone

const string InfectedZone = "infected_zone"
private

Definition at line 21 of file CentralEconomy.c.

◆ LINKS

const string LINKS = "links"
private

Lists stats regarding which loot spawn) that are linked together and how many there are.

Note
In logs: "[linked_groups]"

Definition at line 235 of file CentralEconomy.c.

◆ LOOT_SIZE

const string LOOT_SIZE = "lootsize"
private

Lists the maxlootsize of all CE items.

Note
In logs: "[autotest:ListLootSize]"

Definition at line 276 of file CentralEconomy.c.

◆ MapComplete

const string MapComplete = "map_complete"
private

Definition at line 20 of file CentralEconomy.c.

◆ MapGroup

const string MapGroup = "map_group"
private

Definition at line 19 of file CentralEconomy.c.

◆ Matrix

const string Matrix = "matrix"
private

Definition at line 7 of file CentralEconomy.c.

◆ OCCUPIED

class EconomyOutputStrings OCCUPIED = 0
private

◆ OFF

class EconomyOutputStrings OFF = 0
private

◆ RespawnQueue

const string RespawnQueue = "respawn_queue"
private

Definition at line 5 of file CentralEconomy.c.

◆ RF_ALL

const int RF_ALL = 63

Definition at line 54 of file CentralEconomy.c.

◆ RF_BACK

const int RF_BACK = 16

Definition at line 51 of file CentralEconomy.c.

◆ RF_BOTTOM

const int RF_BOTTOM = 32

Definition at line 52 of file CentralEconomy.c.

◆ RF_DECORRECTION

const int RF_DECORRECTION = 256

Definition at line 64 of file CentralEconomy.c.

◆ RF_DEFAULT

◆ RF_FRONT

const int RF_FRONT = 1

Definition at line 47 of file CentralEconomy.c.

◆ RF_FRONTBACK

const int RF_FRONTBACK = 17

Definition at line 60 of file CentralEconomy.c.

◆ RF_IGNORE

const int RF_IGNORE = 64

Definition at line 56 of file CentralEconomy.c.

Referenced by ObjectSpawnerHandler::SpawnObject().

◆ RF_LEFT

const int RF_LEFT = 4

Definition at line 49 of file CentralEconomy.c.

◆ RF_LEFTRIGHT

const int RF_LEFTRIGHT = 12

Definition at line 59 of file CentralEconomy.c.

◆ RF_NONE

const int RF_NONE = 0

Definition at line 45 of file CentralEconomy.c.

Referenced by ReplaceItemWithNewLambdaBase::CreateNewEntity().

◆ RF_ORIGINAL

◆ RF_RANDOMROT

const int RF_RANDOMROT = 64

Definition at line 62 of file CentralEconomy.c.

◆ RF_RIGHT

const int RF_RIGHT = 8

Definition at line 50 of file CentralEconomy.c.

◆ RF_TOP

const int RF_TOP = 2

Definition at line 48 of file CentralEconomy.c.

◆ RF_TOPBOTTOM

const int RF_TOPBOTTOM = 34

Definition at line 58 of file CentralEconomy.c.

◆ SAreaflags

const string SAreaflags = "s_areaflags"
private

Definition at line 17 of file CentralEconomy.c.

◆ SCategory

const string SCategory = "s_category"
private

Definition at line 15 of file CentralEconomy.c.

◆ SCrafted

const string SCrafted = "s_crafted"
private

Definition at line 18 of file CentralEconomy.c.

◆ SetupFail

const string SetupFail = "setupfail"
private

Definition at line 10 of file CentralEconomy.c.

◆ STag

const string STag = "s_tag"
private

Definition at line 16 of file CentralEconomy.c.

◆ STATUS

const string STATUS = "status"
private

Lists overall CE stats.

Note
In logs: "[autotest:OverallStatus]"

Definition at line 271 of file CentralEconomy.c.

◆ Storage

const string Storage = "storage"
private

Definition at line 11 of file CentralEconomy.c.

◆ SUSPICIOUS

const string SUSPICIOUS = "suspicious"
private

Lists loot spawns that have more loot than their maximum + 4.

Note
In logs: "[autotest:ListSuspiciousGroups]"

Definition at line 240 of file CentralEconomy.c.

◆ Tag

const string Tag = "tag"
private

Definition at line 14 of file CentralEconomy.c.

◆ UniqueLoot

const string UniqueLoot = "uniqueloot"
private

Definition at line 8 of file CentralEconomy.c.

◆ VOLUME

class EconomyOutputStrings VOLUME = 0
private

◆ WORLD

const string WORLD = "world"
private

Lists the number of objects inside of categories.

Note
In logs: "[autotest:ProcessDebugLog]"

Definition at line 266 of file CentralEconomy.c.