Soaponarope wrote:A way to disable sections of map while leaving the rest on would be great. I don't want to force players to play old school but have ideas for puzzles which the automap spoils badly.
Perhaps a new feature to have a mapping layer that simply works like the reflection or noise layer's on and off states. Any highlighted tiles in the layer would then not show on automap while the rest would.
You can use the MapGraphicsComponent to do this.
I've made a 2-level test dungeon where the entire automap in the lower level is overlayed by an image.
http://www.nexusmods.com/legendofgrimrock2/mods/86
You can adapt it to overlay only part of the automap on a particular level.
1) Define this object:
Code: Select all
defineObject{
name = "automap_replacement",
components = {
{
class = "MapGraphics",
image = "mod_assets/textures/automap_replacement.dds", -- 960x960 (= 30x30 for each automap tile)
--rotate = true,
--offset0 = vec(0, 0),
--offset1 = vec(0, 0),
--offset2 = vec(0, 0),
--offset3 = vec(0, 0),
},
},
placement = "floor",
editorIcon = 276,
}
Then put an automap_replacement at 0/0 in the level where you want the automap to be overlayed.
(if you want, you can define more than one object like this, so every level can have its own overlay image)
The .dds file was made with Gimp:
File -> Create -> Patterns -> Flatland
2) At every entrance to the level, put a floor trigger connected to this function inside a script entity:
Code: Select all
visited = {}
function setVisited()
if (visited[party.level] == nil) then
local party_x = party.x
local party_y = party.y
for x = 0, 31 do
for y = 0, 31 do
party:setPosition(x, y, party.facing, party.elevation, party.level)
end
end
visited[party.level] = true
party:setPosition(party_x, party_y, party.facing, party.elevation, party.level)
end
end
The function setVisited() teleports the party to every square on the current map => every tile in the automap is marked as visited.
(there's a short delay while the function runs, but it's hardly noticeable even on my old computer)
Result: the entire automap is overlayed with automap_replacement.dds as soon as you enter the level.
Otherwise, you'd be able to see paths on the automap when you explore the level.
You can still see your position and put markers on the automap.
This method could also be used to replace the automap with a hand-drawn map.
The hand-drawn map could be enabled/disabled depending on whether the party is carrying a map scroll.