Home   Help Search Login Register  

Author Topic: Hight of objects  (Read 482 times)

0 Members and 1 Guest are viewing this topic.

Knowlife

  • Guest
Hight of objects
« on: 22 Mar 2003, 13:16:45 »
Hey, i'm making a map where i'l put some furniture on the 2nd floor of a bulding. So i write this script:

Hight.sqs  
Code: [Select]
_hight = _this select 0
_this setpos [getpos _this select 0,getpos _this select 1,(getpos _this select 2) + _hight]

And in the init field of a tabel i write: [10] exec "Hight.sqs"
But all i get is this error messenge:

Quote
'_this setpos [getpos _this select|#| 0,getpos _this select 1,(getpos _this select 2) + _hight]': Error getpos: Type Array, expected Object
What am i missing here?
« Last Edit: 22 Mar 2003, 13:17:39 by Knowlife »

R3dF0x

  • Guest
Re:Hight of objects
« Reply #1 on: 22 Mar 2003, 17:15:52 »
Try:

Code: [Select]
_object = _this select 0
_height = **WHATEVER HEIGHT YOU WANT**
_object setpos [getpos _this select 0, getpos _this select 1, (getpos _this select 2) + _height]


[this] exec "Height.sqs"

Knowlife

  • Guest
Re:Hight of objects
« Reply #2 on: 22 Mar 2003, 17:26:27 »
Nope, doesent work. I'm getting:

Quote
'_object setpos [getpos _this select|#| 0, getpos _this select 1, (getpos _this select 2) + _height': Error getpos: Type Array, expected Object]

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Hight of objects
« Reply #3 on: 22 Mar 2003, 21:06:41 »
[this,(getpos this)] exec "height.sqs"

Now you should be able to refer to the object in your script like:

_object = _this select 0

_objpos = _this select 1

_height = **WHATEVER HEIGHT YOU WANT**
_object setpos [(_objpos select 0),(_objpos select 1),(_objpos  select 2) + _height]


Sorry i can't try it out for myself right now to ensure it (i'm at work  :-[ ) but it should work.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Knowlife

  • Guest
Re:Hight of objects
« Reply #4 on: 22 Mar 2003, 23:08:39 »
Yeah! It works, nice....

Thanks