UltimateBawb 1 Posted March 12, 2013 (edited) I've made a short patrol script for car patrols in north and south Stratis, but units don't seem to move anywhere. Can anyone help? Placed in car's init: null = [this, "North"] execVM "carPatrol.sqf"; carPatrol.sqf: _car = _this select 0; _setType = _this select 1; while ((alive _car) && !(unitReady _car)) do { sleep 2; }; while (alive _car) do { if (_locationArray == "North") then {_locationArray = ["markerPatrolNorth", "markerPatrolNorth_1", "markerPatrolNorth_2", "markerPatrolNorth_3", "markerPatrolNorth_4", "markerPatrolNorth_5", "markerPatrolNorth_6", "markerPatrolNorth_7", "markerPatrolNorth_8", "markerPatrolNorth_9"} else {_locationArray = ["markerPatrolSouth", "markerPatrolSouth_1", "markerPatrolSouth_2", "markerPatrolSouth_3", "markerPatrolSouth_4", "markerPatrolSouth_5", "markerPatrolSouth_6", "markerPatrolSouth_7", "markerPatrolSouth_8", "markerPatrolSouth_9"}; _selectLocation = _locationArray call BIS_fnc_selectRandom; (group _car) move (getMarkerPos _selectLocation); while {((alive _car) && !(unitReady _car))} do { sleep 2; }; }; Edited March 12, 2013 by UltimateBawb Share this post Link to post Share on other sites
cobra4v320 27 Posted March 12, 2013 You are missing some semi colons. Try running this through squint or a notepad++ program and it will show the errors. Share this post Link to post Share on other sites
UltimateBawb 1 Posted March 12, 2013 (edited) AH SHIT! I completely missed the local variables, guess I just rushed through them. And I am using NP++ by the way. ;) Thanks, checking now. EDIT: OP editted to add semicolons, still dosen't work. :/ Edited March 12, 2013 by UltimateBawb Share this post Link to post Share on other sites
cobra4v320 27 Posted March 12, 2013 Check your while commands, missing some brackets. I would recommend using squint. :) Share this post Link to post Share on other sites
UltimateBawb 1 Posted March 12, 2013 Ah, fixed. Can't test until tomorrow though. Thanks again. Also, the if statement before the else doesn't need a semicolon, right? Share this post Link to post Share on other sites
cobra4v320 27 Posted March 12, 2013 Missing [] in your arrays also. ---------- Post added at 01:59 ---------- Previous post was at 01:53 ---------- _car = _this select 0; _setType = _this select 1; while {(alive _car) && !(unitReady _car)} do {sleep 2}; while {(alive _car)} do { if (_locationArray == "North") then { _locationArray = ["markerPatrolNorth", "markerPatrolNorth_1", "markerPatrolNorth_2", "markerPatrolNorth_3", "markerPatrolNorth_4", "markerPatrolNorth_5", "markerPatrolNorth_6", "markerPatrolNorth_7", "markerPatrolNorth_8", "markerPatrolNorth_9"] } else { _locationArray = ["markerPatrolSouth", "markerPatrolSouth_1", "markerPatrolSouth_2", "markerPatrolSouth_3", "markerPatrolSouth_4", "markerPatrolSouth_5", "markerPatrolSouth_6", "markerPatrolSouth_7", "markerPatrolSouth_8", "markerPatrolSouth_9"] }; _selectLocation = _locationArray call BIS_fnc_selectRandom; (group _car) move (getMarkerPos _selectLocation); }; while {(alive _car) && !(unitReady _car)} do {sleep 2}; Share this post Link to post Share on other sites