Home   Help Search Login Register  

Author Topic: setPos (syntax)  (Read 1234 times)

0 Members and 1 Guest are viewing this topic.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
setPos (syntax)
« on: 28 Jun 2007, 17:22:30 »
How do I use the setPos command to place an object X meters in front of or behind the player (i.e not X meters north or south of the players position)?!?
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: setPos (syntax)
« Reply #1 on: 28 Jun 2007, 17:34:47 »
_pos = [X,Y,Z]
_obj setPos (player modelToWorld _pos)

Y > 0 = in front
Y < 0 = behind
X > 0 = to the right
X < 0 = to the left
Z > 0 = above
Z < 0 = below

BUT
that modelToWorld returns only above ground level Zs.

So, for example, you have your player over a mountain, 100m in front of him there is a deep valley and you want to place a bird 100m in front of it. Well, modelToWorld will return a Z at the same ground altitude od the player, that is 0. So the bird will be placed 100m in front of him, but 50m below (for example).


Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: setPos (syntax)
« Reply #2 on: 28 Jun 2007, 19:17:25 »
Thanks. I love these new commands.  :clap:

*solving*
OFPEC | Intel Depot
RETARDED Ooops... Retired!