Ha!


^ Native World maps in mods! Any graphics can be used, which is pretty nice.
Didn't even know the map screen has a hidden editor feature, that was a nice surprise.
Adding suport for this at the current state was just commenting out a line that blocks mods from opening the world map, and redirect map file saving to the mods directory if in a mod -- about 10 lines changed/added.
However, this depends a lot on the changes I already made, and couldn't be easily added to the icculus repo at this point (without throwing the other changes in as well).
It's still a bit wacky when it comes to positioning the Naija icon, but besides that, seems to work well.
I just totally don't understand how the zoom factor plays together with the exploration box size and other things on the map. This is
really weird and needs digging.
So, any mod developers interested in this?
EDIT:
^ Naija icon world map positioning done right, figured out how it works.

-- the calculations are really weird.
EDIT2:Uploaded new build, link is now in my sig.
A bit of backgrond info about the world map editor:
Open world map and press TAB to enter editor mode.
Alt+Up/Down: Change
scaleShift+Up/Down: Change
scale2Only Up/Down/Left/Right: Move map part around
Press Ctrl to increase scale/move speed.
Press F2 in edit mode to save to data/worldmap.txt. (There is no indication that it saved, but if you have a loud harddisk you may hear it rattling a bit)
When editing a mod, it will save to its own directory instead.
Looking at the Naija map icon,
scale causes the map part to expand, but the naija icon to move inwards.
Scale2 makes both move outwards uniformly.
A
scale factor of exactly 4 and
scale2 of about 1-2 seem good values to me.
Looking at data/worldmap.txt, the columns mean the following:
index | map name (string# in stringbank.txt) | image name | layer | scale | gridX | gridY | pre-revealed | scale2
image name: the files from
gfx/gui/worldmap/*.png but without extension.
layer: 0 mostly for open maps, 1 for caves. I think 0 is drawn first, then 1, ...
pre-revealed: used for the start maps -- when you start a new game, you can already see home waters although you haven't been there, for example.
Now, how to add a working world map to mods?In your mod root dir, make a
data folder, and create your initial worldmap.txt there.
gridX, gridY, scale and scale2 do not matter, as this can be set from the in-game editor. Just use 0 for the positions, 4 for scale, and 1 for scale2, as a start.
Mine looks like this (which i used for the screenshots):
0 1020 FINGERS 0 4.00162 -143.229 -253.862 1 1.35383
1 1020 BIGCAVE 0 4.00281 187.976 -190.119 1 1.23479
2 1020 TOP 0 4.00241 149.129 119.555 1 1.18679
3 1020 NAIJA 0 4.00102 527.481 -234.625 1 1.12416
Then, take your map template PNGs, copy them into a
gfx/gui/worldmap directory in your mod's root dir, and change all the black to fully transparent. Save the map as 256x256 PNG.
Load up your mod, open the world map, and start moving the tiles into the right position, with the right scale. To select another tile, leave the editor mode for a sec, select the new tile, and enter editor again. Can't select another tile while the editor is on.
Later addition:
Don't forget to hit F2 in edit mode when done! (You have to be in edit mode, else it won't work. Also added a little overlay text to indicate it saved in the newer builds)To properly init the Naija map gem, place the following script into your mod's scripts/maps/map_YOURFIRSTMAP.lua (yep, that version supports map_* and premap_* - scripts):
if not v then v = {} end
function init()
-- just use anything here to prevent the gem beeing added twice.
-- should be run on first init only.
-- refer to map_naijacave.lua, near end of the file.
if isStory(0) then
pickupGem("Naija-Token", 1)
setStory(1)
end
end
I have updated my editor test mod with these changes. Re-download if you want to check it out.
For those preferring a direct mod .zip:
There you go.
Note that it requires the build linked in my sig. On older versions this won't work at all.