#mod_development
1 messages ยท Page 279 of 1
Yup, my thought as well. Now to figure out which one, I have no idea still using B41.
has to be one of these
ClothingItemExtra = Hat_SurgicalMask_Green,
ClothingItemExtraOption = PullUpM,
ClothingExtraSubmenu = PullDownM,
those have been working fine for me
you mean this?
yes, but to like... 10k
what does the full item script look like
local container = isoObject:getContainer()
container:setAcceptItemFunction('VNTireRackCommon.AcceptItemFunction')
container:setCapacity(10000) -- lotta weight
I have seen like a trunk with 2k cap
I checked the base game surgical mask and compared most of the other ones exist
item Hat_SurgicalMask
{
DisplayName = Medical Mask,
DisplayCategory = FirstAid,
Type = Clothing,
Weight = 0.2,
IconsForTexture = SurgicalMaskBlue;SurgicalMaskGreen,
BloodLocation = Head,
BodyLocation = Mask,
CanHaveHoles = FALSE,
ClothingItem = Hat_SurgicalMask,
ScratchDefense = 5,
CorpseSicknessDefense = 25,
ChanceToFall = 10,
Tags = FitsWallet;IsFireFuel;IsFireTinder,
ConditionMax = 1,
ConditionLowerChanceOneIn = 1,
}
all I know is this gets hit with a "nope, cant go over 100" message
@winter bolt
item Hat_SurgicalMask_GreenDown
{
DisplayName = Medical Mask (Green, Down),
DisplayCategory = FirstAid,
Type = Clothing,
Weight = 0.2,
IconsForTexture = SurgicalMaskGreen,
BloodLocation = Head,
BodyLocation = Mask,
CanHaveHoles = FALSE,
ClothingItem = Hat_SurgicalMask_GreenDown,
ScratchDefense = 5,
CorpseSicknessDefense = 15,
ChanceToFall = 15,
Tags = FitsWallet;IsFireFuel;IsFireTinder,
ConditionMax = 1,
ConditionLowerChanceOneIn = 1,
Insulation = 0.1,
WindResistance = 0.2,
ClothingItemExtra = Hat_SurgicalMask_Green,
ClothingItemExtraOption = PullUpM,
ClothingExtraSubmenu = PullDownM,
WorldStaticModel = Hat_SurgicalMaskGreen_Ground,
}
}
are you doing that in-game with debug though?
your open jackets should use something similar to clothing extra, no?
yeah... I gotta do it automatically
Oh..
yeah but im lazy and add them automatically through code so its hard to compare
does it still happen if you remove those lines?
lemme try
so that when mp drops, I can let players have a massive amount of storage in one container, but just for logs/sticks/twigs
unless I can find a workaround I'm gonna have to figure out how to register when a player is adding an item to a specific iso container, or removing from it... then grab each item added/removed and multiply it's weight by either 0.001 or 1000
Is there any documentation on B42 yet?
It worked! Thanks a lot โค๏ธ
i found it
we've had another 100 mods added since I slept last night, so might be a bit more in the way of examples... but for the most part it just feels like we're expected to dig through game files.
you're using a comma in the display name which must be breaking it
if you're looking for javadocs, i'm hosting them here https://demiurgequantified.github.io/ProjectZomboidJavaDocs
if you're looking for real documentation, good luck ๐
I have no clue how to approach that, maybe try using setWeightReduction to something big? So that everything weights pretty much nothing.
I think that stat's just for clothing with containers not hitting players 50 capacity.
Uhm i have a problem i made a mod and i downloaded it but i cant see it in the mods section in PZ
I am excited but at the same time dreadful of cracking open B42, but I am multiplayer focused, so I stick to B41 for now.
that was it!
nah, setting an item's weight is solved from the vorpal swords mod, but my issue is just reliably getting like 1k+ items potentially and making sure not a single one gets missed with weight added/reduction
you can still have the comma in the display name if you add it to the translation file instead of the item script
i just used Green - Down
Never played around with capacities so i have no clue - but there must be a solution for that
you'd think so, but trying to search like... "reduce weight on add/remove from container" just leads to a bunch of players asking how to min-max their container capacity. searching how to target an item added to a specific container/removed from a container just leads to hundreds of players saying they can't pick up items.
How about existing mods?
Veracious Network's Garage https://steamcommunity.com/sharedfiles/filedetails/?id=3133520800 is best resource I've found so far, it's the only example of AcceptItemFunction being applied to an iso container I've managed to find. but their method of setting that container's capacity doesn't work.
made by actual saints though, comments explaining almost everything in there.
and the idea I'm looking to recreate is a failed hydrocraft idea where they just tried "storing" logs on an object via adding/reducing an item's weight that you'd leave on the ground.
Just out of curiosity. Does anybody know if it's even possible with the current engine for zomboid To put down objects like, for example, maybe a glow stick and then have that item still emit light when not being held by the character. I feel that if that is possible. It'd be a huge step towards quality of life. Because as it currently stands, it's really nice to have a glow stick, but if you can't leave a trail of them, then I mean, what's the point of a glow stick? You know what? I mean, same goes for candles. Are any other kind of potentially disposable or placeable light item
it's possible, i don't know exactly how flexible it is but
Expanded Helicopter Events has flares that work pretty much like you described
in build 41 you can literally place invisible 'street lamps' for world lighting, they looked kind of bad
the game used them for vehicle lightbars, and those look much better in b42 so there may be a much better way of doing it now
https://steamcommunity.com/sharedfiles/filedetails/?id=2933263134 works... but it's placing an iso object I think.
that said, radios as non-iso objects can still be turned on and do their whole sound plus the text over the object. so that'd prob be the place to start digging
i imagine it'd probably be added at some point in b42
flares seem pretty obvious with the new lighting
yeah... but ripping socks is also obvious and it's been years.
Wicked I'm going to see about looking into seeing if I can't make placeable candles and that sort of thing for a after the power goes out. Lighting options that doesn't rely on power, hungry lampposts Everywhere, or having to need a loud generator
unless someone beets me to it
placeable candles would be a cultist's dream
Imagine NVG's with current darkness
go for extra style points. make the light on candles "flicker" by constantly updating their light on client side to randomly vary within like... +20/-20% strength and hue.
or Thermals of some sort, neat idea
I was thinking about that actually, but I'm worried. It might be a little too intensive on the client-side. I don't know how much of an impact it would have on processing.It might be too much
TIS wants to say the game runs smoother, hold them to their word and send people back down to 30fps
or just lower the update speed on the light... or find a way to like... one update every couple seconds would tell the light to run along a gradiant for the variation
so update hits, zombrand says light's going from +20% to -5% intensity and is shifting from red to yellow slightly over 3 seconds until the next update... then just add in another zombrand every 1 second that quickly turns it off and on again for flickering
or just tie the effect to client-side game settings so if they turn lighting quality down, they can opt out.
hello, does anybody know where the files for when you speak in game (press q) are? as in the text that shows up above the players head saying "HEY" "psst" or "hey"
idk but i'm not new however spiffo sometimes waves me
it's defunitely in lua, probably either in client or shared, can go dig real quick
spiffo always waves at 'hello'
yess i tought so too, im looking around but cant seem to find it
IsChat.lua should have some of it
if you just want the text, it should be in the translation files in lua/shared/Translate/EN, i think IGUI_EN?
im gonna have to dig for it anyways... know full well if I tell the guy paying for the server and doing the real modwork that he can use his own custom voicelines for his character's shouting, that he's going to do that.
i haven't looked for those specific lines however i've seen other player lines in there
if you happen to find it let me know!
I'm also going to see if I can make it so cigarettes create a small glow around the character. When you're smoking, does it make sense that it's completely black, they do have a little light
that would be an awesome mod!
steamapps\common\ProjectZomboid\media\scripts\sounds\player files called sounds_player_voice_female and sounds_player_voice_male?
There are sounds for VoiceMaleLureCmon and VoiceFemaleLureCmon
they've got more light than you'd think. maybe they don't cast it across the entire room, but uh... smoking has gotten a lotta soldiers killed at night
Time to learn lua, I don't know how to code ahhhhhhh
this community's great for it. if you can think of something tangentially related to your mod, it's probably on the workshop and you can see how they did it to add another brick to your legoset.
in there are the actual like sounds
not the text itself i think
no thats a good point... you could search those sound names
and find files using them
Another noob question, is craftRecipie a new system for B42 that should be used instead of the just recipie? Is it depreciated or have usecases?
everything ive seen used recipie but in game files use craftRecipe
yes, craftRecipes replace recipes
thanks ๐
not really a noob question the update's only been out a week!
yep, they swapped recipe code, swapped the name of it in code just to mess with us... and tbh, it is "cleaner" but it's also more confusing
found it! its in IG_UI_EN.txt in shared/en folder
well ive just started today so just mainly reading and understanding the new stuff but ty
like, if I go item 5 [log] then it only takes 1 log, but game files show item 4 [something] working fine.
Ah the translations!
wait, did they add additional one line for tutorial? ๐
tutorial feels mildly revamped tbh. its been a week of running through games to see new stuff and burying my head in code that confuses me, but I wanna say they changed a bunch of things up in it
I was talking about IGUI_PlayerText_CalloutTutorial anyway i didn't know tutorial has been changed even it's mildly. i should check it out ๐ฎ
they uh... definitely made it so that they can turn off menus/hotkeys/etc at points in it
now, does anybody know how i could make this script order the game to use a specific callout?
that way i can match it to what the player hears instead of something generic
guess they got upset by that one guy who made a video years ago about killing every zombie in the tutorial and said "nuh uh, you're gonna die because we said so"
then you should go for lua
that's just the sound script. that's just telling the game how to use the audio file.
not when to use it
yes, what i mean is if i can add a line that says like, when this line plays play a specific line of text
that's a txt script... so no... but yeah that's something you should be able to do in lua. for sure.\
but you'd moreso need like... to find what's calling that audio file to be used, then append the txt to that function
oh man i dont know lua haha
search for this keyword, IGUI_PlayerText_Callout inside of \media\lua\
then you will be able to find which lua file uses this lines, means the result file is about shoutout feature
lua's easy. just be like me... never mod a game before, suddenly get in over your head working on in-house mods for a day 1 b41 server with a sys-admin friend, then get so used to staring at lua that makes no sense to you that you start believing you're seeing patterns.
or just ask how to do something specific in here, or find a mod that's done it before.
haha yeah im in the same boat as you
did that for my first 2 mods, worked out great so far!
Iโve been using winmerge to compare b41/b42 and note changes of structure mostly all in the media folder ๐
Has anyone tried to make zombies jumping small fences not trip and go down but jump them normally/like the player but slower?
i know i saw a mod specifically for that... probably
I know there is a mod that replaces that entirely, but adding a % would be extra fun
you could download the mod and add sandbox options
I remember checking that one back in the day but what it did was replacing an animation iirc
how would i set these to be the only spawned outfits?
replace the zombie zone defs entirely would do it. otherwise you could only really weight stuff super high
Just like how you can add code to check player state in regards to walkinjury in the xml, maybe similar can be done for zombie check ๐ง slow down the animation accordingly
mmm will take a look
i think adding a 10% of zombies not tripping instantly would remove the "fence cheese" strat entirely
this one prevents sneak running with walkinjury but trying to use same check in xml to delay entering/exit vehicle
i mean... there's always gonna be cheese. I can just go sit on a floating floor in the middle of a street and throw molotovs around a police car if I wanted. I think the better question would be like... how could you have a zombie either climb the fence or turn into a crawler and thump the fence regardless of whether it's player-constructed or pre-genned
Yes but you won't be as confident getting 10 zombies against a low fence and splatting them easily
maybe one of them won't go down and you are at risk of getting hurt
that's fair... just be careful with taking the mindset of "no cheese" into modding for an mp server... there will always be cheese, it's just a matter of whether your players are willing to tell you about it or not...
imagine that with sprinters, you can slow down a big batch of them but if even 1 or 2 goes out bam
Ohhh no this is more modding for fun, i always meta and do things like those so i try to subvert the thing xD
Is there a way to link these to sandboxvars? maybe there is something related with the new rope climbing thing
tbh though... more of a mega-project, but I feel like changing zombie pathing entirely would be a better solution... if fence cheese is a thing, why not have zombies recognize themselves as a collective group and start fanning out before encircling you while you're focused on the cheese
aka... you could also have zombies randomly decide whether they can or can't hop the fence, so that some of them go around it
This is about small fences
it is easier to make them have a chance to jump correctly than path around which would make them be sitting ducks to melee xD
yeah, im not saying I'd know how to do it, but it should be possible to look at a zombie pathing towards you, see a low fence in their way, run a zombrand to either let it continue or tell it "that's a wall"
and then you've got zombies surrounding you because you're standing in one place infront of a fence
or have the zombies pull you back over the fence ๐
let them actually swing/bite through windows like we can
A grip mechanic if you are too close would be a fun surprise if there are too many zs
it may actually be possible with some of the new tech, i haven't looked deeply into it
idk... I personally find drag-down to be just a cheap "no recourse" kinda mechanic. clearly you gotta add a QTE to it, or just have them literally force you to vault the fence, fly like 5 tiles forward then trip.
more like "you are dragged and you have to use extra exhaustion to get out/tripping" as you say
but that is too complex on my side, bet someone can do it more efficiently
screw it, that's going on our ideas board for variant zombies that we're working on... SWOLL zombie, that can literally pick you up and "throw" you.
anybody know why the new voice style isnt showing up?
might need to be not in an xml...
a lot of the character creation screen stuff is in media/lua/client/OptionScreens
yeah, voices are in CharacterCreationMain.lua, it's probably calling from a list somewhere
An question for you fellow modders tonight, I have not yet found a satisfactory way to create alternate build recipes to existing entities (i.e. if you would like two recipes to create the forge in build menu) but without having to recreate the full pipeline from tile definition to copying/pasting a lot of code, making things not very future proof. Ideally I would like to be able to add build recipes to existing entities in a more simple manner, but I did not manage to do so, has anyone maybe tried this before and got more lucky with this?
so... you want like a complete "or" statement for all the ingredients in a recipe against another set of ingredients? or something simpler?
btw guys, does someone know why i can't override this .xml
\media\actiongroups\player\defaultTransitions.xml
can someone test and tell me if I'm crazy?
I can edit this file directly in project zomboid folder, but i can't override via mod
The complete "or" statement could do it, or even just a new line in the build menu, but that creates the same thing using other items
could it be this? function CharacterCreationMain:getVoicePrefix()
local voicePrefix = "VoiceFemale";
local voiceStyle = self.voiceTypeCombo:getOptionData(self.voiceTypeCombo.selected);
if voiceStyle and voiceStyle:getPrefix() ~= nil then
voicePrefix = voiceStyle:getPrefix();
end;
return voicePrefix;
end
function CharacterCreationMain:getVoiceType()
local voiceType = "0";
local voiceStyle = self.voiceTypeCombo:getOptionData(self.voiceTypeCombo.selected);
if voiceStyle and voiceStyle:getVoiceType() ~= nil then
voiceType = voiceStyle:getVoiceType();
end;
return voiceType;
end
function CharacterCreationMain:getVoicePitch()
return self.voicePitchSlider:getCurrentValue();
end
oh, a new line in the build menu is literally just a new recipe. meaning copy/paste the old recipe's (two) files, rename some stuff so it's not trying to put two of the same name into worlddictionary and then change the ingredients/requirements...
it's messy, but that's how you'd have to do it if you don't just want like "you can use bricks, or you can use rocks"
But the more I think of it the more I think I must do the full copy, I guess even if I create Entity A with Recipe B, if the Entity A is destroyed by zombies or players hitting it, it will yield materials from the vanilla Recipe A ๐ค
ah, if you want to change what it turns into when broken, then you're talking tilezed.
or lua to do what tilezed does but more robust
or maybe this function CharacterCreationHeader:randomVoice()
local bodyType = 2;
if MainScreen.instance.desc:isFemale() then
bodyType = 1;
end;
local voiceStyle;
local choices = {};
local voiceTypeCombo = CharacterCreationMain.instance.voiceTypeCombo;
if voiceTypeCombo then
for i in ipairs(voiceTypeCombo.options) do
voiceStyle = voiceTypeCombo:getOptionData(i);
if voiceStyle and (voiceStyle:getBodyTypeDefault() == bodyType) then
table.insert(choices, i);
end;
end;
voiceTypeCombo.selected = choices[ZombRand(#choices) + 1];
end;
end
that or setting up some kinda strange lua code to like... "OnBuildObject" or whatever the function is called, grab what recipe is used to create the object and then leave some kinda metadata on the iso object to call later for an on-break event.
I think having the same appareance is fine. But well now that I think of it "you can use branch, or you can use planks" could be fine in fact, but I am afraid that if I use branch to build instead of planks, there could be some abuse by then breaking the wall to ultimately turn branches into planks. I am not wure it will memorize the materials used, but this can be tested !
How would you go to just add a "or this item" to an existing build recipe without overriding it completely?
i mean, if you're worried about that, then just remove planks from the potential objects obtained when broken and leave it as just scrap wood.
i dunno how the code works exactly now... I know in b41 you could literally just go "for this line on the recipe, they can use either a hammer or a sledgehammer"
but they kinda turned everything into item tags for that these days
not sure if the old "x or Y" in recipes is still in
anyone know why this doesnt work
lemme go dig up my old hydrocraft addons to see if i can find examples of ors in recipes
Yes this is also my experience, the only way I managed to customize the recipes from the Build menu in b42 was a complete override by copying complete files from the entities folder which I am not really fond of because it tend to break a lot more and cause incompatibilities... but maybe this is the only way. This or recreating everything in parallel which prevents incompatibilities but is not much more futureproof ๐
recipe Craft Fine Wooden Short Handle
{
HCOakLog,
Woodglue/HCWoodgluejar,
keep Saw,
keep Paintbrush,
keep [Recipe.GetItemTypes.SharpKnife],
Result:FWSH,
Time:150.0,
Category:Carpentry,
OnGiveXP:HCWoodwork_OnGiveXP,
}
ah
or was denoted by the /
you can still do that with ;
the issue of extending vanilla recipes, from what i've seen so far, there isn't really great support for it - i imagine this is something that will be expanded upon during the unstable process
please... I know you could replace item scripts by naming it the exact same as the vanilla item script and having the "replace" tag in it
ive been digging for hours and im not finding too much could someone be so kind and shoot me to a forum post or something talking about how to make a custom character mod?
but i dont remember if I could actually do that with recipes
you could do that with recipes before (with some limitations), i hear people have not been having luck with doing that now
could probably do it with lua though, to insert text into the recipe script... but that's such a pain of a workaround.
i'm more interested in the lua side of things and the prospects for editing the new recipes from lua seem pretty bleak so far, which is a shame with how powerful it was with the old ones
But this is a recipe for an item, that is relatively self contained, but recipes for entities are stored inside the entities, meaning (so far from what I can see and have tested, maybe I made a mistake) requires you to override the full entity to edit its recipe. Which is now a much more important thing to have to copy/paste into your mod to override it
? one sec
Check the files in /media/lua/entities I was surprised too ๐
you mean iso objects by entities?
because those two scripts right there are the recipes and supporting stuff for building a tile
it's all in scripts/entities or scripts/xui
the recipes for them aren't in the tile info. the items they break down into if you scrap them or a zombie breaks them are though (I think?)
Hummmm... So I need to check that more in details then. Because when I look at entity_wood_walllvl1.txt all seems to happen inside, the recipe being defined by the component CraftRecipe section, alongside the sprite config in the same place
I just bought Zomboid again but on GoG this time
it is in there, but it's also in the xui folder for part of it, mostly around how it looks in the UI menu.
but those are in scripts, not lua
they're just text scripts, like other recipes now
Hey guys! Sorry to disturb the conversation. Can someone give a little help with those lines to add parameters to the Propane Tank?
`local function patchPropaneTank()
local propaneTank = ScriptManager.instance:getItem("Base.PropaneTank")
if propaneTank then
propaneTank:DoParam("ReplaceOnDeplete = PropaneTankEmpty")
propaneTank:DoParam("RequiresEquippedBothHands = true")
end
end
Events.OnLoad.Add(patchPropaneTank)`
It works as intended for Propane Tanks that are generated after the game starts. But when I quit and load into the save again, all Propane Tanks goes back to the "Skizot's Carryable Everything" mod parameters.
I spend all day trying to figure out which "events." I should hook the .lua code to.
And I didn't wanted to change de vanilla item .txt to avoid conflicts with other mods.
that mod is probably also updating all propane tanks on world start.
just make your file:```lua
local propaneTank = ScriptManager.instance:getItem("Base.PropaneTank")
if propaneTank then
propaneTank:DoParam("ReplaceOnDeplete = PropaneTankEmpty")
propaneTank:DoParam("RequiresEquippedBothHands = true")
end
Right! I'll update the code without the event. and also look if the Skizot's mod aslo has anything updating the Propane Tanks at the start. Thank You!
Yes but I would have like to find something simpler, as easy as it is to override a single craft menu recipe but here with the build menu, something to only override the CraftRecipe part of these scripts. But anyway I think the scrap generated happen in the tile definition anyway which is not great for me (at least for some usecases) so I'll stick to either do a full replacement or just don't do it at all (a bit too much heavy lifting / upcoming maintenance if I need to do that by copying all full carpentry entities ๐ )
Thanks for bouncing out ideas!
yep, again though, if you just want to replace the recipe to use either tree branches or planks, you should be able to straight up replace lines in the craftrecipe via lua.
while leaving everything else the same, and not overwriting the base-game file
if you want it to not scrap for planks though, you're gonna have to use lua to edit the tile definition to remove planks from it's scrap pool
or modify the entire tiledef, but yeah
would work similarly to how you do distros by inserting/editing lines in distribution tables
int x,
int y,
int z,
int radius,
int volume)```
That is from the sound manager you can call with getWorldSoundManager().
The first parameter is IsoObject source and I have always set that to the player, but it is followed by coordinates.
Does anyone know what the relationship of the object and the coordinates are and why we have them both?
If I wanted to create a sound, for example an explosion sound in the distance, that all players on a multiplayer server could here, what is a good way to do this? Can I use cell or some object in the world for that first parameter?
Any help appreciated ๐ (B41)
Just want to say thank you, it worked like a charm. Now I fell dumb after spending all day trying to find a event. to hook the code.
Also thanks to Jimothy. I checked the "Skizot" mod, and his mod overwrites the vanilla propane tank.
the object does absolutely nothing
That is the best news ever 
i'm not sure where you got this from because the first argument is supposed to be of type Object (which means literally anything except a primitive)
all the 'source' does is get passed to the event that fires when a sound is added, so mods can react to it
That one is from here https://projectzomboid.com/modding/zombie/Lua/LuaManager.GlobalObject.html - not sure how up to date that is w b41 tho
declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject
ohhh i see the global is different...
the one actually on WorldSoundManager takes an object, my best guess without taking a look is it just requires IsoObject for no real reason
actually i think i still have a b41 decompile
yeah no reason, it just calls WorldSoundManager.instance.addSound which is the method i mentioned that takes any Object
Okay cool that is great so I can just pass something to it as a dummy so it has a parameter to satisfy it
you can pass nil if you don't want to specify antyhing
Okay cool!
That will work for me then I was assuming it required it but nil is the answer here. Thank you albion!
anyone know why this command wouldn't work?
How are you calling them?
i dont know, i just put the modified ig_ui_en folder into my mods media/lua/shared/Translate/EN
i thought that would be enough ๐ฅฒ
You are trying to over ride the Q button text then?
yess, i already changed and added voices lines but they dont match the text
i would like text to show up to match specific lines but first i should be able to change the text in general
is there a standard format to convert liquid container from b41 to b42? Im looking at the gas can both in 41 and 42 it weighs 1.6 encumbrance. In b41 a full gas can has 5 encumbrance, but in b42 a full gas can has 11.6 encumbrance, the fluid capacity on it is 10 so it makes sense that it is 11.6 now. Anyways, how can I calculate all this then to update a container ๐ต
Plz provide text instead of picture so I can test something ๐
IGUI_EN = {
IGUI_PlayerText_Callout1 = "LENNY!",
IGUI_PlayerText_Callout2 = "LENNEEEY!",
IGUI_PlayerText_Callout3 = "LENNYYYY!",
IGUI_PlayerText_Callout1New = "Hahah found ya Lenny!",
IGUI_PlayerText_Callout2New = "Lenny where are you?",
IGUI_PlayerText_Callout3New = "Lenny! You... bastard :(",
IGUI_PlayerText_Callout1Sneak = "noone would have me",
IGUI_PlayerText_Callout2Sneak = "you see the thing is... lenny?",
IGUI_PlayerText_Callout3Sneak = "hey",
}
there you go :)
How are icons handled for script items when its set to default?
They still seem to get unique icons in inventory although the parameter is default.
item Mov_CardboardBox
{
DisplayCategory = Furniture,
Type = Moveable,
Icon = default,
Weight = 0.5,
DisplayName = Cardboard Box,
WorldObjectSprite = trashcontainers_01_24,
}
i think it just comes from the moveable
like i think it's just the actual world sprite?
Yah, it seems like it. i couldnt find the icon for this item in any texture pack or ui folder.
Thanks, this gives me direction
Seems to work, what does your file structure look like?
Do you guys know how I can tell wether or not the player right clicked on a hoppable wall using the OnFillWorldObjectContextMenu event (like tall fences) ? I got it for the window but somehow the fences are IsoObjects and isHoppable / canClimbOver return false
@elfin stump
That is odd, I would try recreating the text file new in teh folder and copy and pasting the contents into that. Maybe the file extension is hidden and you have a file named IG_UI_EN.txt.txt?
oooh that makes sense, let me try that
Also verify encoding is UTF-8 but that shouldn't cause it not to exist.
i saw someone with the same issue previously
did that and it still doesnt work
its so weird...
The rest of your code and what not is working tho?
yes, let me show you the code and i can send a vid if you want
Are you restarting PZ to test?
yeah i mean, i oppened it after remaking the txt file, pz wasnt open then
module Base
{
sound VoiceMaleShoutHey
{
category = Player,
clip
{
file = media/sounds/shout/lenny.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
category = Player,
clip
{
file = media/sounds/shout/lennywyhn.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
category = Player,
clip
{
file = media/sounds/shout/lenny2.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
category = Player,
clip
{
file = media/sounds/shout/lenny3.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
category = Player,
clip
{
file = media/sounds/shout/lennywya.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
category = Player,
clip
{
file = media/sounds/shout/lennybastard.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
category = Player,
clip
{
file = media/sounds/shout/lennyfoundya.wav,
reverbFactor = 0.1,
reverbMaxRange = 20.0,
}
}
}
this handles the new voice lines
When you press q you are hearing those?
yup
k that means you are all setup right and the break is further in let me think
Your path looks good, just to verify you have the folder spelt "LUA" and not "IUA" with an I right?
lua
i copy pasted the file name
maybe i could try remaking the whole thing?
like copy pasting one by one
if you are are okay with it you can zip the file at level LENNYYYY and I would be happy to peak at it
sure! thanks :)
How can I trigger or work with [SampleBlaBla] in a crafting recipe if it's defined within a function like SampleBlaBla(items, result, player) on B42?
from shared lua file:
function SampleBlaBla(items,result,player)
slotHandler(items,result,"Example",player,false)
end
now this is the recipe from b41 for example:
recipe Add SampleBlaBla
{
[SampleBlaBla],
LeatherStrips=4,
Result:SampleBlaBlaResult,
Time:300.0,
OnCreate: OnCreateSample,
OnTest: OnTestSample,
Category:Tailoring,
SkillRequired:Tailoring=2,
Tooltip: Sample,
}
now for b42, How to do it here?
craftRecipe Add SampleBlaBla
{
Time = 300,
category = Tailoring,
Tags = InHandCraft,
SkillRequired = Tailoring:2,
OnCreate = OnCreateSample,
OnTest = OnTestSample,
inputs
{
item 4 [Base.LeatherStrips],
}
outputs
{
item 1 Base.SampleBlaBlaResult
}
}
for best practices, should I create new fluid containers full or empty?
anybody figure out how body locations work with the new radio system?
I.e. A ManPack radio that uses a custom "RadioFront" body location?
For some reason my custom radio's not radio-ing when it's not in a hand. BUT, if I make it use the "Back" body location, it works fine.
I put your lua folder in a blank project and it works. So you are good from lua all the way to the file and the file is good. You only have the one copy? Could it be possible you are editing a different copy that you are testing?
Easy fix: Rename your mod "Backpack Radios"
wut?
That's my sarcastic answer ๐
lol
Nor exactly mod dev help, but is anyone working on a mod to make rhe the barrels we see in the world function as liquid containers?
More helpfuly - does it work with other vanilla locations? Good thing to test to see if teh problem is somehow related to the new location you added.
yeah i have no other files, this is where it should be no?
I did specify certain vanilla locations work, yes.
"Back", and the hands
I don't know enough about adding custom body parts to be really helpful, but maybe whatever code triggers the radio only checks certain explicitly listed locations for a radio? e.g. vanilla only allows hand and backpack radios, so the code is if (radio in hand ) or (radio on back) instead of (if radio in any loaction)
idk fam
It looks right, but I am working out of the workshop folder and you are not is the only main difference I can see, but you can hear the audio? So that is what is confusing, is if your mod file structure was broken you wouldn't be able to turno n your mod and hear the audio of course.
im pretty sure i sent you the mods folder not the workshop folder, that one doesnt have the files
oh man
wait
maybe the game is loading the workshop mod instead of the local mod
and thats why it doesnt load
That sounds like it!
Yep, two copies, you are working on the other one. With what you sent me I am seeing audio and text after pasting that to my test project.
Good news is that is all correct, once you move to workshop it should work right away.
Now I am not sure how you will get your text to match your audio tho, I am seeing your text and hearing your audio but they do not always match the right line.
great, thanks for all your help man :)
No problem!
yess there no code to make it match because i dont know how to make it haha
i will probably just make them all say lenny
i can match the whispers tho bc there are only 2 audio tracks and only 1 + 2 text lines for each
made my first scripting, the mod turns out ingame, but nothing is changed, is there a reason why? everything is changed accordingly...
(the mod is in 42)
Provided to YouTube by Ryko/Rhino
Fat Lenny ยท Ween
God Ween Satan: The Oneness (Anniversary Edition)
โ 1990 Twin/Tone Records 2001 Restless Records
Composer, Writer: Aaron Freeman
Arranger: Kirk Miller
Composer, Writer: Michael Melchiondo
Auto-generated by YouTube.
Can i just add it on oncreate too like this?
craftRecipe Add SampleBlaBla
{
Time = 300,
category = Tailoring,
Tags = InHandCraft,
SkillRequired = Tailoring:2,
OnCreate = OnCreateSample;SampleBlaBla, //I added it here
OnTest = OnTestSample,
inputs
{
item 4 [Base.LeatherStrips],
}
outputs
{
item 1 Base.SampleBlaBlaResult
}
}
I haven't dug into this system yet besides right now but it seems like there is a lot that can be done here. If I dig in more and find anything I will send your way.
I haven't tried running two functiosn from OnCreate like that, but it could work? Not sure. Your function though has the old format (item, result, player) and the new format is (recipeInfo, player)
So you will want to goto where you function is and modify the function itself to take the parameters (recipeInfo, player) instead. recipeInfo returns a complex object tho, let me see if I can find the old post.
Are fluid containers a different thing from the actual item script?
allright thank you very much!
Made this item but It doesnt show a fluid container nor I can fill it
item PlasticDrum
{
DisplayCategory = Water,
DisplayName = Plastic Drum,
WorldStaticModel = WorldItem_PlasticDrum,
Icon = PlasticDrum,
Type = Normal,
Weight = 2.5
component FluidContainer
{
ContainerName = PlasticDrum,
capacity = 100.0
}
}
After much hard work I have created a mod that crashes the game if you put on underpants.
Oddly, this feels like a lot of progress.
at least its reading the mod!
And not throwing syntax errors!
And the vanilla function I replaced with own is running the replacment!
And it knows underpants are special and trigger the new code.
B41 format for functions coming from OnCreate:
--stuff
end```
B42 format for functions coming from OnCreate:
```function SampleBlaBla(recipeInfo, player)
--stuff
end```
```function FetchFirstItemFromRecipeInfo(recipeInfo)
if recipeInfo then
local meta = getmetatable(recipeInfo)
if meta and meta.__index then
-- Access the __index table
local indexTable = meta.__index
if type(indexTable.getFirstCreatedItem) == "function" then
-- Call the function
local result = indexTable.getFirstCreatedItem(recipeInfo)
print("SUPERCONSOLE!!::::: Result of getFirstCreatedItem: " .. tostring(result))
print("SUPERCONSOLE!!::::: WE CAN NOW FIND THE GETVISUAL FUNCTION: ")
print("SUPERCONSOLE!!::::: AND HERE IT IS!"..tostring(result:getVisual()))
print("SUPERCONSOLE!!::::: Returning the located first item")
return result
else
print("SUPERCONSOLE!!::::: getFirstCreatedItem is not a function or not accessible.")
end
else
print("SUPERCONSOLE!!::::: Metatable or __index not found.")
end
else
print("SUPERCONSOLE!!::::: recipeInfo is nil.")
end
end```
This is a function I used to grab the recipeInfo item that you can get with getFirstCreatedItem, so from here you can modify and call anything you need from this page:
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/entity/components/crafting/recipe/CraftRecipeData.html
declaration: package: zombie.entity.components.crafting.recipe, class: CraftRecipeData
alr thanks for the info, ill see what i can do
Is there a keybind to erase error logs in debug mode or something
It's hard to see what's new and what's old, and restarting just for a clean slate is a pain in the ass
Would it work if I call both OnCreateSample and SampleBlaBla functions together in the OnCreate field by combining them into one?
e.g.
function combinedOnCreate(recipeInfo, player)
OnCreateSample(recipeInfo, player)
SampleBlaBla(recipeInfo:getItems(), recipeInfo:getResult(), player)
end
craftRecipe Add SampleBlaBla
{
Time = 300,
category = Tailoring,
Tags = InHandCraft,
SkillRequired = Tailoring:2,
OnCreate = combinedOnCreate, //theyre now combined
OnTest = OnTestSample,
inputs
{
item 4 [Base.LeatherStrips],
}
outputs
{
item 1 Base.SampleBlaBlaResult
}
}
anybody know why the voice style shows up like that igui_voice beforehand?
It looks like it is wanting a language entry for IGUI_Voice_ArthurMorgan but one doesn't exist so it is giving you the name of what is missing, maybe?
oooh and where may i find/add that?
IGUI_Voice_ArthurMorgan = "Arthur Morgan", - add that to the translation file with all your lenny lines
i would like to turn on and off the lenny voicelines by checking for this voicetype
on it
Yeah, you may even be able to call two functions from tehre I have no idea, but nesting one in the other is a valid way too. However, you have function calls on recipeInfo that do not exist (getItems()) and (getResult()) I believe that is from B41 and is removed.
You will need to play around with the function calls you do have now that are here:(https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/entity/components/crafting/recipe/CraftRecipeData.html)
declaration: package: zombie.entity.components.crafting.recipe, class: CraftRecipeData
that did it, thanks! i knew i had seen that igui line but didnt know where haha
Nice!
any idea how i would go abt doing that?
Hmm, not entirely but you can start here: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/IsoPlayer.html getVoiceType is a function on that. You may be able to find a way to get the player and call that, but I am unsure if you can add and remove from a language file after load or how to best do that without a further study of the system. You might need to dig in here or see if anyone else has worked with this system yet.
declaration: package: zombie.characters, class: IsoPlayer
Figured it out: underpants do not support getInventory() because Item and ContainerItem are different java objects, based on "Type=Container" in the object definition file. Which is why this works easily if I change underpants to "Type=Container", but that has the side effect of removing all underpants from the world every time you activate/deactivate the mod (and "fails to load due to an error" counts as deactivating)
oohhh nice so now it should be:
function combinedOnCreate(recipeInfo, player)
OnCreateSample(recipeInfo, player)
SampleBlaBla(recipeInfo:getRecipe(), recipeInfo:getToOutputItems(), player)
end
thanks!
ill do some testing hope the errors will stop hunting me๐
Looks like you are getting there. I would expect that you need to then go into SampleBlaBla and ensure that it is getting the proper variables passed to it and handling them correctly if it is etc but definitely making progress towards b42 there.
is it simple to play an already existing player voice line?
so if I wanted to play the "hey!" thing through code in a custom function, would I need to go through a bunch of hoops or just do something simple
I bet you they exist as a sound in there that you can call you would just need to find them in scripts/sounds most likely. Sounds has a section similar to items and recipes that is just a big table.
That'd work, but it wouldn't take into account the player's chosen voice and pitch
You should be able to grab that from isoplayer now: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/IsoPlayer.html getVoiceType getVoicePitch
declaration: package: zombie.characters, class: IsoPlayer
I really think I need to add some sort of code to recognise this item as a fluid container...
item PlasticDrum
{
DisplayCategory = Water,
DisplayName = Plastic Drum,
WorldStaticModel = WorldItem_PlasticDrum,
Icon = PlasticDrum,
Type = Normal,
Weight = 2.5
component FluidContainer
{
ContainerName = PlasticDrum,
capacity = 100.0,
RainFactor = 0.5,
Fluids
{
fluid = Water:1.0,
}
}
}```
It is basically a copy of a vanilla item but the resulting item in-game is not the same weight as this and doesnt have a fluid container
also, when I have the item on my inventory, I cant access sinks or natural lake water options
but theres no error on the console
Alright, I need to stop modding and play or do something else lol
a goddamn comma!!!!!! after weight ๐ญ ๐คฃ
it happens, man
you know how many times I forget a closing bracket somewhere and end up CTDing on startup?
Alright, it's time for me to ask for the big help.
can someone help point me in the right place for this?
last line doesn't actually fire when placing the container, or it's firing too soon before it's built.
and uh... if anyone knows a way in lua to get around the 100 container capacity limit for iso objects, I'm all ears.
found this stuff, trying to find the source sound files but they're nowhere to be found in sounds
anyone know where I can find these events
turns out it was as simple as: player:playerVoiceSound("") 
the event inside it under clip tells you exactly where the sound file is. the sound infront of that name is designating that clip as the sound.
That sound folder for "Character" doesn't exist, figured it must've been linking to some sort of event file and not just the plain sound
No idea where it could be. Hidden files is unticked
Hi, is there a tutorial or any resource to know how to configure the xml files of an animation?
yeah, that's the weird part lol
not like they're broken or anything. I played them with code and it just works
like, if you attach a print function to that event specifically, does it fire?
maybe its a file/folder only available at runtime?
oh
no n3tworks right, one sec
it's probably in zombie, not media
that said... feels depreciated
because of the new voice acting
nothing is in zombie except java .class files
yeah, just figured it could be in a class or something
not really, fmod just lets them do a lot more with the audio
you can extract them with some tool you can get online if you want the sounds
yeah, fair...
just seems like another external tool needed to figure out filestructure though
to utilize existing resources for mods
you just play the sound script if you want to play the sound
you don't need to extract it
would you be able to point that sound script at a loose wav/ogg file in a custom sounds folder for a mod to replace it?
not sure if you're still watching, but think that solved it.
while you're here though alb
any chance you can take a look at that? only have two issues, one of them's a relatively simple event not firing or firing properly
the other one is same issue as earlier that's about to make me go look into the whole shtick of trying to find how to see if a player is adding/removing items specifically from a designated sprite's container and then modifying those items as they enter and exit
just not sure if OnObjectAdd got depreciated or what's wrong with it
if you're expecting it to fire every time an object loads in or something it doesn't, i think it only fires when new objects are placed or otherwise spawned (but not when the game loads a map object for the first time or anything)
what I'm trying to get it to do is apply when the iso object's placed
there's another couple lines under it that're functioning just fine
full script here since I didn't originally write it anyways.
to be honest i'm not sure i've ever used that event since it seems pretty spotty
Okay I'm following the b42 Mod Template for adding a new mod. The structure is correct. Launching PZ through steam and I am able to find and upload my mod to the workshop, but when I subscribe to it and download (It appears in my Zomboid mods folder and my steamapps/workshop folder) the game doesn't show it in my mods list. It works with other mods I've downloaded from steam. Anyone expereienced this issue?
can you zip what you have in documents/user/zomboid/workshop and show it?
yea one sec
any other events you know that'd achieve the same effect and work?
wheres your 42 folder in the same directory as common?
Dont have one, I thought that was only to seperate the versioning for existing mods? I don't have any mod content that applies to older versions
fair... if it's not showing up in-game though, I get the feeling that's the issue
Ill give it a shot and see if that works
try moving everything from common into a folder called 42, same directory as common's in.
mod.infos have been noted to not behave well in common
and imo it's not really desirable to have it in there
is it possible now to add dynamic colored lights?
It worked! Awesome was banging my head lol. Makes sense the info file goes into specific version folders. Thanks!
dynamic as in changing?
yeah, like have a military flashlight be able to switch to like a red light
definitely possible... don't have any examples though
might need to either add some ui/something on the right click menu, or a recipe to swap modes
then have that mode swap just change the light color
I need to track the flashlight code to see how the lighting works
honestly, I feel like the place to look is lamps
because they definitely added a ton of new colored lamps
so just see how they've got different colors, and see if that can be applied to the flashlight
anyone been able to take a look into how the grapple stuff works
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/iso/LightingJNI.html#setLightColor(int,float,float,float)
setLightColor
maybe this? idk
declaration: package: zombie.iso, class: LightingJNI
that code is close, but it requires a light id, so its more than likely for static sources
static void setLightColor(int var0, float var1, float var2, float var3)
var0 is the ID of the light source
oh it was not only rgb :0
It might work, doing some debugging to see if flashlights have a source ID for the light
yeah, searching through workshop... not seeing any obvious "we made cars/flightlights able to use colored lights" mods
shit
closest thing I can find... havent used it, but preview image says it's creating lights with colors that supposedly follow players. @crystal canyon
that said, it might be just spawning a static lightsound ontop of the player and then moving it as they move... but that is a workaround
ooh...
yeah it's doable @crystal canyon look into ShineTogether
you'd have to tweak it since that code is centering a light on a player rather than projecting a cone... but that's prob as easy as cross-referencing it against how flashlights project a cone
nice
how do y'all send code nice and neatly?
i need help with one that goes past 200 char
drag and drop lua files
could anyone help me with this file? it crashes the game when opening it
thanks :)
opne moment while i read, but you're missing a closing bracket i'd bet
you can drag and drop or copy and paste code between three
this will help you. check the code block tab
`` `
haha thanks for taking the time
output items are missing their []'
item 4 [Hat_Cigarette],
item 1 [SheetPaper2]
only tested it a bit, but seems the []'s are neccessary
aaaah
oh... or a missing comma
let me check, thanks
outputs dont need the []
haha damn
plenty of problems
oooh might just be the comma then, good eye thanks
im the guy who forgets brackets, I don't think about commas lmao
MakeSmokingPipe
comma is missing
been dealing with items/recipes all day... ๐ญ ๐ฉ
craftRecipe MakeSmokingPipe
{
timedAction = Making,
Time = 100,
Tags = InHandCraft,
AutoLearn = Woodwork:2,
category = Miscellaneous,
inputs
{
item 2 [Hat_Cigarette],
item 1 [Plank] !!!! HERE !!!!
item 1 tags[Saw] mode:keep flags[MayDegradeLight;Prop1],
}
outputs
{
item 1 Hat_Pipe,
}
haha lets see if that fixes it
could be worse, I spent like 12 hours straight yesterday having to jump straight into tilezed for the first time until I finally had working 2-tile iso objects
yeah, great how they changed almost everything about item/recipe code on us, but didn't just add in a "if it's broken, don't load it and spam errors"
I also spent like 12 hours messing with a function I wasnt able to complete. Maybe ill share it here so someone can have a crack at it.
Thanks to GPT I just asked to him for quick answer and to protect my eyes ๐คฃ
i don't trust that GPT guy
i keep asking him how to do stuff and he keeps making up events out of thin air
gpt misses a LOT of commas and adds stuff it doesnt need to
you have to talk to it as it it were a kid
Nah it's up to you how to ask and what you request. basically, you guys are right when making a code.
GPT sucks at zomboid modding... because it refuses to say "I can't do that" it will just make shit up and confidently say "this will work" when it may as well be gibberish
i mean how old is chat gpt really?
like 5 years old or something no?
aww man :(
don't check console, check log
hell, send log and I'll tell you what it probably is within seconds
logs are in same zomboid folder as workshop is
the new script error handling is a little irritating
the new recipes do have pretty indepth error checking... too bad their response to any kind of error is to crash to desktop...?
Take a look at how I had to train it to assist me with recipes
btw you have both
item 1 [Cigarettes] and item 1 [Cigarette]
are they different items?
you know i think it may not be
inb4 log says Cigarettes dont exist about 20 lines up from last
just found that
hahahaha called it
bro is a prophet
nah, recipes are usually nice about giving nice easy fixes to nice simple problems. I don't mind the ctd or refusal to load since it just speeds up the workflow.
that might just be my stockholm syndrome from having to constantly make in-house addons for hydrocraft for the server though
shit
very nice mod, but definitely feels like something that's a decade old and passed though half a dozen maintainer's hands
debugging time ๐
just throw the console file in here, i gotchu
being in here means I get to avoid my actual work... like having to learn blender for other mods...
thanks friend
now it says that it didnt find cigarette
sorry i don't understand what you meant.. English skill problem ๐ฌ
who understands this game...
one sec
[24-12-24 02:43:53.099] LOG : General f:0, t:1735019033099> WorldDictionary: Checking dictionary....
[24-12-24 02:43:53.114] DEBUG: General f:0, t:1735019033114> ScriptsDictionary$ScriptRegister.parseLoadList> - Parse load list: SpriteConfigs.
[24-12-24 02:43:53.331] LOG : General f:0, t:1735019033331> java.lang.Exception: Item not found: Cigarette. line: item 1 [Cigarette].
[24-12-24 02:43:53.332] LOG : General f:0, t:1735019033332> at zombie.scripting.entity.components.crafting.InputScript.OnPostWorldDictionaryInit(InputScript.java:677).
[24-12-24 02:43:53.332] LOG : General f:0, t:1735019033332> at zombie.scripting.entity.components.crafting.CraftRecipe.OnPostWorldDictionaryInit(CraftRecipe.java:637).
[24-12-24 02:43:53.332] LOG : General f:0, t:1735019033332> at zombie.scripting.ScriptBucketCollection.OnPostWorldDictionaryInit(ScriptBucketCollection.java:188).
[24-12-24 02:43:53.333] LOG : General f:0, t:1735019033333> at zombie.scripting.ScriptManager.PostWorldDictionaryInit(ScriptManager.java:1719).
[24-12-24 02:43:53.333] LOG : General f:0, t:1735019033333> at zombie.iso.IsoWorld.init(IsoWorld.java:2590).
[24-12-24 02:43:53.333] LOG : General f:0, t:1735019033333> at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:301).
[24-12-24 02:43:53.333] LOG : General f:0, t:1735019033333> at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:251).
[24-12-24 02:43:53.334] LOG : General f:0, t:1735019033334> at java.base/java.lang.Thread.run(Unknown Source).
you need to test on a new game/world
haha nice
i had it opened in the next folder over
im porting a b41 mod
now it should work
now that recipe should work
oh man lets hope there isnt another rebel recipe
best part is theres also a cosmetic issue i managed to see, backwards cigies
so even if i fix this theres more to do
Yep, flashlights dont have a light source ID
LOG : Lua f:308, t:1735019349947> Equipped a HandTorch in the primary hand.
LOG : Lua f:308, t:1735019349947> No light source ID found for the equipped HandTorch.
that's prob a simple number change in the model definition text file though
they do make players emit a light cone though
just means they don't emit it from the ground... but that could be solved
another crash goddammit
oh btw one more missing comma here.
craftRecipe MakeCigar
inputs
{
item 4 [Hat_Cigarette],
item 1 [SheetPaper2] !!! HERE !!!
}
lmao
wait, no it would have crashed from that
oh wait no uh... maybe not?
if it's going in order down the list and hitting the first issue
fuck it, I already pitched making a streamlined distribution tool to other guy for server, may as well go throw that old "Graphical recipe builder" tool idea from 2 years ago back on the board too...
yeah i fixed that
still crashing
because once we had a distribution file graphical builder made, that was going public anyways... no eta but yknow
๐ค
queeestion does anyone happen to know where the single player starter items list is (b42 unstable)
trying to make an extremely basic mod for personal use but i am failing to actually locate this
looking at this will probably point you there
heyyy, thanks
-- add StarterKit if configured
if SandboxVars.StarterKit then
local bag = playerObj:getInventory():AddItem("Base.Bag_Schoolbag");
local bat = bag:getItemContainer():AddItem("Base.BaseballBat");
bat:setCondition(7);
local hammer = bag:getItemContainer():AddItem("Base.Hammer");
hammer:setCondition(5);
playerObj:getInventory():AddItem("Base.WaterBottle");
playerObj:getInventory():AddItem("Base.Crisps");
playerObj:setClothingItem_Back(bag);
end;
yes
p sure fbx have been around for a while
yeah, 2006
just got worried since base B41 stuff i saw was plain ol x
i saw a new and unusual extension and got scared
no i mean like, in game. but then again from a TIS development standpoint, 2006 was basically last week. but yeah, they had FBX's in the game in b41
New to modding and having some issues getting the OnCreate to run a function when making an item.
In theory I am calling my function SkittlesSourdoughInactive but not seeing anything being printed
b41 or b42?
b42
they changed a ton of stuff in recipe code in b42, can you show the full recipe or txt file?
{
Time = 15,
ToolTip = Makes a basic Sourdough Starter to be used in bread in place of yeast,
Tags = InHandCraft;Cooking,
category = Cooking,
--attempt to call function SkittlesSourdoughInactive in media/lua/server/recipe_sourdough.lua
OnCreate = SkittlesSourdoughInactive,
inputs
{
item 1 [Base.EmptyJar] mode:destroy,
item 2 [Base.Flour2],
item 1 [*],
-fluid 0.5 [Water],
}
outputs
{
item 1 skittles.SourdoughStarterInactive,
}
}
this is for that recipie
and this is function call
print("test!")
player = getPlayer();
player:Say("made a starter!");
end```
Im worried that I was looking at b41 examples and thats why im getting goofed up
OnCreate still exists...
not sure if you need more stuff to point to that function though
or if that's just more overcomplicating things from TIS
when working on updating for b42, I have a window with VScode loaded with the assets folder from the zomboid folder. A simple search and you can find anything
it's local
it searches for functions by the name you give in the global namespace, it can't be local
so just function xyz()
yeah
is that (_craftprocessor) missing from his function on the recipe causing it?
im curious what does the prop2 and prop1 mean?
im assuming literal props, like things in players hands during animation
no, you just give it the name of the function
1 probably being main hand, 2 being off hand
aight ty
i could be wrong... but that's the feel I'm getting from all the recipes I've looked at
you might be right i see some screwdriver that is used on crafting or something being held when it is declared as prop1
ERROR: General f:0, t:1735020562163> ExceptionLogger.logException> Exception thrown
java.lang.Exception: CraftRecipe error in MakeStarterDough at CraftRecipe.Load(CraftRecipe.java:359).
Stack trace:
zombie.scripting.entity.components.crafting.CraftRecipe.Load(CraftRecipe.java:359)
zombie.scripting.entity.components.crafting.CraftRecipe.Load(CraftRecipe.java:249)
zombie.scripting.ScriptBucket.LoadScripts(ScriptBucket.java:265)
zombie.scripting.ScriptBucketCollection.LoadScripts(ScriptBucketCollection.java:122)
zombie.scripting.ScriptManager.loadScripts(ScriptManager.java:1639)
zombie.scripting.ScriptManager.Load(ScriptManager.java:1562)
zombie.GameWindow.initShared(GameWindow.java:156)
zombie.GameWindow.init(GameWindow.java:1442)
zombie.GameWindow.mainThreadInit(GameWindow.java:701)
zombie.GameWindow.mainThread(GameWindow.java:599)
java.base/java.lang.Thread.run(Unknown Source)```
hi, can anyone help? i'm converting recipes in 42 format but when i start the game it won't start with the recipes file. Why is breaking my game? it seams all good ๐ฆ
gpt did this, is still possible something is missing?
hey there, thank you for your work, unfortunatelly it doesn't seem to work, not sure where to see the stuff you placed in the 'print' function, as to why
log file from c:/users/user/zomboid?
just need the last debuglog
so i dont have anything that can open plain x files, any clue what the difference between the normal and alt models are?
i see time goes not capital
so it doesnt need a surface
yeah, capitalization is prob it
gonna try ty
i forget where it is but if you search for console.txt you can find the file that prints. You should also use the debugger so the console is running when debugging. Do that by adding -debug as a tag in general options in steam.
didn't work ๐ฆ
literally none of the variables/tags/etc should be capitalized, items, categories, functions/events can be though
wait no...
i haven't checked for craftrecipes specifically but usually property names aren't case sensitive (values generally are though)
yeah just looked at another tis example... it's not case sens
i do have that -debug added, but nothing shows up in the game console when crafting those bags
yeah..
is it because they're missing categories?
it looks good wtf
im getting exact same error so im also quite confused
since mine was launching but now its not
Make sure the functions being called by recipe are the ones on the script "PickBagTextureRed" they might not be formatted like that on your example I did not have files etc when I wrote that so it isn't just pasting in.
Likely the function isn't getting called because your OnCreate = hasADifferentFunctionNameHere
check adding categories. I don't really see anything else super wrong aside from that's missing... maybe the new UI demands categories?
did anything chance from the items side?
maybe he don't find the items i put as inputs and outputs?
pz updated like 13 min ago maybe dev man messed something up?
nothing that im seeing wrong with your scripts
and the log would be screaming it if the item was named wrong
it's just " OnCreate = pickBagTextureRed, "(and other options ofc) as you told me the 1st time in the recipe script, should it have the stuff in the brackets too?
yeah it needs categories to show up on craft menu
yeah but it's crashing him
and it's the only missing factor I see
categories in mine and also crashing
i'm gonna try
oh just noticed mine starts from a small letter, is that case sensitive?
Can we see your items file? Do Base.StarterKit BattleReward.AmmoPack and Base.RCoin exist?
reply bumping s4's log. It's not giving any super clear reason without digging into decompiled, and I don't have decompiled
what the base category?
log isn't saying item doesn't exist
BattleReward.AmmoPack looks like the odd one out, what is that?
It usually won't say much with the new recipes as far as I have seen it will just crash
hey guys how do i have another input for the same result in here?
do i just do another inputs {} under the existing one?
yeah but we just did this with cigarette guy, logs will tell you in plain text that an item name isn't real.
check the caps
craftRecipe error means an invalid property
hey that the rat in my pfp is smoking dont mean im cigarette guy 
yes, they are 2 different item files
it's Sound
yeah alb, can we have an example of using ; in a recipe in the same way that / used to be used?
there is no Sound property
recipes need sounds?
sounds are defined in the timedAction
OH
Ah yep thats it!
fucking gpt, man
so is the sound?
this is why im saying, gpt sucks for zomboid. it just pulls things out of it's ass and presents them as semi-believable things
gpt is near useless, if you're good enough to catch all of its mistakes you're good enough to do it yourself
gpt is for the grunt work you already know how to do but don't want to do ๐
but it just got used for that grunt work and decided to slap "sounds" on all the recipes... I would have fucking believed that was a tag.
lol
If you correct its formatting enough sometimes it will show you pictures of a lake
i coulda sworn there was a tag to play a sound while crafting
ty guys
it's configured in the timed action script now
it used to be built in there in b41 but went to b42 cahtgpt picked it up from the example of old and got confused haha
sound and anim are moved there
oh ok it was the small letter, it does something now
oh god, pray for robot ex 140 if he even considers trying to maintain hydrocraft into b42
i quite dislike that there are now two different things called timed actions but oh well
I never dug into the others too much but I did look at em, these ones are much easier to deal with it seems
but yeah I was confused by that if they were related or the same or the new timed actions are replacing the old or what
it's just weird and confusing to have the same name for two different concepts
timed action scripts technically configure the crafting timed action so i guess that's what the name is meant to mean
yeah it is but thats good to know they are just differrent things
but now whenever we talk about actual timed actions we're all going to get confused
I dun like it. change bad.
make it optional and keep my option to not go make a billion different timed actions for specific recipes, just let me essentially define the timedaction in the recipe
did they change even recipecodes?
yeah they have totally different signatures now
noooo XD
remind me to update the links generator for this page to point to my javadocs
speaking of java... alb... I know you don't have an alternate OnObjectAdd...
but do you know about any events that fire when a player looks at a container?
if calling functions from recipe it used to pass (items, result, player) and now it passes (recipeInfo, player) where recipeInfo is a big complicated table of recipe information. I am not sure what they reference recipeInfo as in the java tho, but it is essentially that.
you can use OnRefreshInventoryWindowContainers for that, i think it should fire whenever the list of containers you can access (because you entered/exited range or a new one spawned) changes?
fuck yeah... that sounds like hell on performance to run functions off of, but it's the best I got for now. that's on my other dude to fix.
yeah thats the one
it's probably an improvement tbh but it's going to take getting used to
so bisically it works now, just idk what is the thing at the beginning
LOG : General f:2872, t:1735021693665> ItemPickInfo -> unable to set source grid pick info, Caller: FillContainer, for Container: Bag_BagBundle
LOG : General f:2872, t:1735021693665> ItemPickInfo -> Outermost Container: floor
LOG : Lua f:9538, t:1735021772938> SUPERCONSOLE!!::::: Result of getFirstCreatedItem: BAG_BAGBUNDLE.Bag_BagBundle:zombie.inventory.types.InventoryContainer@7835fdf0
LOG : Lua f:9538, t:1735021772939> SUPERCONSOLE!!::::: WE CAN NOW FIND THE GETVISUAL FUNCTION:
LOG : Lua f:9538, t:1735021772939> SUPERCONSOLE!!::::: AND HERE IT IS!ItemVisual{ m_clothingItemName:"Bag_BagBundle"}
LOG : Lua f:9538, t:1735021772939> SUPERCONSOLE!!::::: Returning the located first item
I like updating other peoples mods because im learning a lot
Yeah it was a bit odd, I was able to fetch information from it via lua, but it was a lot of stuff to go through. It does seem like it passes everything you could need though. This code here actually pulls it: #mod_development message
will they give some guide/documentation for mod making, lile they announce?
i may have hit a snag while looking for armor models to potentially backport to b41
we wish...
what is this tho "unable to set source grid pick " ?
i'm finding more ground models than worn models
S4ro can you show me what you added in to add in the sound to your recipe, im getting the same error for my mod
like i dont think i've even found models for the vambraces you wear
you need to remove the sound line, it's deprecated
gotta make a timed action and define the sound in there.
but not a Timed Action
timeAction lowercase? (T lowercase)
we all hate the texture packs and sound banks, get ready for model packs
no, please don't
No idea really
i haven't started learning blender yet but i need to...
i also have a question regarding the b41 version of a mod, should i just leave the files in the original place, or can i like make a 41 folder and put it there?
Cause I didnt have the sound argument for my recipe but it was still crashing
timedAction
leave in the original
{
timedAction = MixingBowl,
Time = 15,
ToolTip = Makes a basic Sourdough Starter to be used in bread in place of yeast,
Tags = InHandCraft;Cooking,
category = Cooking,
--attempt to call function SkittlesSourdoughInactive in media/lua/server/recipe_sourdough.lua
OnCreate = SkittlesSourdoughInactive,
inputs
{
item 1 [Base.EmptyJar] mode:destroy,
item 2 [Base.Flour2],
item 1 [*],
-fluid 0.5 [Water],
}
outputs
{
item 1 skittles.SourdoughStarterInactive,
}
}```
this is what I got
what'd log say?
aight ty
oh damn roblox has trolled me
oh right... I didn't catch that, been staring at the same lua script for hours trying to build up the will to start working on the workaround to 100 container capacity limit
oh wow
that really was it
function being called and all
ty fellas
really got trolled by a comment
something about the way the models are organized makes me want to vaporize a dev or 15
why not have armor in all of the names
so you can find it all when looking for armor
makes too much sense
im looking for fucking shoulderpads, vambraces, codpieces
gotta specify bob and kate too, got two folders just to split it
wait, we have codpieces now?... are they visible?
yes
oh no...
they're not comical like medieval ones
no but they will be
just a triangle between your thighs
inb4 someone makes a strapon
it's innevitable
I now need to hide the fact that groin armor with models is a thing from my other modding partner...
plus the grappling mechanic... Ive been to loverls lab enough to see where this might be going
sexual zombies
coming next week - spiffo costume doesn't block groin clothing slot mod
game took a turn
yay! Bianca Boxes updated. Now to see if they allow reuploads
anyways, it works so thank you very much for your help!!! Really appreciate it, it wouldn't be possible to update my mod without your help cuz i have 0 knowledge here lmao.
If you wanna check it it's called "Schoolbag Bundle" on steam, it's a simple thing i made for myself but might aswell share it with others right.
Was just messing around with it on different files as to not break more than i fixed ๐ thanks again for your help!!! โค๏ธ
@bronze yoke btw i just realised you helped me set up the b41 scripts, thanks again haha ๐
No problem! Happy to help ๐
pulling my hair out. cant get mod to show up at all in the viewer. i BELIEVE my formatting is good for b42 blarg
ported wearable cigies to b42, now i just need the author's permission to upload it, or sent the files to them lol
screnshottt
one second may have fixed it
question is this one the zomboid directory or
announcement i have fixed the issue
okay sick it actually works properly
thanks gang
this fluid code is making me insane. I thought I was done
They register correctly as fluid containers
It has the fluid type, the amount, etc
But when I press Show Info
LOG : Lua f:6959, t:1735025042934> ISFluidPanelAction not a valid (ISFluidContainer) container?
LOG : Lua f:6960, t:1735025042935> ISTimedActionQueue:tick: bugged action, cleared queue ISInventoryTransferAction
I get this. Might this be a bug?
or is it related to the capacity limit?
Didnt change anything and now it works... wtf
hey, its been a while since modding but wanted to try 42 with older recipes mod I had, however is not working
just downloaded a new recipe mod to see the format and it looks so much different to what I had
this is how I had it
{
recipe Makeshift Needle
{
Base.TinCanEmpty=1,
Result:Base.Needle=1,
Sound:ClothesRipping,
Time:200.0,
Category:Survivalist,
}
and this is how the new mod have it
{
craftRecipe MixClay
{
time = 90,
timedAction = Making,
Tags = InHandCraft;Pottery,
xpAward = Pottery:5,
category = Pottery,
}
is this the reason why my mod doesnt work, do I need to change it to be like this?
I guessed it was too heavy to transfer into your inventory, anyway it works
yeah, seems like it because it worked when I activated debug cheats
yeah, a lot changed
sorry but where can I find the documentation so I can start checking it
check vanilla PZ's recipes. will help you
I honestly got it from seeing vanilla recipes
for example, here is my recipe for a needle
craftRecipe MakeMakeshiftNeedle
{
timedAction = SewingCloth,
Time = 100,
AllowBatchCraft = False,
Tags = AnySurfaceCraft,
category = Tailoring,
inputs
{
item 1 [Base.Nails],
item 1 tags[Hammer] mode:keep,
}
outputs
{
item 1 Base.Needle,
}
}
I used to know how to navigate between the files very well but dear lord I forgot everything about modding
oh I can use your code
but you really dont need a recipe for needles anymore. there are alternatives
like took me an hour to figured out where to put the damn mod folder >:/
is drawTextureColor drawTextureScaled broken? basic drawTexture works fine for me
oh is not really the need of that craft, thats one of a huge list of makeshift crafts I used and wanted to start redoing them little by little, just wanted some tip on the new code, will use yours as its pretty clean
I dont know how to put it online, so I just copied it into the files
ah i see
here, it was just recipes that personaly felt very basic
one important thing from now is that recipes cant have spaces
Makeshift Needle to MakeshiftNeedle
oh
you need to have a tag for crafting like Tags = AnySurfaceCraft, this means that you need a table or any solid surface to craft, theres also InHandCraft meaning you just do it in your hands like in B41
multiple items now are an array like [RippedSheets;RippedSheetsDirty]
instead of RippedSheets/RippedSheetsDirty
one of these. This is the action your character does while crafting
holy they did change it quite a bit
it governs calorie consumption, how tired you get, etc
and the animation
you do NOT need a sound anymore. Having one in your recipe will crash your game
if you're gonna use a tool in your recipe, you can either use a specific like Base.Hammer or use tags like item 1 tags[Hammer] mode:keep
mode:keep is self explanatory, means you keep the tool after use
theres also flags for the input items like item 1 tags[SharpKnife;Scissors] mode:keep flags[MayDegradeLight;IsNotDull;SharpnessCheck],
these add special conditions like damaging your tool, or requiring your knife bieng sharp
before I start looking for the vanilla files to find the item names and other examples, I should clean this tho
I know its meant to be in 108600, but Im pretty sure there is redundant files in my folder
yes, thats too convoluded. you can put your files in your User/Zomboid/mods folder
it used to be clean I swear, but I was getting frustrated yesterday on the game telling me I dont have mod.info in the folder, so I pasted everywhere
wait so I dont need to put it on 108600 for it to work?
no
zomboid reads mods from three folders ๐
User/Zomboid/mods, User/Zomboid/Workshop, and from the steam 108600 folder
oh then I only need this
yeah saw something like that in the test mod I added
got it
and now you can modify the recipes inside the 42 folder for the new format
alrighty, one more thing there used to be a folder filled with .txt files, for all the items/crafts/recipes/etc
thank this discord, they helped me learn this and now im helping others lmao
hah I swear, used to know my way around but its been ages since 41
even if it was yesterday, a lot changed
I think I broke my mod list now hah, everything is suddenly โ
back in b41 if i wanted to include different types of base material for crafting something i could do "Hat_BandanaMask/Hat_BandanaMaskTINT=1,", how do we do that now, just "item 1 [Base.Hat_BandanaMask;Base.Hat_BandanaMaskTINT]" ? (not to mention i should probably check how they are called now)
wait, what do I need to put in mod.info? currently it has a name and an id
name=
modversion=
author=
id=
description=
versionMin=42.0.0
poster=poster.png
icon=icon.png
that's what i have in mine
what is your issue?
i had to put my textures in 42 folder, cuz when i placed them in common they didn't appear for whatever reason, idk what i'm doing tho so there's that
suddenly all the mods went โ after I added mine
Hi! Is there already an updated java doc for B42 available?
your mod shouldn't affect other mods tho
shouldn't it be just 42, without the .0, idk xd
losing my mind rn
i cant find textures for certain weapons
like where the FUCK are the textures for the fork/rake headed bats???
ye i couldn't find the icon files myself, idk where they moved them
???
i figure the unusable metal is the sheet reinforced one
and tin can is obvious
BUT WHERE FORKS????
where rake?!?
ProjectZomboid\media\texturepacks maybe here? idk
also circular saw and rail spike on the same texture??
nothing useful there
go to media/scripts and look at models_weapons.txt
the mesh value points to the model locations
goddamn what the fuck
Odd, is this in the case of recipes that alter it?
Oh right
weird as fuck! but also super neat
save some space lol
weird thing is though
cant find the rake headed bat
it just does not exist here
closest i can find is the long handle rake weapon
oh im dumb
FOUR
FOUR WEAPONS COVERED BY ONE TEXTURE
they all just have a wood handle so its efficient
How dou you guys view .X files or can they just convert to OBJ/FBX?
Anyone ever see an issue where the zomboid console only prints 600 lines and then stops? It prints to console regularly in game but the console.txt hits 600 and dies, never seen it before.
B41
havent ran into that yet
If I remember there was some old viewer or you can use old blender to do that but it has been a long time since I viewed one of those, and I remember I couldn't do much with it. But someone else may have a better answer.
I found a converter thanks, yeah I'm trying to see how they do UV unwrapping and texture coords
you may want to check the modeling channel instead of the modding channel for that
there may be more knowledge there
oh duh! Didn't even see that lol
Anyone know from the server side how you can get a list of all players? I remember there was an easy way but I forgot it ๐ฆ
getOnlinePlayers()?
nice yeah that might be it I think that is on the global object, I missed it! Thanks! gonna try that
is the common folder in the mod for placing textures for multiple versions of the mod? if so why when i place the textures there they don't appear in game, how do i have to redirect them in the mod file?
is there even any point in doing that, or should i just leave them in the 42 folder
I would just leave there for now I think people have had trouble with that, there will be better guides later, or you can do it now but might need to do some trial and error or searching of the chats for people that have made it work.
did you put them inside a media folder in common?
i got tripped up on that a lot
tbh i think i didn't, i did that yesterday so not sure
also you helped me with my backpack mod last year haha, thanks again ๐
Hey everyone, I am a java developer and very interested on implementing my first mods. I am looking for resources on how to get started ? I mean, having the necessary documentation to have something ready, I don't find anything atm. Do you have any ressources to share ?
pz mods are done in lua. for b42 there are not a lot of resources atm. for b41 check threads, there's thread called mod resources
@blissful urchin
Thank you, but I don't find this thread, I made sure to select "pz modding" when joining the server
anyone here know how to use debug mode to increase an isoobject's container capacity?
is there any way to get the value from settings.ini to lua file? i need to get the value of moodleSize
the crafting menu isnt finish yet right? i mean the ff. isn't craftable in the crafting menu
No, you have to do it from Lua. And also with B42 the devs have implemented a limit on container sizes.
public final class ItemContainer {
...
private int MAX_CAPACITY = 100; // default capacity limit
private int MAX_CAPACITY_BAG = 50; // default bag capacity limit
private int MAX_CAPACITY_VEHICLE = 1000; // default vehicle capacity limit
...
}
no i mean, someone the other day edited a container capacity in debug mode
but didn't explain how he did it
and I want to go hijack that code to get around that restriction potentially
so all the vehicles with 1.3k carry weight are rip?

or do we have a get and set method
man imma be sad if we cant have 60 cap bags anymore
this is where someone showed off debug editing a container size
well 1000 + how much does organized trait offer

those limits are used in the set and get functions
i dont need negative weight, i need to see how debug is bypassing that container size limit
i dont get IndieStone, on one hand they allow insane modding capabilities with lua and on other they set restrictions instead of letting ppl play how they want 
oh it's just warns
fuck it we ballin

it gives warnings when you set the capacity, but in all getters the limit is checked
im trying to go over 100 cap on an isoobject's container
yeah ima have a look aswell
so that I don't have to write a whole bunch of code to instead just lower weight when something goes in, increase it when it's pulled out
basically
it checks if the player isUnlimitedCarry ture
then
when getting current weight it just returns 0
oh

MAH 100 KG BAGS
okay... but I'm not trying to change my capacity, or an item container's capacity... I'm trying to change... it's not a box but let's just simplify shit and say I want to make a crate hold infinite shit

i mean, mp is just gonna drop and im going to java edit so
this is new though, right? i dont remember there being a bag limit in b41
there wasn't
what are some common reasons for why a mod wont display sandbox options?
well yeah thats just how the cheat works. Instead of having infinite capacity, it sets the inventories encumberance itself to 0. Never editing the max, so it would be of no use
im trying to make infinite log storage
A really tedious workaround could be to set weight of transferred item to 0 and setting it back to normal when retrieving
yeah... thats what im trying to avoid
Thanks ๐
When the ItemContainer is attached to a GameCharacter.
there's another case, and that's editing through debug mode... but I can't figure out how to do that
which... is just what i wanna know. how do you change an isoobject's inv cap in debug
attached to a parent of gamechar
so i can have a hint where to go look in the debug UI to point at how it's skirting the rule
I need help with someone experienced using sandboxvars
show ur sandbox file
i have never used enum in sandbox options, rest looks fine
so either enum if bricked or file is in wrong location
thanks for giving me somewhere where I can focus
try removing enum section see if it works
what other options are there for sandbox options?
I only ever used numbers and bool so idk
feew!
help
how did you do that thing yesterday, using debug to edit a container cap?
I set it using containers property
yeah but can I get like... a step-by-step?
Yeah, let me get to pc
because im just trying to track down how the debug ui is doing it
to see if I can spoof like "hey, im not doing setCapacity, debug is"
Im not doing that in-game through debug, itโs a lua code that does it
yup
can you share?
