OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: loki72 on 09 Sep 2008, 00:32:00
-
greetings,
most curious...
if i use this code:
_para = createVehicle["Parachute", [((getpos player) select 0) +3 +(random 5), ((getpos player) select 1)+3 +(random 5), ((getpos player) select 2) +1000],[], 0, "FLY"];
i get the same result with:
_para = createVehicle["Parachute", [((getpos player) select 0) +3 +(random 5), ((getpos player) select 1)+3 +(random 5), ((getpos player) select 2) +1],[], 0, "FLY"];
both start the player about 50m up.
why and how is the "FLY" usurping the select 2 variable?
thx
-
Because that is what "FLY" does: It starts you at an arbitrary 50m above the ground. If you want a specific height, then setPos after creation:
_para = createVehicle ["Parachute", getPos player,[], 0, "FLY"];
_para setPos [((getpos player) select 0) +3 +(random 5), ((getpos player) select 1)+3 +(random 5), ((getpos player) select 2) +1000];
-
ah-ha...
"fly" was catching the selects... by breaking it up and then setPos, it takes the variables into account.
thanks
:D