DayZ 1.24
Loading...
Searching...
No Matches
CentralEconomy.c
Go to the documentation of this file.
4// -------------------------------------------------------------------------
5// object (SF) Spawn Flags (use to setup behavior and/ or trigger functionality)
6//
7const int ECE_NONE = 0;
9const int ECE_SETUP = 2; // process full entity setup (when creating NEW entity)
10const int ECE_TRACE = 4; // trace under entity when being placed (from the point of creation)
11const int ECE_CENTER = 8; // use center from shape (model) for placement
13const int ECE_UPDATEPATHGRAPH = 32; // update navmesh when object placed upon it
15const int ECE_ROTATIONFLAGS = 512; // enable rotation flags for object placement
16const int ECE_CREATEPHYSICS = 1024; // create collision envelope and related physics data (if object has them)
17const int ECE_INITAI = 2048; // init ai
18const int ECE_AIRBORNE = 4096; // create flying unit in the air
20const int ECE_EQUIP_ATTACHMENTS = 8192; // equip with configured ATTACHMENTS
21const int ECE_EQUIP_CARGO = 16384; // equip with configured CARGO
22const int ECE_EQUIP = 24576; // equip with configured (ATTACHMENTS + CARGO)
23const int ECE_EQUIP_CONTAINER = 2097152; // populate DE/ group CONTAINER during spawn
24const int ECE_LOCAL = 1073741824; // create object locally
25
26const int ECE_NOSURFACEALIGN = 262144; // do not align object on surface/ terrain
27const int ECE_KEEPHEIGHT = 524288; // keep height when creating object (do not use trace or placement on surface)
28
29const int ECE_NOLIFETIME = 4194304; // do not set lifetime when creating the object
30const int ECE_NOPERSISTENCY_WORLD = 8388608; // do not save this object in world
31const int ECE_NOPERSISTENCY_CHAR = 16777216; // do not save this object in character
32const int ECE_DYNAMIC_PERSISTENCY = 33554432; // spawns in without persistency, once player takes it, persistency will be enabled if available
33
34// note: use predefined combination when not solving something specific
35//
36const int ECE_IN_INVENTORY = 787456; // ECE_CREATEPHYSICS|ECE_KEEPHEIGHT|ECE_NOSURFACEALIGN
37const int ECE_PLACE_ON_SURFACE = 1060; // ECE_CREATEPHYSICS|ECE_UPDATEPATHGRAPH|ECE_TRACE
38const int ECE_OBJECT_SWAP = 787488; // ECE_CREATEPHYSICS|ECE_UPDATEPATHGRAPH|ECE_KEEPHEIGHT|ECE_NOSURFACEALIGN
39
40const int ECE_FULL = 25126; // ECE_SETUP|ECE_TRACE|ECE_ROTATIONFLAGS|ECE_UPDATEPATHGRAPH|ECE_EQUIP
41
42// -------------------------------------------------------------------------
43// object (RF) Rotation Flags (use to force and/ or invoke placement rotation)
44//
45const int RF_NONE = 0;
46
47const int RF_FRONT = 1; // front side placement
48const int RF_TOP = 2; // top side placement
49const int RF_LEFT = 4; // left side placement
50const int RF_RIGHT = 8; // right side placement
51const int RF_BACK = 16; // back side placement
52const int RF_BOTTOM = 32; // bottom side placement
53
54const int RF_ALL = 63; // RF_FRONT|RF_TOP|RF_LEFT|RF_RIGHT|RF_BACK|RF_BOTTOM
55
56const int RF_IGNORE = 64; // ignore placement RF flags - object will spawn as model was created
57
58const int RF_TOPBOTTOM = 34; // RF_TOP|RF_BOTTOM
59const int RF_LEFTRIGHT = 12; // RF_LEFT|RF_RIGHT
60const int RF_FRONTBACK = 17; // RF_FRONT|RF_BACK
61
62const int RF_RANDOMROT = 64; // allow random rotation around axis when placing
63const int RF_ORIGINAL = 128; // use default placement setuped on object in config
64const int RF_DECORRECTION = 256; // angle correction when spawning InventoryItem at Building angle
65const int RF_DEFAULT = 512; // use default placement setuped on object in config
66
67// -------------------------------------------------------------------------
70{
71 private void EconomyLogCategories();
72 private void ~EconomyLogCategories();
73
74 const string Economy = "economy";
75 const string EconomyRespawn = "economy_respawn";
76 const string RespawnQueue = "respawn_queue";
77 const string Container = "container";
78 const string Matrix = "matrix";
79 const string UniqueLoot = "uniqueloot";
80 const string Bind = "bind";
81 const string SetupFail = "setupfail";
82 const string Storage = "storage";
83 const string Classes = "class";
84 const string Category = "category";
85 const string Tag = "tag";
86 const string SCategory = "s_category";
87 const string STag = "s_tag";
88 const string SAreaflags = "s_areaflags";
89 const string SCrafted = "s_crafted";
90 const string MapGroup = "map_group";
91 const string MapComplete = "map_complete";
92 const string InfectedZone = "infected_zone";
93}
94
95// -------------------------------------------------------------------------
98{
99 private void EconomyMapStrings();
100 private void ~EconomyMapStrings();
101
112 static string Category(string category)
113 {
114 return string.Format("category:%1", category);
115 }
116
127 static string Tag(string tag)
128 {
129 return string.Format("tag:%1", tag);
130 }
131
132
134 const string ALL_ALL = "all:all";
136 const string ALL_LOOT = "all:loot";
138 const string ALL_VEHICLE = "all:vehicle";
140 const string ALL_INFECTED = "all:infected";
142 const string ALL_ANIMAL = "all:animal";
144 const string ALL_PLAYER = "all:player";
146 const string ALL_PROXY = "all:proxy";
148 const string ALL_PROXY_STATIC = "all:proxystatic";
150 const string ALL_PROXY_DYNAMIC = "all:proxydynamic";
152 const string ALL_PROXY_ABANDONED = "all:proxyabandoned";
153}
154
155// -------------------------------------------------------------------------
158{
159 private void EconomyOutputStrings();
160 private void ~EconomyOutputStrings();
161
166 const string LINKS = "links";
171 const string SUSPICIOUS = "suspicious";
176 const string DE_CLOSE_POINT = "declosepoint";
181 const string ABANDONED = "abandoned";
186 const string EMPTY = "empty";
192 const string CLOSE = "close";
197 const string WORLD = "world";
202 const string STATUS = "status";
207 const string LOOT_SIZE = "lootsize";
208}
209
210// -------------------------------------------------------------------------
212{
213 OFF = 0,
217}
218
219// -------------------------------------------------------------------------
225class CEApi
226{
227 private void CEApi() {}
228 private void ~CEApi() {}
296
309
331
362 proto native void SpawnDE(string sEvName, vector vPos, float fAngle = -1);
392 proto native void SpawnLoot(string sEvName, vector vPos, float fAngle, int iCount = 1, float fRange = 1);
393
440
494
503
513
536
569
570
575
597
599
600
605
615 proto native bool AvoidPlayer(vector vPos, float fDistance); // return false when there is a player
637
639
640
645
646 // "Loot Spawn Edit"
647 //{
664 //}
665
666 // "Loot Tool"
667 //{
674 //}
675
676 // "Infected"
677 //{
686 //}
687
688 // "Animal"
689 //{
696 //}
697
704
713
716
718
719
724
726
728
729 proto native void OnUpdate();
730
732};
733
741
742// -------------------------------------------------------------------------
744{
745 private void CEItemProfile() {}
746 private void ~CEItemProfile() {}
747
748 proto native int GetNominal(); // nominal - how many items should be aproximately in map
749 proto native int GetMin(); // min - minimal count should be available in map
750
751 proto native float GetQuantityMin(); // min quantity (0.0 - 1.0) (like ammobox - this determine how many bullets are there, or water bottle)
752 proto native float GetQuantityMax(); // max quantity (0.0 - 1.0) (like ammobox - this determine how many bullets are there, or water bottle)
753
754 proto native float GetQuantity(); // random quantity (0.0 - 1.0)
755
756 proto native float GetLifetime(); // maximum lifetime in (seconds) - what is the idle before item abandoned at ground gets deleted
757 proto native float GetRestock(); // restock is oposite of lifetime - idle before item is allowed to respawn when required
758
759 proto native int GetCost(); // cost of item determines its 'value' for players (this serve as priority during respawn and cleanup operation)
760
761 proto native int GetUsageFlags(); // area usage flags (each bit has assigned group - which as part of map overlay effectively affects spawning)
762 proto native int GetValueFlags(); // area value flags (each bit has assigned group - which as part of map overlay effectively affects spawning)
763};
const string ALL_VEHICLE
All vehicles.
class CEItemProfile CEApi
API to interact with Central Economy.
const int ECE_NONE
proto native bool AvoidPlayer(vector vPos, float fDistance)
Check if there is a player within a radius.
const int ECE_EQUIP_CARGO
proto native void LootSetSpawnVolumeVisualisation(ESpawnVolumeVis mode)
"Spawn Volume Vis"
proto native void ToggleOverallStats(bool mode)
"Overall Stats"
proto native void LootExportClusters()
"<<< Export Clusters" / GetCEApi().ExportClusterData()
proto native void AnimalAmbientSpawn()
"Ambient Spawn"
proto native void LootSetDamageToOne()
"Set Damage = 1.0"
const string ALL_PROXY_ABANDONED
All abandoned loot spawns.
proto native void EconomyLog(string sLogType)
Outputs debug file to storage/log/*.csv.
proto native CEApi GetCEApi()
Get the CE API.
const int ECE_AIRBORNE
const int RF_NONE
const int ECE_EQUIP
proto native void EconomyMap(string sMapType)
Outputs debug file to storage/lmap/*.tga showing the current places this is spawned.
const int ECE_OBJECT_SWAP
proto native void ToggleDynamicEventStatus(bool mode)
"Dynamic Events Status"
const int ECE_EQUIP_ATTACHMENTS
proto native void RadiusLifetimeIncrease(vector vCenter, float fRadius, float fValue)
Process lifetime increase within radius by value (sec)
proto native void RadiusLifetimeReset(vector vCenter, float fRadius)
Process lifetime reset to default value from DB within radius.
proto native void LootToggleSpawnSetup(bool mode)
"Setup Vis"
const string ALL_INFECTED
All infected.
const string ALL_PROXY_DYNAMIC
All dynamic loot spawns.
const string ALL_ANIMAL
All animals.
proto native void SpawnVehicles(vector vPos, bool bShowCylinders=false, float fDefaultDistance=20)
Spawn all entities with vehicles category through CE.
const int ECE_NOSURFACEALIGN
proto native bool SpawnAnalyze(string sClassName)
Will emulate the spawning of the item which is being looked at and generate images (....
const int ECE_LOCAL
const int ECE_ROTATIONFLAGS
const int RF_ORIGINAL
const int ECE_PLACE_ON_SURFACE
proto native void SpawnBuilding(vector vPos, bool bShowCylinders=false, float fDefaultDistance=20)
Spawn all entities with building category through CE.
const int RF_FRONTBACK
proto native void AnimalToggleVisualisation(bool mode)
"Animal Vis"
const int ECE_EQUIP_CONTAINER
proto native void AnimalSpawn()
"Animal Spawn"
proto native void SpawnRotation(string sClassName, vector vPos, float fRange, int iCount, int iFlags)
Spawn an entity through CE.
proto native void LootDepleteLifetime()
"Deplete Lifetime"
proto native void ExportClusterData()
Generates "storage/export/mapgroupcluster.xml".
const int ECE_NOPERSISTENCY_WORLD
class EconomyOutputStrings OCCUPIED
proto native void LootToggleProxyEditing(bool mode)
const int RF_FRONT
const int ECE_SETUP
proto native void SpawnPerfTest(string sClassName, int iCount)
Spawn an entity through CE, x amount of times in a grid.
proto native int GetCEGlobalInt(string varName)
Get int from globals.xml.
proto native void SpawnLoot(string sEvName, vector vPos, float fAngle, int iCount=1, float fRange=1)
Spawn an item through CE.
const int ECE_UPDATEPATHGRAPH
const int RF_TOP
proto native void InfectedResetCleanup()
"Reset Cleanup"
const int ECE_INITAI
proto native void LootToggleVolumeEditing(bool mode)
"Edit Volume"
proto native void InfectedSpawn()
"Infected Spawn"
proto native void LootRetraceGroupPoints()
"Re-Trace Group Points"
proto native void ToggleDynamicEventVisualisation(bool mode)
"Dynamic Events Vis"
proto native void LootExportAllGroups()
"Export All Groups >>>>" / GetCEApi.ExportProxyProto();
class EconomyOutputStrings OFF
const string ALL_PROXY_STATIC
All static loot spawns.
proto native void LootExportGroup()
"Export Group >>"
const int ECE_KEEPHEIGHT
const string ALL_PROXY
All proxies.
proto native void DynamicEventSpawn()
"Dynamic Events Spawn"
proto native int CountPlayersWithinRange(vector vPos, float fRange)
Check if there is a vehicle within a radius.
proto native void InfectedToggleZoneInfo(bool mode)
"Infected Zone Info"
proto native Object SpawnSingleEntity(string sClassName, vector vPos)
Spawn an entity through CE.
const int RF_LEFTRIGHT
const int RF_IGNORE
const string Category
proto native void LootDepleteAndDamage()
"Damage + Deplete"
const string ALL_LOOT
All loot.
const int RF_RANDOMROT
proto native void ToggleClusterVisualisation(bool mode)
"Cluster Vis"
proto native void SpawnDynamic(vector vPos, bool bShowCylinders=true, float fDefaultDistance=0)
Spawn all entities with dynamic category through CE.
proto native void MarkCloseProxy(float fRadius, bool bAllSelections)
Invalidates loot spawn points which are closer than the radius supplied.
const int RF_DECORRECTION
proto native void TimeShift(float fShift)
Subtracts the supplied value from the current lifetime of all items in the world.
proto native void CleanMap()
Queue up the depleting of lifetime of everything in the world.
proto native string GetCEGlobalString(string varName)
Get string from globals.xml.
proto native void ExportSpawnData()
Regenerates "storage/spawnpoints.bin" if necessary.
const int ECE_CENTER
proto native void ExportProxyData(vector vCenter=vector.Zero, float fRadius=0)
Generates "storage/export/mapgrouppos.xml".
const int RF_LEFT
const int RF_RIGHT
const int RF_TOPBOTTOM
const int ECE_DYNAMIC_PERSISTENCY
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
proto native void LootExportMap()
"<<< Export Map" / GetCEApi.ExportProxyData(vector.Zero, 0);
const string ALL_ALL
Everything.
class EconomyOutputStrings ADAPTIVE
const int ECE_NOLIFETIME
proto native void SpawnDE(string sEvName, vector vPos, float fAngle=-1)
Force spawn specific dynamic event.
const int ECE_TRACE
proto native void InfectedToggleVisualisation(bool mode)
"Infected Vis"
proto native float GetCEGlobalFloat(string varName)
Get float from globals.xml.
proto native void PlatformStatTest()
const int ECE_IN_INVENTORY
proto native void ToggleLootVisualisation(bool mode)
"Loot Vis"
proto native void SpawnDEEx(string sEvName, vector vPos, float fAngle, int uFlags)
Force spawn specific dynamic event.
proto native void RadiusLifetimeDecrease(vector vCenter, float fRadius, float fValue)
Process lifetime decrease within radius by value (sec)
proto native void EconomyOutput(string sOutputType, float fRange)
Outputs debug logs into server log or rpt.
proto native void ExportProxyProto()
Generates "storage/export/mapgroupproto.xml".
const string Tag
const int ECE_FULL
proto native Entity SpawnGroup(string sGroupName, vector vPos, float fAngle=-1)
Force spawn specific prototype group + loot at position.
const string ALL_PLAYER
All players.
const int RF_DEFAULT
const int RF_ALL
void ~EconomyMapStrings()
proto native void OverrideLifeTime(float fLifeTime)
Fills in the Debug Lifetime, which will be used for any new DE spawned.
class EconomyOutputStrings VOLUME
const int ECE_NOPERSISTENCY_CHAR
void ~CEApi()
const int RF_BACK
const int ECE_CREATEPHYSICS
proto native void ListCloseProxy(float fRadius)
Outputs a list of all loot points closer than specified radius.
const int RF_BOTTOM
proto native bool AvoidVehicle(vector vPos, float fDistance, string sDEName="")
Check if there is a vehicle within a radius.
proto native void ToggleVehicleAndWreckVisualisation(bool mode)
"Vehicle&Wreck Vis"
proto native void DynamicEventExport()
"Export Dyn Event >>"
class EconomyLogCategories EconomyMapStrings()
Special strings for CEApi.EconomyMap.
proto native void RemoveCloseProxy()
Removes all invalid points.
proto native float GetQuantityMin()
proto native float GetQuantityMax()
proto native int GetValueFlags()
proto native int GetNominal()
proto native float GetRestock()
proto native float GetQuantity()
proto native int GetMin()
proto native float GetLifetime()
proto native int GetCost()
proto native int GetUsageFlags()
Categories for CEApi.EconomyLog.
const string UniqueLoot
const string SAreaflags
const string EconomyRespawn
const string MapComplete
const string InfectedZone
const string RespawnQueue
Special strings for CEApi.EconomyOutput.
const string ABANDONED
Lists loot spawns that have been marked as abandoned.
const string LINKS
Lists stats regarding which loot spawn) that are linked together and how many there are.
const string LOOT_SIZE
Lists the maxlootsize of all CE items.
const string WORLD
Lists the number of objects inside of categories.
const string CLOSE
Lists loot spawns that are not abandoned and within the supplied range (< fRange, not equal)
const string STATUS
Lists overall CE stats.
const string SUSPICIOUS
Lists loot spawns that have more loot than their maximum + 4.
const string DE_CLOSE_POINT
Lists DE spawns that have positions that are within supplied range (< fRange, not equal)
const string EMPTY
Lists loot spawns that are not abandoned but have no loot.
Definition Camera.c:2
static const vector Zero
Definition EnConvert.c:110
proto native void OnUpdate()
Definition tools.c:333