#mod_development
1 messages ยท Page 319 of 1
local weapon = getPlayer():getPrimaryHandItem()
if not weapon then return nil end
if not instanceof(weapon, "HandWeapon") then return nil end
if not weapon:isRanged() then return nil end
return weapon
Something like that
self.scriptPart.container.conditionAffectsCapacity
I'm using reflection in Starlit, and it does great until I get to conditionAffectsCapacity and it yells at me
This was how I set up compiling with Java 1.7: a simple powershell script. (a batch file would work fine too)
$JAVAC="C:\Program Files\Java\jdk-17\bin\javac"
$DEP="D:\pz\42.6\output\dependencies"
$CLASSPATH="C:\Games\Steam\steamapps\common\ProjectZomboid"
$WORKDIR="C:\Users\myusername\Zomboid\Workshop\Nep High Beams 2\Contents\mods\Nep High Beams 2\42\Java"
echo +-------------------------------------------+
pushd $WORKDIR
& $JAVAC -cp $DEP -classpath $CLASSPATH VehiclePart.java -Xlint:none
copy .\VehiclePart.class C:\Games\Steam\steamapps\common\ProjectZomboid\zombie\vehicles\
popd
echo +-------------------------------------------+
Easier than messing with the PATH to get the java version I wanted.
Then I made a task in Visual Studio Code to run that, and I just hit F9 to compile and install VehiclePart.java
I just have the one java file in a folder in my mod, you can get fancy and include the whole decompiled source tree as a project and have the IDE do all the cool IDE stuff but for me it's enough to have basic syntax checking on the .java file
Worked
If bomb item scripts list ExplosionPower = 70 then can I use this in a script to get that number: getExplosionPower()
I believe so
definitely not practical, and in 99% of situations it would be completely wasteful, but it'd be hilarious, especially if it triggers by spamming the left click with an empty mag
perfect for all those extra guns you have if you play with gun mods that add alot
does the game have a throw animation?
all I see is John Wick and now I want to watch the movies again for like the 8th time
borderlands 2
yes
perfect, so then we only need someone to program the ability to throw a pistol then tie that to a trigger like either a hotkey or spamming left click with an empty mag
I imagine a hotkey would be easier but spamming with an empty mag would just be funnier and take advantage of panicking
I banged on the keyboard long enough to get it to work. Capacity is correct on the Vehicle Mecahnics UI now
peak!!
hilarious concept
Haveing a get method for script properties is not automated; the java class needs to have a getThing() method. Mostscript properties have some form of getter.
The eway to check is use the javadocs: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/
package index
Put "explosionpower" in the search and you can see that HandWeapon and IsoTrap both have get and set methods for that.
I saw script and assumed they meant code since they mentioned HandWeapon, may have been my bad to assume
Have it happen automaticly if you click fire when there are zero bullet left. Teach fire control and ammo tracking in tense situations!
...maybe make it if you click fire twice.
I would say the fourth click with an empty mag would trigger it
Cuz it usually happens in movies after clicking a few times, and 4 clicks makes it very clear you're panicking
Any fewer than that and you're likely to accidentally trigger it fairly often, 4 clicks would either be your really trying, or you're really panicking
They used "script" twice, probably once for item script and once for lua script. So one of our guesses as to teh real question will be correct! (also, the answers match)
Or maybe holding left trigger with an empty mag could trigger it?
That way it'd be more intentional and also wouldn't need a separate hotkey and would help to avoid accidental trigger
Maybe 2 seconds of holding left click with empty mag?
1 second may help avoid delay tho
accidental trigger makes it funnier
I did a mod last year on the family server to tease my wife a little. it was auto drink all the booze when near it and also when drunk, you just keep falling over until you die. she wasn't very amused though.
My "stupid ideas for mods" list includes Autodrunk - like autodrink, but for alcohol and you keep drining to keep your drunkeness at a level chosen in mod options.
Instead of an empty mag maybe do it when the gun jams? ^^ Would remind me of some comedic movie scenes where the gun doesnt work and the person throws the gun. ^^
Interesting idea, but I'm not sure how much demand there is for a mod that causes the tired moodle to never go away.
I can deal with a tired moodle. It's the hangover moodle I don't like
i love modeling super simple vehicles
am I using this wrong? self is a VehiclePart here. I get tried to call nil. and I did verify that container:getMaxCapacity() and self:getCondition() do return a number
local container = self:getInventoryItem()
return self:getNumberByCondition(container:getMaxCapacity(), self:getCondition(), 5.0)
public static float getNumberByCondition(float number, float cond, float min) {
cond += 20.0F * (100.0F - cond) / 100.0F;
float _float = cond / 100.0F;
return Math.round(Math.max(min, number * _float) * 100.0F) / 100.0F;
}
what is null tough? the container? the getmaxcapacity or the getconditon. and do they all give you a float value back?
container:getMaxCapacity() and self:getCondition() return a number so I'm guessing it's getNumberByCondition()
have you tried adding prints to pinpoint the nil
I did try tonumber but no luck
in base game I see Math.round but not Math.max - only math.max (lower)
i dont know about java, but if number is nil * _float it might make problems? but h says container:getmaxcapacity gives a float, so thats not it i think?
Is that function somthing to do with capacity reducing with condition?
ah wtf didnt notice this was java lol
it is, trying to keep the vaniller lower condition
If you're doing code based mods you'll end up with a decompiled copy of the game to reference... it's the only way to fogure out how a lot of stuff actually works.
yea, I almost always have it open
lua has a math.max also
if I return just a number, it works.
so uhhh, I've pinpointed a possible source for my distributions issue:
forceForZones - This isn't working properly on my end. Somehow it's not finding any zones. Vanilla or modded.
Sorry to just barge in again...
Zones seem weird right now
they can overlap, and the Trapping code means in overlapping zones you get a chance for each zone.
so registerzone doesnt work in .42? or did you try a nother aproach?
I haven't tried hitting static methods from Lua yet @queen oasis , but maybe try "." instead of ":" since static isn't bound to any instance
so, registerzone appears to work fine. Though it seems nothing can read these zones, OR the vanilla zones take priority?
Something along those lines.
that's the only sus thing I can think of
basically, the zone gets put into the world just fine.
BUT...
Say I want to add a zone at a spot that overlaps another zone. My zone gets ignored.
i guess you tryed getZones(x+1,y+1,z) for the place you registered a zone and it gave a null pointer? (just asking to confirm)
Good idea but reflection. it'll just call the function the same way
I just noticed cond += 20.0F * (100.0F - cond) / 100.0F; wonder if that's it
I'll try that rq.
It should work if you call it as VehiclePart.getNumberByCondition
I tried after my reflection comment, and it doesn't work.
scrolling through the log, it looks like it
might just throw it in to closure
says it's there.
behold. I still don't know why I get nil from getNumberByCondition
local function sickOfThis(number, cond, min)
cond = cond + 20 * (100 - cond) / 100
local norm = cond / 100
return math.max(min, (number * norm) * 100 / 100)
end
UH. maybe instead of self:the_static_function you need to call [the_class].[the_static_function]
[Zone{name='Police', type='ZombiesType', x=2026, y=5953, w=29, h=35, id=fe104ed8-08f7-4101-8e88-9c36cddc2d93}, Zone{name='PoliceLoot', type='LootZone', x=2034, y=5983, w=1, h=4, id=379bec68-1bd8-4f62-9eac-1c1ca9a3291a}]
self is the VehiclePart class in this case
isn't self an obj, not the class?
I even double checked and everything about it works as expected
return function(self, chr)
local function sickOfThis(number, cond, min)
local norm = (cond + 0.2 * (100 - cond)) / 100
return math.max(min, number * norm)
end
if not self:isContainer() then
return 0
elseif self:getItemContainer() ~= nil then
if chr ~= nil then
return self:getItemContainer():getCapacity()
else
return self:getItemContainer():getEffectiveCapacity(chr)
end
elseif self:getInventoryItem() ~= nil then
local container = self:getInventoryItem()
if container:isConditionAffectsCapacity() then
return sickOfThis(container:getMaxCapacity(), self:getCondition(), 5)
else
return container:getCapacity()
end
else
return self:getItemContainer():getCapacity()
end
end
not optimized at all. that can wait until I'm more sober
Ok, that means the zone is actually there. thats a start.
Now id just set up your lootzone in an area where there are no rooms, buildings or zones to interfere and set up a container with the forceforzone command in the distribution to check if that works. In that way you can exclude ohter interference (force for zone for example comes after force room, so if the room is first, game code will take that one (at least in 41, no idea if they reworked the javaitempicker)
powel sport wagon
nvm, found one
whoop, got a bug in the code where it spawns cars with no tires or gas tank...
oops momento
same issue
crazy part is:
LootZed says the container should be using the replacement loot table
ah ok, did you use the tool for refill?
so, loot zone said forceforzone policelocker and when you used refill container it put kitchen stuff in it? O_o
yes
thats crazy
i don't see anything wrong. sickofthis is just a quick lua impl of tthe java that doesnt work right? and this lua works?
have you tried VehiclePart.getNumberByCondition(..)?
ah wait no -> it has a room name in it, and item picker goes first for the room, then for the zoon. so if that container has a forceForRooms="containername" in the distribution table, then that one will be taken first... uh, but i dont think that was the case with Manuel refill? Ok thats a head scratcher...
or even just checking if self.getNumberByCondition then print("we good") end
hmmm...
interesting
no idea what's wrong though. scraping the bottom of the barrel at this point
quick question: when do you usually use pcall()?
side note: How do I fix the comically large UI?
check the armysurplus - locker || in the distribution table, that one was empty in .41. i used it to test my zone stuff and just pushed a table entry with my zone into it.
16:10 monitor
I'll take a look
I did and it was nil
they are in the lv mal in the gun store if you want to look for them in the game
but it's all good. lua works and my cars have tires and gas tanks now
thats kinda important. ๐
the eastward progression of test vehicles
you don't, it doesn't work in pz env
it seems like that'd mean the java static function isn't avail on the obj ref in lua
oh lol, time to research again ty ๐
literally no dice.
oof
Hm, is it really the forceforzones command then? did you check the distribution table for zone distributions you didnt do youself?
I've tried it with forceforrooms, worked fine
same for the forcefortiles thing
it only seems to break on forceforzones
and if I try to use a vanilla zone instead of a custom one, same issue
Just checked the decompiled code i have, tough im uncertain which version it is since i got it from git somewhre. XD
first comes forceForItems, then forceForZones, then forceFortiles and then forceForRooms, which isnt exactly as i remembered it to be honestly. So as long as there are no forceForItems it should actually work? O.o
I coudnt see the container bottom you showed, did it show the zone there?
I dunno
UI's jumbo sized for me
dunno how to fix...
a lot of menus just get cut off like that
Isnt ther an option in the ui where you can cahnge that? Like font size and stuff?
anybody know any good tutorials to get started with modding?
there is a video out therer where its explained how to create a nuka cola, sry, donthave the link, but i did quite like it.
If you have a mod idea, a good start is to look for a similar mod and see how they did it. Might not be the best way to do it, but it works.
And this channel is really good for getting pointers on where t olook for things/some idas on how to approach a mod idea
What sort of mod(s) are you planing on making?
I've got many ideas, all revolve around this huge map project of mine.
short question, does anyone see an obvious mistake here? Event.OnFillWorldObjectContextMenu.Remove(DER.onCreateWorldContextMenu)
scratch that comment, it was about one going for a nother, not both being in teh same namespace
strange
if you wanna know all abt it feel free to dm me anytime ๐
sorry I took so long
had to fullscreen PZ to even get that
this is one of the containers that are spawning normal stuff and not what lootzed says it should, btw
freaking weird. there is no 'forceforitem' and since you tried the refill and it still doesnt work, id say something is wrong with the item picker. but id have to see the .42 code to be sure.
oof
now that i think about it, what happens when you change the loot table manually? so from police to something else and back?
ah, sry its late, i was thinking about it having multiple tables it couls switch, but thats not the case when you use a force command, my fault.
I'm testing my van in B41 and I can't enter the vehicle via areas, if I use the radial menu I can but it does not have doors animations, any ideas?
interesting...
editing the vanilla file did nothing
hmmm, do they get filled from elewhere then? did you do a code serach if there are other distribution lists or code inserts? this is just some weird fuckery...
you know, either with an external tool, or just load the whole workspace into your ide
lets assume so till proven otherwise since i lack any other ideas XD
lol
Hi
Is B42 still support any kind "all/repeatable" recipes?
i.e. wash all, open all etc
i need to be able to pile corpses in shopping carts to clear them out faster
that is all
that's harder in B42 where corpses don't become items, they use the new dragging code.
Not impossible since I'm pretty sure they are still items, but you'd probably have to make a custom right-click option like "put corpse in cart"
just wanted to put that idea out there, spending like 4 days in game just dragging corpses to a pile to burn sucks
Im currently trying to find a way to stop instant death scnearios for a certain time. Does anyone know if there is a way to handle the rear vulnerability? The sandbox option... isnt an option. At least not for this project. XD
anyone encountered anything similar?
At the moment no, not in vanilla. I've been looking at adding that as an option to my Better Building mod. Like saw all planks etc.
Is there a timed action to make the player face a certain direction ?
The timed action for dropping item in the world (ISDropWorldItemAction) is used both to drop an item to the ground but is also reused for placing item, except it doesn't make the player face the direction where the item is dropped as it was only for dropping items at the player's feet.
I'd like my player to face the direction where the item is dropping but changing the player's direction is not a timed action, I didn't find any action that would help me in this regard and I am contemplating making my own FaceDirectionAction right now.
Ok. Status update:
I found a workaround for 'forceForZones' being broken.
Since 'forceForRooms' still works, I had the bright idea to use lua to change the room name of the room the container's in.
And it worked!!!
now I just need to figure out if I can make it check for both rooms AND tile-types...
nvm
derped out about the checking for both thing
That was very helpful ty. getExplosionPower does exist
who has a tutorial for splitting files because when I do it correctly it doesn't work even with require
Does this still work? Pressing enter closes the terminal
You mean a lua file?
Do you have localvariables of functions, as in "only for use within this file"?
testing time
It does
It was an issue with the file name and the terminal would crash
because I have 4000 lines
yes i have localvariables
NR_AchievementsList.getAchievementsBySubcategory = function(categoryId, subcategoryId)
local subcategoryAchievements = {}
for id, data in pairs(NR_AchievementsList.achievements) do
if data.category == categoryId and data.subcategory == subcategoryId and data.subsubcategory == nil then
subcategoryAchievements[id] = data
end
end
return subcategoryAchievements
end
count, subcategoryAchievements, subsubcategoryAchievements and more more ^^'
TIL setGameSpeed(0.51) pauses the game same as setGameSpeed(0) ๐
don't click that, <@&671452400221159444>
is there a way to get player viewcone and hearing radius with lua? i cant seem to find it in IsoPlayer
Heyoo! Anyone good with sounds? Been trying to make it so my skateboard sound plays while riding, but trying this doesn't start playing any sound:
emitter:playSound('SkateboardRolling')
addSound(pzPlayer, pzPlayer:getX(), pzPlayer:getY(), pzPlayer:getZ(), 7, 7)```
If I do this it works though, so the sound is correctly set up in the script it seems:
```getSoundManager():PlaySound("SkateboardRolling", false, 0.5);```
NR_AchievementsEvents.lua, This file is responsible for managing events like zombieKillCount,Events.OnZombieDead.Add, Events.LevelPerk.Add, etc.
NR_AchievementsList.lua, This file defines the complete list of successes available in the mod
NR_AchievementsUI.lua, This file manages the user interface
I need to split this file NR_AchievementsList.lua because there are too many lines and I'm lost
Well don't I feel stupid lol, turns out having god mode enabled while in debug mode stops the sound emitter from playing
i think i found it.
vision cone is in:
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/iso/LightingJNI.html#calculateVisionCone(zombie.characters.IsoGameCharacter)
hearing radius is in:
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/IsoGameCharacter.html#getSeeNearbyCharacterDistance()
declaration: package: zombie.iso, class: LightingJNI
declaration: package: zombie.characters, class: IsoGameCharacter
I remember reporting "bug" for someone about lack of sounds of their vehicle which was custom. It took me few hours to figure out that I've been Pressing N which in debug mode also triggers godmode/invisibility, and for some reason it muted vehicle too.
Haha yeah I realized that as well ๐ I tried shooting a gun and it was muted as well so I thought my mod full on broke sounds. Started a new save with no mods and it was still doing it. Then I tried pressing N and boom, all good lol
What does everyone think the most seamless way to implement different cart colors would be? I am not sure I want to redo the entire mod to use them, but I also kinda feel like having seperate versions for a cart color is kinda lame.
Are those cart "clothing items" or more like hand held items?
"Hand held".
IIRC you have it using umbrellas animation thing to hold hands
In front and its attached to hand
As far as i know, there is no way to have diffrent textures for weapon/handheld items, unless they're clothing item, that use XML files
You could technicly make it "clothing item" like a garbage bag that you hold in hands
Which is simply parented to prop1 bone and add all texture variants in XML file, which doesnt seem hard, however i'm not sure how your mod works exacly
Doing it that way, do you know if it's possible to control the spawn rates of the different textures? To make some more rare than others, or will it just assign it at random?
I would also like to know that as well. I'll be investigating if I can have it apply when a cart/trolley spawns, tho. I guess we'll see what happens.
I want to eventually have "special" variants with "special" abilities at some point when the mod fork is "finished".
But obviously I wouldn't want them spawning at the same consistency as the others lolll.
no you have to make multiple clothing items to do that
Ah okay, thanks for confirming ๐
Lovely.
But Vehicle parts seem to be able to switch between different textures using the same model like the police lights
Thing is, that cart is not a vehicle
i think you could actually use the container fill event to grab any of your items that spawn and then manually set which texture it uses but thats the only way
Its an item
That sounds like a smart workaround, but I feel the extra overhead isn't worth it over making additional items in my case
is it possible to let items use the same method as vehicle parts? This issue has been bothering me for a long time.
For texture changing?
Yep,only change the texture not change the model
Cas it would blink when u change the model
I'm not sure what you mean by vehicle part method to be fair.
Like the electric weapon I made before,I trying to change the texture on weapon hit,to get a fake light effect
I have models_trolley.txt and items_trolley.txt. I think I should be able to do what I am thinking, because the mod uses models_trolley.txt for the textures/meshses only and items_trolley.txt for all mod functions involving the carts & trolleys. So, isn't it as simple as defining 2 new models with seperate colors and having the XML point to the functional container the mod actually uses for all functions? I hope that makes sense.
It is, though making it clothing with XML would require you to put a a single line with new texture and game would do it automaticly, where for new model definition with texture you'd need to make EITHER multiple trolley items and each have chance to spawn OR some way with code to assign random model from list of models on its spawn.
At least thats my guess from My understanding how this works, More advanced modders with their lua knowledge could probably come up with better idea.
I assume you prefer to have a single trolley as an item (or more but not to many), but multiple diffrent models/textures for it.
Yup, exactly. And no worries, I appreciate the insight. I tend to bounce ideas off others just to make sure I'm not wasting my time on an insane adventure, cuz I 100% will if I don't. Lmao.
Sorry for poping in D=
I got : player facing where the object is being placed, right click to cancel the 3d thingy and going back to the UI will put the player back to the container they were dragging from !
Hell yeah dude, that's awesome! This will definitely be an essential mod for me
I'll try my hand at controller support before releasing
and also inventory tetris support
in build 42 items can have multiple models
vanilla examples are the crowbar, hammer, etc
Let me know if you get stuck on anything, I've had to fight the controller system a bit when making Better Building
Omfggg I am absolutely in love with all you been doing lately. Just... 
ComboItem's for everyone
at least I know why it doesn't work the way I thought it would
How do print messages work? Do they show uo in the console.txt or while in Debug?
both
Ooooh, how does it determine which model should spawn?
i think it's just random
Ah okay, makes sense
this won't work 100% of the times, but the only solution would be adding a variable that adds 1 per day passed and autosaves every time it hits 7
the problem with that is that you'd need to play 1 week in on go
actually this wont work in any way possible i need a better solution lol
i could do something with %
(it'd still fail every time a new month hits)
oh i've got an idea
this
you can use GameTime.instance.getWorldAgeDaysSinceBegin() % 7 == 0
oh true, that's definitely better
doesn't seem to exist ๐ค
let me do a search
nope
probably's got a different name, lemme check
it's probably this
if you're in b41 it might not have existed yet
yup, I'm in b41
i don't recall seeing it back then
i'll try porting this to b42 later
i'll try this out
i think it does not take in account the start day though, that may be problematic
it'll only affect people who start in 'x months into the apocalypse' scenarios
I could also just make my own method maybe
yeah, that's likely
OR i could just steal the method from B42 lol
let me try decompiling b42
i have it in a separate folder after all
here
done lol, thanks for letting me know about this method
this should do it, just gotta test it
could make it more precise but this is okay honestly
now i need to do one last thing
sync this up with the options menu
I think I am running into the symlink issue as well. I link my mods from my git projects folder into the ~/Zomboid/Mods/ folder. Happens for me with a sound-script. Whats the next step gals @main pasture ? Anybody needs to file a bug report or that has taken place already?
p.s. I run NixOS btw ๐
It's already reported at the mod reports thread
I think you just have to figure a way without symlinks before it's fixed. My "solution" was to switch the folders. The one in mods is the "real" and the one in git folder is the linked
Not a biggy. All good. I run inotifywait and rsync it
ok, stupid question. Could I pull a line out of radio text to use as tool tip text? I am trying to avoid making a translation file ๐
Or maybe there's something similar to "You can't do that" or "option not available" already that I missed?
yea, it was a stupid question. Just getText(RD_guid)
getText("RD_6fee6c8a-0cbd-4d13-bc9d-5ec5828e746f")
I spent the past two weeks rewriting and improving my anti-cheat framework so a lot of kids / cheaters are about to get salty.
doing good work
How can I identify a bomb in a players hand? Is it recognized under getWeapon?
where can i read about adding mod option in build 42.
oh thank you โค๏ธ
Thank you for your suggestion!
You're welcome!
got it working :)
mod is almost done
Interesting, thank you for clarifying. For whatever reason it resets, maybe I should send this instruction several times for it to work. ๐ค
You can use player:getPrimaryHandItem() and player:getSecondaryHandItem() to get items of any type that are held in either hand
thanks
so far everything is working. right now i'm just speeding up the game to test the Per year option (still dont know who'd like that honestly lol)
but per day, per week and per month work
it's not 100% exact but it's still around that time
plus it might not be exact due to me using the debug fast forward
thankfully enough i managed to make it so you can change everything inside of the UI instead of providing multiple java files like other mods do
I'm not criticizing anyone in particular, achieving this was pretty hard and it's nothing more of a nitpick from my part
That's amazing work, well done! ๐
Thank you!! I did my best but I also got many help that was crucial (including outside of this server, to be able to read the options .ini file)
Hey that's what communities are for! We're all here to learn and help each other ๐
damn this is getting harder to test out lol, the game's lagging a lot after 6 months
i'll restart it
Did you work out how to have java access the mod options, or did you have lua "push" the option to the java file?
the first one
basically, i located mod_options.ini and then used a method i found online to read it and transform it into a map string
anyone knows a warp zombies function? i an creating a mod.
To move a zombie to a different location?
See if IsoZombie (or one of teh parent classes) has an appropriate method. https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/IsoZombie.html
declaration: package: zombie.characters, class: IsoZombie
This is in Java, how can I see the Lua version?
this is exposed to lua
I don't understand how it works 100%, first time doing mod
I just need a function to warp zombies to coord
hmm, hit the year and it didnt work
but it could be because i didnt get to stop the super fast forward when it happened
i just did the same as month but instead of % 30, % 365
๐คทโโ๏ธ
I'll leave it in as experimental, lol
If I'm not wrong, the "common" folder gets loaded for both B41 and B42, right?
I'm already setting up my mod for the workshop lol
I don't think so no, some files might load, but if I remember correctly the common folder is part of a new folder structure for b42
I see, thanks
But I haven't made any mods for B41, so I might be off, just remember reading it somewhere
I have no idea what it means, but I love that player:hasAwkwardHands() is a thing
maybe it's the clumsy thing + panic
if you drop your item when you stumble
sometimes you do, sometimes you don't
i'm sure it has more chances with those two factors
i might just be rambling though lol
@left plank not sure why this didn't get deleted but it really should
no one click that link either
Thank youuu
thank you
You're very welcome
Not 100% related to modding but; I'm getting some footage for my mode and I noticed my cursor's still visible
is there anyway to hide it?
never mind that
Does anybody know how to make a text show up like when you try to open a barricaded door?
you know, the white text that fades away
found it
Dear fellow modders
Does anyone know
if I edit an .xml file or 1 player
in a MP game
will it be applied and executed properly?
For example, I have made a steam pack item
which OnEat, it edits 2HDefault.XML file
<m_SpeedScale> Combat Speed </m_SpeedScale>
into 2.0
it executes correctly in Single Play (build 42)
but not sure if it would work well in MP
anyone has tried this in Build 41
and know if it works well?
If you're making a B42 mod I wouldn't worry about multiplayer, it's not happening soon and will likely require a lot of mods to redo things when it does happen.
yea i agree
And if your mod can't work in MP, you just put "Singleplayer only" in the description.
If the mod is on the server and clients then you can have the client(s) make the change
There's a messaging system for client <-> server communications.
So client adds to the ClinetMassageRecieved Event, and does a if command == "MyModDoThing" then <do thing> end type of function
yea but my worry is that... server file (no change), and player file (changed) because of consumtion of the item
and no one else in the server execept that player is changed
which is what im aiming to do
The client can message server so it makes the same change.
yea but if server file is changed
dont edit/overwrite
you have to clone the file and add a variable set so that the condition applies
you also have to sync it if its not synced
won't it b applied to all players?
Ah, that may be an issue - possible desync if one player only is getting modified animations.
if lua checksum is off then it only applies to the player
Just put "single player only" in the description. ๐
yea checksum should b off... that's true
haha but i wanted to make it MP T----T
sad.. ๐ฆ
Mod's 100% done for B41!
Tomorrow I'm testing B42, getting footage done, and setting up the workshop page!
It was fun to work on this y'all, thanks widely for the help! I'll be sure to add a link to the server on my mod's page :)
what's the mod about?
Auto-saving!
ah. xD
basically it makes a backup of your savefile every day
or, every week, month and even year if you want so
use -nosteam as startup param
this will allow you to load multiple instance of the game so one would host another would join
this is how we test MP without needing another person
Been documenting a finished reworked anti-cheat mod.
doesn't the game have anticheat by its own ๐ค
Was never good enough and for a time wasn't even there.
like it's for turning on multiple windows of game right?
I see, good job then
I don't play MP but cheaters must be bothersome
may your mod work the best
I run two anti-cheats: one server-side checking network traffic and one client-side checking values and looking for injected cheat functions.
nice
anti-cheats on clients are vulnerable to various bypass techniques deployed by some cheats so I wrote a very resilient framework for any server to craft their own anti-cheat on-top of mine.
yes
Zomboid would need so much work to have solid anti-cheat. Far too much is done by the client, a lot in lua which is easy to mod locally but the java isn't exactly secure.
or do i have to downgrade myself ๐ฆ
ohhh
yeah frameworks are pretty cool
it basically allows stuff to get constantly upgraded without the need of the main creator
This is true. I'm also a Java modder. I pen-test the game and have for almost a decade. My framework takes advantage of string-based served code by injecting, minifying, and distributing it over simple encryption.
I inject generated strings with varying lengths for commands and handshake encryption keys.
is your mod a java one?
It's going to be a wild ride with these hacker guys.
build 42 has moved a lot of security critical systems to the server
copy your ProjectZomboid and paste it like ProjectZomboid_B41
Also you have to change cache folder's directory too to avoid any unexpected issue.
i'd guess so
Server yes. Client no / yes.
Server-side on client needs an API for kicking players. Client-side no.
Makes sense, that's for the best
ew... sound very tedious task... XD thank for info
i witnessed myself how awful it is to decompile java and then pray to recompile it 
The server and client code for the engine are dynamically injected with generated values to keep things unique per player and server sessions, avoiding static code detection.
=)
If the client throws away the mod loading the code the server sees no response and kicks them.
I found it easy, but it depends on if the java file you are working on decompiles in a way the recompiles correctly. VehiclePart does.
If you know the decompiler / compiler artifacts and how to fix them, it becomes easy to do.
I've cleaned files for many people over the years.
when i tried making my mod i wanted to modify like 3 java files but none of 'em worked, one didnt even have errors but compiler threw a Version error or whatever
miraculously, though, exactly the one file i needed to make all of my mod was able to get compiled
I used ZomboidDecompiler, and so far I've only tried that one file
but i had to use another decompiler
didnt work with ZomboidDecompiler
but it did work with ZomboidDecompiler's Zombie.java file and Dependendencies folder
it's a weird frankestein of two different decompilers
but it worked
๐โโ๏ธ
Of course the weird frankestein works, Zomboid is coded in frankestein.
so if they both have same function but different values, they won't cause any problem?
lol, never said better 
Yes but that is specifically the audited client-key fragment.
i really hope the file i modified has absolutely no changes in b42
itd save my time a lot
kinda having trouble in fully understanding what audited client-key fragment really mean atm.
Keys are a union of compiled and ran functions for a server key-fragment and a client key-fragment, making a key for the player-session, recalculated every heartbeat.
key key key key
So a string for server and client.
haha
Yup. It's a type of authentication for my code where the client and server agree on a key to use for each period of time.
ty for toning down to ordinary newb language..
All good. I'm so deep in this that I can't honestly talk like a normal person about it.
Hey, been there
The code is documented though.
being a programmer and having big, long, complex code that works perfectly feels like heaven
you just get all nerdy about it
I made it so people can write custom modules and modify the key-generation for their server without uploading a new workshop mod.
that's pretty rad
The anti-cheat itself is hosted on the server's filesystem and is fetched and sent to clients when logging in.
will that work in build 42 as well?
Should be no problem.
honestly, so many cool mods have been coming out for b42-only
gotcha
as a hardcore b41 it hurts me on the heart, thats why i aim to port stuff to b41 when possible, or b42 if it's the other way around
eventually i'll move on to b42 tho, i really love it, it's just that ive got some b41 mods i cant live without
haha
after playing build 42 for a day or two... i just coulnd't go back to build 41...
i can't leave my pigs alone no more... ๐ฆ
Make B42 versions of them!
oh i tried, but some of 'em made my head spin and i couldnt find a way to port at all
that was months ago when there was no b42 documentation at all, though
now that there is, i might just retry...
definitely not this month though LOL
after the headache that was getting java zomboid to work, i will take a few weeks just chillin
gotta try out my own mod after all
@fallen knot Music for when you go too deep in code: https://www.youtube.com/watch?v=EL8luMcJBTo
01110000 01110010 01100001 01101001 01110011 01100101 00100000 01110100 01101000 01100101 00100000 01101111 01101101 01101110 01101001 01110011 01110011 01101001 01100001 01101000
Adeptus Mechanicus inspired dark industrial meditative choir and tech-ambient. Music by Monasterium Imperi / Scorpio V. T...
I installed a 360ยฐ mod to help testing and playing with it.. I can't decide if I hate it or not.
Abandon the flesh.
it let you see everything without the fov restriction right?
i like the extra zoom, thats about it
being able to zoom in closer is nice to save fps lol
From the moment I understood the weakness of my untyped scripting languages, they disgusted me. I craved the strength and certainty of C. I aspired to the purity of the Blessed Object Oriented Design. Your kind cling to your LUA, as though it will not decay and fail you.
Damn. I thought The Sims 1 released in 1997. How are you getting low FPS?
true. coding ambiental music
big hordes, many mods
Can we please pin this?
๐
I like this for my Omnissiah soundtrack
The complete, critically acclaimed mastered Original Soundtrack from Warhammer 40,000: Mechanicus. Praise the Omnissiah!
Music by Guillaume David.
0:00 - Children of the Omnissiah
1:47 - Caestus Metalican
4:41 - Lost Civilizations
8:12 - Immortal Machine
9:11 - Noosphere
15:40 - Dance of the Cryptek
22:50 - Millenial Rage
29:33 - Warriors of M...
upvote
And add a list of which sacred incenses to burn to each class on the Javadocs.
haha reddit get it
I'm a type-generator guy.
x)
Wrote Candle, a project that reflects all Java API into Lua typings. Also TypeScript. Now also Python.
you monster
#EpicMusic2024 #warhammer40k #spacemarine2
Warhammer 40k Space Marines 2 Main Title Theme - Pianistec Cover
This is an one hour version of my epic orchestral cover of the Warhammer 40k Space Marine 2 title music, originally composed by Nima Fakhrara and Steve Molitz.
At the end you're hearing a little sneak peak of the track "His Angels", orig...
Astropath | Epic Spiritual Cinematic Grimdark Music (Inspired by Warhammer 40K) Perfect for painting miniatures, reading lore, reflection, meditation, relaxation, or as a background for creative endeavours.
Original Song 'Astropath' by Dream Clinic
๐ฅ Subscribe for weekly ambiences: https://www.youtube.com/@DreamClinicOfficial?sub_confirmatio...
after te autosave mod i might as well just make a similar one to the only cure
always wanted to cut my leg when it got infected, as rare as that case might be
Also look up Prometheus Studio on YouTube for 40K-inspired works.
endlessly slow movement, torture
lol im added all these into my playlists now XD
coding playlist
these are lengthy though, made specially for long-time programming sesions
i think the longest time ive coded in a go might be like 8 hours
so healthy
https://youtu.be/SwUpMhp-DEc
https://youtu.be/VO_LcRkkyWo
https://youtu.be/9KMd4YiURoA
https://youtu.be/gQEcDRUVr8Y
Dead Mechs @deadmechs
Future ใปใซใ - Ambient Cyberpunk for Forgotten Dreams
Explore the enigmatic soundscape of "Future ใปใซใ - Ambient Cyberpunk for Forgotten Dreams," where ambient melodies intertwine with cyberpunk aesthetics to create a unique auditory experience. Immerse yourself in this deep dive into a world where futuristic vi...
Relax as Ghost watches over, with this beautiful ambient music.
๐ป Download music: https://ko-fi.com/s/cc88ff07b0
๐ป Use my music: https://ko-fi.com/s/cd9bf3a2a3
๐ป Custom music: https://ko-fi.com/symbologymusic/commissions
๐ More Fantasy Music: https://youtube.com/playlist?list=PLqq_1cTNkP1yHcIjY-PVahPndQriv7Itg&si=nf-CAkZu4oy2qX7V...
This Mass Effect video features an hour of the Mass Effect 3 soundtrack from the Illusive Man's room on Cronos Station.
๐ข Support the channel on Patreon https://www.patreon.com/gamingambience
๐ข PayPal donations https://paypal.me/wretchedoutkasts
๐ข Subscribe to Gaming Ambience https://bit.ly/2k5Pyew
๐ข If you enjoyed this video on @Ga...
1 hour of extended music including three video sequences of the Catalyst with the song "Wake Up" playing from Mass Effect 3.
๐ข Support the channel on Patreon https://www.patreon.com/gamingambience
๐ข PayPal donations https://paypal.me/wretchedoutkasts
๐ข Subscribe to Gaming Ambience https://bit.ly/2k5Pyew
๐ข If you enjoyed this video o...
whoa
I'm ritualistic in the music I select for the types of coding sessions I do.
Been that way for 12 years.
There's a few good stuff there.
makes you feel like you're speedrunning
welp, gotta go eat
good night y'all, keep on moddin'
guys should i cook up spotify playlist? (upd: i cooked https://open.spotify.com/playlist/377ZFQmrAqchhOKl0ZzWZE?si=ea8ebcb09414420f)
ty for watching!
โข yt playlist: https://www.youtube.com/playlist?list=PLuA39-5_mTZYjwsNIp-De5tZqO6RKgg3t
โข soundcloud playlist: https://soundcloud.com/feverecognition/sets/breakcore-beyond
here is your track...
This is one of the mixes I use
good night.
ill make sure to check it out
thanks
Thansk for music @red tiger . I'm going to put some of that on and then... do some of my actual job. ๐ฆ
CryoChamber is a great label to look at too.
https://youtu.be/OIuX68vnJqs Inekt too
Prod. INEKT
Digital release๐ง - Spotify: https://open.spotify.com/artist/3HsW224VtUlDWQsBFMjaQN?si=xt49GJkPRKa_NWg20WMBgg
Say hi๐ - Instagram: https://www.instagram.com/_inekt
The soundtrack and artwork within this piece is original and protected under copyright law. For any enquiries(film scoring, collaborations, etc) - feel free to get i...
Hopefully this helps out people who need to isolate from the world to get work done.
Final progress photo for today, spent a while playing fiveM so I lost like two hours of time
Most of whatโs left is a bit more shadowing and the door
I like mods that tries to stay within the realism of 1993.
=)
Yeah I stay within that pre- 93 rule
Idk if there ever even was a Powell sport wagon in Knox county at the time but it definitely couldโve been!
I don't think you need to be too strict, it's enough to have "could have resonably been around in the 1990s"
Oh yeah I don't mean exactly. I meant believable realism.
Immersion is such a massive make-or-break quality for my play experience.
I might port my client java patch to add support for immersive shaders API.
My personal rule is weather or not it reasonably couldโve been in American during 1993
So a mod that adds a Nokia phone you can use as a indestructable shortblunt weapon would be OK, even if those phones were late 1990s.
Fun Fact: There were only ten functional AA12 shotguns ever made and they were all in rural Kentucky.
Based on my loot collection.
Quite funny
I should make a proper StreetSweeper mod. Fully automatic... with only 12 rounds and a slow one-by-one reload time.
I think that's the only automatic shotgun that has ever existed in any meaningful way in the real world, everything else is a concept weapon that went nowhere except for video games.
And I'm still annoyed that giving a weapon more than 9 projectiles crashes the game due to a buffer overrun in the java, because I still want to make a punt gun mod.
Or a KS-23 four guage shotgun,... those were made in the 1970s so were around in the 1990s, even if no-one outside Russia thought they were a good idea. And Russia only made them to use up faulty barrels meant for aircraft guns.
...I really just want to make something where the player crafts ammunition using a empty tin can, gunpowder and scrap metal. ๐
Adding AttachmentType = Rifle does let you wear a skateboard on your back...
is there an Event.OnPlayerSpotZombie? or when any character comes into view of the player? i want to modify the zombies that are only in view of the player.
Events.OnTick and getting the player's spottedList seem to make sense, but that seems pretty inefficient.
THATS IT I AM MAKING A MOD TO CAP STRESS FROM ZOMBIES THUMPING ON THINGS!

I walked too close to a building full of zombies and instantly jumped to full panic.
maybe a 20mm AT rifle like the NTW or the Anzio
not quite tin can size but could probably make 2 or 3 rounds out of one tin can if you cut it and wrapped it
firing guns stresses veteran characters :/ its crazy
reminds me of tom and jerry for some reason
Until we get boss zombie something that can clear a street is useful, while doing a lot of damage to several zombies in a line is not
That's true, would be a fun little trophy though
I've got a idea for improvised, fixed position trap (world objects) that fires by killing every zombie in a cone in front of it.
Like an improvised cannon, and include remote and timed triggers.
But, too many things to do first lol
that'd be pretty cool
Hahaha but why? ๐ I already have it attachment type shovel so it can be worn on the back (and I fixed the position and rotation for that)
Hmm.. I might need to unsubscribe and resubscribe, I think you've updated the mod and my local copy hasn't.
Like no skateboard attacks.
I only just found a board and kickscooter so I had not tried them previously.
I've heard that happen to someone else, but I'm not sure why ๐ค is it a common thing for mods not to update properly, or am I doing something wrong?
Oh yeah you should be able to attack, attach it to back, and yesterday I added sound to the skateboard. The folded kick scooter is now a weapon as well so you should be able to equip and swing it
no, it's a steam thing.
I was surprised that there's nothing in the workshop for having a bigger noise maker that can be triggered multiple times
like, I wanted to clear a road by just making noise
I guess maybe the map isn't being simulated if I'm not there though
or just a repellant in general
instead of a noise maker, which attracts
Also
How hard is it to modify zombie appearance / sounds? I feel like there's barely any mods that add new zombie types, the closest I've seen is just one that makes some zombies be able to sprint
Like there's no zombies that are bigger in size (and hp/damage/louder) but slower, or anything like that
if someone would like to, please i need saab mods and more volvo mods
someone can help me in the mod supp discussion pls?
Hey guys. I need some help. I want to remove some specific vehicles from spawn in the world. Some of them are vanilla, and others are modded. How should I approach this issue? I was thinking of finding the spawn chance of these vehicles and creating a mod that would overwrite those values with zero.
Is it just me or is https://pzwiki.net/wiki/Modding down?
true @thin swan
im not understanding how to put my mod on workshop...it's a manual installing mod and idk how to set the folders ๐ฆ
the wiki was down a few days ago too, but right now it's up for me
I haven't done a mod like that, but if you install the mod by replacing files in the ProjectZomboid\zombie folder, try making your folder structure like this (for b42 and b41):
C:\Users\YourUser\Zomboid\Workshop\YourModName\Contents\mods\YourModName
And in the last YourModName folder it should have 4 folders:
41
42
common
media
In your 41 and 42 folders you make a new folder called zombie where you put your files to replace the vanilla ones, and then instruct users to copy/paste this folder into their game install.
common folder can be empty.
If your mod has .lua as well, then put that in YourModName\media\lua for b41 and YourModName\42\media\lua for b42
You need to just also make sure you have a mod.info in your YourModName folder and YourModName\42 folder
Hmm, the rest of the wiki seems fine, it's just the modding section that's returning 500 http error, so something server side is borked
works for me
Hmm, I guess it could be the CDN server in my location that's messed up then. Where are you located if I may ask?
EU
Well damn, same
it's working for me in canada so yeah it might just be whatever specific server you are connecting to
someone messed up somewhere over there I guess lol
I think they just fixed it, it's working now ๐
perfect timing lol
nothing to do...always mod.info missing...i put this file everywhere lol
mod.info has to be in the 42 and 41 folder and I believe the folder that has media, common, 42 and 41 in it, mods/yourmod/mod.info
Each version gets it's own mod.info file basically and the main mod folder can also be used for 41
@gilded crescent riesci a darmi una mano in pvt?
Yeah just send me a message, I accepted the request
Hello.. im trying to make a simple mod for zb and need some help. I want to share RVInterior from Base.Van with Zrap (modded car), but cant find any documentation. Any help will be apreciated. Ty in advance
Im working on a mod to remove bullet defence from leather patches and Im unable to add the mod to my game. Anyone have any idea what could be causing this?
https://steamcommunity.com/sharedfiles/filedetails/?id=3459875383 if anyone want to test it ๐
Some more background on your method? aka "how?"
all explained in the workshop page
Improved memory management:
-Xmx8192m: Increased maximum memory (if your PC has 16GB+ RAM)
-Xms4096m: Added minimum memory to reduce the need for reallocation
Garbage Collector optimizations:
Improved ZGC usage for Windows 10+ versions
Changed fallback to use G1GC with optimized parameters
Added -XX:+UseNUMA for multi-CPU systems
Added -XX:+AlwaysPreTouch to pre-allocate memory at startup
Batch file optimizations:
Automatic detection of system RAM
Automatically scale memory allocation based on available RAM
Detection of number of CPU cores to optimize GC threads
General optimizations:
-XX:+OptimizeStringConcat to improve handling of strings
-XX:+DisableExplicitGC to avoid explicit garbage collector calls
Interesting. Not a Java pro here. You took some measurements?
im not a pro too ๐
no lag in the initial screen...loading game and - lags when u ride cars and change cells
NOTE ON MULTI-CPU OPTIMIZATIONS:
Project Zomboid is primarily a single-threaded game, so even with these optimizations, most of the workload remains on a single CPU core. The changes I've made still improve overall performance by optimizing:
โข Memory management (multi-threaded garbage collector)
โข Memory access on NUMA systems
โข Secondary operations like texture loading and data compression
These optimizations cannot fully transform the game into a multi-threaded application, but they maximize efficiency within the limitations of the game engine.
Yes I've read the workshop page. Personnally I don't have performance issues unless very zoomed out but cool if it helps, then great work
! Others here have much more experience and can give you more qualified feedback.
p.s.: welcome to the community!
thanks ๐ im trying to help
Can someone tell me from where the events in java are fired? I wanna know whats going on there, since i try to figure out the damage system. It simply doesnt make sense to me and i suspect a lot of 'damage' or 'damage types' arent send per event. No matter what i do - with the exception of god mode - the character in a crowd of zombies starts out shouting and thats pretty much when they drop dead. ๐ง
Thought its maybe panic that kills him, but putting panic and pain to 0 each tick also doesnt help.
if there's three zombies attacking you at once you instantly die
it's extremely rare to actually die of damage
Wait what? While that is great to know, where can i find the code for that. There has to be a way around that one or god mode woudnt allow you stay in a crowd, rigth? ๐ฆ
Well, at least it lets me get a bit closer to my goal, since i should be able to figure out if 3 zombies attack at the same time... also i have no idea how id do that... jet. ^^
This is evil
yeah, played forever without even knowing that one. XD
you can turn it off, you'd usually get stunlocked instead anyway
but i've never felt combat really needed to be easier ๐
Hm, i guess i need to look into stun lock too? but knowing where to shut it off would be better, or at least a call for the case it happened?
I do not wish to make it easier. I am trying to make a mod for an emergency recall for an mp server where people dont go to events because they dont wanna die? So i hope i can make some kind of emergency recall that gets them out of doge for these events. Outside of them? Nope! XD
Especeally pvp events are dead on the server i play, which is a bit of a shame. So i think that mod might be well recived? Well, first i have to get it going, then i can introduce the idea. ^^
Urgh, sorry for tagging you, that wasnt meant to be. ๐
dw!
does anyone know where you can find weapon stats in the game code?
You mean like the damage, swing speed, stuff like that?
yeah
It's in the item script for the weapon, so you want to go to steamapps\common\ProjectZomboid\media\scripts\items and then open the .txt file for the weapon you want. For example the baseball bat would be in items_weapons_2handed.txt
If you want to find it easier you can open that folder in vscode and then use their search
I believe so yes, the 2handed.txt contains long and short, blunt and blade, but axes are in a separate one
or wait maybe not
Albion, i think im blind. Where did you find the option to shut off a player object being killed when attacked by 3 or more zombies?
the game calls it 'drag down'
Oh, that option, i thought it was meant for getting.... well dragged down, so i set it "off", but that doesnt stop my guy from starting to shout and cry and die miserably.
Actually the weapons_2handed.txt seems to just be blunt, long blades and axes are in their own files
thanks i found it
playtesting my mod for b42; So far, it's working
lol, didn't know they had added fire rubber duckies in it
Whatchu workin on ๐โจ?
Finally taking a short break after a ~200 hour mod project. woohoo
Can't wait to watch all the cheaters get flipped.
a mod that autosaves the game as a separate file in time lapses that can be either days, weeks, months or even years
it's done for B41 actually
It's an arms-race I suppose. Don't spill all the secrets, let them scripters figure it out by themselves.
Best "defense" is a healthy community and good admins?
i was just testing it out with B42
Hi! I am currently playtesting some of my mods on the most recent 42.7.0 and got this strange error:
ERROR: General f:870, t:1744062334052> ExceptionLogger.logException> Exception thrown
org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_PRIMARYKEY] A PRIMARY KEY constraint failed (UNIQUE constraint failed: vehicles.id) at DB.newSQLException(DB.java:1179).
Stack trace:
org.sqlite.core.DB.newSQLException(DB.java:1179)
org.sqlite.core.DB.newSQLException(DB.java:1190)
org.sqlite.core.DB.execute(DB.java:985)
org.sqlite.core.DB.executeUpdate(DB.java:1054)
org.sqlite.jdbc3.JDBC3PreparedStatement.lambda$executeLargeUpdate$2(JDBC3PreparedStatement.java:129)
org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:458)
org.sqlite.jdbc3.JDBC3PreparedStatement.executeLargeUpdate(JDBC3PreparedStatement.java:124)
org.sqlite.jdbc3.JDBC3PreparedStatement.executeUpdate(JDBC3PreparedStatement.java:105)
zombie.vehicles.VehiclesDB2$SQLStore.addToDB(VehiclesDB2.java:335)
zombie.vehicles.VehiclesDB2$SQLStore.updateVehicle(VehiclesDB2.java:300)
zombie.vehicles.VehiclesDB2$QueueAddVehicle.processWorldStreamer(VehiclesDB2.java:890)
zombie.vehicles.VehiclesDB2$WorldStreamerThread.update(VehiclesDB2.java:651)
zombie.vehicles.VehiclesDB2.updateWorldStreamer(VehiclesDB2.java:1076)
zombie.iso.WorldStreamer.threadLoop(WorldStreamer.java:513)
zombie.iso.WorldStreamer.lambda$create$0(WorldStreamer.java:544)
java.base/java.lang.Thread.run(Unknown Source)
LOG : ExitDebug f:1070, t:1744062338520> EXITDEBUG: ToggleEscapeMenu 1```
My mods are not in any way related to the vehicle system. Possible that this is an error from the vanilla game?
Oh. It's open-source.
it works just fine, but it isnt synced to the mod options file because it's different in B42
so i was just fixing that
It's a good design so it'll take time for any cat-and-mouse plays from the other side. I built in diversity to break anti-cheat bypasses.
after that's done, it's gonna release
Yeah of course.
i've even got footage of it working already so it's just a matter of fixing that and then upload it to the workshop
I might be wrong, but it seems b42.7 its buggy with the mod list
i get a bug just by opening the mod menu
when you have basic functioning anti-cheat, yes, this is the only viable way - but zomboid doesn't by default so hackers can be insanely destructive so having admins to respond after the fact isn't enough
lol
rest deserved
i thought i was gonna be done with my mod today but b42 said nuhuh ๐
regardless, it'll be prob done by tomorrow
had it almost figured out but had to go due to my english class
this error happened for me during gameplay only once so far. but never seen it before so I am wondering what this could be...
When your anti-cheat injects generated values for server-client code that only works within that session and even encryption keys are based off of dynamically injected key-generation functions, hackers will uhh.. have a hard time.
i'm happy that i didnt have to do the decompiler frankestein for b42 though
zomboid decompiler did just fine
funny that it works better with b42 than b41
Yes I was expecting something like this.
This is why I loadstring the server and client-code.
BTW all that stuff is broken down into utilities / libraries for anyone to use for their projects.
Not sure who will need string-injection magic but its there.
i've never actually tested it with b41 even once, it started development after b42's public release, it shouldn't behave differently in any major way but issues that are exclusive to b41 aren't going to get noticed or fixed
ohhh, that explains a lot then
Yeah, i barely had any problems with b42
compared to b41
i see why now
?
oopps wrong mention.
it's not that b41 is unusable, just more buggy
i'm not sure if there's anything i've done that specifically should help b42 more but again b41 doesn't get any testing, if it works it works
I'm falling back into development for Mallet btw.
makes sense
Razab personally I have no idea. I assume you test with no other mods and on a fresh player life, yes? could be a corrupted file? Something is trying to insert a key that already exists it seems.
Upgrading the anti-cheat was a detour.
pretty good job by the way, it manages to stay simple for a decompiler
Back to fighting the war of documentation.
yeah, the main purpose of it was just to get it to be the least effort possible, realising i could use it to seriously improve the output came later
and since i had to playtest b42, i get to share my thoughts on it after a good while
I still haven't played 42 yet. =(
i think my favorite aspect about it is the performance improvement, the new weather system, and the useless items that ironically add a lot
i experienced all of that in a short playthrough lol
Lost and deep in the trenches of code.
oh also the new aiming system is fun
i'd like to write something to resolve generic parameters (these seem to be the cause of 99% of uncompilable code) since it doesn't seem like it'd actually be that hard, but it's a lot of effort, vineflower's api doesn't really let me do anything like that so i'd probably have to do it in post
hmm, sounds tedious
Oh yeah. You can't really. It would have to walk through every single generic implementation in runtime.
Oh wait
No you can actually.
There's a couple utilities I used to achieve this somewhat with PipeWrench.
Candle was a rewrite of the codebase for PipeWrench typings.
if you think of an arraylist, something is going to call get at some point and cast the result to the type that's actually contained (or potentially a supertype but it doesn't really matter if we end up giving it a supertype), i just have to work backwards from there
I don't think you'd need to go that far but then again I looked at class-structure, not actual code-blocks.
This is what I wanted to do for Lua typing discovery.
I was working on code that walked and discovered type assignments / references in the PZ Lua codebase.
yeah, i've been thinking of doing that as well ๐
omar's lua stub rewrite is fantastic but it still ends up with unknown for java types
Quick chat with chatGPT recommends "Delete vehicles.db (located under Zomboid/Sandbox/<save>/vehicles.db) โ it will be regenerated, but this will remove all parked vehicle data unless they are saved elsewhere like in a mod."
Just a stab in the dark, never blindly trust the AI.
Anyway, maybe just a corrupted save file (corrupted how, well, good luck :D)
You'd have to manually input those types.
i'm sure we could use rosetta data to resolve java types
I was abusing Candle to achieve this.
There's code somewhere on my repo that has this stuff.
Basically it'd require walking through all blocks, noting scopes and their respective local declarations.
Then you'd look through an AST of the code for references and assignments.
--- @type string|number|nil
local x;
-- ..
x = 'e';
-- ..
x = 2;
yeah that's what i had in mind
Lua makes it even easier to discover because of the syntax.
PZ needs the custom flavor of Roblox Lua.
I do not understand the point. if the decoding is done client side from a sent key. the decoding of the key is as easy for the legit client than for the hacker, right ?
This is true, however because the code is loaded and somewhat dynamically generated, scrappers can't easily pick out the next key which is in the code and is generated only for the handshake. Then the next key is built with functions for the server-fragment and the client-fragment. The client-fragment is also ran and audited on the server. These key-generator functions are dynamically injected into EtherHammerX's engine and are moddable by servers.
I can't defeat the fact that the client requires the initial key.
I have to obfuscate this. However scrambling dynamic, varying lengths of strings and injecting them makes scrappers more difficult to write.
Even moreso the key-gen functions I provide by default use synchronized randoms so execution count matters. That alongside servers being able to quickly customize how their keys work and their modules work gives way to diversifying the anti-cheat, making it even harder for cheaters to bypass.
no global scope ๐ฅบ
Further still, if the client doesn't respond (correctly or at all), the server kicks.
I'm limited in what I can do for anti-cheats for PZ as a modder however the code I have in place for EtherHammerX should be strong enough to give server admins a fighting chance and opportunities to add to and improve on their own anti-cheat detection.
Build 42 should make this situation improve drastically with systems migrating to server-side.
thanks. I'll keep trying a bit. Maybe the new update just messed things up in my zomboid folder or smth
@mellow frigate If you have any suggestions or ideas on how to improve the anti-cheat, please let me know. I want this thing to work and protect servers. =)
One idea I had was writing commented / annotated ranges where local definitions could be scrambled / randomly inserted to further obfuscate / confuse code scrappers.
I am interested in the topic, so I ask stuff. but I have no knowledge of anti-cheat and MP protection. I see client side anti-cheat as a lost cause. Server side dynamic behaviour analysis may limit the impact though.
I provide both. =)
With build 41 moving a lot of key functions of the game to client-authority, the server became severely limited in its cheat-detection.
anyone know where to find the Occupation images in the code
That's a surprise to me, I understood TIS wanted to put most stuff server side (starting with inventory mgmt)
Yes. This is happening in 42.
I'm not sure why it moved to client-side on 40 -> 41.
The server became somewhat of a glorified bouncer.
The code model where a single-player session runs on a local server would be so much better IMO.
They used an extern team with expertise in that domain. maybe they wanted to provide a PZ MP asap for B41. And the least we can say is that B41 was a huge success (even with the technical limitations you detail)
Would force these sorts of design choices that encourages separation of code and speculation on what authors events and how to control that within a simulated server.
Yeah this is also what I believe happened.
The builds are becoming so big that it takes years now instead of months.
It's also a nightmare for hype-building. Would explain why Thursdoids are now Monthdoids.
Build 41 was moderately successful as a marketing campaign for the game. A lot of eyes looked at PZ when 41 released.
Hopefully 42 will address issues with PvP servers suffering from cheats and latency degrading the quality of the game.
If choices must be made, I would prefer latency problem solution with white-listed servers than anti-cheat.
I think that servers should have options. Those choices aren't mutually-exclusive. =)
PZ has a very creative community. I'd like to see what is in store for build 42 and those who are up for the challenge to solve those problems when they come.
Right now I'm writing tools to prepare people for when that time comes, both anti-cheat and modding tools like Umbrella.
Both of you are reading my mind, I see
The AST thing is what stubgen currently does, but yeah without Java types it's just primitives, Lua-defined classes, and a whole lot of unknowns
Not necessarily anymore. The majority of the work between B41 and 42 was to expedite future builds. The foundation is so much more stable, as made evident by the 7-9 business day patches. I'm not saying B43 is coming later this year, but the strides made from B41 to B42 enabled them to have quicker and more stable updates.
At least that is my understanding of what has gone down.
Speaking of builds, 42.7 is out.
Time to see how easily I can update a java mods.
I'm lucky, VehiclePArt did not change. But Better Car physics is broken ๐ฆ
Ughhh you're jokinggg! I freaking love that mod smfh.
Same, but given how many file it touches I'm amazed that Neidmare keps up with it so well.
He's already commented to confirm he's aware it's broken and will release a new version.
(or she, or they... I'm just defaulting to "he" without any evidence)
Hahaa, well I hope it's soon. I love to play in winter and it's borderline impossible to run tractor trailers without it sometimes lolll.
Anybody know a mod that uses multiple textures for the same item? I'd like to look at their implementation.
My current game (assuming it survives 42.7) is in April 1994, but I had such a mild winter! I was a bit dissapointed, not having to drive on snow unabel to see the road etc.
That's the worst!!! But I tend to avoid that by setting the weather to "very cold" hahaa.
Though B42's new grass I think will make that easier, with lots on the edge of road and only small tufts on it.
Cryogenic winter? I did that once, it was fun until I managed to pile on enough insulated clothing to ignore it.
Only time I've actully wanted a firemans outfit!
Added recipe validation that recipes can be learned.
But no fix for "corrept teh entire world or refuse to even load teh game if a recipe has a typo" ๐ฆ
fixed more globals. output,test,bullets,bed,b,p,s,v,obj,hotkey,element,str,selected,action,input,uses,delta.
Any ideas what these are? Are there default globals for p=player, s=square the player is in, v=vehicle?
Nope, I'll still be copy/pasting p=getPlayer();v=p:getVehicle() into the lua console.
That is a misunderstanding, unfortunately. If anything, b42 code is even more of a monolothic spaghetti nightmare than b41. The current hotfix patch update cadence is by no means representative of how extremely laborious and time consuming tech and feature work is, and it's that tech and feature work that made b42 take so long (new crafting framework, new liquid framework, new lighting engine, new render engine, etc); the patches they are releasing recently are just making content iterations, which a single designer/artist can make the same way a single modder can make a mod with a bunch of scripts and pixel art, excepting ofc that TIS' employees are also actual professionals (although many of the recent hires are former PZ modders, which is just a smart onboarding decision for a small tech startup that doesn't want to and/or can't waste months with onboarding tasks for entirely new hires, which is avoided by modders already familiar with the codebase and game design in question).
The idea that somehow they've made things easier on themselves with b42 is in fact complely the opposite of the truth. In fact, they've thoroughly fucked some stuff up, such as the fact that mapping now uses two entirely different sizes of cells between map making and the in-game render engine, and it's not clear if they intend to actually complete this refactor (to the new size of cell introduced) or if they intend to leave it this way, as as it stands there is effectively duct tape and hot glue holding together systems like the in-game map (which is effectively still using the old b41 cell system, which is different from the new b42 cell size used for chunk rendering), which implies that they just bashed their heads against the wall trying to get the render engine (lighting etc) working for b42's new changes and, once they did, they just made everything else work as best they could. They clearly haven't refactored their code to make anything easier on themselves, QUITE the opposite.
Is it true that b42 is limiting all containers to be 50 max capacity? Why is that if so
For the most part, yep, it's true.
I wish I knew, too.
how do you know?
Because it exists and I have been living in the wake of the disaster it has caused? lolll. Wdym how do I know?
yeah that's not an unreleased change or anything, thats been like that since 42's release to unstable
was wondering if it was in a patch note or something, but yeah that sounds no bueno
Yea, it's been like that since B42 was first released.
not sure if related but there's a [self-described] WIP mod for B42 capacity: https://steamcommunity.com/sharedfiles/filedetails/?id=3452113500&searchtext=weight
I feel like the only 2 logical reasons I can imagine are that either it's for technical reasons (optimizations or bugs or whatever) or it's because one of the devs got sick of the "1000 capacity" mods LMAO
having 1000 capacity is so nice tho
Yep, I am waiting for a more stable version before updating the ZuperCarts port with it tho.
filling one military locker with all your guns feels so good and it feels so tidy
I was surprised to see that literally no one made a sprinkler mod
there's like
irrigation pipes
but no sprinkler
Honestly, I have no idea, because whatever the reason is it's not impossible to mod out. So... why implement it in the first place? No clue.
you can mod it out via workshop?
I thought you needed to fuck with game files
if so it's not a big deal then ig
You can, without Java editing and with LUA, but it's a massive PITA.
It's buggy and broken and full of issues.
ah well
that sucks
I just want chickens and a locker with 1000 capacity worth of eggs
is that too much to ask for

has anyone tried to mess with player cone of view? so far it looks like the classes with the capability aren't exposed in the API to Lua (LightingJNI.java, AnimationPlayer.java)
Yeah, I tried to get some resolution for this, but nobody cares.
end of todays progress
almost done, should be on to the masking and lights tommorrow! then ill do some more model varients and texture varients!!!!!
I should release the "ignore capacity limit" mod I have, it's been nice and stable since I rewrote the entire thing with API call overrides instead of LUA patches.
This gives me vibes I can't quite put my finger on, but I LOVE it.
Well, if it's Java or doesn't update with the UI, then I'll have to pass.
It's LUA, but instead of patching the lua functions in 50 places it patches the lua -> java call
Itโs the Powell sport wagon if that rings a bell, super neat vehicle
Using Albion's magic
Which is nice and simple if you copy-paste the sytax, and a WTF of weird-ass lua quirks otherwise.
No, prolly saw it in a movie or something before and it's giving me that vibe hahaa. But yeah, it's gorgeous.
Reminds me of the '49 Dodge Powerwagon
Using Albion's gatekept magic*** FTFY :p
He's not gatekeeping, we just don't understand his wisdom ๐
Uhhh huhhh. The only thing Albion imparts on me half the time is confusion hahaa.
And I mean that endearingly hahaa.
local index = __classmetatables[DevicePresets.class].__index said no-one sane, ever...
...why did 42.7 sawn a zombie in my closet?
Very possible lol!
Definitely my best and favorite texture model combo so far, canโt wait to do the c-series texture updates sometime the the road!!
$@#%^@#!
looks like one chunk of my base reset
The chunk with all the guns and reworked gun counters downstairs, all the renovated kitchen with all my food upstairs!
oh well, I'll dev mode stuff back.
wow how???
Albion's magic!
any particular mod of his?
local index = __classmetatables[DevicePresets.class].__index
local old_addPreset = index.addPreset
index.addPreset = function(self, ...)
local maxPresets = self:getMaxPresets()
if self:getPresets():size() >= maxPresets then
self:setMaxPresets(maxPresets + 1)
end
old_addPreset(self, ...)
end
Not a mod, the syntax to modify the ...mumble mumble table mumble mumble meta table mumble mumble
thats happened to me at random recently
That example changes DevicePresets.addPreset()
Same as modifying lua functions, but you're modifying the lua functions that interact with java.
this is awesome i didn't realize it was possible
I think everyone assumes it's not possible, then Albion just casually drops "no, you can do it like this" in chat
yeah it looks like he's modifying a java "object" stored in lua
dis me
It's the lua side of the Kahlua java <-> lua interface
but also include metatables which are a confusing lua thing on their own
"lets make Lua an OO language, but... all we have to work with are tables tables and tables."
anything is OO if you ignore enough guard rails
Albion has been a very helpful individual for my modding adventures aswell!!!!
dont really get it, will have to browse the internet for that, but you mean i can change the java side of things? nice ๐
no no no
You're not changing anything in java
only where lua calls java
So that example will work when lua calls DevicePresets.addPreset() but will do nothing if a java class calls DevicePresets.addPreset()
also wenn doing a chanel search, the most helpfull answers are mostly albion or sir doggy ^^
To change a java function when other java code calls it you need a java mod and replace the .class file.
ah ok, thats rather sad, but understandable. still, for a moment i had hope. XD
It's still immensly powerful
has anyone wrapped LuaManager.java to expose additional classes to Lua? I don't think there'd be too many maintenance risks
the only issue with metatables imo is that they're kind of obscure to learn about, ultimately they're just a set of hardcoded names that do hardcoded things
maybe cheat risks depending on what's exposed
i personally like that lua is so consistent that the only data structure ever is a table
if you think about it java is just primitives and Object derivatives
Zomboid is already full of cheat risks... a cheater can just modify java if they want
If you think about it every language is assembly in a fancy outfit.
And assembly is just ones and zeros, which are just a bunch of special rocks that can control lightning.
Writing cheats in Cheat Engine is just modding in assembly.
i can confirm in my three days staying in here that is true
Does anyone other than modders ever use them like we're doing here?
Feel like one of those things where the normal answer is "just write that into your code, don't patch stuff at run time!"
That's why I had a lot of trouble getting the hang of C# reflection... what sane coder would use that when you could just add the stuff you need to the target object?
reflection is a workaround for insufficient api
All my fresh vegies are gone, replaced with this. ๐ฆ
for modding that comes up a lot
yeah kinda
programming in assembly is the worst thing ever though
ive suffered just trying to write simple code
brrr
i guess that's why they call it unstable
most of my runs dont last longer than a month anyways, i doubt i'd suffer from this
I always make a new save right before actually starting to progress
I like exclusively play the game to collect vehicles lol
That would be this mod which does fix capacity in pure lua
https://steamcommunity.com/sharedfiles/filedetails/?id=3452113500
was reading about metatables... so they basically allow you to change behavior of specific tables? idk if there's an analog in other languages for the level of control. maybe c++ for the operator overrides
@ornate basin was asking about this I think
that's poed's mod. it uses the capacity override mod
the main usage is __index can be used to emulate classes
Strange, i just was looking for the IsoGameCharacter, looking for a way to get it ouside of the getdamage event call... then i read a comment from albion how its an abstract class that you cant get. Did i set the param of it the whole time wrong because the doku wrote the wrong thing?
( Me: I trust albion more then the wiki. Wiki: Tell her to write me then! ๐คฃ )
What do you mean "looking for the IsoGameCharacter"?
Do you mean the player object for the active player? That's IsoPlayer
Nothing much, i had it in the ondamage event, so i thought instead of saving the player id save the gamcharacter beforehand, but coudnt find a method to get to it and used the search function. Thats when i stumbled over albions comment on this and was like: damn wiki, you lied to me!
an IsoGameCharacter 'exists', but any IsoGameCharacter is actually an IsoPlayer, IsoZombie etc
And unless you're doing something weird, you want a specifc instance of it (i.e.: tha player you want to affect)
there's no such thing as a pure IsoGameCharacter
getPlayer() will get the active player.
(client side, if your code is running on a server you need to be more specific.. no idea about split screen)
A lot of events or existing code will pass the player object around as well.
shrug dude really? XD come on, im new, but not that new. No, as i said, it was that i found myself scratching my head when looking a bit closer on the ondamage that i was like: hmmmm, how about this (its early in the morning here, so give me a break for having stupid thoughts ^^)
Here, take a look guys, thats what made me write this
character: IsoGameCharacter (JavaDoc) - The character who took damage.
damageType - The type of damage the character took.
"POISON"
"HUNGRY"
"SICK"
"BLEEDING"
"THIRST"
"HEAVYLOAD"
"INFECTION"
"LOWWEIGHT"
"FALLDOWN"
"WEAPONHIT"
"CARHITDAMAGE"
"CARCRASHDAMAGE"
damage: number - The damage that was taken.
from OnPlayerGetDamage event in the wiki
And this is how i set up the header of my ondamage till now:
---@param character IsoGameCharacter
---@param damageType any
---@param damage any
DER.OnPlayerGetDamage = function(character, damageType, damage)
Could be old, could be something that was always wrong on the wiki... could be some weirdness where it casts the IsoPlayer back to IsoGameCharacter.
If lua was strictly typed this would be a lot less messy.
True, its just that i had set my param to isogamecharacter till now never looking at it specific. ^^
And you'd never spend an hour smashing your head on a wall because a vanilla function was passing the player number as player, not the object.
One of the TIS devs uses playerObj and playerNum. I like that person.
avoid using getplayer at all cost
Well, there are also cases where you try to use a function and always get anull pointer, trying for hours and hours till you come here with a white flag and then the code wizards here say: Ah, thats an empty function...
specially if your mod wants to be multiplayer/npc compatible
always try to use the user who called the function in a first place
best practice
I have a feeling that the multiplayer is going to break so many things, but also it's going to be so different from B41 in terms of what to do where and what commands to send that it's not worth trying to plan for now.
But if you have the option of using a player object from a paramater always take that over getPlayer... and most times you can.
yes
you rarely NEED to use getplayer
its more of a lazy practice
but i suffered from it when i enabled NPC mod
getPlayer() is my most used function typing manually on the in-game lua console though. ๐
had to go thru the process of replacing each and every one of getplayers lol
ive never used the lua console honestly
i usually just spam prints when debugging
works most of the time to let me know if shit's actually executing
equip canteen in main hand, getPlayer():getPrimaryHandItem():getFluidContainer():setCapacity(2) and now it holds 2L.
I do that too!
hell yeah
so if you write a mod for multiplayer, but the modul you are usinig with a ongameinit event is client sided, you shoudnt use getplayer?
but sometimes poking things directly helps as well, or I make a special function just to use from the lua console to help me figure out a mod
Think about how it triggers.
welll, getplayer will literally load each and every client's player on MP depending on the context lol
so if one player for example ate poison and you used getPlayer to poison them
you might as well poison others
if you attach code to OnDamagePlayer() you'll have the player object handed to you, if you attach code to OnTenMinutes() you'll have to do a "for each player" loop
i was made aware of this when the stupid NPCs were affecting my character by doing dumb stuff themselves lol
it was kinda funny
Hm, could i just check if im online, use the online player id to look the local player up and save it as a reference?
You could add a check to OnCreatePlayer() that saves the player object if it's the local player.
NPCs are essentially other players so it's actually a great way to test you're doing things relatively okay
Modded NPCs?
Bandits makes the NPCs out of Zombies... so it's funny when the mod breaks and all your near-useless guards revert to zombies.
Or an idle NPC uses zombie idle animations.
Pretty sure I've murded dozens of human who were just sleepy lol
oh i meant more like superb survivors. it uses the deleted NPCs so like
they do act like other players basically
it is how i learned that getplayer is only useful for SP
I've not tried that (other than a short attempt in B41 that exploded everything so I quit)
in other words, the game interprets them as IsoPlayer
so yeah
if you rlly wanna test everything's ok with MP on your mod you could try it with SS in case it isnt anything big
I wonder if the official NPCs will be another class off IsoLivingCharacter
not really how much of good practice is that but that's that lol
didnt even know living character was a thing lmao
Just to make sure my tired brain gets it rigth, but local player is the 'LOCAL' player, not just any player ... right? Oo
IsoAnimal inherits from IsoPlayer
Which mean racoons are higher evolved than players
But that would make sense if the NPC (or animal) can do everything a player can but also needs an AI framework
Because the oncreateplayer event speaksof a player number, which confuses me.
While Zombies are highly stripped down compared to a player.
yeah
I have no idea how player number is assigned, last time I checked in single player my player number was 3
doesn't matter how it gets assigned as long as you can take it and go getPlayerByNum(x) or whenever the function is called
usage of getPlayer doesn't actually affect multiplayer compatibility
Ah, so i should use that instead of the player the function provides? I like saving stuff like that localy to not call up functions all the time.
only splitscreen
but it's bad code style even if you don't plan on supporting splitscreen
no, if a function provides a player use that unless you want to affect someone else
huh, i see
K thx. Just like to be on the saver side of things. To often i spend hours banging my head against a wall becaue i dint pay attention to some little detail. ^^
oh, so it's a "which local player on this client" number?