OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: sharkattack on 14 May 2009, 19:35:51

Title: add height to created vehicle
Post by: sharkattack on 14 May 2009, 19:35:51
guys im  trying to create a bomb blast at a position of a truck
this works fine

bomb = "Bo_GBU12_lgb" createvehicle getpos truckplayer

however id like to raise the blast a few meters from the truck ... 
what would be the best way to do this

many thanks in advance
Title: Re: add height to created vehicle
Post by: bedges on 14 May 2009, 19:58:43
Code: [Select]
bomb = "Bo_GBU12_lgb" createvehicle [getpos truckplayer select 0, getpos truckplayer select 1, (getpos truckplayer select 2 + x)]
where x is the number of metres above the truck the "boom" should go.
Title: Re: add height to created vehicle
Post by: sharkattack on 14 May 2009, 20:36:02
hi mate

Error returned

type any, expected number


many thanks
Title: Re: add height to created vehicle
Post by: DeanosBeano on 14 May 2009, 21:28:42
 try this  untested ,

 bomb = "Bo_GBU12_lgb"  createvehicle ( truckplayer modeltoworld [0,0,4]) 

 i presume your truck is named truckplayer in editor ?

 adjust the first zero  , positive number for west , negative for east

 adjust the first zero  , positive number for south , negative for north

 adjust the 4 for more height 

 this wont change the blast height , for that you will need to collide your bomb with another object before it hist the truck .i am sure mandoble made a thread about that many moons ago.

 good luck

 DB
Title: Re: add height to created vehicle
Post by: MachoMan on 15 May 2009, 13:24:47
You need to do what bedges said, except change:

Code: [Select]
(getpos truckplayer select 2 + x)

into:

Code: [Select]
(getpos truckplayer select 2) + x

What bedges typed makes the scripting engine try to select (2+x), since + has a higher precedence than select.