#mod_development
1 messages Β· Page 23 of 1
Hello!!
Does somebody has ideas on how to fix this for MP? In single player it works fine but as soon as you have NPC's or in MP, players, this will stop working as expected. Basically I want to create a Vignette effect (using the search mode) when the player is too tired, so I have two functions, one to enable the effect, and other to disable it, and they will be switching between them so both won't run at the same time because I want the disable to occur just once and not permanent.
But when another player is in the game t he problem is that I may have the situation where one has tiredness but the other doesn't so the code basically explode xD
This is the current code:
`function enableVignetteEffectWhenTired(player)
print("DT Logger: running enableVignetteEffectWhenTired function");
--local player = getPlayer();
local playerNum = player:getPlayerNum();
local vignette = getSearchMode():getSearchModeForPlayer(playerNum);
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
local currentFatigue = player:getStats():getFatigue();
local currentPanic = player:getStats():getPanic();
print("Enabling vignette");
getSearchMode():setEnabled(playerNum, true);
vignette:getBlur():setTargets(0.7, 0.7);
vignette:getDesat():setTargets(0.5, 0.5);
local baseRadius = 25 - (25 * currentFatigue) - ZombRand(1, 7) + (currentPanic / 10) + 10;
print("baseRadius: " .. baseRadius);
vignette:getRadius():setTargets(baseRadius, baseRadius);
vignette:getDarkness():setTargets(currentFatigue - 0.2, currentFatigue - 0.2);
else
print("Vignette disabled");
getSearchMode():setEnabled(playerNum, false);
Events.OnPlayerUpdate.Remove(enableVignetteEffectWhenTired);
Events.OnPlayerUpdate.Add(disableVignetteEffectWhenTired);
end
end
function disableVignetteEffectWhenTired(player)
print("DT Logger: running disableVignetteEffectWhenTired function");
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
Events.OnPlayerUpdate.Remove(disableVignetteEffectWhenTired);
Events.OnPlayerUpdate.Add(enableVignetteEffectWhenTired);
end
end
Events.OnPlayerUpdate.Add(disableVignetteEffectWhenTired)`
Try changing the event at the bottom with this:
Events.OnCreatePlayer.Add(OnFillInventoryObjectContextMenu);
( make a backup first π )
i do believe it has to be the inventory thing, since it's to do with inventory, not starting game..
in which folder is located your lua file?
-----------------------------------------
function: doReloadMenuForBullets -- file: ISInventoryPaneContextMenu.lua line # 1312 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 604 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla
ERROR: General , 1662829613539> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getDisplayName of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1662829613539> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getDisplayName of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onRightMouseUp(UIElement.java:1458)
at zombie.ui.UIElement.onRightMouseUp(UIElement.java:1416)
at zombie.ui.UIManager.update(UIManager.java:903)
at zombie.GameWindow.logic(GameWindow.java:261)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:764)
at zombie.GameWindow.run_ez(GameWindow.java:680)
at zombie.GameWindow.mainThread(GameWindow.java:494)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1662829613540> -----------------------------------------
STACK TRACE
-----------------------------------------
function: doReloadMenuForBullets -- file: ISInventoryPaneContextMenu.lua line # 1312 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 604 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla
i'll try disable all but the dupe mod
let's see what happens then
could be another mod conflict i don't know about...
if it still bugs out, then we'll know it's truly the script... somehow
i wonder if the bug still show if i disable the mod completly
I've made a quick test
I've put your script in my mod in lua ---> Client
No errors but not any additional contex menu when right clicking on a item...
because the mod needs the Duplirino item
can you share it so I can try
Replace the
if not getSpecificPlayer(player):getInventory():contains("AGCMDupeListRecipes.AGCMDuplarino2Half") then return; with
if not getSpecificPlayer(player):getInventory():contains("base.keyring") then return;
That i KNOW will make it work
(Temp workaround)
okay, disabled my mod
Now there is no mods loaded at all, if the ammo STILL spits an error when you open the context menu, then the bug is also with the game devs
nope errror in main screeen with the new string added
what folder is your code in
you'd want it in client
Also, after removing my own mods, Gather Gunpowder, Place item and Drop now shows up x.x
it IS in clinet
that was not a reply to you :p
Is in client
if not getSpecificPlayer(player):getInventory():contains("base.KeyRing") then return; end
Make sure both K and R is CaPaTaLiZeD
I hate it when CaSe is needed now and again
I have a doubt for the Events.OnPlayerUpdate.Remove, when it removes it, it removes for everyone I assume, or if it is in client it removes it for only that client? I mean in MP I didn't test it, I happened while testing with NPC's, is maybe because NPC's are all the same clients?
Error fixed but no effect on any items...
I don't even see the .remove anywhere... are you talking about somethign else?
Yes, the question was for @weak sierra that answer my question xD sorry
I'm talking about this π
gotcha
She's talking of her mod not yours LOOL π
XD
kind of wish it was possible to make threads here to keep things a little more clear, ya know?
Damned modders ego LOOL π
wrap it in a local function
don't forget the pink little bowtie π
local playerCopyOfFunction = MyFunctions.Function
Events.OnPlayerUpdate.Add(playerCopyOfFunction)
wrapping it in a local should give it a unique identity
and thus removing it later won't yeet all of them
or some shared one
as for my script, it seems to only bug out ammo/bullets...
im not an expert on lua (yet) so forgive me if this doesn't work as i expect or my explanation is off but i've seen this done by people who know better than i
i have coded a long time in other languages tho
so the concept makes sense
Here I've tried with the 9mmm ones...no errors but as said no new contex menu....I'm beginning to guess that maybe the error resides in your item script...
aye
do any of the recipe or item names (as in the item's type name, not the display or translation) have a "." in them?
Testing is the only way to check if it works or not. I'm not pretty sure how to do what you mentioned but will try, thanks for the suggestion
just make a local copy of the function and pass that instead of the original when registering it with the event and unregistering it with the event
I only use the . in the Display name, not the IDs
i showed how to do the local copy thing above
yeah good, that breaks some stuff
guess that ain't your problem then xD
can you send me the item script via PM?
the thing is: When my mod is active, it breaks the context menu of ammo items, functions such as "Gather Gunpoweder", "Drop" or "Place item" don't show up, but works just perfectly fine on other items.
And looking at the error code above, it seems there is some kind of conflict happening with the code from vanilla nd my dupe mod. But my skills at lua is only able to edit the most basic of variables.
i'll send it here
It's going to be uploaded to the workshop once the script works fine again
ok. " Quote: the thing is: When my mod is active, it breaks the context menu of ammo items, functions such as "Gather Gunpoweder", "Drop" or "Place item" don't show up, but works just perfectly fine on other items. " Here not instead alll those menus remains available as per normal with your script acrtive
not on my end.
when i have JUST the Dupe menu (and it's needed cheat mod) active, the thing won't show those menus
I need to see that item script...I'm pretty sure the culprit is there...
sorry I'm tired missed it LOOL π
Can you see it now?
Here, just to be a snarky sphincter, i'll post it again: π
that means it's causing an error during the context menu generation at a point before those things are generated in the menu
I was meaning the Duplirino item script....
oh, uh sure
{
Weight = 1,
Type = Normal,
DisplayName = .Duplarino 2Β½,
Icon = AGCMDuplarino2Half,
Tooltip = Tooltip_AGCMDuplarino2Half,
}
recipe Shape a Duplarino 2Β½
{
keep KeyRing,
AGCMCheatItems.AGCMOddThingy=5,
Result:AGCMDuplarino2Half,
Sound:Hammering,
Time:10.0,
Category:AGCM,
}``` there ya go - again, the item seems to work just fine... it's basically just a clutter item like rubberbands or credit cards (which also has no damn function)
Well, managed to make it run for each one as different functions like this but for some rason even though the tiredness is full it doesn't enter in the if and goes directly to the else
`local DTvignetteEffects = {}
DTvignetteEffects.enableVignetteEffectWhenTired = function(player)
print("DT Logger: running enableVignetteEffectWhenTired function");
--local player = getPlayer();
local playerNum = player:getPlayerNum();
local vignette = getSearchMode():getSearchModeForPlayer(playerNum);
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
local currentFatigue = player:getStats():getFatigue();
local currentPanic = player:getStats():getPanic();
print("Enabling vignette");
getSearchMode():setEnabled(playerNum, true);
vignette:getBlur():setTargets(0.7, 0.7);
vignette:getDesat():setTargets(0.5, 0.5);
local baseRadius = 25 - (25 * currentFatigue) - ZombRand(1, 7) + (currentPanic / 10) + 10;
print("baseRadius: " .. baseRadius);
vignette:getRadius():setTargets(baseRadius, baseRadius);
vignette:getDarkness():setTargets(currentFatigue - 0.2, currentFatigue - 0.2);
else
print("Vignette disabled");
getSearchMode():setEnabled(playerNum, false);
Events.OnPlayerUpdate.Remove(DTvignetteEffects.enableVignetteEffectWhenTired);
Events.OnPlayerUpdate.Add(DTvignetteEffects.disableVignetteEffectWhenTired);
end
end
DTvignetteEffects.disableVignetteEffectWhenTired = function(player)
--local player = getPlayer();
print("DT Logger: running disableVignetteEffectWhenTired function");
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
Events.OnPlayerUpdate.Remove(DTvignetteEffects.disableVignetteEffectWhenTired);
Events.OnPlayerUpdate.Add(DTvignetteEffects.enableVignetteEffectWhenTired);
end
end
Events.OnPlayerUpdate.Add(DTvignetteEffects.disableVignetteEffectWhenTired)`
There is one NPC near (I'm using it to test lol), in the prints I see it runs the disable for the NPC because is not tired, the enable for my character because is tired but instead of entering the if, I'm seeing the print from the else π€
Moved this to OnEveryMinute and used the getPlayer instead of the player from OnPlayerUpdate and seems to work with NPC's, MP test now...
Can anyone point me to information about checking if a mod is present on the system? There are a few mods I would like to make compatible with mine and the best solution I see is to have my scripts check for the incompatible mods and then adjust some of their variables if they are present to correct the issues. - Any suggestions on where to start? Thanks!
Mod Manager in the workshop π
It should be a good reference/starting point I guess
Thanks I will look into the code here and see if I can find any useful references in there - it probably has it based on what it does. I am looking to check via a lua script so I need to find some functions I can call to get it done.
Anyone knows if there the possibility, when a new game is started, to let spawn the characther inside a vehicle?
not 100% sure but the closest thing i know is this; https://steamcommunity.com/workshop/filedetails/?id=2792231102
https://steamcommunity.com/sharedfiles/filedetails/?id=2754567348&searchtext=survivor+bases https://steamcommunity.com/sharedfiles/filedetails/?id=2747565374 between these two which one do you guys suggest, im pretty sure noirs is better for compatibility but ive heard the other one is more functional and have been using the second one for awhile now.
the former is excellent and the latter is old and the modder is absent
things can easily be patched to support noir's with a line or so of code
Thanks mate π
any incompatibilities?
and is noirs compatible with smokin joes backpacks
also is it compatible with two weapons on back mod?
i do not use either of those, but no incompatibilities that i am aware of thus far
https://github.com/asledgehammer/PipeWrench/pull/16/files 41.76 API changes for those interested, java and lua
I am getting this error when I boot my server but the file is in the mods folder on my computer
it wont just cuz ur missing a ,
on the generateDeeoSHardWound
but other than that then idk
if it can actually work when u fix the missing comma thing
i think wrong channel
but also is this s
single player ? host? server?
if server then just restart it
I wasnt sure what channel to post int. But it does this everytime. and yes its for my server
if its local then just upload to steam and use that instead of users mod
im not sure what you mean?
u have a mod folder on your steam zomboid directory
the mods are bunch of numbers
yes I downloaded them all from the steam workshop
thats the one u download from subscribing to mods
Yes, I did that already. I did that too
have u uploaded the mod?
uploaded the mod to where?
steam
I didnt create it I downloaded from the workshop
then the server doesnt have the file
you have to configure it to load the mod
servertest.ini
workshopid=
modid=
something like that
it should show
mod1;mod2;awsomemod3
and
173737222;928373322;82288222
something like that
this is posted on every workshop mods. on the bottom part of the description
also on the mod.info
sample
Workshop ID: 2859296947
Mod ID: MoodleFramework
yea the mods are all loaded. I made sure to add them all.
#mod_support , but this looks like maybe the server needs the mod reinstalled, or your client copy has an extra file in it. considering which mod it is, im guessing the server's install of it is messed up.
since it's unlikely to have had a file removed in a new update
I disabled the mod on the server and im still getting the error so im not sure
esp a vehicle script
then it's probably a mistargeted error
there's a bug i reported to TIS already
where it tells you the wrong file
but SOMETHING is erroring
and it's trial and error to figure out what
i've seen this happen with STALKER armor and with the boots expanded thing
both of which also work fine for some people
I have 53 errors when I try to boot the server. but that one is the one that displays and crashes it on startup
earliest?
sometimes it's a cascade
oh yea I gotchu
leading to the final straw
rather than the last one on its own causing the issue
that said, that appears to be a client-side error on join
not the server
are there by any chance and premade kitchen sink esque mod packs I can DL with the load order already set?
basically download and play like Minecraft or Terraria?
yup and they come with no support and are usually out of date or broken, modders hate them and want them gone, and they break licensing on many mods
if ur playing SP or locally hosted it's very simple to just install mods and hit button usually
dedicated not so much
im just trying to host a server on my computer for me and my brother. nothing fancy. just throw it up when we have time
then are u using the host button in the menu? anyway really this is the wrong channel for this
yea I am
huh
never seen those errors happen with that
unsub/resub to the mods 
anyone know why this.. just doesn't seem to work at all?
traitsToYeet["Athletic"] = true
traitsToYeet["Fit"] = true
traitsToYeet["Out Of Shape"] = true
traitsToYeet["Obese"] = true
traitsToYeet["Underweight"] = true
traitsToYeet["Unfit"] = true
traitsToYeet["Illiterate"] = true
traitsToYeet["Slow Reader"] = true
traitsToYeet["Fast Reader"] = true
traitsToYeet["Feeble"] = true
traitsToYeet["Weak"] = true
traitsToYeet["Stout"] = true
traitsToYeet["Strong"] = true
traitsToYeet["Runner"] = true
traitsToYeet["Very Underweight"] = true
print("[UdderlyRP] Yeeting traits that are inappropriate for our server..")
local traitList = TraitFactory.getTraits();
for i = 0, traitList:size() - 1 do
local trait = traitList:get(i);
if traitsToYeet[trait.name] == true then
trait:setIsRemoveInMP(true)
end
end```
like.. the code that fills the lists checks that variable
so it should work, no? it's executing, i see the thing print in the console, no error

i put it in shared since it didn't work in client
and it still does not work
i did test on a local dedicated server, since i don't expect it to work in sp of course
You have any updates or is it still borked?
(Yes I'm alive again, big reveal, woah!)
@weak sierra are you sure getTraits() doesn't call self?
If it does, it'd be : instead of .
Not entirely sure why it wouldn't be throwing an error in that case, but worth a shot.
(Reason why I ask is because a lot of the java functions are : )
Also seems to be "setRemoveInMP" instead of "setIsRemoveInMP" according to online Java docs.
I also have a few suggestions to tidy up but I dont wanna nitpick
copied that line from a vanilla file so im pretty sure that's ok
Understandable
wudda thought taht would have thrown an error then

It called nil?
no
that's usually the error when u call something that ain't there
and it didnt give one
That could be it.
Try just printing out the names and seeing what comes up.
(Though odds are you're already doing that hehe)
Anyone know any good mods I should get π
Ohhh okay! Mb
Naw you're goodie
Hi guys can I do that in ProceduralDistribution or just in SuburbsDistributions ? (this format below)
table.insert(ProceduralDistributions.list["BathroomCabinet"].items , "GodigodMod.GinsengPills");
table.insert(ProceduralDistributions.list["BathroomCabinet"].items, 4);```
table.insert(SuburbsDistributions["all"]["Outfit_Police"].items, "GodigodMod.GinsengPills")
table.insert(SuburbsDistributions["all"]["Outfit_Police"].items, 0.2)```
apparently their names are null, or at least.. some of them are
lol
that's not what i expected
was gonna if/else on a few things but yeah might as well do that too make sure im getting something sane
they're all type userdata
how.. interesting
:|
Lovely
i dunno what to do with that
getType is supposed to return a string so now I'm confused
????
there's a getType on IsoObject but i dont think that'll be on a trait
LOG : General , 1662867710367> [UdderlyRP] Found 85 traits.
LOG : General , 1662867710367> UDDTST: Trait is type "userdata".
LOG : General , 1662867710367> UDDTST: Nil trait name.```
loops the latter two lines 85 times
Javadoc Project Zomboid Modding API declaration: package: zombie.characters.traits, class: TraitFactory, class: Trait
I swear I'm insane
huh
i mean if it's userdata type will it have that tho
like it says it has name field
but it fails if u try to do trait.name
mm
alright ill try that
whatever it is
Hopefully it doesn't do something insane
the fuck
LOG : General , 1662868226639> [UdderlyRP] Found 85 traits.
LOG : General , 1662868226639> UDDTST: Trait is type "AdrenalineJunkie".
LOG : General , 1662868226639> UDDTST: Nil trait name.
LOG : General , 1662868226639> UDDTST: Trait is type "Agoraphobic".
LOG : General , 1662868226639> UDDTST: Nil trait name.
LOG : General , 1662868226639> UDDTST: Trait is type "AllThumbs".
LOG : General , 1662868226639> UDDTST: Nil trait name.```
ok that's.. very weird
im a noob but i would maybe try TraitFactory:getTraits();
:getType() doesn't retrieve type, it's probably set up like items

so item type as in
like Type | Name | Category | DisplayCategory
in items
when spawning
oh man that's awkward
so internal name
Oh well, it works it works
Did the fix for the uhh
add that to my toolkit of weird shit
setMultiplayer thing work
oh i have no idea, my names were display names
so it isnt picking them up
i imagine u were correct on that part
my code wasn't running for that bit
because it wasnt finding matching names
holy shit the "type" names have no consistency
some have spaces, some dont
some are uppercase per word
some aren't
some are all lower, some are all upper
some are display names and some are arbitrary stuff
ff
Anyone ? π¬
u just have to find references for this
i am unfamiliar with suburbsdistributions
but procedural distributions looks fine, as long as those are real entries
if "BathroomCabinet" exists
yeah there is
should be fine then
ye which makes it harder for newbs like me to learn to code
probably intentional too or perhaps since they have different coders working on the game and they write stuff like however they want and they have different styles
or maybe cuz so that modders can do whtver on the types
it's not intentional it's probably a matter of time and experience over time
diff coders and ppl starting out with less idea of how to proceed
most indie titles are developed by a tiny team that is learning how to code and/or at least how to go about their project, at the start
and expand and get more professional as time goes on
but then they retain old names for compatibility
but usually it's not as chaotic so it still surprised me lol
About Pharmacy Cosmetics, how the rolls and chance to item respawn works ? I'm getting a little confused ...``` PharmacyCosmetics = {
rolls = 4,
items = {
"Cologne", 8,
"HairDyeBlack", 2,
"HairDyeBlonde", 2,
"HairDyeGinger", 2,
"HairDyeLightBrown", 2,
"Hairgel", 4,
"Hairgel", 4,
"Hairspray", 6,
"Hairspray", 6,
"Lipstick", 10,
"Lipstick", 10,
"MakeupEyeshadow", 10,
"MakeupFoundation", 10,
"Perfume", 8,
"Razor", 4,
"Soap2", 4,
"Toothbrush", 4,
"Toothpaste", 4,
},
junk = {
rolls = 1,
items = {
}
}
},```
higher number = more
multiple entries = can be more spawned at once
Lipstick has a bit more than half the chance to spawn that hairgel has
and the rolls ? what this means ?
and both have two chances to spawn
that's the number of times it tries for each entry iirc
it rolls a number and checks if it will spawn or not
higher rolls -> more loot overall in the container
without being specific about which things
regardless of rarity settings
so, the spawn roll four times before to "spawn" a item ? Thats it ?
i think it rolls 4 times for each item
and if any of the rolls succeeds it spawns
but i havent read teh code
so
could be wrong on that
nice, make sense
there we go
LOG : General , 1662869484964> [UdderlyRP] Found 85 traits.
LOG : General , 1662869484964> [UdderlyRP] Yeeting "Athletic"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "FastReader"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Feeble"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Fit"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Illiterate"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Obese"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Out of Shape"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Jogger"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "SlowReader"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Stout"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Strong"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Underweight"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Unfit"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Very Underweight"!
LOG : General , 1662869484965> [UdderlyRP] Yeeting "Weak"!```
in case anyone is wondering, on my server it's super easy to level fitness/str/sprinting, reading speed is very fast regardless of traits, and illiterate would lock you out of a number of game features
so removing those prevents wasted points, cursing your char without access to various features by illiteracy, and gaming the system too hard by picking low str/fit builds
im hoping that they still work properly for dynamically assigning in the game
i.. presume so
is it possible to have like a trait that if you have it you cant dmg or get dmg from other players
the trait is called non_pvp
That would be difficult/probably impossible. I'm sure there's a way to insure only ZedDamage counts as actual damage to a player but i think if you would attempt to make it so they can't hurt playerw either you will run into the issue of not being able to damage zombies either
It would be more of a actual pacifist trait than a non pvp one
are there any city/town mods that interfere with Raven Creek?
theres a dmg modofier for pvp tho
it might have something to do with this stuff
how do i add my own mod item and get called by Recipe.GetItemTypes
you can create your own get item types using tags using the following
function Recipe.GetItemTypes.HuntingShotgun(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("HuntingShotgun"))
end
in this case "HuntingShotgun" is a tag added to the item
how do you check whether a game is singleplayer or multiplayer
I've been able to realise a function that spawns an item beside the character when a new character is created....but now I want to make one to do exactly the same but with a vehicle...any idea how to possibly do it?
thank you very much!
does anyone know how to add tooltip to sandbox options? is it possible?
is it possible to make new display categories?
thanks alot, you're the cutest hamster i've ever seen on earth π
The reason was UI_Policy_Kick, UI_ValidationFailed_Type22
I keep getting this error on my dedicated server. Players are getting kicked. Anyone knows why?
Is there some sort of vehicle upgrade/ armor framework I can use? I would love to make a mod that gives all the stock cars an ability to armor them up and weaponize them. I know some mods already do this so I am wondering if someone has already done the Lua work for this and I can use that
I think Autotsar has something for this but I could never make much sense of how it worked
Would anyone like to make a mod with me?
What do you have in mind? I do 3D modeling for living so I can make assets, but I am hopeless for coding
I dm'ed you what I was thinking
Reason: Bad word usage
would a 1st person mod be possible for PZ?
most sprites have limited facings for sprites
you could do it for all sprites that have 4 facings
but for those that don't and for which facings matter said mod would have to also include sprites for other facings
you could then rotate all sprites and flip the way it's rendered.. but this would likely have to be a java mod
flipping render order is not trivial btw
all the culling and chunking optimizations that i assume they have (i've written isometric game engines) likely make assumptions that the orientation of the grid is a certain way
lots of code for functional things would also have to be adjusted
world-to-grid and grid-to-world code (or whatever they call it here)
hopefully would centralize that bit
anyway it'd be a nightmare, but technically not impossible
that's my point
xD
When we are using -debug mode, are we not able to use 3d items checked in options menu ?
BringToBearSound <- anyone have idea what this does?
I believe that is something related sound when weapons get stuck .. idk
can anyone please ping me with the directory where the poster/painting tiles are located?
aka if i try shooting jammed gun?
No JamGunChance is the chance, i believe that is something related to sound whe this occurs, but Im not right about that sorry
Would there happen to be a dedicated modding discord for Zomboid? Been looking around, but have been unable to find one.
not here ?? lol
I thought it was here π
We got even a PZ Discord LOOL π
Some games have a general-ish server like this, but I was looking for a primarily modding oriented one. XCOM 2 has one e.g. modders getting together
Normally the modders gang meets here π
Ah, alrighty. I'll be paying attention to this channel then. 
mod support channel if you have troubles with mods
Nah, it's just for creation and stuff.
I did have a question. It's if there's a "map" mod where the location's cell is randomized?
Say I had made an UFO, as a building, not a vehicle. Where it might appear e.g. in a farmer's field, or a city park?
You have a selection of cells where X building can appear, and it's chosen on game start.
I guess it depends on the selected cell
Just be carefull that the random cells do not mess with other map mod cells or you'll get a lot of compatibility issues I guess
that's the sound when u take a gun/weapon out
there's one for mapping but i dont know a modding-only one
Would you happen to have a link to the mapping one?
dm'd
Thank you!
mhm
Hello, what programming language is used for making mods on pz?
so, if i want to make mods on project zomboid i need to learn features and syntax of lua?
@weak sierra ?
look at other mods, read lua tutorials in general
poke around the PZ lua code in meda/lua
there's also modding docs
like a wikiish thing
there's also a 41.65 doc that is purportedly more updated in some ways
yep, but also i need at least to learn basics, all things i know about lua is that lua used in OpenComputers minecraft mod lol
i learned mostly by looking at other mods
but i coded for 17 years before starting and modded a few other games
i can only tell u what i did tho
u might need to find ur own way
x3
thx for answers, i'll dig into it
Does anyone know the difference between "StaticModel" and "WorldStaticModel" ? As well as "newitems","models_items","items" ?
There a thing that I'm going crazy trying to fix...If I spawn in a building no problems all set clothes spawn as planned...If I spawn in the open 1 red error and no clothes worn...any idea what could be the cause of the issue?
try checking the red error
done but basically it doesn't specify nothing of real interest
what does it specify?
kalua error bla bla bla
ok so like actually what does it say
its not just a random red error that means nothing
it only happens when you get the no clothes worn and you think it is unrelated?
How i can translate mod if author is sussy baka that didn't made language folder
how i can translate something like this
you can just make your own
Is there a way to check if an dish made with an evolved recipe contains a specific kind of food ? Like I want something to happen only if the dish was made using carrots ?
The error
I'd overwrite the script file adding a DisplayName for each recipe but maybe there's an easier/cleaner way
ok so looks like thats the error causing it. I mean that is literally the code that is giving you the stuff on spawn, and it is breaking.
it looks extremely related to the issue
Yep but I can't understand what the issue is
If it works when spawning inside a building, why not in the open?
well, I suggest adding some print statements to see what the getKeyId is supposed to look like when it is working, then try to figure out why it isn't that when spawning else where
Has anyone any ideas what this function does:
I've been writing a telemetry module to stream zomboid server data out in XML for consumption by an external service (Discord Bots, Middleware game managers etc), and it's working well - but I'd like to add the players overall X,Y within the map to the output data. This seemed likely but it just returned nil. I'm aware co-ordinates may be relative to a current cell etc, but just wondered what this function was actually aimed at before dismissing it as "not the solution".
(Understanding that the teleportto command takes an absolute set of co-ordinates, can I read these via the lua functions?)
Anyone have an idea why Hunter trait can be picked twice only in PTBR language while using my traits mod?
I checked everything, but this bug only working with PTBR language and other languages are fine.
I think you can just sussy baka your own translate folder and file should be pretty easy
Can anyone tell me where the Mod Options mod saves individual options for each mod?
I'm trying to figure out how RELOAD script button works in debug mode.
First I created simple test script: lua Events.EveryOneMinute.Add(function() print("tick1") end)
It just works and prints "tick1" every few seconds.
Then I added more lines and pressed reload:
Events.EveryOneMinute.Add(function()
print("tick1")
end)
Events.EveryOneMinute.Add(function()
print("tick2")
end)```
Nothing happens. It still print only "tick1". Does the button work? Actually it works but it's strange. I changed script to this:
```lua
Events.EveryOneMinute.Add(function()
print("tick1")
Events.EveryOneMinute.Add(function()
print("tickN")
end)
end)
Now it works as expected. It prints "tick1" and N times "tickN".
After a while I changed the script to the first variant:
Events.EveryOneMinute.Add(function()
print("tick1")
end)```
Now it prints "tick1" N times! What?? Why?!
I wonder how it really works, how it should work....
Somehow reload button removes some events on reload, but not all.
C:\Users\[user]\Zomboid\Lua\mods_options.ini
Excellent, ty
yeah I think it's unreliable and if you use them more than 5 times, you should make your own event system
Is there a way to make a recipe give a set amount of XP for a skill ASIDE from creating a one-off function that gives an exact amount of an exact skill? eg:
function Recipe.OnGiveXP.GiveXP(player, perkName, xp)
player:getXp():AddXP(Perks[perkName], xp);
end
idk how the game reads the recipe ".txt" files
Also reload button doesn't really reload any simple injection. On reload it adds new injection using the same code place. lua local old_fn = GameFunction function GameFunction(...) local result = old_fn(...) return result + 1 end
It needs some kind of protection: ```lua
MyMod = MyMod or {}
if not MyMod.is_injected then
MyMod.is_injected = true
local old_fn = GameFunction
function GameFunction(...)
local result = old_fn(...)
return result + 1
end
end
There are many ways but you should decide what triggers exp gain in your mod.
Crafting means creating. Doesn't this the same?
does my example not make sense?
you want to just do the thing you described, that is the way to do this
:p
you can do it other ways, but it would be odd and pointless
I don't understand how these functions are called
the recipes just refer directly to the function
so how are the args populated?
right, which doesn't include XP or skill
look in the "RecipeCode.lua" file
there IS but it's awkward and would involve doing something like populating a table or moddata and then processing that with your function
more work, more complex, will confuse others
how does that look? out of curiosity
you could make a table of recipes mapped to skills and xp numbers
that's the same thing
I'm looking for an abstract function that takes XP and skill as args
and then you could do a lookup
no because you have no control over the args
right
nothing u can do wouldn't have to be keyed to the recipe
in some way
whether that be at assignment time or via a table or something
is there no way to change how this event is processed?
you can mod the java of the game
I would like to do that
which will mean no official api support to load ur mod
very much
and u can't really put it on the workshop
but it's technically possible
i recommend just doing it the normal way
create a bunch of methods that do the things you want - you can even make the methods programmatically
and call those
it's.. better
haha
no reason to javamod for something that insignificant
I don't understand why it's done this way in the code... you would think that it would be more similar to cataclysm
modding a game will lead u to be frustrated when the code doesnt work like would be intuitive or better to u
but owell
that's just how modding is
I've modded before, but Rimworld allows you to do injections with Harmony
yeah i came from there
so I've had a lot more freedom
this has no equivalent
yeah
@exotic prairie example is in game code:
function Recipe.OnGiveXP.SawLogs(recipe, ingredients, result, player)
if player:getPerkLevel(Perks.Woodwork) <= 3 then
player:getXp():AddXP(Perks.Woodwork, 3);
else
player:getXp():AddXP(Perks.Woodwork, 1);
end
end
You can code any logic like add more or less exp, depending on item id and other conditions.
over there
yes, I know. I'm looking at that code as an example
oh nice. I'm the Advanced Cultivation author
the best u can do if u dont wanna make duplicate functions is make one function that takes those args and somehow derives the XP to give based on them
I think people have asked me to support Soil Relocation lol
either keyed by recipe or ingredients or result
or a keyword in the recipe name even
right
but that's about all ya got
i hope someday they add a java mod hook, personally
what is up with these text files?
how in the world are they parsed?
they have no syntax checking pass
jeez...
are they at least whitespace neutral?
yes
thank god
you'll find even the devs don't do nice whitespace consistency
lol
or naming consistency
u gotta poke around sometimes
I was really confused when I saw them and they weren't JSONs
or... ya know... a normal data serialization
or at least lua
i dont understand why they aren't just valid LUA since everything else is lua, they're nearly-lua
but whatever
i just hope they add a syntax check pass
omg they're case-sensitive?
I would like to not have my crafting menu nuke itself whenever I misspell one thing
the keywords are
yes
keywords and field names
and there's diff separators depending on context
"=", ";", ","
idk if I want to mod this anymore...
it's painful but satisfying

u can do a lot of stuff in lua and avoid the scripts if u want
mostly
i avoided XML mostly on rimworld, heh
yeah, the XML was a pain
@exotic prairie lua do -- injection local old_fn = Recipe.OnGiveXP.Default function Recipe.OnGiveXP.Default(recipe, ingredients, result, ...) -- default: old_fn(recipe, ingredients, result, ...) -- ASIDE: if result:getType() == "BaseballBat" then player:getXp():AddXP(Perks.Woodwork, 20) end end end
yeah that's an example of keying it to result
yeah
I was really hoping there would be a way to wrap with a function that takes the xp and skillname but I don't think there is
oh yeah... I see how the table would work
not if I can't have the recipe pass the args
i mean what's the difference tho
true
well the difference is having 1 function instead of 50
it doesn't do u any particular good to avoid more functions
just make the ones u need
yeah so only make the ones u need lol
reusability has boundaries in PZ land
I'm discovering that
i make framework style mods here, it's frustrating but possible
some areas u just can't
Welcome to the world of PZ modding, pain is everywhere for you to enjoy!1
It's not impossible, there's a method to the madness for sure.
Just be ready for weirdness.
this just exists so u can share attachments between many gun mods dynamically
and it involves each involved mod having to inject data into a table
and then this one dynamically adjusting scripts before playing
:P
and share guns between attachment mods
cool
it was a nightmare to make
I bet
I tried cramming every "remove battery" recipe into one once and learned the hard way that that's a bad idea
but it shows the kind of madness approaches u have to go thru to achieve what'd seem simple
plsu what if u dont wanna remove batteries from everything when u hit "All"
I noticed that battery-operated items aren't battery containers but instead COMPLETELY DIFFERENT ITEMS when they have batteries...
i separated bullet scrapping in my ammocrafting mod for that reason
yeah isn't that fun
lol
yikes
same with lots of other containers
My mod had to adjust battery logic since flashlights ate dead batteries for breakfast
It used the "drainable" use delta to determine if a battery was in or not for you to be able to remove batteries.
on my server there's empty, full w/ gas, and full w/ diesel versions of each container that holds fuel
each with its own item id
and some with full of water versions too
oh and item ids are called "type"
the problem with this too is that it's memory bloat to load all these item defs
I hope they move in the direction of CDDA
that seems to have a very modular design
try this) ```lua
function MyExpWrapFunction(perk, exp_amount)
if perk == Perks.Cooking then
exp_amount = exp_amount + 1
end
return exp_amount
end
MyMod = MyMod or {}
if not MyMod.is_xp_wrapped then
MyMod.is_xp_wrapped = true
local old_fn = nil
Events.OnCreatePlayer.Add(function(_, player)
if old_fn then
return
end
local xp = player:getXp()
local m = getmetatable(xp).__index
old_fn = m.AddXP
m.AddXP = function(self, perk, exp_amount, ...)
exp_amount = MyExpWrapFunction(perk, exp_amount) or exp_amount
return old_fn(self, perk, exp_amount, ...)
end
end)
end```
that one is beyond me
lol
are u.. replacing the function in the player function table
fixed a bit. btw not tested, just blind coded
that would be nice
i didnt know u could do that with diff args
i thought it had to match the template
im not used to lua
even after 2mo
everything is just a table
that's clever, Star
to try to think in this paradigm
I think we need to wrap the recipe function call instead
almost everything works by doing that when u wanna mess with vanilla, much like harmony patching but w/o a tool
but changing it in the function table is very very clever as a variation
fixed again)
u try to wrap by running original still
Fixing metatable adds wrap function to the entire class (e.g. to all players if split screen or on server)
generally speaking things that want to change something to that drastic a measure aren't gonna be compatible either way, and u can handle things seeking the vanilla way as a case
modding-wise
For example, you have a food item. Fixing its metatable affects all the food (but not all items).
right. Don't we need to wrap how the recipe handles calling its "OnGiveXP"?
Injection above wraps ANY xp gain. Sadly. If you want inject only into the crafting system, you may make ninja injection, but it's too hardcode π
Maybe I could re-use some of the fishing mechanics
easy
just add a new lure that is a magnet
and have that change the outcome of the fishing
no?
:p
good idea tbh
i expect u have to override whatever function does fishing results
and go "is lure magnet?"
but probably
Hm, will be interesting.
Might also combo metal detectors in the same mod, but that'd probably be significantly more difficult.
LOG : Mod , 1662934421547> mod "UdderlyKnockedOut" overrides media/lua/shared/translate/en/sandbox_en.txt
LOG : General , 1662934421564> translator: language is EN
ERROR: General , 1662934421597> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method).
ERROR: General , 1662934421597> DebugLogStream.printException> Stack trace:
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at se.krka.kahlua.integration.expose.caller.MethodCaller.call(MethodCaller.java:62)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:198)
at se.krka.kahlua.integration.expose.MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:60)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1228)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
at zombie.ui.UIManager.update(UIManager.java:809)
at zombie.GameWindow.logic(GameWindow.java:261)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:764)
at zombie.GameWindow.run_ez(GameWindow.java:680)
at zombie.GameWindow.mainThread(GameWindow.java:494)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException
at zombie.config.ConfigOption.<init>(ConfigOption.java:9)
at zombie.config.DoubleConfigOption.<init>(DoubleConfigOption.java:13)
at zombie.SandboxOptions$DoubleSandboxOption.<init>(SandboxOptions.java:867)
at zombie.SandboxOptions.newCustomOption(SandboxOptions.java:1870)
at zombie.sandbox.CustomSandboxOptions.initInstance(CustomSandboxOptions.java:56)
at zombie.core.Core.ResetLua(Core.java:4058)
... 23 more```
I wonder if you could use the "foraging" system for metal detection π
wtf did i do
Not a bad idea
Example of ninja injection is in my last mod "Simple Vehicle Recycling".
I'm trying to inject into string.match π
Ofc it mustn't be permanent injection!
is there a way to decompile source?
oh nice i didn't see that one yet
that might be a good alternative to the other vehicle recycling + patch
i need to follow u on there..
Is it possible to add a body location group on top of all the other groups?
Like as below, where the bandages are on top of everything else
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation("Bandage")
... how do I get my mod to show up in the modlist? I put it in <myUserDir>\Zomboid\mods...
It should have proper structure and files like mod.info
Restart the game or reset lua.
Anyone know what mod this guy is using to play as a fat dude? Is he justcheating in the AZ fat model? https://youtu.be/9zotdrzEGTE
This isn't the same as my other video formats, I will start to upload random gameplay clips that I think are funny or interesting.
i don't understand what i did here
it's really.. mysterious
does anyone know what's going on
illegal argument exception to ConfigOption?
like how
these are my sandbox options, i added the bottom one
Sandbox_EN = {
Sandbox_UdderlyKnockedOut = "Udderly Knocked Out",
Sandbox_UdderlyKnockedOut_ChanceToLose = "Default Chance To Lose Skill",
Sandbox_UdderlyKnockedOut_ChanceToLose_tooltip = "The percentage (0-100, not decimal) chance that a skill will be lost on respawn. Used as a default by items without a =X:Y section in the Skill Configuration below.",
Sandbox_UdderlyKnockedOut_MaxLossPercentage = "Default Max Loss Percentage",
Sandbox_UdderlyKnockedOut_MaxLossPercentage_tooltip = "The percentage (0-100, not decimal) of skill levels that can be lost up to, randomly, on respawn, used as a default by items without a =X:Y section in the Skill Configuration below.",
Sandbox_UdderlyKnockedOut_SkillConfiguration = "Skill Configuration",
Sandbox_UdderlyKnockedOut_SkillConfiguration_tooltip = "Semicolon-delimited list of skills with optional =X:Y setting after the name, where X is the percentage chance to lose some of that skill on respawn (not decimal) and Y is the percentage that can be lost (again not decimal). Items without this but that are present use the above defaults. Items not listed are unaffected on respawn.",
Sandbox_UdderlyKnockedOut_BookLossChance = "Chance To Forget Recipe Book/Magazine",
Sandbox_UdderlyKnockedOut_BookLossChance_tooltip = "Chance to forget the content of a recipe-granting book per-book (0-100, not decimal).",
}
option UdderlyKnockedOut.ChanceToLose = {
type = double,
default = 60,
min = 0,
max = 100,
page = UdderlyKnockedOut,
translation = UdderlyKnockedOut_ChanceToLose,
}
option UdderlyKnockedOut.MaxLossPercentage = {
type = double,
default = 30,
min = 0,
max = 100,
page = UdderlyKnockedOut,
translation = UdderlyKnockedOut_MaxLossPercentage,
}
option UdderlyKnockedOut.SkillConfiguration = {
type = string,
default = Carpentry;Electrical;Metalworking;Mechanics;Cooking=40:15;Farming=40:15;First Aid=40:15;Tailoring=40:15;Fishing=40:15;Trapping=40:15;Foraging=40:15;Maintenance=20:10;Aiming=20:10;Reloading=20:10;Sprinting=20:10;Sneaking=20:10;Lightfooted=20:10;Nimble=20:10;Axe=40:15;Long Blunt=40:15;Short Blunt=40:15;Long Blade=40:15;Short Blade=40:15;Spear=40:15;Strength=20:10;Fitness=20:10,
page = UdderlyKnockedOut,
translation = UdderlyKnockedOut_SkillConfiguration,
}
option UdderlyKnockedOut.BookLossChance= {
type = double,
default = 10,
min = 0,
max = 100,
page = UdderlyKnockedOut,
translation = UdderlyKnockedOut_BookLossChance,
}```
does anyone see something i messed up?
could the forward slash be murdering it?
or am i barking up the wrong tree
tis not the slash,.
oh it's probably cuz i didn't copy the latest to the workshop version that i left installed. :P
herrrrp
nope still does it
ok so the java just says "is not null, is not empty, and doesn't have an equals in it"
oh my god is it because i don't have a space between the name and the equals?
i swear to god
oh my god that was it
@exotic prairie i take it back, it apparently can care about whitespace
1 hour and 15 minutes gone due to parser doesn't tell you the problem clearly and/or has no tolerance for whitespace D:
I've got a question about loot tables. If I update my mod with reduced loot chances do these numbers get adjusted on prior saves? Or do I end up with multiple entries with the old and new loot table entry on the save? I'm not sure how or when this runs and so I am not sure if I need to remove existing loot table entries when I update amounts.
i think the loot table is rebuilt on every load
it won't change spawned-in loot
but it'll have new values when it spawns again
Any clue why between these two examples, the one that plays based on "OnPlayerUpdate" doesn't work with NPC's? (I would like to give compatibility as many people uses that mod)
`local DTvignetteEffects = {}
DTvignetteEffects.enableVignetteEffectWhenTired = function()
local player = getPlayer();
local playerNum = player:getPlayerNum();
local vignette = getSearchMode():getSearchModeForPlayer(playerNum);
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
local currentFatigue = player:getStats():getFatigue();
local currentPanic = player:getStats():getPanic();
getSearchMode():setEnabled(playerNum, true);
vignette:getBlur():setTargets(0.7, 0.7);
vignette:getDesat():setTargets(0.5, 0.5);
local baseRadius = 30 - (30 * currentFatigue) - ZombRand(1, 7) + (currentPanic / 10) + 10;
print("baseRadius: " .. baseRadius);
vignette:getRadius():setTargets(baseRadius, baseRadius);
vignette:getDarkness():setTargets(currentFatigue - 0.15, currentFatigue - 0.15);
else
getSearchMode():setEnabled(playerNum, false);
Events.EveryOneMinute.Remove(DTvignetteEffects.enableVignetteEffectWhenTired);
Events.EveryOneMinute.Add(DTvignetteEffects.disableVignetteEffectWhenTired);
end
end
DTvignetteEffects.disableVignetteEffectWhenTired = function()
local player = getPlayer();
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
Events.EveryOneMinute.Remove(DTvignetteEffects.disableVignetteEffectWhenTired);
Events.EveryOneMinute.Add(DTvignetteEffects.enableVignetteEffectWhenTired);
end
end
Events.EveryOneMinute.Add(DTvignetteEffects.disableVignetteEffectWhenTired)`
That is the example one with EveryOneMinute, the effect works fine in single player, single player + NPC around and multi player
But if I change it to this it doesn't work with NPC's:
`local DTvignetteEffects = {}
DTvignetteEffects.enableVignetteEffectWhenTired = function(player)
--local player = getPlayer();
local playerNum = player:getPlayerNum();
local vignette = getSearchMode():getSearchModeForPlayer(playerNum);
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
local currentFatigue = player:getStats():getFatigue();
local currentPanic = player:getStats():getPanic();
getSearchMode():setEnabled(playerNum, true);
vignette:getBlur():setTargets(0.7, 0.7);
vignette:getDesat():setTargets(0.5, 0.5);
local baseRadius = 30 - (30 * currentFatigue) - ZombRand(1, 7) + (currentPanic / 10) + 10;
print("baseRadius: " .. baseRadius);
vignette:getRadius():setTargets(baseRadius, baseRadius);
vignette:getDarkness():setTargets(currentFatigue - 0.15, currentFatigue - 0.15);
else
getSearchMode():setEnabled(playerNum, false);
Events.OnPlayerUpdate.Remove(DTvignetteEffects.enableVignetteEffectWhenTired);
Events.OnPlayerUpdate.Add(DTvignetteEffects.disableVignetteEffectWhenTired);
end
end
DTvignetteEffects.disableVignetteEffectWhenTired = function(player)
--local player = getPlayer();
if player:getMoodles():getMoodleLevel(MoodleType.Tired) > 0 then
Events.OnPlayerUpdate.Remove(DTvignetteEffects.disableVignetteEffectWhenTired);
Events.OnPlayerUpdate.Add(DTvignetteEffects.enableVignetteEffectWhenTired);
end
end
Events.OnPlayerUpdate.Add(DTvignetteEffects.disableVignetteEffectWhenTired)`
Is the "player" obtained by the OnPlayerUpdate different than the one obtained by the getPlayer? any clue? π€
With doesn't work I mean that with the EveryOneMinute the effect is applied accordingly and doesn't affect others. But with the OnPlayerUpdate for some reason no matter the fatigue it always goes to the "else"
getPlayer() returns the client if it's run from the client code, player in the event returns whatever player triggered the event contextually. im not sure what getPlayer() does if u call it elsewhere
i haven't looked into that yet
would also like to know
@knotty abyss
you can find out the difference between staticmodel and worldstaticmodel here
#mod_development message
Y'all from 10 Years later have serious issues
Who removed all submods, renames the mod and makes servers and savegames require to wipe a ton of cells mid stable branch
removes*
Is there a piping/wiring mod that allow to build cables/pipelining for long range energy/liquid transmitting? I am not talking about barrels, but more like plumbing through out houses.
For a lua function located in the server folder, can it safely call other functions or data located in the shared folder?
Yes
Yes... to my question?
Yes
You should explicitly require the file, still
even if it is just a global table which is located in shared and then accessed by a function from server?
You are depending on another file, use require
If the dependency already loaded, require does nothing, if it didn't, it ensures everything works
ok
is there a mod that fixes hair clipping out of hoodies and stuff like that?
Try this one -> https://steamcommunity.com/sharedfiles/filedetails/?id=2447729538 (FLUFFY HAIR - made by Scavenger)
@knotty abyss already have it doesn't work sadly
hats/masks stuff like that its working but no hoodies and other types of clothes
I just know this one, sorry
Apparently yes, there is a comment in there file that says that groups have to be declared in render order
@winter bolt sorry for late response, but no there's no modded hairs
oh weird
In this case both runs in the client code, the function is in the same place but I only change the Event that triggers it. I also tried to not use the player obtained by the event and using the getPlayer inside but same behaviour
Alexa, if I may ask, on which NPC mod are you working? New or exsting one?
No no, I'm not working in the NPC mod, but as it is really popular, what I'm doing I'm trying to make it compatible, right now using the EveryOneMinute it is compatible in SP, SP + NPC and MP, but If I switch to OnPlayerUpdate it is only SP + MP
Thanks Alexa π
...BTW...Anyone know if around there's a mod containing Survival Military Glow Light Sticks/Chem Lights? ( Otherwise I need to made one LOOL π )
IIRC around there should be a mod for having a bald character, that should solve the clipping hairs issue LOOOL π
I made my first mod, if you could take a look π https://steamcommunity.com/sharedfiles/filedetails/?id=2862104381
Looks interesting! Are you able to add more pictures of it? Like in game for example? And add more information to the description? π
Uh, just a question. Iβm new to modding.
Thereβs a mod I want to edit for personal use - Pamboβs Ultimate Zombie Loot or something. I want to make it so more items (including items from other mods) can drop from zombies. How would I do that?
Of course bro!
I will do this later when I have some free time.
My suggestion mate, to possibly avoid you a lot of hard work, is to go to the workshop and download Mod Manager then check what are the mods of interest for you. You can then enable them in the right order and having all that you need without the need to made a mod yourself ( Take in mind that in most cases PZ mods are modular so they can be used together ). About your original question...Hard to reply in short...It depends on what you want to add, your modding skills, etc
I donβt think mods like what Iβm looking for exist, Iβm afraid.
Ok if so then welcome to the mod community and be ready for a lot of hours of " fun " playing with lua files, scripts, functions etc LOOL π
If you are new to PZ modding my suggestion is first of all looking at already built similar mods ( in respect to what you want ) so to starting have an idea about how the PZ file structure works π
Then when you feel yourself confident with it start making yourself something easy....In the worst case the game will crash or your mod will not work
For all the rest you can ask here ( but you need to do more specificic questions ), there's a lot of talented people around here willing to help ( Also someone not so friendly but the most are good available persons ). Remember that in modding communities making very general questions may sound like if you stop a random person on the road and you ask him " What I have to do to become God? " ( Just to give the idea no offence intended )
Imagine the reply that the random person could return to you and you'll understand immediatly what I mean π
I forgot to mention...If you do a Google/YouTube search there are several modding tutorials available that may help you in realising your project π
...and don't forget to check also the PZ Wiki ( Even if sometimes is not super updated ) and GitHub
Got it. Iβll try my best.
Good luck mate! π
The very last thing but it's very important...Whatever you'll do, NEVER forget to make always first a backup copy of the files you intend to edit π
( Just in case something may go wrong or not as planned )
Will do.
git is a great way to manage your modifications, if you haven't used it before. makes it alot easier to revert things in case you need to go back
hi guys, im new in this discord server, passing by to check-in, hope u are all healthy and fine, etc...
does anyone know any tool that help changing loot that respawn on some cells??? for an example, some mods have their own edited cells with their loot, which give the game some "unbalance" and since what i want to do it's for an multiplayer server
it would help a lot, to change specific loot spawn/respawn on some areas... cells...
some mods doesn't give an option to change what or where it should respawn, so, any hints tips????
https://pzwiki.net/wiki/Modding:Lua_Events i went to this page, hoping to find my solution
Good night my friends! what would you think of a mod (or modpack) that makes the zomboid steampunk style? it would also change the entire game balance and functioning of the world!
steampunk/madmax are awesome, in my perspective
A mod who turn the game in car based... Hummmm sounds good
everyone is looking for something like that for a while
we have that bus/madmax style only
have you seen it???
i dunno if i should be posting links here, im sorry if i shouldn't
but the concept is gold, dunno if the mod is up to date too
eh can't really find such a mod, fluffy hair's steam page says that issue has been fixed by indie stones themselfs in a previous patch
anyone available for a few questions about loot drop rolls?
Does anyone know how to increase the amount of experience a weapon gives per hit? I don't know the code for it if there is one.
it's up to date but it has its imperfections
it works tho
Almost all day to find an error in the script...and the error was then a single letter " E " written capital instead of minor....I hate lua LOOL π
EXP is not given only by the weapon but by the aiming perk settings too π ( But take this with the pincers because is a lot that I don't look at a weapons script about this )
( IIRC they should be in the file MainCreationMethods file, if not hardcoded )
In the weapon script you can find also the string " AimingPerkCritModifier = 10, " ( Sample )
Thank you very much! So there is no way to edit the experience gain from the json files for weapons, only directly with code?
I was looking at it right now...I presume you have to play with the weapon string value mentioned above to increase/decrease at which rate the gun use increases the xp given ( In the other file there are no settings about xp speed gain I've checked now )
You have make some trials but I guess that raising the value will have some kind of effect
oh I misunderstood, so this goes in the weapons txt scripts
Yeah I shall test it, tyvm
I dunno which gun script you are using. Personally I've looked to a script of a Brita's mod gun.
I'm actually working on a melee modifier so perhaps it does not apply there, but I will see if there is something similar
I'm trying to figure out how to make the xp modifier higher on a melee weapon (since it does very little damage and gets little xp for many hits because of it)
It depends also on the character skill level the damage inflicted
Yes but when compared to another blunt weapon it takes around 5x as long to get the same amount of experience with constant fighting
(I made an unarmed mod and want people to actually be able to use it to level their blunt skill)
not to make it OP but to make it viable
Sample ( on a total of 10 bars ) with aiming....Until levels 8-9 your character will only hit seagulls basically π
it's not as bad with melee weapons but yeah hitting anything with guns is hard at low levels
send me the weapon script via pm I'll check π
it uses the same format as the base games weapon files
it's also on the workshop
"Donazo's fine fisticuffs"
Please send me the file I have no time to go to the workshop right now sorry
( I'm about to prepare dinner π )
search for strings
MaxHitCount = 3,
DoorDamage = 55,
CriticalChance = 50,
CritDmgMultiplier = 12,
MinDamage = 0.9,
MaxDamage = 3,
Just made a super quick check, watch if there are other strings of interest
The xp you get from using a weapon is actually tied to the damage you deal with each hit. Thus, using a hunting knife will increase your short blade skill significantly faster than if using a butter knife.
Using the same logic, you deal more damage when hitting a zombie that's on the ground, doing more damage and earning more xp as well.
You'll also earn less xp with each hit when you're tired, or exhausted...
Hi guys, need help. Is there any possibility to use file system or network interface in zomboid mods? In Minecraft mods, for example, one could just make web requests and save things to files. Is persistence totally forbidden in PZ (since io and os modules are not available from lua) and is there really no way to use it? How do I make cool mods if I could only store stuff in memory untill the server restarts?
Ok, I'm back with one question. How do I make a reference to an item added by another mod?
Here's an example of the code I'm trying to modify:
addItemToZombieLoot("Base.WaterBottleEmpty", 0.05, GlobalDropRate, ContainerDropRate);
addItemToZombieLoot("Base.WhiskeyEmpty", 0.05, GlobalDropRate, ContainerDropRate);
addItemToZombieLoot("Base.WineEmpty", 0.05, GlobalDropRate, ContainerDropRate);
addItemToZombieLoot("Base.WineEmpty2", 0.05, GlobalDropRate, ContainerDropRate);
I'm sure I can expand this set for base game items simply by adding in stuff with "Base.WhateverItIs" in the appropriate spot and so forth, but how do I do this with items added by mods?
Some mods extend Base, some don't. You'd have to check the mod you're wanting to modify.
So in other words, they could fall under Base or some other prefix.
Is there any way to edit the TV/radio transmissions with lua, or do you have to do it via XML overwrites?
relatable
i can't tell u how many times
you can certainly use the filesystem, but it's sandboxed into the Zomboid/Lua directory
im not sure if there's any way to break out network-wise
haven't looked into that
i would imagine you could use a file as a pipe, worst case scenario, to acheive whatever you want to do by talking to another program though
curious what your use case is?
Anyone know if "rolls=1" means that only one item can drop or can multiple actually drop?
it means that it has more opportunities to drop
has nothing to do with how many can drop
multiple entries of the same item mean multiple can spawn
so if rolls=4 and the item is only once in the list, then it could only drop once?
I'm new to lua/zomboid modding and I hit a wall, where is this the best place to ask for help?
I made a mod today and it was working fine. But now I see when I'm in the game, in the workshop tab my mod with a gray screen and it's not working anymore. What can it be ?
don't know if it's this but you could be missing the extra folder it's supposed to go in C:\Users\Me\Zomboid\Workshop\Uzi's Duffel Bags\Contents\mods\Uzi's Duffel Bags\media\
^
There are many folders .. im freeking out
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\Workshop
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\mods
C:\Users\romar\Zomboid\Workshop
C:\Users\romar\Zomboid\mods
its saying in local in your picture
I need to know what is the folder of my mod made and the structure of it (mod.info , preview.png ..)
Yeah, but when the mod stuck I changed something and dont remember the right way
if you look at your picture you posted on the right it says local: and has the address to where your mod is right
I dont need to install my own mod right ? my mod works directly from the folder he is right ? ?
nvm that's not your issue
as for network interface, you can try using the getUrlInputStream
I sent u a private message @glad ridge
your C:\Users\ UserName \Zomboid\Workshop\ MOD NAME GOES HERE folder contains the Contents folder which has mods folder, which contains another folder named the same as the previous MOD NAME GOES HERE folder, which contains the media, mod.info and/optional poster.png and icon.png and media contains the lua, scripts, textures files in it
Is there a trick to getting "Minimal Display Bars" mod to function? I installed it but in game I don't see the bars anywhere
what icon and icon.png ?
here have too this workshop.txt
What is missing here are these files that you mentioned icon and icon.png
Need I to subscribe my own MOD ?
Page 1
Page 2
did you upload the mod to the workshop or are you just trying to make the local one work
don't think you need an icon.png it will just have a default icon if you dont have it
was it working before you uploaded it?
yea
yes because the game asked to add these files in different folders so i took them and put them where he wanted
but after that nothing works anymore
add what files specifically
yeah so you didnt have mod info before?
mod.info should contain this name=Uzi's Duffle Bags id=Uzi's Duffel Bags description=My 5 Duffel Bags poster=poster.png icon=icon.png the id should be the same as the mods folder name and just get the poster and icon from any other mod on the workshop as a template
you can make your own in paint or photoshop or whatever
my mod.info name=Ginseng Pills poster=poster.png id=GodigodMod description=Ginseng pills for endurance.
looks good
like i said you can get one from someone elses mod
its just a png icon that you want to show when selecting the mod in the mod selection on pz
now I edited mod.info adding icon.png ```name=Ginseng Pills
poster=poster.png
id=GodigodMod
description=Ginseng pills for endurance.
icon=icon.png
oh yeah good idea
I need to subscribe my own mod ?
why when i go ahead in this part it tells me that files are in wrong folder ?
This file dont go there ?
i can't translate but it seems like your png might be too big, no?
Dont have a preview.png on the folder that i selected
you might need one then
workshop/modname
folder
if you just download a mod you could follow the structure lol it be easier
so I need to take the one I put in the folder you said before and put it in this one?
I need to create a new one and put there ? thats it ?
it has to be the size it says in your screenshot above
and should be named what they name it in that screenshot as well
what I did the first time I uploaded it was take the files I already had and put it where it was sending. Maybe that's why I got all this problem that I can't solve now
the size was 256x256 like it want
idk man its just a png that you could get from ANY other mod in the workshop and edit it to your own
I got my own poster.png and ctrl+c and ctrl+v there and changed the name for preview.png ok
works. now the next step and I believe that is the last one
Ok, I will test right now.
the path that is appearing there is this -> C:\Users\romar\Zomboid\Workshop\GodigodMod\Contents\mods\GodigodMod
Do I need to sign up for my own mod now? will not conflict with the one that is already there?
if you added a mod to the workshop, and you want to use the one from the workshop, you probably have to subscribe to it on the workshop
if you edit the mod you should unsub from it IF you are subbed to it as it will cause conflicts
I'm trying to find out what happened buddy and I appreciate your help. by the way sorry for the inconvenience
i thought we just figured out what happened
I'm asking this because before I was running the mod without sending it to the workshop. When I was creating him
I'm not registered and it's already showing up there with this path I said
C:\Users\romar\Zomboid\Workshop\GodigodMod\Contents\mods\GodigodMod
yes that's the local path..
ok I will subscribe right now and restart the game to see what happen
I subscribed and the same path is there C:\Users\romar\Zomboid\Workshop\GodigodMod\Contents\mods\GodigodMod
take the mod out of the workshop folder and see what happens
just cut and paste it to your desktop and try it out
yep i think having it in your local directory will cause it to load your local over your workshop one
path changed
now it is working from here C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\2862104381\mods\GodigodMod
I cant open it.
But now the mod works again.
oh kkkkk
download my mod and give me your feedback after please
Thanks for all @glad ridge , thank u so much !!
nice one broski, glad you got your first one down
looks like you got some good views already
Can I delete that folder right now or I need to put back there ?
the workshop folder with files etc
the one i told you to paste on your desktop?
yep
you should keep the workshop folder in the pz file location like it was
i was just saying to cut your mod out to see if it would load the workshop one
But will it not cause conflict again?
is there any reason you want to run the workshop one over your local one?
when someone downloads your mod they will just have the one that's path goes to ... workshop\content\108600\2862104381\mods\GodigodMod
yeah i know that
so it shouldn't matter which one you load as long as you don't change it
but is weird is causing conflict before when the mod was in workshop
but it was just working right. it loaded from your local path even when you had the workshop one dled, and when you took it out of the local it loaded your workshop one
so no more conflict right
I will see
i think we just checked earlier here no? #mod_development message
you'll want to keep the local one so if you decide to update it or need to fix it you'd have to do it to the local directory
then reupload through the workshop option in pz
what is that ?
the txt?
well we talked about preview before
and appear too in this path 2 strange files
but the workshop txt is all the info you input when you were adding it to the workshop
also includes its workshop id
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\2862104381\mods
appear here a media folder with poster.png inside it
lol
yep its just what happens automatically when you add a mod to the workshop
look that shit
can I delete this one ? the others mods dont have this folder media in this place, very weird
yeah idk.. when i dled it, it looks like this



