Arma 3
Overthrow [Outdated]
LoOni3r 8 Apr, 2019 @ 1:39pm
Gendarmerie does not spawn in started cities Manual spawn script
I have the problem that in cities where I was already, no gendarmerie spawn more.
I wrote a simple spawn script.


spawngen.sqf:
{ _playertype = typeOf _x; _playervarname = vehicleVarName _x; _playercount = _playercount + 1; if (_playervarname == "bigboss") then { _player = _x; _randnumbspawngrad = round(random 360); _randnumbspawn = round(random 400) +200; _playernearestposspawn = _player getPos [_randnumbspawn,_randnumbspawngrad]; _nearestRoad = [_playernearestposspawn, 200] call BIS_fnc_nearestRoad; _roadpos = getpos _nearestRoad; _closesttown = (nearestLocations [_player,["NameCityCapital","NameCity","NameVillage"],500]) select 0; _town_name = text _closesttown; _town_pos = position _closesttown; _group = createGroup WEST; _unit = _group createUnit ["B_GEN_Commander_F", _roadpos, [], 0, "FORM"]; _unit setVariable ["garrison",_town_name,false]; [_unit,_town_name] call OT_fnc_initGendarm; _unit = _group createUnit ["B_GEN_Soldier_F", _roadpos, [], 0, "FORM"]; _unit setVariable ["garrison",_town_name,false]; [_unit,_town_name] call OT_fnc_initGendarm; _unit = _group createUnit ["B_GEN_Soldier_F", _roadpos, [], 0, "FORM"]; _unit setVariable ["garrison",_town_name,false]; [_unit,_town_name] call OT_fnc_initGendarm; _unit = _group createUnit ["B_GEN_Soldier_F", _roadpos, [], 0, "FORM"]; _unit setVariable ["garrison",_town_name,false]; [_unit,_town_name] call OT_fnc_initGendarm; _group deleteGroupWhenEmpty true; _wp1 = _group addWaypoint [_player, 25]; _wp1 setWaypointSpeed "FULL"; _wp1 setWaypointType "SAD"; }; } forEach playableUnits;

save the script in folder:
@overthrow\addons\overthrow_main\campaign\missions\OverthrowMpAltis.Altis\spawngen.sqf

run this:
[] execVM "spawngen.sqf";
as a host in the debug console -> Server