Extra Map Tiles - Add extra texture tiles to your minimap and pause menu map.
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:
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)
- 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:
- By using in-game XY coordinates.
You can also opt to replace thexOffset
andyOffset
fields withx
andy
respectively. This will tell the program to create the tile anchored with the top-left corner at the in-game coordinates ofx
andy
. 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
andyOffset
pair orx
andy
. 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 hascentered = 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 |