Jump to content

Items Spawn on the Floor - Mod & Tool for Modders


nolanri

Recommended Posts

Is there a full time Janitor working during the apocalypse? No ? Then why is the floor so clean? 

This mod makes items spawn on the ground / floor. Not just any random item anywhere. Based on your location, building or room you are in predictable items may spawn on the floor.

There are many different room types in PZ and I have not yet made item spawn definitions for all the different types of rooms yet. 

If you have a good idea about what item(s) should spawn on the floor in certain areas, leave a note.

 

http://undeniable.info/pz/ItemsSpawnOnFloor.php

 

 

ATTENTION MODDERS!

 

if you would like to have the items in your mod spawn on the floor feel free to use this mod tool!  It is especially made so that it can be used in multiple mods and still work.

 

Take the 2 attached files and place in your LUA/Server/ folder.  Do not edit the FloorLoading.lua file. But open the FloorLoading_Definitions.lua file which is where you can define what items spawn where at what rate.

 

in the FloorLoading_Definitions.lua file you will see many table.insert lines. These are what you need to edit.  For example:

table.insert(Area["Forest"], "Base.Twigs/15");

means that Base.Twigs will spawn in Forest areas with a spawn rate of 15 out of 10,000 tiles.  Which means when walking through the forest you are likely to see a hand full of Twigs on your screen at any given time when walking through the woods. 

So if I wanted to change make the Lazor Guns in my Lazor Guns mod spawn on every tile in the Bathrooms, I would change it like this:

table.insert(Area["bathroom"], "LazorGunsMod.LazorGun/10000");

 

Above each area/rooms lise of item spawn definitions you will see an array declaration eg.

if Area["Forest"] == nil then Area["Forest"] = {}; end

Do not remove this, and if you need to add definitions for an area not already add this array declaration above your item definitons like all the other rooms/areas in the file have.

 

After you have added your item definitions for your mod you will probably want to remove the rest of the Base. definitions that are in this file or you will just increase the spawn rate for these Base. items assuming the player is already using this base version of this mod.

 

FloorLoading.lua

FloorLoading_Definitions.lua

Edited by nolanri
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...