Home   Help Search Login Register  

Author Topic: add height to created vehicle  (Read 1393 times)

0 Members and 1 Guest are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
add height to created vehicle
« 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
"HOLY SARDINE" - see Shark-Attack meet his match

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: add height to created vehicle
« Reply #1 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.

Offline sharkattack

  • Former Staff
  • ****
Re: add height to created vehicle
« Reply #2 on: 14 May 2009, 20:36:02 »
hi mate

Error returned

type any, expected number


many thanks
"HOLY SARDINE" - see Shark-Attack meet his match

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: add height to created vehicle
« Reply #3 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
« Last Edit: 14 May 2009, 21:44:44 by DeanosBeano »
I love ofp

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re: add height to created vehicle
« Reply #4 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.
Get those missions out there you morons!