[Release] Extra Map Tiles - Add extra map and minimap texture tiles

Extra Map Tiles - Add extra texture tiles to your minimap and pause menu map. :snail:

Intro


At the moment of posting this, you cannot mount the minimap.ymt file that controls the number of texture tiles that make up the pause menu map and minimap, you could just modify and stream the minimap_x_y.ytd and minimap_sea_x_y.ytd files and hope that the map textures for your extra ymaps fit inside the default bounds, leading to your beautiful graphics that you worked on, clipping at the edges.

And for that reason, I created this resource that will allow you to add as many texture tiles as you want to both the pause menu map and the minimap, similar to what modifying the minimap.ymt would do. You’ll still have to design and align the textures yourself, obviously.

Download (Free)


ExtraMapTiles.zip (79.3 KB)

Screenshots


This “Extra tile” texture you see in these screenshots will have to be replaced with your own textures, I just used it to demonstrate the features.

Example of texture not fitting inside the default map texture bounds:

Show

Features


  • Adds extra tiles for custom textures.
  • Extends the pause menu bounds so you can actually look at the textures.
  • Individual configurable texture dictionary and texture name for each tile.
  • Configurable position, alpha, centering and rotation for each tile.
  • Uses GTA 5’s native Scaleform functions.
  • Performant, no infinite loops, just runs once when the client script starts.

Configuration - IMPORTANT, PLEASE READ!


The following section will detail the two available methods to set up the extra map tiles.

Show configuration info

The map tiles have fixed width and height values, represented with in-game units, as seen in minimap.ymt. Inside the config.lua file, you will find a table called extraTiles that controls the properties of each tile. Each entry in this table has mandatory fields and some that are optional and can be omitted.

Currently, there are two possible ways to set up the position of a tile:
(I recommend using method 1)


  1. By using fixed tile offsets.
    The default map is separated into 6 pieces in a 2x3 grid. You can picture it like this:

Each division, on either axis, represents the length and width of one tile, hardcoded to 4500 in-game units. For example, if I want to create a new texture tile that is West of the map but a little bit far away, I could use xOffset = -2 and yOffset = -1. Notice how the anchor point is the top left corner of the extra tile:


  1. By using in-game XY coordinates.
    You can also opt to replace the xOffset and yOffset fields with x and y respectively. This will tell the program to create the tile anchored with the top-left corner at the in-game coordinates of x and y. Let’s take the following setup, for example:
extraTiles = {
    ["tile1"] = {x = 0.0, y = 0.0, txd = "minimap_extra_tile_1", txn = "extra_tile_1", centered = true},
    ["tile2"] = {x = 4500.0, y = 0.0, txd = "minimap_extra_tile_1", txn = "extra_tile_1"},
}

Notice that I didn’t use xOffset and yOffset but x and y. This will create two tiles, one centered at in-game coordinates X=0 and Y=0 and another one with the top-left corner at coordinates X=4500 and Y=0:

The one on the left is centered at position X=0, Y=0 the one on the right has its top-left corner placed at X=4500, Y=0.


Inside the extraTiles table:

  • The keys have to be different, but can be arbitrary.
  • For the tile’s position, you’ll have to chose between using the xOffset and yOffset pair or x and y.
  • txd is the texture dictionary’s name (the .ytd file).
  • txn is the texture’s name inside the dictionary that will be used on that tile.
  • alpha sets the texture’s alpha value and can be omitted (in that case, the default value of 100% will be used).
  • centered is a boolean value that either creates a tile centered in the position when true or anchored in the top-left corner when false. Can be omitted.
  • rotation specifies the clockwise rotation in of the tile relative to its anchor point in degrees. Can be omitted and does not currently work on a tile that also has centered = true.

You can use all of these fields in any combination, for example:

extraTiles = {

    -- 2 tiles in the top left corner of the default map.
    [1] = {xOffset = -1, yOffset = 1, txd = "minimap_extra_tile_1", txn = "extra_tile_1"},
    [2] = {xOffset = -2, yOffset = 1, txd = "minimap_extra_tile_1", txn = "extra_tile_1", alpha = 50},

    -- Another tile in the middle, on the right side of the default map, but rotated 25 degrees clockwise
    [3] = {xOffset = 2, yOffset = 0, txd = "minimap_extra_tile_2", txn = "extra_tile_2", alpha = 70, rotation = 25},

    -- Tiles created using in game coordinates instead of offsets.
    [4] = {x = 0.0, y = 0.0, txd = "minimap_extra_tile_1", txn = "extra_tile_1", centered = true},
    [5] = {x = 4500.0, y = 0.0, txd = "minimap_extra_tile_1", txn = "extra_tile_1"},
}

This will create the following tiles:

If there is something you don’t understand about the configuration, please feel free to ask, I may have not explained it in the best way possible.

Exports


In order to better integrate this resource’s functionalities with your other scripts, I have made available client-sided exports that can be called to do a few different things with the map tiles.

Show exports info

createAllTiles() - Draws all tiles that are configured in config.lua.
deleteAllTiles() - Deletes all tiles that are currently drawn on the screen.
createTile(tileName) - Draws the tile with the name/key tileName.
deleteTile(tileName) - Deletes the tile with the name/key tileName.
extendPauseMenuMapBounds() - Extends the reachable area of the cursor on the pause menu map to reach all currently drawn tiles.
resetPauseMenuMapBounds() - Resets the pause menu map’s bounds to default values.
isTileDrawn(tileName) - Returns a boolean if the tile with name tileName is currently drawn or not.

The tileName value is the key of the tile that you set in the config.lua file.

In Lua, these exports can be called like this (and in a similar way for other languages):

-- For example:
exports.ExtraMapTiles:createAllTiles()
exports.ExtraMapTiles:deleteTile("your tile name")

Performance


  • Resmon 0.00ms at all times since it doesn’t run any infinite loops, code only executes once, when the resource starts

Other mentions


  • Textures should be of aspect ratio 1:1 (square) or else they will be scaled and deformed to fit the 1:1 aspect ratio of a map tile.
  • Was tested on FXserver v6683 with game build 2944.

Acknowledgements


  • Thanks to @manups4e for his research of GTA Scaleforms and for letting me use his MINIMAP_LOADER.gfx file in this release.

Support and bug-reporting.


  • If you require any help, have found a bug with this resource, or have a feature request, either leave a reply in this thread, or in my PMs and as always, feedback is very much appreciated.

Changelog


Show changelog

Version 1.2.0:

  • Added the ability to center, rotate and place a tile using in-game XY coordinates instead of fixed-width tile offsets. See the “Configuration” section for more information.
  • Added centering and rotation as extra configuration fields.

Version 1.1.0:

  • Added exports to functions that allow the creation/deletion of tiles on the fly as well as other functions. See the exports section for more info.
  • Refactored some parts of the code.

Version 1.0.0:

  • Initial release.
Code is accessible Yes
Subscription-based No
Lines (approximately) 304
Requirements None
Support Yes
27 Likes

Amazing job!! :heart:

1 Like

interested

1 Like

I can’t thank you enough for this mod.

Because of it, I spent 6 hours tonight configuring images in photoshop.

Because of this mod, I now have Cayo Perico rendered on the map as well as the Venturas project and I was able to supply that community with your link to this post and the ytd’s necessary to finally have a map. Thank you.

Sometimes its the little things.

3 Likes

Damn, thanks for the kind words, and I agree, sometimes it’s just about little things like this. I’ve been waiting for a long time for something like this and now I had the opportunity to make it myself. Mind sharing a screenshot? I’m curious how it looks. :wink:

Hero!

Ive been bouncing between the las venturas discord and the roxwood discord, trying to find solutions for the map - but because they were all gfx files, it was stuck in a rock and hardplace. Thank you for making this!

1 Like

Thanks, glad you enjoy it.


The Cayo Perico is from this single player mod:Atlas / Colored Map with Radar for Cayo Perico Map Add-on (both locations) - GTA5-Mods.com
and Las Venturas is from this project: https://las-venturas.com/

1 Like

Nice.

Will this fix Interior GFX’s aswell or no?

What do you mean by “fix”?

Awesome, thank you!

Is there a possibility of switching tiles at the runtime? Similar way iz does for MLOs, but for exteriors? My KotH server has various custom maps, so being able to switch minimaps would be very handy.

1 Like

Yes, adding and removing tiles can be done at runtime, but only for the extra ones you create, not the default 6 GTA tiles. I will update soon, maybe today or tomorrow and let you know.

1 Like

I have posted an updated version that includes exported functions that you can use to dynamically draw and delete tiles, check out the Exports section. Please let me know if you encounter any bugs.

1 Like

Is there any way to get the x and y values exactly?

As in get the XY coordinates of each tile?

nono, I mean is there any way to configure xOffset and yOffset more easily and quickly?

Yes there might be. I’ll get back to you with an update.

I have updated the resource, making it possible to create tiles using in-game XY coordinates, check the configuration section for more information.

TL;DR: replace xOffset and yOffset with x and y respectively, these represent in-game coords.

1 Like

is there any way to load the tile only if you are in certain map? i have few maps in z axis and if i set all the tiles in the same place they will be cliping. How can i load only 1?