BohemiaInteractive / DayZ-Central-Economy

DayZ Central Economy configuration
https://dayz.com/
289 stars 398 forks source link

How Grenade_ChemGas spawn? #12

Open ApacheAA opened 2 years ago

ApacheAA commented 2 years ago

Hi! Grenade_ChemGas is expected to spawn by the event StaticContaminatedArea. But according to events.xml StaticContaminatedArea spawns only type ContaminatedArea_Dynamic. At the same time Grenade_ChemGas is mentioned only in types.xml with spawn count 0.

  1. How to change Grenade_ChemGas count in dynamic contaminated area?
  2. How Grenade_ChemGas and ContaminatedArea_Dynamic are related?
openface commented 2 years ago

I've looked into this as well. I was able to make sense of it by reading game data source file scripts\4_World\Classes\ContaminatedArea\ContaminatedArea_Dynamic.c.

It defines a SpawnItems() function that spawns a few of these gas grenades.

// Item Spawning upon area creation, the 4 arrays bellow have to have the same amount of elements
const ref array<string>     SPAWN_ITEM_TYPE         = {"Grenade_ChemGas"};//item classnames
const ref array<int>        SPAWN_ITEM_COUNT        = {Math.RandomIntInclusive(2,5)};//how many of each type
const ref array<float>      SPAWN_ITEM_RAD_MIN      = {5};//min distance the item will be spawned from the area position(epicenter)
const ref array<float>      SPAWN_ITEM_RAD_MAX      = {15};//max distance the item will be spawned from the area position(epicenter)

So, it seems intentional and not configurable without a mod override.