Pasi 11 Posted April 4, 2016 Hello guys i want to create a Waypoint loop but it dosnt work... can anyone look over my script ? i think the variable _waypoint is not a string but i dont know how it run... here is my script :/ _markers = ["marker_1","marker_2","marker_3"]; _count = count _markers; _group = group player; for [{_i = 0;}, {_i <= _count}, {_i = _i +1}] do { _waypoint = _markers select _i; _waypoints = _group addWaypoint[getMarkerPos "_waypoint", _i]; _waypoints setWaypointType"MOVE"; }; pls help me... Share this post Link to post Share on other sites
sarogahtyp 1108 Posted April 4, 2016 Maybe this description from currentWaypoint helps: If there are no waypoints, then the index is 0. By default, a group has 1 waypoint at their starting position, which is considered completed and so the currentWaypoint is 1. If I understand that correct then you have to start with index 2 because the first waypoint is set with groups creation, has index 1 and is already completed. Share this post Link to post Share on other sites
Bnae 1431 Posted April 4, 2016 _markers = ["marker_1","marker_2","marker_3"]; _count = count _markers; _group = group player; for [{_i = 0;}, {_i <= _count}, {_i = _i +1}] do { _markers = ["marker_1","marker_2","marker_3"] call BIS_fnc_selectRandom; _waypoints = _group addWaypoint [getMarkerPos _markers, 0]; _waypoints setWaypointType "MOVE"; sleep 1; }; No sure how you're going to use it. Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 thanks but i dont want to get a random marker. i want to start at marker_1 and end at marker_3 this select a random marker :/ Share this post Link to post Share on other sites
Bnae 1431 Posted April 4, 2016 _group = group player; _select = 0; while {true} do { _markers = ["marker_1","marker_2","marker_3"]; _waypoint = _markers select _select; _waypoints = _group addWaypoint [getMarkerPos _waypoint, 0]; _waypoints setWaypointType "MOVE"; _select = _select + 1; if (_select == 3) then {_select = 0}; sleep 1; }; Not the easiest way Edit: _group = group player; _select = 0; while {true} do { _markers = ["marker_1","marker_2","marker_3"]; _waypoint = _markers select _select; _waypoints = _group addWaypoint [getMarkerPos _waypoint, 0]; _waypoints setWaypointType "MOVE"; _select = _select + 1; waitUntil {(player distance (getMarkerPos _waypoint)) < 10}; if (_select == 3) then {_select = 0}; sleep 1; }; Now it'll wait until you're in the current waypoint Share this post Link to post Share on other sites
sarogahtyp 1108 Posted April 4, 2016 _markers = ["marker_1","marker_2","marker_3"]; _group = group player; _wpcount = 2; { _waypoints = _group addWaypoint[getMarkerPos _x, _wpcount]; _waypoints setWaypointType"MOVE"; _wpcount = _wpcount +1; } forEach _markers; _group setCurrentWaypoint [_group, 2]; // does not hurt this should work. but u should take care that in this example is _waypoints just the last created waypoint. It is not an array of all created waypoints. if u need that, just say. Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 Ok thank you guys now it works :) Thank you for the quick help. Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 OK i know that i nerve but now i cant see the waypoints when i get in a Car :D what is false with me ? Share this post Link to post Share on other sites
sarogahtyp 1108 Posted April 4, 2016 OK i know that i nerve but now i cant see the waypoints when i get in a Car :D what is false with me ? post ur script! Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 private ["_group", "_select","_markers","_waypoint","_makierung"]; _group = group player; _select = 0; while {_select < 3} do { _markers = ["marker_1","marker_2","marker_3"]; _waypoint = _markers select _select; _waypoints = _group addWaypoint [getMarkerPos _waypoint, 0]; _makierung = "Sign_Sphere200cm_F" createVehicle getMarkerPos _waypoint; _waypoints setWaypointType "MOVE"; _waypoints showWaypoint "ALWAYS"; _waypoints setWaypointVisible true; _select = _select + 1; waitUntil {(vehicle player distance (getMarkerPos _waypoint)) < 5}; sleep 1; deleteVehicle _makierung; }; Share this post Link to post Share on other sites
sarogahtyp 1108 Posted April 4, 2016 sorry but my opinion is that this is a terrible way. did u try mine? edit:but maybe that i misunderstood what u want to do.... Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 yes but the waypoints skip automatical when i get in a car Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 Auf Deutsch ;D ich möchte einfach nur Waypoints erstellen die man nach und nach abfahren soll wie z.B. bei den Kart DLC rennen. Share this post Link to post Share on other sites
ProfTournesol 956 Posted April 4, 2016 Auf Deutsch ;D ich möchte einfach nur Waypoints erstellen die man nach und nach abfahren soll wie z.B. bei den Kart DLC rennen. You must at least translate in English what you're posting mate. Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 ^^ he is from german :) i want to create waypoints like the Arma 3 Kart DLC routs Share this post Link to post Share on other sites
sarogahtyp 1108 Posted April 4, 2016 You must at least translate in English what you're posting mate. he wants to have some checkpoints as often did in racing games. if u get through the current checkpoint arc then the next arc should appear... Share this post Link to post Share on other sites
Pasi 11 Posted April 4, 2016 yes the script from Bnae is working but i cant see the waypoints in Vehicles Share this post Link to post Share on other sites