Search the Community
Showing results for tags 'garrison'.
Found 3 results
-
Hi, I try to spawn garrison in three random buildings in two different villages. This is what I have in the trigger _rHouse1 = (nearestObjects [getMarkerPos "capture_1", validHouse, 250]) call BIS_fnc_selectRandom; _grpDef1 = createGroup [east, true]; _unit1 = _grpDef1 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse1 buildingPos 3),[],0,"CAN_COLLIDE"]; _unit1 disableAI "PATH"; _unit1 setUnitPos "UP"; _unit2 = _grpDef1 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse1 buildingPos 5),[],0,"CAN_COLLIDE"]; _unit2 disableAI "PATH"; _unit2 setUnitPos "UP"; _rHouse2 = (nearestObjects [getMarkerPos "capture_1", validHouse, 250]) call BIS_fnc_selectRandom; _unit3 = _grpDef1 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse2 buildingPos 4),[],0,"CAN_COLLIDE"]; _unit3 disableAI "PATH"; _unit3 setUnitPos "UP"; _unit4 = _grpDef1 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse2 buildingPos 6),[],0,"CAN_COLLIDE"]; _unit4 disableAI "PATH"; _unit4 setUnitPos "UP"; _rHouse3 = (nearestObjects [getMarkerPos "capture_1", validHouse, 250]) call BIS_fnc_selectRandom; _unit5 = _grpDef1 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse3 buildingPos 3),[],0,"CAN_COLLIDE"]; _unit5 disableAI "PATH"; _unit5 setUnitPos "UP"; _unit6 = _grpDef1 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse3 buildingPos 4),[],0,"CAN_COLLIDE"]; _unit6 disableAI "PATH"; _unit6 setUnitPos "UP"; _rHouse4 = (nearestObjects [getMarkerPos "capture_2", validHouse, 250]) call BIS_fnc_selectRandom; _grpDef2 = createGroup [east, true]; _unit7 = _grpDef2 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse4 buildingPos 5)),[],0,"CAN_COLLIDE"]; _unit7 disableAI "PATH"; _unit7 setUnitPos "UP"; _unit8 = _grpDef2 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse4 buildingPos 6),[],0,"CAN_COLLIDE"]; _unit8 disableAI "PATH"; _unit8 setUnitPos "UP"; _rHouse5 = (nearestObjects [getMarkerPos "capture_2", validHouse, 250]) call BIS_fnc_selectRandom; _unit9 = _grpDef2 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse5 buildingPos 4),[],0,"CAN_COLLIDE"]; _unit9 disableAI "PATH"; _unit9 setUnitPos "UP"; _unit10 = _grpDef2 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse5 buildingPos 5),[],0,"CAN_COLLIDE"]; _unit10 disableAI "PATH"; _unit10 setUnitPos "UP"; _rHouse6 = (nearestObjects [getMarkerPos "capture_2", validHouse, 250]) call BIS_fnc_selectRandom; _unit11 = _grpDef2 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse6 buildingPos 2),[],0,"CAN_COLLIDE"]; _unit11 disableAI "PATH"; _unit11 setUnitPos "UP"; _unit12 = _grpDef2 createUnit ["CUP_B_US_Soldier_OEFCP",(_rHouse6 buildingPos 4),[],0,"CAN_COLLIDE"]; _unit12 disableAI "PATH"; _unit12 setUnitPos "UP"; It give me "missing ]" typo error. This is the array of valid buildings : validHouse = ["Land_jbad_House3_dam","Land_jbad_House_c_5", "Land_jbad_House_1_old","Land_jbad_House_8_old", "Land_jbad_House_c_11","Land_jbad_opx2_big_e", "Land_jbad_House_c_2","Land_jbad_House_c_10", "Land_jbad_dum_istan2","Land_jbad_House_c_3", "Land_jbad_opx2_complex5","Land_jbad_opx2_big_c", "Land_jbad_House8","Land_jbad_House_1", "Land_HBarrierTower_F"]; Any leads? 🙄
-
Spawn script to fill buildings with garrisons.
kibaBG posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi guys, I am bashing my head with something very easy (hopefully 🙂). I want to make a script to fill some buildings (sorted by classname or random) with enemies in given location (town, village, etc.). The old way I used before was just making a trigger next to every big building in the location and pasting this in on activation: private _group = createGroup [WEST, true]; _unit1 = _group createUnit ["CUP_B_US_Soldier_OEFCP",(nearestBuilding thisTrigger buildingPos 1),[],0,"CAN_COLLIDE"]; _unit1 disableAI "PATH"; _unit1 setUnitPos "UP"; _unit2 = _group createUnit ["CUP_B_US_Soldier_MG_OEFCP",(nearestBuilding thisTrigger buildingPos 2),[],0,"CAN_COLLIDE"]; _unit2 disableAI "PATH"; _unit2 setUnitPos "UP"; _unit3 = _group createUnit ["CUP_B_US_Soldier_GL_OEFCP",(nearestBuilding thisTrigger buildingPos 3),[],0,"CAN_COLLIDE"]; _unit3 disableAI "PATH"; _unit3 setUnitPos "UP"; _unit4 = _group createUnit ["CUP_B_US_Soldier_OEFCP",(nearestBuilding thisTrigger buildingPos 4),[],0,"CAN_COLLIDE"]; _unit4 disableAI "PATH"; _unit4 setUnitPos "UP"; _unit5 = _group createUnit ["CUP_B_US_Soldier_MG_OEFCP",(nearestBuilding thisTrigger buildingPos 5),[],0,"CAN_COLLIDE"]; _unit5 disableAI "PATH"; _unit5 setUnitPos "UP"; _unit6 = _group createUnit ["CUP_B_US_Soldier_GL_OEFCP",(nearestBuilding thisTrigger buildingPos 6),[],0,"CAN_COLLIDE"]; _unit6 disableAI "PATH"; _unit6 setUnitPos "UP"; Its terribly tedious and I want to change it to a proper script executed by the server. Any ideas? -
_bpos = []; _origin = ((get3DENSelected "object") select 0); {_bpos append (_x buildingPos -1)} foreach (nearestObjects [_origin, ["House", "Building"], 50]); { _bp = selectrandom _bpos; _bpos = _bpos - [_bp]; _x setpos _bp; } foreach (get3DENSelected "object"); The code is used in the 3den editor CONSOLE to place the SELECTED units/objects to all buildings in 50m radius. You need to select your units in the editor, then press ctrl + D to enter the console, then you run the code. Works with editor placed buildings/fortifications. the units will be put into nearest buildings, the 3den markers will update AFTER testing the mission, to make them stay you should put {_x disableai "PATH"} foreach units this into the composition of the group