Home   Help Search Login Register  

Author Topic: Raising a setpos'ed object  (Read 679 times)

0 Members and 2 Guests are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Raising a setpos'ed object
« 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
« Last Edit: 01 Jan 2006, 17:23:11 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:Raising a setpos'ed object
« Reply #1 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?

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Raising a setpos'ed object
« Reply #2 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.
« Last Edit: 01 Jan 2006, 18:30:46 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Pilot

  • Contributing Member
  • **
Re:Raising a setpos'ed object
« Reply #3 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

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Raising a setpos'ed object
« Reply #4 on: 01 Jan 2006, 19:06:29 »
Hehehehe.........

Try this instead:

Code: [Select]
bpos = getPos building2

deletevehicle building2

building1 setpos bpos


Planck
I know a little about a lot, and a lot about a little.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Raising a setpos'ed object
« Reply #5 on: 01 Jan 2006, 19:14:26 »
Thanks guys, got it working  ;D
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB