View Single Post
06/11/19, 05:25 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
You can use the RedirectTexture function to exchange a texture globally. Each map uses several tiles, so you would need to find the path and count for them and then redirect each one to use the files in your addon:
Lua Code:
  1. local function ReplaceMapTextures(mapId, customTilePathTemplate)
  2.     local numX, numY = GetMapNumTilesForMapId(mapId)
  3.     local totalTiles = numX * numY
  4.     for i = 1, totalTiles do
  5.         RedirectTexture(GetMapTileTextureForMapId(mapId, i), customTilePathTemplate:format(i))
  6.     end
  7. end

You can find the map id with "/script d(GetCurrentMapId())" while looking at the map you wish to replace.
The customTilePathTemplate should look like something like that: "MyAddon/path/to/map/maptile_%d.dds".
Then you'd just store the edited tiles in the specified subfolder with names starting from maptile_1.dds.

The hardest part is to get the map textures out of the game files. You can use esoextract for that.
  Reply With Quote