Home   Help Search Login Register  

Author Topic: Set pos  (Read 440 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Set pos
« on: 04 Dec 2004, 20:03:36 »
how do u make a units set pos in increments.

so like say i had a unit but i wanted it to sepos 2m to the right of a man

how do i do that.
thanks

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Set pos
« Reply #1 on: 04 Dec 2004, 20:57:54 »
You use getpos to do this eg:

Man1 SetPos [getpos Man2 select 0, getpos Man2 select 1, getpos Man2 select 2]

There may be dashes before the select I can't remember. Anyway you can add and subtact values from each coordinate eg

getpos Man2 select 0 + 2

(Puts Man1 2 metres East of Man2)

getpos Man2 select 2 + 2

(Puts Man2 2 metres above Man1)

This can also be put in a script and put in a loop so you can stay at a relative position even if the object changes location. You can therefore strap yourself to a plane or car or do many other cool things like that.

I'm not positive about the syntax but that is the general idea behind it.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Set pos
« Reply #2 on: 04 Dec 2004, 21:18:43 »
This is suddenly a topical subject.  Check this out:
http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=20702