OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gundernak on 01 Nov 2003, 18:18:22

Title: how to setPos a sodier to a watchtower?
Post by: gundernak on 01 Nov 2003, 18:18:22
Hi all,

I would like to setPos a sodier to a watchtower.

Please help me in the syntax and what command to use in the soldier's init field or in a script made for achieve this.

Thanks in advance

Title: Re:how to setPos a sodier to a watchtower?
Post by: mikeb on 01 Nov 2003, 18:25:13
place him directly over the tower and put the following in the init line:

this setpos [(getpos this select 0), (getpos this select 1), (getpos this select 2) + 3]

the + 3 puts him 3m in the air.  experiment with this value until you get him where you want.  you may also want to put:

 this setunitpos "up"

This prevents him from going prone while in the tower
Title: Re:how to setPos a sodier to a watchtower?
Post by: GrimMonkey on 01 Nov 2003, 18:31:36
I haven't tried that mikeb,

What I use is:
Code: [Select]
This SetPos [Getpos This Select 0, GetPos This Select 1, x]x being the variable height.

Or you could select 'Flying' in the 'Special' menu of the unit

And as mikeb said:
Code: [Select]
This SetUnitPos "Up"

Beware the GrimMonkey
Title: Re:how to setPos a sodier to a watchtower?
Post by: gundernak on 01 Nov 2003, 18:43:50
Thanks mikeb!!!

It was pefect....and working

GrimMonkey,

I think the '...select ) + 3' is always exactly the height of the coordinates

anyway thank you Gentlemen
Title: Re:how to setPos a sodier to a watchtower?
Post by: mikeb on 02 Nov 2003, 15:00:36
what grimmonkey said will work just as well with a little less text.  my line put the unit up 3m relative to where he starts .  seeing as the ground units always start at 0m (ground level) anyway, you can leave the last "select" bit out and put in a staright number value.
Title: Re:how to setPos a sodier to a watchtower?
Post by: _hammy_ on 02 Nov 2003, 15:40:55
solve topic then?
Title: Re:how to setPos a sodier to a watchtower?
Post by: sabreblade on 02 Nov 2003, 19:41:28
lol thx guys you helped me out too  :)
Title: Re:how to setPos a sodier to a watchtower?
Post by: gundernak on 02 Nov 2003, 21:54:32
thanks all,

I left this topic open to be able to reply or add something else...

definetely we can close
 ;)