#mod_development
1 messages ยท Page 386 of 1
already did my test in MP 
its working
even the silly ammo belt thing
as for the stats, server authorizes any stat modification, same concept as with RAF
But the problem when you modify a weapon script is that it will modify it for every single weapons no ?
So shooting two guns at once will end up with them fighting for their appropriate stats ?
Unless I misunderstood what you did
Ah no
It's not modying the script sorry
The weapon instance
It's just doing normal setters and getters
(SetReloadTime etc etc..
That's why I made Universal Simple Silencers, which lets the silencer from Simple Silencers work on anything (included modded) by editing the attachment stuff at runtime.
Would be nice if there were standard ammo types.
Actually that is a goodidea for the requests channel.
what I did personally for my mod is that I scan each item that uses ammotype and I change it to mine in case someone puts a weapon outside my mod pack
guess to ensure its in some way usable
lol
Its actually fine to do that in SP ๐ it only causes problems in MP if the server is also simulating gunshots (I believe it likely does for a number of the values)
Some properties are per-item, some are per-script.
Yea
modying script is not recommended honestly
as it will affect all new future items
You can tell by looking at the getThing() function in java; if it returns this.thing it's per item, if it returns this.getScriptItem().getThing(); it's per script.
yea
I normally do all my operations on the instanceitem normallt
I wouldn't want to change the script for a feature that wasn't an intended permanent change for every item of that type, but you can do most of what you need for weapons with item-specific changes.
Any other "people want this in mods" calibres I should add to that?
i think that this is when the community should leverag something
instead of askign the devs for items that wont be used to be honest

If you try to make a "community firearms pack" you'll still end up with it being ignored.
this is the goal of the weapons framework honestly, is to provide useful functions of things almost all gun modder develops
not a community firearm pack
but I am working on the framework for functionality
all the things I have shown in my videos are systems that come from the framework rather than exclusive to my weapon pack
the main reason community frameworks don't get used is because they aren't useful
if you create something that actually has the features a modder wants they will usually prefer to use it
some people will always prefer to do it themselves but they wouldn't play nice with vanilla ammo either
yeah hence why im trying to make the functionality of the framework optionals, yet they wont break anything if not used
as for you know items that people define
that has to be the author, nothing we can do about that
That's literally what I said ๐
Instead of frameworking, i just add compatibility api to my stuff, if people wanna play nice with my weapon mod, its a 3 line change in nearly every case
(i did framework tooltips tho(sorry albion, thats kidna ur thing) but i did it anyway, cuz i was tired of ppl breaking my tooltips
it didnt make sense to add a shitton of ISToolTip metatable hacking to my weapon mod specifically so i put it in a framework :p
๐
I did for my first mod. But the new framework im releasing im also releasing my weapons along to show case the fratures
Features* i feel its important for a mod to show case them
thats a good idea, did the same thing for my tooltip library to show how it can be used effectively
its only a few weeks old and I found a mod thats actually using it already
where are the attributes listed at need to look up 'Brave' and exactly what it does
Pretty sure that got nuked by the reflection removal
We can only add now I think
No-one? just need be pointed in the right direction to look for a specific trait and what it does exactly
Have you tried looking through the media folder for "brave"?
is there any kind of new "special" procedure we need to update our mods?
if you suggesting that every trait is listed in its own file...?
plus dont matter someone answered what 'grapple' buff was about
traits don't really have 'attributes'
the game has hardcoded checks for specific traits across the codebase when calculating things like chances
so to find out what a trait does, you need to look for all usages of the trait in the codebase, there isn't a central place where it's defined
For me when trying to update, I got an "error requesting steam to update item" immediately when I click the in-game "create and update" button. It doesn't even try to load anything.
Maybe a known linux issue since one of the most recent game updates?
thats why I was asking where in the code they hide I was gonna sift thru it looking see if something changed from 41 <> 42
No, I was suggesting opening media folder in IDE of your choice and searching in all files for brave
because likely its in java... not Lua.. as someone already stated hardcoded. lets just leave it at that.
Well ye that would be your option after checking Lua
is there an event that can be used when ClothingItemExtra is pressed?
hello,
how do I make transmission set to never in .lua ?
SandboxVars.ZombieLore.Transmission = 4
is it ok?
I did on AReallyCDDAy.lua
I got bitten, my character has fewer and anxious right now....what did I do wrong?
CDDA.OnInitWorld = function()
...
SandboxVars.ZombieLore.Transmission = 4
under these settings
I think that doesn't work
hiding is possible for the world object surfaces but many of those dont have an existing tooltip, if you can explain your usecase I'd be happy to add some functionality
https://steamcommunity.com/sharedfiles/filedetails/?id=3694097672
Im not sure if its possible to disable transmission for bites, scratches yes, but not bites maybe im wrong tho -- u could just load the game in debug mode, and turn on godmod for a sec ๐
mmk yeah I looked into DoSpecialToolTip actually will hide the tooltip for us pretty easily....anyhoo happy to add that if you're interested
the problem is moreso hiding specific elements from the vanilla tooltip
starlit had api for this but it didn't seem possible to reimplement without reflection
you usually don't want to just nuke the whole thing
how difficult/hacky is it to add a new crafting skill (chemistry)? i know fleshing out recipes and stuff is a mountain of work, I'm just wondering how technically involved it is
if it's literally just the adding of the skill, there's not much to it
as you say the complexity is in fleshing it out and justifying it as an entire skill
I've just been thinking zomboid could use a real tech mod.. tons of ideas and I don't have a clear vision yet
but chemistry is something that could support a ton of tech things
ya that sounds cool, tech progression/crafting progression stuff is a great mod surface
real
chemistry sounds like something that would need a lot of original items to work, and probably would want to reach out further than vanilla crafting would allow
People will love or hate this idea: Gasoline realistically goes bad within 6 months, and works like crap after about 3
long term you'd have to do something like biofuel, and there are ways...
its tractable for non inventory item tooltips specifically
i see... starlit was only concerned with item tooltips
they did something rlly interesting with this concept in one of the twd spinoffs. tldr: corpses emit methane. methane can be converted into liquid fuel. zombies = fuel might be a bit op though xD
Heh I was thinking algae farms
would be cool to make a base that generates its own fuel
"100 years later" mod
someone drop Feed the Zed modpack
If i had magic powers to snap my fingers and make the mod happen.. it would basically be gregtech for zomboid.
fuckyeah
yeah, i think beyond crafting it could potentially need some custom tiles(?) and other mechanics on the side
and there's no way a mod like that could exist without going deep into both chemistry and electrical.. and most of hte other skills lol
there's a good handful of vanilla assets for tiles which could totally be repurposed for this type of concept 
now we have crafting stations its feasible, prolly as much design work as actual programming to be comprehensive
"The world has ended, but Moore's Law did not"
where we gon end up rimworld hypertech?
I mean this is just a daydream right now lol
cybernetics mod xD
but man, if only. maybe if I start doing one little thing at a time
keep dreaming ponyboy ๐
my dream would be something like computercraft
all it takes is doing a lil bit of work here and there. building the concept over time. what i've learned about zomboid modding is the skys the limit ~ all it takes is dedication 
computercraft sounds a lot like the PZDos mod I've been workin on
ohhh do tell
It's a lua+java mod, but it makes dos work within zomboid. You can build computers from retro components, use them, install software on them
if its an old dos game you can play it.
lmfao youre a savage
technically you could even install emulators on it and play nintendo games
im gonna throw up
doom in zomboid? 
thats so sick
Oh yeah, doom works
helllll yeaah xD
If it works in dosbox it's basically working in zomboid at this point
The hard part of PZDos was multiplayer sync.. it's technically file sharing. Your buddy opens the computer, he needs to see the files and games and stuff you made.
thats a neat rabbit hole to go down with the programmable computers concept
project factorioboid
lmfao exactly
I don't have any way for the computers to interact with the game world.. Like if zomboid had a redstone equivalent I'd be all over the idea
that sounds diabolical
I do plan to make em interact with each other so people can play multiplayer dos games
it's feasible with java modding, i'm fairly certain
Almost anything is feasible if you hack things enough lol...
some lua stuff that's already available is like adding/removing tiles for example
I never figured out how to do much beyond basic reflection ... It would be helpful to replace vanilla zomboid java code
so far I've avoided any need to
ask claude
the simplest way is to just replace the class entirely, but the maintenance burden will get pretty absurd that way
i recommend using something like zombiebuddy
java modding is fun 
But yeah, PZDos is almost feature complete and in "million little things to fix" mode
badass will def try it when its ready
Theres lots of little pics and a couple early videos I made of it in this channel
but today? Friday. Home from work. Sat+Sun = mod days hehe
bet
that's why I'm in here asking about tech mods ๐
that photo is how I feel right now
So.. if I go LUA-only for a tech mod... what if I totally want to repurpose generators? No range, actually connect them to a building... whole new power system.
u can do dat i think
could be done in lua 
power is nightmarish to work with in lua
Heh, I figured it probably wouldn't be easy.. if it were that mod would exist right
i think there is a mod that does that
ive seen one that makes like a generator network
having a genny connect to a single building is pretty straightforward
you can't manually set a device as powered or connect it to a generator or anything, nor can you change the range of a generator
Hm maybe its just something I haven't stumbled on yet
Its just that a big component of a tech mod would almost have to be wiring of some form
so the "magic generator range" mechanic really gets in the way
using custom tiles for wiring would work well
i was working on something like that and it felt increasingly likely that it would be easier to just go around the vanilla power system entirely than try to work with it
but yah, you might run into some limits with the power-specific api
I'm already thinking about tiles heh.. pipe + wire = wire conduit
if thats the case then it would be fun to come up with some kind of pz-esque lore way to explain an alternate power system
i mean there are zombies you can add a lil sci fi
I'm not against this either.. I wonder if its possible to make lights and stuff work with no generator through some other hackery
force world shutoff lmao
if its like a year from now and somehow this idea takes off... sci fi from me is almost guaranteed.
you can do lights manually, my biggest concern was fridges
i think my plan was to also give up on the vanilla fridge system and revert the age of the food manually when it loads or whatever
i wrote my own scifi-horror lore for my weapon mod to explain why your weapons can set zombies on fire now
but burning zeds are even worse tha non-burning ones lol
but its fun!
it takes them about 3 years to finally burn to death and they set everything on fire lol
thats just one of the affixes, you could get knockback, or crit damage, or w.e else
i havent managed to fully burn down my base with one of the fire affixes yet
whats a couple burnt walls between friends
Make a special super shotgun. on kill, make them ragdoll and apply a backwards force of 9000
lmao yea probably will do that
just imagine them launching off the screen haha
i did add a stagger affix
forces zombie stagger on hit chance, pretty funny to see when you have a screwdriver
is there like a zombie:ragDollEnabled() ๐
Is it like diablo? "Lord's Screwdriver of Shanking"
I'd probably break them too fast haha
they repair when they awaken
thresholds are also scaled by Condition Lower Chance
so u can see a kitchen knife become badass ๐
Heh, do that and add level-ups that fully heal you (and remove zombie virus)
suddenly it's now an action rpg
hahah maybe one day shit, it is going very rpg
Can't wait for the new jetpack armor ^.^
Crimson Zomboid
That's the kinda mod you'd see privatelime make a mini series around
for sure
the Crazy RP servers basically do that without all the fun game-y rpg stuff
I think that's the mod that makes generators work for buildings
looks like it adds its own unique type of generator rather than change vanilla ones
actually looks like a GREAT mod heh
Yeah, and comments saying its outdated.. Well a proof of concept is good enough for me
ya for sure
Maybe I'll just ignore vanilla generators and do my own thing like he did
the thing is you can't 'just' do your own thing, you can't set a device to be powered
i'm not sure how this mod works but if there's vanilla power there is actually a real generator involved somewhere
i remember a couple mods that used invisible generators to power larger areas
i don't know if that's how they're doing this though, i feel like it'd be really obvious if it ended up powering the next door building too by coincidence
โฏ ls
drwxr-xr-x - prog 17 Apr 18:17 ๎ฟ 42
drwxr-xr-x - prog 17 Apr 18:17 ๎ฟ common
drwxr-xr-x - prog 17 Apr 18:17 ๎ฟ media
.rwxr-xr-x 2.7k prog 17 Apr 18:17 ๏
icon.png
.rwxr-xr-x 1.1k prog 17 Apr 18:17 ๏ฉ mod.info
.rwxr-xr-x 5.9k prog 17 Apr 18:17 ๏
preview.png
~/.local/share/Steam/steamapps/workshop/content/108600/3478628177/mods/UltimateGeneratorOverhaul
โฏ find . -maxdepth 5 -type f | sort
./42/icon.png
./42/mod.info
./42/preview.png
./common/media/light-switches.tiles
./common/media/lua/server/BuildingGenerator.lua
./common/media/lua/server/LightSensor.lua
./common/media/lua/server/ProximitySensor.lua
./common/media/lua/server/UtilsContextMenu.lua
./common/media/scripts/Lightswitch_Items.txt
./common/media/scripts/sounds_base.txt
./common/media/sound/activate-alarm.wav
./common/media/sound/activate-sensor.wav
./icon.png
./media/light-switches.tiles
./media/lua/server/BuildingGenerator.lua
./media/lua/server/LightSensor.lua
./media/lua/server/ProximitySensor.lua
./media/lua/server/TimedActions/GeneratorActivation.lua
./media/lua/server/TimedActions/GeneratorAddFuel.lua
./media/lua/server/TimedActions/GeneratorFix.lua
./media/lua/server/TimedActions/LightSensorToggle.lua
./media/lua/server/TimedActions/ProximitySensorActivation.lua
./media/lua/server/TimedActions/TimedActionExample.lua
./media/lua/server/UtilsContextMenu.lua
./media/scripts/Lightswitch_Items.txt
./media/scripts/sounds_base.txt
./media/sound/activate-alarm.wav
./media/sound/activate-sensor.wav
./mod.info
./preview.png
They can't hide how they're doing it from me ๐
Ok that mod is basically making fake generator source positions in every room of the building
i guess that trick lives on then
maybe.. last update about a year ago...
anyone know of any ios ports i have the game on pc but it would be good on mobile
Nah
The only project for a mobile port is Zomdroid
when custom animsets for custom animals :D

You can already work without these rn
wgat
Yea
Rideable horses mod for Project Zomboid. Contribute to PZ-HorseTeam/HorseMod development by creating an account on GitHub.
People that overwrite existing AnimSets are just stupid ๐
It has always been possible to not overwrite anything
Sorry this isn't mod development related but I was wondering if anyone can enlighten me on how the foraging system works now? I am looking at the game files and its mentioning forest etc, but in game I see organic forest, farmland forest and other such
Anyone here willing to test my Base Saver mod? (Lets you save/load buildings between save games/PZ versions, including container contents and floor items)
Assuming you mean B42? There are forage zones defined as a bunch of rectangles, circles, polygons and polylines. These all have a type. They can overlap and I'm honestly not sure how that works in practice. Go to https://b42map.com/ and overlays -> Foraging to see the zones.
That info is stored with the map.
Then lots of stuff in media/lua/shared/Foraging/ to control what is found where
does true here means anti cheat on or anti cheat off
confused cuz the comment says disables
so is that enabled or disabled
yes
I rmemeber being very confused but eventually figuring out the default was all off.
good thanks
Is there any kind of advanced logging mod out there for MP servers? Like if we had someone being sneaky and tossing molotovs into someone's base but weren't there to see it happen that we'd be able to check the logs for that kind of event and see "whodunit"
try check the log file like 2026-xx-xx_xx-xx_item.txt
None of that does anything
B42 PZ has no anticheat outside of lua checksum
no? since b41 when the character gain huge amount of XP in a short time, the game kick that player out of the server. I tot that is a kind of anti cheat.
btw many b42 mods suggest server owner to disable lua checksum, this is so bad for server management.
they where all removed for B42
there some leftover anticheat code but its... extremely under referenced and not actually used
Probably removing old stuff before implementing new stuff from scratch
My guess
I love this mod by @jagged fulcrum . Is there a way to make something similar where you can build it in the game like you can a hamm radio? Starting out it's a little OP but if you could level your skills it would be a useful tool for the more dangerous areas. Maybe make it so that it ticks up one of your important slots?
ok, shark gave me an idea. basically using muzzle flash fx for the explosion. how this looks?
Okayish i would say, if you take a look at escape from kentucky / modern firearms, it looks like this.
idk shit about guns, if you shoot a grenade launcher does it do a flash or an actual fiery explosion?
for me both of those work honestly, the zombies are already ragdolling my brain fills in the rest
shoot behind a building and tell me if you still see the explosion
function ISToggleGenerator:isValid()
if self.generator then
if not self.generator:isConnected() then return false end
return true
else
return false
end
end
What is so wrong about if not self.generator:isConnected() then return false end that the TimedActions keep saying bugged action??!
ah explosion is kinda like a big bullet impact to be honest
Grenades are crazy powerful and this is just an incident that regularly happens everywhere (in every military) -- however! Looks like it happens more in China. They dug specific Grenade trenches for it and they both get up and carry on like it's "no biggie".
The smoke stream coming from the grenade is the fuse cooking off (4 seconds). It's...
yea its visible
thats why im taking the approach of a 3d object instead
what mod is that ? never seen it
ppl love that one, modern firearm systems
I'm tryna get homie to add compatibility for my mod cuz ppl ask about it so much
yea its that one, but iam using my private version, since that guy just copy pasted my stuff to fix his mod ๐
i feel like thats gonna happen regardless
all kinds of 3d models in that mf
2.5 gb? miss me with that dawgs
i mean its not my kinda mod ๐
i feel like if you want that kinda gun experience go play Arma or DayZ lmao
still got 40k subs tho ๐คฃ
maybe im im concern about keeping stuff optimized in line with the game
that when I see a 2gb mod its an automatic no for me
almost like AI thumbnails lol
one day you wont be able to tell the difference ๐คท
on what
ai thumbnails
if or not they will be like that in the future, there is no workaround that currently, they look like absolute shit without soul
its cool to feel strongly about this, i do not
nothing to do with my intelligence, just feel its a overhyped technology
people said that about the internet too
and cars, and electricity...
seems silly in hindsight
Hi, can someone tell me the prerequisites for taking/placing lightswitches in B42 ? I am not able to take them with the moveable take option (lvl 10 electrical).
i thought that only took 6 -- could be a mod im using tho
(edited)
Picking up light switches was removed recently
Had to update https://steamcommunity.com/sharedfiles/filedetails/?id=3409684284 because of it
Can you give us some more context? Is that a vanilla thing breaking, or something you added?
Also, if you havn't already confirmed exactly why it's invalid add some print statements to find if if self.generator is nil or self.generator is a thing but self.generator:isConnected() is returning false
not just about :isValid() TimedAction should come with a set of functions
and?
saw the meme opportunity
finally getting around to fixing my mod for 42.16
require 'recipecode'
function Recipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function Recipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end```
and i look back on this code after getting two exceptions from it
im thinking about scrapping it altogether, on one hand im not sure if it even works at all, but removing it could cause more issues with the mod since some craftrecipes rely on it for checking the condition of items from when they were packaged
๐
It should work, the main problem is that you are trying to store the function in a table that no longer exists
You need to store this in your own global module or in a global function
You don't have to use anything of the base game here
The function just needs to be accessible globally
alright, so just declare a global function
it was craftRecipeData that was removed, correct?
I don't think so no ?
or player
i might be looking at the wrong thing
what were you talking about here?
ah crap
Store it in your own global table or just in a global function
require 'recipecode'
global function boxMoreRecipe = {
}
function boxMoreRecipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function boxMoreRecipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end```
i just added global function boxMoreRecipe = {} and then replaced Recipe with the former, thanks simkdt
im gonna check on the craftrecipes to see if i need to fix anything there, this is what it looks like during debug. img 1 is before packaging, img 2 is after unpackaging
craftRecipe OpenBoxOfCrowbars
{
timedAction = OpenAmmoBox,
Time = 60,
Tags = InHandCraft;CanBeDoneInDark,
category = Packing,
OnCreate = ConditionInheriter.FromConditionInheriter,
inputs
{
item 1 [Base.BoxOfCrowbars] flags[Prop2],
}
outputs
{
item 6 Base.Crowbar,
}
}
craftRecipe PackBoxOfCrowbars
{
timedAction = PlaceAmmoInBox,
Time = 60,
Tags = InHandCraft;CanBeDoneInDark,
category = Packing,
OnCreate = ConditionInheriter.ToConditionInheriter,
inputs
{
item 6 [Base.Crowbar;Base.CrowbarForged] flags[Prop2],
}
outputs
{
item 1 Base.BoxOfCrowbars,
}
}```
i'm not seeing anything inherently wrong on the craftRecipe side?
your functions are called boxMoreRecipe.OnCreate.FromConditionInheriter etc but you're referencing them as ConditionInheriter.FromConditionInheriter
Where did you even get that from ? ๐
That global keyword isn't a thing ?
it isnt?
then how should i implement a global function?
i removed the global keyword and added boxMoreRecipe to the craftrecipe oncreate reference
i performed the same test to the same result, the worn crowbars are still converted to full condition rather than some of the crowbars having their original condition
Also that's still wrong
Bcs you're trying to add the function to a table inside the global table boxMoreRecipe
But that sub table doesn't exist
You need to read that Lua language wiki page and learn a bit about the language because here you are confusing yourself, wrongly assuming how things work
A table can hold key values combination
When you do
tbl.var = ...
It stores whatever ... is in the key var of tbl
So if you do
tbl.sub.var = ...
You try to store var key with value ... inside a table sub which is inside a table tab
should i reference the table as boxMoreRecipe = {} then?
so in turn when i run the to/fromconditioninheriter functions it does have a table to reference?
thank you, i have been referencing it but my understanding can be limited
doing this produced another exception, console said it was trying to index a non-table so im implementing it wrong again
wdym ?
in the tables section on the lua language page the example is structured similarly
You have to show what you did here
require 'recipecode'
boxMoreRecipe = {}
function boxMoreRecipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function boxMoreRecipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end```
ive got this at the moment
i can get the memo here but im unsure how to implement it with what i have
You STILL are trying to put shit in OnCreate
That doesn't exist
Read what I just explained above
tbl.sub.var = ...
You can't do that, because sub isn't a thing in that table
OH SO THATS WHAT YOU MEANT
so replace oncreate with my own subtable?
require 'recipecode'
boxMoreRecipe.bmOnCreate = {}
function boxMoreRecipe.bmOnCreate.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function boxMoreRecipe.bmOnCreate.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end```
You literally don't need a subtable
But now you don't define boxMoreRecipe anywhere
Just put that freaking function in the main table ๐
i removed the subtable
put the functions inside of the boxMoreRecipe table?
See this
I guess the way you write the functions makes it unclear
function tbl.var()
...
end
Stores a function in var key of tbl
It's the same as
tbl.var = function()
...
end
ah,
require 'recipecode'
boxMoreRecipe = {}
function boxMoreRecipe.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function boxMoreRecipe.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end```
so more like this?
/\
so bring that back
Do you understand what boxMoreRecipe is here ?
its defined as a table?
It's a table, so if you don't create that table, it won't create itself
ah, alright
ill test it again
thank you for your help so far especially with my misunderstandings, i really appreciate it
Sorry I haven't been too patient here
no worries, i'd be mad too if i had to explain something over and over
still doing this, i had all the conditions set differently and it did not replicate after packaging. there was 1 discrepency in craftrecipe ill adjust in a moment
alright its working perfectly after the adjustment
through some miracle spiffo has spared me from debugging any further
should I make RAF have a spread calculator to make automatic fire more unforgiving?
i know the translation files updated to json, but now im struggling to get craftrecipes to have their proper display names ingame. the regular names of the items are fine, but craftrecipes have no spaces
is there something im doing wrong? they're in their proper folders, and its in UTF-8.
Also recipes need to be referenced with the module no ?
i think they removed that aswell based off the game files
worked thanks
alright, its working great in SP, i tried to run it on a self hosted MP server and none of my items are there
is there anything i have to do from a mod-perspective on updating to be MP-compatible?
Are they in a custom module ?
im not sure what you mean by that; the items are stored in scripts under Box more!\Contents\mods\Box more!\42\media\scripts
both items and craftrecipes
oh
no they arent in a custom module
does this mean i cant have a custom module here
Wellll, that might just be the other way around idk
Try using a custom module if they don't appear
I remember some weird ass issues about that
so i did that, replaced all base. with BoxMore.
problem, now im getting this exception from one of my submods
local script = "{ inputs { item 1200 [Base.BlowTorch] mode:destroy flags[Prop2],} }"
local recipe = getScriptManager():getCraftRecipe("PackBoxOfWeldingTorches")
recipe:getInputs():clear()
recipe:Load("PackBoxOfWeldingTorches", script)```
this is the script for the submod, its supposed to replace part of a recipe with that script
nevermind, i had to specify the module
You said the item doesn't appear
Does it appear now ?
ill check in mp in a second, there are some other issues to address after moving modules
particularly translation again, its having the same no spaces error
You always should reference other blocks by their full type
and im pretty sure i have to specify the module somewhere
No spaces ?
Ok man you're throwing way too many different information that seem unrelated
We told you that translation files need to have a very specific naming, and that the Recipe prefix should not be there on keys
its just recipes.json
and its under the EN folder
I mean it's clearly not, the file you sent is named p21h4ms
ah
i forgot to turn that off
Also it's Recipes, not recipes
its an anonymous file name thing
Ah bruh
the Recipe_?
Yes
i got it running in MP after an hour
debug mode on, all mods and some dependencies working
problem, it works perfectly in SP but in multiplayer, craftrecipes do not output
The recipes need to be in the Base module
One day they'll fix that shit don't worry ๐
Does anyone know what IsoObject subclass 'water dispencers' are?
IsoObject
.. how is it special from other isoObjects/how do I spawn one?
(when I copy a tile containing one, I get a water dispencer I can.. walk through and not interact with)
probably forgetting to serialise components
what are those stored in?
I see a getGameEntityType() of isoObject.. though no idea how to set that/spawn a certain type...
Yea.. Im confused how to create anything but a very generic isoObject like a wall or floor.
Currently using IsoObject.new(isoCell, IsoGridSquare, IsoSprite)
(Aside from when its a derived class like IsoBarbecue or IsoClothingDryer or whatever)
they aren't using subclasses for new features, it's a fairly outdated way of doing things
they're using components instead
isoobjects and a couple other things are gameentities which hold components
Yea but whats the function to add/get components?
oh, its from GameEntity parent class?
I was looking at IsoObject's functions -_-; keep forgeting to use firefox search instead of the top left search bar
Now to figure out how to seralize components to text and back..
Hu.. tons of things have components...
reduces scan area
Looks like water dispencers have 5..
most have a few, and the number will continue to increase
legacy features will eventually be replaced with components as needed
looks at SpriteConfig... absolutely no setters, no constructor...
EntityScriptInfo at least has a setter...
kinda guessing seralizing the components is the wrong way to go about this...
Since I doubt I can use the vanilla load/save functions to save to a file...
sigh... depressing.
I have literally no idea how to create a non default entity... function ISMoveableSpriteProps:placeMoveableInternal( _square, _item, _spriteName ) that iv been using for other types doesn't seem to mention it at all..
oh.. hmm...
if obj and not _item:hasComponents() then GameEntityFactory.CreateIsoEntityFromCellLoading(obj) end GameEntityFactory.TransferComponents(_item, obj);
movable isoobject entities just get turned into an item entity with the same components and vice versa
GameEntityFactory at least seems useful
yeah
local f = ComponentType.FluidContainer:CreateComponent(); f:setCapacity(5.0); f:addFluid(FluidType.Water, 5.0); GameEntityFactory.AddComponent(o, true, f);
i've used that for a couple things but i don't know if it'll help you create components that don't have setters or constructors
is something...
I mean.. LUA lets you place things.. so I assume at some point LUA has to let you create (most) of these..
no, because lua just transfers the components from the item
... doh.
Hmmm... GameEntityFactory.CreateIsoObjectEntity(thumpable, script, true) and GameEntityFactory.CreateInventoryItemEntity(item, this, isFirstTimeCreated); seems relevaant...
Hu, the 2nd is in public InventoryItem InstanceItem(String param, boolean isFirstTimeCreated) {
all objects and items are entities
Yea.. Im wondering if I can create the inventory item and transfer its components over... or if CreateIsoObjectEntity just makes a generic 'as spawned' version.. (I care little about copying the entity data, just creating an valid, usable entity)
ie, if you lose your leather on your drying rack, TOUGH. But id like the drying rack to at least accept new leather.
i think i've used CreateIsoEntityFromCellLoading to spawn entities from a sprite
Lets try that then.
Hey that seems to have given me a functional, random fluid level water dispencer. thanks
(I think fluidComponent is the only accessable one anyway lol)
Thanks.. that entity stuff was starting to depress me after all the work I put into this -_-
Wish I knew how to animate, cuz hema/other sword martial arts animations for being higher level long blade skill would be fantastic
Yea I just never looked at the gameEntity class before
lol at random function I found: getCloudColorReddish
reddish, lol.
also, You can safely assume there is a greenish and blueish... but.... getCloudColorPurplish .. wut?
since when do we have 4 primary colors?
also, wut: setKateBobStormCoords
Now to figure out what makes shelfs appear 'full' when you add items to them
function ISPaintSignAction:complete() if self.wall:getProperties():has("WallW") then self.sign = self.sign + 8 end self.wall:setOverlaySprite("constructedobjects_signs_01_" .. self.sign, self.r or 1.0, self.g or 1.0, self.b or 1.0, 1)
TIL painting signs is a thing?
Iv literally never tried painting walls because I quickly decided there was far too mainy paint colors for me to find enough paint of the same color -_-
plus I didn't want to have to find MORE paint if a zombie ever smashed stuff
the whole plaster walls things too was like.. yea im not doing that
(didn't help that only time I built my own base was in B41 where there was massive issues with base building/lighting/etc)
what are GLB files for models
I miss the mod that let you spraypaint random stuff on roads.
(pretty sure it wasn't updated..)
Not asa needed anymore with minimap showing symbols but... I still liked it
Now just how to figure out if a cell is close enough that it should exist/be loaded...
(game doesn't like it when I try to load a base that is far off in neverneverland)
Quick google suggests 100 tiles in every direction. good enough for me
.. Ok, not 100.. more like... 80 or something. Guess that was B41 or something
Easy: try to get a square, if it's nil then it's not loaded.
local square = getSquare(x, y, z)
if square then
do(stuff) -- the square is available in the active region around the player
More reliable than using distance from the player, since you don't have to guess if the loaded area size has been changed or is trying to catch up due to movement etc.
I guess that'd work if I set the Z level to 0
but nil cells also show up in mid air
true, but like you say just use z=0
and that will work until we get actual 3D ground.
yea
Sim City 2000 did this 33 years ago.
Shame, I want a bunker with an underground parking lot -_-;
tikitown has a police station with underground parking, iam not gonna spoil you whats beneath the garagedoor ramp there ;o
Ahh map mod? Cool that someone is using them!
LOL at the lighting on them, I can see they haven't tested them in awhile
inb4 my basesaver mod explodes trying to save/load them
Damn, Now I really want that area as a base
yea the hanging lamps dont seem to work atm in that underground parking
that looks so much cooler then the moudrough police station (however you spell that)
many
Neat
They have a few issues.... https://www.reddit.com/r/projectzomboid/comments/1k7nk4u/more_fun_with_b42_ramps_and_the_laws_of_physics/
The problem isn't the ramp tho
It is kinda partly the ramp's fault for being at such an angle and not smooth tbf
Uh ? The problem is that water tiles can't handle things being on it, that's it
The angle is fine
It wasn't made clear, but I meant just in general, the approach and exit angle is sharp. It's possible to get a car stuck at the top.
Yes but now my question to you is: who would take such a ramp with that speed ?
Of course you wouldn't, because those ramps are not meant for that, those are garage ramps where you take a slow approach
But the way these objects are implemented, literally allows you to make ramps with smoother angles, that's completely possible
That's not a problem with ramps, that's just how the ramp is, you wouldn't take a ramp with such speed in real life unless you didn't give a shit about breaking something on your car
Basically that, yeah. I'm interested in them fixing vehicle physics and slightly adjusting the ramp angle a little
No but again the angle is completely fine ๐
Currently those are concept objects in the game and are not utilized at all, so they don't provide other options because those are not used, that's it
Nothing is stopping them from adding ramps with a curved entry
Same as nothing is stopping you from doing that too
I disagree
this ramp stuff is also accessible for vehicles, you can use the mesh for vehicle physics boundarys, not rly sure why xD
Why that ? Have you never seen such ramps on the road lol ? Those are not uncommon in France, but you just don't find them directly on major roads where you are at high speed, those can be present in cities that's a bit vertical, or even worse if you have an underground garage
Those ramps are not abnormal, but of course you wouldn't find them on your main roads, that's normal
Wdym ? Like attached to the vehicle ? How does that work ?
yea instead of box or sphere you can use mesh, but only presets from indiestone, havent played around with it much
Interesting, I wonder how they handle that because from my memory in the code it only handles it as a rectangle ? Unless that's very very new
Also I didn't knew your vehicle could be a sphere ?
they also kinda sneakily introduced useChassisPhysicsCollision = false, just found it by chance
Chassis refers to the main vehicle structure I suppose ?
you use the physic boxes you have declared for impact and collision and not physicschassisshape you declared
Aah I see, I'm not too aware of how vehicles are created in the game
It's weird that those are different tho no ? The impact/collision in comparison with the physics chassis ?
I'll try to add that in the scripts docs
There's a huge lack of doc about vehicle scripts rn
well the physicschassisshape is just one big box, if you use it, the zombie will react as it had hit a wall, but with a real hood shape it will plant face first on it, so it kinda interacts better
just a parameter
Takes an array of width length height ?
ah i thought you meant the other physicsChassisShape = 1.9130 1.9826 8.3304,
Yea ok that's an array
I'll add those to the docs
So to sum it up
- physicsChassisShape is a rectangle hitbox of the vehicle
- if you set useChassisPhysicsCollision to false, it will no longer use physicsChassisShape and replace it with the impact/collision boxes, which are the rectangles on your image right ?
I assume it is
physicsChassisShape = height width length,
``` ?
yea when false it will use the physics box you declared
physics boxes are blocks in the vehicle script or parameters ?
{
offset = 0.0000 1.9185 1.6870,
extents = 1.7826 2.1043 2.7913,
rotate = 0.0000 0.0000 0.0000,
}```
I see, so that id of this block, box, needs to be one of the available geometries ? So a box, or a sphere like you mentioned before, or I guess those ramp objects for some reasons ?
yea its box, sphere and mesh
Ah mesh, so does it take different parameters in that block if you use the id mesh ? Or did you mean "mesh" as in the name of the physics shape ?
Is it related to that
physicsShape ramp20segment4w
{
mesh = physics/ramp20|Segment4,
translate = 3.0 0.0 0.0,
rotate = 0.0 270.0 0.0,
}
cant say for sure but should be physics mesh { mesh = physics/ramp20|Segment4, translate = 3.0 0.0 0.0, rotate = 0.0 270.0 0.0, }
i dont have debug on to test atm XD
No worries, I'll add those info to the docs, and they can be refined
There's no example of mesh being used in the vanilla files so I can't really base myself on what the game provides rn
i did reset my pc yesterday, now the stupid windows snippet tool on print is not saving it -.-"
Join us, move to Linux 
{
offset = 0.0000 0.0000 0.0000,
rotate = 0.0000 0.0000 0.0000,
physicsShapeScript = Base.ramp10segment1n,
scale = 0.8772,
}```
hell no ^^
And yet, it works so much better :3
physicsShapeScript, ok interesting, so it does refer to the physicsShape block
btw anyone knows whats up with the Curtains on windows, when pressing shift+e its always intercting twice on the first try
super annoying ^^
shift + E ? What does that do ?
Ok lmao bcs I was going to tell you to join Linux again 
quick action for interacting with the curtains
on vehicles you automaticaly move to driver seat when entering it from any other seat
I had no idea there were alternative interaction keybinds
@knotty stone what's the zombieType parameter of the vehicle scripts? Does that define like a zombie which can spawn next to the vehicle ?
vehicle VanSpiffo
{
zombieType = Waiter_Spiffo,
sounds reasonable, no clue ๐
๐
have let ai run to decompile
zombieType is a list of zombie outfit names for the vehicle. It is used to spawn appropriate zombies in specific vehicle scenarios and to determine which zombies are considered legitimate key holders for the vehicle so it rly sounds reasonable
That's by making AI parse the Java right ?
yea, it was pretty accurate in its findings there ๐
Sounds likely
@knotty stone have you ever used the frontEndHealth parameter ?
Because that parameter can't work, since the parser uses frontEndDurability 
} else if ("frontEndDurability".equals(k)) {
this.frontEndHealth = Integer.parseInt(v);
vanilla vehicles still use frontEndHealth 
would explain why changing it never rly mattered
Yeaa that parameter isn't parsed ๐
but i rly dont know what it rly does since every vehicle part has its own durability
That idk

I did not understand what it just said
yea its kinda strange
its kinda a buffer on how much damage your vehicle parts get
or lets say crash resistant the front/rear is
this.frontEndHealth = Integer.parseInt(v);
continue;
}``` ๐ isnt that what it said in the first picture about the legacy frontEndDurability still accepted.
Like I said, the parameter frontEndDurability is parsed, but frontEndHealth which is what is used in the game scripts actually doesn't get parsed
So they were supposed to use frontEndDurability but instead they use frontEndHealth, which does nothing because that parameter isn't parsed and so it uses the default value 100.0
ah right
Here's the doc I just wrote about that
- name: rearEndDurability
type: integer
default: 100
description: |-
It is unclear what that parameter does but as of 42.16.3, the game uses `rearEndHealth` which is a mistake.
- name: rearEndHealth
deprecated:
description: While that parameter is present in vanilla scripts as of 42.16.3, it actually does nothing because it is not parsed as `rearEndHealth` but as `rearEndDurability`.
replacedBy: rearEndDurability
That would explain why some people are noticing their trunks taking more damage than expected lol
isnt that a multiplayer bug where it multiplies the damage by the people in proximity?
iam rly not good at it but when i look at the java it should work as intended?
this.rearEndDurability = Math.min(this.rearEndDurability, this.script.getRearEndHealth());
this.currentFrontEndDurability = this.frontEndDurability;```
``` private void addDamageFront(int dmg) {
if (this.isDriverGodMode()) {
return;
}
this.currentFrontEndDurability -= dmg;
VehiclePart part = this.getPartById("EngineDoor");
if (part != null && part.getInventoryItem() != null) {
part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
}
if ((part == null || part.getInventoryItem() == null || part.getCondition() < 25) && (part = this.getPartById("Engine")) != null) {
part.damage(Rand.Next((int)Math.max(1, dmg - 3), (int)(dmg + 3)));
}
if ((part = this.getPartById("Windshield")) != null && part.getInventoryItem() != null) {
part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
}
if (Rand.Next((int)4) == 0) {
part = this.getPartById("DoorFrontLeft");
if (part != null && part.getInventoryItem() != null) {
part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
}
if ((part = this.getPartById("WindowFrontLeft")) != null && part.getInventoryItem() != null) {
part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
...```
Never heard of that, but there were a few posts on what I said, never looked into it
This, albeit a little too vague, is basically true, just to confirm.
But corpses spawned inside the vehicle are still completely random, unfortunately.
That's good to know, I didn't remember if the corpses spawning in vehicles was from mods lol
It's super super rare
Usually just in trunks or ambulances as well.
Added a huge amount of docs to parameters of the vehicle script block and subblocks
https://sirdoggyjvla.github.io/pz-scripts-data/blocks/vehicle.html
engineForce is 10x what is displayed in the car mechanic menu for 'horsepower'
lol at frontEndDurability
isSmallVehicle never knew that was a thing.
mass might wanna add something like 'values in excess of 1400 can cause vehicle wheels to start sinking into the ground and be unable to move'
(the heavest vanilla cars are 1400 and they already have problems with wheels sinking into the ground when you turn at high speed)
lol
offRoadEfficiency affects horsepower reduction when offroad (Higher = less horsepower reduction when offroad)
I'm including ModData to synchronize data server wide. Any tips on how to troubleshoot solo?
playerDamageProtection Love how that variable suggests that higher values would be less damage but its actually the opposite (just checked code, your description is correct)
steeringClamp is the max angle you can turn the front wheels left/right
stoppingMovementForce is a drag factor applied to the vehicle at all times
You know you can contribute to these docs right ?
Yea but then id need to make an account and shit.
A GitHub account ?
i have github i can get on there and add in what he's doing
shrugs don't think I have one
wheelFriction is 1.2 to 1.9 for all vanilla vehicles and controls turning and stopping (but not acceleration) tire friction limits, with 1.4 being the most common. Values over 1.8 can cause vehicles to flip in sharp turns. (Likely depends somewhat on center of mass)
Why don't you have a GitHub account ?
Iv never githubed anything?
do I look like a professional developer or something?
Maybe that's the time to start then, it would make my life so much easier and that's a skill you can learn
I'm not a professional dev
shrugs
I started using GitHub for personal projects
Oh, 'wheelfriction' for trailers is 4.0. I dunno why, kinda dumb.
(also why horsetrailer likes to flip)
i forked it, ill send a pull soon
Just thought id give some info. Too lazy to do more.
Thx !
do i have to add the |- in front of the description
That yaml syntax
Basically when you add that, you put the text on the line after and you can use newlines in the string
If you don't do that, newlines don't work
alright, so add |-, enter and then tab
I suggest downloading red hat's extension for YAML on VSCode
ill look at it
Hu, TIL your more likely to get broken glass injuries on impact in a car if your vehicles windows are <15% condition (But not if they are missing entirely(?))
(see public void addRandomDamageFromCrash(IsoGameCharacter chr, float damage) in BaseVehicle.java for details)
sent the pull
I'll check it out a bit later
on another note
ive been looking at some of my other mods, they still work perfectly item-wise but ive found that a custom foraging category i made doesnt display
i was thinking i might need a separate foragecategories.lua file
it runs the file, i checked it through console
You likely just need to add to whatever global table is in that file
thats what its supposed to do
Game runs all .lua files in \lua
its in \42\media\lua\shared\Foraging
i compared it with base game files, the only discrepancy i found is that it doesnt seem like you add both categories and definitions in the same lua script
so im thinking of separating them
PS iirc, there is still(?) a bug where foraging doesn't work for items that arnt in the base. module space.
so make sure to test that if your not using base.
im not using base here, and i cant use base or else MP stops working too
Im saying for the items in your mod itself.
And you can use base., your just not supposed to.
(but I always use base. because far too much stuff breaks if you don't)
since TIS never tests non base module stuff -_-
i had it using base on another mod of mine but its still currently bugged in MP
i can see why you used it because theres not as many problems with base
Hell, last I checked you can't even craft items in MP if the output (or was it the recipe itself?) wasn't in base.
recipes have to be base
thats what i found
so im guessing i literally cannot use any of my items because they're from a non base. module
distributions still work fine afaik
because lootzed still showed the items on some corpses
yea pretty sure distributions work with non base items. Maybe foraging has been fixed? Just saying make sure you test it and it works properly before going through all the effort of adding all your items
(add some item with super high frequency and see if you can find it properly spawning)
also add some base item with super high frequency so you can confirm if its base or your code
alright it still works fine
yurp
ill just wait until someone finds a workaround they can sneak in
works in mp too
we good
@cinder storm sent a review, don't change all description string entries to multi line
got it
While that isn't anything bad, it adds noise to the reviews
only a couple of them
so if i remove IGUI_ would that screw me over
yes that would not work
iirc just recipe names and item names
those never get added to the main translation lists in the first place, they're stored separately, so the prefixes were pointless
basically if it's something you would use getText() for, the prefix will definitely still be needed
anyone can help me with this ? im trying to add a custom sword to the game but keep getting that faild Assetpath. B41 btw
module MyCustomWeapon {
imports {
Base
}
item CustomSword {
HitSound = KatanaHit,
ImpactSound = KatanaHit,
SwingSound = KatanaSwing,
AttachmentType = BigWeapon,
BaseSpeed = 1,
BreakSound = KatanaBreak,
Categories = LongBlade,
ConditionLowerChanceOneIn = 333,
ConditionMax = 100,
CritDmgMultiplier = 14,
CriticalChance = 28,
DamageCategory = Slash,
DamageMakeHole = TRUE,
DisplayCategory = Weapon,
DisplayName = Custom Sword,
DoorDamage = 8,
DoorHitSound = KatanaHit,
HitAngleMod = -30,
HitFloorSound = KatanaHit,
Icon = CustomSwordIcon,
KnockBackOnNoDeath = TRUE,
KnockdownMod = 0,
MaxDamage = 16,
MaxHitCount = 3,
MaxRange = 1.4,
MinAngle = 0.8,
MinDamage = 8,
MinimumSwingTime = 3,
MinRange = 0.61,
PushBackMod = 0.5,
RunAnim = Run_Weapon2,
SubCategory = Swinging,
SwingAmountBeforeImpact = 0.02,
SwingAnim = Bat,
SwingTime = 3,
TreeDamage = 1,
TwoHandWeapon = TRUE,
Type = Weapon,
WeaponLength = 0.4,
WeaponSprite = CustomSword,
Weight = 1.4,
Tooltip = Custom Sword...
}
model CustomSword
{
mesh = weapons/2handed/CustomSword,
texture = weapons/2handed/CustomSword,
}
Where did you put your model
nvm you just sent it
Make sure you properly exported the model
Try to load it back into Blender
Ah wait
The problem is WeaponSprite
You need to reference the model by its full type
So module.id
this is my first time. so where should i add that
WeaponSprite
You need to change the module.id ....
To your model
I suggest you go read that
https://pzwiki.net/wiki/Scripts#ID
Thanks bro it's working
now the weapon is working but still invisible do u think its a problme with scale ?
@bright fog
Where's your texture located ?
Zomboid\mods\Custom Sword Mod\media\textures\weapons\2handed
What format is it
PNG
Did you fully reload the game after doing your edits ?
Place the item on the floor and play with the scale value, both dividing by 10 or multiplying by 10, multiple times
u mean relog from the game ?
Relaunch the game
thanks again bro u are a life saver
any reference anywhere on how the loot distribution works for placed items like these?
it doesn't
this is just a hardcoded event
there's no modding it, and i think the 42.17 blog post said they're even taking it out in that patch?
Yes
Wait really ?
What!
Unless they are taking it out to rework Random Stories to be lua-available
Like this request: #mod_portal message
I sure hope so. a Lua passthrough would be gold.
I thought about how it could be done as a lua mod and it's feasible to make a framework for "specific building changes" but a lot harder to do one for random building changes (or at least I could not see any way to do so neatly)
I mean you just do the specific building changes but then add calls to random to see if you do it or not.
But a LUA callthrough for stories would work so much better.
and only cost 0.00001% FPS
(im sure onCreate callthrough alone costs 50x more)
(ie, leave everything in java, but call the java functions through Lua like how onCreate is done now, so that Lua can easily intercept the calls if desired)
Honestly it probably should.
Niceee. Does the bayonet take cond damage?
I realized recently that attachments are full on items stored in the gun. I always assumed it was just some metadata stored.
The lost art of combination melee/ranged has been rediscovered!
One step closer to Warhammer: 1993
anyone can help me with this issue ? was everything good until i got that wrong rotation on the ground
I assume you're using the same model for wapon and world item, so look at the world attachment point.
You might need to start a new test game after adjusting because I had issues working on a similar problem and it urned out teh save was somehow storing attachment info but only sometimes.
{
imports {
Base
}
item CustomSword {
HitSound = KatanaHit,
ImpactSound = KatanaHit,
SwingSound = KatanaSwing,
AttachmentType = BigWeapon,
BaseSpeed = 1,
BreakSound = KatanaBreak,
Categories = LongBlade,
ConditionLowerChanceOneIn = 333,
ConditionMax = 100,
CritDmgMultiplier = 14,
CriticalChance = 28,
DamageCategory = Slash,
DamageMakeHole = TRUE,
DisplayCategory = Weapon,
DisplayName = Custom Sword,
DoorDamage = 8,
DoorHitSound = KatanaHit,
HitAngleMod = -30,
HitFloorSound = KatanaHit,
Icon = CustomSword,
KnockBackOnNoDeath = TRUE,
KnockdownMod = 0,
MaxDamage = 16,
MaxHitCount = 3,
MaxRange = 1.4,
MinAngle = 0.8,
MinDamage = 8,
MinimumSwingTime = 3,
MinRange = 0.61,
PushBackMod = 0.5,
RunAnim = Run_Weapon2,
SubCategory = Swinging,
SwingAmountBeforeImpact = 0.02,
SwingAnim = Bat,
SwingTime = 3,
TreeDamage = 1,
TwoHandWeapon = TRUE,
Type = Weapon,
WeaponLength = 0.4,
WeaponSprite = CustomWeapon.CustomSword,
StaticModel = CustomSword,
WorldStaticModel = CustomSword,
Weight = 1.4,
Tooltip = Custom Sword...
}
model CustomSword
{
mesh = weapons/2handed/CustomSword,
texture = weapons/2handed/CustomSword,
}
}
i did that
i had no idea
model Sword
{
mesh = weapons/1handed/Sword_SingleEdge_Hand,
texture = weapons/1handed/Sword_SingleEdge,
attachment Bip01_Prop2
{
offset = -0.013 0.0001 0.0025,
rotate = -23.8537 -86.6222 -22.0887,
}
attachment world
{
offset = -0.0105 0.0002 0.0,
rotate = 0.0 0.0 -1.0335,
}
}
note the two attachmentt defs in a vanilla sword
One is (I think) when the model is used as a prop, like crafting with things in your hands.
And the other for when it's placed in the world.
the world stuff here is almost "no change at all" but maybe you need something else for your model, or maybe you didn't have it perfect w/rotation and transforms on export.
Two ways to start fixing: add a world attachment and change the world parameters by 90 at random until it works
or try add world attachment and try the attachment editor.
Or just copypaste the vanilla sword and that might work.
i'll try this thanks
Next up, the gunsword! (hopefully not the really dumb final fantasy one that doesn't actually shoot things but just... uhhh... vibrates?)
Worst gunsword ever.
@silent zealot ๐ซก ๐ซก
that axes finish hurts my knifemaker soul.
(the sanding lines not being aligned, mainly)
.. and looking like it was finished with a 40~60 grit
ahh... thats better...
Agents of Shield was fun, but not known for their high level of attention to realistic prop details.
And that is a badly balanced shotgun with an impossible to hold properly axe.
this would be cool to have as a faction weapon
standard issue custom made axe shotgun
good for zeds, better at destroying bandits
that way you dont have to carry both a hatchet in your belt and your gun on your back
implementing it in zomboid though sounds like a pain
since im a baby who hates injuries, i was wondering if there was a way for me to change settings in the files that would allow me to suture closed lacerations and bites. I have transmission turned off because i have yet to even make it a full week
Oh wow it would be so cool for someone to make it into an attachment that you can swap between.
Too bad nobody has ever done that before
Nope.
I think you could make a mod to do it, but it would not be straightforward; you'd have to redo the medical GUI stuff to allow suturing, probably redo the timed action, then have something running on a timer event to manage healing since vanilla healing won't heal those faster because of suturing...
Better option for learning is transmission off (already done!) and disinfect/bandage. And turn down the starting zombie population.
I know when I was learning injuries from a fight I survived were never the real problem, it was dying during the fight as zombies tore me apart.
java.lang.RuntimeException: attempted index: getAmount of non-table: zombie.entity.components.fluids.FluidInstance@2298d705 at KahluaThread.tableget(KahluaThread.java:1441).
... did.. did they unexpose FluidInstance?
local fluidComp = object:getFluidContainer();
if fluidComp then
local fluidSample = fluidComp:createFluidSample();
for x = 0, fluidSample:size()-1 do
local fluid = fluidSample:getFluidInstance(x)
print("Amount " .. fluid:getAmount());
Im sure that used to be exposed...
I guess fluidComp:getSpecificFluidAmount(fluid) works.. just annoying.
It's private now. At least for FluidContainer.. looks public for FluidSample
Yea I was taking it from the fluid sample, I believe that error of 'non-table' means that fluidInstance isn't exposed at all
today, on amazingly cursed looking code:
for index,value in ipairs(fluidTable) do
local it = string.gmatch(value,"[^|]+");
fluidContainer:addFluid(it(),it());
end
My cursed code of the day is logging a change ticket using sed instead of a dozen lines describing what to edit in a file.
sed -i -e 's/\(internalProxies.*\)44\158/' /usr/local/apache-tomcat/conf/server.xml
I'm almost certain I'll get told there is a mistake and it's meant to be 58, not 158.
lol.
...I also just updated a ticket with
tomcat log rotation is not doing what it should be doing and I am still shouting "YOU HAVE ONE JOB!" at it while pointing at unrotated logs.
...so it's probably time for a break.
lol
My fav was finding some comments about how good pizza was after a night of drunk coding.
object:getFluidContainer():removeFluid();
object:getFluidContainer():addFluid("Water",15);
Anyone have any ideas why this is not adding water to a waterDispencer object?
(the removeFluid seems to work fine..)
Without removeFluid I get a dispencer with RNG amount of water, with it I get 0 water
object:getFluidContainer():addFluid(FluidType.Tea,10); also results in 0 fluids...
... grrr obscure wtf thingy silently preventing addfluid from working: object:getFluidContainer():setInputLocked(...)
Dunno why that would just break the addFluid API instead of being a UI only thing -_-
doggos with non-zomboid skeleton and anims not made for zomboid 
Is it possible to hijack the 'heating' mechanic in a feasible way for my own scripts? For example, instead of heat, it's a crafting process bar, and if it turns into 'burned', I can change the item myself. For like Passive Crafing?
I'm sure that's possible (definitely with Java modding), I'm just wondering why not use the heating mechanic, and set the "burned" version of your item to be replaced by the new item? I mean, I don't specifically understand how you would heat up a players inventory in the first place either? but maybe I'm just misunderstanding your message
now you can use knifes as bayonets if they are registered with system
yeah. Thats my only issue tbh. I just wanted something to help especially when i have currently have a bite on my neck
Yes there is ReplaceOnCooked IIRC
You can also do ReplaceOnRotten (used for the disabled sugar recipe thing)
Combining the two, you can have something like: "Must be cooked, and then it has to 'sit' for some amount of time to become the final thing"
Exactly how I remember brewing mods in Rimworld working for some drinks
(replaceOnX are part of the itemScripts that let you transform it into a new item, without any code required)
Make up some mash, keep it around to "rot" aka age into somethingthat then goes into barrels
Yep! using the two you can get a lot of fancy stuff done
(theres also ReplaceOnUse (most often used for food to return the container) and ReplaceOnDepleted and ReplaceOnExtinguish (Used for candles and stuff)
i want to "hack" a new passive Crafting station with just using the oven mech.
The Dryingrack "Method" doesnt work cuz i need 2 diffrent items as input and it does only support 1:1 itemexcange. My thought was to hijack the "Burned" event to check if the 2nd material is in the same inventory then replace both with the output.
ah I see, the one problem with this is you would have to create a custom tag as well, and limit your container to only accept that one tag, otherwise people could cook their food in your crafting table
You can't hijack burnt AFAIK, only cooked.
But you could try hijacking ReplaceOnCooked and then the replacement could have an onCreate script
(the onCreate could MAYBE check for the 2nd item and then revert it if the 2nd item doesn't exist.. Not 100% sure what you can do in the onCreate event of an object)
But onCreate at least can call Lua code for you.
Also note, leaving a burnt item in the oven causes risk of fire
good points, i will try it later
Do you just like duct tape it to attach it or like spear crafting just with a gun instead of a stick or pole/handle, and/or is it a set of proper bayonet with lugs and such?
I think a bayonet mod is super neat btw.
nah you just mount it, I didnt wanna make it too complicated
42.17 is out.
NEW - The Survival Guide has been updated with new content - Added additional static spawn points to Sandbox Mode --Brandenburg --Echo Creek --Ekron --Fallas Lake --Irvington --March Ridge --Valley Station - Added new Skill VHS tapes --Aiming --Animal Care --Blacksmithing --Electrical --First Aid...
since a bayonet has the little thing for attaching
but its part of the framework. I could leave an option to make a material a requirement
Yeah usually it's just a knife with a small hole in the handle that fits and locks into the bayonet lugs on the gun but didn't know how detailed you were getting.
But you could MacGyver one with just any knife and some tape, although it might not work anywhere near as well.
in my mod is just some knife you find and can put on weapons. on the framework I will leave a system to make a material requirement
Awesome. Can wait to try it out. Affix bayonets and charge.
still a bit before its out ๐
its a whole ass framework and my weapons mod to showcase it
No problem, take your time. No need to rush.
getCell():getVehicles() <- boom gone Edit: ok still working but output changed xD
one step closer to stable build 42 though
So what is the way to use Java iterable from lua ? ```java
Set<BaseVehicle> vehicles = IsoWorld.instance.currentCell.getVehicles();
for (BaseVehicle vehicle : vehicles) {
...
}
Hi! With the recent update, one of my mods broke, and the culprit is this method: getVehicles(). Has anyone been able to find its name?
the only use I see of getVehicles in Vanilla B42.17 lua is as broken as my mods (ISVehicleBloodUI:prerender)
@knotty stone They removed the patch note that said something like, fixed not being able to place light switches
Now it's just, "Fixed being able to pick up light switches"
well funny part is that this was something already done in 42.16.3
Oh, well then it makes sense
i honestly don't know if you will be able to iterate over a set... can you try ArrayList.new(vehicles) and iterate over that?
hi sunshi
what even is the point of changing the output type lol, does anyone see how they changed their usage of the func
i'd argue this should've been a set in the first place
the order is meaningless and there shouldn't be duplicate entries
yeah but why change it
it wasn't an approriate usage of a list
Never used getVehicles (plural index version), but it's good to know now I guess lol
i suppose, though for this usage is there any performance difference between a list and a set
Thank you so much for sharing the change to getVehicles() ๐
Sorry for asking this, I couldn't find anything in pins. Is there a plugin for blender to work with .x model format for import/export? The method im using gets rid of correct worldscale size
no
you can use ZomboidAssetConverter to convert vanilla models to gltf for import, and there's no reason to export to x in the first place (use glb or fbx instead)
cries in linux guess ill have to build it
there is a full package uploaded somewhere
google has become useless for niche findings
look for aoqia pinned message in animation channel of PZ Modding community Discord. (I just got temp banned for linking it..)
thanks, im trying to get the weapons .x files but already have them converted to fbx. I found a plugin in that discord for blender that does GLTF, ill see if that works. (It works thx)
lol.
getisnpc
whoops, thanks discord, that definitely is the textbox i wanted to type in
Hey guys got a question here
If I want to allow any and all vegetables in a crafting recipe thats NOT an evolved recipe
Do I do Base:Vegetables ?
are the JavaDocs that the pz wiki links to up to date for current unstable versions? trying to hunt down a method returning null but dunno if i gotta decompile the java myself first
yes
It's written at the top right what version it's for
I don't think base:vegetables is a valid item tag for craftRecipe
So how do I format this because there is thing in the files that say Foodtype = Vegetable
Do I just put Item 3 as Foodtype=Vegetable and it uses anything with that?
i don't think you can do this
As of right now I think that's the only comprehensive solution
A vegetables tag would be nice for items though
So whats the point of the line
Foodtype=Vegetables
I'd have to check to be certain but it's probably for evolved recipes or nutrition
Yeah I'd have to guess it's for evolved or nutrition
it's just used for categorising ingredients for the ui
The only relevant line to use as a tag in a craftRecipe is ItemType though
Oh that makes sense lol I'm slow
So utterly useless
to confirm - what url are you getting this from? i am looking at https://projectzomboid.com/modding/index.html, which does not have that, i apologize if i'm missing something obvious
Alright typing every veggie in then manually
package index
ah thanks mate, i really was looking at the wrong set of docs then, did not know there was a user maintained branch
no problem
The official docs are not updated
appreciate all the help haha
when have they? thought the JD's always been unofficial
btw Sim, where are keybinding hiding at if you just happen to know offhand in java...
You mean the keybinds that you can setup in the option menu ?
yep
its likely java since its IG, apparently aiming is doing a null check on the first key so when its unbound oh you lose all aim abliity....
basically the null check is killing RMB from working
Null check of what ? Not sure I understood
if you unbind 'aim' from in this case default is left Ctrl.... and set it to 'none' your RMB ability to aim dies with it
Oh hey I looked into it
Foodtype = vegetable
Is for foraging categories
I suggest you make a bug report then
Bugs go here. Please save us the time to translate all the posts in different languages and post them in English instead.
oh I plan on it but few people alreadyt reported similiar problems. I was just hoping to find the code to see if my theory was correct and its cuz its not passing beyond the none being considered == null
basically if Aim=key:74;altCode:10001 and if Aim=key:0;.... it just stops there and goes okay we not doing anything more :)
looks like they know about it too and seems to agree on the cause and also temp solution I suggested (random key on your numpad area out of the way...)
declaration: package: zombie.characters, enum: CharacterInputKeyBinding
Then
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/component/CharacterInputComponent.html
and
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/CharacterInputComponentEntity.html
look like they check if the aim key is pressed (among other things)
declaration: package: zombie.characters.component, class: CharacterInputComponent
declaration: package: zombie.characters, interface: CharacterInputComponentEntity

