#mod_development
1 messages · Page 145 of 1
your workshop page is on tetris mode
Horde manager isn't working to spawn zombies. Is it bugged?
where did you see a horde manager?
I'm in debug
if your zombie population is set to 0 you cannot spawn zombies
is zed pop set to 0?
same brain
Ah, that's it
I was hoping it had changed since i lasted tried to do zombie testing in debug many years ago
Is there a way to see the health of a door in debug?
Hello there!
What is the best way to implement sandox options for a mod? With the help of mod options? Or is there any better way?
Guess i found the answer
#mod_development message
Is there any way to make it so zombies get bored and give up after hitting something for a while?
i am so satisfied with this rn
modpage if anyone wants to see the layout
id appreciate if someone checked that it looks okay on their pc and not just mine lol
PC looks nice, but mobile goes brr if you mind it at all
it's really steam's fault for all this
hey guys I'm making my first mod by forking another one and I am struggling with figuring out how the data is arranged in these lua tables. There are tables in a table but some of them are empty so I can't just dump them, I tried some inspect library but couldn't get it to work
wwyd
Steam Mobile is a steaming pile of shit for navigation, even with the major UI update they did. Better than nothing though.
Make a for loop that prints each table element, if at all possible. Otherwise, I would investigate what exactly gets added to those tables. It has to be somewhere in the code.
Also, it delays notifications EVERY TIME. So goddamn annoying, I get notifications for comments that were hours ago
the best i could do is get some "table 1x234567" rows print out, but if i go deeper nothing prints out. but this is where the mod i'm forking successfully saves the data to load later so there must be something in there
You could maybe insert a breakpoint when running it in debug
To see what the list has
uhm, how would I do that? I found breakpoint() on indiestone forum but it didn't seem to do anything, everything ran normal. I am running in debug mode
Double click the line in fileviewer through the f11 menu
scrolling the file list I now understand why the mod maker has a separate file for next to every function in the project
is there a boolean check to see if a function is currently being run?
i should see the contents in object stack?
Not sure.. but you can make a new boolean in your function and use that
well, maybe it isn't a lua table any longer after a point 
wait are they actually?
there's a KahluaTable which doesn't open in the debugger
How do you get the table?
u mean where it's from? or how i see it in the debugger
In the code
Could you paste the call here? Im not on pc rn
this is the one part of the table I'm interested in ```function RecoverableTraits:Save(player)
Respawn.Data.Stats.Traits = {};
local traits = player:getTraits();
for i = 0, traits:size() - 1 do
table.insert(Respawn.Data.Stats.Traits, traits:get(i));
end
end```
it's pretty convoluted maybe i should try to focus on this exact function first
What table do you want from this?
i need a string list of names of the traits the character has basically
but at a later point by loading the saved data when character is no longer alive
maybe I just need to do my own saving function or sth
So far i know there is a GetFromIndex for perks maybe look in the pz documentation for calls
I meant traits not perks
this is the docs right? https://projectzomboid.com/modding/index.html
package index
Yes
so if i made the nearest tile the sound emitter source, would that make it so every tile a dif emitter?
very possibly, thanks
i think i might be able to use PlayWorldSound
i'll take another look at it tomorroe
lmao
it looks great!
can you explain a bit more what you want to do?
i got .01 progress on my mod today at least since i only had so little free time
this part specifically
i separated the startup function to its own event so i can test it and do other things to make sure it functions properly
and ofc every progress leads to 10 more questions
Why do you need the traits when they die?
maybe for statistics
yeah
that's info i wish i had sometimes
Great Wall of China



where to set how much player get XP for fixing something ?
gn everyone
gn at 10am xD
im looking to give player 20xp per repair custom item but not sure where to set it

looks cool, but too distracted
better keep full width and let the user read from top to bottom
It is full width just two columns
is there way to request from player to have item but wont be taken after use?
like in receipt you use keep option but in fixing ?
Technically more info per space
that will make people refuse to read further
when they read from left to right and hit the box, they will be unsure if they should read the next right box or the bottom box
anyone can help me with fixing script ?
what's the custom item?
custom tarp to put on window
it can be damaged and destroyed but want to make option to fix it with xp for carpentry skill...
you can use this but you'll have to do some steps before it to get a InventoryItem
declaration: package: zombie.inventory, class: InventoryItem
TARP not TRAP xD
it is item already
but to fix i want to give xp in fixing function
not as recipe function
do you want it like fixing weapons where you right click on it in inventory
more like vehicle fixing part
can you explain I've never really fixed vehicles in this game
like is it when It's on the window in the world you can repair it?
oh so It's these types of files
fixing NameYourFIX
{}
where do you find the vanilla ones?
Does anyone know if it is complicated, or if there is a simple way to make a mission system? Something similar to the snake mod pack, where I go to a container, drop an item and it automatically gives me back another one (or make an npc).
problem is in game when you repairing cloths you Tailoring exp
when repair something electric like radios or tv or even generator you get Electrical exp
and when repair vehicles you get Mechanics exp
and i'm looking where is located that file for refer XP of repairing those items....
from vehicle parts only found for fixing engine .... for rest parts still not sure
My quest system will go live in Mr Atomic Duck's server in a few hours and should be made public in the next few days
We could create our own missions?
Yes that is the idea
Okay, thank you. Because that's what I was interested in, that the player would complete some quests to complete the map, even if it was something as simple as delivering items. I'm looking forward to seeing it when it comes out.
Hello I'm a novice Modder and I'm trying to make a mod that adds in Chloe's pickup Truck from Life is Strange I've got the model and I've even spent some time finding the right coordinates for all the interactable on the truck but when I load the mod into my game the trucks body is completely invisible, how I made the mod is i went and found a mod a truck mod and severally edited the code, models and general information to better suit my mod
im not sure if there are any tools to make this easier but ive been doing it manually so far
any info in the log?
im not really sure i can tell whats old and whats new is it possiple to move the log out of the folder and boot the game with just my mod to see only those logs?
You do not receive any errors when running the game?
last i remeber was error number 4 i think but i can check again
This would be something similar to the Quest Framework that was released last year?
Remember that when you add a vehicle to the game, you must start a new game. check the error code.
alright ima go see if there are any errors just a moment please :)
Probably I guess. It will allow complex quests to be created simply by inserting lua tables into it
small question can be used Moveable item in crafting
I know it can be used as a result
crap
Nice! will be looking forward it 🙂 the previous one did not understand it at all 😂
BrokenGlass is defined as moveable item so ugh i wanna make from it bulb
glue + broken glass + metal scrap + metal wire = light bulb
If there were no changes to that. Moveables can be the result of a recipe but not ingredients

dam it why it is defined in game as moveables object not as item
is there way to move that object to item ?
like convert
when you have Moveable_Broken_Glass in inventory it will replace that with item.BrokenGlass ?
Pretty sure moveables stay moveables in inventory
bruh [02-04-23 10:03:43.322] LOG : General , 1680444223322> ERROR: model texture "Vehicles/chloecartxt" wasn't found.
[02-04-23 10:03:43.322] ERROR: Animation , 1680444223322> ModelManager.addVehicle> texture not found:.
yes try Moveable.sprite. e.g Moveable.carpentry_01_0
The error itself is telling you, the textures are not imported to the game.
yeah i knows lol i must have changed the name of the texture for the truck ive just changed it back and ill try again
yessss i think
You are getting this error because it is not well configured in the mod itself, check it. Sometimes the solution is the simplest there is. And if I remember correctly, PZ's 3d modding supports OBJ, FBX, and 3DS
yea after i get it half ass working ima go back through and fix any
or bad lua code
yep that was the problem
lol
now i got other issues that i actually know how to fix
thx so much!!
If I remember correctly, that error is due to dimensional issues in the texture, if you have used the texture of a sports car in that car, that will happen, try with a normal texture of that car to see if it still gives you error.
That screenshot looks pretty cool.
Hey. Anyone know of any "Templates" for types of items or any scripts that are available online for helping modders?
I can fully integrate these for the VSCode extension that I'm currently writing.
Like "Create New Weapon" command generating a template where name, tooltip, and some other things could be filled in as a starter for weapons.
I wanna enable respawning a character with the penalty of taking an additional negative trait. The mod I'm forking enables it for an exp penalty
any idea what i could have fucked up? XD

Both the PZWiki and Wolf's guide doesn't have documentation to describe the item block.
where can I find the custom non pvp zone file
texture size
maybe, .. not sure .. but majority the texture size
check the vanilla texture size of that specific cart
file size
anyone knows where the weapons that get spawned stuck in zombies are defined?
any of my texture works.
maybe some people knows
Media/lua/shared/definitions
yep found it thanks
Going hard on them docs. heheh.
Making it so there's no way that the scripter couldn't figure out something when scripting. =)
The extension is more intelligent with scope-detection too so I can also make it where options only shows up when in a valid scope.
like
vehicle MyVehicle {
// ...
part MyPart {
// ...
}
}
Templates / auto-complete should help out a bit.
wait jab
you have a functional vehicle script syntax ultimate tool now
woah
this is groundbreaking
links pls
@red tiger PLEASE SIR
this will solve our current syntax confusion
I mean.. I'd need to fill this portion out for the extension.
That might take upwards of a week for vehicles alone, however it is planned.
ok looking forward to this like 100%
I'd need to figure out how vehicles work.
If I had someone construct vehicle "templates" for types, I could add them as commands.
I have hover-documentation & auto-complete support already in-place and ready to go after vehicles when I get there.
maybe ask skiz if his willing? idk
I still don't know how to script lol.
@faint jewel Up to you bud if you want to throw a hand in vehicle templates.
creator of zedscripts dunno how to script thats ironic
BTW the vanilla scripts currently in Build 41 are full of dead properties that were removed ages ago.
TIS made ZedScript. I call it that because it has no official name or extension.
A lot of the scripts in PZ can be cleaned up if a formatter detected and either commented or removed dead properties.
That and the insane whitespace / tabbing.
I have to write another Lexer because the one I wrote was for digesting script-data, not for formatting.
After documentation comes formatting. After that I can begin to look into diagnostics & error-detection along with "Quick Fix" support. =)
Goodluck boss
does anyone know how to rerender a zombie? I add an attached item to it but it wont show unless its dead
i've seen zombie:resetModel()
don't know if that actually does what you want but that seemed to be what it was meant to do in the code i saw it in
Is there any way to make it so zombies get bored and give up after hitting something for a while?
You’re just a god walking on earth
How can I tell if my item is spawning?
I'd suggest going into debug mode, enabling the 'LootZed' cheat and going to a location where your item would spawn. From there you can right click on a container icon in your inventory to access LootZed. It'll have a list of items and their spawn chances
I'm considering making lootZed easier to use in the community tools 🤔
Or maybe more obvious
Perhaps just a little (!) next to the button
I’m about to publish my mod and it’s not showing up in the workshop creation tab on zomboid
Do you have the workshop folder setup properly?
It needs to be in the local workshop folder for starters.
Where’s that
And you need a folder in there that contains the mod's content and workshop.txt
It's your local cache folder -- usually user/Zomboid/Workshop
copy the structure of Workshop/ModTemplate
How do I get to my local cache
Nvm I see it
I named it content instead of contents
Now it’s saying preview.png is not readable
What zombie state determines whether they are aggroed? is it walkTowardState, isAttacking, or something else? Also, when a zombie thumps on a door, while seeing a player through it, is it both thumpState, and whatever the state for aggro is as well at the same time?
i haven't looked into it specifically, but i don't think aggro itself is a state?
I'm pretty new to PZ modding and i wonder if there's an explosion event and can i trigger it on zombie hit?
That's what it's looking like to me. Do you know how to determine if a zombie is aggroed?
probably getTarget()?
How might I determine how long a zombie has been in a thumping state?
you might need to use OnAIStateChange to record the time they entered the state
and then compare to the current time
Are there any mods that significantly change zombie behavior? I could use one as reference
is possible to add in temple location of place item?
Is there somewhere I can see a list of all world events?
How do I force a zombie out of a state or change a zombie's state?
changeState(state)
i've heard the zombie ai usually interferes with stuff like that though
Aloha there, folks. I've been having some technical difficulties with getting the lunch box spawns to work, it claims they're null. I presume there might be something wrong with the script here? I have the Distributions.lua file marked as required (where they reside in) - though they don't seem to work. The vending machines work just fine on the other hand.
table.insert(Distributions["all"]["Lunchbox"].items, "PompsItems.PISchoolMilkChocolate");
table.insert(Distributions["all"]["Lunchbox"].items, 1.0 * SandboxVars.PompsItems.DrinksSpawnRate);
doesn't seem like Lunchbox is under all
Distributions["Lunchbox"].items should be good
Ah all right, appreciated. I'll give 'er a go
Evidently, I needed it to be SuburbsDistributions - I was under the impression that was wrong and left the ["all"] part - all better now!
Can anyone help me understand what I'm doing wrong here? I want zombies to stop thumping if they haven't seen their target for 15 seconds, but it isn't working.
zombie:getCurrentStateName() returns a string, but you are comparing it to an object
I just updated, it was looking for string before, still didn't work
I just forgot to remove name from the getCurrentState
That didn't work either though
i'd throw in a print to make sure your code actually gets to this point
zombie:changeState(IdleState:instance());
if the print shows up, then most likely it's something to do with this
The print does not show up.
So maybe I'm misunderstanding what output "getTargetSeenTime" does
Ah, it's not how long since they've last seen the target; it's how long they've seen the current target for
How can I get the time since a target was last seen by a zombie?
how are you supposed to set up folders for a workshop item in project zomboid.
look at Zomboid/Workshop/ModTemplate
I made a recipe and when I test it the result is make and a part of the recipe. I also don’t know how to make it so the result it multiple items
How does the zombie ThumpTimer work?
i copied the mod template and changed everything i could to fit the mod i am doing but im still missing something 😢
only one of my recipes is working in this script pls help this is only my second mod jaja
How do I access a zombie's "TimeSinceSeenFlesh" field?
I saw another mod do this. Should doing this allow me to access a zombie's fields?
local zombieData = objectData[zombie]
make sure your mod.info has a unique name and id, and your mod stuff is in the right folders
Yo joy can you tell me what going on here? I have no idea
nope. im not on my pc atm so i cant preview files
Oh ok
if i remember later and u havent got an answer i will take a look, but i dont really do anything with scripts
has anyone ever tried to make a house indestructible? it will not break even with fire, explosions or sledgehammer.
I want to make a warehouse that can only be accessed if you have a card (simulating a key) and can not destroy any part, both the zombies and the player. to make a mission system. Something like Labs de escape from tarkov. if u play the game
Bro
In this file, how do I access zombie's 'TimeSinceSeenFlesh' field?
put ur items and recipes in separate files
items.txt
recipes.txt
oh i see thx
which recipe works
has anyone here worked on modding the stealth system on the Java side?
@rancid panther
-- Function to activate the mission
function activateMission()
-- Get the player
local player = getPlayer()
-- Create a new mission
local mission = player:getModData().mission
-- Define the mission details
mission.name = "Deliver Object to Designated Crate"
mission.complete = false
mission.crate = "Crate XXX"
mission.item = "Object ZZZ"
-- Display the mission objectives
player:Say("I need to deliver the " .. mission.item .. " to the " .. mission.crate .. ".")
player:Say("The " .. mission.item .. " is in my inventory.")
end
-- Function to check if the mission is complete
function checkMissionComplete()
-- Get the player
local player = getPlayer()
-- Get the mission data
local mission = player:getModData().mission
-- Check if the player has delivered the item to the crate
if not mission.complete and player:getInventory():contains(mission.item) and player:getTile():getObjects():contains(mission.crate) then
-- Remove the item from the player's inventory
player:getInventory():RemoveOneOf(mission.item)
-- Add the new items to the crate
local crate = player:getTile():getObjectList():get(mission.crate)
crate:AddItem("Object VVV")
crate:AddItem("Object MMM")
-- Set the mission as complete
mission.complete = true
-- Display a message to the player
player:Say("Mission complete! The " .. mission.item .. " has been delivered to the " .. mission.crate .. ".")
end
end
yeah, for real. there's a couple references to the Java API in the docs, but I can't tell if anyone is actually patching Java for their mods.
This should not work then, should it?
Because it would seem too much to me that an AI could generate a mission in project zomboid.
Can I access a java class's fields from lua?
it's total bullshit
well not total... but it's nowhere near a complete releasable mod
pretty sure no, unless there's a getter or some kind of variable binding.
sometimes you can grab fields with reflection but it's really annoying and ugly
and for some reason a couple select fields throughout the entire game just work
now that i think about it it might be because they're static fields
do you have an example of a directly accessed field on the lua side?
ScriptManager.instance
GameTime.instance to a lesser extent - for some reason that gives you a cursed instance that doesn't work properly, which doesn't make any sense, but it sure is a thing that happens
Yo Albion can you help me
mmm. LuaManager.setExposed
@bronze yoke
missing commas after Time: entries
In a few days a quest creation system will be released, I'm looking forward to see it and see how it works. The problem in PZ is the late game, even if you set it to maximum difficulty and with very little loot, in the long run you have nothing to do.
Who’s that directed at? Me or someone else?
u
you
Does getThumpTimer() work at all? When I use it, I just get 0
there seems to be a pretty general method of getting Java fields on the Lua side (getClassFieldVal): https://theindiestone.com/forums/index.php?/topic/22480-anticipating-zombies-edited-zombie-behavior-now-in-lua/&do=findComment&comment=260478
Hello. This mod edits the lunge behavior of zombies, which is the part where most of them stretch out their arms and run towards you. Instead of heading directly towards the player, zombies now try to predict a player's future position to intercept them instead of constantly lagging behind them. ...
yeah, that's the reflection stuff i was talking about
gotcha. it does look like static fields might get exposed by default, but I can't confirm. nothing in the kahlua docs, anyways.
yeah, i couldn't really see anything in the java explicitly exposing them
you made them separate files now, right? you have to name them differently
Tried that, still not working
from the name KR, i would just differentiate them with KR_items.txt and KR_recipes.txt or something
try putting them back in your main file and see if it works again. and if it works, show me what both files look like when u separated them
my guess would be that you're missing the module Base{ or } in your new file, if you just cut it out and paste it to a new file
i just said or
you put them back together yet?
if it worked like that before then just put it back like that until you understand how it works
send the file again
I think it's because the last couple recipes have lowercase keys instead of PascalCase
like it should be Result, rather than result
recipe assemble machete
{
sharpenedmacheteblade,machetehandle,keep Hammer,
result:Machete,
sound:Hammering,
SkillRequired:maintenance=6,
Time:400.0,
Category:General,
}
recipe make Whetstone
{
Stone,Stone,keep Hammer,
result:Whetstone,
sound:Hammering,
SkillRequired:maintenance=2,
Time:400.0,
Category:General,
}
recipe make knife handle
{
Plank,keep Saw,
result:knifehandle,
sound:Sawing,
SkillRequired:maintenance=2,
Category:General,
}
recipe make machete handle
{
Plank,keep Saw,
result:machetehandle,
sound:Sawing,
SkillRequired:maintenance=4,
Category:General,
}
these ones are doing result instead of Result
same for sound too
and as far as i know its case sensitive
you suddenly started changing the case capitalization in everything
that'll be $5
it was the capitalization, yes?
are u editing these in windows notepad?
we all start somewhere
you should get a proper code editing and reading application if ur gonna be doing this
also now that it works, i recommend putting them in separate .txt files now that you how it should look
it's better for organization to separate the items from the recipes
I’m def gonna do that, looking through all that shit was a nightmare
also, tabbing will help you look through your stuff
What’s tabbing
idk if notepad lets u do it, but you should be able to just press tab
in a code reader it does it automatically or you can press tab or even highlight and press tab
Any good code readers you reccomend?
i use visual studio code but others recommend notepad++
as long as u have something
sublime text is a pretty alternative to notepad++
I’ve been using visual code editor
oh so it should be automatically doing that for you
I didn’t see it do anything
theres a vscode extension that does highlighting and autocomplete for pz scripts you could download to make your life easier
AUTO COMPLETE????
yeah, but from my experience its not perfect some of the options are missing
vscode already autocompletes stuff but the addon might help autocomplete stuff specifically in the zomboid format
Oh i see
Also
I want to 3d gorund models but I don’t know how
Where could I go to get help
Thx
how can i generate explosion or splash damage on successful zombie hit?
Will do, thanks much.,
guys, i have a question about ArrayList
let's say I want to find a match that matches the result of index 1 in
mylist = {key1:hello, key2:bye}
just like dictionary in python
can this be possible?
or do I have to make 2 separate lists?
I got it working. Here it is. https://steamcommunity.com/sharedfiles/filedetails/?id=2956903883
i do know I can get index number by using For iterate
myArrayList = {"apple", "banana", "orange", "grape"}
function getIndex(myArrayList, item)
for i, v in ipairs(myArrayList) do
if v == "orange" then
return i
end
end
end
this gives the index number which is an integer
but can it be used as something similar to dictionary in python?
what i want to do is:
have a "python dictionary like" {item: file directory address}
for loop that matches index "item"
return its file directory address
not sure if i made myself clear...
i guess i can make 2 separate arraylists and get index number from list 1, and call index from list 2 after..? which seem redundant
how can i quickly set the players stress level through the console?
i think there's a method for it
but stress might b bound with another trait as well
in admin panel
yep
🙂
since ur using a vape mod i also assume you need getStressFromCigarettes
yea i think that's a good idea
that happens when you make a mod that becomes p popular
what is the bug they say?
that vaping adds stress instead of relieving it
but
before vape
true = vape
after vape
they probably have smoker trait and expected it to remove cig stress
i need to look into this smoker trait
i legit don't even know how vanilla functions
i just made the vapes and cigs without looking int o it
wait
is smoker trait a mod?
even with smoker it reduces stress
Can i see a sample script
if you do
local playerStats= getPlayer():getStats()
stuff
playerstats.setStressFromCigarettes(playerstats.setStressFromCigarettes - .5)```
or something like this, it should decrease their stress from lack of smoking
I might be able to pin point why that happens
unless you want just a snippet
okay one sec ill type it up
the smoker trait probably also adds a "time since last smoked" thing or something
oh i was right
lua/server/recipecode.lua
from the looks of it, if you just use setStressFromCigarettes, it will handle the time since as well
----- OnEat_Cigarettes IS NOT RECIPE CODE. IT IS CALLED BY IsoGameCharacter.Eat() -----
-- smoking cigarettes gives more bonus to a smoker
function OnEat_Cigarettes(food, character, percent)
local script = food:getScriptItem()
percent = percent * (food:getStressChange() * 100) / script:getStressChange()
local bodyDamage = character:getBodyDamage()
local stats = character:getStats()
if character:HasTrait("Smoker") then
bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10 * percent);
if bodyDamage:getUnhappynessLevel() < 0 then
bodyDamage:setUnhappynessLevel(0);
end
stats:setStress(stats:getStress() - 10 * percent);
if stats:getStress() < 0 then
stats:setStress(0);
end
local reduceSFC = stats:getMaxStressFromCigarettes()
stats:setStressFromCigarettes(stats:getStressFromCigarettes() - reduceSFC * percent);
character:setTimeSinceLastSmoke(stats:getStressFromCigarettes() / stats:getMaxStressFromCigarettes());
else
-- bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() + 5);
-- if bodyDamage:getUnhappynessLevel() > 100 then
-- bodyDamage:setUnhappynessLevel(100);
-- end
bodyDamage:setFoodSicknessLevel(bodyDamage:getFoodSicknessLevel() + 14 * percent);
if bodyDamage:getFoodSicknessLevel() > 100 then
bodyDamage:setFoodSicknessLevel(100);
end
end
end
{
DisplayCategory = Junk,
Count = 20,
HungerChange = 0,
Weight = 0.005,
RequireInHandOrInventory = Matches/Lighter,
Type = Food,
DisplayName = Cigarettes,
StressChange = -5,
Icon = IckySticks,
CustomContextMenu = Smoke,
CantBeFrozen = TRUE,
OnEat = OnEat_Cigarettes,
StaticModel = Cigarette,
EatType = Cigarettes,
WorldStaticModel = CigarettePack_Ground,
CustomEatSound = ,
}
item GnomeBarRB
{
DisplayCategory = Vape,
Weight = 0.05,
CantBeConsolided = TRUE,
UseWhileEquipped = FALSE,
Type = Drainable,
DisplayName = GnomeBar (Rainbow Blast),
Icon = rainbowblast,
StaticModel = GnomeBarRB,
WorldStaticModel = GnomeBarRB_ground,
ReplaceOnDeplete = GBEmpty,
Tags = HasMetal,
AttachmentType = Walkie,
}```
function hitVape:perform() --
local isNotBurned = true;
local grabbedName = self.item:getDisplayName();
if string.find(grabbedName, "Empty") then isNotBurned = false; end
if (isNotBurned) then
-- !! If the vape is a normal vape with charge
-- !! Add happiness bonus when hitting a vape
self.character:getBodyDamage():setUnhappynessLevel(self.character:getBodyDamage():getUnhappynessLevel() - 3);
-- !! Add stress bonus when hitting a vape
self.character:getStats():setStress(self.character:getStats():getStress() - 0.05);
-- !! Make sure stress & unhappiness do not go below 0
if self.character:getBodyDamage():getUnhappynessLevel() < 0 then self.character:getBodyDamage():setUnhappynessLevel(0); end
if self.character:getStats():getStress() < 0 then self.character:getStats():setStress(0); end
-- !! if the vape is an empty burned vape
elseif not isNotBurned then
-- " *cough* *cough* "
self.character:Say(getText("UI_vape_cough0"));
-- !! Add unhappiness bonus when hitting an empty vape
self.character:getBodyDamage():setUnhappynessLevel(self.character:getBodyDamage():getUnhappynessLevel() + 5);
-- !! Add stress bonus when hitting an empty vape
self.character:getStats():setStress(self.character:getStats():getStress() + 0.02);
-- !! Make sure stress & unhappiness do not rise above 100%
if self.character:getBodyDamage():getUnhappynessLevel() > 100 then
self.character:getBodyDamage():setUnhappynessLevel(100);
end
if self.character:getStats():getStress() > 1 then
self.character:getStats():setStress(1);
end```
item definition
performance for normal vape
performance for empty vape
maybe the person is smoking an empty vape and thinks the feature is a bug
When did you call the function
this is in the perform section of the timed action
i would just add the setStressFromCigarettes thing right below setStress
try something like this
Wait wait your item is triggering your onperform?
I think im about to learn something new
Here i thought i would be helping you
How the what the what
i think they just did a custom context option instead of a recipe onEat
Ok so the co text menu trigger the time action
Then ok ok simple solution on the onperfomr trigger the cig function by copy pasting it turning it into local function
And replace or declare the
Food
Character
Percent
params
testing this rn
then ill try your method glytch3r
how can i set a sound emitter to be a tile relative to the player
She wants to add the cig function
Vanilla
local function vapeNicotineEffect(character, percent)
local configureME = -5
percent = percent * (configureME * 100) / configureME
local bodyDamage = character:getBodyDamage()
local stats = character:getStats()
if character:HasTrait("Smoker") then
bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10 * percent);
if bodyDamage:getUnhappynessLevel() < 0 then
bodyDamage:setUnhappynessLevel(0);
end
stats:setStress(stats:getStress() - 10 * percent);
if stats:getStress() < 0 then
stats:setStress(0);
end
local reduceSFC = stats:getMaxStressFromCigarettes()
stats:setStressFromCigarettes(stats:getStressFromCigarettes() - reduceSFC * percent);
character:setTimeSinceLastSmoke(stats:getStressFromCigarettes() / stats:getMaxStressFromCigarettes());
--[[ else
bodyDamage:setFoodSicknessLevel(bodyDamage:getFoodSicknessLevel() + 14 * percent);
if bodyDamage:getFoodSicknessLevel() > 100 then
bodyDamage:setFoodSicknessLevel(100);
end --]]
end
end
function hitVape:perform()
vapeNicotineEffect(self.character, -5)
--TODO add the rest of your code
end
or you can just remove the else
cuz vape isnt cig right
got distracted making another program lol
going to add that function now, ty glytch3r I really appreciate it!

the issue wasn't even on my end
the user removed the smoker trait mid game with debug menu and it messed with their settings somehow
lol
still adding this for smoker trait functionality tho
should I add the ability to gain the smoker trait?
from smoking a vape
like a 1/100 chance or something?
can you use translations in you script item definition files
like just the .txt files
like instead of
DisplayName = GnomeBar (Empty),
is there a way to do
DisplayName = IGUI_item_vapeEmpty
i would say no, unless you were to actually track their vaping habits over time
try taking a look at ItemName_EN in Translate folder
lol
np
what format is your sound file saved as?
oh god im getting so caught up on the sound stuff
i cant figure any of it out
AYY
okay it is now a 3d sound
any idea how to change the volume of specific sounds in the game?
particularly fridge humming and other electronics
context:getOptionFromName("Favorite")
do y'all think this will work if the game is a different language
Maybe try with getText()?
does anyone know where this file location actually is?
is it only server sided?
.
..\Steam\steamapps\common\ProjectZomboid\media\sound\banks\Desktop
try somewhere around here
someone mentioned it as a weird place that another sound ended up
i think i ended up getting the mod to work with the smoker trait finally
ended up making the whole script a lot better
how it be with coding
i'll try it, but im p sure it is nowhere in the media folder
thanks
i might be able to use it to simulate a world power outage without changing elecshutmodifier
and if so, i'd also be able to do the same thing with my power on function
i did it! I totallyfixed the bug and made the mod function with the smoker trait
also while scrolling through my mods i noticed greenfire has addictions and withdrawals so i might provide functionality with that
one thing after another
guys
im having a problem
could someone help me with this?
function: create -- file: Wuro_client_UI.lua line # 100 | MOD: Wuro Core -[DEBUG]
function: OpenmagZ_OnCreate -- file: Wuro_client_UI.lua line # 158 | MOD: Wuro Core -[DEBUG]
Callframe at: PerformMakeItem
function: perform -- file: ISCraftAction.lua line # 58 | Vanilla
function: perform -- file: Skill Recovery Journal Write.lua line # 7 | MOD: Wuro Core -[DEBUG]
LOG : General , 1680526197922>
LOG : General , 1680526326301> creating new sourcewindow: B:/SteamLibrary/steamapps/common/ProjectZomboid/media/lua/client/DebugUIs/ISFastTeleportMove.lua
LOG : Lua , 1680526327139> Loading: C:/Users/sungc/Zomboid/mods/Wuro Core [DEBUG]/media/lua/client/Wuro_client_UI.lua
LOG : Lua , 1680526327640> Loading: C:/Users/sungc/Zomboid/mods/Wuro Core [DEBUG]/media/lua/client/Wuro_client_UI.lua
LOG : General , 1680526330875> SexyZpage
LOG : General , 1680526330876> -------------------------------------------------------------
attempted index: javaObject of non-table: null
LOG : General , 1680526330876> -----------------------------------------
STACK TRACE
-----------------------------------------
function: addChild -- file: ISUIElement.lua line # 1081 | Vanilla
function: create -- file: Wuro_client_UI.lua line # 100 | MOD: Wuro Core -[DEBUG]
function: OpenmagZ_OnCreate -- file: Wuro_client_UI.lua line # 158 | MOD: Wuro Core -[DEBUG]
Callframe at: PerformMakeItem
function: perform -- file: ISCraftAction.lua line # 58 | Vanilla
function: perform -- file: Skill Recovery Journal Write.lua line # 7 | MOD: Wuro Core -[DEBUG]
ERROR: General , 1680526330877> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: javaObject of non-table: null at KahluaThread.tableget line:1689.
function MyUI:create()
local btnWid = 175
local btnHgt = FONT_HGT_SMALL + 2 * 4
local padBottom = 10
print(name)
if name == SexyZpage then
self.image = ISImage:new(self:getWidth()*0.001, self:getHeight()*0.001, 0, 0, getTexture("media/ui/mag/pic1.png"));
end
-- self.image.scaledWidth = self:getWidth()
--self.image.scaledHeight = self:getHeight()
self:addChild(self.image);
self.cancel = ISButton:new(self:getWidth() - btnWid + 55 , self:getHeight() - padBottom - btnHgt, btnWid*0.5, btnHgt, "cancel", self, MyUI.onOptionMouseDown);
self.cancel.internal = "cancel";
self.cancel:initialise();
self.cancel:instantiate();
self.cancel.borderColor = self.buttonBorderColor;
self:addChild(self.cancel);
end```
i think something is wrong after print(name)
can't figure out what it is..
new problem
function MyUI:create()
local btnWid = 175
local btnHgt = FONT_HGT_SMALL + 2 * 4
local padBottom = 10
print(name)
for i, v in pairs(list_tres) do
if v == name then
return i
end
print(i.."chking")
end
print(i)```
why can't i call return index value of "i" to print(i) ??
i checked with print that it went into for loop then successfully found v == name
oh i see
does any one knows how to manual edit non pvp zone
like the file itself
Mod is almost done and ready for release
i tried this before and found that there is no simple method like that
when I set the non pvp zone ingmae . my game crashes
{
mag_page/mag_page2/mag_page3/mag_page4/mag_page5/mag_page6/mag_page7/mag_page8/mag_page9/mag_page10/mag_page11/mag_page12/mag_page13/mag_page14/
mag_page15/mag_page16/mag_page17/mag_page18/mag_page19/mag_page20,
Result: mag_page,
RemoveResultItem: False,
NeedToBeLearn:False,
Sound:PutItemInBag,
Time:3.0,
OnCreate:OpenmagZ_OnCreate,
Category:WURO_recipe,
}```
local chk = result
local name = chk:getName()
print(chk)
local myUI = MyUI:new()
myUI:create();
myUI:addToUIManager();
end```
guys i have a problem
when i do DO SMTH recipe perferm
it only produce result item mag_page
thus result is always mag_page
but i have a list
function MyUI:create()
local btnWid = 175
local btnHgt = FONT_HGT_SMALL + 2 * 4
local padBottom = 10
print(name)
for i, v in pairs(list_tres) do
if v == tostring(name) then
print(i)
self.image = ISImage:new(self:getWidth()*0.001, self:getHeight()*0.001, 0, 0, getTexture(tostring(list_dos[i])));
--self.image.scaledWidth = self:getWidth()
--self.image.scaledHeight = self:getHeight()
self:addChild(self.image);
self.cancel = ISButton:new(self:getWidth() - btnWid + 55 , self:getHeight() - padBottom - btnHgt, btnWid*0.5, btnHgt, "cancel", self, MyUI.onOptionMouseDown);
self.cancel.internal = "cancel";
self.cancel:initialise();
self.cancel:instantiate();
self.cancel.borderColor = self.buttonBorderColor;
self:addChild(self.cancel);
else
return
end
end```
that gets different texture depending on the diff. names of result item
is there any way to solve this problem?
Good morning.
mornign jab
hi, is its possible to we make a mod that player can make an ice cube or ice cream from scratch? so basically i just thinking about lets say if "ice cream mixtures" freezing then replace it with ice cream. Thx
function MyUI:create()
local btnWid = 175
local btnHgt = FONT_HGT_SMALL + 2 * 4
local padBottom = 10
print(name.."here")
for i, v in pairs(list_tres) do
if v == tostring(name) then
print(i)
self.image = ISImage:new(self:getWidth()*0.001, self:getHeight()*0.001, 0, 0, getTexture(tostring(list_dos[i])));
--self.image.scaledWidth = self:getWidth()
--self.image.scaledHeight = self:getHeight()
self:addChild(self.image);
self.cancel = ISButton:new(self:getWidth() - btnWid + 55 , self:getHeight() - padBottom - btnHgt, btnWid*0.5, btnHgt, "cancel", self, MyUI.onOptionMouseDown);
self.cancel.internal = "cancel";
self.cancel:initialise();
self.cancel:instantiate();
self.cancel.borderColor = self.buttonBorderColor;
self:addChild(self.cancel);
else
return
end
end```
could someone help me where i did this wrong?
"SexyZpage",
"SexyZpage2",
"SexyZpage3",
"SexyZpage4",
"SexyZpage5",
"SexyZpage6",
"SexyZpage7",
"SexyZpage8",
"SexyZpage9",
"SexyZpage10",
"SexyZpage11",
"SexyZpage12",
"SexyZpage13",
"SexyZpage14",
"SexyZpage15",
"SexyZpage16",
"SexyZpage17",
"SexyZpage18",
"SexyZpage19",
"SexyZpage20",
}```
i have list here
and it only work with the 1st item
it's not working from 2nd value to 20th..
name = SexyZpage works well
but when name = SexyZpage2 or above, its not working..i can't figure out why
It's cause you're actively comparing v to the name
The name is the first one I assume
Also - why are you firing through the list anyway?
What is list_dos?
checking scopes could be a good idea too
Yeah, I'm on my phone so it's hard to tell what's going on
list_dos has lists of addresses where the file is saved in
so i get the name of the item
and compare it from the list
then get its index number
and use that index number to call the directory address of the file
was local at first but now it's global
function OpenmagZ_OnCreate(items, result, player)
print(result)
chk = result
name = chk:getName()
print(name)
myUI = MyUI:new()
myUI:create();
myUI:addToUIManager();
end```
so how should i change it??
so change to ipairs?
oki
with first item it shows index well which is 1
then when i do 2nd item
index is not passing
i didn't really understand fully what he meant 😦 sadly
could you explain this further?
@sour island di you know the location of the custom non pvp files
maybe I'm wrong but why not use result:getType() and name the textures accordingly? This seems like a long topic and I haven't read everything. Also reading from mobile.
what does getType return?
seems like it will just do the same thing wouldn't it?
getType() is calling the item variable
getName() calls item display name
it returns the name of the item as its named in its .txt file
yea just checked
local list_tres = {
"SexyZpage",
"SexyZpage2",
"SexyZpage3",
"SexyZpage4",
"SexyZpage5",
"SexyZpage6",
"SexyZpage7",
"SexyZpage8",
"SexyZpage9",
"SexyZpage10",
"SexyZpage11",
"SexyZpage12",
"SexyZpage13",
"SexyZpage14",
"SexyZpage15",
"SexyZpage16",
"SexyZpage17",
"SexyZpage18",
"SexyZpage19",
"SexyZpage20",
}```
so ill change that to item name
thus, it would probably do the same i think
you could do key, value pairs, tedious but easy to call
Is it still there that you return if the name doesn't match?
is that what i did though??? i guess it's written differently?
for i, v in pairs(list_tres) do
i thought i is the index or key
and v is value or item
No you made a table i mean a dictionary so you could just say list_tres[itemtype]
yea i wanted to do the dictionary
at first
but i asked here whether if it's same as python
and no one really gave me a clear answer Xd....
i guess it works in lua too
Lua only has tables no dictionary but you can kinda simulate dictionary by having a table with key, value pairs inside of them
Nvm didn't see the replies
yea the name is result:getName()
could you give me an example of how it is used??
i guess if or iteration doesn't work, ill have to do tons of if and elseif
You can iterate but it's not needed for this
ah?
You could just name the texture the same as what ever string you expect
If pic1 is the name, yes
I also see list_tres, but not list_dos
Could you be referring to another list accidentally?
local list_uno = {
"WURO_items.mag_page",
"WURO_items.mag_page2",
"WURO_items.mag_page3",
"WURO_items.mag_page4",
"WURO_items.mag_page5",
"WURO_items.mag_page6",
"WURO_items.mag_page7",
"WURO_items.mag_page8",
"WURO_items.mag_page9",
"WURO_items.mag_page10",
"WURO_items.mag_page11",
"WURO_items.mag_page12",
"WURO_items.mag_page13",
"WURO_items.mag_page14",
"WURO_items.mag_page15",
"WURO_items.mag_page16",
"WURO_items.mag_page17",
"WURO_items.mag_page18",
"WURO_items.mag_page19",
"WURO_items.mag_page20",
}
local list_dos = {
"media/ui/mag/pic1.png",
"media/ui/mag/pic2.png",
"media/ui/mag/pic3.png",
"media/ui/mag/pic4.png",
"media/ui/mag/pic5.png",
"media/ui/mag/pic6.png",
"media/ui/mag/pic7.png",
"media/ui/mag/pic8.png",
"media/ui/mag/pic9.png",
"media/ui/mag/pic10.png",
"media/ui/mag/pic11.png",
"media/ui/mag/pic12.png",
"media/ui/mag/pic13.png",
"media/ui/mag/pic14.png",
"media/ui/mag/pic15.png",
"media/ui/mag/pic16.png",
"media/ui/mag/pic17.png",
"media/ui/mag/pic18.png",
"media/ui/mag/pic19.png",
"media/ui/mag/pic20.png",
}
local list_tres = {
"SexyZpage",
"SexyZpage2",
"SexyZpage3",
"SexyZpage4",
"SexyZpage5",
"SexyZpage6",
"SexyZpage7",
"SexyZpage8",
"SexyZpage9",
"SexyZpage10",
"SexyZpage11",
"SexyZpage12",
"SexyZpage13",
"SexyZpage14",
"SexyZpage15",
"SexyZpage16",
"SexyZpage17",
"SexyZpage18",
"SexyZpage19",
"SexyZpage20",
}
these are lists i made
Ah, I see you're relying on the keys to match
yea
for i, v in pairs(list_tres) do
if v == tostring(name) then
print(i)
self.image = ISImage:new(self:getWidth()*0.001, self:getHeight()*0.001, 0, 0, getTexture(tostring(list_dos[i])));```
so i compare name from list tres and get its index
then use that index to call string out from list_dos
and set that to texture
and when i tested it, 1st item which is "sexyZpage" works perfectly
but when sexyZpage2 shows up, its index isn't passing
so texture is getting nil
And the name gets printed?
yes
LOG : General , 1680541066542> mag_page
LOG : General , 1680541066542> mag_pagehere
LOG : General , 1680541066543> 1
LOG : General , 1680541069908> zombie.inventory.types.Literature@50c3f3b8
LOG : General , 1680541069908> mag_page2
LOG : General , 1680541069909> mag_page2here```
so here is the result of 2 items
if i create the first item
it gets its index "1"
when i do 2nd
name of item passes (here i used getType() temporarly)
but index isn't showing
Print V
To confirm
Ooh
I can't tell cause of the formatting
But if that else then return is inside the for loop
It's going to cancel the for loop the first failure it runs into
That should be why you're getting locked at 2
Also though -- this could be a lot cleaner if you use a key/value pair
Not defining the keys makes them 1,2,3,etc by default
how could i fix this?? i guess i completely messed up for loop
ah fixed it
thank you all
for help
how do I overwrite a recipe again?
Override: true ?
For those curious or confused - just remove it 😅
Also I do recommend not for looping if possible
You can use Lua tables like an associative array
haha agreed
trying to find a better way to execute this other than using OnCreate
maybe i should look up custom context menu..
just updated gnomebars with two new flavors
works with vanilla smoker trait now too
its not hard to do
you can look at my mod for an example
its an entirely custom tooltip
custom tooltip with a custom timed action
local x,y = player:getX(), player:getY()
local closePlayers = {}
for playerIndex = 0, getNumActivePlayers() -1 do
local p = getSpecificPlayer(playerIndex)
local distance = IsoUtils.DistanceTo2D(x, y, p:getX(), p:getY())
if distance < 20 then
table.insert(closePlayers, playerIndex)
end
end
print("CLOSE PLAYERS COUNT: "..#closePlayers)
Im trying to find the close players but it prints 1 all the time (it only finds me). What am I doing wrong?
yes
Good, i know i would make the mistake of trying that in sp
hey! I just read the patch notes. I would like to put my input here for the battery situation.
I guess the easiest way to put it, was the idea to make these reachable vapes or one time use?
They look like rechargeable to me so I would vote for the battery implementation.
But just adding the battery to the current durability seems like it would be annoying. I would make the overall durability proportional if you add the function to change the battery.. 3 times or whatever
does this make sense?
irl you can recharge them with a usb c charger forever
they just run out of juice so eventually its just burned cotton and no flavor
oh cool thanks ill do that
yw
it has custom backgrounds
colors
variable height
etc
should have most stuff you will need
and its well commented
nice nice
yea but for the sake of 1940s we gotta dumb the rechargeable a little and the only "rechargeable" in the game are batteries
from the ones I used to sell, one full pod lasted a lot longer than one full charge
i would treat the charges as the batteries and the full pod as the item durability
I am sorry if i am making it more complicated lol
hmm
no that makes sense
ill deal with that later
i'm making a new mod rn
i'm excited for it lol
as expected, go get it lol.lmk if you more questions in dmg or here. i think it could work
I changed my code to this and its working now 🚀
local players = getOnlinePlayers()
local x,y = player:getX(), player:getY()
local closePlayers = {}
for playerIndex = 0, players:size() -1 do
local p = players:get(playerIndex)
local distance = IsoUtils.DistanceTo2D(x, y, p:getX(), p:getY())
if distance < 20 then
table.insert(closePlayers, playerIndex)
end
end
print("CLOSE PLAYERS COUNT: "..#closePlayers)
Is the decompiled java code in github somewhere?
i dont know but you can just decompile it online
i don't think that'd be legal 😅
Hello, I am making a wallet, as a container the option to wear does not appear and I could not put it on, can help me?
It is, it's the exact same code as in the .class files in a slightly different representation. I was just hoping for something on github because I like their search tools but I can decompile locally
Something I'm not clear about is the demarcation between the java/lua code - it seems there's some blurry boundaries there.
the game's class files are not public and making the game's source available is a breach of the tos

🥳
i can't seem to get recipe sounds to work
i have a .ogg file in media\sounds but it doesn't find it
i looked at vanilla and they are stored in sounds_player.txt on line
{
category = Player,
clip
{
event = Character/Survival/Cooking/OpenCannedFood,
}
}```
i can't find Character/Survival/Cooking/OpenCannedFood anywhere
does anyone have any ideas
{
StuartLittle,
keep [Recipe.GetItemTypes.SharpKnife]/[Recipe.GetItemTypes.Saw]/Axe/HandAxe/AxeStone/WoodAxe/MeatCleaver,
Result:StuartLittleSliced=4,
OnCreate:Recipe.OnCreate.SliceStuartLittle,
Time:20,
Category:Cooking,
OnGiveXP:Recipe.OnGiveXP.Cooking3,
AllowRottenItem:true,
Sound:ratscream,
}```


Idk about you but those sounds don't look like they're inside the folder?
they are
They aren't indented
vscode doesn't indent based on language mode
since .ogg has no language
it is not indented
Okay
Did you define the sound effect In code?
besides Sound:ratscream, in the recipe code no
Like that open canned food
As for why you can't find it yourself, it's likely packed in the resource files
You need to define a sound pointing at your audio clip and use that in any action
At least I think so... Never.made a sound. I only fix vanilla bugs
usually it creates it for you if it isn't already created
but looking at how that works might be helpful
yeah like my vape mod just makes it for me
ecig.ogg in media\sounds and it just works
oh
its just sound
not sounds
the folder
lol
Anyone able to give me a basic run down on how to add cars?
If there is a tutorial online you can point me that way too. I have blender and all that
Hey y'all, is there a way to give an item like a "description"?
Also, anybody know how to add in medical items? As the attributes in Items.txt doesn't specify any medicinal effects, I assume it's in some LUA file, but can't find it
anything that's not in the item scripts is probably hardcoded java stuff
the medical system is very basic and not really designed to be moddable
fuck
Repost in the right channel >.>
Changing the color of blood?
So I have been trying to figure out just how the game controls blood color, I tried changing the blood texture and overlay, but no matter what I change it to, its always got a tint of red to it, and oddly if I try to turn the blood white it turns teal in game on the character model and weapon but it turns pink on the ground ?
if I turn it black it turns black.
Is the color of blood hardcoded in the .class files? or am I missing something.
When I craft a food item that has x days fresh and x days to rot it's creating the item with nan on Age(days) is that normal?
{
DisplayName = Unfermented Corn Slurry,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Pot_Water,
DaysFresh = 1,
DaysTotallyRotten = 1,
CantBeFrozen = TRUE,
ReplaceOnUse = Pot,
ReplaceOnDeplete = Pot,
ReplaceOnRotten = MoonshineMash,
HungerChange = -5,
ThirstChange = +5,
Unhappiness = +50
Calories = 33,
Carbohydrates = 10.74,
Lipids = 1.53,
Proteins = 3.68,
StaticModel = CookingPot,
WorldStaticModel = CookingPotPasta_Ground,
Tooltip = Tooltip_item_FermentTime,
Tags = HasMetal,
}```
do I have a conflicting field?
does this happen when you spawn the item in?
no
Spawned in ^
When it's crafted it doesn't have the (Fresh) designation either
likely related to nan, but yea
i remember seeing that some vanilla recipes set the age in their oncreate, so maybe that is normal

result:setAge(items:get(0):getAge());
end```
albion do you know if ReplaceonRotten is working?
i've never used it
Be wary of deprecated properties that are throughout the script files in PZ.
I don't know if that one is or not.
I'm marking the ones I spot as deprecated in my extension..
ReplaceonRotten is still being used in vanilla so I assumed it was working
{
DisplayName = Ice Cream,
...
Packaged = TRUE,
ReplaceOnRotten = IcecreamMelted,
DaysFresh = 1,
DaysTotallyRotten = 1,
...
WorldStaticModel = IceCream,
Tags = GoodFrozen,
}```
has anyone ever thought about how pz would be the perfect medium to remaster fallout 1/2?
is there a command i can do to change the volume of an individual sound in the game?
try adding your mod id on ReplaceOnRotten
so it'll be like ReplaceOnRotten = ID.Item,
sometimes nan prints when the number is really small, it'd be weird if it actually was nill
id = emitter:playSound(...)
emitter:setVoulume(id,num)
im looking for a way that i can use to change the volume of certain ambient noises
Hello.
Am torn between working on several projects and now even playing the game again.
the advanced volume enabler mod lets me change the volume of individual sounds but i dont see where the actual sounds are handled in vanilla
it's interesting cuz my added sound is also in it
most options go to the core
I wish I had complete and total control of PZ's sound engine without modding the core.
I did some insane shit when I did mod the core though.
(I hooked up the audio engine with a modified shader library that allowed me to modify the screen in realtime using PCM data)
(I wrote the shader library and part of this audio mod)
=)
you don't need to add "+" on positive values, so maybe try removing that, and change your "Unhappiness = +50" to "UnhappyChange = 50,"
maybe that'll work
Wait what? Haven't seen that before.
could i edit the scripts to have higher volume and radius?
oh, that's good to know, I'll fix that. Albion was right though, you still have to manually set the age to 0 for recipes results
That's for Item scripts
I want a mod to exist where it requires a maturity warning for being absolutely batshit insane with psychological stuff.
=(
so if i reuploaded the scripts in my own mod it will use those instead of the vanilla ones?
i wanna make p much all electronic ambiance louder with more range
Going to document food properties tonight..
okay i know how to check if a square is outdoors or indoors now
now i need to find out how to check for the nearest indoor square
wait I thinkk I'm at the wrong channel
when you start a dedicated server where does the server saves
how do i create a for loop for getSquare around the player?
function ISExtinguishCursor:getClosestSquare(squares)
local closest = nil
local closestDist = 1000000
for _,square2 in ipairs(squares) do
local dist = IsoUtils.DistanceTo(self.character:getX(), self.character:getY(), square2:getX() + 0.5, square2:getY() + 0.5)
if dist < closestDist then
closest = square2
closestDist = dist
end
end
return closest
end
is this close to what i need to do to get the nearest indoor square?
sun sensitive zombies also has something for getting nearest building that is very similar to this, i just dont know how to apply it to the sound manager to play my sound from the square
understand the basic of looping
for "for loop" the parameter are initialization, condition,incrementation
is there like a wait() function
or something to just eat up time
during my timed action i want there to be a chance where you "lose" the item for a few seconds and you're supposed to be looking for it, then the timed action starts
i imagine i can do this somehow in waitToStart() i'm just not sure how
you can use ZombRand maybe to have a chance to do a timed action before going to the main action
if ZombRand(1,5) <= 1 then
add animation
IT WORKS
now when the player is outside, the power starting up sound effect will only play from an indoor square if they are close enough to one
and if they arent near any buildings, they wont hear anything
thanks for the advice! i decided to actually look up a little bit about it to understand what i was doing
and also thanks to glytch3r, who gave me an example i can build off of
would it be possible to have wall clocks act as a watch for players in the same room as said wall clock
ie. display time if the player doesnt already have a watch
Would this work in MP so others can hear the sound too : player:getEmitter():playSound("RandomSoundName");
It plays properly in my SP test.
Why not if not square:isOutside() then ?
Yes
The sound will come off the player though even if he moves
Thanks! I can work with it. Just wanted to know if its heard by others too.
because the sound effect i used is specifically for indoors, and it has a nice effect when heard from outside
still, i need to make a sound you can hear when not around any buildings but still on the power grid
Nono i meant the syntax as in „if not square:isOutside() then“
Can someone check vanilla code for me?
Do cars have a function to drop items out of their trunk when low durability AT ALL?
So far in my testing that simply DOES NOT happen
no
Where did that myth came from then?
The game itself, its a tooltip
Its an unimplemented feature?
IM AN IDIOT 💀
took a screenshot with the lights off so it barely made a difference from the blackout
oh well
If it is not doing that it was either removed or is currently broken, because that was a thing basically since they added vehicles to the game

There is code for it
-- having a damaged trunk or no trunk at all will make item go on floor
function Vehicles.Update.TrunkDoor(vehicle, part, elapsedMinutes)
local speedNeeded = 20;
local steeringModifier = 5;
-- opened trunk like pickup require more speed/steering
-- if not part:getItemType() then
-- speedNeeded = 60;
-- steeringModifier = 2.5;
-- end
if vehicle:isEngineRunning() and part:getItemContainer() and vehicle:getCurrentSpeedKmHour() > speedNeeded and not part:getItemContainer():getItems():isEmpty() then
-- if u don't have a trunk door or is in poor condition
if not part:getInventoryItem() or part:getInventoryItem():getCondition() < 60 then
-- the more you turn hard, the more chance you'll have to drop item
local chanceToDropItem = math.abs(vehicle:getCurrentSteering()) * steeringModifier;
-- the more damaged your trunk is, the more chance you'll have to drop item
if part:getInventoryItem() then
chanceToDropItem = chanceToDropItem + ((100 - part:getInventoryItem():getCondition()) / 100)
else -- no trunk
chanceToDropItem = chanceToDropItem + 1;
end
-- drop item!
if ZombRandFloat(0, 100) < chanceToDropItem then
local item = part:getItemContainer():getItems():get(ZombRand(0, part:getItemContainer():getItems():size()-1));
vehicle:getSquare():AddWorldInventoryItem(item, 0,0,0);
part:getItemContainer():Remove(item);
end
end
end
end
chances are pretty low. not sure how often the update function is called
Ah, I see the problem
Are you telling me you read this over and founda bug?
No, no; I see the problem with my testing
No, I wasn't driving "recklessly"
Items need the vehicle to match at least two conditions
Speed above 60mph
Turning
it's speed above 20
I wasn't turning (although I did a couple times at the ends of the highway, to turn around) for the chances to happen
I can't say I've ever had it happen to me
I can already see stuff happening once
vehicle:getCurrentSpeedKmHour() > speedNeeded but speed is mph?
Say it still works so the check passes, the part of the function elapsedMinutes happens locally since the vehicle is started or the player gets inside the vehicle, but it never accounts for it?
It doesn't matter, for all it cares is speed and steering input
Supposedly the state% the lid is, the chances for it to not happen (which makes sense), if no lid then its chance+1, which would return 2?
What I'm getting is, either the check doesn't ever happen, or it only happens once and fails to go through
It should not get there, because trunks always have their item installed, and if they didn't you wouldn't be able to have items inside them anyway
The very first if checks if it is a container, but as far as I know it only really counts as a container if the item is installed anyway
I think I remember that trunks used to be removeable
Also this is for the trunk door
But analyzing it, yes. For no trunk door, you have 2% per update...
More when steering
Speaking of advertising... Is there a channel one can post links to their mods?
any idea about xgamingserver ?
People usually just send them here + maybe in #pz_b42_chat. As long as you don't spam or send a word wall I don't think anyone will mind
Not sure what you're asking
Hello!
There's no event for when the player wakes up, right?
Couldn't find one here https://pzwiki.net/wiki/Modding:Lua_Events
does not seem like it
though if sleep is a timed action, you may be able to hook into it anyway
oh hey
ISSleepDialog
Hello how can i make books faster not instant but like a minute
Hi, I need to increase a particular zombie health only when it is created/spawn. Is there a event that i can call to do that? OnZombieUpdate maybe? When this events is called?
every frame for every loaded zombie
So not that one. Is there any other?
You can use that one
You can create a boolean in their modData to prevent repeated calls
But the modData doesn't save -- so there's that
Not sure if there's a hard cap to zombie hp but I have made a zombie have more hp
So the modData only persist while the zombie its visible or loaded?
For zombies, yes
Ok thanks... i think I can work with that
are you sure it's reset when zombie is moved?
I'm not sure what happens if the zombie is unloaded within the games session -- it may be buffered
But it is not persistent in loading from saves
This is only true for zombies btw
And only if the zombie is not flagged as a former player
Create the moddata if it doesn't exist. Set health while true, make it false after. If it disappear and found it later it will be full health again
It will be fine... trying to create some unique zombies for server event.
It will not dissappear until its dead
Gonna try this way... thanks
You'll need a way to determine which zombie it applies to -- I use a specific outfit for my AI
