OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Knowlife 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 _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:
'_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?
-
Try:
_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"
-
Nope, doesent work. I'm getting:
'_object setpos [getpos _this select|#| 0, getpos _this select 1, (getpos _this select 2) + _height': Error getpos: Type Array, expected Object]
-
[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
-
Yeah! It works, nice....
Thanks