Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
centraleconomy.c File Reference

Go to the source code of this file.

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

Get values from globals.xml

proto native int GetCEGlobalInt (string varName)
 Get int from globals.xml. More...
 
proto native float GetCEGlobalFloat (string varName)
 Get float from globals.xml. More...
 
proto native string GetCEGlobalString (string varName)
 Get string from globals.xml. More...
 
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. More...
 
proto native bool AvoidVehicle (vector vPos, float fDistance, string sDEName="")
 Check if there is a vehicle within a radius. More...
 
proto native int CountPlayersWithinRange (vector vPos, float fRange)
 Check if there is a vehicle within a radius. More...
 
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" More...
 
proto native void LootToggleSpawnSetup (bool mode)
 "Setup Vis" More...
 
proto native void LootToggleVolumeEditing (bool mode)
 "Edit Volume" More...
 
proto native void LootRetraceGroupPoints ()
 "Re-Trace Group Points" More...
 
proto native void LootExportGroup ()
 "Export Group >>" More...
 
proto native void LootExportAllGroups ()
 "Export All Groups >>>>" / GetCEApi.ExportProxyProto(); More...
 
proto native void LootExportMap ()
 "<<< Export Map" / GetCEApi.ExportProxyData(vector.Zero, 0); More...
 
proto native void LootExportClusters ()
 "<<< Export Clusters" / GetCEApi().ExportClusterData() More...
 
proto native void LootDepleteLifetime ()
 "Deplete Lifetime" More...
 
proto native void LootSetDamageToOne ()
 "Set Damage = 1.0" More...
 
proto native void LootDepleteAndDamage ()
 "Damage + Deplete" More...
 
proto native void InfectedToggleVisualisation (bool mode)
 "Infected Vis" More...
 
proto native void InfectedToggleZoneInfo (bool mode)
 "Infected Zone Info" More...
 
proto native void InfectedSpawn ()
 "Infected Spawn" More...
 
proto native void InfectedResetCleanup ()
 "Reset Cleanup" More...
 
proto native void AnimalToggleVisualisation (bool mode)
 "Animal Vis" More...
 
proto native void AnimalSpawn ()
 "Animal Spawn" More...
 
proto native void AnimalAmbientSpawn ()
 "Ambient Spawn" More...
 
proto native void ToggleVehicleAndWreckVisualisation (bool mode)
 "Vehicle&Wreck Vis" More...
 
proto native void ToggleLootVisualisation (bool mode)
 "Loot Vis" More...
 
proto native void ToggleClusterVisualisation (bool mode)
 "Cluster Vis" More...
 
proto native void ToggleDynamicEventStatus (bool mode)
 "Dynamic Events Status" More...
 
proto native void ToggleDynamicEventVisualisation (bool mode)
 "Dynamic Events Vis" More...
 
proto native void DynamicEventSpawn ()
 "Dynamic Events Spawn" More...
 
proto native void DynamicEventExport ()
 "Export Dyn Event >>" More...
 
proto native void ToggleOverallStats (bool mode)
 "Overall Stats" More...
 

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. More...
 
const string ALL_LOOT = "all:loot"
 All loot. More...
 
const string ALL_VEHICLE = "all:vehicle"
 All vehicles. More...
 
const string ALL_INFECTED = "all:infected"
 All infected. More...
 
const string ALL_ANIMAL = "all:animal"
 All animals. More...
 
const string ALL_PLAYER = "all:player"
 All players. More...
 
const string ALL_PROXY = "all:proxy"
 All proxies. More...
 
const string ALL_PROXY_STATIC = "all:proxystatic"
 All static loot spawns. More...
 
const string ALL_PROXY_DYNAMIC = "all:proxydynamic"
 All dynamic loot spawns. More...
 
const string ALL_PROXY_ABANDONED = "all:proxyabandoned"
 All abandoned loot spawns. More...
 
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. More...
 
const string SUSPICIOUS = "suspicious"
 Lists loot spawns that have more loot than their maximum + 4. More...
 
const string DE_CLOSE_POINT = "declosepoint"
 Lists DE spawns that have positions that are within supplied range (< fRange, not equal) More...
 
const string ABANDONED = "abandoned"
 Lists loot spawns that have been marked as abandoned. More...
 
const string EMPTY = "empty"
 Lists loot spawns that are not abandoned but have no loot. More...
 
const string CLOSE = "close"
 Lists loot spawns that are not abandoned and within the supplied range (< fRange, not equal) More...
 
const string WORLD = "world"
 Lists the number of objects inside of categories. More...
 
const string STATUS = "status"
 Lists overall CE stats. More...
 
const string LOOT_SIZE = "lootsize"
 Lists the maxlootsize of all CE items. More...
 

DEPRECATED/LEGACY

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

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

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

◆ 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");

◆ 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)
GetCEApi().EconomyLog(EconomyLogCategories.Economy);

◆ EconomyLogCategories()

private void EconomyMapStrings::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);

◆ EconomyOutputStrings()

private void CEApi::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

◆ 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);

◆ 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);

◆ 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);

◆ 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));

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

Definition at line 229 of file centraleconomy.c.

◆ ~EconomyLogCategories()

private void EconomyMapStrings::~EconomyLogCategories ( )

◆ ~EconomyMapStrings()

private void ~EconomyMapStrings ( )

◆ ~EconomyOutputStrings()

private void CEApi::~EconomyOutputStrings ( )

Variable Documentation

◆ ABANDONED

const string ABANDONED = "abandoned"

Lists loot spawns that have been marked as abandoned.

Note
In logs: "[autotest:ListAbandonedGroups]"

Definition at line 176 of file centraleconomy.c.

◆ ADAPTIVE

class EconomyOutputStrings ADAPTIVE = 0

◆ ALL_ALL

const string ALL_ALL = "all:all"

Everything.

Definition at line 135 of file centraleconomy.c.

◆ ALL_ANIMAL

const string ALL_ANIMAL = "all:animal"

All animals.

Definition at line 143 of file centraleconomy.c.

◆ ALL_INFECTED

const string ALL_INFECTED = "all:infected"

All infected.

Definition at line 141 of file centraleconomy.c.

◆ ALL_LOOT

const string ALL_LOOT = "all:loot"

All loot.

Definition at line 137 of file centraleconomy.c.

◆ ALL_PLAYER

const string ALL_PLAYER = "all:player"

All players.

Definition at line 145 of file centraleconomy.c.

◆ ALL_PROXY

const string ALL_PROXY = "all:proxy"

All proxies.

Definition at line 147 of file centraleconomy.c.

◆ ALL_PROXY_ABANDONED

const string ALL_PROXY_ABANDONED = "all:proxyabandoned"

All abandoned loot spawns.

Definition at line 153 of file centraleconomy.c.

◆ ALL_PROXY_DYNAMIC

const string ALL_PROXY_DYNAMIC = "all:proxydynamic"

All dynamic loot spawns.

Definition at line 151 of file centraleconomy.c.

◆ ALL_PROXY_STATIC

const string ALL_PROXY_STATIC = "all:proxystatic"

All static loot spawns.

Definition at line 149 of file centraleconomy.c.

◆ ALL_VEHICLE

const string ALL_VEHICLE = "all:vehicle"

All vehicles.

Definition at line 139 of file centraleconomy.c.

◆ Bind

const string Bind = "bind"

Definition at line 75 of file centraleconomy.c.

◆ Category

const string Category = "category"

Definition at line 79 of file centraleconomy.c.

◆ 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

Definition at line 228 of file centraleconomy.c.

◆ Classes

const string Classes = "class"

Definition at line 78 of file centraleconomy.c.

◆ 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

Definition at line 187 of file centraleconomy.c.

◆ Container

const string Container = "container"

Definition at line 72 of file centraleconomy.c.

◆ 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]"

Definition at line 171 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

const int ECE_CREATEPHYSICS = 1024

Definition at line 16 of file centraleconomy.c.

◆ ECE_DYNAMIC_PERSISTENCY

const int ECE_DYNAMIC_PERSISTENCY = 33554432

Definition at line 32 of file centraleconomy.c.

◆ 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.

◆ 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

const int ECE_IN_INVENTORY = 787456

Definition at line 36 of file centraleconomy.c.

◆ ECE_INITAI

const int ECE_INITAI = 2048

Definition at line 17 of file centraleconomy.c.

◆ ECE_KEEPHEIGHT

const int ECE_KEEPHEIGHT = 524288

Definition at line 27 of file centraleconomy.c.

◆ ECE_LOCAL

const int ECE_LOCAL = 1073741824

Definition at line 24 of file centraleconomy.c.

◆ ECE_NOLIFETIME

const int ECE_NOLIFETIME = 4194304

Definition at line 29 of file centraleconomy.c.

◆ ECE_NONE

const int ECE_NONE = 0

Definition at line 7 of file centraleconomy.c.

◆ 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

const int ECE_OBJECT_SWAP = 787488

Definition at line 38 of file centraleconomy.c.

◆ ECE_PLACE_ON_SURFACE

const int ECE_PLACE_ON_SURFACE = 1060

Definition at line 37 of file centraleconomy.c.

◆ ECE_ROTATIONFLAGS

const int ECE_ROTATIONFLAGS = 512

Definition at line 15 of file centraleconomy.c.

◆ ECE_SETUP

const int ECE_SETUP = 2

Definition at line 9 of file centraleconomy.c.

◆ ECE_TRACE

const int ECE_TRACE = 4

Definition at line 10 of file centraleconomy.c.

◆ ECE_UPDATEPATHGRAPH

const int ECE_UPDATEPATHGRAPH = 32

Definition at line 13 of file centraleconomy.c.

◆ Economy

const string Economy = "economy"

Definition at line 69 of file centraleconomy.c.

◆ EconomyRespawn

const string EconomyRespawn = "economy_respawn"

Definition at line 70 of file centraleconomy.c.

◆ EMPTY

const string EMPTY = "empty"

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

Note
In logs: "[autotest:ListEmptyGroups]"

Definition at line 181 of file centraleconomy.c.

◆ InfectedZone

const string InfectedZone = "infected_zone"

Definition at line 87 of file centraleconomy.c.

◆ 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]"

Definition at line 161 of file centraleconomy.c.

◆ LOOT_SIZE

const string LOOT_SIZE = "lootsize"

Lists the maxlootsize of all CE items.

Note
In logs: "[autotest:ListLootSize]"

Definition at line 202 of file centraleconomy.c.

◆ MapComplete

const string MapComplete = "map_complete"

Definition at line 86 of file centraleconomy.c.

◆ MapGroup

const string MapGroup = "map_group"

Definition at line 85 of file centraleconomy.c.

◆ Matrix

const string Matrix = "matrix"

Definition at line 73 of file centraleconomy.c.

◆ OCCUPIED

class EconomyOutputStrings OCCUPIED = 0

◆ OFF

class EconomyOutputStrings OFF = 0

◆ RespawnQueue

const string RespawnQueue = "respawn_queue"

Definition at line 71 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

const int RF_DEFAULT = 512

Definition at line 65 of file centraleconomy.c.

◆ 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.

◆ 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.

◆ RF_ORIGINAL

const int RF_ORIGINAL = 128

Definition at line 63 of file centraleconomy.c.

◆ 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"

Definition at line 83 of file centraleconomy.c.

◆ SCategory

const string SCategory = "s_category"

Definition at line 81 of file centraleconomy.c.

◆ SCrafted

const string SCrafted = "s_crafted"

Definition at line 84 of file centraleconomy.c.

◆ SetupFail

const string SetupFail = "setupfail"

Definition at line 76 of file centraleconomy.c.

◆ STag

const string STag = "s_tag"

Definition at line 82 of file centraleconomy.c.

◆ STATUS

const string STATUS = "status"

Lists overall CE stats.

Note
In logs: "[autotest:OverallStatus]"

Definition at line 197 of file centraleconomy.c.

◆ Storage

const string Storage = "storage"

Definition at line 77 of file centraleconomy.c.

◆ SUSPICIOUS

const string SUSPICIOUS = "suspicious"

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

Note
In logs: "[autotest:ListSuspiciousGroups]"

Definition at line 166 of file centraleconomy.c.

◆ Tag

const string Tag = "tag"

Definition at line 80 of file centraleconomy.c.

◆ UniqueLoot

const string UniqueLoot = "uniqueloot"

Definition at line 74 of file centraleconomy.c.

◆ VOLUME

class EconomyOutputStrings VOLUME = 0

◆ WORLD

const string WORLD = "world"

Lists the number of objects inside of categories.

Note
In logs: "[autotest:ProcessDebugLog]"

Definition at line 192 of file centraleconomy.c.

EconomyLogCategories
Categories for CEApi.EconomyLog.
Definition: centraleconomy.c:69
EconomyOutputStrings
Special strings for CEApi.EconomyOutput.
Definition: centraleconomy.c:158
RF_ALL
const int RF_ALL
Definition: centraleconomy.c:54
ECE_FULL
const int ECE_FULL
Definition: centraleconomy.c:40
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
GetCEApi
proto native CEApi GetCEApi()
Get the CE API.