Making a Map - Electric131/Sandustry-CustomMapLoader GitHub Wiki
This page is up to date as of v4.1.3
Making a Map
This guide covers what you'll need to know in order to make a map.
What is a map?
A map, in the context of this mod, is a mod that also contains the pngs the game uses to load the map, as well as some extra files such as metadata.
Creating your map folder
To start, you'll want to either use another mod from the Fluxloader, or use the "Create Mod" button in the UI.
Once you've created a mod for you map, you'll want to find the modinfo.json file and be sure to add the map tag, as well as the CML version dependency. Hint: You'll likely want to use ^x.x.x with whatever CML version you used when creating the map! You'll need to update your map if the CML ever has a major version change (breaking changes!), even if your mod isn't affected by it.
If you need help setting up the basic mod structure, you can look at other mods or ask in the modding chat on the discord.
Once you have a basic mod template, you can check out the following pages for information on creating your map:
Uploading your map
Ensure your map modinfo.json file has the map tag (otherwise the CML won't recognize it) and has the CML marked as a dependency.
Also ensure any other mods you used are marked as dependencies in the same way. corelib should already be included for you since the CML requires it, but it's not a bad idea to go ahead and add it if you end up using corelib features.
Once you've ensured your map is tagged correctly, make sure to try to load in in game to make sure you didn't miss anything.
After you're sure everything is correct, zip up your entire mod folder (all the contents of your mod's folder) and upload it to the Fluxloader website
Your map should then be available for others to download and play for themselves!
Map Making Tips and Tricks
Finding player Y
Manual Method: Fly around then run fluxloaderAPI.gameInstance.state.store.player.y in the console.
Math Method (Using only the map image): Find the pixel y in your map image, then calculate: ([pixel y]) * 4) - 30 (Note this formula gives the y of the player if they are standing on this pixel)
Creating the fog in fog_playtest.png
To avoid doing work by hand, you can look into my other project Sandustry Light Spreader which generates the fog texture from map_blueprint_playtest.png.