|
I already introduced the new GETSTARTPOSES command in the How to get starting poses page. It uses Player Starts and allows to query the map for all the available starting positions before spawning any robot.
As we want to improve spawning precision (we don't want robots to jump from the ground or fall from the sky when created), we need to have exact Z spawning values for the robots we are using. What we have to do is:
Why we need the Player Starts all at the same Z value? Because the map (the GETSTARTPOSES command) doesn't know what kind of robot we are going to spawn, therefore it can't adjust the Z value to match our needs. The best that it can do is to give us some standard Z value. We can then use that value to find the correct Z spawning value for our robot.
The GETSTARTPOSES command could also be modified to take some parameters, like the robot type for example, but I think it's not a good solution. Robot can change over time, can be added or deleted, we may want to use the same starting positions with different kind of robots etc... That's why, in my opinion, it's better to use some standard Z value.
It's also possible to modify the INIT command so that it accepts Player Starts tag names as locations. But right now I don't have time for that :-( I hope I will return to this solution in the future (or maybe someone else can work on it).
Playing with the editor I discovered that all Player Starts are placed at a standard Z of 47 unreal units, that is 18.8cm. Also, if this value is modified by editing the Player Start position, it is reset to 47 after a map (re)build. In the following movie I'll show you how it's easy to place Player Starts in the map and how to verify their exact location (this is the first time I make a flash video so I hope it will work fine. Just click on it to start):
(Movie Link - Use it to download the movie if needed)
So, we now know how to place Player Starts at Z = 47 unreal units (18.8cm).
Now that we know that the Z value returned by GETSTARTPOSES is always 18.8cm above ground (actually it may vary from 18 to 19 cm because the value is rounded to the nearest cm), it's easy to write the following table (other robots may be added if needed):
Robot |
Position above ground |
Delta Z |
P2AT |
-26 cm |
-7cm |
P2DX |
-20 cm |
-1 cm |
Zerg |
-6 cm |
+13 cm |
Talon |
-13 cm |
+6 cm |
ATRVjr |
-39 cm |
-20 cm |
GETSTARTPOSES returns (these are the real values from the map you have seen in the flash movie):
NFO {StartPoses 4} {Start1 -1.79,0.70,-0.19 0.00,0.00,0.00 Start2 -4.10,0.19,-1.21 0.00,0.00,0.00 Start3 -4.09,-1.79,-1.72 0.00,0.00,0.00 Start4 -0.96,-1.86,-2.24 0.00,0.11,0.51}
If I want to spawn a P2AT at the Start4 position I will use as location:
-0.96,-1.86,-2.31
because Z = (-2.24 -0.07) m. If I want to spawn a Zerg at the same location I will use:
-0.96,-1.86,-2.11
because Z = (-2.24 + 0.13) m.