#mod_development
1 messages · Page 74 of 1
no
but i triedd on a car
i am thinking that might be the issue.
and what you told me they are all the same right
maybe
but im not sure really ..
they are. but i am wondering if a vheicle being towed breaks time and space.
itheres no other whole world of lua just for trailers excpt maybe the towable parts
wtf
skizot break time and space not trailers
Is there a mod that allows players to be in more then one safehouse
Hi again, should I be putting this in the same file as the trait itself, or a new file that requires the trait file? I'm a bit confused by that
yes cuz its a local function
if its a global you choose not to put it on the same file and just use require
local function Loader()
--TraitFactory.addTrait("","",0,"",false,false)
local SunlightSensitive = TraitFactory.addTrait("sunlightsensitive","Sunlight Sensitive",-10,"Take periodic damage whilst outside in the day time. \n (Does not activate when indoors)",false,false)
end
Events.OnGameBoot.Add(Loader);
local function TraitSunlightSensitive()
local player = getPlayer();
local timeOfDay = getGameTime():getTimeOfDay();
if timeOfDay > 9 and timeOfDay < 20 and player:isOutside() then
public void AddDamage((player.getPlayerNum),5)
end
end
Events.EveryOneMinute.Add(TraitSunlightSensitive)
trailers break reality
Does player:isOutside() return true if they're inside a vehicle? You shouldn't take sun damage if you're in a vehicle...
Well I'm having issues just getting it working in general tbh
local function TraitSunlightSensitive()
local player = getPlayer();
local timeOfDay = getGameTime():getTimeOfDay();
if timeOfDay > 9 and timeOfDay < 20 and player:isOutside() then
AddDamage((player.getPlayerNum),5)
end
end
Events.EveryOneMinute.Add(TraitSunlightSensitive)
I think the add damage isn't right
So something like player:getBodyDamage():AddDamage(bodyPart, amount)?
yee
that should work
you should be able to just ZombRand the bodypart from the table if you dont wanna pick it
but- I would consider making it have some sort of other reduction, like maybe just giving the player pain
Also @molten cobalt have you added the decompiled java and vanilla lua files to your IDE, so you get intellisense etc?
Is it possible to limit what can be put into a container and prevent people from taking anything out of it?
Yes
Would I set that in the tile definitions?
I have a lockout function set, you'd be the second person other than me to use it - so I'ma make it an API

@finite owl I haven't done that yet no, what would that give me, sorry I've very new to all this
@winter thunder
Thank you both I'll try doing that and see how I get on
So in-game it throws an error when I walk outside, maybe this isn't correct for some reason?
player:getBodyDamage():AddDamage(ZombRand, 10)
Try something like this
local part = bodyParts[(ZombRand(14)+1)]
player:getBodyDamage():AddDamage(part, 10)
@molten cobalt
Still getting an error when In-game :/
On the second line in the section you posted above
Still nope, I appreciate the help by the way
is it possible to unhook a car being towed via lua?
What's the specific error being thrown? You'll normally see a Java stacktrace, followed by some log lines saying the Lua files that were active at the time the error occurred (effectively the "lua stacktrace"). The important info is usually the specific error before the Java stacktrace.
So that says that you have an expression which evaluates to null, but you're trying to index it (using a value of 3.0).
Is the error on this line? local part = bodyParts[(ZombRand(14)+1)]?
Yeah, that UI isn't very accurate. You'll see it's saying the error is on line 12, but it's highlighted line 13
So bodyParts isn't defined.
... it is because it should be a capital b
Is there a global BodyParts object then?
believe so
Another option might be to use player:getBodyDamage():getBodyParts() to get the body parts for the player. That might future-proof against TIS adding other body parts for things like animals...
So you'd have something like
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPart = allBodyParts:get(ZombRand(allBodyParts:size()))
player:getBodyDamage():AddDamage(bodyPart, 10)
(allBodyParts is a Java ArrayList, so it's indexed from 0 rather than a Lua table indexed from 1)
Really appreciate this help btw, giving me an insight on how all this works 🙂
No worries! What we are here for :)
Ok yeah that works now 🙂
Just it only seems to be damaging the left hand and nothing else lol
I don't know about others, but I mostly come to this channel when I have questions myself, and it seems like good karma to help anyone I can while I'm here 😁
It should pick a random body part each time.
It triggers every 10 minutes? So how long did that character stand in the sunlight?
Every minute it triggers
I'm just stood outside now watching it and its just doing the left hand all the time
Hmm, I haven't used ZombRand before, let me have a look
But- If youd like, there is climate variables as well. Things like ->
isRaining()
isSnowing()
getDayLightStrength()
getFogIntensity()
getGlobalLightIntensity()
So you can also check for the specific conditions, since if it is raining and stormy- you should be able to go outside
Yeah I 100% want to implement those things into, even some sort of tiered vamparism that could be reduced with items etc
One thing that is pretty common is to stick some debugging print statements in your Lua code when working on it, so you can see what's going on in your code in the log. print("Vampire debug: picked random body part ", bodyPart) or similar
But print actually takes any number of args and prints them all
hey all, need a small tidbit of help regarding what file this is refering to in regards to the teachedrecipies
@molten cobalt Actually, a good one to consider. There is code for the following - getDawn & getDusk. Which I think gives back an int for the time that dusk and dawn are for the current day
it is via a context in tsarlib so im guessing it's possible
That is referencing the script file in ProjectZomboid\media\scripts called models_items
Yeah I saw those when I was thinking of it, so yeah now I've got more of an idea how things work I could use that, I think 9am is technically day, and 8pm is night time but not sure if that changes with the seasons etc
ty
it does
So @molten cobalt you could break it up so you can see what's going on
local allBodyParts = player:getBodyDamage():getBodyParts()
print("Vampire debug: got " .. allBodyParts:size() .. " body parts")
local bodyPartIndex = ZombRand(allBodyParts:size())
print("Vampire debug: picked body part index ", bodyPartIndex)
local bodyPart = allBodyParts:get(bodyPartIndex)
print("Vampire debug: damaging body part ", bodyPart)
player:getBodyDamage():AddDamage(bodyPart, 10)
Wait- Did you want the items texture?
oh yeah no
And then if the bodyPartIndex values look like they're nicely spread out, but it's always damaging the same part, then you'd know that the problem was with the AddDamage call, or something
ohhhhhhhhhhhh
sorry
lol
I thought you meant the highlighted line
i really need to read through things lol
just wondering where it actually is
ik it has something to do with how its not just a single recipe
i wouldnt know where to find it though....
A quick search suggested that Herbalist is hard coded.
public boolean isKnownPoison(InventoryItem var1) {
(stuff)
} else if (var2.getHerbalistType() != null && !var2.getHerbalistType().isEmpty()) {
return this.isRecipeKnown("Herbalist");
}
used a bad example
I got an error when in-game, where in that error should I see the randomisation for line 18?
Where you just looking for a way to add recipes from books?
probably bc herbalist doesnt really have recipe, if i look at metalworkingmag3 it shows the recipes
yeah
oh word, yeah- You just list them
Type = Normal,There are various types of items in Project Zomobid, below you will se each of them with a short description. Normal – A basic item. Drainable – An item that has a certain amount of uses before it's destroyed Food – An item that can be consumed by the character Weapon – An item that...
This is usually a good source for things related to scripts and recipes
You need to scroll that stacktrace below the java callstack to see which Lua line is really causing the "no implementation found" issue
ty
id also have to add this custom magazine into the spawn pool i assume
which i dont know how to do either lmao
IME "no implementation found" means that the arguments to a function call are not of the expected type. Java supports polymorphism where you can have multiple implementations for the same function with differently-typed parameters, and it invokes the one whose params match. When called from Lua, it searches for the right implementation based on the types of the converted Lua values, and throws that error if it can't find a matching parameter type signature
try
local selectedBodyPart = player:getBodyDamage():getBodyParts():get(n);```
where n is index of bodypart
ctrl+f for "MTDTraitGainsByInjuries" here: https://github.com/hypnotoadtrance/MoreTraits/blob/master/Contents/mods/More Traits - Dynamic/media/lua/client/MoreTraits - Dynamic.lua
there's function that checks specific bodyparts for injuries, that can help
I mean, he already has player:getBodyDamage():getBodyParts() stored in the local var allBodyParts
All good 😁
@molten cobalt What actual line is the error coming from? And what did the print statements say leading up to the error?
12 according to this
attempted index:3.0 of non-table: null
then the same line for the next error
expected a method call but got a function call
can u send code?
Yeah, I've lost track of what the code looks like at this point 🙂
method call vs. function call is generally because something is blah.function() (with a dot) instead of blah:function() (with a colon)

Lua uses the colon as a shorthand to pass the object as an implicit first parameter (when invoking a function), or to expect an implicit first "self" parameter (when defining a function).
So invoking blah:function(1, 2, 3) is the same as blah.function(blah, 1, 2, 3).
local function Loader()
--TraitFactory.addTrait("","",0,"",false,false)
local SunlightSensitive = TraitFactory.addTrait("sunlightsensitive","Sunlight Sensitive",-10,"Take periodic damage whilst outside in the day time. \n (Does not activate when indoors)",false,false)
end
Events.OnGameBoot.Add(Loader);
local function TraitSunlightSensitive()
local player = getPlayer();
local timeOfDay = getGameTime():getTimeOfDay();
if timeOfDay > 9 and timeOfDay < 20 and player:isOutside() then
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPart = allBodyParts:get(ZombRand(allBodyParts:size()))
player:getBodyDamage():AddDamage(bodyPart, 10)
end
end
Events.EveryOneMinute.Add(TraitSunlightSensitive)
That is what we had that worked, which now doesn't work lol
And which line gave the "no implementation found" error?
(Or what error are we looking at now?)
Give me 2 secs
Ah, I think I see the problem.
The params of the two AddDamage methods on BodyDamage expect either (BodyPartType type, float damage), or (int bodyPartIndex, float damage). There is no implementation which expects (BodyPart part, float damage)
So passing in bodyPart as the 1st param to AddDamage isn't going to work.
In fact, all the version which takes an index does is this:
public void AddDamage(int var1, float var2) {
((BodyPart)this.getBodyParts().get(var1)).AddDamage(var2);
}
So you can call AddDamage on bodyPart directly.
So you could either do
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPart = allBodyParts:get(ZombRand(allBodyParts:size()))
bodyPart:AddDamage(10)
or
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPartIndex = ZombRand(allBodyParts:size())
player:getBodyDamage():AddDamage(bodyPartIndex, 10)
Whichever you prefer
i just need a car:disconnecttowing() or something like that.
@finite owl that has worked and is randomising the damage as I wanted it to, thanks so much for the help, its slowly making more and more sense as I go on
local function Loader()
--TraitFactory.addTrait("","",0,"",false,false)
local SunlightSensitive = TraitFactory.addTrait("sunlightsensitive","Sunlight Sensitive",-10,"Take periodic damage whilst outside in the day time. \n (Does not activate when indoors)",false,false)
end
Events.OnGameBoot.Add(Loader);
local function TraitSunlightSensitive()
local player = getPlayer();
local timeOfDay = getGameTime():getTimeOfDay();
if timeOfDay > 9 and timeOfDay < 20 and player:isOutside() then
local n = ZombRand(player:getBodyDamage():getBodyParts():size())
local selectedBodyPart = player:getBodyDamage():getBodyParts():get(n);
print("selectedBodyPart:"..tostring(selectedBodyPart))
selectedBodyPart:AddDamage(5)
end
end
Events.EveryOneMinute.Add(TraitSunlightSensitive)
there, fixed it @molten cobalt
not sure if zombrand should be player:getBodyDamage():getBodyParts():size() or player:getBodyDamage():getBodyParts():size() - 1
think - 1 but you gonna have to test urself
lol where can I hire a modder
ZombRand seems to return from 0 to N-1, and the body parts are a java ArrayList, so it's 0 index.
Or you could just set the vampire character on fire when they go outside, and bypass all this "pick a random body part" business 😆
Maybe it could be a alternative mode aha
anyone remembers if getStats():getStress() has values between 0 and 1 or 0 and 100
fucking annoying to test
If you find out, pls lmk

I am curious ab a lot of the effects, tbh
or stats
i mean
I dont know their bounds, or default values
FWIW, setStressFromCigarettes clamps the value from 0 to 0.51, so that implies it's from 0.0 to 1.0
public float getMaxStressFromCigarettes() {
return 0.51F;
}
public void setStressFromCigarettes(float var1) {
this.stressFromCigarettes = PZMath.clamp(var1, 0.0F, this.getMaxStressFromCigarettes());
}
yep, from 0 to 1
i hate this inconsistency

who needs consistency in our game right

stress is 0-1, unhappiness is 0-100
classic game experience 
The fun part is that destress items get their values divided
From the client it just uses a client command:
local args = { vehicle = self.vehicle:getId() }
sendClientCommand(self.character, 'vehicle', 'detachTrailer', args)
But I can't for the life of me find anything on the server side which reacts to that client command 
Oh, wow, GameServer.receiveClientCommand explicitly handles vehicle client commands specially.
if (!"vehicle".equals(var4) || !"remove".equals(var5) || Core.bDebug || PlayerType.isPrivileged(var1.accessLevel) || var8.networkAI.isDismantleAllowed()) {
LuaEventManager.triggerEvent("OnClientCommand", var4, var5, var8, var7);
}
But also- I am messing with the lua event manager, adding/removing events. Is that going to be something that will effect everyone?
Like, I want to have something added when a specific player uses a drug. Code at the end of this is a super general example of what I mean with the code I am messing with. When these are added, will they be in effect for EVERYONE? Or just the specific player? I'm under the assumption that if I put these into client that it will only matter for the specific player, but idk much about this.
Wanna make sure that I dont accidentally mess this up royally lol
function every10mins()
-- check players mod data, reduce effective duration by 1.
local duration = getPlayer():getModData().DrugDuration
if duration = 0 then
Events.EveryMinute.Remove(DrugEffectPerMinute)
Events.EveryTenMinute.Remove(every10mins)
end
else
getPlayer():getModData().DrugDuration = (duration - 1)
end
end
------------------------------------
function DrugEffectPerMinute()
-- give player stat bonus or trigger effect. Considering multiplying these values based on world speed (?)
-- example vvv
local stats = getPlayer():getStats()
local NewEndurance = (stats:getEndurance() + 2)
stats:setEndurance(NewEndurance)
end
------------------------------------
function TakeDrug()
if Cumulative Potency >= x then
Events.EveryMinute.Add(DrugEffectPerMinute)
Events.EveryTenMinute.Add(every10mins)
end
end
You're using getPlayer(), so it's client-side code?
yep
honestly just wrote that out now for the example lol
I dont know the best way to go about implementing this- Sorta running it blind
drugs should be on client side, so lua/client folder
Right
all files in that folder are executed client side
so its safe to remove events after adding them
i do same, lemme send example
hell yeah
Alright sweet, I just wanted to be 100% sure so i wasnt accidentally breaking anything when it is ran in mp
local function catEyes() -- confirmed working
local player = getPlayer();
local nightStrength = getClimateManager():getNightStrength()
local playerNum = player:getPlayerNum();
local checkedSquares = 0;
local squaresVisible = 0;
local darknessLevel = 0;
local square;
local plX, plY, plZ = player:getX(), player:getY(), player:getZ();
local radius = 30;
local modData = player:getModData().DynamicTraitsWorld;
for x = -radius, radius do
for y = -radius, radius do
square = getCell():getGridSquare(plX + x, plY + y, plZ);
checkedSquares = checkedSquares + 1;
if square and square:isCanSee(playerNum) then
local squareDarknessLevel = nightStrength * (1 - square:getLightLevel(playerNum)) * 0.01 * (square:isInARoom() and player:isInARoom() and 2 or 1);
squaresVisible = squaresVisible + 1;
darknessLevel = darknessLevel + squareDarknessLevel;
modData.CatEyesCounter = modData.CatEyesCounter + squareDarknessLevel;
end
end
end
--print("DTW Logger: Checked squares: "..checkedSquares..", visible squares: "..squaresVisible.." with total darkness level of "..darknessLevel);
--print("DTW Logger: CatEyesCounter: "..modData.CatEyesCounter);
if not player:HasTrait("NightVision") and modData.CatEyesCounter >= SBvars.CatEyesCounter then
player:getTraits():add("NightVision");
HaloTextHelper.addTextWithArrow(player, getText("UI_trait_NightVision"), true, HaloTextHelper.getColorGreen());
Events.EveryOneMinute.Remove(catEyes);
end
end
this is run client side everyminute
until player gets the trait
then it's removed
and not launched anymore cuz of the way it's added to events
local function initializeEvents(playerIndex, player)
if SBvars.CatEyes == true and not player:HasTrait("NightVision") then Events.EveryOneMinute.Add(catEyes) end
if SBvars.SleepSystem == true then Events.EveryTenMinutes.Add(sleepSystem) end
end
Events.OnCreatePlayer.Add(initializeEvents);
so once player gets it it's straight up removed for the rest of the gaming session
and next time they log in
it wont even add it cuz they got the trait
With the code I sent- What would happen in the player logged off before their duration hit 0?
So- Should I consider triggering this function (or a modified version) when the player loads in / joins?
function every10mins()
-- check players mod data, reduce effective duration by 1.
local duration = getPlayer():getModData().DrugDuration
if duration = 0 then
Events.EveryMinute.Remove(DrugEffectPerMinute)
Events.EveryTenMinute.Remove(every10mins)
end
else
getPlayer():getModData().DrugDuration = (duration - 1)
end
end
Oops
I'd recommend adding moddata, something like this (pseudocode)
modData.YourModName = modData.YourModName or {}
modData.YourModName.DrugXYZduration = modData.YourModName.DrugXYZdurationLeft or 0;
``` and then writing leftover duration in it adding event onCharacterCreate() to run it
why you run every ten minutes and then run every minute from it?

its not, one function runs every minute. The other runs every 10 to see if it should still run lol
that's unneeded
No worries
Yes pls the scroll and click on icon isnt working on my version
gime 3 min
@winter thunder I'd do something like this
function DrugXYZEffectPerMinute()
local player = getPlayer();
player:getModData().YourModName = player:getModData().YourModName or {};
local modData = getPlayer():getModData().YourModName;
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft or 0;
if modData.DrugXYZPotencyLeft ~= 0 then
local stats = getPlayer():getStats()
local NewEndurance = (stats:getEndurance() + 2)
stats:setEndurance(NewEndurance)
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft - 1
else
Events.EveryMinute.Remove(DrugXYZEffectPerMinute)
end
end
------------------------------------
function DrugsInPlayerSystem()
local player = getPlayer();
player:getModData().YourModName = player:getModData().YourModName or {};
local modData = getPlayer():getModData().YourModName;
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft or 0;
if modData.DrugXYZPotencyLeft >= x then
Events.EveryMinute.Add(DrugXYZEffectPerMinute)
end
end
Events.OnCreatePlayer.Add(DrugsInPlayerSystem);
you will also have to find a way to check if player taked drugs
and from there set your player:getModData().YourModName.DrugXYZPotencyLeft to something
and then add make it add Event back in
I already have it, you can set custom functions in the OnEat variable in food items
The way to check if they have taken drugs i mean
ye then there increase ur modData for that drug
and add event there
that starts checking stuff every minute until it wears off
So when does the OnCreatePlayer trigger?
when character loads in
hell yeah
every time, not only 1st one
sweet
OnTest
huh?
Yeah, OnEat takes any function. And naturally pushes the player, and the item consumed into the function
What do you mean?
Like when ur high youre bound to get sobered up at some point
Nah his makong drug mod
hahaha

But yeah, I am going to basically tie into the event discussion above. If the remaining is > 0, and then is set = to 0, it will basically add some negative effects to simulate the comedown
you dont even need separate event for that
since ur function is ONLY ran when drug is in the system, you can add effects when it hits 0
well if u want them over period of time you need separate function
if modData.DrugXYZPotencyLeft ~= 0 then
local stats = getPlayer():getStats()
local NewEndurance = (stats:getEndurance() + 2)
stats:setEndurance(NewEndurance)
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft - 1
if modData.DrugXYZPotencyLeft = 0 then
Events.EveryMinute.Add(DrugComedown)
end
else
Events.EveryMinute.Remove(DrugXYZEffectPerMinute)
end
Like this
ye
Wait
ye it'll never do it
but that would mean they have 1 min of the high and the comedown
It is reducing that variable on the line above tho, right?
nested if ugly, but I think it would work?
oh... It is hitting the end and never the else... I see
function DrugXYZAfterEffects()
local player = getPlayer();
player:getModData().YourModName = player:getModData().YourModName or {};
local modData = getPlayer():getModData().YourModName;
modData.DrugXYZAfterEffectsDurationLeft = modData.DrugXYZAfterEffectsDurationLeft or 0;
if modData.DrugXYZAfterEffectsDurationLeft ~= 0 then
-- do some stuff
modData.DrugXYZAfterEffectsDurationLeft = modData.DrugXYZAfterEffectsDurationLeft - 1
else
Events.EveryMinute.Remove(DrugXYZAfterEffects)
end
end
function DrugXYZEffectPerMinute()
local player = getPlayer();
player:getModData().YourModName = player:getModData().YourModName or {};
local modData = getPlayer():getModData().YourModName;
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft or 0;
if modData.DrugXYZPotencyLeft ~= 0 then
local stats = getPlayer():getStats()
local NewEndurance = (stats:getEndurance() + 2)
stats:setEndurance(NewEndurance)
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft - 1
else
Events.EveryMinute.Remove(DrugXYZEffectPerMinute)
modData.DrugXYZAfterEffectsDurationLeft = 10; -- 10 min
Events.EveryMinute.Add(DrugXYZAfterEffects)
end
end
------------------------------------
function DrugsInPlayerSystem()
local player = getPlayer();
player:getModData().YourModName = player:getModData().YourModName or {};
local modData = getPlayer():getModData().YourModName;
modData.DrugXYZPotencyLeft = modData.DrugXYZPotencyLeft or 0;
modData.DrugXYZAfterEffectsDurationLeft = modData.DrugXYZAfterEffectsDurationLeft or 0
if modData.DrugXYZPotencyLeft >= x or modData.DrugXYZAfterEffectsDurationLeft >= 0 then
Events.EveryMinute.Add(DrugXYZEffectPerMinute)
end
end
Events.OnCreatePlayer.Add(DrugsInPlayerSystem);
Basically just have a seperate function to check if the player has drugs on load in, but dont include the add event on 0 clause. If it runs while they are already in game, then keep track of comedown effect
you dont need separate func, check code i sent
lets say player has no drugs and only aftereffects are left and he logs out
he loads in
it fires drugs in player system
or wait need another clause in if
there
so drugsinplayersystem sees that there's either drugs in system or aftereffects in system
so it adds Events.EveryMinute.Add(DrugXYZEffectPerMinute)
could this work theoretically
DrugXYZEffectPerMinute sees that Drug duration is 0 so it removes itself from events and adds aftereffects to events
@winter thunder got the idea?
Yeah! I really appreciate the help
I will try my best 🫡 No promises though
noisemaker
or atleast be able to visualize tile distance
idk
actually
i think its working
lmfao yeah- Sure seems like it haha
oh- Yeah... That uh. That is a lot lmao
i play with insane zombies
so i need a way to wrangle the hordes
im also playing an engineer
so
trying to use innovative ways to beat the undead
unfortunately the default traps are lackluster
i might make a mod for that too tbh
thats when i say fk it, grab a molotov and shotgun with a single shell, and go at it
hopefully the one zombie I kill has a lighter or matches on it
hah
Anyone know what the endurance is set at? 0-1 or 0-100?
0 - 1, incase anyone was wondering
is there a tutorial on how to make helmet
so with this, i would have to get the vehicle towing my trailer and then tell THAT to disconnect it?
time to make a giant mod that just combines all firearms to be able to work together
how to hide vanilla "trade" context menu, instead of disable it using notAvailable = true?
Does anyone know how to add a light source and show it at x, y, z? I tried making a custom IsoLightSource and I can confirm that it instantiated, but I am not clear how to make it visible.
Could anyone help me get started modding? I'm not necessarily wanting to make anything big, and I don't really have any experience coding, I'd just like to make a couple simple mods to mess with with my friends
I completely understand if you don't want to waste your time lmao
Hello! Is there a link to the variables surrounding items, i am struggling to find it, scrap this, found the list
https://pzwiki.net/wiki/Modding Here's where I went!
thanks!
Is it possible to heavily mod the main menu, like changing the actual layout?
All I've seen for main menu mods are replacements of the background
Type = Normal,There are various types of items in Project Zomobid, below you will se each of them with a short description. Normal – A basic item. Drainable – An item that has a certain amount of uses before it's destroyed Food – An item that can be consumed by the character Weapon – An item that...
This is a great place to start imo
Pretty sure all the layout in game is handled through lua- I might be wrong, but that would mean you could mess with everything
Actually
@tranquil reef Main menu is located here
media\lua\client\OptionScreens\MainScreen.lua
Weird there's not really any public mods that already do it lol
to try and make it look like that remake that was posted.
I think its bc UI is already such a pain to mess with lol
I would say out of all the people who mod this game, a tiny fraction of them actually do any serious UI work
local theTruck = vehicle:getVehicleTowing():getId(); would that work?
brandon i LIVE in the ui at the moment
I was slightly tempted to recreate the Left 4 Dead main menu layout but I'm not too sure if I will lol
I usually improvise with this stuff
Wake up one day, "Zombie kidnapping mod" and then in 8 hours with no breaks it exists
while here, can I have nested tables in mod data?
like
getPlayer():getModData().MyMod = getPlayer():getModData().MyMod or {};
local modData = getPlayer():getModData().MyMod
local x = 1
modData
modData.Example = modData.Example or {};
modData.Example.Poptart = modData.Example.Poptart or 0;
getPlayer():getModData().MyMod.Example.Poptart = x
uhhhh
You know- I need to stop coding late at night...
DAMMIT now i wanna make one.
"THE MOST LOUDEST & CRAZIEST YES! CHANT FOR DANIEL BRYAN IN PROVIDENCE AT THE DUNKIN' DONUTS CENTER"
Nice, I think cell:addLamppost(self.lightSource) may be among the key steps I am missing. Thanks. I wonder if this is available and updated on Workshop...
I don't see anything on Workshop unfortunately
But I can extract the essential functions for my situation
I would like to quickly commemorate this man for including a bug & giving steps to fix it, doing God's work
Think that might be the Diakon here
It almost definitely is
Whoa
also-
If I have a variable that will = the name of a variable in the mod data, would the notation to get that be something like this? ->
function (ModDataVariableName)
local player = getPlayer()
player:getModData().MyMod[ModDataVariableName]
Yes
?
I see the param
You have it right
sweet
yeah! Just wanted to make sure lol
Just making sure
You can also do player:getModData().MyMod.MyModVariable but passing as string doesn't work so smoothly that way
Depends on the situation which notation feels better
Adding an event OnPlayerCreate to initialize my tables :)
So I will be sure to do that lol
So- For the sake of just making sure my tables exist, is this a good way to go about it?
function InitializePlayerDrugData()
local playerMD = getPlayer():getModData()
-- Core data related to mod
playerMD.StreetPharma = player:getModData().StreetPharma or {};
local modData = playerMD.StreetPharma;
-- Effect durations currently effecting the player.
playerMD.StreetPharmaDurations = playerMD.StreetPharmaDurations or {};
local durationData = playerMD.StreetPharmaDurations;
--just examples below, but should I also initialize the variables of those tables?
durationData.Stimulants = durationData.Stimulants or 0
durationData.Narcotics= durationData.Narcotics or 0
-- Records of drug use.
playerMD.StreetPharmaRecords = playerMD.StreetPharmaRecords or {};
local recordsData = playerMD.StreetPharmaRecords;
if modData and durationData and recordsData then
print("Street Pharma Initialized Successfully!")
end
end
Events.OnCreatePlayer.Add(InitializePlayerDrugData);
How can I check a corpse's gender
back again, wondering how you add custom sandbox options for your mod
declaration: package: zombie.core.skinnedmodel, class: DeadBodyAtlas
I think it might be here
holy crap... their ui is rediculous.
Is the code just really ugly looking or is it like CSS lol
Change one thing and everything else screws up
it';s both
they HAVE to have either a WSYWYG program for editing it, or someone with SERIOUS mental proclivity towards self hate.
CSS isn't that bad
I mean, CSS like 10 years ago for sure
looks good! there's a little syntax error on this line:
playerMD.StreetPharma = player:getModData().StreetPharma or {}
-- should be:
playerMD.StreetPharma = playerMD.StreetPharma or {}
```but as this was a few minutes ago you might have already corrected that
I personally hate all of it lol, but yeah, centering anything kills me
I uh... I didnt... 🐸
I really need to stop coding late at night lol
well this is fun,
local TsignDistance = {}
for k,v in ipairs(TrailerSignPlacement) do
if v.loc == CurrLoc or v.loc == random_loc then
table.insert(TsignDistance, v)
end
end
how do i make it so currloc i ALWAYS the first in TsignDistance ?
are you trying to insert it to the start of the table? table.insert(TsignDistance, v, 1)
nvmi did it a little different
it was weird they way i had it becasue it basically made all the cities in the array BEFORE the current location, be the leaving location and it's like THAT'S WRONG!
the fricking shipping mod is gonna drive me to drink i swur
OKAY
so i am to a fun point.
it's PLAYABLE.
wait... it's "Playable"
them quotes are needed. lol
aye guys ! I'm a professional at making music and fell in love with this game a year ago, I'll do any voice acting (voices range from insane scientist - rugged survivor - your grandchilds grandchild) Hit me up if you need some clips! Also have a ZOOM field recorder so if there's any specific sound you want sampled in the game I'll go get them for free! ❤️ love you guya
Implying any sound I can record from ANYTHING outside, if you need the sound for it I'll hop out on an adventure and get it for you at 48hz (movie quality)
Also wondering if anyone has any info on the survivor radio mod and the functioning of the audio file broadcast
would very much to revive it or toss a channel of my own but can't find a way for it to openly play sound files in MP not even with the aeldri patch
might just have to recode the reverend to preach world peace and everyone becomes super happy while I'm singing a singular Cm note
so i'm getting somewhere. just need to figure out how to center those.
and then increase the font etc ya know.
In case anyone is actually interested I finally figured out the issue here:
The left side part is overlapping to next cell by 2px and the game then draws the wall on the next cell on top of the picture and that's why there's a sliver missing
told ya to move it 😛
Take a break man
Lifesaving wizardry! Thankkkk yooouuuuu! Omg
lmk if the "how to use" needs clearing up
But i wont be able to use my custom icon tho or is there a parameter
i'm pretty much done. i just gotta touch up the turn in and then make it pay people.
Im not at home atm. I will probably tom evening
oh, that's a good point
i just need to figure out how to center a label.
you shift it's x by half its width
....
i know that part.
but to make the game DO that. there's the fun part.
and ONLY to the text!
Are you using DrawText() ?
there's a drawTextCenter
no i'm using country add override on teir menu lol.
idk what that is
for _,child in pairs(self.bottomPanel:getChildren()) do
if child.Type == "ISLabel" then
child:setWidth(maxWidth)
child:drawTextCenter()
end
end
yeah that aint do it lol
drawtext requires paramters for the text
DrawTextCentre
if you aren't using drawText() then it's not viable
danged brits
@ancient grail I added a function for texture setting just call it anywhere
---How To Use:
--Define local copy of `containerLockout` using require
local containerLockout = require "containerLockout-shared"
local function func(mapObject, player)
--add conditions here, for example:
if player:getModData().blockView == true then return false end
end
containerLockout.addFunction(func)
---default texture: "media/ui/lock.png"
--function containerLockout.setTexture(texturePath)
probably should factor in what is locking it but meh
local label = ISLabel:new(10, self.bottomPanel.y - 30, FONT_HGT_SMALL, "", 1, 1, 1, 1, UIFont.Small, true)
that appears to be how they are drawn.
that's how i am setting the width
eh?
Do have that on github? Cuz ill defntly study it now
Yeah, but what I posted is all you need
But this is the label not the frame
@sour island
<@&986122150958202931> the latest update of the Journal Mod Broke the Transcribing. Old Skill Cannot be Transcribe. and even if Admin give you EXP you still cannot Save it on the Journal. Unfortunately you have to Grind it again from the Start. and for that i will Slightly increase the EXP Multiplier.
doubt
This was from @smoky meadow
oh, old xp, yeah
whatever they hadn't transcribed before the update can't be transcribed
Ow i thought it was a bug he just told me u are aware
nah, just a growing pain

@weak sierra sorry to tag u mam. one of your mods is spamming prints. Was that intentional?
I think it was the car respawn
Theres also another mod that spams on loop as you hover any inventory item. No idea what mod it is nor who made it .
grab fingerPrint
does somebody have the list of approved mods? just downloaded and skipped by the link by accident
self.tutorialOption = ISLabel:new(labelX, labelY, labelHgt, getText("UI_mainscreen_tutorial"), 1, 1, 1, 1, UIFont.Large, true);
self.tutorialOption.internal = "TUTORIAL";
self.tutorialOption:initialise();
self.tutorialOption.onMouseDown = MainScreen.onMenuItemMouseDownMainMenu;
self.bottomPanel:addChild(self.tutorialOption);
labelY = labelY + labelHgt
``` this is where they set them. have not found a single one that is centered.
Yep thats wht i told them to do
But ossalion must have forgotten
Error magnifier and fingerprint is the same mod right
no
Ow ok
@sour island is it possible to create an api that suppresses print from mods that you list
Like for example
stopPrintsFrom('glytch3rsMod')
yes

well damn i can't find JACK on the ISLABELs
Sent u a file
I thought you meant to move them "closer" to each other to fill in the gap not change the origin point, my bad
🙂
function checkVar(var)
if var == nil or var == '' or var == false then return false
elseif var ~= nil or var == true then return true
end
end
function isNull(var)
if var == nil or var == "" then
return true
else
return false
end
end
will something like this be useful on the community mod you are building? @sour island
it just checks if theres anything on that var
so we can use "get" as if its "is"
checkVar(getPlayer():getVehicle())
-- will return true instead of the actual object
sooooooooo
I don't know what it is about 'Join' but alignment looks like this: ')'
what the heck did you just do
i did... a thing.
were you off doing stuff in the naughty zone again?
local SkizotsNaughtyZone = everywhere
Ooh that is clean
But also
Have you been working on that this whole time?
Because I thought I was the only one coding for like 14 hours today 😂
im trying to lock some recipes behind the mechanic profession but the recipes im trying to add show up for everyone else too
Variable in the recipes, I think “KnowOnStart”? defaults to true, you have to set it to false
Lmk if that works for you
{
KnowOnStart=false
SkillRequired:MetalWelding=3,
BlowTorch=4,
Prop1: BlowTorch,
Sound: BlowTorch,
keep WeldingMask,
CanBeDoneFromFloor:true,
FrontCarDoor1/FrontCarDoor2/FrontCarDoor3/FrontCarDoor8/RearCarDoor1/RearCarDoor2/RearCarDoor3/RearCarDoor8/RearCarDoorDouble1/RearCarDoorDouble2/RearCarDoorDouble3/RearCarDoorDouble8/ECTO1CarFrontDoor2/ECTO1CarRearDoor2/M998BackCover1_Item/M998BackCover2_Item/IFAVDoor2/SL500Door3/W460CarFrontDoor2/W460CarRearDoor2/R32Door3/McLarenF1Door3/E150CarFrontDoor2/E150CarSlideDoor2/DG70Door3/fhqFusFleaSupDoor/NivaLeftDoor1/NivaRightDoor1/89BroncoCarFrontDoor2/88ChevyS10CarFrontDoor2/82JeepJ10CarFrontDoor2/CadillacFuneralCoachDoorSC1/CadillacFuneralCoachRearDoorSC1/ChevyBlazerDoorSC2/ChevyCamaroDoorSC3/ChevyCapriceFrontDoorSC1/ChevyCapriceRearDoorSC1/ChevyG30FrontDoorSC2/ChevyG30RearDoorsSC2/ChevyG30SideDoorSC2/ChevyG30RearDoorsSC2/ChevyP30DoorSC2/ChevyP30RearDoorsSC2/M1010RearDoors2/FireCoachFrontDoor2/FordBroncoDoorSC2/FordCrownVictoriaDoorSC1/FordCrownVictoriaRearDoorSC1/FordCrownVictoriaRearDoorSC1/FordExplorerFrontDoorSC2/FordExplorerRearDoorSC2/FordF150DoorSC2/FordF150RearDoorSC2/FordF700DoorSC2/FordF700RearDoorSC2/FordF700BoxTruckRollUpDoorSC2/HondaAccordDoorSC1/JeepCherokeeDoorSC2/JeepCJ7DoorSC2/M35Door2/MazdaB2000DoorSC2/Mercedes280DoorSC1/Mercedes280RearDoorSC1/PlymouthVoyagerFrontDoorSC2/PlymouthVoyagerSideDoorSC2/PlymouthVoyagerRearDoorsVanSC2/ToyotaCamryDoorSC1/ToyotaCamryRearDoorSC1/VWRabbitDoorSC1/VWRabbitRearDoorSC1/Shubert38LeftDoor1/Shubert38RightDoor1/49powerWagonFrontDoor2/49powerWagonRearDoor2,
OnCreate:Recipe.OnCreate.SalvageModuleReturnsLargeMetals,
Result:SheetMetal,
Time:1000.0,
OnGiveXP:Recipe.OnGiveXP.MetalWelding20,
Category:Salvage,
}```
does this look right
oh ok ty
im covering all the bases lol
Lol, you could instead add a lua file that gives all car doors an item tag
Using the doParam function
You already have them typed, so it wouldn’t be too bad to get them transferred to that sort of thing
Just put a tag function, and add make a lua function 🤔
Huh?
since i posted about it earlier.
i wasted a lot of time trying to make a new font for it but PZ does NOT like fonts.
Yeah I remembered haha, it looks awesome!
something like
in script: [Recipe.GetItemTypes.DoorTypes],
in lua: ...
hm, I seem to have the trashed the code
function Recipe.GetItemTypes.wireCarBattery(scriptItems)
for type,_ in pairs(def.carBatteries) do
scriptItems:add(getScriptManager():getItem(type))
end
end
Poltergeist is talking about the Recipe Tags
Oh no yeah we meant the exact same thing lmfao
Probably a clean way to check all vehicle/item scripts for the car doors too. Especially since they all use the ‘door’ in their name lol
so to start like this
The DoParam is probably not required for this
{
SkillRequired:MetalWelding=3,
BlowTorch=4,
Prop1: BlowTorch,
Sound: BlowTorch,
keep WeldingMask,
CanBeDoneFromFloor:true,
Recipe.GetItemTypes.DoorTypes
OnCreate:Recipe.OnCreate.SalvageModuleReturnsLargeMetals,
Result:SheetMetal,
Time:1000.0,
OnGiveXP:Recipe.OnGiveXP.MetalWelding20,
Category:Salvage,
}```
you need the [] brackets
this might be useful, go through all the items and check if they are car doors
Yeah, would mean you don’t have to worry about any or all added car mods
Would just automatically do it
not sure if it's important but usually you list the source items on top.
I had the same problem with adding a custom function the way i fixed it was to put it in the vanilla lua file
But can it be put somewhere alone in its own file? Or do i have to copy the vanilla one evrytime
for the lua file i dont really know where id find the correct input for the car doors but i tried this
for type,_ in pairs(def.carDoors) do
scriptItems:add(getScriptManager():getItem(type))
end
end```
Can I prevent a specific car from spawning on the server? only i spawn
for type,_ in pairs(def.CarDoor) do
scriptItems:add(getScriptManager():getItem(type))
end
end``` like this?
you can have it in your own file, just make sure it has a unique name, is in server folder and put on top
require "recipecode"
*That is if you want it to be in Recipe.GetItemTypes, otherwise it can be anything global
yeah, if you only have strings like
doors = {"a","DoorB"}
then you do
function Recipe.GetItemTypes.DoorTypes(scriptItems)
for _,door in ipairs(doors) do
scriptItems:add(getScriptManager():getItem(door))
end
end
shouldn't be, get me a log
the base game does this for tooltips, so anything that ties into the tooltip system can look like it's doing that if an error happens or a print happens
if you wanted to check all items you'd do something like
local items = getScriptManager():getAllItems()
local function isValid(item)
return item:getName():contains("Door")
end
for i=0,items:size()-1 do
local item = items:get(i)
if isValid(item) then
print("valid",item:getName())
end
end
Wait the inventory thing isnt your mod i think. I mentioned 2 different print spam occurance
Afaik the udderly on the print is yours
The inventory hover i really dont know what mod it is
U can hook or overwrite the specific function and not the whole lua file
Yes
Remove that vehicle from the distribution table
Can anyone recommend an ide i can use while using mobile. Just need it for situations like now since im not at home till tomorrow
yeah get me a log from the one that i did do tho pls so i know exactly what's up
stuff acts different with different settings and diff mods present
nothing i write should spam the log unless there's good reason
so if it's doing that i can either tell u the reason or fix what's going on
Im not at home but ill ask for favors
Send it to u as soon as i have em
Good morning.
Working on improving an old rain effect UI utility that I wrote several years ago on request.
where is the distribution table
Lua folder
Most probably somewhere on the server folder
@weak sierra hope this helps mam
🫡
Ill ask for a settings configuration ss
ahhhhhhhhhhh whyyyy
I always create issues when going between Lua and JS. (this vs self)
Half of my errors are "what is 'this'" in the PZ console haha
UIElement gradient draw calls when? 😄
the current method would be to draw a texture to aspect - this would only be for backgrounds or overlays
You mean as images?
Yeah unfortunately
Aaaand that's my issue. 🙂
For those following along- my drug mod is in the home stretch :)
Recently wanted to start working on this mod was wondering if there was someone willing to "Coach" me and help me work on this project and learn how to code in general i do want to warn per-say that this project has a bit of a big scope.
Is there a mod that makes the video game item able to be used as a boredom reducer?
Honestly, having just basically taught myself how to code over the past month- i would take your project idea, break off a single, manageable piece, and work on that. Then; test in game, reference other similar mod code, and all that
Yeah, I think soul f’s boredom time is the name? There are a few mods that add that sorta thing iirc
What is your project idea?
So basicly
What if the zombies where more survivor like
They still are infected
But they will wander around wont attack the player immediately
Unless they break a "Rule"
I would make a comparison to we happy few
But i dont know if you know what that is
So like
Zombies will wander around the map
If they encounter the player they might give a word or 2
If they loot a zombie corpse they will become aggresive
And act like normal zombies
and at night they will seek indoors
And all that
That sounds like a lot of hardcoded java modding.
yeah kinda
I mean- you could do it, but it’d probably only work effectively on client side.
You could make the player ‘invisible’, emulating them not attacking. The Lingering Whispers mod already makes zombies talk, so that would probably be a place to look for the words. And I’d imagine you’d just have a number of event hooks that will turn off the invisible with certain conditions
I can give you some pointers on where to start, but I’ve got a big mod project of my own right now 😂
When I get out of work, I’ll post some stuff I would start with- so you can get a basic understanding
For now- I would look at the lua of a few mods, and try to parse the meaning. See if you can understand the basic language structure and stuff
Alrighty then cheers!
Ahh man.. The guy I'm rewriting my rain UI class for went to sleep when I finally got it working.
I've essentially created a glorified particle emitter for rain with speed, spread, angle, color, alpha, etc.
It just makes an image overlay, running those corresponding parameters, right?
Nope.
https://www.nexusmods.com/projectzomboid/mods/60?tab=files
Anyone use this? It says v1 and v1.1 but v1 is described as "main download". Wut
Oh
Want a zip of the current mod WIP?
Yeah, that would be cool
Trying to compile everything I can for when I get to psychedelic drug effects 😂 but Im not familiar with anything related to UI or screen effects yet
So having references helps lol
Will do 🙏🏻 I am at work now, but I’ll peep it when I get home
I could generify this code and create an API for particle emitters.
Like for example being able to have images dropping from the top to the bottom of the screen like emojis.
Behaviors like gravity could be made so someone could make a "celebration" animation on the screen where a bunch of images arc from the bottom of the screen and go back down.
That sounds incredible
nicer sliding pop ups would be a nice have too
Anyone knows what @sour island's recent changes to the journal mod do exactly/affect multiplayer servers? I'm struggling to understand his changelogs
I heard that guy just slaps code together
Ngl I heard that he just locks a bunch of monkeys in a room with typewriters to generate his code
Hahaha I love your mods man
But sometimes when you explain things I'm confuzzled
Fair, but what part?
The whole thing
I think the way you explain things often assumes that the user isn't stupid
Unfortunately, the user is stupid
"Capped recording XP to max level's cap"
????!!
I have 600 hours of PZ and I have no idea what that means
[Capped recording XP] - ok, I guess we capped how much XP we can transcribe into the journal
[to max level's cap] 😬 😬
Max level's cap?
Same with pretty much the other ones, I think it stems from the fact I don't really understand how it works
I don't know what "a rollover of old character's XP" means, or what the new tracking system is
Or what "adding into the XP tracking" means
Long story short: skill issue on my part
Still curious about whether I should worry about using the mod or not since the comment says something about holding onto journals and crafting new ones - which is contradictory when I read it: Am I keeping the journal or should I craft a new one?
I want to be dead clear this isn't a critique of your writing skills, but me pleading for help with my poor comprehension skills 😉
Very thankful for your mods lol
max levels of skills have a cap to their xp
I don't quite understand that either
you unlock level 10 but you haven't completed it until the bar is full
Ahhhhhhhhhhhh
that's how pz does levels
What is a max level's cap
level 10's max xp
basically maxing a skill out
I capped recording XP to maxed out XP
I didn't account for it, so people were able to keep recording xp on addXp events
And now your XP is like, level 10 + 5981512XP
yes
It accounts for that
AHHHHHHHHH
PZ lets you keep gaining XP even after you reach level 10
And now your mod takes that into account
And caps it at whatever XP is at level 10
yes
Understood
So this whole update makes no difference whatsoever if no one on the server has ever reached level 10 in anything
(for us)
shouldn't be that big of a deal wither way as it's only been a few hours
and I don't think it has an impact on read/transcribe times but I rather not find out
the more xp you have the longer it takes to read/transcribe
Gootcha
What about the "- implemented a rollover of old character's XP into the new tracking system"
What does that mean?
I changed how the journal's work fundamentally, before I used the actual current xp of the character - now I intercept the addXP event (when you gain XP) and determine on a separate list if it should be recoverable
Why'd you do that
people were confused as old characters had no tracked XP to speak of - and were worried they'd lose something - but the journals had the XP values, they'd get it all when they die
so I can control bonuses from professions/traits and TV watching
Ooh okay
prior to this update starting skill levels gained more XP that converted to a flat value - which isn't ideal or fair
So now it only transcribes XP you actually earned through grinding, not the ones you start with free from profession
Oh good
So at the end, should I as a server admin using this mod, tell all my users to delete their existing journal and write a new one? After today's update
not me
they should keep their old journal and make a new one - and try to transcribe/read from both until all the kinks transition out
after they die once, there should be no lingering issues
and they can keep using their new journal
also there was a bug with reading from journals not being recorded - this may not fix itself until the character dies - but the same advice as above applies
a priority in the update was keeping the old information salvageable - no one should lose anything
there was also an old ugly solution for passive skills as they work somewhat differently to the rest
I was able to even roll that over into the new system and clear out that info from the player's modData
much nicer having every skill work the same way for me
@sour island disregard this if it's already a thing but I have started using the skill journal on my server and I was thinking a really good feature would be if the recorded skills were given to your new character via an xp modifier as opposed to just directly getting the xp. I like that you can cut the max levels in half so there is still some punishment but I just think it would be better and make more sense if the journal worked like a skill book that gave you a modifier for every recorded skills so that you still gotta work for it.
this would actually be possible now
going to wait for this current update to circulate lol
how do you call to run a lua file? i have a function down but its asking me for a file to run it
Two things- can you send the function, and when do you want it to trigger?
if you put ```lua before you paste code it will format it, just end the code block with ```
Lie on ground mod? 
gonna add a new dynamic trait for those who did 100 pushup , 100 situps, 100 squats and 10km run a day
anyone able to help with a mod load order
maybe
that's normal it just means people are dismantling lots of vehicles
or entering areas where old vehicles were and they are all despawning at once
it only logs this when it tries to spawn something and the area isnt loaded
so each one of those is a spawn attempt
@dim hill Is this clearer, ignoring all the added info I gave you earlier.
I think so! Hard to forget what you told me but I think that's easier to understand 🙂
👍
Is it hard limited at 10 or just checks the highest level?
Can you have a skill has less than 10 levels by default?
Any modders taking commissions currently? I have a fairly simple idea I would like to execute.
something that has been bugging me a bit that I would like to put on my server
what happens if i have no texture for me melee weapon but i made it coloured in blender
I don't think you can have less than default, but you can have more. Maybe you can have less but it's weirder than more and more is already weird.
ah like 9, should be easier
and allow 10 for players with right trait / proficiency
*changing it per person is extra layer of challenge though
are there any recourses on melee modding
What is the idea?
It will be invisible afaik. You set the model definition in the script file, and it expects a texture image to overlay on that
Oop, was replying to you ^
Just some quality of life addons for the true music and true actions dancing mod. containers for carrying unlimited cassetts, vinyles, and dance cards. changing loot spawns on music so they spawn in boxes you must unpackage much like the cereal boxes in the dance mod to help unlitter loot tables. and lastly a cassette player tho that last one seems undoable.
I've already got a taker tho
Oh no worries! Was just curious is all haha, currently working on a big project of my own as is 😂 kinda always wonder ab these sorta things tho, like - the commission stuff
it's been a little thing that has been bugging me a lot lately. I am big into the music stuff. and have way too much to store and way too much spawning in shelves and book cases. I wish I was smart enough for this modding stuff because I have so many ideas. Guess that's where a job and money come in. 
For sure! I had no experience myself like a month ago- and now I am making a complete drug overhaul mod 😂 it’s honestly not too bad to learn, esp with all the great people here who help.
You run a server?
it's a private one with friends but yes.
and I tried my hand with modding and all I can say is it is way our of my grasp and I don't have the time or patients to learn sadly. I do still try to dabble in blender and such every now and again tho.
Oh word! Well- because I feel obligated to plug my past projects 🥸
If you want to threaten your friends with menacing notes-
https://steamcommunity.com/sharedfiles/filedetails/?id=2897228813
I do like menacing notes 🙂
i've actually worked on a system similar to that for cassettes
oh yea?
I looked on the workshop and didn't find anything but it is flooded with addons
Adds some stuff for event mods for bigger servers- but that is only admin accessible. The best part imo is that you can pin notes up on the wall :) you can use knives, tape, or a screwdriver. Saves the text when you take it off / pin it up
it's not available as a mod separate from the mod i helped with it for, but i'm sure you could repurpose the code
that's cool. I remember a sililar notes mod like that for dayz. I had tons of fun using that
it doesn't use a box, but it uses the same concept - instead of a box you open, there's a single dummy cassette item that gets replaced with a random cassette when it spawns
is there a guide on melee weapons btw
you got a link I think I actually have an idea what one it is. I got the idea from it
i used some similar code for the pony mod - i think lea added a bunch of sandbox stuff into it that complicates things that you might not want (and of course i haven't asked if they want their work to be offered like this)
I actually like a lot of the sandbox idea in there. they should consider making a lightwieght version without the music and only the spawning and settings
does it work with other addons?
no, the cassettes are all written into a big table
you could probably grab them with the scriptmanager with some reliability though
maybe i should make that 
hmm, actually, i'd have to detect and remove the spawns from all other cassette mods... that'd be a pain
I think that is actually what is going to be done for my mod. I was just talking it through with them.
does anyone know how to make a melee mod there are no guides on how
yeah, the difficulty in making a standalone 'better cassette spawns' mod is you'd have to find a way to block the normal spawns, but if you're doing it for a specific set of mods that's very easy
well it's all beyond me but he says he can do it so I'm happy 🙂
but the sandbox settings and cassetts spawning on zeds is all very nice
Are you just trying to make a new melee weapon?
thanks
Go to TIS Forums section, first link
Where do we find the icons for items? I am struggling to find them
they're in texture packs
Ohhh okay, and no. I just wanted to know how to design the path to add new ones
oh- you just put them into the media\textures file as pngs
if it is for an item it needs to be named Item_Example.png
and it is 32x32
couldnt find guide here
You need to make an item script
Thank you!
alr
Look at the githubs at the bottom for the basic outlines of how
i dont see i guide for blender to zomboid tho
i can only find clothing
not melee
i downloaded a framework for melee
Hey, forgot to message sooner. New Years and all- but some stuff here is probably a good place to start! Threw some extra links in there for you so there is a lil bit of everything
anyone have a list of distributionTable["CarNormal"] for vehicles?
and now its rainy!
eyy need some help
any reason this doesnt work?
i know nothing, just trying to mess with variables
originally it was this
probably because data['spears'][spearIndex].condition is nil
hmm thats shouldnt be the case tho
its being set to zero as its broken so it should have an original value
idk im extremely new so i really have no clue
anyone good at tuning vehicles?
RAHHHHHH
This is trying to pull a table too deep, to my understanding. You are pooling for
ModData.spears.spearIndex.condition
Which is multiple nested tables 😂
I am messing with a super similar functionality in my drug mod atm, if you wanna send me your code I can mess with it
ooooh so its like almost a file directory in a sense
Yee
just a weird way to type it lol
so @ruby urchin was probably right then
ill try to figure it out on my own but if i give up ill msg you
lol
idk literally you gave a one line of code
Oh no worries haha
but yeah @fluid current I can give you some pointers on the table stuff, if you want. I am using something similar to store data on items / player to keep track of durations, effects, and all that
i was really just trying to adjust a single value
see this is part of the Spear Traps mod
Oh! Word. So- Is the value listed in the mod data?
And- Do you initialize your mod data tables anywhere?
no clue im fresh to this lol
honestly thinking that i really should have done the crash course on lua
heh
haha, I feel that. I am self taught over the last month
only other mod ive made for this was based off a tutorial and that was for java not lua
so easy compared to this
honestly dont even know where to check for that
You wanna dm me your lua code? I will explain what I mean
sure
Anyone familiar with the anticheats and how to avoid triggering them?
Not circumvent, just avoid getting people kicked from MP
I'd look at java to see what the specific one checks. The xp one was checking a hardcoded number I think.
IsoGameCharacter has this in update
if ((double)this.lastXPGrowthRate > 1000.0D * SandboxOptions.instance.XpMultiplier.getValue() * ServerOptions.instance.AntiCheatProtectionType9ThresholdMultiplier.getValue()) {
so if you add less XP than that per update it should be ok
is it hard to create mods?
depends what you want to do, all you need to make an empty mod is copy the example
@sour island
the anticheat14 seems to be about wrong player in packet
okay
Odd, but it's probably related to me hijacking the function
it's kind of critical to the new features I added - so that sucks
could this be a split screen issue? @sour island
people reporting it are on MP afaik
--self is the XP obj that AddXP is used on
local pXP = player:getXp()
if pXP ~= self then return end
--not important but 10 is hard set here :(
--local maxLevelXP = perksType:getTotalXpForLevel(10)
--this seems like a bad idea, changing parameters
if passHook==nil then passHook = true end
if applyXPBoosts==nil then applyXPBoosts = true end
if transmitMP==nil then transmitMP = false end
was that the issue?
I haven't tested anything, but the problem seems to be there
is @tame veldt here?
@faint jewel I'am here
are you 10 years later dane?
sadly no, that's a different "Dane" in an alternate universe...
well damn
if im trying to add a custom action/recipe too a profession is this the right code for it
mechanics:getFreeRecipes():add("Salvage Vehicle Doors");
when i load up this mod it just freezes at the loading screen
this is base hook to the function
then you need something like
local burglar = ProfessionFactory.getProfession("burglar")
sweet ok ty!
considering more than one mods overwrite the function completely, you want your hook to apply later
BaseGameCharacterDetails.DoProfessions = function()
original_doprofessions(unemployed)
unemployed:setDescription("14 free skill points");
would this be correct?
no...
BaseGameCharacterDetails.DoProfessions = function()
original_doprofessions()
local unemployed = ProfessionFactory.addProfession("unemployed", "unemployed", "", 14);
unemployed:setDescription("14 free skill points");
``` how about this
Is there a way to switch it off via sandbox? I mean the prints?
local original_doprofessions = BaseGameCharacterDetails.DoProfessions
BaseGameCharacterDetails.DoProfessions = function(...)
original_doprofessions(...)
local unemployed = ProfessionFactory.getProfession("unemployed")
unemployed:setDescription("14 free skill points");
end
hm, maybe this
oh ok. get not add
add would replace it
oh yea thats what i want
yeah, then just make a new one like vanilla does
i am working on a medicine mod but my medicine dissapear when i used it (and it don't have remaining bar like others medicine) does anyone know how to fix it
thank you @fast galleon
i need your help
this channel has a few drug lords, but if you show the script for the item maybe I can tell if something is wrong
@fast galleon here
can i use supervitamins?
what is that?
well if you did use same name , you would probably overwrite the base item
i am not going to overwrite the base item, man
I never said to do that either
can i edit the number of times this thing is applied? how
UseDelta = 0.1,
means it has 1 / 0.1 uses
so if i want to use it 50 times it will be 0.02 right
thank you @fast galleon
@fast galleon now i can't use it anymore
Lua programming in Roblox is the same as PZ ?, there is a lot of tutorials of Roblox
my potion consumes itself when it needs it, it no longer affects my stats and its stats are completely gone
Good morning.
If anyone wants me to take that particle emitter UI code and package it as an ISUIElement, let me know.
Has anyone made a solution with ISUI regarding texture masks?
I'd like to mask using a texture, not just a stencil.
Pretty much feels like UIElement needs to support blend modes at some point.
Actually, it looks like Texture might have what I need..
what about the overlay thing
is it the same ?
i doubt .. nvm
@merry quail
yeah you seem to use some custom logic
any mods that add gear shifting and fuel consumption based on revvs?
Saw some post on Reddit about a core mod for gear shifting.
Roblox uses Luau, a superset of Lua, as of a few years ago. PZ and roblox also have entirely different APIs. Some of the language knowledge would be transferable (minus Luau-specific features), and much of the standard library, but not much other than that
core mod?
You're more bare-bones with Lua here as the Lua environment for PZ is not genuine Lua, but an emulation as a JIT / JRE Lua Engine called Kahlua.
Java.
uhhhh...
Thanks for answering
See what DeltaMango just said as well, significant detail (it won't usually matter, but sometimes when calling Java methods it leads to some weirdness)
When you write something like a Typescript layer to PZ modding, you'll have so much fun with the advanced weirdness of Kahlua.
I can only imagine 😄
I did manage to solve the load-order problem with the global dictionary module for it.
TypescriptToLua's compiled Lua created constants for imports so I wrote a footer code block to reassign them after PZ fully loaded the Lua code. 🙂
So yeah if you're not dealing with that stuff, PZ Lua should be 95% normal.
How do I make a custom spawn in project zomboid
How do I make a mod that alters distribution tables/loot chance of specific items or removal of items spawning in containers from vanilla or modded items within the world of project zomboid, with clean code written for optimization.
In B41 Firearms mod, there’s a graphical error that happens when you try to place the M77 Hunting Rifle with an 4x or 4x-12x scope. When this weapon is placed on the ground, it appears as the Inventory icon instead of the world model that appears on the player.
How can I mod this to fix this issue?
where do i call an outside function in this code ```local original_doprofessions = BaseGameCharacterDetails.DoProfessions
BaseGameCharacterDetails.DoProfessions = function()
original_doprofessions()
end
Events.OnGameBoot.Remove(original_doprofessions)
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoProfessions)
ProfessionFramework.addProfession = function()
original_doprofessions()
end
Events.OnGameBoot.Remove(original_doprofessions)
Events.OnGameBoot.Add(ProfessionFramework.addProfession)
``` like this?
Anyone know exactly what causes server to stop launching?
And how to fix it?
Simple hosting button just says Initializing and then a few seconds later falls back to the server selection screen, no errors, no explanation.
I just restarted PC and it's still doing it
This has happened occasionally but usually restarting game or PC resolves it...
The reason it occurs is not at all obvious to me but somewhere in the course of relaunching a server for testing, the game stops letting me relaunch servers. I tried commenting out new code in the only file I was editing but I don't think it's relevant. File is loading when I launch PZ with no errors...
@thick karma
Check logs when this happens
You can do anything you want inside this function.
https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md
This is very helpful if you are rather new to coding.
I'll look at them in a bit, thanks.
thanks dude. i was scratching my head at the basic lua tutorials
This means it doesn’t have a world model assignment, which could be because of the attachment giving the gun something incorrectly. That should be fixable- but I’m not super familiar with the way gun attachments effect world models, if they do at all.
Do me a solid, check the code for the gun? It could be that the attachment is instancing a new item, which doesn’t have a world model description
Hey, does anyone know if @hollow shadow' The Workshop mod (https://steamcommunity.com/workshop/filedetails/?id=2680473910) is a good solution for metalwork skill levelling without needing to scrap vehicles/fences/etc?
Yes
100%
It lets you scrap items and tools you loot, which respawn if you have that turned on. It makes a world of a difference. And the other sub mods connected to ‘the workshop’ add some cool uses for metalworkers as well
You just craft the workbench in game, and there are common magazines that will teach you the recipes to break down everything you need
Thanks @winter thunder - does it give you metalwork XP?
Yes
Thanks - appreciate you.
No worries! Those mods are hands down one of my favorite additions to PZ, I basically treat them like as mandatory when I play 😂
.-.
LuaEventManager.triggerEvent("OnPreDistributionMerge");
LuaEventManager.triggerEvent("OnDistributionMerge");
LuaEventManager.triggerEvent("OnPostDistributionMerge");
How can I get an exact 1 month Water Shutoff? Is there a mod or is there a way I can code it so in exactly one month, water and power shut off?
How or where do I check the code for the gun?
I am new to the whole modding thing, so I’m sorry about that.
Could anyone explain what these two do? They both seem interesting but I'm confused their actual usages
there is way to make it works on pz 41.78 ?
oldProcessSayMessage = processSayMessage;
processSayMessage = function(spokenMessage)
if not spokenMessage then return end
local trimmedMessage = luautils.trim(spokenMessage);
if not trimmedMessage or #trimmedMessage == 0 then return end
getPlayer():setLastSpokenLine(trimmedMessage);
oldProcessSayMessage(trimmedMessage);
end
due after lattes update it stop works
Does anyone know why my custom ui element isn't getting its render function called? it's a child of a visible panel and it's children do get rendered
hey Guys, I am looking for some guidance. I want to get into modding PZ its such a fun game with crazy possibilities. I want to create a map of an old Hospital here in my hometown, for starters I'd just enjoying building the Hospital itself and maybe some outerlying buildings, but eventually I'd like to get into unique scripted events and items to turn the whole thing into a Custom Scenario. Where do I start with just creating the building itself and maybe some textures
I also have zero programming knowledge but this could be fun way to learn, and I plan on learn the LUA basics
Instead of doing that, I got busy for 2 hours, came back, and it worked. I changed nothing.
I really wish I knew what causes it to get in that state so I could reset it faster.
Will check logs next time.
Anyone know of a mod to let you craft fireaxes
Anyone know a mod that shuts off water and electricity in one months time, or a way for me to create that setting?
@gaunt cargo I don't know but they are settings in sandbox options... I am not sure about the units but I imagine the units are days.







