Project Zomboid

Project Zomboid

61 ratings
Spawn Map-Objects Utility
   
Award
Favorite
Favorited
Unfavorite
Tags: Mod
File Size
Posted
Updated
7.047 MB
Jul 13, 2017 @ 2:16am
Jul 13, 2017 @ 3:34pm
2 Change Notes ( view )

Subscribe to download
Spawn Map-Objects Utility

Description
Spawn Map-Objects Utility - Enhance maps



What is this mod ?

While I was working with the map editor, I got frustrated some items could not be placed using it. For instance, barricades and campfires. So we decided with a friend to solve this problem... Once done we decided to make this mod and make it as generic as possible ! This should allow any mapper to use our object-spawning system to make better maps and any modder to upgrade it with ease.

I'm a player, what do I need to know or do ?

Nothing. This mod should be a dependency mod for any map that uses the Spawn Map-Objects Utility. One you have this mod installed, it should work without needing you to do anything.

I'm a mapper, what is this mod doing precisely and how does it works ?

Tell me more about it !

This mod will allow you to place items events within the map editor like campfire, tents, wall frames, zombies... Those placeholders will be converted into their working version inside the map once loaded. This means you will be able to place pick-up-able tents, light-able campfires, thumpables wooden and metal structures, break windows, spawn zombies at precise places and even more !

Interesting... So how do I use it ?

The installation is very simple, once you have subscribed and download this mod, locate it's installation folder :

\Steam_Installation_Folder\steamapps\workshop\content\108600\974718243\mods\SpawnMapObjectsUtil

Once inside the mod folder, you should see a Tiles folder. Open it, and then open the 2x folder. You should see all the placeholders images you will need.

Copy all these .png files to the 2x folder of your Tilezed.

Now, you should be able to use the placeholders via the tilset list. I usually place those on the Furniture layer but it should work on other layers too.



If you want to test the features, check out the building we are using for internal testing : https://rbfi.io/dl.php?key=/0Sol/testmap.tbx

Once your map is finished and you are ready to publish it to the workshop make sure to add this mod to the dependencies of your map. So that it will be prompted to the players to install it with your map.

Great, but before I install it, can you showcase some features ?

Of course, here is the list of what you can do with the current version of Spawn Map-Objects Utility.
  • Place thumpable walls of all possible quality with adjusted durability (Logs, wood, metal).
  • Place fences adjusted durability too (Sandbags, wood, metal plates or bars).
  • Place thumpables and working-properly barricades on windows (1,2,3 or four planks, metal sheet, metal bars)
  • Place upgradable by player walls frames.
  • Place weapons, literature, trash and food items on the floor.
  • Place properly-interactable camping materials (tents, campfires and compost)
  • Zombies-spawner at specific places (Horde inside a tower away from the city or a lone zombie in a specific room...)
  • Add water collecting barrels already full of water
  • Place fishing-nets on your lake or generators in a specific room
  • Break specific windows on the map (with them still barricadable and full of dangerous shards).
  • Break and remove glass from windows and keep it barricadeable
  • Place sheetropes on windows.

We also plan to add more to this list with upcoming updates, things like traps, sound events and such.

What are those red tiles on your placeholders images ?

As said earlier, we are planning to add more tiles to the placeholders. You can use the blue ones, but if you try to place a red one, it won't work. The red tiles are the not-implemented-yet features. But we kept it so that it will be easier to update once done.

Please do not use the red placeholder tiles.

I'm a modder, you said I could expand your utility ?

Even more ! We made functions for you to easily add your own placeholders or remove the default placeholders shipped with the mod. Let me explain.

Create your custom placeholder

Once you have created the png of your custom new placeholder, you will need to code the replacement function in lua. To do it, you can write your lua file using this template :
require "WorldManager/SpawnFromPlaceholder"; MyPlaceholder = {}; MyPlaceholder.replace = function(square, tileObject) -- Your code goes here -- indicate that the method has worked properly -- and the placeholder tile can be removed return true; end -- register and identify the placeholder in the system SpawnFromPlaceholder.Add({ name = "MyPlaceholder" });

Here are the explanations :

First, you need to implement the method MyPlaceholder.replace(square, tileObject) which will be called for each object found in each square loaded.
This method need to return a Boolean (true or false) to indicate if the method has worked.
If the method return true the program will automatically delete the tile placeholder else it does nothing.
Be careful of the optimisation of this method because it will be called a large number of times and may produce lag. To avoid bad performances, you should not log messages inside the console (do not forget to remove them after use if you do). Also, make sure tile you are currently checking matches your placeholder name unsing the startString method before doing anything complex.

The second step is to register your placeholder in the system with the method SpawnFromPlaceholder.Add(placeholderInfoObj).
The parameter expect one important property :
  • name : the name of your object which contains at least the method replace()

Remove default placeholders

This mod allow you to remove unused shipped placeholders to save resources and gain performance.
To remove the placeholders, you can use this snippet :
require "WorldManager/SpawnFromPlaceholder"; SpawnFromPlaceholder.Remove({ "WallsPlaceholder", "ZombiePlaceholder", "..." });

The method will remove the placeholders listed in the array when the event OnGameStart is fired.

Shipped placeholders list
  • BarricadePlaceholder
  • CampingCompostPlaceholder (campfire, tent and compost)
  • CarpentryAndConstructedPlaceholder (sandbag, barrel, rain collector, lamp)
  • DroppedFoodItemsPlaceholder
  • DroppedTrashItemsPlaceholder
  • DroppedWeaponsItemsPlaceholder
  • GeneratorPlaceholder
  • TrapsPlaceholder
  • WallsPlaceholder
  • WindowStuffPlaceholder (smash clean window, sheet rope)
  • ZombiePlaceholder

Workshop ID: 974718243
Mod ID: SpawnMapObjectsUtil
15 Comments
Haek Dec 18, 2023 @ 10:15am 
Can you spawn items on the floor with this?
cameronwilletts Jun 16, 2023 @ 9:43am 
Hey @Onkeen
I understand this mod is old af but I downloaded it today as it looks like it'll do exactly what I need.
I followed the instructions and happily placed all my zombie placeholders, but when I loaded up the map in game instead of zombies, I found the same placeholder image I'd placed in the building editor. Is this me misunderstanding the mod and how to use it or is it instead just too outdated to work?
Any help is appreciated!
Deon ☣ Jan 6, 2022 @ 4:32am 
Aha, so you are saying that I need to make my own mod, and then find a way to trigger this function? Correct? Sorry for turning your discussion into a troubleshooting forum :D.

I've just started modding and so far I've only managed to correct LUA errors and recipes in existing mods, and I lack the global picture.

If I understood you correctly, I will go ahead and try to find a mod that adds new functions, and I will implement your method.

Thank you for being helpful!
Onkeen  [author] Jan 6, 2022 @ 4:24am 
@Deon basically, if you have the square your item is supposed to be, you need to do as following:
https://pastebin.com/MyJPciJX

This example is for a fishing net, for your case you will have to customize this to match your needs in terms of objetcs etc. Note that this approach, like this mod, is pre-b41. It should work but I cannot guarantee it!

Good luck with what you want to do :)
Deon ☣ Jan 6, 2022 @ 12:45am 
@Tirpitz Zomboid modding tools can be found in TOOLS section of your Steam library.
The tutorial was linked by Onkeen below:
https://theindiestone.com/forums/index.php?/topic/21951-the-one-stop-tilezed-mapping-shop/
Deon ☣ Jan 6, 2022 @ 12:44am 
Hello, Onkeen. You are my only hope :).

I was using the Tireks' propane refill mod (which places propane double-tile objects all over the map), and found a place where one piece of propane tank object is missing.

My goal - to place an object on a tile in existing world. I know object ID.

I couldnt find a way to place an object on a tile in Debug mode, or remove the broken piece.

Looking at your mod, it's about mapping, not in-game placement.

Would you be able to give me an advice in which direction to look to figure out how to fix/remove objects on existing map, if possible at all?

Thank you!
Tirpitz Jul 16, 2018 @ 9:39am 
How to use/find the map editor?
Lord-Xanthor Dec 17, 2017 @ 5:35am 
Thanks. I was actually there and found out some art was never finished. Also found art that was meant for some new system where things grew? As for the park art, I actually fixed that, and the sections in red, fixed that as well. Was able to use buildings that could not be used in ages due to the missing art. I plan uploading on that website, after I finish the touchups.
Onkeen  [author] Dec 17, 2017 @ 3:55am 
It sure looks like the mapping tool is missing some tiles, I think you need to make sure all your tiles are in the right folder. But I never encontered this kind of issue though. You could also try going to the official IndieStone forum / official Zomboid discord channel, both feature sections / channel where someone could help you with that.
Lord-Xanthor Dec 13, 2017 @ 10:13am 
@ Onkeen. Deleted previouse comment as it was lame anyway and served no purpose lol. Ok, I'm having a fair idea you might know what's causing this even though it's not your mod. I'm making a map and was placing houses and large buildings when I noticed two of them had sections with question marks, like half a swingset in the park section. I was about to replace the set with something else, when I decided to check in Tiles section, and low and behold, I pound the park art, with everything on it. For some reason, parts of it are not loading in. Any chance know what I need to fix or look at to get them loading in again?