Jump to content

Where to look for starter kit change


XxZeraphinexX

Recommended Posts

The .lua file responsible for what's in starter kit is in Project Zomboid/media/lua/server/XPSystem and it's called XPUpdate.lua

 

The piece of specific code is:
 

xpUpdate.onNewGame = function(playerObj, square)    if SandboxVars.StarterKit then        local bag = playerObj:getInventory():AddItem("Base.Schoolbag");        local bat = bag:getItemContainer():AddItem("Base.BaseballBat");        bat:setCondition(7);        local hammer = bag:getItemContainer():AddItem("Base.Hammer");        hammer:setCondition(5);        playerObj:getInventory():AddItem("Base.WaterBottleFull");        playerObj:getInventory():AddItem("Base.Crisps");        playerObj:setClothingItem_Back(bag);    endend

If you wanted to turn School Bag into a Duffelbag you'd have to modify this line

 

local bag = playerObj:getInventory():AddItem("Base.Schoolbag");

 

to something like this

 

local bag = playerObj:getInventory():AddItem("Base.Duffelbag");

 

if you wanted to add a saw and nails for example then directly below the line above you need to add this.

 

bag:getItemContainer():AddItem("Base.Saw");

bag:getItemContainer():AddItem("Base.Nails");

 

It will add 5 nails, for more you need to add another line like it below, each line will ad 5 nails, or if you want a Box of Nails then

 

bag:getItemContainer():AddItem("Base.NailsBox");

 

For other item ID's check items.txt and newitems.txt in media/lua/scripts and if you want to spawn something directly in inventory just add something below the line

 

playerObj:getInventory():AddItem("Base.Crisps");

 

For example Let's add a Spiffo to inventory

 

playerObj:getInventory():AddItem("Base.Spiffo");

 

I hope it answers your question. If you're going to modify the game file remember keep the backup of the original!

Link to comment
Share on other sites

A question to it, what i have to change if i wanna add items from a mod like hydrocraft?

 

playerObj:getInventory():AddItem("Base.HCBeekeeperhat");

 

doesn´t work, so have i to change the base to something else?

 

playerObj:getInventory():AddItem("Hydrocraft.HCBeekeeperhat");

 

Base is the name of the Module the item belongs to, Hydrocraft Items use Hydrocraft as module if my memory serves.

 

So you just replace Base with Hydrocraft and then give the item name, should work fine then.

When you look at a mod's item script you will first see

 

module ModuleNameIsHere

{

 

Use whatever is in ModuleNameIsHere as replacement for Base if you want items from that particular mod.

Link to comment
Share on other sites

So far most things work fine, only stuff like

 

playerObj:getInventory():AddItem("Base.HandShovel");
 

or CarrotBagSeed

 

So the only thing i can´t figure out is what went wrong with these :(

 

all seed packs and Spade and Trowel doesn´t work, all other items like nails or saw works just fine.

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...