Game Development Community

World coordinates

by DejaBlue · in Torque Game Engine · 12/01/2005 (7:23 am) · 2 replies

Been looking around on GG for a resource for world coordinates. what i am trying to achive is to get players X, Y location into a numeric type number. for example as you move might be x 35 y 56. what i am trying to do by end of this is to have a location with my Overhead Map showing in text our location and updates as we move.

anyone happen to be able to help out, it would be very appreciated.

#1
12/01/2005 (8:25 am)
Try putting this in your game.cs file

// This should be the last line in createPlayer:
$myPlayer = %this.player;

// This function can go anywhere in game.cs
function printPlayerPosition()
{
%pos = $myPlayer.getTransform();
%x = getWord(%pos, 0);
%y = getWord(%pos, 1);
%z = getWord(%pos, 2);
echo("Player Pos: x=" @ %x @ " y=" @ %y @ " z=" @ %z);
}
#2
12/01/2005 (9:03 am)
Wow Works great thank you