steffieth 4 Posted January 8, 2018 I have a problem with syntax in my latest Script. I totally do not understand why: // usage: 0 = this addAction ["Halo Jump","scripts\Jump.sqf", [[0,0,0], "B_T_VTOL_01_infantry_F", 2000]] private ["_caller","_spawnpos","_vehicle","_height"]; _caller = _this select 1; _spawnpos = _this select 3 select 0; _vehicle = _this select 3 select 1; _height = _this select 3 select 2; openMap [true,false]; hint "select jump location"; [_caller, _spawnpos, _vehicle, _height] onMapSingleClick { params ["_caller","_spawnpos","_vehicle","_height","_transpoert","_pos"]; openMap [false,false]; onMapSingleClick ""; _marker = createMarker ["Marker_" + (str _randomnumber),_pos]; _marker setMarkerType "mil_dot"; _dir = _spawnpos getDir _pos; _dist = _spawnpos distance2D _pos; _transport = createVehicle [_vehicle, [_spawnpos select 0, _spawnpos select 1, _height], [], 0, "FLY"]; _transport setPos [_spawnpos select 0, _spawnpos select 1, _height]; _transport setDir _dir; createVehicleCrew _transport; {_x moveinCargo _transport} forEach units group _caller; openMap [false,false]; _transport flyInHeight _height; _crew = group driver _transport; _wp1 = _crew addWaypoint [_pos, 0]; _wp2 = _crew addWaypoint [_pos getPos [_dir, _dist/2], 0]; _wp2 = _crew addWaypoint [_spawnpos, 0]; hint str ((getPos _transport) distance2D _pos <= 100); // this hints "false" waitUntil { ((getPos _transport) distance2D _pos <= 100) }; // this throws Error Generic error expression //waitUntil { getPos _transport distance2D _spawnpos) <= 100 }; deleteMarker _marker; //{deleteVehicle _x} forEach crew (_transport) + [_transport]; }; Error Message is: '... { ((getPos _transport) distance2D _pos |#|<= 100 }; deleteMarker _marker; };' File [...] \scripts\Jump.sqf, line 36 Error Generic error in expression tryed a lot with Braces. next would be to surround with spawn but should work like this too.l Any Idea? Edit: fixed typo in private "_transpoert" ... still not working. Edit 2: same Error if I use waitUntil{(!(_caller in _transport))}; Share this post Link to post Share on other sites
Schatten 289 Posted January 8, 2018 @steffieth, code in event handlers (e.g. onMapSingleClick) runs in unscheduled environment, so suspending (waitUntil, sleep, etc.) is not allowed. Share this post Link to post Share on other sites