Home   Help Search Login Register  

Author Topic: How to put objects on the roof?  (Read 1014 times)

0 Members and 2 Guests are viewing this topic.

1hHoplite

  • Guest
How to put objects on the roof?
« on: 11 Jun 2006, 00:46:09 »
I'm trying to put a searchlight on a roof of a building. Does anyone know the command for it?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How to put objects on the roof?
« Reply #1 on: 11 Jun 2006, 01:42:45 »
objects have a position which is usually expressed with three values - x, y and z, or east/west, north/south and up/down.

the command to get an object's location is

Code: [Select]
_position = getpos object_name
the object's location will be stored in _position.

to set an object's location, the command is

Code: [Select]
object_name setpos [x, y, z]

so. to make this work in your situation, place the searchlight in the editor as close to where you want it on the building as possible, and give the searchlight a name in its 'name' box. in its init box type

Code: [Select]
this setpos [getpos this select 0, getpos this select 1, 15]
which will put the searchlight 15 metres in the air at its present position. you may need to adjust the 15 to be the right height of the building in question.

1hHoplite

  • Guest
Re: How to put objects on the roof?
« Reply #2 on: 11 Jun 2006, 02:24:25 »
Wow thanks mate! That was exactly what I was looking for!