Page 1 of 1
Coordinate information in an Unreal Map
Posted: Tue Jan 27, 2009 4:15 am
by Cyan_phoenix
Hi Everyone,
I'm currently working on a project on topographical memory (i.e. knowing your way around environments) and thought that the Unreal Editor would come in handy for this.
I was wondering if anyone knew a way to find out coordinate information of where a player is in an unreal map? What I mean by this is, say i create a large rectangular room using the UnrealEditor, I want to know the players coordinates (i.e. how far away they are from an object in the room). Is there a simple command that is needed to get such information or will i need a mod of some kind?
Any help would be greatly appreciated.
(I apologise if this question is in the wrong section. I wasn't sure whether to put it in the UnrealEd forum, the Mod forum or the general unreal forum).
Re: Coordinate information in an Unreal Map
Posted: Tue Jan 27, 2009 5:10 am
by Bane
in Ued, there's the Location field. I believe it's under 'Movement' in the object properties. If you want to get the location of a random point in space, move the camera over it and get it's location from one of the 2D views (I don't think there's a way to just see a random location's point in space, anyways...) You can't get the scalar distance between two objects automatically, so you'll have to use the distance formula between 2 3d vectors to convert it to a scalar.
If you want to get your position in game, go into window mode and type "editactor class=playerpawn" in the console. That should bring up a window like what you'd see when going to object properties. Getting the position of any other object (but not a wall) is possible with the method using something else for class=, but that's trickier and I'd recommend just learning how to make a quick mod if you need to do that.
Re: Coordinate information in an Unreal Map
Posted: Tue Jan 27, 2009 6:52 am
by []KAOS[]Casey
need a mod really. vsize(vecta-vectb) = size in uu{i think}
Re: Coordinate information in an Unreal Map
Posted: Tue Jan 27, 2009 8:00 am
by Cyan_phoenix
that location field option is exactly what I need! Thanks for that!
Does anyone know if it would be possible to modify the game to have that coordinate information pop up on the side of the screen (small enough so the participant wont see the info If i cover a small part of the screen, much like how you can see the 'frames per second' info using that timedemo command)? I've used the editor for quite a few years, but when it comes to modds and programming, i'm a complete newbie..
(I pretty much just need the coordinates of the players current position fairly quickly- the distances they are from objects I can pretty much subtract from their location later).
Re: Coordinate information in an Unreal Map
Posted: Tue Jan 27, 2009 1:59 pm
by GreatEmerald
This is easier:
Though it outputs the locations still only to a console, but it's simpler and takes less space and you can quickly repeat the command.
Re: Coordinate information in an Unreal Map
Posted: Tue Jan 27, 2009 4:20 pm
by Bane
This is easier:
Though it outputs the locations still only to a console, but it's simpler and takes less space and you can quickly repeat the command.
"get" returns the default value for the class, so it will not find the player's current position.
Making a mod to show your current position is very simple. The code, best placed in either console or a weapon, is this
Code: Select all
function postrender(canvas c)
{
super.postrender(c);
c.setpos(200, 200);
//Pick one.
//c.drawtext(owner.location); //weapon
//c.drawtext(viewport.actor.location); //Console
}
There are guides out there to explain what to do with that. Put it in a subclass of either console and modify unreal.ini to use a custom console, or put it under an existing weapon and summon it. Remove the comment (//) from one of the two "c.drawtext" lines.
Or someone with some webspace could just make a .u and host it themselves.
That's incredibly simple code that just shows your position in the top-left corner of the screen, but if that's all you need then that should be fine. If you want to show the distance from something in real time, you'd have to find a way to say what you want to get the distance from, and you'd probably have to learn some UScript to be able to do that.