Grinher1988
Member-
Content Count
10 -
Joined
-
Last visited
-
Medals
Everything posted by Grinher1988
-
I made a really simple enemy convoy script but besides the A3 AI being terrible drivers theres a bigger problem a little town called "Sagonisi" is sometimes selected as a destination for the convoy and its inaccessible to land vehicles. I tried _townlist = _townlist - ["Sagonisi"]; but that doesn't seem to work can anyone help? Also a related question how can I spawn more vehicles but in a way they aren't spawned on top of the previously spawned vehicle? TLDR; how can I blacklist/delete a selected town from an array? //==============Enemy Convoy Script============ //place null = [] execVM "randomConvoy.sqf"; in init.sqf or whatever :P //place an object on the map named myAmmoBox or change it on line 12 //line 33 change side west,east, or resistance //line 36 change vehicle type //***THIS SCRIPT LOOPS SO ONLY CALL IT ONCE!*** //================By Grinher============== if (!isServer) exitWith {};//Should prevent 40+ convoy spawning on mission start //===========================Random time before next convoy=========================================================== _delay = 900 max (floor(random 1800));//in seconds default is 15~30mins after the first convoy spawn //============================Create List of Towns==================================================================== _townlist = nearestLocations [getpos myAmmoBox, ["NameCityCapital","NameCity","NameVillage"],15000];//get list of towns _townlist = _townlist - ["Sagonisi"];//Blacklist doesn't work yet :c _rnd = floor random (count _townlist); _townStart = _townlist select _rnd; _roadList = (getPos _townStart) nearRoads 100; _rndRoad = floor random (count _roadList); _roadStart = _roadList select _rndRoad; _townlist = _townlist - [_townStart]; _townEnd = _townlist select _rnd; _town_Start = text (_townStart); _town_End = text (_townEnd); //=================================================Create Convoy====================================================== _convoyGroup = createGroup east; _vehA = [position _roadStart, 180, "O_Truck_03_ammo_F", _convoyGroup] call bis_fnc_spawnvehicle; sleep 5; _convoyGroup setBehaviour "CARELESS"; hint format ["A convoy has been sighted leaving %1, reports indicate the convoy is heading towards %2.", _town_Start, _town_End]; //=================================================Set convoy dest===================================================== _wp1 = _convoyGroup addWaypoint [position _townEnd, 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointCompletionRadius 25; //=================================================Create Markers===================================================== _marker = createMarker ["Tracker", position _townStart]; _marker setMarkerShape "ICON"; _marker setMarkerType "hd_ambush"; _marker setMarkerColor "ColorRED"; _marker setMarkerText "Convoy"; _marker setMarkerAlpha 1; _markerTS = createMarker ["Start", position _townStart]; _markerTS setMarkerShape "ICON"; _markerTS setMarkerType "hd_start"; _markerTS setMarkerColor "ColorRED"; _markerTS setMarkerText "Start"; _markerTS setMarkerAlpha 1; _markerTE = createMarker ["End", position _townEnd]; _markerTE setMarkerShape "ICON"; _markerTE setMarkerType "hd_end"; _markerTE setMarkerColor "ColorRED"; _markerTE setMarkerText "End"; _markerTE setMarkerAlpha 1; //keep track of leader while {alive leader _convoyGroup} do { "Tracker" setMarkerPos getpos leader _convoyGroup; sleep 1; }; while {true} do { waitUntil{{alive _x} count units _convoyGroup < 1 or (leader _convoyGroup) distance _townEnd < 25}; }; hint "The convoy has either been destroyed, or has left the area.";//not skilled at coding enough to detect difference xD deleteMarker "Tracker"; deleteMarker "Start"; deleteMarker "End"; { deleteVehicle _x } forEach units _convoyGroup; deleteGroup _convoyGroup; sleep _delay; [] execVM "randomConvoy.sqf"; ---------- Post added at 02:09 ---------- Previous post was at 02:06 ---------- OH! I forgot that I figured out how to delete the first town picked to prevent start/end being in the same place with _townlist = _townlist - [_townStart]; but I don't understand why _townlist = _townlist - ["Sagonisi"]; does nothing!
-
Delete an array selection?
Grinher1988 replied to Grinher1988's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks I finally got everything working, but because of how horrible the AI drive compared to A2 this is a waste of time. -
Delete an array selection?
Grinher1988 replied to Grinher1988's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you F2k, I figured out a way of deleting the grid coordinates from your example. I have another question for some reason this line of code is failing but not sure why? while {true} do { waitUntil{{alive _x} count units _convoyGroup < 1 or (leader _convoyGroup) distance getMarkerPos "End" < 25}; }; -
Solved, thanks for the help. Error: waitUntil {!alive _uav1}; hint "UAV has been destroyed!"; Solution: [] spawn { waitUntil {!alive _uav1}; }; hint "UAV has been destroyed!";
-
--solved--
-
------removed---------
-
Messing up script?
Grinher1988 replied to Grinher1988's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well, the "solution" was incorrect after turning on -showScriptErrors. I keep getting a generic expression error but not sure how to solve it. while { ({_x distance _opDropZone < 100}forEach units _opGroup) } then { [color="#FF0000"]hint "WORKED"; deleteVehicle (_opVehicle); sleep 0.5; [/color] }; While all group members are close enough to the dropzone(invsibile helipad) then {//code}; -
Messing up script?
Grinher1988 replied to Grinher1988's topic in ARMA 3 - MISSION EDITING & SCRIPTING
solved -
testing
-
I saw an VTOL aircraft on armaholic for A3 a couple days ago maybe you could extract and peak at their config.cpp?