Game Development Community

Getting positions????

by Killer Game Studios · in RTS Starter Kit · 04/02/2006 (6:09 am) · 5 replies

Hey guys need some help again,

just want to know if their is a yaw to get the x and y co-ordinates of a character??

i know the %obj.getPosition() call gets the x y and z but it doesnt realy help as i need the thre co-ordinates individualy,

can anyone help???????????

thanks

Ross

#1
04/02/2006 (1:01 pm)
If you mean getting single cordinates of and object you must use the getword() function

If you mean getting the 2d cordinate of the unit on the gui I cant help

GetWord(text string, index);
%string = SetWord(text string, index,substitute value);
#2
04/03/2006 (3:26 am)
Thanks man but just exactly how does this work????

if i have the %player.getPosition(); how do i convert this to its X Y and Z co-ordinates????

thanks man

Ross :)
#3
04/03/2006 (3:40 am)
Thanks man but just exactly how does this work????

if i have the %player.getPosition(); how do i convert this to its X Y and Z co-ordinates????

thanks man

Ross :)
#4
04/03/2006 (4:22 am)
It would go a bit like this
for y coordinate
// Get objects position
%pos = %player.getPosition();

// Y is second in the list
%y = getword(%pos,2);

// Change coordinate
%y=%y + 5;

setword(%pos,2,%y);

%x = getword(%pos,1);
%y = getword(%pos,2);
%z = getword(%pos,3);
#5
04/03/2006 (4:47 am)
Thanks man your a code genious,

thanks man