OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: loki72 on 09 Sep 2008, 00:32:00

Title: to "FLY" or not to "FLY" that is the question (solved)
Post by: loki72 on 09 Sep 2008, 00:32:00
greetings,

most curious...

if i use this code:

Code: [Select]
_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:

Code: [Select]
_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
Title: Re: to "FLY" or not to "FLY" that is the question
Post by: Spooner on 09 Sep 2008, 01:47:44
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:
Code: [Select]
_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];
Title: Re: to "FLY" or not to "FLY" that is the question
Post by: loki72 on 09 Sep 2008, 01:56:49
ah-ha...

"fly" was catching the selects... by breaking it up and then setPos, it takes the variables into account.

thanks

 :D