Page 1 of 1

Making a Minimap

Posted: 2012-03-21, 16:56
by X21
Hi, Ive been studying the engines documentation for answers but I still cannot figure out how to go about making a circular minimap for players that tracks their location and rotation on any map. Any tips?

Re: Making a Minimap

Posted: 2012-03-21, 21:10
by Haimi
Hi X21,

I think this is not very complicated. you need an image of your map for the Minimap. You need to create a material in the GUI folder of your mod with that image.
You can get the position of your player, so you will only need to write a Method to get the player Positions into your GUI.
The Position is in HumanPlayerT::State.Origin and is an instance of Vector3dT. So you could map the X and Y coordinates to your minimap sizes. Then you create a GUI Window as Minimap-container and as child element a WindowT Element with your minimap-material as background. The minimap-window must be bigger than the container-element. With the coordinates you can set an offset for the inner minimap-window. If you want I can draw you a little Graphic to show you in Detail what I mean.

Re: Making a Minimap

Posted: 2012-03-21, 21:35
by Haimi
So, i have drawn a little example.

You only see the little piece of the Map your Position is currently on. The Rest is hidden because the map's size exceeds the size of the minimap container. The position of the map window is negative (Window positions are always relative to its parents).

Re: Making a Minimap

Posted: 2012-04-02, 19:36
by X21
Ok, I kinda understand what your saying and I kinda don't. So I need to make a GUI Map to represent the top down view of my map right? Then after that I create a small window that shows the mini maps size and from that mini map container it scrolls the larger map background centered off of the players origin(using HumanPlayerT::State.Origin). After making the method and container I should control it using scripting to attach and display it to the player right?
Correct me if im wrong please because im still learning the game engines source code.