Search the Community
Showing results for tags 'buildingpos'.
Found 3 results
-
Cannot get AI to move to waypoints in a tower
beako posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
HI All, I cannot get the AI to move to the top level waypoints of a tower. The AI seems to stay on the ground level. How can I get the AI to move to each building position on the top floor? for example: player addAction ["<t color='#f44298' size='1' > BUILDING SEARCH</t>", { _posTestGrp = screenToWorld [0.5,0.5]; _building = "Land_Cargo_Tower_V1_No1_F" createVehicle _posTestGrp; sleep 1; _testgrp = createGroup WEST; _soldier = "B_Soldier_F"; _newUnit = _testgrp createUnit [_soldier, _posTestGrp , [], 0, "NONE"]; _buildingPositionsArray = [_building] call BIS_fnc_buildingPositions; _buildingPositionsCount = count _buildingPositionsArray; for "_i" from 10 to _buildingPositionsCount - 1 do { _wp = _testgrp addWaypoint [AGLToASL (_building buildingPos _i), 0]; //_wp waypointAttachObject _building; _wp setWaypointHousePosition _i; _testgrp setCurrentWaypoint _wp; //_wp setWaypointType "MOVE"; _arrow = createSimpleObject ["Sign_Arrow_F", AGLToASL (_building buildingPos _i)]; hint format ["moving to %1", getPosATL _arrow]; waitUntil { sleep 1; hint format ["%1m to %2", round (AGLToASL getPos _newUnit distance AGLToASL (_building buildingPos _i)), AGLToASL(_building buildingPos _i)]; ((AGLToASL getPos _newUnit distance AGLToASL(_building buildingPos _i)) < 2) }; sleep 3; deleteVehicle _arrow; }; },"",2]; I also tried without waypoints and used ATL player addAction ["<t color='#f44298' size='1' > BUILDING SEARCH</t>", { _posTestGrp = screenToWorld [0.5,0.5]; _building = "Land_Cargo_Tower_V1_No1_F" createVehicle _posTestGrp; // Land_Cargo_HQ_V1_F sleep 1; _testgrp = createGroup WEST; _soldier = "B_Soldier_F"; _newUnit = _testgrp createUnit [_soldier, _posTestGrp , [], 0, "NONE"]; _buildingPositionsArray = [_building] call BIS_fnc_buildingPositions; _buildingPositionsCount = count _buildingPositionsArray; for "_i" from 0 to _buildingPositionsCount - 1 do { _buildingPos = [(_building buildingPos _i) select 0, (_building buildingPos _i) select 1,((_building buildingPos _i) select 2) + 5] ; _arrow = "VR_3DSelector_01_default_F" createVehicle _buildingPos; _arrow setPosASL _buildingPos; sleep 0.1; /* _wp = _testgrp addWaypoint [[(getPosATL _arrow) select 0,(getPosATL _arrow) select 1, ((getPosATL _arrow) select 2) + 5], 0]; _wp waypointAttachObject _building; _wp setWaypointHousePosition _i; _testgrp setCurrentWaypoint _wp; _wp setWaypointType "MOVE"; */ _newUnit move getPosATL _arrow; waitUntil { sleep 1; hint format ["%1m to %2", round (_newUnit distance getPosATL _arrow), getPosATL _arrow]; (( _newUnit distance getPosATL _arrow) < 3) }; sleep 3; hint format ["I am here at %1", getPosATL _arrow]; deleteVehicle _arrow; }; },"",2]; But soldier does not climb up the stairs to get the first building waypoint!- 4 replies
-
- setwaypointhouseposition
- buildingpos
-
(and 1 more)
Tagged with:
-
_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
-
I can spawn items in buildings, though i want to only spawn one or two.
HAFGaming1 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi everyone! I was able to get a script working to spawn loot. It spawns like 5-6 items per building (so far weapons and mags) and it lags the crap out of my game. (this is within a 100m distance) is there anyway to make it spawn one or two per building so i dont lag as much? also to keep my mission from being to easy to find loot. here is the script:: _unit = _this select 0; _addActionID = _this select 2; _unit removeAction _addActionID; _markerPos = getMarkerPos "lootMarker"; _weaponArray = []; //Automation process _cfgWeapons = "true" configClasses (configFile >> "cfgWeapons"); { _weaponString = configName (_x); _parents = [_x,true] call BIS_fnc_returnParents; if ("Rifle" in _parents) then{ _weaponArray append [_weaponString]; }; if ("Pistol" in _parents) then{ _weaponArray append [_weaponString]; }; } forEach _cfgWeapons; //Automation process _itemBoxArray = []; _houseArray = _markerPos nearObjects ["house",100]; { _buildingPositions = [_x] call BIS_fnc_buildingPositions; { _weapon = _weaponArray select (floor (random (count _weaponArray))); _itemBox = "WeaponHolderSimulated" createVehicle [0,0,0]; _itemBox setPos _x; _itemBox addWeaponCargoGlobal [_weapon,1]; _magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); _mag = _magazines select (floor (random (count _magazines))); _itemBox addMagazineCargoGlobal [_mag,5]; _itemBoxArray = _itemBoxArray + [_itemBox]; } forEach _buildingPositions; } forEach _houseArray; sleep 120; { deleteVehicle _x; } forEach _itemBoxArray;