#mod_development
1 messages Β· Page 13 of 1
this works for you???
and just to be sure you've enabled it in the mods menu right?
when testing i think people generally put the mod in C:/Users/youruser/Zomboid/mods but idk if workshop works too it prob does
in debug mode see if you can locate your lua script too after pressing F11 to see the scripts/windows and stuff
i just had it dled i didnt test it, but yes it works i just checked now
okay cool, i'll load it in there as well
https://github.com/FWolfe/Zomboid-Modding-Guide this was very helpful for me as well if you haven't seen it yet and also some of the stuff on https://pzwiki.net/wiki/Modding
ohhh ty so much i was on that page earlier and lost it
no problem!
for this would it just load in the debug text window? or would i have to type something to locate it?
on the right side of the debug window you can find all the lua scripts
and you can type in the name of the script and find it there
that's where you can also reload changes without restarting the game
hey there, i'm wondering how many layers deep i can store player moddata. seems like i can store variables by themselves just fine, but if i wanted to modify something within, for example, an array inside of an array, it doesn't save the next time i access it. is there a limitation with that at all or do you think it's user error?
its a kahlua table so there should be no limitation
only thing is you cannot save java object or they will be lost and instanciated lua object will lose their metadata
so really you can save tables and primitives
ah ok, so if I made an interface in typescript and was trying to call/modify an instance of that, I would run into problems?
if so that makes sense. i think i can work around that just need to ponder
no if you made an interface you can just cast it back as that interface
const someData = theTable.myData as IMyInterface
hmm okay, yeah it should be cast properly. i can print the length of the array i wanted to modify at the very end of my action, and it's correct. but the next time my action is called the array is empty again.
you still need to verify if that data is valid
got it ok. this gives me a bit to work with thanks! i'll report back if i'm still stumped.
when you figure it out, would you mind posting? I am curious π€
absolutely ^^
Power at your fingertips.
I would like to see it too. Helps me see how people learn to use it.
Looking to commission a modder who knows how to alter item stats/spawn tables for other mods. Would be a mod that overwrites some stuff.
Paid?
thats what commission means
Some people really don't.
Ok. Can you DM me?
i figured it out. i was reassigning it incorrectly in my event. it happened so quickly that i thought the data just never got there in the first place.
ahh i see thank you!
and you just created an interface and then casted a table to that interface?
yeah, so my moddata looks sort of like this:
takenDrugs: {
"AntiInflammatory": DrugInstance[],
"Morphine": DrugInstance[],
}
and then DrugInstance is another interface that has stuff like name, effectiveness, etc.
the reason i changed it to be like this is so i can keep track of how many of a certain kind of drug are in the player's system. i'm thinking diminishing returns rather than damage/overdose
ooo that's pretty cool!
if you don't mind do you have a github? I'd love to take a look
also what do you guys do for testing multiplayer? do you just host a dedicated server from your local computer and use your own client? I want to take the easiest route since I'm lazy lol
local dedicated is the easier and faster
host button is slow asf
you can also run a second client using nosteam
ahhh good to know! and if it's just on the same computer i don't have to port forward right
if your computer can handle running two client and a server haha
i think it should be able to
mine cant
and yeah its local so no port forwarding needed
you just add localhost in the join server menu
32gb ram and an i9 + 3080ti should probably be fine haha
you can set your server config with the host menu
but you start it with your bat file
yaaa i just edited the sandbox settings and added my mod
sure!
https://github.com/SaaSKey/niets-pharmaceuticals
keep in mind, work in progress, code not stable, written by monkeys etc etc.
likewise if you have a repo link it, i'll toss it a star!
Contribute to SaaSKey/niets-pharmaceuticals development by creating an account on GitHub.
sure thing! I'll unprivate it. it's my first mod so kinda trash but it's a good starting point! https://github.com/petegilb/WeldingGoggles/
hell yeah thanks! this is also my first so no worries lol
I'd like to have that "first mod" experience again.
It's nice to see people getting that.
Feels amazing when you go through the effort to learn so much to try something like modding for the first time.
can anyone tell me what the procedural=true tag does for modding item spawns?
i just want to know if i need to merge my items (weapon attachments) into the ProceduralDistribution table or use mymapdistributionTable
It's definitely been rewarding! more complicated than I expected haha
I recall that you use Typescript. How was that experience?
a bit confusing but more comfortable for me since I have experience with javascript!
and using Konijima's pzpw tool made it quite easy
Awesome.
some parts are a little more complicated tho since you have to have everything typed unlike lua
Do you feel lost?
Do you feel like you saved time writing in that typed environment?
I definitely still feel a little lost, but overall I think it will be beneficial for when I write mods in the future
It's a new environment for PZ to write mods in. Good to know how the first modders think about it.
probably a bit more of a learning curve though
I think I'd feel lost either way though bc I'm new to this haha
Awesome. The group that made the typings is useful if you have specific questions about it. If you want it I can DM you it.
I feel like it will save more time in the future for sure and having all the methods and definitions with autocompletion was super nice
sure that would be great!
Awesome.
@thin hornet Did great work with pzpw
done. hopefully it didn't break anything :)
you rock
you actually fixed something π
now the settings should update without needing to restart
ill test very soon
inventoryfemale = {
rolls = 1,
items = {
"ZombieSample", 10,
"ZombieBrainSample", 1,
"5DollarBill", 3,
"Money", 5,
"KaeldorWallet", 3,
"KaeldorCoin", 0.5,
"LerasLuck", 0.01,
"KaeldorTailoring1", 0.1,
"KaeldorTailoring2", 0.1,
"KaeldorTailoring3", 0.1,
"KaeldorTailoring4", 0.1,
"KaeldorTailoring5", 0.1,
"KaeldorTailoring6", 0.1,
"KaeldorTailoring7", 0.1,
"KaeldorTailoring8", 0.1,
"KaeldorTailoring9", 0.1,
"KaeldorTailoring10", 0.1,
"KaeldorTailoring11", 0.1,
"KaeldorTailoring12", 0.1,
"KaeldorFurniture1", 0.1,
"KaeldorFurniture2", 0.1,
"KaeldorFurniture3", 0.1,
"KaeldorFurniture4", 0.1,
"KaeldorFurniture5", 0.1,
"KaeldorFurniture6", 0.1,
"KaeldorFurniture7", 0.1,
"KaeldorFurniture8", 0.1,
"KaeldorBrewing1", 0.1,
}
},
I'm here with another question. I might be understanding the loot tables wrong, but doesn't 0.1 behind the items mean the rarity?
I have people reporting they're getting 30+ of those magazines when killing around 800 zombies. There's no waay that's 1/1000 of a chance to spawn at this point in time. Anything I'm missing?
Please @frail spire if you have a solution or tip ππ½
This poor 'me' account gets pinged so many times I bet.
i didnt think @frail spire was actually an account
yeah, the 0.1 is the weight of that item behind the roll. Im pretty sure though that it doesnt translate into clear percentage chance, and theres stuff behind the screen that is affected too
It's because everything is set around the same rarity it doesn't really have an option to spawn anything
I've adjusted it to spawn money 50%
5 dollar bills 20%
So the otehr stuff now actually is rare
I feel like because everything is rare, the game just pcks one thus making it not rare
If you know what I mean π
you know what that would technically work
otherwise if you lower the weight of the rare items to like 0.01 it should be closer to 1/1000
do you guys know where i can find the school bag icon and the green spiffo icon for your inventory?
The Zombie Heat Map in an area will affect loot rarity in a complicated fashion that makes rare items less rare, among other effects.
Junk tables are exempt from this effect however, but are not affected by the sandbox loot rarity levels, always defaulting to normal.
Junk tables used to be affected by zombie heatmap, but that was unintended and removed in the latest build.
But it's zombie loot
That's not affected by any of this is it
I mean a lone zombie should have the same chances of spawning those things compared to a zombie in a horde of 500
No, that is how it works. That's why there's so many empty junk tables in the distributions files, so modders can bypass this effect.
Zombie corpses in Louisville will have more loot than ones in a otherwise zombie free forest cell.
That's interesting
It's even intended to work like that on zombies or is that going to be changed?
It's not a bug.
Sounds like fighting hordes is a more rewardable challenge. Nice.
Is there a clean way to override one file of a mod without copying all of the files? I want to override a ProceduralDistribution table to decrease spawn values, where the override works even if a mod is updated
for clothes/bags?
yes
Does anybody know if it's possible to override the distribution table for a vanilla vehicle?
that fileGuidTable.xml has them all in it
dope thanks
no problem
What do you want to change?
Trying to add a custom item to the truck bed of police vehicles
Doesn't seem to do anything
I tried adding a regular item too but no luck
if DistributeTo == nil then
DistributeTo = function(_table, item, chance)
local n = #_table+1;
_table[n] = item;
_table[n+1] = chance;
end
end
DistributeTo(VehicleDistributions.PoliceTruckBed.items, "Base.Wallet", 5);
Replace Base.Wallet with the item you want to add
Currently trying to add sunglasses. I wrote this:
VehicleDistributions = VehicleDistributions or {}
VehicleDistributions.PoliceTruckBed = {
rolls = 4,
items = {
"Glasses_Aviators", 999999,
"The other regular items go here, I am shortening it for Discord.", 1,
},
junk = {
rolls = 1,
items = {
"The junk items go here, I am shortening it for Discord.", 1,
}
}
}
And change the number from 5 to whatever weight you want for the rolls
I'd suggest something like 100 when testing to be sure it spawns enough to find it
quick question, is it possible to create a java object from the lua side? I would like to create a new Fixer object that I could pass to the FixingManager, but I can't tell if it's possible
@agile coral
table.insert(ZombiesZoneDefinition.Army, {name = "Brita_Crewman_2"})
this just removes the entire table right?
because im trying to achieve that lol
is there a way to remove items from a table akin to how table.insert works?
lmao same
table.remove()
yea but you have to tell it what to remove
Which works like table.remove(tableName, index)
i dont neeed an index yea
i jsut want to remove the whole table
so i can just but table name
and leave the index empty?
Where would I put that function? Game start?
Oh
i think server is the highest
Omg I am dumb
Oh no wait I had it in server already
shared means both server and client can access
God for a second I thought I was doing it client side lmao
lowest in the hierarchy
media/lua/server/BitBraven_Dist.lua or whatever you want to name it
so it goes like
Oh ok thanks
server => client => shared
I was wondering if I could just throw it on a blank file
you can edit things in the client frm the server
but you cant do client => server
only server => server
and i think that causes headaches too
lol
Yeah, stuff in Server is only run server-side, Client is client-only, and shared runs in both
It worked!
distributions are usually server side
welcome!
Now my mod is complete
would this work to remove a modded item from this container?
table.remove(ProceduralDistributions["list"]["GunStoreShelf"].items, "moddeditem");
iirc
dont quote me on this
you can simply do this
table.remove(ProceduralDistributions["list"]["GunstoreShelf].items,1);
1 just means you are removing the first item on the table
Loot distros go from 1 to 100 right?
lmao
Do you only want to remove one item, or many?
i only know how to remove one, teach me how to remove the entire index
lol
you could run through the indexes as a loop
goddamit
so its literally just what i said but automated
removing each index 1 at a time
lol
i want to remove about a dozen items entirely from the proceduraldistribution table yeh
not sure if pz has this but
table.removekey is a function in lua
that allows you to remove indexes
lemme type up sspaghetti code to remove items in a table
ok nvm you can remove specific items
the table just shifts
so you just loop that
until table is empty
its a pain in the ass
i usually just delete the entire table and create my own
if there are a lot of entries
Since the way the item tables work is by pairs of entries, you can't really remove items unless you know the index. So you could find it by looping through the items table until you find the one you want, and save that index (as well as index+1 for the roll weight). Then remove those indexes
But if it changes, then you'll remove wrong items π
oh ya
das right
or do it the lazy way
remove the index and put in your own

that works too
only issue would be you'd cause mod conflicts
for any mod that edits the same table
lol
Yeah, that's why its often harder to remove old code than just adding more new code. Less breaks
Whelp, finally got my mod updated
That's a win for the night
i guess the simplest way is
to create a function to remove table indexes
lemme search
are you trying to remove item from distribution?
Yeah, they want to remove some items from ProceduralDistributions["list"]["GunstoreShelf"].items
@agile coralbtw from <m_Guid>f033a656-d685-434b-9025-312b81bf7087</m_Guid>
do i just make my own
new GUID
is there a GUID generator somewhere
lol
local function postDistributionMerge()
RemoveItemFromDistribution(ProceduralDistributions.list.GunstoreShelf, "Base.ItemName", nil, true)
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
just for visibility I'll ask again: Is it possible to create a java object from lua? Or can you only manipulate objects that already exist?
im trying to override the proceduraldistrubtion table edited by a mod without having to copy the whole mod over and update it each time the mod updates
uh
thats just overriding it
ok well look at how the mod edits the ProceduralDistributionTable
thats probably the latest
then you can manually remove items using table.remove
if there are many items you'd like to remove, you just have to remove them from the index one at a time
or count
Look into C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\SuburbsDistributions.lua
Devs added global methods to remove or replace item in a distribution table
Some Java objects can be created directly, such as InventoryItemFactory, but I don't see one for Fixer
oh they did
they created functions
local recursive = (_dorecursive==nil) or _dorecursive
local doChance = type(_chance)=="number"
for k,v in pairs(_dist) do
if type(_dist[k])=="table" then
if type(k)=="string" and k=="items" then
local validItem = false
local isChance = true
for i=#_dist[k],1,-1 do
local val = _dist[k][i]
if isChance then
validItem = not doChance
if doChance and type(val)=="number" and val==_chance then
validItem = true
end
else
if validItem and type(val)=="string" and val==_item then
table.remove(_dist[k], i+1)
table.remove(_dist[k], i)
end
end
isChance = not isChance
if isChance then
validItem = false
end
end
else
if recursive then
RemoveItemFromDistribution(_dist[k], _item, _chance, _dorecursive)
end
end
end
end
end```
pretty self explanatory
_dist is distrubution table Item is uh item
you can instanciate java object but not create java object.
fuck me
ah, that's a shame, I want to feed temporary Fixer/Fixing objects to FixingManager.getChanceOfFail() and FixingManager.getCondRepaired()
I believe you're describing what I want
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,2);
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1);
i was removing indexes one at a time

you instanciate an object using the new after the class like so
local newIsoObjectInstance = IsoObject.new(cell, sprite, x, y, z)
.new rather than :new?
I can run RemoveItemFromDistribution from my own lua?
yeah for the java new its .new
looks like it i think
I'll give it a try right now
Example creating a new square
local newSquare = IsoGridSquare.new(getCell(), nil, x, y, z);
getCell():ConnectNewSquare(newSquare, true);
its global and vanilla so yeah its loaded before any mods
Nice okay
keep in mind mods might run before or after yours
so you can require("the_other_mod_distribution_file")
to ensure its loaded before your script
also use if not getActivatedMods():contains("TheOtherModID") then return; end at the top of that file so that it doesnt run if the other mod is not activated
crap, it doesn't look like Fixing has a constructor
oh, the implicit empty constructor does, so Fixing.new() works. Nice, thank you very much @thin hornet
Can anyone think of a way to tell if a melee weapon is made of wood or metal? I tried InventoryItem.getMetalValue() but its pretty unreliable
FixingManager, Fixing, Fixing.Fixer, Fixing.FixerSkill are exposed so technically any public method should work
which is great. As long as I can instantiate Fixing and Fixing.Fixer I can use all the methods in FixingManager without having to port them to lua and having to maintain that
getMetalValue is probably your only option
ya, its ok, for example a bat is 0 and a spiked bat is 5. But a katana is also 0
one way would be to add Tags
wanted to procedurally choose a required tool to work on the weapons, since a blow torch doesn't make much sense for a baseball bat, but I may just be out of luck
Tags?
what about getMeltingTime()?
I could try that, in theory it makes sense
\zombie\scripting\objects\Item.java
line 2109 for tags
Nuclear fallout mod when?
you can search items by tags and can add multiple tags per items
example HandAxe has tags Tags = ChopTree;CutPlant,
hmmmmm
you could create a listing of item to add a custom tag like MetalItem WoodItem
I don't like the idea of adding my own tags, thats a lot of manual data entry, and I'd have to add specific compat for other mods
but again that mean to list them all manually
So im trying to make animations for my character for pz but if i export it in blender as fbx it seems to do nothing ingame
I could possibly look at their repair recipes and assume items that have welding recipes are metal, now that I think of it
since I'm elbow deep in FixingManager as it is
repair recipe are fixing
and ducttape is the main item lol
fixing Fix Banjo
{
Require : Banjo,
Fixer : DuctTape=2,
Fixer : Scotchtape=3,
}
where is this file located?
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\fixing.txt
Is the model you're working with a Direct X model?
Wow I feel old here just figuring this out.
I know the old old school stuff for modifying 3D models but not the newer setup.
use blendah
Oh yeah. Old school model edits used a specific IO plugin for Blender written by third-party.
Was like Blender 2.6 -> 2.7
@thin hornet @drifting ore thanks for your help guys got it all working now π
awesome
is there a mod to increase the capacity of storage containers? not looking for a 0 weight cheat or anything, just find it odd that one crate has more storage then large metal shelving witch takes up 4 blocks instead of one...and i do not want to have a crate base just to store all my crap
vanilla storage are defined into tiles files and i doubt we can edit them. From the look of the workshop there is no mods expending vanilla storage.
but there might be mods that let you build new storages with more space into it
thats what worried me, thanks for the info
@agile coral this code isnt working
table.remove(ZombiesZoneDefinition.Army,"Brita_Crewman_2")
am i writing it wrongly
do i need a require "NPCs/ZombiesZoneDefinition"
oop
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
you probably need to add Base.Brita_Crewman_2
local function postDistributionMerge()
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
why do i need a new local function
what do you mean
local function postDistributionMerge
yeah this is a callback that we pass into Events.OnPostDistributionMerge.Add(postDistributionMerge)
that callback will run when Events.OnPostDistributionMerge is triggered
so it will RemoveItemFromDistribution after all distribution is fully merged
I suppose this could do
most likely after all mods added new item to the dist
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS_2")
so i dont need to concern myself with load order, with that function
got it
yeah
also if the item is not in the distribution it will do nothing
Events.OnPostDistributionMerge.Add(function()
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
end)
i prefer this code lollocal function postDistributionMerge() RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2") end Events.OnPostDistributionMerge.Add(postDistributionMerge)
using anonymous function is a bad habit in lua at least
makes it clearer
True
local function postDistributionMerge()
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)```
lets give it a whirl
especially when reloading script
require "NPCs/ZombiesZoneDefinition" is not necessary its garanteed that files is already loaded when your mod runs, cause vanilla scripts runs before everything
it would be usefull to require only if the thing in that file was not global and was returned at the end or if its an other mod that you want to run before yours
ah okay yea
Proper require usage:
FileA
local myModule = {}
function myModule.test()
print("test")
end
return myModule
FileB
local TheModule = require("FileA")
TheModule.test()
even if FileB was loading first, it would require and force FileA to be loaded first, anyway FileA return what is accessible.
Files can return just like a function
ah
so if you want to use the function of another module
you use the require function
got it
yeah and also stopping using globals everywhere (which is the main cause of load order issues)
the only pain i can see from not using globals is reloading scripts
cause if i want to reload FileA after changing something ill also have to reload FileB after so that it require the new FileA again and get its new values
What is the exact syntax I would need to use to call IsoGameCharacter.Traits.Lucky.isSet() from lua? I'm a little unclear on when . and when : is needed
thanks for the help!
Ill make this simple for you, you cannot access any properties
whomp
if there is not a public method available forget it
lucky you there is one for traits
playerObj:getTraits()
player:getTraits():contains("Lucky")
ah, I see a getCharacterTraits(), is that something different?
I think what they return is different
Yeah, you'd want to use getTraits() over getCharacterTraits()
its similar
but doesnt contains custom trait I think
it extends TraitCollection
use getTraits youll have more power freedom
especially for custom traits
well thanks guys, I'm sure this will work. Right now I'm getting a weird casting exception that I think I'm too tired to debug, but progress is good
you're very helpful
glad to be of help
new mod works at least 
gotta work on the audio tho
maybe decrease how long it lasts
planning to make a mod that changes the noise when you get hit by a zombie
which works better
Reason: Bad word usage
wut

bad bot, overly sensitive word filter
also i broke pz yesterday with my script
i learnt you need to overwrite the event with the sound
otherwise if the mod is enabled it just constantly crashed
had to delete from my c: workshop
you might forgot to end the script with }
a bracket missing and you can't boot the game up
Possibly lol
damn
i found a way to change the shouts when q is pressed
but no way to add a sound when its done
hey guys
anyone what script I should use to remove certain clothing items from mobs ?
or if I could even remove all profession items from them
you could make a function to make the sound play when the key for the shout button is pressed using the one of the key pressed events. There are a bunch, not sure which would be best, probably either OnkeyPressed or OnkeystartPressed
by mobs do you mean zombies? you would have to remove the outfit that has the clothing from the ZombiesZoneDefinition or remove that particular item from all outfits that use it in ZombiesZoneDefinition
I dont really have any experience modding, can you give me directions ?
what item are you trying to remove?
all outfits, so they have no items or clothing
I've already got a mod to remove items
oh so that they would all be naked?
yes, I use the shadow zombies so it doesnt really fit when they spawn as a fireman
but it only affects the civilian spawns I think
anything with a profession still spawns the same
I found the professions.lua file
if I turn it all to 0, would it just replace them with regulars or just remove the spawns entirely ?
you could try something as simple as
local function remove_outfits()
ZombiesZoneDefinition = {}
end
Events.OnGameStart.Add(remove_outfits)
would this work on respawns too ?
idk, haven't done this before, you would have to try
oh i could literally just add that as a script? hell yeah
yeah, also make sure that the function doesn't consume the Q press. I haven't looked super hard at code related to key presses, but i've seen that there is a consumption mechanism for the keys, but in this case you wouldn't want it to be consuming it, when not in some menu. also youd have to make it not trigger when typing q for example in the crafting UI
well theres probably a way the game checks for shouts when in game right?
just gotta try and find how it does that
yeah, well, when I took a quick look, it was in the java side of things, but I might have missed it
thats the thing. me not too skilled in java lmao
its in isogamecharacter.java, the callout function. about line 3637
you can see there, it is doing the random selection of those shout texts, then generating the virtual sound to attract zombies
where can i find isogamecharacter?
huh
didnt think that would work 
have you decompiled the java?
nyet
hey it does work,thank you
would this apply to respawns or should I look further into that ?
if you are interested in looking at the java, there is this good guide that will show you how step by step to set it up. https://github.com/Konijima/PZ-Libraries
Complete tutorial to decompile and use Intellisense for Project Zomboid modder. - GitHub - Konijima/PZ-Libraries: Complete tutorial to decompile and use Intellisense for Project Zomboid modder.
ahh cheers
@thin hornetim having an issue
@agile coralu free?
i have this line of code ```TweakItem("Base.Hat_Gentex_Helmet","BulletDefense","100");
TweakItem("Base.Hat_HGU56","BulletDefense","60");
TweakItem("Base.Hat_PSGT_Helmet","BulletDefense","100");
TweakItem("Base.Hat_PSGT_Helmet_Camo","BulletDefense","100");
TweakItem("Base.Hat_MX_Helmet","BulletDefense","100");
TweakItem("Base.Hat_MX_Helmet_Glass","BulletDefense","100");
TweakItem("Base.Hat_FAST_Opscore","BulletDefense","100");
TweakItem("Base.Hat_Maska","BulletDefense","100");
TweakItem("Base.Hat_Killa","BulletDefense","100");
it applies it just fine
but for some reason
when the item spawns naturally
it doesnt apply the bulletdefense line
only when i spawn it via console?
how do i retroactively apply these values
are you sure the params are being applied before they spawned? tmk the tweakItem doesn't affect items that have already spawned in. Have you tried traveling to another city to make sure all the stuff is newly spawned after the items have been modified?
MAP-JAM is currently running with some great map ideas being thrown around atm! Its definitely not too late to get started, even if you have never made a map before we are around to help you figure it out
hey guys, back with two questions
how would I make a certain item(s) not spawn in the game ?
I just want to disable all spawns of it
and how would I disable all zombie injury textures
no exposed ribs, no bandages etc
oh right that explains it
btw i cant remove this for some eason
local function postDistributionMerge()
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)```
trying to remove this
table.insert(ZombiesZoneDefinition.Army, {name = "Brita_SPECOPS", chance = 10})
table.insert(ZombiesZoneDefinition.Army, {name = "Brita_SPECOPS_2", chance = 10})```
Those aren't items, they are outfits. The removeItemFromDistribution only works on item distributions tmk
so how do i remove those outfits
Idk if there is a handy dandy function given by IS for doing it. you might have to make your own function to parse through the outfits to remove the correct one
can i just do table.remove
local function removeoutiftcrew(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
for i, v in ipairs(ZombiesZoneDefinition.Army) do
if v == "Brita_Crewman_2" then
return table.remove(ZombiesZoneDefinition.Army, i)
end
end
end```
made it so that
it searches for the value
you don't need a return, just performing the removal should be enough
wdym
im trying to create a function to look for a string within a table
the table is ZombiesZoneDefinition.Army
i dont know in what exact location it is so i cant just put 1 2 or 3
table.remove modifies the ZombiesZoneDefinition.Army array in place, so you won't need a return there. just the function call should be enough I think.
so just remove the return
ok
im a lua noob how do i put multiple strings into 1 function
i got "Brita_Crewman_2" "Brita_SPECOPS" amd "Brita_SPECOPS2"
local function RemoveOutfitFromZone(zone, outfitname)
for i, v in ipairs(zone) do
if v.name == outfitname then
table.remove(zone, i)
end
end
end
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
haven't checked it ingame, but this seems right to me
for i, v in ipairs(zone) do
if v.name == outfitname then
table.remove(zone, i)
end
end
end
local function postDistributionMerge()
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_SPECOPS")
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_SPECOPS_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)```
i just wanna make sure
i remove them after distribution is merged
do local functions even interact with each other
or do i have to make it a global function
I would just require the file that is adding those outfits into the zones. The zombie zone definitions aren't related to the OnPostDistributionMerge tmk.
so just use require("BritaZeds")
or it might be "Npcs/BritaZeds" I can't remember when the path searching starts
I'm trying to show a piece of text above a zombie through something like
zombie.addLineChatElement("B. I'm close to " .. target:getUsername() .. ": " .. distance, 0, 0, 255, UIFont.Dialogue, "default", false, false, false, false, false, false, true)
But this doesn't seem to do anything either... Does anyone have any experience with this?
ProceduralDistributions = {};
local function
RemoveItemFromDistribution("Earring_LoopLrg_Gold")
would this be good to remove items from spawnings ?
local function postDistributionMerge()
RemoveItemFromDistribution("Earring_LoopLrg_Gold")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
ah thanks
it seems strange. i can't get a proper screenshot for it, but If I just do
testZed:addLineChatElement("B. I'm close to " )
it does have the text. not sure why the other function doesn't work though since they both are public
Ah wait it does work, you are just using the wrong arguments. You have one extra false, and you are missing a float between the UIFont.Dialogue and the "default"
public void addLineChatElement(String var1, float var2, float var3, float var4, UIFont var5, float var6, String var7,
boolean var8, boolean var9, boolean var10, boolean var11, boolean var12, boolean var13) {
this.chatElement.addChatLine(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12, var13);
}
Would anyone be willing to give me a quick step by step tutorial on how to do this? Reduce the amount of cigarettes spawn in the world.
look at \media\lua\server\Items\SuburbsDistributions.lua
-- set 'chance' or 'replaceChance' to false if you want to ommit either or both of them.
function ReplaceItemInDistribution(_dist, _item, _chance, _replacement, _replaceChance, _dorecursive)
-- optionally set 'chance' to false if you want to ommit it but do want to set dorecursive
function RemoveItemFromDistribution(_dist, _item, _chance, _dorecursive)
using theses two globals you modify the distribution table and item and their chance of spawning.
What's the overall difference between ProceduralDistributions and Suburbs?
Aight lads current problem
i modify the actual game file>
it works
dis it
i turn it into a mod
it ain't working
thing being it worked fine like 3 months ago
alright time to wake up my only hope
@gaunt pendant
guess what
they somehow patched it
How to change the chance of katana in corpses?
Aight time to ask other people for help
@winter bolt MY COMRADE YOU HAPPEN TO HAVE SPARE TIME FOR EDUCATING PEOPLE?
for what
i know there is a mod for rain washing YOU, but why is the ground still dirty after 3 storms?
does anyone know anything about attachments not visually showing up on custom guns
How can I open the texture .pack files?
side note, wearable medkits? or medi bag?
there's a tool included with the modding tools u can download via steam
wrong channel this is for modders making mods
Procedural are like "categories", Suburb is the actual distribution using those categories (procedural)
What is the largest number of uses an item can have/the smallest UseDelta? Anyone know that info offhand?
will need more of a description of what you are trying to do, and why it isn't working if you want help
not sure if there is a practical limit. ofc there is probably a theoretical limit. But anyways i've seen items with 0.00001 UseDelta, so 10,000 uses. although I haven't tested them to actually count if it reaches the 10000 uses exactly
Just didn't know if I could throw another 0 in there and multiply uses even further
i.e. 0.000001 or 0.00000001
Thanks for the response btw
ahhh I see that makes sense. then if you were to remove items from the distribution, would it only be necessary to remove it from the suburb one?
or i guess from either one?
depend what you want to do
If you remove it from the procedural it will remove it from any location using that procedural
trying to make my own customcontextmenu is there anyway for me to get it without the ContextMenu_Swim and just get it to Swim?
lua/shared/Translate/
ahh ty i see i'll look at some others files to see how that works
and then removing it from suburb would allow you to remove it from a specific location instead of all locations using that procedural?
an fbx model.
im trying to export it to fbx again with my animation but it doesnt seem to do anything...
are you using the animations are being exported? try importing it into a new blender project and see if they are there
Is there a mod that lets you decide how many points each trait gives?
Oof. Official JavaDocs when?
well, it is already visible from zomboid-javadoc.com although idk if that is technically "official javadocs"
Variable names.
Thank you. I sort of lost track, I think. Hahaha
this.chatElement.addChatLine(sayLine, red, green, blue, font, scramble, tag, allowBBCode, allowImages, allowChatIcons, allowColors, allowFonts, equalizeLineHeights);
}```
So many freaking args
my good friend made this cool pz bot to tell information on users info and stuff , donβt know where else to share it than here
zomboi?
i contribute to that sometimes
A discord bot for project zomboid multiplayer servers - GitHub - JonnyPtn/zomboi: A discord bot for project zomboid multiplayer servers
flip the normals, it work for me
Does anyone know how to make an invisible piece of clothing?
if you set the model to a filename that doesnt exist it'll be invisible
I tried, and does not seem to work it causes a long chain of errors
module InvisibleArmorTransmog {
imports {
Base
}
item Invisible_Armor
{
Type = Clothing,
DisplayName = Invisible_Armor,
ClothingItem = Invisible_Armor,
BodyLocation = Tail,
Icon = Rabbittail,
BloodLocation = Jacket,
RunSpeedModifier = 0.99,
CombatSpeedModifier = 0.99,
BiteDefense = 50,
ScratchDefense = 50,
Insulation = 0.85,
WindResistance = 0.85,
WaterResistance = 0.8,
Weight = 3,
}
}
And this error too
could always export a nothing model
and use that
Blank file π€ That might work
mhm
or try just erasing the line that assigns it to a model
might also work
not sure how PZ behaves with that
Good idea
@willow estuary Now after the recent change I'm getting drops like this
Even though the roll is defined as '1', how the hell is it possible that so many items get spawned on one single dead zombie??
very good luck
Is there a reliable way to apply an outfit to a character? I'm currently trying:
zombie:dressInNamedOutfit("Spiffo");
zombie:resetModelNextFrame();```
But that only applies it after restarting or after interacting with the zombie.
I forgot that I can use ClothingItem = Belt,!
you dont need to deal with most of them, if you just use the shorter functions
they just call the longer funct with default args
hey guys if i want something to dry in 30 min real time what would i set this to? WetCooldown = _______?
probably easiest way to figure it out is to just try it
Yeah, I'm now using the one-arg version and that works. Thanks ^^;
https://pzwiki.net/wiki/Dish_Towel Gives an idea of a value. I'd say check how long that takes to dry and fill in a value based on that.
ty i will look into this!
Is it possible to make an item/tile visible and interactive for admins only? I.e. players with no permissions cannot see or interact with it
How do I get itemGUIDs?
Free Online GUID/UUID Generator
Thanks
if I make a little mod and put it on a game I'm hosting, does it automatically get sent to someone who connects or is that only for workshop'd mods?
Workshop is required
anything you put on the workshop is public, right?
oh that's handy
where are the icon pngs stored in the game's files
hello friends, if someone can help me, how can I make this script all players can listen to it if they are online and additionally add the base module? sorry i am new and learning how to mod
local OnEveryHour(player, x, y)
local hour = getGameTime():getHour();
if hour = 24 then
getSoundManager():PlaySound("music1", false, 10.0);
end
end
Events.EveryHours.Add(OnEveryHour);
module Base {
sound music1
{
category = music1, loop = false, is3D = true,
clip { file = media/sound/music1.ogg, distanceMax = 1500, volume = 1, }
}
}
maybe check out true_music in the meantime?
idk i just go to the wiki and dl em from there https://pzwiki.net/wiki/
does anyone know how i can make the player add water to a recipe that is not cloth or food?
Hey so how would I go about making a fake game character?
I dont need it to move or anything, just to show up as a character and derive from the object base for mod data
maybe something derived from IsoLuaCharacter?
try using Water=1, in your recipe?
I'm having a weird issue. I've retrieved a Fixer for an item, it has a FixerSkill with the name "MetalWelding". If I call PerkFactory.getPerkFromName("MetalWelding") I get nil
the actual repair in game uses Metalworking, and does work
why are so many random things in the vanilla ProceduralDistributions file listed twice
give it a chance to spawn more than one?
can't they just up the rolls?
most of the time the chance is the same
What is the best way to get a player's skill level from a string containing the skills name? PerkFactory.getPerkFromName(name) and PerkFactory_Perks.FromString(name) are both not working for me.
which means I can't use player:getPerkLevel(perk)
Does anyone knows whether it is possible to save data structures so that the save is persistent over quitting and reloading a game? I know that you can save some data via the getModData() command but afaik, this will only store strings and doubles (or am I wrong?). Specifically, what I need to save is (probably) an IsoGridSquare type of object.
Another question: Given some x, y and z coordinates on the game's map, can I make an IsoGridSquare type of object out of them?
Perks.MetalWelding:getName() gives Metalworking, yet PerkFactory.java clearly says this:
very frustrating
I don't know what to do
5 days and a lot of help later from Youtube, steam and you guys here π
, finally I can now start working properly on my first *-real- *mod which will add craftable fairy lights and other things for your cosy apocalypse interiors
β --- *please don't mind the visuals yet.
*
So, thanks a lot guys :]
Perks.FromString("MetalWelding") works where PerkFactory.getPerkFromName("MetalWelding") did not. I don't know why but I'm not going to look a gift horse in the mouth
yeah i guess i had to use WaterBottleFull = __, but would love to find out how to use the sink as well to clean this item
im curious about this too
any yt recommendations that would help for beginner modders?
Depends what you are after :] ?
For the whole tile import/setup thing i followed this 3parts series https://youtu.be/Fbvb6LeX0Sw
Haven't done anything 3d-related yet though
Quick video on getting custom tiles in the project zomboid editors (buildinged, tiled and worlded)
If you like what im doing please consider donating to my Patreon.
https://www.patreon.com/DaddyDirkieDirk
for anyone who created their own mod, did you ever get an error that a workshop item 2590924071 is missing and it won't load the world
awesome thank you! not after anything in particular but lookin for all kinds of stuff π
Another modder has a function firing on Events.OnFillInventoryObjectContextMenu, how do I make sure my function fires after his?
The mod is probably added to your modlist.
The mod - 2590924071 - does not exist. https://steamcommunity.com/workshop/filedetails/?id=2590924071
You're trying to load a mod that is not uploaded to workshop, or has been deleted. - your question belongs in #mod_support fyi.
Is this an issue that anyone has had with the Kahlua compiler?
https://pastebin.com/wkaM1Lk1
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
java.lang.ArrayIndexOutOfBoundsException: Index 200 out of bounds for length 200
at org.luaj.kahluafork.compiler.LexState.new_localvar(LexState.java:768)
kahlua can only have a max of 200 locally scoped variables on any given stack
I would like to commission someone to create a mod that changes the way stun lock in pvp works
Makes a lot of sense. Thanks.
"ProjectZomboid\media\texturepacks\UI2.pack"
use tilezed to extract
Feel free to DM me.
woo thanks - easy to get them from the wiki but that'll be easier for a lot of things to just be able to browse them
Does anyone know the name of the mod that you can leave your learning in a book if you die?
making something that is only interactive for admins I think is feasible, but I don't think making the tile only visible to admins is
#mod_development message take a look at this message. I've tried it and it works
skill = player:getPerkLevel(Perks.PlantScavenging);
you can find examples of all the other perk names in the engine by just searching "Perks." in the vanilla lua files
sure, but the perk wasn't hardcoded, it was being retrieved from a FixerSkill
I did manage to solve it, Perks.FromString(fixerSkill.getSkillName()) did the trick
might be better to get some more details about what you are trying to acheive. You can't store isogridsquares in a moddata somewhere, but you can store the coordinates in a moddata table. so you could have a table, that contains tables. Each one of the sub table, just has the 3 coordinates, so you are able to grab the isogridsquare later. Also I say that storing the isogridsquare might not be what you want, because they are only accessible while the player is close to them, and the grid square, and their moddata table are not loaded in, so you won't be able to manipulate distant isogridsquares if that is what you are trying to do
there is a -nosteam flag that lets you run multiple instances of PZ
Here's a fun math problem I can't quite figure out: Is there a reasonable way to calculate exponential decay when the decay amount per time interval is always rounded to the nearest integer? Tempted to just write a recursive function to brute force it, but I feel like it can be math'd
its called exponential decay, but yes its logarithmic
whelp, I didn't realize going into this that the average weapon has a condition of 10, I assumed it would be something like 100. The minimum amount a successful repair can do is one whole condition point, which is 10% of the total condition, even when the tooltip says it'll only repair 2% of the damage
breaks some assumptions I built a mathematical model around, lol. Now I'm gonna have to rebalance everything
Doesn't work for MP :/
How to get the hunger value below zero, i.e. with positive (green) hunger effects?
I'd like to know green hunger moodle level. But not just 2 or 3, but 2.5 for example.
the only way to know what type of building you're in (hospital, pd, bank, spiffos, etc) is to check every room name and look specifically for "bankroom" or "hospitalroom" etc right?
TIL OnFillInventoryObjectContextMenu is a thing π I never realized that
do the autotsar mods overwrite the "ISVehicleMechanics:doPartContextmenu();"?
guys I'm having trouble with the simple mod I made
I tried to edit zombiezonedefinition and proceduraldefinition files
to remove costumes from zombies and remove certain items from the game respectively
but none of it works
I will post an example of what I used
ProceduralDistributions = {};
local function postDistributionMerge()
RemoveItemFromDistribution("Earring_LoopLrg_Gold") end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
there are more items on the list, but as far as I can see stuff is still spawning
ZombiesZoneDefinition = ZombiesZoneDefinition or {};
-- total chance can be over 100% we don't care as we'll roll on the totalChance and not a 100 (unlike the specific outfits on top of this)
ZombiesZoneDefinition.Default = {};
table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});
local function remove_outfits()
ZombiesZoneDefinition = {}
end
Events.OnGameStart.Add(remove_outfits)
I even managed to add it as a mod to the game and activate it, but I find items I've included in the mod and zombies with clothing still spawning, how to fix this ?
did you remove all the other outfits from the zombie zone definitions?
nope, this is all I posted on the file and used it as a mod
how should I have done that ?
Did anyone ever use ScriptItemInterface.newItemType or ScriptItemInterface.cloneItemType ?
@willow estuary Sorry to ping you, but, do ScriptItemInterface.newItemType and ScriptItemInterface.cloneItemType work?
If yes, when should I use them? I'm trying to generate new itemTypes on the fly. But I'm strugling
Also, for fellow modders
Regex to look for search Events in the zomboid lua files [E]vents\.[a-zA-Z]+
And dump file of the events
And in alphabetical order
I don't get it why this does not work?
function TransmogCloner()
local items = getAllItems();
-- Must cache lenght or it will keep growing the more I add stuff
local lenght = items:size() - 1
for i = 0, lenght do
local item = items:get(i);
local fabricType = item:getFabricType();
local NbrOfCoveredParts = BloodClothingType.getCoveredPartCount(item:getBloodClothingType())
if fabricType == nil and NbrOfCoveredParts > 0 then
-- I have to use the global version apparently
cloneItemType('Transmog'..item:getFullName(), item:getFullName())
print('Transmog'..item:getFullName())
end
end
end
Events.OnGameBoot.Add(TransmogCloner)
I'm not even getting an error, I'm getting notthing
do you want the if to have this? if fabricType == nil? or is it supposed to be !=
and is there a reasoning for this being ongameboot rather than start?
fabricType == nil is good enough, and no specific reason to not use ongamestart
bc i thought boot was when you launched the game rather than when when you join a game
This is pain
I just decided to log the result of cloneItemType
LOG : General , 1660925126458> TransmogBase.Hat_GasMask
LOG : General , 1660925126458> Item{Module: Base, Name:null, Type:Normal}
LOG : General , 1660925126459> TransmogBase.Hat_BalaclavaFull
LOG : General , 1660925126459> Item{Module: Base, Name:null, Type:Normal}
LOG : General , 1660925126459> TransmogBase.Vest_Hunting_Orange
LOG : General , 1660925126459> Item{Module: Base, Name:null, Type:Normal}
LOG : General , 1660925126460> TransmogBase.PonchoYellowDOWN
LOG : General , 1660925126460> Item{Module: Base, Name:null, Type:Normal}
LOG : General , 1660925126460> TransmogBase.PonchoGreen
LOG : General , 1660925126460> Item{Module: Base, Name:null, Type:Normal}
LOG : General , 1660925126461> TransmogBase.Hat_SummerHat
LOG : General , 1660925126461> Item{Module: Base, Name:null, Type:Normal}
You already did not using dark theme.
its notepad i barely use it sue me
???
Don't know the name of the horn but it's Italian.
Sneezy XL?
the horn when you honk it
makes a sneeze noise
Adventures of Rick & Morty (S1E8)
Justin Roiland's Solo Vanity Card Productions
Harmonious Claptrap
Starburns Industries
Williams Street
Adult Swim
Diclaimer: I am not the owner of this content.
Hahahaha
Those horns! :D. When my hubby and I were staff at a YMCA youth camp in Italy, we experienced this vintage car parade. :) When these oldschool vintage cars passed, we all cued up at the roadside and cheered those fancy old cars on. :D Well ok, the Ferrari was not that oldschool. ;) No Iβm not skinny because I move so much ;) Follow me on Strava:...
oh the spongebob car horn
Now I need to find the exact one I'm hearing in my head.
GodFather Musical Car Horn - http://www.boomblasters.com/product/godfather-musical-car-horn/
This makes absolutely no sense
This function throws no errors, and it logs properly too
function TransmogCloner()
local module = "Base"
local name = "MxDebug"
local displayname = "MxDebugName"
local type = "Clothing"
local inventoryIcon = 'WatermelonSmashed'
local item = createNewScriptItem(module, name, displayname, 'Weapon', inventoryIcon);
print(tostring(item))
print(tostring(item:isHidden()))
print(tostring(item:getObsolete()))
local belt = ScriptManager.instance:getItem("Base.MxDebug")
print(belt)
print(tostring(belt:isHidden()))
print(tostring(belt:getObsolete()))
end
Events.OnGameBoot.Add(TransmogCloner)
Events.OnGameStart.Add(TransmogCloner)
TransmogCloner()
LOG : General , 1660926847103> Item{Module: Base, Name:MxDebug, Type:Weapon}
LOG : General , 1660926847104> false
LOG : General , 1660926847104> false
LOG : General , 1660926847104> Item{Module: Base, Name:MxDebug, Type:Weapon}
LOG : General , 1660926847104> false
LOG : General , 1660926847104> false
Why the hell then the items does not appear in the list 




















for some reason i thought the sounds had to be ogg but i could be wrong
i shall try that
then the IsoGridSquare might indeed not be the thing I am looking for. thanks for explaining.
what I want to do is storing, having access to and manipulating the crops which the player has planted. What I can do is storing the x,y and z coordinates of the crop's location via getModData(). problem is that I don't know how to access the actual plant object by using the coordinates. there is a vanilla command which returns the plant and looks like this:
local plant = CFarmingSystem.instance:getLuaObjectOnSquare(self.sq)
problem is that I do not really know what the argument "self.sq" is. possible that it is an IsoGridSquare object but also possible that it is another "location/square" object....
nah they've got .wav and .ogg in the game files so I don't think that's it
oof
im pretty sure the script is right
thats how it looks in the original vehicle script
yeah i just took a look at it too
try changing the path?
like i dunno if you need the media/sound/ part
i did for replacing other sounds
again. the other sound mods i modded did too
danggg idk then
It needs to be in that folder yeah.
ahhh gotcha
i really want this to work
So you give the relative path
cause if it does its gonna me hilarious
i just saw that the paths in the items are in the sound folder, but they don't write that part of the path
Exactly.
yeah the relative path was what i was thinking
The code fills it in.
so instead of media/sound/clown_horn.wav it would just be clown_horn.wav
I know this because of music player code I'm converting to Typescript.
String var4 = null;
if (ZomboidFileSystem.instance.getAbsolutePath("media/sound/" + var0 + ".ogg") != null) {
var4 = "media/sound/" + var0 + ".ogg";
} else if (ZomboidFileSystem.instance.getAbsolutePath("media/sound/" + var0 + ".wav") != null) {
var4 = "media/sound/" + var0 + ".wav";
}
if (var4 != null) {
long var5 = FMODManager.instance.loadSound(var4);
if (var5 != 0L) {
var2.file = var4;
}
}
var0 is your thing.
That's called in code.
ah also you need to move that table.insert to after clearing the zombies zone definition in your remove outfits function. You are adding that in, then clearing it all
I don't use script text files for my work so I wouldn't know from experience.
ZombiesZoneDefinition = ZombiesZoneDefinition or {};
-- total chance can be over 100% we don't care as we'll roll on the totalChance and not a 100 (unlike the specific outfits on top of this)
ZombiesZoneDefinition.Default = {};
table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});
local function remove_outfits()
ZombiesZoneDefinition = {}
end
Events.OnGameStart.Add(remove_outfits)
it is like this now, where should the table.insert go ?
im surprised no one has made this mod yet
so here is an idea
PZ but Plants vs Zombies soundtrack
with working "intense wave song" if you got spotted by more than 2 zombies
ScriptManager.instance:getItem("Base.MxDebug") gives you like the template for the item, it doesn't actually make an item for you. createNewScriptItem I think also just create a new template so you can customize. if you want to spawn the item in, and give it to yourself, use :
player:getInventory():AddItem("fulltype");
But the template does not appear in the debug item list view
Reinitialize the debug UI?
all the plants are already stored in the SFarmingSystem. its a bit complex, as there are somethings that are accessible to the client, and some which are not. depending on what you want to do, if it is serverside only its fairly easy, if you want client to trigger actions its a bit harder. You can do the following.
for i=1,SFarmingSystem:instance:getLuaObjectCount() do
blah blah blah to effect each plant
end
Tried multiple times, the item does not appear
like I just said, move the table insert, just below the zombieszonedefinition = {}
java.lang.ArrayIndexOutOfBoundsException: Index 200 out of bounds for length 200 at org.luaj.kahluafork.compiler.LexState.new_localvar(LexState.java:768)
Does this mean Kahlua has limitation on array size?
It's a Lua thing.
You shouldn't need to have 200 vars in one file.
This is how Lua is in general.
They are all in on table
But, I can run the script fine. When running in game this error.
Well I have a Lua file where I assign around 2 thousand items to a table. It runs.
There is no way I have that many vars
I believe it's top-level assignments.
From what i read LUA can have infinite array sizes.
or almost infinite depending on memory limitations.
its not a lua limitation, its a kahlua limitation
Thought so
You can do at most 200 variables, because by empirical testing, Lua only allows you to have 200 local variables to any piece of code. Outputs all the numbers from 1 through 200. Lua's local limit is 256, not 200, because the lua interpreter uses bytes as IDs for locals.
No. This is Lua.
Concerning vars in general, got yuh
The Lua development repository, as seen by the Lua team. Mirrored irregularly. Please DO NOT send pull requests. Report issues in the Lua mailing list https://www.lua.org/lua-l.html - lua/lparser.c...
Aint no way I have that many but I could...
I apologize if this is the wrong channel. However there isn't much chat going on in mod support. I just had two quick questions. Does mod load order matter? I am hosting a server for coop and have a few dependancies. I assume the dependancies just go below other mods? Is there a mod load order sorting tool I can download to auto-manage the mod load order like Rimpy for Rimworld?
afaik mod load order does matter, but the mod creators should account for that rather than the user (I could be wrong). mods load in alphabetical order i believe
unsure about a mod load order tool
I see. Thank you for the response. The game has been stable despite a few LUA errors concerning the UI and some items. However I Feel that's mostly in due part to using the controller on the Steam Deck.
many thanks! that's probably what I need!
but I have still a question: within the for loop, how do I access the individual plant? is there something like
local plant = SFarmingSystem:instance:getLuaObject(i) ??
and if I want to do stuff for all plants (independent of the player), should I put the code into the server folder?
ah yeah, thats the one. sorry, accidentally cut that out of my example. If you want it to do stuff for all plants, you want it on the server folder. and also, if you want it to be something that regularly happens, or checks to do something, you want to do that stuff inside a function, then add that function to a relevant event, such as OnEveryHours. You can find alot of examples using this mechanism in vanilla code.
dependancies should take care of themselves as long as they were written properly. however in the case of conflicts, load order does kinda matter, but typically chosing which to go first is just deciding which one you want to be broken rather than there being a specific order in which everything works.
Does anyone know how does one send the command to create a vehicle as a client?
indeed, I am planning to add it to a certain event but I am already familiar with how the events work. π
just to clarify: the code
local plant = SFarmingSystem:instance:getLuaObject(i)
inside the for loop will work? I just made it out of my head without any knowledge. π
sorry I was wrong, the following is from vanilla example of a function doing this
function SFarmingSystem:checkPlant()
for i=1,self:getLuaObjectCount() do
local luaObject = self:getLuaObjectByIndex(i)
blahblah
many thanks!
this good ?
sorry if I am bothering you, I literally have no idea how to mod lol
made my first mod! thanks to some of the folks here for helping me out. simple but made with typescript/pzpw/pipewrench for the tinting part π
https://steamcommunity.com/sharedfiles/filedetails/?id=2851206870
you haven't posted what you did, but just try it in game and see if it works
local function remove_outfits()
ZombiesZoneDefinition = {}
table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});
end
or does it have to come after end ?
as per your request ^^
ah actually between those two lines, you need to recreate the Default table.
ZombiesZoneDefinition.Default = {}
local function remove_outfits()
ZombiesZoneDefinition = {}
ZombiesZoneDefinition.Default = {}
table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});
end
like this ?
Anybody commision mods? Willing to pay
Hey.
I have a market space that's for posting commissions. If you're interested, DM me.
yep
Can anyone help me to add a new satchel to the game? the model is now i just need to code it
Like a backpack?
As long as youβve got the model set up correctly I believe all youβve gotta do is make a new item in the scripts folder and add to the distribution table with a lua script
nvm i was referring to Belt Pouch
I don't know how to add them
It's my first time coding something so idk
this is a bit outdated but it can give you some insight on how to add an item: https://www.youtube.com/watch?v=N6tZujOPnDw
Many many thanks!
Is there a mod that increases the size of the moodles? They are waaaaay too small for 4k resolution.
looks rad
thanks!
Other than the tint does it close the vision cone?
I was trying something similar (although opposite) with NVGs
yeah it does slightly. I actually looked at the implementation of the blind trait mod to see how it was done
You can choose the different settings for it bc what it's actually doing is enabling search mode
I believe it's using the gradientwidth for that? I could be wrong
how are you implementing it out of curiosity?
the game has a native NVG mode - but there's no way to adjust the intensity
ahhh I see
internally it just adjust's darksight and applies a filter of green
I tried looking into adjusting the darksight to match the same values but I didn't see it
can search mode and the nvg mode be activated at the same time?
I guess I could look into cat's eyes
ooo yeah cat's eyes would probably be a good place to look
probably
could try to layer them then too idk
if i do a script override of an item
from another mod
i expect it to list my mod replacing the other mod's item like it normally does
but it doesn't..?
what triggers that listing or not
e.g.
Can someone recommend a good newbie tutorial for making a food mod?
Hey guys, new to the modding scene, I have made a mod for Zangetsu from bleach, the weapon stats and Icon work however the audio and model isnt showing up in game (no noise when swinging, holding invisible sword) would anyone have any tips or know what the issue is? I used a blender file (fbx) I (I think I scaled properly) and mp3 sound files
Dl a mod that just adds a new food to the game and study the txt files, Lua files and folder structure. If you're just making a recipe and new food item that gets created it's pretty straight forward just follow the txt files. If you want it to load into the map and be able to find it while looting you'll have to edit the luas. Also https://github.com/FWolfe/Zomboid-Modding-Guide
Guide to modding various aspects of Project Zomboid - GitHub - FWolfe/Zomboid-Modding-Guide: Guide to modding various aspects of Project Zomboid
I got the audio to work (turns out it had to be ogg) however the model is still invisible π¦ I can't find any info on this
Idk but all I'd say is follow someone else's weapon mod til someone might help you
Im afraid its the mesh as everything else is working fine :/ I'll take a look again tomorrow
hey is there a mod that removes the option to choose one of the 4 maps?
I want to get the map I choose randomized each time, I don't want the option to be manually chosen
I did a search for mods with the search "random start" but found nothing so idk
thank you! I will check this out
Book Consumer
As requested by Klean
Add new options for how book/magazine are consumed and more.
https://steamcommunity.com/sharedfiles/filedetails/?id=2851424239&searchtext=Book+Consumer
i created a "fun time" mod that decreases sadness, boredom, and stress but idk if it should be released into the world.. not my proudest moment but it was necessary for spending long periods of time alone without human contact
How to enable fatigue in debug mode?
What do you mean?
wont work in god mode
Singpleplayer option SleepNeeded is false by default for some reason...
O.o
is there a way to choose what color duffel bag i spawn in?
nvm got it
i have absolutely no clue how doParam works, i'm trying to add an item to an evolved recipe and it just won't work
can anyone help
Can item tweaker insert new variables ?
I need help using the debug mode, how i can use reload lua? since i want to edit the capacity and weight reduction from a bag of stalker armor pack
isn't that in the txt file...
I mean, reload the lua in game
but you want to change the weight and capacity which are in the text file no?
Yeah, i changed them so i want to reload the lua in game because my pc sucks when i try to load pz
I can save much time on it
you can push f11 i think to bring up the menu and search for your lua in the bottom right square text box
Ty
My PZ loading is so bad i can't even to main menu when i started a game lmao
okay i just tested it for you and my initial reasoning was correct, if you change data in the txt file i believe you need to restart the whole game to get those values to update, not just reloading the lua but idk your lua could load these thinks in differently than i do
From what i seen, i don't find the script clothing file
?
Has anyone ever ran into an issue where their 3d model was invisible and if they fixed it?
Any modders willing to get commisioned to make a semi simple mod?
commissioned π . I spend the last week to try and understand PZ moding but would pay someone to get me introduced as the process is painfull
So I kinda got the model to spawn in however Im still lost but this might be more of a blender issue
did you do anything with the .xml files?
the .txt files I used to make the mod?
sorry do you have a textures folder in your mod?
have you seen this yet?
Okay so.....
Might have had the texture set as jpeg and not png
however ran into another issue lmao
oh yeah they should be pngs
sorry i can't help more i'm working on my first model as well
lol cool
just got to fix the offset
Is it supposed to be twice the size of her body
is there a tool for offsetting or is it just playing around in blender or with the template
For weapon models, I put them upside down from the 0,0,0 origin point
Looking at the anime I think the blade should be smaller in diameter
The cutting part should also be larger
It's looks like a big knife
It is kinda just a big knife
I made the handle thinner to make the rest of the knife look bigger
fits in the hand better too
tbh the sword changes size many times in both the anime and manga it wasnt consistent
K, now I understand
what would happen if i had an existing game with no mods but then after a couple days of playing it i add mods to it? would it be corrupted
well i dont excatly have a list but i would add a lot of mods like new guns, pass out, basements
new cloths
basements should be fine as they are technically not on the same map
clothes too
guns should work too
with maps its diff
the map won't spawn on the chunks you aleardy visited
but you can restart these chunks
and it will work
Also
Loot generates when you open something
So you should see new items innit etc
alr
btw i know this isnt a mod question but can you change settings of your game? like zombie lore, nature etc
if you already have a game
or a run that exists
somewhere in the settings i guess
like the actual save settings
Also if ur new to the game check this collection out and choose somethings that you might like
I would suggest 100% adding these two lol
im not actually so sure about the specifics of that mechanism. just in case, maybe you should check if your override is loaded last as well. Are the changes you made applying to the item?
maybe change the mod load order
alot of the time, this can be caused by having another mod that also uses the same modid subscribed. And I mean subscribed in steam. It causes issues even if it is not activated in the game. Because PZ will search all the mod folders you have, and activate the ones with that mod id, so even though the conflict is coming from a different workshop mod, they will still be loaded, but then the server won't have that mod, causing the file does not exist. Double check that you don't have 2 versions of the same mod subscribed.
that is an amazing png XD
most mods are fine without a new save, only issue is that they won't spawn in new items into places you already visited, unless you have loot respawn on. So for example, a new mod that adds items, or vehicles. Any area you have already been into, has had their "round" spawning stuff in. so you won't find any of the new stuff. Although that isn't usually that much of a problem. Whenever I add anything big, I move to a new city, so it will spawn all the new stuff there. Also unfortunately basements will not work on an existing save. idk about the tech details on why, but on their mod page they say it doesn't work.
there is a mod that lets you modify the sandbox settings. But I think it only works in SP
Thank you all so much
Just so you know the mod only allow modifying sandbox options if you start the save file using custom sandbox.
yeah it's working just fine it just doesn't mention the original mod and that seemed weird.
it let me change sandbox options - at least for a mod - when my test save was started on regular apocalypse
didn't try changing anything vanilla
Ill give 35$ to anybody who can make a working bear trap mod
I can prolly up the price if its that hard
Just want one thats gonna stick people in one spot and break their legs. And they have to open it at their feet
Im ignorant on coding in this game tbh but it dont sound like too much coding needs to be done
For those that uses Intellij to decompile PZ code did it happen that the find is no longer showing results in the Java classes? π€ Tried to find any config or something but nope lol
idea for a mod: the ability to use computers as notebook storage, so you can keep track of as many things as you would like
press SHIFT key twice
Yeah I mean, I've done that but is searching inside the lua files, the scripts etc but not in the Java classes
not this?
You're searching the class there, I want the content inside the class
well I don't know then π
Like I know "Outdoorsman" word exist inside IsoGameCharacter, but now it is only finding it in the lua file π€ weird
its not really an answer to your problem but I usually prefer using vscode for finding in files
VS Code FTW β€οΈ
I use Vscode for modding and Intellij to see the PZ Code, will check if I can using vscode
In vscode you have an extension for decompile right? Intellij does it all alone but vscode as I know doesn't
i dont use intelij at all other than maybe decompiling
i know you have Emmylua plugin for vscode but it doesnt give as much as emmylua in intelij with the modules plugged in
otherwise PipeWrench has everything java and lua auto-complete and allows to write your mod in typescript.
For vscode I use this but I need something to decompile Java I think because I can't see the code
You can use IntelliJ to decompile jars into .java files that you then open in VSCode or your editor of choice
Probably the best option π€ weird anyway why I can't search inside the java files
