Ok, slowly i'm getting mad about this one. Got this really simple patrol script (well, in fact just move around but it is good enough for what i need)..
private ["_group", "_dist", "_array", "_leader", "_gl", "_start_pos", "_pos", "_xpos", "_ypos", "_dir", "_vehicle", "_inrange"];
_group = _this select 0;
_dist = _this select 1;
_array = _this select 2;
_leader = leader _group;
_vehicle = vehicle _leader;
_inrange = false;
_gl = "logic" createvehicle [0,0,0];
_start_pos = _array select (floor (random (count _array)));
_gl setpos getmarkerpos _start_pos;
_group move getpos _gl;
while {count units _group > 0} do
{
while {!(_inrange)} do
{
_dist = _gl distance _vehicle;
if (_dist < 20) then
{
_inrange = true;
};
};
if (random 100 > 75) then
{
_start_pos = _array select (floor (random (count _array)));
_pos = getmarkerpos _start_pos;
};
_dir = random 360;
_xpos = (_pos select 0) + ((random _dist))* sin _dir;
_ypos = (_pos select 1) + ((random _dist))* cos _dir;
_pos = [_xpos, _ypos];
_gl setpos _pos;
_group move getpos _gl;
_inrange = false;
};
deletevehicle _gl;
Parameters passed:
_group = Vehicles group; check with hint shows correct group
_dist = 200; also this i checked with a hint
_array = array containing several marker names; for testing i have just one marker and a hint shows correct ["go"]
The logic i created is actually part of my tries to solve the problem.
before i tried the
while {!(_inrange)} do
i had a waituntil which had condition (_gl distance _vehicle < 20) which also didn't work.
If someone could point the problem for me...before i bite my a$$
Myke out.
- SOLVED -
The problem wasn't in this script (which had also a few glitches were Mandoble pointed me at, thx Mandoble) but in the previous from which the above script was launched...a dostop command messed it up.