PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
CentralEconomy.c File Reference

Data Structures

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.
 
private void EconomyLogCategories ()
 
private void ~EconomyLogCategories ()
 
private 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.
 
private void EconomyOutputStrings ()
 
private void ~EconomyOutputStrings ()
 
private 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 ( )

"Ambient Spawn"

◆ AnimalSpawn()

proto native void AnimalSpawn ( )

"Animal Spawn"

◆ AnimalToggleVisualisation()

proto native void AnimalToggleVisualisation ( bool  mode)

"Animal Vis"

◆ AvoidPlayer()

proto native bool AvoidPlayer ( vector  vPos,
float  fDistance 
)

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 BoatScript::DecayHealthTick().

◆ AvoidVehicle()

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

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)
static

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.
const string Category
Definition CentralEconomy.c:84

References string::Format().

◆ CleanMap()

proto native void CleanMap ( )

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 
)

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 ( )

"Export Dyn Event >>"

◆ DynamicEventSpawn()

proto native void DynamicEventSpawn ( )

"Dynamic Events Spawn"

◆ EconomyLog()

proto native void EconomyLog ( string  sLogType)

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

Note
DEVELOPER/DIAG ONLY
Parameters
sLogTypestring The type of log (EconomyLogCategories)
Categories for CEApi.EconomyLog.
Definition CentralEconomy.c:70
const string Economy
Definition CentralEconomy.c:74

◆ EconomyLogCategories()

private void EconomyLogCategories ( )

◆ EconomyMap()

proto native void EconomyMap ( string  sMapType)

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 
)

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.
Definition CentralEconomy.c:159
const string CLOSE
Lists loot spawns that are not abandoned and within the supplied range (< fRange, not equal)
Definition CentralEconomy.c:193

◆ EconomyOutputStrings()

private void EconomyOutputStrings ( )

◆ ExportClusterData()

proto native void ExportClusterData ( )

Generates "storage/export/mapgroupcluster.xml".

GetCEApi().ExportClusterData();

◆ ExportProxyData()

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

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 ( )

Generates "storage/export/mapgroupproto.xml".

GetCEApi().ExportProxyProto();

◆ ExportSpawnData()

proto native void ExportSpawnData ( )

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 ( )

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(), BoatScript::DecayHealthTick(), CGame::GlobalsInit(), HandlePlayerBody(), BaseBuildingBase::InitRefresherData(), ItemBase::IsPlayerInVicinity(), Entity::MaxLifetimeRefreshCalc(), BaseBuildingBase::OnCEUpdate(), DayZPlayerCommandDeathCallback::OnSimulationEnd(), BaseBuildingBase::SetRefresherActive(), and BaseBuildingBase::TerritoryFlag().

◆ GetCEGlobalFloat()

proto native float GetCEGlobalFloat ( string  varName)

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)

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)

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 ( )

"Reset Cleanup"

◆ InfectedSpawn()

proto native void InfectedSpawn ( )

"Infected Spawn"

◆ InfectedToggleVisualisation()

proto native void InfectedToggleVisualisation ( bool  mode)

"Infected Vis"

◆ InfectedToggleZoneInfo()

proto native void InfectedToggleZoneInfo ( bool  mode)

"Infected Zone Info"

◆ ListCloseProxy()

proto native void ListCloseProxy ( float  fRadius)

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 ( )

"Damage + Deplete"

◆ LootDepleteLifetime()

proto native void LootDepleteLifetime ( )

"Deplete Lifetime"

◆ LootExportAllGroups()

proto native void LootExportAllGroups ( )

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

◆ LootExportClusters()

proto native void LootExportClusters ( )

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

◆ LootExportGroup()

proto native void LootExportGroup ( )

"Export Group >>"

◆ LootExportMap()

proto native void LootExportMap ( )

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

◆ LootRetraceGroupPoints()

proto native void LootRetraceGroupPoints ( )

"Re-Trace Group Points"

◆ LootSetDamageToOne()

proto native void LootSetDamageToOne ( )

"Set Damage = 1.0"

◆ LootSetSpawnVolumeVisualisation()

proto native void LootSetSpawnVolumeVisualisation ( ESpawnVolumeVis  mode)

"Spawn Volume Vis"

◆ LootToggleProxyEditing()

proto native void LootToggleProxyEditing ( bool  mode)

◆ LootToggleSpawnSetup()

proto native void LootToggleSpawnSetup ( bool  mode)

"Setup Vis"

◆ LootToggleVolumeEditing()

proto native void LootToggleVolumeEditing ( bool  mode)

"Edit Volume"

◆ MarkCloseProxy()

proto native void MarkCloseProxy ( float  fRadius,
bool  bAllSelections 
)

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)

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 ( )

◆ RadiusLifetimeDecrease()

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

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 
)

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 
)

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 ( )

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)

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 
)

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 
)

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 
)

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
Definition CentralEconomy.c:40

◆ SpawnDynamic()

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

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 
)

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 
)

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 
)

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 
)

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 
)

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
Definition CentralEconomy.c:54

◆ SpawnSingleEntity()

proto native Object SpawnSingleEntity ( string  sClassName,
vector  vPos 
)

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 
)

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)
static

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"));
const string Tag
Definition CentralEconomy.c:85

References string::Format().

◆ TimeShift()

proto native void TimeShift ( float  fShift)

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)

"Cluster Vis"

◆ ToggleDynamicEventStatus()

proto native void ToggleDynamicEventStatus ( bool  mode)

"Dynamic Events Status"

◆ ToggleDynamicEventVisualisation()

proto native void ToggleDynamicEventVisualisation ( bool  mode)

"Dynamic Events Vis"

◆ ToggleLootVisualisation()

proto native void ToggleLootVisualisation ( bool  mode)

"Loot Vis"

◆ ToggleOverallStats()

proto native void ToggleOverallStats ( bool  mode)

"Overall Stats"

◆ ToggleVehicleAndWreckVisualisation()

proto native void ToggleVehicleAndWreckVisualisation ( bool  mode)

"Vehicle&Wreck Vis"

◆ ~CEApi()

private void ~CEApi ( )

◆ ~EconomyLogCategories()

private void ~EconomyLogCategories ( )

◆ ~EconomyMapStrings()

private void ~EconomyMapStrings ( )

◆ ~EconomyOutputStrings()

private void ~EconomyOutputStrings ( )

Variable Documentation

◆ ABANDONED

const string ABANDONED = "abandoned"

Lists loot spawns that have been marked as abandoned.

Note
In logs: "[autotest:ListAbandonedGroups]"

◆ ADAPTIVE

class EconomyOutputStrings ADAPTIVE = 0

◆ ALL_ALL

const string ALL_ALL = "all:all"

Everything.

◆ ALL_ANIMAL

const string ALL_ANIMAL = "all:animal"

All animals.

◆ ALL_INFECTED

const string ALL_INFECTED = "all:infected"

All infected.

◆ ALL_LOOT

const string ALL_LOOT = "all:loot"

All loot.

◆ ALL_PLAYER

const string ALL_PLAYER = "all:player"

All players.

◆ ALL_PROXY

const string ALL_PROXY = "all:proxy"

All proxies.

◆ ALL_PROXY_ABANDONED

const string ALL_PROXY_ABANDONED = "all:proxyabandoned"

All abandoned loot spawns.

◆ ALL_PROXY_DYNAMIC

const string ALL_PROXY_DYNAMIC = "all:proxydynamic"

All dynamic loot spawns.

◆ ALL_PROXY_STATIC

const string ALL_PROXY_STATIC = "all:proxystatic"

All static loot spawns.

◆ ALL_VEHICLE

const string ALL_VEHICLE = "all:vehicle"

All vehicles.

◆ Bind

const string Bind = "bind"

◆ Category

const string Category = "category"

◆ CEApi

class EconomyOutputStrings CEApi ( ) = 0

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

◆ Classes

const string Classes = "class"

◆ CLOSE

const string CLOSE = "close"

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

◆ Container

const string Container = "container"

◆ DE_CLOSE_POINT

const string DE_CLOSE_POINT = "declosepoint"

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

Note
In logs: "[ClosePosition]"

◆ ECE_AIRBORNE

const int ECE_AIRBORNE = 4096

◆ ECE_CENTER

const int ECE_CENTER = 8

◆ ECE_CREATEPHYSICS

◆ ECE_DYNAMIC_PERSISTENCY

◆ ECE_EQUIP

const int ECE_EQUIP = 24576

◆ ECE_EQUIP_ATTACHMENTS

const int ECE_EQUIP_ATTACHMENTS = 8192

◆ ECE_EQUIP_CARGO

const int ECE_EQUIP_CARGO = 16384

◆ ECE_EQUIP_CONTAINER

const int ECE_EQUIP_CONTAINER = 2097152

◆ ECE_FULL

const int ECE_FULL = 25126

◆ ECE_IN_INVENTORY

◆ ECE_INITAI

const int ECE_INITAI = 2048

◆ ECE_KEEPHEIGHT

◆ ECE_LOCAL

◆ ECE_NOLIFETIME

◆ ECE_NONE

◆ ECE_NOPERSISTENCY_CHAR

const int ECE_NOPERSISTENCY_CHAR = 16777216

◆ ECE_NOPERSISTENCY_WORLD

const int ECE_NOPERSISTENCY_WORLD = 8388608

◆ ECE_NOSURFACEALIGN

const int ECE_NOSURFACEALIGN = 262144

◆ ECE_OBJECT_SWAP

◆ ECE_PLACE_ON_SURFACE

const int ECE_PLACE_ON_SURFACE = 1060

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

◆ ECE_ROTATIONFLAGS

const int ECE_ROTATIONFLAGS = 512

◆ ECE_SETUP

◆ ECE_TRACE

const int ECE_TRACE = 4

◆ ECE_UPDATEPATHGRAPH

◆ Economy

const string Economy = "economy"

◆ EconomyRespawn

const string EconomyRespawn = "economy_respawn"

◆ EMPTY

const string EMPTY = "empty"

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

Note
In logs: "[autotest:ListEmptyGroups]"

◆ InfectedZone

const string InfectedZone = "infected_zone"

◆ LINKS

const string LINKS = "links"

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

Note
In logs: "[linked_groups]"

◆ LOOT_SIZE

const string LOOT_SIZE = "lootsize"

Lists the maxlootsize of all CE items.

Note
In logs: "[autotest:ListLootSize]"

◆ MapComplete

const string MapComplete = "map_complete"

◆ MapGroup

const string MapGroup = "map_group"

◆ Matrix

const string Matrix = "matrix"

◆ OCCUPIED

class EconomyOutputStrings OCCUPIED = 0

◆ OFF

class EconomyOutputStrings OFF = 0

◆ RespawnQueue

const string RespawnQueue = "respawn_queue"

◆ RF_ALL

const int RF_ALL = 63

◆ RF_BACK

const int RF_BACK = 16

◆ RF_BOTTOM

const int RF_BOTTOM = 32

◆ RF_DECORRECTION

const int RF_DECORRECTION = 256

◆ RF_DEFAULT

◆ RF_FRONT

const int RF_FRONT = 1

◆ RF_FRONTBACK

const int RF_FRONTBACK = 17

◆ RF_IGNORE

◆ RF_LEFT

const int RF_LEFT = 4

◆ RF_LEFTRIGHT

const int RF_LEFTRIGHT = 12

◆ RF_NONE

const int RF_NONE = 0

◆ RF_ORIGINAL

◆ RF_RANDOMROT

const int RF_RANDOMROT = 64

◆ RF_RIGHT

const int RF_RIGHT = 8

◆ RF_TOP

const int RF_TOP = 2

◆ RF_TOPBOTTOM

const int RF_TOPBOTTOM = 34

◆ SAreaflags

const string SAreaflags = "s_areaflags"

◆ SCategory

const string SCategory = "s_category"

◆ SCrafted

const string SCrafted = "s_crafted"

◆ SetupFail

const string SetupFail = "setupfail"

◆ STag

const string STag = "s_tag"

◆ STATUS

const string STATUS = "status"

Lists overall CE stats.

Note
In logs: "[autotest:OverallStatus]"

◆ Storage

const string Storage = "storage"

◆ SUSPICIOUS

const string SUSPICIOUS = "suspicious"

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

Note
In logs: "[autotest:ListSuspiciousGroups]"

◆ Tag

const string Tag = "tag"

◆ UniqueLoot

const string UniqueLoot = "uniqueloot"

◆ VOLUME

class EconomyOutputStrings VOLUME = 0

◆ WORLD

const string WORLD = "world"

Lists the number of objects inside of categories.

Note
In logs: "[autotest:ProcessDebugLog]"