OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: the_real_ULTIMA on 09 Feb 2004, 21:00:53
-
I have constructed a CTF that sits 100 metres in that air. I am pretty pleased with it up until now, i cant get the infantry to respawn at their original starting height, they do respawn but only 100 feet lower than they should. Ive messed about with the setpos get pos in triggers and so on but still no luck. Any help would be greatly appreciated. Thankyou :P
-
Well bud,
You could probably make a script like this, name it setunitheight.sqs or something:
#Loop
~1
?(Alive _x): Goto "Loop";
~5.2 (change this to whatever your respawn delay is, (ex: respawndelay=15 this should be 15.2))
#setHeight
_x setpos [getpos _x select 0, getpos _x select 1, (getpos _x select 2) +100] (change the '+100' to a height that suites the mission, you will probably have to go through some trial and error)
Goto "Loop"
The Script without the '()' should look like this:
#Loop
~1
?(Alive _x): Goto "Loop"
~5.2
#setHeight
_x setpos [getpos _x select 0, getpos _x select 1, (getpos _x select 2) +100]
Goto "Loop"
If this doesn't do what you want just send me a private message and I'll write you another one ;D Hope everything works out for you.
-
Thanks for your help crook, i think that my problem was that i am using piers to build my map and these along with other objects such as concrete blocks etc can have a strange effect on players and vehicles. I got it to work in the end by placing a respawn and a setpos getpos trigger underneath the part of the map i wanted the players to end up, using .1 metres as the height in the trigger (as using 100 metres would send me 100 metres above the map and not actually on it lol) Thanks again crook! :moon:
-
Here is the easy way.
You can use the following for placing units or objects on a second floor, or perhaps a table. You must write the following line in the Init field of the object or unit you want to relocate to a height.
this setpos [getpos this select 0, getpos this select 1, (getpos this select 2) + 4]
Where 4 is the height value. For every object you need to change the values to see what is the correct height (by trial and error)