Home   Help Search Login Register  

Author Topic: Respawn at certain height?  (Read 1398 times)

0 Members and 1 Guest are viewing this topic.

the_real_ULTIMA

  • Guest
Respawn at certain height?
« 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

Crook

  • Guest
Re:Respawn at certain height?
« Reply #1 on: 11 Feb 2004, 07:52:28 »
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.

the_real_ULTIMA

  • Guest
Re:Respawn at certain height?
« Reply #2 on: 11 Feb 2004, 16:20:51 »
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:

Omaha

  • Guest
Re:Respawn at certain height?
« Reply #3 on: 18 Mar 2004, 21:19:36 »
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)

« Last Edit: 18 Mar 2004, 21:20:40 by Omaha »