#mod_development
1 messages Β· Page 178 of 1
I've been messing around with UI tooltip code, trying to show different values than the base item. I based my changes on expanded tooltips and i finally just got it working
or, uh, kind of working hahaha. that's supposed to be under the grapefruit
Does anyone know how to do this more simply?
how do y'all publish mods
idk how i'm messing up, but putting the mod in the workshop folder with the template just
doesn't work at all
it never reads it, it only ever recognizes the existence of the template
is it in this directory:
C:\Users\your_username\Zomboid\Workshop
and then the file structure is kinda wacky.
C:\Users\username\Zomboid\Workshop\modname\Contents\mods\modname\media\modded_stuff_here
it should probably function as is
it ran as a local mod
i just have to get it published
copy the structure of the ModTemplate in that folder
it should already be good to go
it's a simple mod
i was just changing a repair recipe
left everything else untouched
if you got the mod off the workshop it won't have the file structure for uploading
oh
it's like how it is above, right?
C:\Users\username\Zomboid\Workshop\modname\Contents\mods\modname\media\modded_stuff_here
what itsmars posted like that?
yes
gonna test once more to make sure it works
the aa-12 is gonna be useable lmao
none of that fuckin repair an aa-12 with an aa-12
repair that shit with tool kits
do you have permission to be reuploading this mod?
with the organized trait, will that effect be applied to a custom backpack I make? Or does the custom backpack need to be added to a table somewhere
or does the organized trait just apply its effect to any item in the bag category
I've never really worked with traits so i'm not sure which files I would do best to look at for references
can anyone point me in the right direction or know the answer?
I think the trait multiplies the capacity for every single container
yeah it just makes containers bigger
I edited a backpack mod and it increases the capacity in accordance
it would be much harder for it to be hardcoded per container than not
the check is made for the player not the container π
this is what I figured but I didn't want to make any assumptions
thank y'all for the help, I appreciate it
I tried looking for an answer to this but couldn't find anything conclusive. I have generated over 100 new items to serve as drainable versions of vanilla items. This list is done and I can easily just drop the drainableItems.txt into the mod and call it a day. However I'm trying to plan ahead for mod compatibility and I think it would be better if I could dynamically create these items. They will always be near copies of existing items, they'll just be drainable with a useDelta and a different tag. Is it possible to create brand new items OnGameBoot or does the item have to already exist in a txt file? I was experimenting with DoParam but that requires an item to already exist.
You would need to have dummy items? Otherwise you will get warnings and errors? from item dictionary.
Also my seatbelt is already be buckled to be told this is a terrible TERRIBLE idea
yeah the world dictionary is going to screw you over there
would it be possible to copy the existing item (since a copy is all I need anyway) and rename the copy, then DoParam? The original would be my "dummy".
it'd still cause issues with the world dictionary
i'll be honest that i'm not really sure what the world dictionary does (i think it's probably a save optimisation?) but i do know that it screams at you if an item isn't in it
I'm assuming among other things, at least one problem is that world dictionary is expecting 10 items and would freak out if somehow it found 11.
it's actually one of the few ways to get the game to outright refuse to load
it's a shame, procedural items would be really useful
@fast galleon my mod is currently HEAVILY based off your buckets mod. I'm currently looking at what appears to be an unused function from your ScriptEdits module. https://github.com/Poltergeistzx/Project-Zomboid/blob/16ba008461d2c064978351178df2813aff14f797/Workshop/BucketsMultipurpose/Contents/mods/BucketMultipurpose/media/lua/shared/MIC_ScriptEdits.lua#L69
function Edits.addItem(itemName, itemProperty, propertyValue)
if not Edits.Items[itemName] then Edits.Items[itemName] = {} end
Edits.Items[itemName][itemProperty] = propertyValue
end```
Were you also trying to do this? Or was this/is this for something else that I haven't noticed?
I thought some people might find this useful, it's very similar to what Item Tweaker had.
It would be used to populate the table I use to change things.
oh I'm a dumbass... I wrote my own to do exactly that. π
π Thank you both! Gonna turn in. Good night!
I think I blacked out the board on this
Have other local copies of mod and things you change don't apply.
if i had a nickle lmao
I'm having hella trouble setting ownership for these moving items
'no documentation on this method at all' you guys have documentation on any methods??
Can someone help me figure this out. It was moving stuff before, but then I wanted to add claiming a doggo so they wouldn't just move towards any moving player.
ive never seen so many nested if statements
.> Whatever
Does lua have switch like statements
It was working fine till I added that you need to be an owner of the dog -- which was like, I Was gonna use mod data but it just wasn't working no matter what I did
so now I have this dumb work around where I'm like storying the item id in a table and it's all very confusing
tables can be used like switch statements but not really no
anyone know of a lua event that fires when sandboxoptions are updated?
never done it, but ive seen other mods use lines such as...
local objectInfo = xxxxxxxxx.GetObjectInfo(self.isoObject);
local modData = self.isoObject:getModData()
self.isoObject:transmitModData()
if data can be stored in an object itself, that seems like a good place to put the owner ? maybe ?
edit: unless those also use data tables / setmetatable
lmao
i thought i found it
local function setOwnership(playerObj, item)
-- Check if the item is valid
if not item then
print("Error: Item is nil")
return
end
local item_mod_data = item:getModData()
item_mod_data.ownerID = getPlayer():getDisplayName()
item:transmitModData()
-- Set the ownership of the item
print("Dog ownership set to Player: " .. item_mod_data.ownerID)
end
This look good?
moddata is a table that is attached to the object, and is saved/loaded along with that object
is it this? https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How to use global modData.md or i'm assuming theres a local version
global moddata is mostly like regular moddata but not attached to a specific object
it also has some extra utilities to do with networking it but they're mostly the same thing
Hello everyone,
I'm currently working on a game project and I'm experiencing an issue with the muzzle flash of my weapon. It seems to be misaligned with the gun barrel, and I'm not sure how to fix it.
Could someone please guide me on how to move the muzzle flash in the game file so that it aligns correctly with the barrel? I would greatly appreciate any assistance or advice you can provide.
Thank you in advance!
it looks like a modeling topic. you'll have more help in modeling channel.
Is there a way to show the grid (tile grid) ingame ?
is there a way to add a new vehicle skin to the existing ones? I would not like to overwrite the entire files. UPD: found solution
Iβm trying to make some time based loot respawn mechanics - does anyone know how it works with cells/chunks that havenβt loaded yet? Is it possible to update the contents of them or is it worth only adjusting them ones the player enters that 300x300 cell?
I wanted to take a moment to thank you for your offer of assistance. However, I have already found a solution to my problem. I also wanted to express my gratitude for everything you have done for the Project Zomboid modding community. Your contributions are truly appreciated. By the way, I have a quick question for you. Do you know if it's possible to modify the size of a weapon in game? Or would I need to go through Blender for that?
you can change the reach distance of a melee weapon from the lua code. Blender (or equivalent) is used for changing the visual size. afayk there is no code to change visual size, but I cannot ensure it. Thanx for your kind words.
Spawn function of TchernoLib mod does something close to that
Ok cool, Iβll take a look. Thanks!
this is amazing work - how long did it take you to write this? I think what i'm looking for is probably within "Spawn.spawnOnLoadGridsquare(square)", so i'll use that for inspiration. Gonna take me a while to work it all out though. It wish it was simpler to spawn objects based on conditions in this game.
can i make a pistol bolt acction/
I have made a custom profession that I can select when I create a new game but after dying and creating a new character it's not there anymore, do i have to do the initialization of the custom profession after some Event again?
the lua file is in the shared/NPCs/ folder, i've tried these:
Events.OnNewGame.Add(applyProfessions); Events.OnGameBoot.Add(applyProfessions); Events.OnGameStart.Add(applyProfessions); Events.OnCharacterDeath.Add(applyProfessions);
I think i'll just replace the BaseGameCharacterDetails.DoProfessions function..
please make a hook, no full overwrite
yea
Hey I'm looking for help in developing a mod for zomboid and was wondering if anyone would be interested in helping as we would be commissioning outfits for you to make for the mod
Hey guys, I've a custom item added in but I keep getting this error in the console:
LOG : General , 1688742568071> 10,398,843,741> InventoryItem.loadItem() item == null, skipped bytes. itemtype: PPZRP.AlternateExclaim4```
I don't understand why it can't create the item when the item is both in the viewer list and can exist in the world? Is it something else entirely?
Hello! I am wondering if there is any way you can add references to the java api while coding with lua?
Wait I think I figured it out nevermind.
this library gives java api intellisense
Thanks! Would this be prefered over PipeWrench where you write with typescript?
Or say going with this solution:
https://github.com/Konijima/PZ-Libraries
Hi all. I'm curious on the difficulty of creating a mod partly based on an already in-game item.
Basically, a rain catcher mod that incorporates a tarp, metal bars (or wood logs), and rope.
Similar to the one in Rust.
this could break a game right
it would be tile related
now its stuck on** UI_Loading_Texturepack **
this is the shit i get
check out this mod https://steamcommunity.com/sharedfiles/filedetails/?id=2852690210
this is an older project, the main reason we made umbrella was because this one was so crappy
that just depends if you want to write in typescript or lua
this is cute hahahaha
Amazing
It would be hillarious if it occasionally barked using the same "talking" system the player does when you press Q. With the overhead text.
"Bark.mp3"
"Woof.ogg"
Is there a way to profile mod loading time?
How does this differ from Konijima's solution? It seems Umbrella are just the pre-exported typings / docs / stubs?
If you already have a workflow set up to export these, is there any actual benefit?
the stubs only include classes and methods that are exposed, the parameters are named, it actually considers whether methods are actually instance methods or static (instead of assuming always instance)
the events module doesn't even have a capsid equivalent
As for profiling, the game leaves a lot to be desired
the lua module still leaves a bit to desired (it's just harder to generate good stubs for a non-typed language) but it includes fields now
and for people who don't already have the workflow set up, they don't need to go through that annoying process, which notoriously just doesn't work for about half of the people who try it
So, what are the specific benefits for people who don't mind the current workflow? Instance vs static assumptions?
I guess if you have a file in shared with a name starting with '!!!!' it should be the first to load :D. store a getTimestampMs(), then compare the result with another getTimestampMs() in a client file with 'zzzzzz' as prefix, it should be a good approx of the lua loading time
Smart
instance vs static, named parameters, and that it won't show you stuff you can't use
Is there an event for mod init & init done?
Nope
All mods load whenever and its chaos
Alphabetics seems to be the best control over order
I have mods that require other files of other mods so anyway it is not one after each other.
Best option to profile a single mod's load time would be averaging without vs with
Hm
And there's absolutely no hook when mods start their individual loading, and when mods finish their individual loading?
Or at least either?
there is no mod individual loading. that's not a thing
if you enforce a load order in your mod, then when your first file starts and when your last file finishes
No mod / package discovery before it starts loading a specific mod folder?
The lua scripts are all gathered up, then load in alphabetical order, only breaking order as needed by require
Well, is there lua file individual start/finish stuff?
You can ask the game if a mod ID is enabled for the save
Anyone know anything about bare feet? Is that an item? Trying to assign stomp power to bare feet
i think you'd have to make a secret item if you can't set that on the character directly
Like the hands
Thanks for the information, looked nice tho with being able to read the decompiled code
you should still decompile, but there's better tools to do it
Pure guessing, but its probably just a state in the java when you stomp and it sees you're not wearing shoes
this would be appear to be the code for shoeless stomping lmao
any damage is halved
that's a channel error π
im so confused
PSA: Always be sure to turn on God Mode when you fly to paint buildings, and/or mark the spot on your map where you do things. 
It's absolutely hilarious like some user will come under your mods and be like "hey is it possible to disable 99% of the mod, and make it do something completely different"
lmao what
can i do contains in lua and relatedly, if i find a trait in TraitFactory:getTraits() can i get its name somehow?
TraitFactory:getTraits() returns a java list of Trait objects.
They have 2 methods for getting their names:
getType()
getLabel()
Label would be the pretty readable name, and type is the actual name of the trait used in code.
oh snap maybe this is doable then
what are you trying to do
This is the docs site I used:
https://zomboid-javadoc.com/41.78/
Pretty quick to find whats available on the java side. Not everything here is exposed to lua, but it usually just works.
Javadoc Project Zomboid Modding API package index
Hey guys, anyone got any experience with generating custom log files? I've got most of the logic sorted for what I wanna stuff in there but I'm struggling to find an appropriate global provided by the api to pass through my desired file name and path, any help would be greatly appreciated π
i'd prefer tis's site
They have a site with this?
trying to make a mod to let users define a list of traits in sandbox vars to disable, and a list of traits that are given to all players
Ah, I see. The site I'm using maintains prior versions.
I didn't realize it was thrid party
the most significant difference is named parameters but there's also a tiny bit of documentation, and i think it's a bit more specific about types sometimes
the one you're using was used because tis's was outdated, but now it isn't really
@crystal oar should be possible yeah
local list = SandboxVars.Doctrine.DisabledPerks
if list then
for item in string.gmatch(list, "[^;]+") do
item = item:match("^%s*(.-)%s*$") -- Trim leading and trailing spaces
print("looking for ", item)
local traits = TraitFactory.getTraits()
for trait in traits do
if CheckForTrait(trait, item) then
print("Disabling ", item)
else
print("Trait not found! ", item)
end
end
end
end
end
function CheckForTrait(trait, item)
if trait.getLabel() == item then
print("Disabling ", item)
trait:setRemoveInMP(true)
return true
end
return false
end
Events.OnInitGlobalModData.Add(DoctrineModDataLoaded)``` i'm sure my first draft will have some problems but i think it's getting there
Question for y'all. How would I make a ghost item that gets equipped for shoes like barehands does for hands?
is there a shorter or smarter way to write player:getTraits():add(trait.getType())?
can't you just do TraitFactory.getTrait(item) instead of this whole loop?
item would be Axe Man and the trait is Axeman
so i think i have to loop through trait:getLabel()
@crystal oar
local function addTraitToPlayer(player, trait) player:getTraits():add(trait.getType()) end ?
can i have a function return a string or false and work right?
or should it be string or nil?
okay so this isnt working out for me function CheckForTrait(traits, item) for trait in traits do if trait.getLabel() == item then return trait.getType() end end return false end says java.lang.RuntimeException: tried to call a non-function
It can't find the method
for trait in traits? there's no iterator here
traits is an array, does that not work?
no, you need to do```lua
for i = 0, arrayList:size()-1 do
local item = arrayList:get(i)
end
weird, i have this that works for item in string.gmatch(list, "[^;]+") do
string.gmatch is an iterator
also soimeone here said to start at i=1, do you know if i start at 0 or 1?
0 if it's an arraylist/other java object, 1 if it's a lua table
and that's why there's the size-1 up top?
yeah
okay so like function CheckForTrait(traits, item) for i=0, traits:size()-1 do local trait = traits(i) if trait.getLabel() == item then return trait.getType() end end return false end
the calls for the trait methods should be with colons but yeah
the use of dots and colons trips me up a lot
it's generally just colon if it's an instance method, dot if it's a static method
i honestly don't understand the difference yet, like just looking at something i have no idea if it's a static
for i=0, traits:size()-1 do
local trait = traits(i)
if trait:getLabel() == item then
return trait:getType()
end
end
return false
end``` is still not doing it, but now it is throwing a different error something like "did not have __call metatable set at KahluaUtil.fail line:82."
oh, traits(i) should be traits:get(i)
i think it's full on working now, time to test it some more. thanks as usual albion!
i may have overthought something with two traits i added to my mod, vegetarian and carnivore. evolved recipes. theres vegetarian burritos and meat burritos .-.
hey guys, is there any way to make a function play after taking a pill i added in my mod?
Argh. Why is the amount a propane tank refills a propane torch hardcoded to the vanilla torch's UseDelta
result:setUsedDelta(previousBT:getUsedDelta() + result:getUseDelta() * 30);
while result:getUsedDelta() < 1 and propaneTank:getUsedDelta() > 0 do
result:setUsedDelta(result:getUsedDelta() + result:getUseDelta() * 10);
propaneTank:Use();
end
I also have no clue why that first line is there
far as I know previousBT (destroy BlowTorch) has been nuked by RemoveItem by the time this even gets called
but the important bit:
result:setUsedDelta(result:getUsedDelta() + result:getUseDelta() * 10);
unconfigurable hardcoded number! woo!
with the default torch usedelta of 0.1, 1/16 of the propane tank refills the torch entirely
but with a mod that changes it to 0.01, so that it has 100 uses instead of 10
it only refills 10%
(for some reason this leads to it taking 8/16 of the propane tank to refill the torch once? which is weird, I thought it would take 10/16)
I really have to wonder why a custom OnCreate is used for this at all
ah, I see
it's to keep the amount in the old blowtorch.
but you could still handle actually using the propane tank in the recipe code?
recipe Refill Blowtorch New
{
destroy BlowTorch,
PropaneTank=1,
Result:BlowTorch,
Time:50.0,
Category:Welding,
OnTest:Recipe.OnTest.RefillBlowTorch,
}
guess I'll test to see if this works
OnTest:Recipe.OnTest.RefillBlowTorch, see i don't get when to use colons or periods still lol i would have thought this was all colons
OnTest is the name of the variable you're setting
Recipe.OnTest.RefillBlowTorch is the value you're setting it to
time to test
gl!
if this does fix it i don't know what to do honestly lol
i reported a radio bug + the fix two years ago
no dev comment in that entire time, confirmed it still happens + is worse than i thought
this is because of the blowtorch buff
buff? didn't they lower it from 100 to 10 lol
yeah but they also lowered all the costs
ah
before then you would use a varying amount of the propane tank based on how empty the blowtorch was, but now one unit always refills
well, not quite
one unit always refills 10x the UseDelta
which is fine by default because it's 0.1
well yes, but if it's only caused by a mod it's not a bug
it's unnecessarily complicated for what it does, and it's an unconfigurable hardcoded magic number in the middle of the code
it's effectively doing UseDelta * 1/UseDelta so it should just be adding 1
and then it'll always refill it, no problem. or they could at least make the amount refilled configurable
honestly this is just a minor annoyance since it means the capacity-changing mod still buffs it from 160 uses in vanilla to 200 with the mod
the main thing bothering me is the radio issue...
I get that for multiplayer, people who use text chat are a very small minority, those who use text chat over radio are an even smaller minority, and the main focus is on people using VOIP-over-radio or /all
what was the issue?
Formatting such as [col=255,255,255] or 255,255,255 doesn't work over radios, either in overhead messages or in the chat log. The cause of this is twofold. For the chat log, this appears to be because SayChat.getMessageTextWithPrefix calls ChatUtility.parseStringForChatLog, while RadioChat does...
need to get a screenshot of it, but this is an issue in vanilla
an example is equipped radios receiving broadcasts with [img=music] in them
or [col=r,g,b]
both of which are used in the various radio programs
i guess it's just not a high priority issue
yeah, like i said
.
at least radio text chat still works
you can't really say the same for radio voice chat
really? I thought it was fixed a while back
though
an easy way to let modders fix this at least would be
expose ChatUtility
all we get chat-wise is
this.setExposed(ChatMessage.class);
this.setExposed(ChatBase.class);
this.setExposed(ServerChatMessage.class);
frankly I feel like exposing ChatUtility and then just calling parseStringForChatLog from ISChat's addLineInChat would be better
then use message.chat:getMessagePrefix(message) .. message.getSanitizedText instead of dealing with getMessageTextWithPrefix overrides
since an unacceptable amount of sanitization is also done in getMessageTextWithPrefix
from what i hear, the chat log is one of the oldest and least maintained systems in the game
it might even be one of the systems that was adapted from a mod...? that might have been an unrelated mod though
i (briefly) helped maintain buffy's roleplay chat and had a mod that implements some of those features in a much, much cleaner way so i'm unfortunately aware of the chat log's issues
i had to write a library mod in order for commands to work
wiat
did they just... forget to lower vehicle wreck scrapping costs? because i really doubt it required 100 fuel before, and it takes one full propane torch now, which is basically untenable
i thought wreck recycling was a mod, but
wreck recycling is vanilla, vehicle recycling is a mod
that might have been intentional...? i recall at first they didn't reduce wreck costs and recycling them was literally impossible
so they must have chosen these numbers
I have a mod to release, and I need to know something
How can I add a translation to a mod?
How does that work?
folder structure would be
media\lua\shared\Translate
and you put one folder per language
and you refer to strings as variables, in your code. i guess. never done it before π
you replace any hard-coded strings with getText() calls that reference the translation strings in those folders
That is the part I know about, actually
What?
e.g. if you have a string displayed to the player e.g. 'Hello World!', you'd want to replace that with something like getText("IGUI_HelloWorld"), and then in your translation files you'd have a IGUI_HelloWorld = "Hello World!", entry
I see, so I just place every String into a getText() function?
every one that's displayed to the player at least, internal stuff should be kept as it is
as for stuff in scripts like items, you don't need to do anything special, they're already set up for it and just need entries added to the right translation files
ah, sorry, my mods are very lua heavy so that's where my mind goes first
So, I guess the getText() isn't really necessary then?
not for scripts
you'd need an ItemName_EN.txt with pairs like ItemName_Base.AlarmClock = "Alarm Clock",
it'd probably just be easiest to look at the vanilla translation files to see what the patterns are and which file they should be in
Side question, can I have 2 Items with the same DisplayName?
Obviously, different item ID
DisplayName is only used when there isn't a translation anyway
having two items with the same display name or translated name should be absolutely fine though
one thing to note is i think the way item stacking works is that it's based on the display/translated name, so two different items with the same one will stack in the inventory
Interesting
Anyone knows how to open and edit the model of a PZ Item?
And how to upload the model to the Workshop for the users to preview it as well
Is it possible to set a sprite's properties permanently instead of session only?
anyone ever make an RC car mod? I wanna blow up a pack of zombies like kevin bacon in tremors 2
If I wanted to add more skin textures to the player model, how would I go about doing it? Specifically, so they can pick it from the creation menu
go to this directory to see the folder structure and files.
\steamapps\common\ProjectZomboid\media\textures\Body\
see, theres MaleBody01 to MaleBody05, five different skin shades. and MaleBody01a - MaleBody05a, for chest hair variants.
edit those in photoshop (or whatever), and save your new copies in...
C:\Users\username_here\Zomboid\Workshop\yourmodname\Contents\mods\yourmodname\media\textures\Body\
check the ModTemplate for more info about required files, fouind here
C:\Users\username_here\Zomboid\Workshop\ModTemplate
I know how to overwrite skin textures, I want to keep the OG skin textures while adding more onto it. Through Variants
if that was possible, i feel like a mod would have done it by now, on the workshop. never seen it before. but i guess i havent really looked forit.
Is there any explanation as to how exactly the speed of a weapon works?
Between MinimumSwingTime , SwingTime and BaseSpeed
I'm just confused...
it's also tied to the animation itself so 
Ahg, I'll just try to give it similar numbers to the weapon of another mod that's kinda similar
Ah yeah, the Base speed of a heavier weapon is lower, but the other ones are higher
I really don't feel like gutting out that much code LMAO, I'll figure out something else
i was
oh- okay gotcha
@drifting ore i would suggest you start with looking at some code from the Improved Hair Menu mod, as it actually changes the character creation interface & menu UI.
https://steamcommunity.com/sharedfiles/filedetails/?id=2732662310
using that as a reference, you could go back and look at similar base PZ files. I think 'skin color' might be an enum? Maybe you can add to it, and offer more choices?
That may actually work, I'll add that to the list of mods I'm examining-
out of curiosity, i looked as well.
\steamapps\common\ProjectZomboid\media\lua\client\OptionScreens\CharacterCreationMain.lua
this lua doc has promising code inside, such as...
table.insert(buttons, charCreationMain.skinColorButton)
self.skinColor = desc:getHumanVisual():getSkinTextureIndex() + 1
self.colorPickerSkin:setPickedFunc(CharacterCreationMain.onSkinColorPicked)
anyhow, its not an enum like i thought, but an int index, and a table of buttons. i don't see why you wouldn't be able to add new options here.
Question, is there pre-requisites to how the pain stat of a character can be changed?
Im trying getPlayer():getStats():setPain(1) to set the players pain to the maximum, but it does nothing and remains at 0. Adjusting other stats such as fatigue does set it to the specified value though??
it's most likely recalculated every tick based on the character's injuries, pain pills etc
some stats are like that
Yippie
Is there a way to cause neck pain (I think it's 'injury' is just called HeavyPain) and similar to other body parts then without just injuring the player?
oh, alternatively it might be that pain is 0-100 instead of 0-1
Ill try that real quick
i've been developing a stats api to get around issues like this but i haven't even gotten around to looking at pain yet so i don't have specific knowledge about it
Seems this is the case, the slider doesn't even move in the General Debugger
i'd look into adding HeavyPain then
alternatively i see BodyDamage has a setContinualPainIncrease(float ContinualPainIncrease)
can it be applied without specifying the bodypart?
that might just be a multiplier to normal pain increases or something or it might be a way to add extra pain
Got it, BodyDamage.BodyPart has setAdditionalPain(float) which causes HeavyPain by the look of it
Moodle is also increased
Knowing some of the quirks with Zomboid modding, I'm shocked
does this work?
player:getBodyDamage():getBodyPart(BodyPartType.FromString("Left Hand")):setAdditionalPain(100)
BodyPartType.Hand_L is a correct way to reference the bodyparttype
i'm not really sure what FromString wants, so that might be right?
Ive never used BodyPartType.FromString before, but assuming it returns the same as BodyPartType.Hand_L, it should yes
i would've guessed it would want "Hand_L" but that would make it redundant with valueOf
(and in lua, it's redundant with BodyPartType[str]/BodyPartType.str, which will probably perform a lot better than using a method)
It would appear to cause a runtime error, p:getBodyDamage():getBodyPart(BodyPartType.FromString("Left Hand")) is null and crashes when you try running setAdditionalPain(100)
p:getBodyDamage():getBodyPart(BodyPartType.FromString("Hand_L")) does work though
i guess it's just redundant with valueOf then
Im bad at typing :/
you should still just reference them with BodyPartType.Hand_L, java method calls are slow and i think it's just cleaner
if you're using a variable for whatever reason you can use BodyPartType[str]
^ i also avoid string comparisons in C#, theres always another way lol
how would you guys handle evolved recipes that involve certain tagged items? like i have a vegetarian trait, a burrito can have bacon in it or something. how could i check if the burrito contains bacon or not?
soo im working on a mod that spawns "stories" or "notes" written by victims/surviors supposedly during or at the beginning of the apocalypse. I've made it so that when it randomly picks a story from the list of prewritten ones, it'll pick them depending on the room the item was found. I.e. if a story makes sense to have been written in a bedroom, this story will spawn only in a bedroom. I use the following list for the rooms to define stories in:
https://theindiestone.com/forums/index.php?%2Ftopic%2F38185-new-room-definitions-4165%2F
My question is, are there more "specific" ways to get what kind of spawn the item is spawning in, for example, checking if its spawning on a zombie (how do I even make it spawn on a zombie?), or for example making it check/making it spawn in a car crash, etc. Situations that aren't necessarily bound by a room name
Listed below are all of the current new room definitions, which should be used for internal room names in buildingEd. Under each roomdef is a list of the containers that definition has rules for. Any container you place that does not have an entry in the roomdef you have used will instead pull it...
if you can seperate the stories into different groups, you can put them into different distributions
can you emphasize on that? This is the way I set up my stories:
so basically a JSON seprating each story and defining what kind of rooms the story may spawn it, and the script just picks one randomly (and does its checks of the rooms element against the actual room the item spawned in)
you can check if it's on a zombie by just checking if the item's container's parent is a zombie
in your zomboids lua/server/Items/ProceduralDistributions and SuburbsDistribution (might be more). theres a guide somewhere where you can insert items into the tables inside the distributions. theres a couple different lines to do so from what i gathered, depending on the distribution. when you put your story on an item, you can put that item in the distro and its chances of spawning in a given container
in your mod, your additional distributions will most likely live in the lua/server/yourModDistrobutions.lua
this is all assuming these stories are in book items.
you can then set up your stories as like, a list or something of stories that could happen in a house, then add those stories to the respective house distribution
I kinda set up a base for the distrubitions already for testing/dev stage,
require 'Items/ProceduralDistributions'
table.insert(ProceduralDistributions["list"]["BinGeneric"].items, "TatteredPaper");
table.insert(ProceduralDistributions["list"]["BinGeneric"].items, 100);```
I guess I just need to alter it later to add the actual containers names
any idea what's the way of making it spawn on a zombie?
it's one of the distributions
i can't really check right now but it's something like proceduraldistributions.all.malegeneric
that's definitely not exactly right but it's along those lines
okii I will do a quick search for anything similar to that
Thanks for assitance guys :)
i found what i think it is in Items/Distributions, around line 426
oh, are you relying on onfillcontainer to set the data by chance?
it doesn't work on zombies, i have a work around for that but it's pretty complex
in your case i might consider just rolling to spawn and set the data on onzombiedead instead
ermm I am.
-- Function that sets the saved room name in an item's mod data
function ImmersiveLore.OnFillContainer(roomName, containerType, itemContainer)
for i = 0, itemContainer:getItems():size() - 1 do
local item = itemContainer:getItems():get(i)
if item:getType() == "TatteredPaper" then
item:getModData().ImmersiveLore_savedRoom = roomName
print(containerType)
end
end
end```
but shouldn't be an issue really, right? because I can just, before getting the savedRoom, I can check for parent container first
or check for both
Found it, thanks!
if you want it to work on zombies, they never fire that event
Can I get retrieve room name from OnZombieDead?
probably, you can get the room object from the zombie's square and i'm sure you can get the name from there
hmm oki will try to work with that. Thanks for the heads up (otherwise I'd have probably spent hours trying to figure it out lol)
So I'm not sure if I'm having a fundamental misunderstanding of how loot generation works in conjuection with distribution tables... I was under the impression that the number of "rolls" a category has is finite, regardless of the length of the list, and the number of rolls a container has is modified by the sandbox loot settings?
So if I added twice as menu new items to a distribution table, it shouldn't be spawning more items in general, right?
no
it rolls every single item individually, it's not a weight system or anything
more possible items = more items on average
... Oh, oof.
that's why true music packs spam their cassettes everywhere, they literally cannot make them individually rare enough to compensate for that
Hmm.... which raises an issue with relying on sandbox settings to reduce a category of items, where it might be too general and cause other things to become much rarer as well.
I'm assuming there's no simple way to reduce the spawn chances of everything in a single distribution table, is there?
At least not without risking incompatibilities with a lot of other mods.
btw any idea how to make things spawn on top of tables/counters/beds/etc?
you could just loop through it and multiply every chance
Yeah, which is what I was thinking, but I am worried that will have an impact on other mod's items.
So what is the "rolls" for then? How many times every item has its drop chance rolled?
ey is there a max map size?
Any ideas on how you could possibly add items to loot dist tables then that are more sensibly "weighted" to output a similar number of total items as originally? Or is our only recourse really just get a bit invasive and adjust the vanilla loot weights or use sandbox settings?
for a book mod i had it automatically calculate the total chance for a book in that container and reduce the chances so that the total chance would be the same after the additions
I feel like I'm going to have to take that approach, no real way around it.
What mod was that one?
And would you mind if I took a peek at the code? β€οΈ
Seems quite likely π
Dependency actually makes me realise a good point, if I was going to go modifying vanilla item values like their loot spawn weights, I should probably use Item Tweaker API.
Assuming it has that functionality.
... whiiich it might not, damn.
Is there any way to know what action a Player is about to perform / has performed, if they used the Interaction button to do it?
E.g open or jump through a window with E
Am I crazy or do the Louisville Gym lockers not spawn anything?
Added some items to the GymLockers distribution table but... as far as I can tell, nothing actually uses it? π€£
Opened an unmodded game save and debug checked the Louisville Gym's lockers and the don't seem to have any loot distribution tables added.
you using lootZed?
that api does almost nothing and causes a bunch of startup lag, better to just call doparam
that is one of my older mods and i haven't been able to push the update that removes the dependency yet
that api basically just changes the syntax of a function call
Yeah I was.
Drop-down for the attached loot tables was blank.
Checked on a fresh save and everything.
At first I thought maybe my own mod broke the table somehow.
i checked 2 workout-looking buildings in louisville, the rooms themselves were correctly labeled lockers. then theres another building with blue lockers, but the room is labeled 'changing room'. anyhow, thats strange. did u teleport to some other place outside of louisville and check lockers to see if your distro was working
I gave up searching for another gym after about 15 minutes. π€£ I figure I'll run into one eventually just playing, but I have no idea where another is on the map.
If it's that hard to find and my mod accidentally jackpots a loot cache in it, I figure what the hell and call it a "feature". π
Unlisted mod anyway just for me and mine so it's not a big deal.
im not a mapper so i dont know, but im assuming its more about the name of the room, and less about the container itself. or i guess a combination of the two.
lockers can appear in "hall" rooms (schools), "changing room" rooms (restaraunts, hotels) and "locker" rooms (police stations, fire departments, gyms) as far as i know.
edit: the reason i bring this up, is that i checked 2 gyms in louisville. the rooms themselves are just labeled "locker" -- hmmm.
but it'd be strange if they had police station loot, though.
lol, like i said, not a mapper. strange
Yeah I'm almost certain it's the room definition. Considering how hard it is to find dedicated "gym" buildings, I think that particular definition is just very rarely used.
And most of the time the only one players usually care about are the gym weights shelves.
Vanilla gym lockers, even if they did work, don't spawn anything interesting.
ah......... the gym is indeed labeled gym. but unfortunately, because the lockers are not in the workout portion of the building, they will not have the correct loot table !?!?
Yeap that's the one.
The change room basket outside in the hallway also has no loot tables.
There's a "GymLaundry" table that I'd have assumed goes there.
are those lines /texts rendered by the game?
Pretty sure that's TileZed π
they appear on both https://map.projectzomboid.com/ and https://pzfans.com/vanilla-full-map/ online maps, when you enable "room outlines"
Didn't know about that second one.
ah, because i'm trying to find a way to create a map/visual of where a specific loot items are located
Oooh second one actually has a zombie heat map too.
it has maps and heatmaps for like 160* modded maps, too. very nice
there used to be a 'loot finder tool' on PZ reddit some years ago, but the developer's website went offline.
π¦
https://www.reddit.com/r/projectzomboid/comments/sxyfzs/pzmapcom_interactive_map_and_loot_visualiser/
that would have been great
there it is. yeah, i learned about this right after it went offline, so i never even got to use it. lol
I can see the distributions but not where the cells are defined
Huh; there's another weird one... The Fun XTreme building in LV has the reception area marked "gymstorage" ???
should be somewhere though
C:\Games\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\Distributions.lua:
5553 procedural = true,
5554 procList = {
5555: {name="GymWeights", min=0, max=99, forceForRooms="fitness;gym"},
5556 }
5557 },```
That's where gymweights is being defined at least...
you're trying to find gym locations?
or 'fitness', i wonder where that is π
Well at the moment I'm just trying to find what "locker" is even supposed to point to. π
i have a hunch it's not referenced in the media folder as text
going off of this picture, https://theindiestone.com/forums/index.php?/topic/38165-quick-guide-how-to-mod-the-loot-distribution-system-distributionslua-proceduraldistributionslua/ the locker can drop several different types of things, based on context clues of what room it is in, and what the furniture around it is.
changeroom = {
locker = {
procedural = true,
procList = {
{name="BowlingAlleyLockers", min=0, max=99, forceForRooms="bowlingalley"},
{name="FactoryLockers", min=0, max=99, forceForRooms="batteryfactory;brewery;dogfoodfactory;factory;fryshipping;metalshop;radiofactory;warehouse;wirefactory;whiskeybottling"},
{name="FireDeptLockers", min=0, max=99, forceForRooms="firestorage"},
{name="GymLockers", min=0, max=99, forceForRooms="fitness"},
{name="HospitalLockers", min=0, max=99, forceForRooms="hospitalroom"},
{name="HuntingLockers", min=0, max=99, forceForRooms="hunting"},
{name="PoliceLockers", min=0, max=99, forceForRooms="policestorage"},
{name="PrisonGuardLockers", min=0, max=99, forceForRooms="cells"},
}
},```
There it is~
grep: media/maps/Muldraugh, KY/42_4.lotheader: binary file matches
grep: media/maps/Muldraugh, KY/20_17.lotheader: binary file matches
grep: media/maps/Muldraugh, KY/41_4.lotheader: binary file matches
these have references to clothesstorestorage, so they must be defined in the maps files
same for lockerroom etc
So I'm guessing that room in the gym was miscategorised and should have been "changeroom" not just "locker".
Or it's a hold over from pre 41.5x
SuburbsDistributions.locker = SuburbsDistributions.changeroom
SuburbsDistributions.lockerroom = SuburbsDistributions.changeroom
SuburbsDistributions.lockers = SuburbsDistributions.changeroom
check this gym, it has "lockerroom" instead of "locker"
a'ight I'll fire itup
@nimble yarrow you can search for locations on the map?
not on the online map websites. probably, with the mapping software or debug tools.
Dead there too!
ah
No loot populated.
Hey sorry if I'm interrupting anything but does anyone think I could get some assistance with a very basic/simple mod?
I want to use the base model for the already existing Hoodie asset, but I just want to add decals to the back and have it be a seperate item. Does anyone know how to achieve this? I have no experience modding PZ whatsoever and want to get into it a bit more.
Sure go for it Cauchemar, at this point I'm mostly just on this out of curiosity. π€£
Thanks ^_^
Right now I'm following this guide but I need it to be a bit more specific.
Like, do I need specific names for the files? Etc etc?
have you checked out https://pzwiki.net/wiki/Modding, btw btw
Not yet, would it have the answers I'm looking for?
there are some 'your first mod' tutorials and guides linked there, yeah
As a pointer, I believe the file you'll be looking for that has the hoodies definitions should be media\scripts\clothing\clothing_jacket.txt
Find the right item in there, and that will tell you exactly what model it's using that you'll need to hunt down.
like that reddit post says, though, you will be taking vanilla, base PZ files from
\steamapps\common\ProjectZomboid\media\
and copy+pase+edit then putting them in your
C:\Users\username_here\Zomboid\Workshop\modname_here\Contents\mods\modname_here\media
you already have a 'mod template' folde there, which will show you the required folder structure and stuff
Ohhh okay, that's very useful, thank you guys
ProjectZomboid\media\textures\Clothes\Hoodie has your texture files by the looks
Perfect
Re: GymLockers saga, I'm pretty sure this is just something gone funky for the transition from the old loot distribution system.
are you trying to spawn something but it isnt spawning?
Yeah; added to the GymLockers distributions table expecting new items to appear in the gym lockers/gym changerooms, only to find those lockers don't spawn anything, since it seems like their definition is broken at the moment.
Was just planning on having fitness and strength xp books show up there really.
You'll need to mimick the same folder structure for where those files came from.
Ok so, make a scripts folder and a textures folder?
Exactly the same as the source files.
Gotchya
If it'd be easier to work off an example, if someone else has made a mod that does something similar to yours, you could take a peek at its folder and file structure.
I'll take a look on the workshop
.\Steam\steamapps\workshop\content\108600 will have all your subscribed workshop mods in them when you find it, folder inside there will be the workshop mod's id.
Well that's a pain... the link to "Guide for adding new clothing items with modding for build 41" from the PZwiki modding page is dead.
I did it!
is it possible to import the default animations from Project Zomboid into Blender? If so, what are the steps to achieve this? Are there any specific tools or plugins that I should use?
Grats man! π Enjoy your new hoodie! ^_^
Even managed to generate a new GUID for it?
Yup!
Imagine how big the Google Maps/Earth database is.
Grats @raw solar π
https://steamcommunity.com/sharedfiles/filedetails/?id=3000848183 several sleepless nights of coding and I have a result Iβm proud of on the workshop
Looks awesome, will for sure try it.
ty
good overhaul.
is there mod that adds wood powered cars?
Could someone give me a some kind starter point on making a player do interaction with tile (like when you right click a tile with sink, you can then drink/wash/etc,), I would like to make a player to need to use for example table to be able to use certain recipe (simulating workbench for now). I'm not sure if there are mods that do with just standing next to tile for something like this to work, so i would be happy with context menu when clicking said tile.
so uhm... Somebody had to do it..
https://steamcommunity.com/sharedfiles/filedetails/?id=3001223107
I love you
Singlehandedly fixes one of my worst gripes with vanilla
π
Amazing mod, just a tip if you accept it, I think you should improve its presentation on steam, put more images and stuff, this mod is pretty amazing and deserves a less timid presentation.
currently waiting on my buddy for an improved steam page. Lol
Is this not the correct way to have to skill requirements?
SkillRequired:Carpentry=3:Metalwelding=1,
i think carpentry may be named Woodwork
But do you use : between then skills?
Ahh ty
it's about time! looks great.
thankies
Hey modders, anyone know how dirty clothes interact with body cleanliness?
Do clothes protect the player from dirtiness?
Do dirty clothes dirty the player's body?
i feel like it is totaly random. I have had times where seconds after cleaning my character and his cothes they will get stains on their pants without me even movign
now there's just https://steamcommunity.com/sharedfiles/filedetails/?id=2791656602 :^)
gotcha. stil great. now that you got all the vehicles covered ith some basic armor you can expand upon it with ease if you want. I read the description and i like the uniform design you are going for
thankies
keeps all the cars from looking totally different
ya
yeah i've noticed that too, but I have no basis for that in the code anywhere
would it be possible to prevent certain items from loading when the 'All Clothing Unlocked' option is enabled? I noticed the code is in media/lua/client/OptionScreens/CharacterCreationMain.lua but I'm not sure how I would go about preventing individual pieces of clothing from displaying
Can anyone send me in the right direction for UI creation?
Can you tell me more about your use case?
Guys, is it difficult to mod the game? I would really like to make a really simple mod that adds an action that the player can do and an extra option in the context menu
I have experience in coding, although I have not yet touched what PZ uses
float var11;
if (Math.abs(this.clientControls.steering) > 0.1F) {
var11 = 1.0F - this.speed / this.vehicleObject.getMaxSpeed();
if (var11 < 0.1F) {
var11 = 0.1F;
}
this.VehicleSteering -= (this.clientControls.steering + this.VehicleSteering) * 0.06F * var8 * var11;
} else if ((double)Math.abs(this.VehicleSteering) <= 0.04D) {
this.VehicleSteering = 0.0F;
} else if (this.VehicleSteering > 0.0F) {
this.VehicleSteering -= 0.04F * var8;
this.VehicleSteering = Math.max(this.VehicleSteering, 0.0F);
} else {
this.VehicleSteering += 0.04F * var8;
this.VehicleSteering = Math.min(this.VehicleSteering, 0.0F);
}
those 0.04Fs should probably be this.vehicleObject.getSteeringIncrement() instead
lua is relatively easy especially if you have little to no experience with other programming languages, since it can be a little quirky
this is in, iirc, CarController
getSteeringIncrement is currently unused even though it's defined for vehicles
(0.4 by default)
that's not really unusual for the codebase i'm afraid, particularly vehicles
being able to configure it would let the bike mod make steering less janky, for example
(it steers very slowly for a bike, imo)
maybe in the vehicle overhaul
fingers crossed
from my perspective it isn't a huge change to fix it but with a project as large and sprawling as PZ, well
it's not really a bug from TIS's perspective
it'd be nice but it doesn't even appear on that priority list
Are there any resources on how to create gun mods?
if i grab a recipe with local recipe = getScriptManager():getRecipe(recipeName) can i just be like recipe.obsolete(true) or how do i make it obsolete?
personally i consider unused variables and hardcoded magic numbers to be bugs :P
thanks
this doesn't technically delete it like obsolete does but it should have the same effect of hiding it
obsolete isn't actually a field, it deletes the recipe from all lists as soon as it reads that line, and unfortunately the relevant doparam-equivalent isn't possible to use from lua so you can't invoke that
i wonder if my hacky code to expose additional classes in debug mode still works
from lua? no way
when did you do it? we haven't exactly had a patch in a while
41.65, i think
and i know it's still exposed in debug mode in 41.78
not too useful in production but maybe fun for testing
maybe that's why they aren't exposed normally
i was a little curious about the reasoning behind that
here it is
looks like i gave up on using it for the purpose i made it for, and just like
edited the bytecode to flip that var instead
i believe there are specific helpers for method/field stuff in non-debug mode, yeah
there are but you can't do too much since you can't manipulate the objects
Similar idea
i wonder if we could do some fun metatable stuff with them actually...
I mean, it's still useful to know what a value is in some cases
In the above example snippet it's for weapon script's length
learning about __classmetatables broke my brain
i wrote some really bad code in the name of writing good code down the line...
might not be thinking it through properly yet
Hey Chuck, would you mind if I sent you a DM real quick?
Sure
i suppose you could just add getClassFieldVal s to the existing __index but then the syntax would be () which seems bad
i gotta try this out
Simple solution is for TIS to expose the exposer and let mayhem happen 
does that only hide it from the crafting screen? i seem to still be able to do the recipe
oh, maybe...?
is there a reason you can't just set it obsolete with a script as normal?
i want to define recipes in the sandbox vars to disable them, so it can be a general purpose tool
if not SandboxVars.WaterGoesBad.NeedFilterWater then
getScriptManager():getRecipe('WaterGoesBad.Make Tap Filter'):setNeedToBeLearn(true)
end
```in a mod i just set it to require learning the recipe
this won't work if the recipe you're trying to remove actually can be learned though
hmmm what about addRequiredSkill(obsolete, 11)? or something like that
so there's no way to have the required skill? then i hide it too and it won't show up either in the context menu or in the crafting menu?
seems to have worked, a bit janky of an approach tho
there's potential
i'm going to work on that more tomorrow, that could be crazy useful
Sorry about that I fell asleep, I just need the fundamentals on UI creation as the documentation that does exist doesn't help too much
Thank you man this is awesome
@dark wedge If you think about reversing the climb I might have some code that can help you. I just gave up because it broke and the player would fall after the second reversal.
It also includes jumping off the rope into the direction the player chooses.
Hey all, I'm having real trouble setting up a test mod to print to console.
I only have my mod turned on in PZ, but none of my 'print' commands are coming through at all
It wasn't something I was planning, but it seems to be something that would be useful. I took a crack at it earlier, and the issue I had was it doesn't seem to want to restart the ClimbUp state correctly. So, you just got stuck at the top.
Nice, I feel like I saw this before and probably linked my debug tools? π
If not I got hit by some deja vu
is your mod loading? maybe the mod.info is bad
Could be! Would that create an error in the console.txt?
i don't think so
I've had that too, it was a minor issue since I added the ability to jump off manually.
also didn't always happen.
If I can see this, does that mean it loaded correctly?
Or could it still be failing silently
I swear it worked the first time i tried it, and it changes to the down state no problem. π€· I'd be down to take a look at what you had though. The jumping off might expand the scope a bit, but the switching direction would be a cool addition. Feel free to DM if you want.
π± thank you! I followed the file structure of the example mod, that didn't have /client or /server
It's working, I'm so grateful π π I've spent actual hours making this file again and again from scratch, with the incorrect file structure
Does anyone know where in the code the shadow is applied to the player?
Is it possible to add two IsoObjects to the same tile?
I seem to be getting an error when fetching the second Obj every time.
yeah, the game already has a bunch per square

Why is this happening then
Here's my code to fetch the objects:
local sq = cell:getGridSquare(emptySqX, emptySqY, i)
if sq then
local objs = sq:getObjects()
for n = 0, objs:size() - 1 do
local obj = objs:get(n)
...
end
end
I get an error in line local obj = objs:get(n), specifically in get
If it helps these are IsoObjects I am spawning myself
I get:
java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor334.invoke
Stack trace: java.lang.reflect.InvocationTargetException
If I spawn only one IsoObject on the square it works fine, but the moment I add two, poof, get this error.
its in the Java.
IsoGameCharacter has:
public void renderShadow(float var1, float var2, float var3) {
if (this.doRenderShadow) {
...
From what I can see, your player shadow is always visible, while other players are contextual based on if you can see them or not
so I can't see other players shadows?
Thank you for your help earlier π
now I'm trying to find the square that is underneath the mouse (OnMouseMove), so that eventually I can find the container that the user is hovering over.
Does my z-value for "getSquare()" need to be something other than 0 ?
((get square is not working at all))
You can see other player's shadows if you're looking at them. Their shadow's rendering for you is based on if their character is in your field of view though is all.
I see, thanks for the research and answers.
All good, I think I have to convert the mouse coordinates to world coordinates using ISCoordConversion.ToWorld
For anyone interested, this code appears to work:
function ObjectContextMenu(x, y, xMultiplied, yMultiplied) print("on hover") local hoveredSquare local mX, mY = ISCoordConversion.ToWorld(x, y, 0); mX = math.floor( mX ); mY = math.floor( mY ); -- get the cell local cell = getWorld():getCell(); -- get grid square (tile) hoveredSquare = cell:getGridSquare(mX, mY, 0); if hoveredSquare ~= nil then --print("Found square!") local squareObjects = hoveredSquare:getObjects() --print("Found objects!") for i=0, squareObjects:size()-1 do local currentObj = squareObjects:get(i) --print("Found object!") --print(currentObj:getSprite():getName()) if currentObj:getContainer() then local container = currentObj:getContainer() print("Found container!") end end end end -- Register our event handler function. Events.OnMouseMove.Add(ObjectContextMenu)
For UI design does anyone know how to allow UI toggle?
any up-to-date list of room definitions? The ones I find are missing few definitions
Hello, I want to make a VHS mod, but I don't understand the auto-generated part. Can anyone guide me?
there a way to return the client language of a player?
getCore():getOptionLanguageName()
Any ideas why a simple
if player:HasTrait(*) then
would keep throwing an error?
HasTrait of non-table: null
type error
player is nil
why would it be nil if the statement is run in the middle of a recipe result
i can't tell you that without seeing your code
Thanks so much!
Can you check if a function has already been added to an event, such as exampleFunc in Events.OnTick or something like that?
It seems that you can add a function to the same event several times without issue, and that is an issue for me atm π
I think best you can do is try to remove the old function, it will not prompt any errors if it's not added.
Hmm
I might just have to make my own bool track if the Event was added or not. If I don't, or if there is no way to check myFunc in Events.OnTick, then it'll just be added multiple times, making the code run multiple times which Im trying to avoid
so, weird error
-- Function that gets a random story from the stories.json file based on a saved room name
function ImmersiveLore.getStory(savedRoom)
if getCore():getOptionLanguageName() == "EN" then
print("THE LANGUAGE IS INDEED ENGLISH")
end
local jsontext = ImmersiveLoreUtils.readModFile("ImmersiveLore", "media/lua/client/jsons/EN/stories.json")
--rest of code
end```
When I try that on English language, the print statement is printed, and the rest of the code is executed without any issues or error, however, when I moved the ``local jsontext = ImmersiveLoreUtils.readModFile("ImmersiveLore", "media/lua/client/jsons/EN/stories.json")`` to inside of the if statement, I get the following error:
```ERROR: General , 1688921481887> ExceptionLogger.logException> Exception thrown se.krka.kahlua.vm.KahluaException: nil passed to JSON:decode() at BaseLib.error line:292.
ERROR: General , 1688921481887> DebugLogStream.printException> Stack trace:
se.krka.kahlua.vm.KahluaException: nil passed to JSON:decode()```
During loading you usually check if a class exists. If you do it to loop a table during game time, you can see if the table is empty or if it exists.
not sure what exactly is going wrong there
aa wait actually i think I know
I am defining a local variable inside an if statment
so from the dev logs i've read that zomboid is a custom engine built on openGL?
whats the codebase written in?
cuz Lua is used for scripting yeah?
Newbie question regarding tilesets...
If I use tiles from another creators tileset on steam workshop, do I need to either:
A) Repackage the custom tiles into my own mod (This feels like an infringement on the creators work)
or
B) The tiles will work if the user has also downloaded that tileset from the workshop. (Add as a dependency mod?)
This assumes the creator gives permission to use their tiles, and credit is given in the mod.
probably add a dependency, but you want to becareful not to enter dependency hell by having too many lol
but its the cleanest way i suppose
im not too sure as to credit as im new, but i imagine you just credit the author and/or get permission then continue, moreso as a sign of good will ala the "be lovely" rule that the company has for their game and overall spirit of dev/modding
java
a couple parts have been converted to c for performance but it's primarily java and lua
really? wild.
good old java, so then you can decompile it eh? do people do that to get a feel for the codebase when modding? or is that agaisnt EULA?
honestly most people don't, but i feel it really holds them back
lots of questions here that i answer in a couple seconds with ctrl-f π
so i'd highly recommend decompiling
I probably will, i wanna see how the thing works under the hood tbh
I do solo dev stuff in Unity but nothing beyond prototypes and experiments for now
and maybe some modding in the meantime will be a boon
if you use intellij, i recommend using https://github.com/quarantin/beautiful-java to decompile it
tho theres already quite a few great content and QoL mods for this game so its like the bases are covered ya know?
kk fair
i think modding's a really great way to get comfortable with big codebases and to get some portfolio work while doing it
yeah hey, no kidding
I've made some mods for RimWorld and Space Haven as well, but nothing too extravagant
(Space Haven is also written in java!)
RimWorld I mostly fixed other peopls mods, Space Haven I wrote some modding guide for, tho idk if anyone uses it lol
Zomboid, we'll see what it has to offer
seems like its fairly extensible given the current existing mod library
I guess once B42 is going itll be open to stuff like making logic simulators like wire mod for Gmod or redstone stuff for MC
cuz of the devices and machines/crafting ui overhaul
it varies, some systems are very hardcoded but a lot of it is quite open
thats so cool.
why is my muzzle flash so massive, how do i fix that
π
i need to do so more sleuthing around to see if this is actually viable to do but the proof of concept is there
at the moment the big limitation is i seem to need an instance to generate the metatable, and there just isn't a catch-all way to get instances of every class
you can parse LuaManager for setExposed
the problem isn't finding the classes, i need an actual object because the getClassField etc stuff uses .getClass()
if i pass it a class itself it doesn't work
it might be necessary to just generate them out of game by parsing LuaManager as you say, which is not as elegant as doing it in-game would theoretically be futureproof
also, it will add a slight overhead to all java calls - it needs to be examined how large this is, if it's significant at all then the method your mod uses is preferable
Wha do you wanna do ?
with what i've written the syntax for getting a field is just object.field
e.g. looking at the syntax on your mod page, in your modlua local frameStageValue = getPublicFieldValue(getCore(),'frameStage') in my test would just be```lua
local frameStageValue = getCore().frameStage
that's an interesting exercise. out of my knowledge π
It depends on scale if you use blender
If you use blender, apply scale so every axis is in scale 1, then scale it all down to 0,01 (i found this scale to work the best with muzzle, but you can adjust it from there depending on your liking), go to modeling and edit mode and there adjust size (changing size in modeling edit tab does not change "scale" which we aim for) so it looks good in game
In conclusion, scale 0,01 makes muzzle flash size pretty much the same as vanila gun.
ive been thinking of different ways to be able to tag evolved recipes depending on what you put into them, is there a function i can hook like i've done with eating before to be able to check for ingredients?
Hoping to get an opinion:
Im making a mod that makes clothing adjust the characters comfort, and baded on this comfort, it will adjust their sleep quality and a couple other things. My dilema is when to show this moodle:
- Display when player is sleeping: To me this is the one that makes the most sense so far that I could implement easily, but then you don't know your sleep is going to be affected before you sleep.
- Display at all times: The moodle only affects your sleep, so to me it doesn't make sense to show the moodle when no effect is happening
Anyone have ideas/suggestions for when the moodle should be shown to the player?
how about here?
when you right click a bed/chair, the tooltip reads:
Too panicked to sleep. (this line optional)
Bed Quality: Good (or poor, etc)
Clothing comfort: 60/100 (or something)
sheeeeeeeei
That would be a good spot, could just attach the moddle status there and ditch the moodle entirely
I've never worked with the UI's though, how would I access/modify/add the text to that?
I'd personally look at existing mods. subscribe on the workshop and take a peek.
There's a 'sleep in bathtubs' mod, but that probably edits the tub, not the tooltip.
theres a 'item tooltip expanded' and 'show weapon stats', but those look weapon related.
theres 'do i have a key for that' which extends doorknob tooltips, but we want bed tooltips. <- might be a good place to start?
Ill take a look, thanks
Do I Have A Key For That seems to have something similar to what I'd need to do, it uses Events.OnFillWorldObjectContextMenu and iterates through it for a IsoDoor object. By the look of it, however there doesn't seem to be a IsoBed object π’
the game knows what objects are beds, so there's a way
the way i would do this actually is OnFillWorldObjectContextMenu search the context menu for the sleep option
if it's there you can just change the tooltip from there
How would I do that? I'm assuming it wouldn't be as simple as this
try just```lua
local option = context:getOptionFromName(getText("ContextMenu_Sleep"))
You're a life saver
osnap
Where would I look to see the functions context has? "Do I Have A Key For That" uses context:addOption() but the Zomboid API has no record of addOption being a function
it's from a lua class, ISContextMenu
you can just check the file it's from
you can get intellisense for it with umbrella
I take it this isn't in zombie/Lua?
Are the Lua classes stored somewhere else outside of zombie?
media/lua/
i've managed to smooth out all of the issues i found with this, so it is now released for anyone interested https://steamcommunity.com/sharedfiles/filedetails/?id=3001901955
you should be able to access any instance fields with just object.field syntax
e.g. local username = player.username
I managed to add an option above the Sleep option.. No dice yet on adding it to the Sleep option. I think I'm just not understanding the structure behind it.
I'm assuming Sleep is an object of ISContextMenu, and the UI with the bed quality info is a SubMenu of Sleep, or how far off am I?
i can't be sure how that tooltip works but it might just be an ISTooltip, in which case you can grab it with option.tooltip
or .Tooltip or something, i have a feeling it was weird like that
you should look into where this tooltip is actually added so you can get a clearer idea of how it works
option.toolTip returns something
Of which, option.toolTip appears to be a table
tooltip["description"] also appears to be what I'm modifying
@bronze yoke Your help is godly as always
osnap
I also just realized that me doing what I just did ate the last half of the bed quality part lol
<BR> eats anything it doesn't have a space between for some reason
e.g. foo<BR> bar eats the foo but not the bar
So anything between the two <BR> tags gets eaten?
Ohhh, so it'd have to be <BR> Bed Quality: Good <BR> as opposed to <BR>Bed Quality: Good<BR>?
yeah!
Gotcha gotcha
@bronze yoke trying to intercept your TaintWater function, using https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md this as a guide.
tried to remove your Events.LoadGridsquare, but that's called by EveryDays(), but that's called by CalculateExpirationDate(), but that's called by Events.OnInitGlobalModData
Fixed it, seems that <BR> only eats what's between them if both tags do not have a space between the tag and the word
you can remove the functions after they're added, nothing should re-add it until a new session
Hello! maybe you could help me out here @albion, do you know anything about britas weapon pack by any chance?
not really, sorry
So, now I know I can get objects on a grid square.
Is it possible to programmatically get the object associated with whatever sprite is directly under the mouse?
(for example, if you hover over the topmost crate in a stack)
@bronze yoke for a 10 years later / six months later / water & elec disabled playthrough, sinks start with 20.
WaterGoesBad sandbox options -- drain 20, chance 100, start 0, min amount = 2
not bad, but now every sink in the game has 2 water.
I'm looking for, let's say, ZombRand(0,7), so I figured i'd make a small WaterWentBad mod that loads after yours.
local WGB = require 'WaterGoesBad/WaterGoesBad'
local function NewTaintWater(square)
local objectArray = square:getObjects()
for i = 0, objectArray:size() - 1 do
local object = objectArray:get(i)
if WaterGoesBad.IsValidContainer(object) then
object:setTaintedWater(true)
object:setWaterAmount(ZombRand(0,7))
end
end
end
Events.OnInitGlobalModData.Add(function()
Events.LoadGridsquare.Remove(WGB.TaintWater)
Events.LoadGridsquare.Add(NewTaintWater)
end)
I successfully replaced your function, but IsValidContainer threw 85,000 errors lol
edit: and I think I tried if WGB.IsValidContainer(object) then as well, hmmm
should be WGB or it will throw 85,000 errors
Maybe WGB:IsValidContainer instead of WGB.IsValidContainer?
check the function definition but i don't think i wrote any classes for WGB
so . should be all you need
Is there a way to the return the instanceof of a table in zomboid's lua?
I know I can do instanceof (item, "InventoryContainer") but what if I don't know the type of item? How can I print that?
if you just need to print it, print(item)
if you actually need it usable in code it's a bit more annoying
I saw this in java\characters\CharacterTimedActions\LuaTimedActionNew.java
public String getMetaType() {
return this.table != null && this.table.getMetatable() != null ? this.table.getMetatable().getString("Type") : "";
}
is there a way to port this to lua?
yes, but i don't think this does what you think it does
this is the equivalent of```lua
getmetatable(t).Type
Type is set by derive for lua classes, it won't be set for java objects
Oh yes
That's exacly what I need
Inside ISTimedActionQueue im trying to figure out which action is derived from
OH YEAH
Thank you! @bronze yoke π β€οΈ
Now I can implement my ultra minimal "speed the fuck up the game" mod
I've died twice due to "Chop Tree" + F4 π¦
performing an action, then speed the fuck up the game. zombies zoom to you out of nowhere and give you a bite π
Ah yes
What my mod is doing is making the action itself faster
Not the entire game time
swag
If this mod works, it's quite a pogger moment ngl
strange, @bronze yoke i got it working, but i... had to not use the function............?
--if WGB.IsValidContainer(object) then <-- throws 40,000 errors
if object:hasWater() then -- pulled from IsValidContainer()
if object:getProperties():Is(IsoFlagType.waterPiped) then -- pulled from IsValidContainer()
object:setTaintedWater(true)
object:setWaterAmount(ZombRand(0,7))
end
end
How can I get the originalName of an InventoryItem object, or is there a way to sanitize a display name to not include modifiers (worn/bloody/wet/soaked)?
item.originalName is always nil, and I'm guessing it's because the field is in the Java class, with no get() method :/
you could do getItemNameFromFullType(item:getFullType())
I don't think you could be anymore useful
Actual lifesaver
Is there a better guide for what functions do other than the API that I'm missing? Or have you just been through the gauntlet of hell that is modding PZ?
Hi good evening, I would like to know how I can make this tile "pickable", it already exists in the game. However, it cannot be picked up differently from a conventional computer. I've tried a few things here and it doesn't work.
This would be called a tile or a moveable object. You need to make it moveable by changing it's properties.
The model already exists in the game, but there is no way to get it, I just want to be able to get it through the pickup
You need to change the properties.
I'm trying to export the tiles here to the program, but they look like this
(Reworded to be much more clear)
-
Is there a command to find an isoObject at coordinates x/y?
-
Or; is there a command to find the sprite that is under the cursor at the mouse x & y world coordinates?
Use case: I'd like to know the IsoObject that a player is hovering over with their mouse/cursor.
(Without referencing a grid square or needing to click, since these could fail if the object sprite spills over into a different square visually on the screen)
Surely there has to be some way to do it, since Project Zomboid knows which crate you are hovering over when the player clicks to open its inventory (for example)
is there an event when players teleport?
could somebody link me a guide to backpack modeling? weapons work just fine but my backpacks are either invisible or look like they exploded from within. something is missing.
Hey guys, is anyone able to provide a simple demonstration of how I can store a virtual table of data across restarts, I'm using table.insert to populate a table with data but I'm presuming this data is gone as soon as the server restarts? I guess I'll also need to add events on save to save the data and onboot to load the data back up to repopulate the table with the correct info? any help would be greatly appreciated as always π
You should look into the global modData object. But if the data is related to an item or even player you can use their respective modDatas.
Legend thank you so much, the data is the time stamp of territory wars and the result, with the key value being the control point itself, I've sorted all the logic to figure out time difference between one faction capturing a zone and another taking it off of them, pumping out the results weekly to a log file, It looks like I can add data through add(string, table), simple enough, is there a major difference between Init() and load()? and then I'm using get(string) to retrieve the table related to the string defined in add?
Hi, do you know how you can make a character stop limping at all after bandaging his leg? Or maybe you know the mods for instant wound healing?
Hi! I'm completely new to modding PZ but I want to try making a simple mod that adds decorative items to the game. Can anyone help me out in terms of showing me where to start?
The mouse thing I don't think it's possible (can't say for sure), as you said, the player needs to "click" on the crate and them opens it's inventory =/
See if you can find something related to the Chunk Debugger in debug mode, as it show the current x & y of your mouse cursor without clicking π
For the isoObject, I use "getCell():getGridSquare(x,y,z):getObjects()", this will return a java ArrayList, then you can use a for loop to iterate on all the objects in that square, and use a filter to get the object you want, like a name or something
is there an event when players teleport?
Mod resources is a good place to start: https://discord.com/channels/136501320340209664/1070852229654917180
Decorative items you're probably ooking at adding new tiles etc - Daddy Dirk has a pretty good set of help guides on it starting here: https://www.youtube.com/watch?v=87JWHO5hs8g
Or maybe even here for making an item: https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/scripts/README.md
thank you!!
the simplest way to use global moddata is to just replace your table initialisation withlua local myTable -- if it's part of your module you can skip this Events.OnInitGlobalModData.Add(function() myTable = ModData.getOrCreate("MyKey") end) generally functions other than getOrCreate aren't used very often
Another good way to start is to download a few mods that do similar to what you're trying to achieve and work out how they work. Best not to copy the code but it should help you do thinks like find event hooks, in file references, get you used to the mod structure. If you're making something that will need to spawn into the game somewhere you'll need to get familiar with the distribution files, again - some guides in the big list.
On top of that, ask questions here. You might not always get an answer because while people love to help - everyone has their own commitments, but I've learned a lot by listening, or searching to see if someone asked something similar.
Thanks for the neat example Albion 
is there a file or folder that lists every trait in the game and how it works?
no, traits are initialised in MainCreationMethods and then their actual implementation is just inserted wherever in the lua or java they're relevant
if you want to see how a specific trait works you should find its internal name and then search the source for references to it
i saw that but figured there had to be some sort of master table holding all of them for internal references to what they actually do.
i dont have access to the files right now, but does the game have some sort of mechanic where each time it ticks it would iterate through the traits and then do xyz? or does each trait have its own seperate clock that does its own thing
i'm not sure any of them have clocks, if they have a constant effect it'd likely be baked into the character's main update method
i guess that is a point, alot of them only statically affect the player.
for something like smoker however, would that have a clock?
for traits that affect the players mood when their dirty/bloody/whatever, are those just checked based off of an event (more dirty the player is => see if they haave trait x => do y)
the stressed when bloody trait is just part of the stress update method, which is part of the Stats update
alrighty thank you. i ask because im working on my own project and wwas curious how project zomboid handled 500 bajillion traits
so basically they just check the players traits when another event fires instead of haaving their own specific event
it handles them by hardcoding literally everything 
i think maincreations did that for every single trrait...it hurt to see as a somewhat-experienced lua person
why not make a table and iterate through that π
with the older stuff you can really tell tis did not have any lua developers
honestly though even if they were new lua coders, they still made it rather wwell
its stood the test of time even with modding support and hasnt shatteredd into a quadrillion piecces
i just wish they'd used modules
The oldest stuff is in need of TLC forsure
Massive if trees make mod compat near impossible
- yeah a lack of module use sets a bad learning example -- not that they're obligated to teach people or make their code focused on modders. But would also corral a lot of issues users have in the end.
Contrary to popular opinion, mods don't have to fire off errors every second/minute lol
Does anyone know what causes this issue? There is a lack of proper display and the item itself doesn't show up when worn.
Bad bodylocations
I'm guessing you're getting errors every frame?
May or may not be related to the item in question - if you have another mod that changes bodylocations as well
A good example I know of is UndoMaskExclusion
Yep!- I think I realize the issue then since I have other mods for testing
I'll disable all other mods and see if that fixes the issue, thank you for the suggestion
Being this is a custom item, could be it itself
No problem, I made a mod that debug this issue - if it's the same one.
There's 2-3 ways to brick tooltips that don't relate to the actual tooltip Lua code. π
I meant to expand on it to find the other issues, but never got around to it. This will forcibly add the location the code is looking for though. So it may provide a clue in the logs.
Ah! Thank you! This already helps a lot since I didn't know where to start with the mod- I appreciate it!
I've had a bit of a thought about vehicles. I think they could be added upon by adding oil and coolant to their functionality along with the need for a battery and gas.
batteries and gas are a thing
The issue wasn't with the bad body location, but with the missing XML file fileguidtable- but now I'm on the next issue
The item shows up fine, it's just when it comes to the texture, this happens.
The guide for clothing items also disappeared from steam so π
you can wayback machine it if you still have a link
as far as i know all of dislaik's guides (which is likely the one you're talking about) are still available that way
Oh! okay got it! Thank you for the advice!
I don't know where to ask; Where can I learn how to make animations for Project Zomboid?
I imagine I'd have to learn how to use blender on top of trying to code it in the game.
A guide on how to make a dance with True Actions might be useful. I'm not making a dance but learning how that's expressed in the game and how to make an animation model would be very helpful.
not my area, but this guide is a popular resource https://web.archive.org/web/20230404001952/https://steamcommunity.com/sharedfiles/filedetails/?id=2867805604
I trying to add another weapon placement on belt with ISHotbarAttachDefinition.
How I can add another attachment via table.insert in SmallBeltLeft/SmallBeltRight?
My issue is that once you get a battery and a generator, the battery being the easier part, you basically have a car forever. I want to add some more need to loot to keep a vehicle functional
looking at adding spawn points, how can i easily find the worldX/Y and posX/Y? on pz map online i can get the regular x,y but then it seems spawn points need the world/pos that are cell and relative x,y?
world co-ordinate is (x / 300) rounded down, relative co-ordinate is (x % 300)
Is possible to make guitars attachable to the backpack?
was trying to get screenshots for a guitar retexture im working on and it wouldnt let me
thanks. not sure why they had to complicate that so much lol
is there something like [Recipe.GetItemTypes.RipClothing_Leather] for shoes/footwear?
umbrella shows Shoes but idk where it gets that from since i am new to umbrella
is there any easier way to make the spawnpoints file than manually editing? i saw a forum post someone mentioned a "Spawn Region" thing in sandbox settings, but i failed to find what they were talking about...
can i fetch all items that have BodyLocation = Shoes?
you can loop through the item list and check whatever conditions you need to
do i just make a lua fucntion to do that and then replace [Recipe.GetItemTypes.RipClothing_Leather] with the name of my lua script? and is that going to run the scrips each time someone goes to rip shoes?
yeah, the square brackets mean it's the name of a lua function
am i going to be looping through all the items in the game a bunch that way? is that why the vanilla rip item tooltips take so long to load?
nah don't worry, getitemtypes only gets called once while loading
ah okay
the vanilla rip tooltips take so long to load because of the preview of what items you can use, it literally checks your inventory for every single clothing item in the game 
just to only display ten of them
unless you use Fix Inventory Tooltip Laghttps://steamcommunity.com/sharedfiles/filedetails/?id=2915430406
i am, it's great
for spawn points... how do these occupations listed line up? can i leave all but 1 out if i want a spawn region to just have 1 spawn point? i tried that(only defined unemployed) and it doesn't seem to spawn me where i want. should i just copy the same coords to every occupation then? and this is definitely not the whole list of possible occupations
err, maybe it was spawning me in right spot. not very random tho
Does gendered-textures exist? Is it possible to make an apparel change textures depending on male or female?
Hey guys! Is there a good way of knowing if something Lua related (eg. a command) NEEDS to be client/server/both? Some things I know, like ProceduralDistributions or UI related stuff, they are server and client respectively. Would be cool if there was some kind of "rule" that says what needs to be executed where. 
Also, not necessarily Lua related stuff, Java methods too
in terms of lua, it's mostly arbitrary, and you should either put it where you want, or if your code ties into vanilla code closely, put it the same place they did
if you're not aware, the server folder isn't server only (there's a huge amount of client-only code there even) - so it usually only matters in the cases that either you're trying to hook into something from client (which is client-only, thankfully) or you need to ensure load order (as lua loads shared -> client -> server)
@cobalt fiber
ok so I am trying to make a item that acts like any other edible consumable. and I just want to make sure. is the "EatType:" the animation that plays when you use the item?
@bronze yoke Thanks for the help! 
how do i set the description/picture for a spawn region? only vanilla ones show anything for me. all of the map mod ones are blank
i installed the map mods via steam workshop, then added the name/file line to Zomboid/Server/servername_spawnregions.lua
and of course included the Map name and Mod IDs in the servername.ini file, that's all working
π€ do all InventoryItems have an Item?
I'm looking to get the icon for the InventoryItems in a container, but the InventoryItem class doesn't have a :getIcon() function
It's item:getTexture() for the icon
π thanks @dark wedge !
do Events.xxx.Remove(xxx) fail silently? or do I need to perform a nil check first? just in case the event im trying to remove doesnt exist?
or rather, is there a way to get a list of functions that are subscribed to an event?
I need to know what is getting called each time Events.LoadGridsquare,
so that I know if I need to remove something, or not. hmmm,
Time to work on an ISPanel ... I'm trying to create my own 'class' called PanelClass.
But the script fails immediately as I open the game on the first line π¦ I've done a lot of diving on how other folk have implemented ISPanel, but this error message is confusing me π’
Put the derive outside the function
Look overall how the vanilla panels do that they all derive from IsPanel
And store the derive in a local var for which they make all the function like create etx
If I want to make multiple PanelClass:new(),
will every call to the derive mutate the same panel?
You wanna make multiple :new() functions that have different vars parsed through?
I donβt know if thats possible tbh
You could make a second class that derives from your og class but has a different :new() function
oh hang on let me try to explain better, I'd like to create more than one instance of PanelClass ?
But I'm worried that moving IsPanel:derive outside of PanelClass would mean that I can't override its render with the PanelClass properties
Or you just make a new2() function for your class
do survivors' houses have special room names/special containers name? or the dead survivors found in the house itself? Basically want to handle certain spawns in survivors houses
Is there a way to get the ID of a ItemContainer? 'ID' seems to be a public variable, but it doesnt have a getter method
nvm, just going to use the id of the container's IsoObject π
Nevermind, getKeyId of IsoObject returns -1 π€
it fails silently
you can't get a list of added functions but you could generate one by hooking Event.Add as long as you can ensure your code runs before anything you're interested in
if two separate mods add a lua file with the same name, in the same directory,
im assuming the last mod loaded in the load order 'wins
Yes which is why you should never replace vanilla files but hook into their functions
How can I control the sound radius of a sound emitted on a square ? I use isoSquare:playSound('MSR788Shoot') from a square and the range of Z attraction is big. How can I control it ? I do not see no soundradius parameter associated to the sound (there is one associated to the weapon though but I aint got no weapon and I wanna be able to use any sound)
Do you mean the soukd volume or the sound attraction radius?
If you have the events for when it should fire then its pretty easy
can you use addSound instead? as it has an overload for radius. /shrug
so i would get the shout event?
for a custom shout sound
im doing a commission so i needa know
Dont think there is a shout event but you can check for which key is pressed through the KeyPressed event
oh sick
The pz wiki has all the events in the game
I wanna control the sound attraction radius
this does not play sound, it just does the attraction stuff afayk.
i've done the sound and attraction separately in the past
Would be better if you defined that in the item script but if the sound itself attracts zombies would be good to look at the script
But usually you define the hear radius in the sound script and the attraction radius in the item script
hum.. maybe I did not test enough. Many Zs have been attracked but It may be due to something else
Well i dunno how the vanilla sounds work since they are defined in their own way
yep, that's it. There is no attraction with playSound.
Has anyone made a mod that adds more Mannequin poses? I've come to realise there's only like 4 default poses haha
There's a mod called disable sleep in single player, unfortunately the guy who created the mod can't makes it so sleep isn't required but allowed, is there anyone that could work with him to make it so sleep isn't required but you can sleep to skip time
