#mod_development

1 messages ยท Page 319 of 1

icy night
#

I'll test it right now

queen oasis
#
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

silent zealot
#

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

icy night
#

If bomb item scripts list ExplosionPower = 70 then can I use this in a script to get that number: getExplosionPower()

queen oasis
placid quartz
#

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

topaz tangle
#

perfect for all those extra guns you have if you play with gun mods that add alot

placid quartz
#

does the game have a throw animation?

queen oasis
#

all I see is John Wick and now I want to watch the movies again for like the 8th time

placid quartz
#

context: throwing pistol after running out of ammo

topaz tangle
placid quartz
#

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

queen oasis
#

I banged on the keyboard long enough to get it to work. Capacity is correct on the Vehicle Mecahnics UI now

topaz tangle
#

peak!!

silent zealot
#

Put "explosionpower" in the search and you can see that HandWeapon and IsoTrap both have get and set methods for that.

queen oasis
#

I saw script and assumed they meant code since they mentioned HandWeapon, may have been my bad to assume

silent zealot
#

...maybe make it if you click fire twice.

placid quartz
#

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

silent zealot
placid quartz
#

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

topaz tangle
#

accidental trigger makes it funnier

queen oasis
#

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.

silent zealot
#

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.

queen oasis
#

that's my life goal

#

"mod my life"

craggy nacelle
#

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. ^^

silent zealot
# queen oasis "mod my life"

Interesting idea, but I'm not sure how much demand there is for a mod that causes the tired moodle to never go away.

queen oasis
#

I can deal with a tired moodle. It's the hangover moodle I don't like

topaz tangle
#

i love modeling super simple vehicles

queen oasis
#

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;
}
craggy nacelle
#

what is null tough? the container? the getmaxcapacity or the getconditon. and do they all give you a float value back?

queen oasis
#

container:getMaxCapacity() and self:getCondition() return a number so I'm guessing it's getNumberByCondition()

distant inlet
#

have you tried adding prints to pinpoint the nil

silent zealot
#

it has to return a number if it gets called

queen oasis
distant inlet
#

in base game I see Math.round but not Math.max - only math.max (lower)

craggy nacelle
#

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?

silent zealot
#

Is that function somthing to do with capacity reducing with condition?

distant inlet
#

ah wtf didnt notice this was java lol

queen oasis
#

it is, trying to keep the vaniller lower condition

silent zealot
#

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.

queen oasis
#

yea, I almost always have it open

queen oasis
#

if I return just a number, it works.

fiery pecan
#

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...

silent zealot
#

Zones seem weird right now

#

they can overlap, and the Trapping code means in overlapping zones you get a chance for each zone.

fiery pecan
#

mmmm

#

but I'm trying to use a custom zone of type "LootZone".

craggy nacelle
#

so registerzone doesnt work in .42? or did you try a nother aproach?

distant inlet
#

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

fiery pecan
distant inlet
#

that's the only sus thing I can think of

fiery pecan
craggy nacelle
queen oasis
#

I just noticed cond += 20.0F * (100.0F - cond) / 100.0F; wonder if that's it

frank elbow
queen oasis
#

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

queen oasis
#

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
distant inlet
#

UH. maybe instead of self:the_static_function you need to call [the_class].[the_static_function]

fiery pecan
# fiery pecan says it's there.

[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}]

queen oasis
distant inlet
#

isn't self an obj, not the class?

queen oasis
#

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

craggy nacelle
# fiery pecan ```[Zone{name='Police', type='ZombiesType', x=2026, y=5953, w=29, h=35, id=fe104...

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)

fiery pecan
#

well

#

you you know of any rooms on the map that have containers but no zone?

topaz tangle
queen oasis
#

whoop, got a bug in the code where it spawns cars with no tires or gas tank...

fiery pecan
#

oops momento

fiery pecan
#

crazy part is:
LootZed says the container should be using the replacement loot table

craggy nacelle
fiery pecan
#

I did

#

lol

craggy nacelle
#

so, loot zone said forceforzone policelocker and when you used refill container it put kitchen stuff in it? O_o

fiery pecan
#

yes

craggy nacelle
#

thats crazy

distant inlet
#

have you tried VehiclePart.getNumberByCondition(..)?

craggy nacelle
# fiery pecan yes

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...

distant inlet
#

or even just checking if self.getNumberByCondition then print("we good") end

distant inlet
#

no idea what's wrong though. scraping the bottom of the barrel at this point

brave bone
#

quick question: when do you usually use pcall()?

fiery pecan
#

side note: How do I fix the comically large UI?

craggy nacelle
# fiery pecan interesting

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.

fiery pecan
craggy nacelle
#

they are in the lv mal in the gun store if you want to look for them in the game

queen oasis
#

but it's all good. lua works and my cars have tires and gas tanks now

craggy nacelle
queen oasis
#

the eastward progression of test vehicles

coarse sinew
distant inlet
brave bone
craggy nacelle
#

Hm, is it really the forceforzones command then? did you check the distribution table for zone distributions you didnt do youself?

fiery pecan
#

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

craggy nacelle
#

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

fiery pecan
#

hmmm

#

I theorize it's an issue of forceForZones isn't finding the zone.

craggy nacelle
#

I coudnt see the container bottom you showed, did it show the zone there?

fiery pecan
#

I dunno

fiery pecan
#

dunno how to fix...

#

a lot of menus just get cut off like that

craggy nacelle
#

Isnt ther an option in the ui where you can cahnge that? Like font size and stuff?

fiery pecan
#

I mean

#

font size is at 16x

#

the lowest option

uneven stratus
#

anybody know any good tutorials to get started with modding?

craggy nacelle
silent zealot
#

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?

uneven stratus
craggy nacelle
#

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

uneven stratus
fiery pecan
#

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

craggy nacelle
#

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.

fiery pecan
#

oof

craggy nacelle
#

now that i think about it, what happens when you change the loot table manually? so from police to something else and back?

fiery pecan
#

hm?

#

elaborate?

#

like, in the vanilla files?

craggy nacelle
#

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.

fiery pecan
#

all gud

#

I will test and see if it works in the vanilla file though

granite ginkgo
#

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?

fiery pecan
#

editing the vanilla file did nothing

craggy nacelle
#

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...

fiery pecan
#

code search?

#

what?

craggy nacelle
#

you know, either with an external tool, or just load the whole workspace into your ide

fiery pecan
#

hmmm

#

well, it appears to be a bug as far as I gather

craggy nacelle
#

lets assume so till proven otherwise since i lack any other ideas XD

fiery pecan
#

lol

violet laurel
#

Hi
Is B42 still support any kind "all/repeatable" recipes?
i.e. wash all, open all etc

pallid valve
#

i need to be able to pile corpses in shopping carts to clear them out faster

#

that is all

silent zealot
#

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"

pallid valve
#

just wanted to put that idea out there, spending like 4 days in game just dragging corpses to a pile to burn sucks

craggy nacelle
#

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

granite ginkgo
thin swan
broken kayak
#

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.

fiery pecan
#

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

icy night
tardy condor
#

who has a tutorial for splitting files because when I do it correctly it doesn't work even with require

granite ginkgo
#

Does this still work? Pressing enter closes the terminal

silent zealot
#

Do you have localvariables of functions, as in "only for use within this file"?

granite ginkgo
#

testing time

granite ginkgo
tardy condor
# silent zealot You mean a lua file?

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 ^^'

small osprey
#

TIL setGameSpeed(0.51) pauses the game same as setGameSpeed(0) ๐Ÿ˜‰

gilded crescent
#

don't click that, <@&671452400221159444>

slow marten
#

is there a way to get player viewcone and hearing radius with lua? i cant seem to find it in IsoPlayer

thin swan
#

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);```
tardy condor
#

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

topaz tangle
thin swan
tranquil kindle
thin swan
storm trench
#

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.

tranquil kindle
#

Are those cart "clothing items" or more like hand held items?

storm trench
#

"Hand held".

tranquil kindle
#

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

thin swan
#

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?

storm trench
#

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.

winter bolt
thin swan
storm trench
#

Lovely.

slim swan
tranquil kindle
#

Thing is, that cart is not a vehicle

winter bolt
tranquil kindle
#

Its an item

thin swan
slim swan
#

is it possible to let items use the same method as vehicle parts? This issue has been bothering me for a long time.

tranquil kindle
#

For texture changing?

slim swan
#

Cas it would blink when u change the model

tranquil kindle
#

I'm not sure what you mean by vehicle part method to be fair.

slim swan
#

Like the electric weapon I made before,I trying to change the texture on weapon hit,to get a fake light effect

storm trench
# tranquil kindle Which is simply parented to prop1 bone and add all texture variants in XML file,...

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.

tranquil kindle
#

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.

storm trench
broken kayak
#

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 !

thin swan
broken kayak
#

I'll try my hand at controller support before releasing

#

and also inventory tetris support

bronze yoke
#

in build 42 items can have multiple models

#

vanilla examples are the crowbar, hammer, etc

thin swan
storm trench
queen oasis
#

ComboItem's for everyone

#

at least I know why it doesn't work the way I thought it would

icy night
#

How do print messages work? Do they show uo in the console.txt or while in Debug?

bronze yoke
#

both

tranquil kindle
#

Nice

thin swan
bronze yoke
#

i think it's just random

thin swan
#

Ah okay, makes sense

fallen knot
#

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

bronze yoke
#

you can use GameTime.instance.getWorldAgeDaysSinceBegin() % 7 == 0

fallen knot
#

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

bronze yoke
#

if you're in b41 it might not have existed yet

fallen knot
#

yup, I'm in b41

bronze yoke
#

i don't recall seeing it back then

fallen knot
#

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

bronze yoke
#

it'll only affect people who start in 'x months into the apocalypse' scenarios

fallen knot
#

I could also just make my own method maybe

fallen knot
#

let me try decompiling b42

#

i have it in a separate folder after all

#

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

small osprey
#

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 ๐Ÿ˜

main pasture
#

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

small osprey
#

Not a biggy. All good. I run inotifywait and rsync it

queen oasis
#

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?

queen oasis
#

yea, it was a stupid question. Just getText(RD_guid)

getText("RD_6fee6c8a-0cbd-4d13-bc9d-5ec5828e746f")
red tiger
#

I spent the past two weeks rewriting and improving my anti-cheat framework so a lot of kids / cheaters are about to get salty.

topaz tangle
#

doing good work

icy night
#

How can I identify a bomb in a players hand? Is it recognized under getWeapon?

brave bone
#

where can i read about adding mod option in build 42.

bronze yoke
brave bone
orchid quiver
#

Thank you for your suggestion!

fallen knot
#

You're welcome!

fallen knot
orchid quiver
#

Interesting, thank you for clarifying. For whatever reason it resets, maybe I should send this instruction several times for it to work. ๐Ÿค”

thin swan
icy night
#

thanks

fallen knot
#

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

thin swan
fallen knot
#

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)

thin swan
#

Hey that's what communities are for! We're all here to learn and help each other ๐Ÿ™Œ

fallen knot
#

damn this is getting harder to test out lol, the game's lagging a lot after 6 months

#

i'll restart it

silent zealot
fallen knot
#

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

heavy jewel
#

anyone knows a warp zombies function? i an creating a mod.

silent zealot
heavy jewel
#

yeah!!

#

i'm vibe codding, i don't know to mutch on this api

silent zealot
heavy jewel
#

This is in Java, how can I see the Lua version?

bronze yoke
#

this is exposed to lua

heavy jewel
#

I don't understand how it works 100%, first time doing mod

#

I just need a function to warp zombies to coord

fallen knot
#

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

thin swan
fallen knot
#

I see, thanks

thin swan
#

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

fallen knot
#

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

gilded crescent
#

@left plank not sure why this didn't get deleted but it really should

#

no one click that link either

#

Thank youuu

left plank
#

thank you

gilded crescent
#

You're very welcome

fallen knot
#

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

open drum
#

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?

silent zealot
#

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.

open drum
#

yea i agree

silent zealot
#

And if your mod can't work in MP, you just put "Singleplayer only" in the description.

open drum
#

but just wanted to know if it's a possible thing

#

wether if it's a possible concept

silent zealot
#

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

open drum
#

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

silent zealot
#

The client can message server so it makes the same change.

open drum
#

yea but if server file is changed

ancient grail
# open drum Dear fellow modders

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

open drum
#

won't it b applied to all players?

silent zealot
#

Ah, that may be an issue - possible desync if one player only is getting modified animations.

ancient grail
silent zealot
#

Just put "single player only" in the description. ๐Ÿ˜›

open drum
#

yea checksum should b off... that's true

#

haha but i wanted to make it MP T----T

#

sad.. ๐Ÿ˜ฆ

fallen knot
# fallen knot found it

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 :)

open drum
#

what's the mod about?

fallen knot
#

Auto-saving!

open drum
#

ah. xD

fallen knot
#

basically it makes a backup of your savefile every day

#

or, every week, month and even year if you want so

ancient grail
red tiger
#

Been documenting a finished reworked anti-cheat mod.

fallen knot
#

doesn't the game have anticheat by its own ๐Ÿค”

red tiger
open drum
fallen knot
#

I don't play MP but cheaters must be bothersome

#

may your mod work the best

red tiger
#

I run two anti-cheats: one server-side checking network traffic and one client-side checking values and looking for injected cheat functions.

fallen knot
#

nice

red tiger
#

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.

open drum
#

is there a way

#

for a person to turn on

#

build 41, and 42 at the same time?

silent zealot
open drum
#

or do i have to downgrade myself ๐Ÿ˜ฆ

fallen knot
#

yeah frameworks are pretty cool

#

it basically allows stuff to get constantly upgraded without the need of the main creator

red tiger
#

I inject generated strings with varying lengths for commands and handshake encryption keys.

fallen knot
#

is your mod a java one?

red tiger
#

It's going to be a wild ride with these hacker guys.

bronze yoke
#

build 42 has moved a lot of security critical systems to the server

tacit pebble
fallen knot
#

i'd guess so

red tiger
#

Server-side on client needs an API for kicking players. Client-side no.

fallen knot
open drum
fallen knot
#

i witnessed myself how awful it is to decompile java and then pray to recompile it unhappy

red tiger
#

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.

silent zealot
red tiger
#

I've cleaned files for many people over the years.

fallen knot
#

miraculously, though, exactly the one file i needed to make all of my mod was able to get compiled

silent zealot
#

I used ZomboidDecompiler, and so far I've only tried that one file

fallen knot
#

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

#

๐Ÿ™‡โ€โ™‚๏ธ

silent zealot
#

Of course the weird frankestein works, Zomboid is coded in frankestein.

open drum
red tiger
fallen knot
#

i really hope the file i modified has absolutely no changes in b42

#

itd save my time a lot

open drum
#

kinda having trouble in fully understanding what audited client-key fragment really mean atm.

red tiger
#

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.

fallen knot
#

key key key key

red tiger
#

So a string for server and client.

open drum
#

english??

#

ah

fallen knot
#

haha

red tiger
#

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.

open drum
#

ty for toning down to ordinary newb language..

red tiger
#

All good. I'm so deep in this that I can't honestly talk like a normal person about it.

fallen knot
#

Hey, been there

red tiger
#

The code is documented though.

fallen knot
#

being a programmer and having big, long, complex code that works perfectly feels like heaven

#

you just get all nerdy about it

red tiger
#

I made it so people can write custom modules and modify the key-generation for their server without uploading a new workshop mod.

fallen knot
#

that's pretty rad

red tiger
#

The anti-cheat itself is hosted on the server's filesystem and is fetched and sent to clients when logging in.

open drum
#

will that work in build 42 as well?

red tiger
fallen knot
#

honestly, so many cool mods have been coming out for b42-only

open drum
#

gotcha

fallen knot
#

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

open drum
#

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... ๐Ÿ˜ฆ

fallen knot
#

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

silent zealot
#

Very important to test your mods.

#

Night fighting by high-beams.

red tiger
silent zealot
#

I installed a 360ยฐ mod to help testing and playing with it.. I can't decide if I hate it or not.

red tiger
#

Abandon the flesh.

fallen knot
#

i like the extra zoom, thats about it

#

being able to zoom in closer is nice to save fps lol

silent zealot
#

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.

red tiger
fallen knot
#

big hordes, many mods

fallen knot
#

๐Ÿ˜”

silent zealot
#

I like this for my Omnissiah soundtrack

fallen knot
silent zealot
fallen knot
#

haha reddit get it

red tiger
#

x)

#

Wrote Candle, a project that reflects all Java API into Lua typings. Also TypeScript. Now also Python.

fallen knot
#

you monster

red tiger
# silent zealot https://www.youtube.com/watch?v=aJIDqYZ7qM0

#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...

โ–ถ Play video
red tiger
# silent zealot https://www.youtube.com/watch?v=aJIDqYZ7qM0

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...

โ–ถ Play video
fallen knot
#

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

red tiger
#

Also look up Prometheus Studio on YouTube for 40K-inspired works.

fallen knot
#

endlessly slow movement, torture

open drum
#

lol im added all these into my playlists now XD

fallen knot
#

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

red tiger
#

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...

โ–ถ Play video

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...

โ–ถ Play video

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...

โ–ถ Play video
fallen knot
#

whoa

red tiger
#

I'm ritualistic in the music I select for the types of coding sessions I do.

#

Been that way for 12 years.

fallen knot
#

cant say that doesnt work

#

coding with breakcore is fun

red tiger
#

There's a few good stuff there.

fallen knot
#

makes you feel like you're speedrunning

#

welp, gotta go eat

#

good night y'all, keep on moddin'

red tiger
fallen knot
fallen knot
silent zealot
#

Thansk for music @red tiger . I'm going to put some of that on and then... do some of my actual job. ๐Ÿ˜ฆ

red tiger
#

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...

โ–ถ Play video
#

Hopefully this helps out people who need to isolate from the world to get work done.

topaz tangle
#

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

red tiger
#

=)

topaz tangle
#

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!

silent zealot
red tiger
#

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.

topaz tangle
#

My personal rule is weather or not it reasonably couldโ€™ve been in American during 1993

silent zealot
#

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.

silent zealot
#

Based on my loot collection.

topaz tangle
#

Quite funny

silent zealot
#

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. ๐Ÿ˜‚

silent zealot
#

Adding AttachmentType = Rifle does let you wear a skateboard on your back...

slow marten
#

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.

silent zealot
#

stressed stressed THATS IT I AM MAKING A MOD TO CAP STRESS FROM ZOMBIES THUMPING ON THINGS! stressed stressed stressed

#

I walked too close to a building full of zombies and instantly jumped to full panic.

gilded crescent
#

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

sonic needle
ancient grail
silent zealot
gilded crescent
silent zealot
#

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

gilded crescent
#

that'd be pretty cool

thin swan
silent zealot
#

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.

thin swan
#

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

ornate basin
#

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

ornate basin
#

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

teal olive
#

if someone would like to, please i need saab mods and more volvo mods

hasty wharf
#

someone can help me in the mod supp discussion pls?

karmic cobalt
#

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.

thin swan
hasty wharf
#

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 ๐Ÿ˜ฆ

ornate basin
thin swan
# hasty wharf im not understanding how to put my mod on workshop...it's a manual installing mo...

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

thin swan
ornate basin
#

works for me

thin swan
# ornate basin 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?

ornate basin
#

EU

thin swan
#

Well damn, same

ornate basin
#

just wait it out

#

it'll probably fix itself

gilded crescent
#

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

thin swan
#

I think they just fixed it, it's working now ๐Ÿ˜„

gilded crescent
#

perfect timing lol

hasty wharf
gilded crescent
#

Each version gets it's own mod.info file basically and the main mod folder can also be used for 41

hasty wharf
#

@gilded crescent riesci a darmi una mano in pvt?

gilded crescent
pseudo warren
#

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

queen root
#

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?

hasty wharf
tranquil kindle
small osprey
hasty wharf
#

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

small osprey
#

Interesting. Not a Java pro here. You took some measurements?

hasty wharf
#

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.

small osprey
#

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 spiffo ! Others here have much more experience and can give you more qualified feedback.

p.s.: welcome to the community!

hasty wharf
#

thanks ๐Ÿ™‚ im trying to help

craggy nacelle
#

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.

bronze yoke
#

if there's three zombies attacking you at once you instantly die

#

it's extremely rare to actually die of damage

craggy nacelle
# bronze yoke if there's three zombies attacking you at once you instantly die

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. ^^

craggy nacelle
#

yeah, played forever without even knowing that one. XD

bronze yoke
#

you can turn it off, you'd usually get stunlocked instead anyway

#

but i've never felt combat really needed to be easier ๐Ÿ˜…

craggy nacelle
#

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

craggy nacelle
#

Urgh, sorry for tagging you, that wasnt meant to be. ๐Ÿ˜•

bronze yoke
#

dw!

rose dew
#

does anyone know where you can find weapon stats in the game code?

thin swan
rose dew
#

yeah

thin swan
# rose dew 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

rose dew
#

is it 2 for short and long weapons

#

or for every skill

thin swan
#

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

craggy nacelle
#

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?

bronze yoke
#

the game calls it 'drag down'

craggy nacelle
#

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.

thin swan
fallen knot
#

playtesting my mod for b42; So far, it's working

lol, didn't know they had added fire rubber duckies in it

fallen knot
#

oh nice, hadnt noticed you could set your own seed now

#

that's cool

small osprey
red tiger
#

Finally taking a short break after a ~200 hour mod project. woohoo

#

Can't wait to watch all the cheaters get flipped.

fallen knot
#

it's done for B41 actually

small osprey
fallen knot
small topaz
#

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?
fallen knot
#

so i was just fixing that

red tiger
#

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.

fallen knot
small osprey
fallen knot
#

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

fallen knot
#

i get a bug just by opening the mod menu

bronze yoke
fallen knot
#

lol

fallen knot
#

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

small topaz
red tiger
fallen knot
#

zomboid decompiler did just fine

#

funny that it works better with b42 than b41

small osprey
red tiger
#

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.

bronze yoke
fallen knot
#

Yeah, i barely had any problems with b42

#

compared to b41

#

i see why now

red tiger
#

?

small osprey
#

oopps wrong mention.

fallen knot
#

it's not that b41 is unusable, just more buggy

bronze yoke
#

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

red tiger
fallen knot
#

makes sense

small osprey
red tiger
#

Upgrading the anti-cheat was a detour.

fallen knot
#

pretty good job by the way, it manages to stay simple for a decompiler

red tiger
#

Back to fighting the war of documentation.

bronze yoke
#

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

fallen knot
#

and since i had to playtest b42, i get to share my thoughts on it after a good while

red tiger
#

I still haven't played 42 yet. =(

fallen knot
#

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

red tiger
#

Lost and deep in the trenches of code.

fallen knot
#

oh also the new aiming system is fun

bronze yoke
#

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

fallen knot
#

hmm, sounds tedious

red tiger
#

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.

bronze yoke
#

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

red tiger
#

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.

bronze yoke
small osprey
red tiger
bronze yoke
#

i'm sure we could use rosetta data to resolve java types

red tiger
#

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;
bronze yoke
#

yeah that's what i had in mind

red tiger
#

Lua makes it even easier to discover because of the syntax.

#

PZ needs the custom flavor of Roblox Lua.

mellow frigate
red tiger
# mellow frigate I do not understand the point. if the decoding is done client side from a sent k...

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.

bronze yoke
red tiger
#

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.

small topaz
red tiger
#

@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.

mellow frigate
red tiger
#

With build 41 moving a lot of key functions of the game to client-authority, the server became severely limited in its cheat-detection.

rose dew
#

anyone know where to find the Occupation images in the code

mellow frigate
red tiger
#

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.

mellow frigate
red tiger
#

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.

red tiger
#

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.

mellow frigate
red tiger
#

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.

frank elbow
#

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

storm trench
#

At least that is my understanding of what has gone down.

silent zealot
#

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 ๐Ÿ˜ฆ

storm trench
silent zealot
#

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)

storm trench
#

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.

storm trench
#

Anybody know a mod that uses multiple textures for the same item? I'd like to look at their implementation.

silent zealot
storm trench
silent zealot
#

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.

jolly comet
# storm trench Not necessarily anymore. The majority of the work between B41 and 42 was to expe...

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.

ornate basin
#

Is it true that b42 is limiting all containers to be 50 max capacity? Why is that if so

storm trench
ornate basin
#

Why

#

Like why would they enforce that

storm trench
distant inlet
storm trench
gilded crescent
#

yeah that's not an unreleased change or anything, thats been like that since 42's release to unstable

distant inlet
storm trench
distant inlet
#

not sure if related but there's a [self-described] WIP mod for B42 capacity: https://steamcommunity.com/sharedfiles/filedetails/?id=3452113500&searchtext=weight

ornate basin
# storm trench I wish I knew, too.

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

storm trench
ornate basin
#

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

storm trench
ornate basin
#

I thought you needed to fuck with game files

#

if so it's not a big deal then ig

storm trench
#

It's buggy and broken and full of issues.

ornate basin
#

ah well

#

that sucks

#

I just want chickens and a locker with 1000 capacity worth of eggs

#

is that too much to ask for

distant inlet
#

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)

storm trench
topaz tangle
#

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!!!!!

silent zealot
storm trench
storm trench
silent zealot
#

It's LUA, but instead of patching the lua functions in 50 places it patches the lua -> java call

topaz tangle
silent zealot
#

Using Albion's magic

#

Which is nice and simple if you copy-paste the sytax, and a WTF of weird-ass lua quirks otherwise.

storm trench
silent zealot
storm trench
silent zealot
#

He's not gatekeeping, we just don't understand his wisdom ๐Ÿ˜‚

storm trench
#

Uhhh huhhh. The only thing Albion imparts on me half the time is confusion hahaa.

#

And I mean that endearingly hahaa.

silent zealot
#

local index = __classmetatables[DevicePresets.class].__index said no-one sane, ever...

silent zealot
#

...why did 42.7 sawn a zombie in my closet?

topaz tangle
topaz tangle
#

Same shaped hoods

silent zealot
#

$@#%^@#!

#

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.

silent zealot
#

Albion's magic!

distant inlet
#

any particular mod of his?

silent zealot
#
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

steep cliff
silent zealot
#

That example changes DevicePresets.addPreset()

#

Same as modifying lua functions, but you're modifying the lua functions that interact with java.

distant inlet
silent zealot
#

I think everyone assumes it's not possible, then Albion just casually drops "no, you can do it like this" in chat

distant inlet
#

yeah it looks like he's modifying a java "object" stored in lua

silent zealot
#

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."

distant inlet
#

anything is OO if you ignore enough guard rails

topaz tangle
craggy nacelle
silent zealot
#

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()

craggy nacelle
#

also wenn doing a chanel search, the most helpfull answers are mostly albion or sir doggy ^^

silent zealot
#

To change a java function when other java code calls it you need a java mod and replace the .class file.

craggy nacelle
silent zealot
#

It's still immensly powerful

distant inlet
#

has anyone wrapped LuaManager.java to expose additional classes to Lua? I don't think there'd be too many maintenance risks

bronze yoke
#

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

distant inlet
#

maybe cheat risks depending on what's exposed

bronze yoke
#

i personally like that lua is so consistent that the only data structure ever is a table

distant inlet
silent zealot
silent zealot
#

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.

fallen knot
silent zealot
#

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?

bronze yoke
#

reflection is a workaround for insufficient api

silent zealot
#

All my fresh vegies are gone, replaced with this. ๐Ÿ˜ฆ

bronze yoke
#

for modding that comes up a lot

fallen knot
#

programming in assembly is the worst thing ever though

#

ive suffered just trying to write simple code

#

brrr

fallen knot
#

most of my runs dont last longer than a month anyways, i doubt i'd suffer from this

topaz tangle
#

I always make a new save right before actually starting to progress

#

I like exclusively play the game to collect vehicles lol

distant inlet
#

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

distant inlet
queen oasis
bronze yoke
craggy nacelle
#

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! ๐Ÿคฃ )

silent zealot
#

What do you mean "looking for the IsoGameCharacter"?

#

Do you mean the player object for the active player? That's IsoPlayer

craggy nacelle
#

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!

bronze yoke
#

an IsoGameCharacter 'exists', but any IsoGameCharacter is actually an IsoPlayer, IsoZombie etc

silent zealot
#

And unless you're doing something weird, you want a specifc instance of it (i.e.: tha player you want to affect)

bronze yoke
#

there's no such thing as a pure IsoGameCharacter

silent zealot
#

(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.

craggy nacelle
# silent zealot `getPlayer()` will get the active player.

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)

silent zealot
#

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.

craggy nacelle
#

True, its just that i had set my param to isogamecharacter till now never looking at it specific. ^^

silent zealot
#

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.

fallen knot
#

avoid using getplayer at all cost

craggy nacelle
#

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...

fallen knot
#

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

silent zealot
#

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.

fallen knot
#

just take it east

#

easy

#

take it east sounds funny

silent zealot
#

But if you have the option of using a player object from a paramater always take that over getPlayer... and most times you can.

fallen knot
#

you rarely NEED to use getplayer

#

its more of a lazy practice

#

but i suffered from it when i enabled NPC mod

silent zealot
#

getPlayer() is my most used function typing manually on the in-game lua console though. ๐Ÿ˜›

fallen knot
#

had to go thru the process of replacing each and every one of getplayers lol

fallen knot
silent zealot
#

It can be really helpful for debugging

#

or just hacking up things quickly in game.

fallen knot
#

i usually just spam prints when debugging

#

works most of the time to let me know if shit's actually executing

silent zealot
#

equip canteen in main hand, getPlayer():getPrimaryHandItem():getFluidContainer():setCapacity(2) and now it holds 2L.

silent zealot
fallen knot
craggy nacelle
#

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?

silent zealot
#

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

fallen knot
#

so if one player for example ate poison and you used getPlayer to poison them

#

you might as well poison others

silent zealot
#

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

fallen knot
#

it was kinda funny

craggy nacelle
#

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?

silent zealot
#

You could add a check to OnCreatePlayer() that saves the player object if it's the local player.

fallen knot
#

NPCs are essentially other players so it's actually a great way to test you're doing things relatively okay

silent zealot
#

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

fallen knot
#

they do act like other players basically

#

it is how i learned that getplayer is only useful for SP

silent zealot
#

I've not tried that (other than a short attempt in B41 that exploded everything so I quit)

fallen knot
#

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

silent zealot
#

I wonder if the official NPCs will be another class off IsoLivingCharacter

fallen knot
#

not really how much of good practice is that but that's that lol

fallen knot
silent zealot
#

Hmmm.

craggy nacelle
#

Just to make sure my tired brain gets it rigth, but local player is the 'LOCAL' player, not just any player ... right? Oo

silent zealot
#

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

craggy nacelle
#

Because the oncreateplayer event speaksof a player number, which confuses me.

silent zealot
#

While Zombies are highly stripped down compared to a player.

silent zealot
#

I have no idea how player number is assigned, last time I checked in single player my player number was 3

fallen knot
#

shrugs

#

i only know there can be up to 4

#

local players

silent zealot
#

doesn't matter how it gets assigned as long as you can take it and go getPlayerByNum(x) or whenever the function is called

bronze yoke
craggy nacelle
#

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.

bronze yoke
#

only splitscreen

#

but it's bad code style even if you don't plan on supporting splitscreen

silent zealot
#

no, if a function provides a player use that unless you want to affect someone else

craggy nacelle
#

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. ^^

silent zealot
fallen knot
#

thanks for correcting me

#

saying missinfo online aint fun ๐Ÿ˜”

#

i guess SS is a good way to test local multiplayer compatibility then... even though barely anyone uses it LOL