total 1 Posted September 1, 2013 (edited) Need help! :p I can't find an example with position numbers, only objects, units or markers. 1) setWaypointPosition or addwaypoint? I get Error Type Number 2) How do I replace AA_Squad_spawn1-marker with position? if (!isServer) exitwith {}; _side = createCenter EAST; _AASquad1 = [getMarkerPos "AA_Squad_spawn1", _side, ["O_soldier_TL_F", "O_soldier_AA_F", "O_soldier_AA_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup; _wp1 = _AASquad1 addWaypoint [14230.033,14.379024]]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointStatements ["true", ""]; _wp1 setWaypointCombatMode "RED"; _wp1 setWaypointSpeed "NORMAL"; _wp2 = _AASquad1 addWaypoint [14414.781,17.423283]]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointStatements ["true", ""]; _wp2 setWaypointCombatMode "RED"; _wp2 setWaypointSpeed "NORMAL"; _wp3 = _AASquad1 addWaypoint [14415.356,17.463614]]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointStatements ["true", ""]; _wp3 setWaypointCombatMode "RED"; _wp3 setWaypointSpeed "NORMAL"; _wp4 = _AASquad1 addWaypoint [14079.998,14.377373]]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointStatements ["true", ""]; or this? I have no idea. if (!isServer) exitwith {}; _side = createCenter EAST; _AASquad1 = [getMarkerPos "AA_Squad_spawn1", _side, ["O_soldier_TL_F", "O_soldier_AA_F", "O_soldier_AA_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup; _marker1 = createMarker ["wp1", [14230.033,14.379024]]; _marker1 setMarkerType "mil_destroy"; _marker1 setMarkerColor "ColorRed"; _marker2 = createMarker ["wp2", [14414.781,17.423283]]; _marker2 setMarkerType "mil_destroy"; _marker2 setMarkerColor "ColorRed"; _marker3 = createMarker ["wp3", [14415.356,17.463614]]; _marker3 setMarkerType "mil_destroy"; _marker3 setMarkerColor "ColorRed"; _marker4 = createMarker ["wp4", [14079.998,14.377373]]; _marker4 setMarkerType "mil_destroy"; _marker4 setMarkerColor "ColorRed"; _wp1 = _AASquad1 addWaypoint [getMarkerPos "wp1", 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointStatements ["true", ""]; _wp1 setWaypointCombatMode "RED"; _wp1 setWaypointSpeed "NORMAL"; _wp2 = _AASquad1 addWaypoint [getMarkerPos "wp2", 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointStatements ["true", ""]; _wp2 setWaypointCombatMode "RED"; _wp2 setWaypointSpeed "NORMAL"; _wp3 = _AASquad1 addWaypoint [getMarkerPos "wp3", 0]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointStatements ["true", ""]; _wp3 setWaypointCombatMode "RED"; _wp3 setWaypointSpeed "NORMAL"; _wp4 = _AASquad1 addWaypoint [getMarkerPos "wp4", 0]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointStatements ["true", ""]; Edited September 1, 2013 by Total Share this post Link to post Share on other sites
delta99 34 Posted September 2, 2013 Looks like you have too many brackets at the end of your addWaypoint lines. Remove one of them. Share this post Link to post Share on other sites
kylania 568 Posted September 2, 2013 Why are you giving enemy AI markers? Share this post Link to post Share on other sites
total 1 Posted September 2, 2013 (edited) I can't get the waypoint positions to work. I tried creating markers with positions and use getMarkerpos on waypoints, but nothing works. Edited September 2, 2013 by Total Share this post Link to post Share on other sites
total 1 Posted September 2, 2013 @Delta99: I've tried to remove it, but still it doesn't work. The unit spawns, but the waypoinst doesn't work at all. Share this post Link to post Share on other sites
magicpanda 19 Posted September 2, 2013 This way works for me. _AISpawnLoc = "AISpawn"; _AttckPos = getMarkerPos "AttackArea"; _grp1 = createGroup east; _grp1 = [getMarkerPos _AISpawnLoc, east, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam")] call BIS_fnc_spawnGroup; _wp0 = _grp1 addWaypoint [ _AttckPos,0]; _wp0 setWaypointType "SAD"; _wp0 setWaypointFormation "COLUMN"; _wp0 setWaypointBehaviour "COMBAT"; _wp0 setwaypointcombatmode "RED"; _wp0 setWaypointSpeed "LIMITED"; _wp0 setWaypointCompletionRadius 20; ---------- Post added at 03:47 PM ---------- Previous post was at 03:32 PM ---------- It's not the index of the waypoints is it? (in red) _wp1 = _AASquad1 addWaypoint [getMarkerPos "wp1", 0]; _wp1 setWaypointType "MOVE"; _wp1 setWaypointStatements ["true", ""]; _wp1 setWaypointCombatMode "RED"; _wp1 setWaypointSpeed "NORMAL"; _wp2 = _AASquad1 addWaypoint [getMarkerPos "wp2", 1]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointStatements ["true", ""]; _wp2 setWaypointCombatMode "RED"; _wp2 setWaypointSpeed "NORMAL"; _wp3 = _AASquad1 addWaypoint [getMarkerPos "wp3", 2]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointStatements ["true", ""]; _wp3 setWaypointCombatMode "RED"; _wp3 setWaypointSpeed "NORMAL"; _wp4 = _AASquad1 addWaypoint [getMarkerPos "wp4", 3]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointStatements ["true", ""]; Share this post Link to post Share on other sites
total 1 Posted September 8, 2013 (edited) I want to connect this script with Urban Patrol. What's wrong? if (!isServer) exitwith {}; _side = createCenter EAST; // Anti Air Squad - Gravia _01_wp0 = getMarkerPos "01_wp0"; _01Squad = [getMarkerPos "01_spawn", _side, ["O_soldier_TL_F","O_soldier_TL_F", "O_soldier_AA_F", "O_soldier_AA_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup; _01Squad = setvariable ["nul=[this,""Sector1"",""random""] execVM ""ups.sqf""], true]; _wp0 = _01Squad addWaypoint [ _01_wp0,0]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointStatements ["true", ""]; _wp0 setWaypointCombatMode "RED"; _wp0 setWaypointSpeed "NORMAL"; Is this the right way to get all units to run UPS? _01Squad = setvariable ["nul=[this,""Sector1"",""random""] execVM ""ups.sqf""], true]; 1) AI spawns 2) Follows the waypoint into the marker "Sector1" 3) Generates new random waypoints with UPS inside the marker "Sector1". If not, how can I get this to work? Edited September 8, 2013 by Total Share this post Link to post Share on other sites
total 1 Posted September 8, 2013 _01Squad = setvariable [nul=[this,"sector1","NOAI"] execVM "ups.sqf"]; Error message: Missing ; Whats wrong? Share this post Link to post Share on other sites
kylania 568 Posted September 9, 2013 setVariable doesn't work that way at all, you don't execute code within in you just set a value referenced to an object. I don't think you want to use setvariable there at all, just the exeVM stuff on it's own. _01Squad = [getMarkerPos "01_spawn", _side, ["O_soldier_TL_F","O_soldier_TL_F", "O_soldier_AA_F", "O_soldier_AA_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup; [_01Squad,"Sector1","random"] execVM "ups.sqf"; Share this post Link to post Share on other sites
total 1 Posted September 9, 2013 (edited) Error in expression <c) then {_exit = false;} } else { if (count _obj>0) then { {if (alive _x) then> Error position: <count _obj>0) then { {if (alive _x) then> Error count: Type Group, expected Array,Config entry File C:\Users\Total\Documents\Arma 3 - Other Profiles\[aCe]Total\missions\[aCe]COOP_test.Altis\ups.sqf, line 191 What's wrong? if (!isServer) exitwith {}; _side = createCenter EAST; // Anti Air Squad - Gravia _01_wp0 = getMarkerPos "01_wp0"; _01Squad = [getMarkerPos "01_spawn", _side, ["O_soldier_TL_F","O_soldier_TL_F", "O_soldier_AA_F", "O_soldier_AA_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup; [_01Squad,"Alpha","random"] execVM "ups.sqf"; _wp0 = _01Squad addWaypoint [ _01_wp0,0]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointStatements ["true", ""]; _wp0 setWaypointCombatMode "RED"; _wp0 setWaypointSpeed "NORMAL"; // unit that's moving _obj = _this select 0; _npc = _obj; // is anybody alive in the group? _exit = true; if (typename _obj=="OBJECT") then { if (alive _npc) then {_exit = false;} } else { if (count _obj>0) then { {if (alive _x) then {_npc = _x; _exit = false;}} forEach _obj; }; }; Edited September 9, 2013 by Total Share this post Link to post Share on other sites
kylania 568 Posted September 9, 2013 That error is from 191 lines down, not the first 10 lines of the script. The error references code you're not showing us. Share this post Link to post Share on other sites
total 1 Posted September 9, 2013 UPS.sqf http://pastebin.com/66782KW6 Share this post Link to post Share on other sites
kylania 568 Posted September 9, 2013 Ooh, ok. Looks like UPS is designed to be run from the group leader's init. So change your code to: [leader _01Squad,"Alpha","random"] execVM "ups.sqf"; Share this post Link to post Share on other sites
total 1 Posted September 9, 2013 Thanks, that fixed the problem. Now it has suddenly appeared an new error message. AI spawns, but disappear 1-2 seconds later when this error message pops up: Error in expression <KRON_TRGFlag=KRON_Trig_EAST_Alpha> Error position: <KRON_Trig_EAST_Alpha> Error Undefined variable in expression: kron_trig_east_alpha Share this post Link to post Share on other sites
kylania 568 Posted September 10, 2013 That one you can ignore, it'll disappear once you're on stable anyway. :) Share this post Link to post Share on other sites
total 1 Posted September 10, 2013 (edited) But why does my array spawned units disappear as soon as they run UPS ? Is it possible to get the leader to not run UPS before last waypoint is completed? Edited September 10, 2013 by Total Share this post Link to post Share on other sites
kylania 568 Posted September 10, 2013 Caching maybe? Also I think it's waypoints or ups, not both. Share this post Link to post Share on other sites
total 1 Posted September 10, 2013 (edited) Caching? It seems like it's my waypoints that are the problem. How can I get UPS to run after the waypoint is completed? In the worst case, how can I put Sleep on UPS, so it doesn't run until after 2-3 minutes? Waypoint = 0 If waypoint = 1 run UPS.sqf if (!isServer) exitwith {}; _side = createCenter EAST; // Anti Air Squad - Gravia _01_wp0 = getMarkerPos "01_wp0"; _01Squad = [getMarkerPos "01_spawn", _side, ["O_soldier_TL_F","O_soldier_TL_F", "O_soldier_AA_F", "O_soldier_AA_F", "O_soldier_AA_F"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup; [leader _01Squad,"Alpha","random"] execVM "ups.sqf"; _wp0 = _01Squad addWaypoint [ _01_wp0,0]; _wp0 setWaypointType "MOVE"; _wp0 setWaypointStatements ["true", ""]; _wp0 setWaypointCombatMode "RED"; _wp0 setWaypointSpeed "NORMAL"; Edited September 10, 2013 by Total Share this post Link to post Share on other sites
kylania 568 Posted September 10, 2013 You don't. Either you give your guys waypoints OR you set them up to patrol a marker using UPS. Why have them walk to a waypoint anyway, just start them at the marker and have them patrol Or run the ups from the waypoint. _wp0 setWaypointStatements ["true", "foo = [leader this,'Alpha','random'] execVM 'ups.sqf';"]; I think that might work, but trying to combine waypoints and a script which dictates waypoints is just a recipe for a headache. :) Share this post Link to post Share on other sites