diff --git a/USER/civSettings.hpp b/USER/civSettings.hpp index 9eb8c51..704802d 100644 --- a/USER/civSettings.hpp +++ b/USER/civSettings.hpp @@ -3,23 +3,22 @@ * In der Klasse "userEquipment" können eigene Ausrüstungsgegenstände für die Zivilisten definiert werden. */ +enableCivs = 0; -enableOnFoot = 0; // Zivilisten, die durch die Gegend laufen, einschalten (0/1) -enableInVehicles = 0; // Fahrzeugfahrende Zivilisten einschalten (0/1) - -maxCivs = 60; // maximale Anzahl an Zivilisten -spawnDistances[] = {1000,4500}; // Mindest- und Maximalabstand zu allen Spielern, in denen Zivilisten spawnen backpackProbability = 0.15; // Wahrscheinlichkeit, dass Zivilisten mit Backpacks spawnen (0-1) exitOn = ""; // Skriptbedingung, ab der keine weiteren Zivilisten mehr spawnen onSpawn = ""; // Code, der ausgeführt wird, wenn ein Zivilist spawnt onHeldUp = ""; // Code, der ausgeführt wird, wenn ein Zivilist angehalten wird (Spieler zeigt mit Waffe auf Zivilist) +maxCivsOnFoot = 10; // Maximale Anzahl an Zivilisten die zu Fuß durch die Gegend latschen +maxCivsInVehicles = 5; // Maximale Anzahl an Zivilisten die mit Auto fahren. Achtung: inkludiert Beifahrer und Passagiere +maxCivsResidents = 20; // Maximale Anzahl an Zivilisten mit festem Wohnsitz +spawnDistancesOnFoot[] = {1000,4500}; +spawnDistancesInVehicles[] = {1800,5000}; +spawnDistancesResidents[] = {750, 1500}; // Mindest- und Maximalabstand zu allen Spielern, in denen Zivilisten spawnen -maxCivsOnFoot = 40; // maximale Anzahl an Zivilisten zu Fuß -maxCivsInVehicles = 15; // maximale Anzahl an Zivilisten in Fahrzeugen -spawnDistancesOnFoot[] = {1000,4500}; // Mindest- und Maximalabstand zu allen Spielern, in denen Zivilisten zu Fuß spawnen -spawnDistancesInVehicles[] = {1800,6000}; // Mindest- und Maximalabstand zu allen Spielern, in denen Zivilisten in Fahrzeugen spawnen - +initialGroupSize = 3; // Gruppengröße für Zivilisten zwischen 1..N +automaticVehicleGroupSize = 1; // Autos werden zufällig mit Passagieren bedacht class userEquipment { // Soll die hier definierte Ausrüstung die vordefinierte, inselabhängige Ausrüstung ersetzen oder zu dieser hinzugefügt werden? (0: hinzufügen, 1: ersetzen) diff --git a/description.ext b/description.ext index 2c2a51c..2d6fe40 100644 --- a/description.ext +++ b/description.ext @@ -66,7 +66,8 @@ class CfgGradCivs { #include "USER\civSettings.hpp" autoInit = 1; - debugMode = 0; + debugCivState = 0; + debugFps = 0; }; class GRAD_Replay { diff --git a/node_modules/grad-civs/README.md b/node_modules/grad-civs/README.md index b460ff6..a69e493 100644 --- a/node_modules/grad-civs/README.md +++ b/node_modules/grad-civs/README.md @@ -49,7 +49,7 @@ Add the class `cfgGradCivs` to your `description.ext`. Use the following attribu Attribute | Default Value | Explanation -------------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------ autoInit | 1 | Toggles on automatic initialization of module on missions start (0/1). Turn this off if you want to use functions to set civs properties first. -automaticVehicleGroupSize| 1 | Allow vehicles to be filled according to capacity, ignoring *initialGroupSize* (0,1). +automaticVehicleGroupSize| 1 | Allow vehicles to be filled according to capacity, ignoring *initialGroupSize* (0/1). enableOnFoot | 1 | Enable civilians on foot (0/1). enableInVehicles | 1 | Enable civilians in vehicles (0/1). maxCivsOnFoot | 30 | Maximum number of civs on foot. @@ -60,7 +60,7 @@ spawnDistancesResidents | [500, 1000] | Minimum and maximum distance to playe spawnDistancesOnFoot | [1000,4500] | Minimum and maximum distance to players that civilians on foot can spawn in. debugCivState | 0 | Toggles civ behavior debugging mode (0/1). debugFps | 0 | Toggles fps monitoring mode (0/1). -initialGroupSize | [1, 2, 3] | Initial group size for civilians. +initialGroupSize | 3 | Initial group size for civilians. minCivUpdateTime | 2 | Spawn new civilians only if their beheviour states get updated at least every N seconds. NOTE: each frame only one civ gets updated. Example: With 40fps and minCivUpdateTime=2, not more than 80 civs will be alive at any given time. This setting is meant to prevent civs from becoming too unresponsive. minFps | 40 | Spawn new civilians only if fps are at or above N . NOTE: the fps are taken from the machine that spawns the civs, which may be a HC. onSpawn | "" | Code to execute on civilian spawn. Passed parameters are: [civilian,vehicle (objNull if on foot)]. diff --git a/node_modules/grad-civs/functions/init/fn_initConfig.sqf b/node_modules/grad-civs/functions/init/fn_initConfig.sqf index 2c2f4ec..a6b8245 100644 --- a/node_modules/grad-civs/functions/init/fn_initConfig.sqf +++ b/node_modules/grad-civs/functions/init/fn_initConfig.sqf @@ -40,7 +40,9 @@ missionNamespace setVariable ["GRAD_CIVS_ONSPAWN",compile ([missionConfigFile >> missionNamespace setVariable ["GRAD_CIVS_ONHELDUP",compile ([missionConfigFile >> "cfgGradCivs","onHeldUp",""] call BIS_fnc_returnConfigEntry)]; missionNamespace setVariable ["GRAD_CIVS_ONKILLED",compile ([missionConfigFile >> "cfgGradCivs","onKilled",""] call BIS_fnc_returnConfigEntry)]; -missionNamespace setVariable ["GRAD_CIVS_INITIALGROUPSIZE", ([missionConfigFile >> "cfgGradCivs","initialGroupSize", [1, 1, 2]] call BIS_fnc_returnConfigEntry)]; +_initialGroupSize = [missionConfigFile >> "cfgGradCivs","initialGroupSize", 3] call BIS_fnc_returnConfigEntry; +if (typeName _initialGroupSize == "NUMBER") then { _initialGroupSize = _initialGroupSize + 1 }; +missionNamespace setVariable ["GRAD_CIVS_INITIALGROUPSIZE", _initialGroupSize]; missionNamespace setVariable ["GRAD_CIVS_AUTOMATICVEHICLEGROUPSIZE", ([missionConfigFile >> "cfgGradCivs","automaticVehicleGroupSize", 1] call BIS_fnc_returnConfigEntry) == 1]; missionNamespace setVariable ["GRAD_CIVS_PANICCOOLDOWN", ([missionConfigFile >> "cfgGradCivs", "panicCooldown", [15, 120, 240]] call BIS_fnc_returnConfigEntry)]; diff --git a/node_modules/grad-civs/functions/spawn/fn_addCarCrew.sqf b/node_modules/grad-civs/functions/spawn/fn_addCarCrew.sqf index 319b4dc..5559c13 100644 --- a/node_modules/grad-civs/functions/spawn/fn_addCarCrew.sqf +++ b/node_modules/grad-civs/functions/spawn/fn_addCarCrew.sqf @@ -16,11 +16,12 @@ LOGTIME_END("findSpawnPos_vehicle"); if (_pos isEqualTo [0,0,0]) exitWith {}; private _vehicleClass = selectRandom GRAD_CIVS_VEHICLES; -private _groupSize = random GRAD_CIVS_INITIALGROUPSIZE; +private _randomArg = GRAD_CIVS_INITIALGROUPSIZE; if (GRAD_CIVS_AUTOMATICVEHICLEGROUPSIZE) then { _maxCount = [_vehicleClass, true] call BIS_fnc_crewCount; - _groupSize = (floor random _maxCount) + 1; + _randomArg = _maxCount + 1; }; +private _groupSize = floor random _randomArg; LOGTIME_START("spawnCiv_vehicle"); _veh = [_pos, _vehicleClass] call grad_civs_fnc_spawnVehicle; diff --git a/node_modules/grad-civs/functions/spawn/fn_addFootsy.sqf b/node_modules/grad-civs/functions/spawn/fn_addFootsy.sqf index a256408..8756abc 100644 --- a/node_modules/grad-civs/functions/spawn/fn_addFootsy.sqf +++ b/node_modules/grad-civs/functions/spawn/fn_addFootsy.sqf @@ -15,7 +15,7 @@ LOGTIME_END("findSpawnPos_onFoot"); if (_pos isEqualTo [0,0,0]) exitWith {}; -private _groupSize = random GRAD_CIVS_INITIALGROUPSIZE; +private _groupSize = floor random GRAD_CIVS_INITIALGROUPSIZE; LOGTIME_START("spawnCiv_onFoot"); _group = [_pos, _groupSize, objNull, "patrol"] call grad_civs_fnc_spawnCivilianGroup; diff --git a/node_modules/grad-civs/functions/spawn/fn_addResident.sqf b/node_modules/grad-civs/functions/spawn/fn_addResident.sqf index cb60e21..eedbcd8 100644 --- a/node_modules/grad-civs/functions/spawn/fn_addResident.sqf +++ b/node_modules/grad-civs/functions/spawn/fn_addResident.sqf @@ -13,7 +13,7 @@ private _house = [ if (isNil "_house") exitWith {INFO("could not find spawn position for resident this time")}; if (isNull _house) exitWith {INFO("could not find spawn position for resident this time")}; -private _groupSize = random GRAD_CIVS_INITIALGROUPSIZE; +private _groupSize = floor random GRAD_CIVS_INITIALGROUPSIZE; private _group = [getPos _house, _groupSize, objNull, "reside"] call grad_civs_fnc_spawnCivilianGroup; if (isNull _group) exitWith {}; diff --git a/package.json b/package.json index 8afc0ed..3299c7c 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,12 @@ "name": "McDiod" } ], - "dependencies": { "@gruppe-adler/replay": ">=0.0.1", - "grad-listbuymenu": ">=0.0.1", - "grad-fortifications": ">=0.0.1", - "grad-loadout": ">=0.0.1", + "grad-civs": "^1.2.2", "grad-factions-tvt": ">=0.0.1", - "grad-civs": ">=0.0.1" + "grad-fortifications": ">=0.0.1", + "grad-listbuymenu": ">=0.0.1", + "grad-loadout": ">=0.0.1" } }