Home   Help Search Login Register  

Author Topic: Need help to elevate objects in editor  (Read 1198 times)

0 Members and 1 Guest are viewing this topic.

Nephilim2001

  • Guest
Need help to elevate objects in editor
« on: 19 Jun 2003, 04:27:07 »
Hi guys. One question:

I been trying to make objects elevate in editor. An example: I was going to put a 1952's radio addon ontop of a table addon. but when i placed the radio ontop of the table icon in the editor the radio would be placed on the ground under the table. looked kinda silly so i had to leave it alone. is there anyone out there who might have the answer for me?

thank you

Neph

Tactician

  • Guest
Re:Need help to elevate objects in editor
« Reply #1 on: 19 Jun 2003, 06:52:03 »
In the radio's init field:

this setPos [(getPos this select 0),(getPos this select 1),(getPos this select 2) + 2]

And change the 2 until it's at the right height.

What's happening here is that the getPos function is looking at the position of the radio (this) and splitting it into x,y,z coordinates in an array of output.  So getPos radio select 2 returns the z value (height above ground, not sea level).

Nephilim2001

  • Guest
Re:Need help to elevate objects in editor
« Reply #2 on: 19 Jun 2003, 19:47:52 »
Thank you so much for the quick reply Tactician.  The explanation was quite easy to understand. Finally the poor ai dont have to lie down to hear the news lol. Again thank you

Nephilim