001 Game Creator

001 Game Creator

Not enough ratings
Game Recipe #12 - Mini Map
By AnvilHouse
In this recipe, we will go through the process of adding a Mini Map display to your game. We will be using an interface with a field set to behave as a Camera View.
   
Award
Favorite
Favorited
Unfavorite
Requirements
  • An interface for your Mini Map
Setup
  1. After opening your project, select Interfaces in the lower left to list your interfaces.
  2. Open your desired interface to create the Mini Map in.
    1. Using the Cam. tool, add a field to the interface.

    2. Position and resize the field however you like.
  3. Using the Timer tool, place a timer on the interface.

    1. Set the Initial Delay to 0 seconds.
    2. Set the Every Delay to 0.1 seconds.
    3. Select the Every Timer Tick trigger and then press the Edit Script button.
      1. Place a Force Focus on Actor event.
        1. Select your Mini Map field for Camera View.
        2. Select (main) for Focused Actor.
        3. Click OK to close the window.
      2. Place a Change Zoom event. Make sure it is the one under the Camera Views category.
        1. Select your Mini Map field for Camera Views.
        2. Copy the following into the Zoom field:Field("Mini Map").SizeX / Map("main").SizeXBe sure to replace the "Mini Map" with the name that you gave to your Mini Map field.
      3. Click OK to close the window.
    4. Click OK to close the script window.
  4. Click OK to close the timer window.
  5. Test out your new Mini Map!
Notes
If you would like your Mini Map to not span the entire map but rather a slightly larger area around the player, then you can simply multiply the expression you copied into the Zoom field by a number greater than 1, like so:
Field("Mini Map").SizeX / Map("main").SizeX * 2