Jump to content

How to Create Lootable Maps

Recommended Posts

Download and install CartoZed from here:



Follow the instructions in the above thread to create a top down image of your map mod (or any map mod), I created a copy of and renamed the default theme and removed all the trees, vegetation and walls options within to create the look I wanted for my map. Try it yourself, create a new theme and add/remove or edit different options to create different looks.


Next, create the following file structure (if you are adding the lootable map to your own map mod then create all folders within the media folder below in your map mods media folder instead):







Once you have finished editing your lootable map image you extracted using CartoZed (I simply copy and pasted one of the keys from one of the official lootable maps found in "steamapps\common\ProjectZomboid\media\ui\LootableMaps" and then area filled each building the corresponding colour) save it in your LootbaleMaps folder as a png file with a name like "MyLootableMap" or "FictitiousTownMap" etc.


Next up create a .txt file in the scripts folder called something like "mylootablemap" (except make it more unique to avoid any possible compatability issues with other mods that might use the same names), it should include this code:



module Base
    item MyLootableMap
        Type    =   Normal,
        DisplayName   =      Your map name here,
        Icon    =   Map,
        Weight    =   0.1,
        Map                 =           media/ui/LootableMaps/MyLootableMap.png,



The above code is adding a new item with the internal name "MyLootableMap" (so again make sure your's is something unique) into the vanilla pool of items, the above settings work for maps, just make sure the "Map = " line is pointed to your lootable map png.


The last file you need you will want to create in the "media\lua\server\Items" folder, call it something like MyLootableMapDistribution.lua but again make it's a unique name to avoid any possible mod imcompatability with other mods. It should contain the following code:



require 'Items/SuburbsDistributions'

table.insert(SuburbsDistributions["fossoil"]["shelvesmag"].items, "Base.MyLootableMap");
table.insert(SuburbsDistributions["fossoil"]["shelvesmag"].items, 2);

table.insert(SuburbsDistributions["all"]["shelvesmag"].items, "Base.MyLootableMap");
table.insert(SuburbsDistributions["all"]["shelvesmag"].items, 0.5);


In the above code you can see that we are adding our new Item "MyLootableMap" into the "shelvesmag" containers within the "fossoil" and "all" room definitions. The numbers 2 and 0.5 govern the likelihood of a map spawning in said containers, higher being more likely. To find the current room and container definitions, navigate to your "steamapps\common\ProjectZomboid\media\lua\server\Items" folder and open the Distributions.lua file.


And that's it, copy your entire folder structure into your "C:\Users\YourUserNameHere\Zomboid\Mods" folder, load up the game, enable the mod (Your map mod if you made your lootable maps as part of a map mod) and start a new game, you now have your lootable map in game and waiting for you to find.

If you need a working example you can always subscribe to Bedford Falls on Steam and check it's workshop folder "steamapps\workshop\content\108600\522891356" . It's handy to verify your folder/file structure etc if you're having problems.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...