OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 01 Jan 2006, 17:20:00

Title: Raising a setpos'ed object
Post by: greg147 on 01 Jan 2006, 17:20:00
Hi all,

I've got a building that I have setpos'ed from one place to the other, however I can't seem to raise it up or down.

When I try putting 'building1 setpos [(GetPos this select 0), (GetPos this select 1), 5]' I get an error saying 'building1 setpos [(GetPos this select|#| 0), (GetPos this select 1), 5]': Error getpos: Type Bool, expected object

I don't know if this is the right command, or weither I'm just using it wrong for this

Can anyone help?  :P

Thanks
Title: Re:Raising a setpos'ed object
Post by: Baddo on 01 Jan 2006, 17:44:07
Your script line seems to work fine if I put it to the initialization field of the building and replace building1 with this.

But I suspect you are doing this in a script file. And I bet you are not using this correctly... where did you put that code, and what is this?
Title: Re:Raising a setpos'ed object
Post by: greg147 on 01 Jan 2006, 18:29:55
Currently, my script file goes:

Code: [Select]
building1 setpos getpos building2

deletevehicle building2

building1 setpos [(GetPos this select 0), (GetPos this select 1), 5]

exit

The first two lines work fine, but the building that is put in its place is under the ground, with only its roof showing.

When I tried putting the line in a trigger and activating it, the building was transported to an area on the other side of the map.
Title: Re:Raising a setpos'ed object
Post by: Pilot on 01 Jan 2006, 18:53:44
To raise the building up and down, you will need to do this:
building1 setpos [(GetPos building1 select 0), (GetPos building1 select 1), 5]

-Pilot
Title: Re:Raising a setpos'ed object
Post by: Planck on 01 Jan 2006, 19:06:29
Hehehehe.........

Try this instead:

Code: [Select]
bpos = getPos building2

deletevehicle building2

building1 setpos bpos


Planck
Title: Re:Raising a setpos'ed object
Post by: greg147 on 01 Jan 2006, 19:14:26
Thanks guys, got it working  ;D