Project Zomboid

Project Zomboid

TchernoLib B41
Tchernobill  [developer] 9 Jun, 2023 @ 7:07pm
Spawn Interface
You can:
Spawn a specific item in a specific container.
Spawn a specific item from a right click + action on a specific square.

Differences with vanilla distribution:
This is (much) more CPU expensive than vanilla distribution.
This ensures one instance of Item to spawn on a specific square.

I advise to use this tool for unique objects and very rare quest objects.
Imagine your own uses.
Last edited by Tchernobill; 9 Jun, 2023 @ 7:37pm
< >
Showing 1-6 of 6 comments
Tchernobill  [developer] 9 Jun, 2023 @ 7:16pm 
Spawn common interface

Add server side
if isClient() then return end require 'SharedPortalTools' require 'Spawner/SSpawn' --args = .. Spawn.addToSpawn(args)

Each spawn function has a specific interface for args as described below.

You can see exemple of use in Portal Gun mod.
Last edited by Tchernobill; 9 Jun, 2023 @ 7:33pm
Tchernobill  [developer] 9 Jun, 2023 @ 7:24pm 
Spawn a specific item in a specific container
What it does
When the defined square is loaded, if there is at least one container available on the square, it will add the item to it.

Definition
args is a table including
x: (float) coordinate Northing
y: (float) coordinate Easting
z: (float) coordinate Up
cItem: (string, FullType) item added to the first container found on the square.
rKey: (string) a unique key to identify your spawn args. this is required to not respawn the cItem on each load of the square.
hItem[optional]: (string, FullType) adds the full type of another item inside the cItem mod data for further use.
respawn: (boolean) if set to true, the cItem will respawn with the vanilla respawn rules defined in the sandbox options (except that the cell must be reloaded for that to work. if you do not know what that means, consider that after the vanilla timer has passed, your character must go 100 squares away from the target square and come back before the respawn occures)

Exemple
args = {x=10652,y=9923,z=0,cItem='Base.CakeIsALie',hItem=Portal.PortGun,rKey='MuldraughBakery'}
Last edited by Tchernobill; 9 Jun, 2023 @ 7:32pm
Tchernobill  [developer] 9 Jun, 2023 @ 7:32pm 
Spawn a specific item from a right click + action on a specific square
What it does
  1. When the defined square is loaded, a new IsoObject is added to the square. The ModData of that IsoObject include the information of a type of Item.
  2. When the player right click on the square, the IsoObject is detected and the usual investigate button is replaced by a new one.
  3. When that new button is activated, a research action occurs that adds the item to the player's inventory.

Definition
args is a table including
x: (float) coordinate Northing
y: (float) coordinate Easting
z: (float) coordinate Up
sItem: (string, FullType) item added to the mod data of the IsoObject on the square.
rKey: (string) a unique key to identify your spawn args. this is required to not respawn the IsoObject on each load of the square.
sprite[optional]: (string, SpriteName) adds a visible sprite to the IsoObject. -Does not work properly. The sprite is always loaded once. But most of the time it is not reloaded afterwards-

Exemple
args = {x=4279,y=7289,z=0,sprite='location_community_cemetary_01_30',sItem=Portal.PortGun,rKey='SouthPond'}
Princess abby 11 Jun, 2023 @ 3:20am 
Quick question.

So is this a mod that gives to a interface to spawn any item or vehicle mod or from the base game?.

As i'm not too sure as i read over it as it says it spawns stuff but i'm not sure to what extent as having a mod spawn any and everything at any given time by few simple clicks would help me test items and vehicles in mods when adding new mods to see if they work as intended and conflict so far i'v been doing it the and slow way.
Tchernobill  [developer] 11 Jun, 2023 @ 3:42am 
These spawn function are only for mods that want one item to always spawn at the same spot.
For item testing purpose, you should use the vanilla debug / admin "Item List" function.
For vehicle testing purpose, I do not know what you should use, but this mod wont help you at all.
Princess abby 11 Jun, 2023 @ 8:14am 
Originally posted by Tchernobill:
These spawn function are only for mods that want one item to always spawn at the same spot.
For item testing purpose, you should use the vanilla debug / admin "Item List" function.
For vehicle testing purpose, I do not know what you should use, but this mod wont help you at all.

Ah okey thanks yeah i use biki mod to spawn any and all vehicle related stuff and use the debug mod to spawn zombies and what not which is another mod but them two don't exactly bring up a interface panel to pick and spawn stuff like the vanilla debug you can activate before starting the game.

Which i can use and have before but would be nice to find the perfect mod that does that in a better way regardless thanks for the replay your a big help i'll keep looking for a mod that will aid me in spawning stuff in so i don't need to keep turning on and off the debug menu before i start the game :)
< >
Showing 1-6 of 6 comments
Per page: 1530 50