#mod_development

1 messages · Page 282 of 1

bronze yoke
#

you'd have to upload it as a mod yeah

kindred grove
#

Ah yeah. Different issue appears. It didn't auto update but now tells me I don't have it installed. I'll have to publish my own version.

crystal canyon
#

i meant unlisted, not hidden

#

I did something similar when one of my favorite map mods disappeared, Stonehill Apartments

#

had to reupload it as unlisted so me and my brother could keep playing

rare saddle
#

Halp. I updated my mini-mod, signed up on Steam page to check how it works, but in the game in the mods menu it is not shown (there are generally only ~40 mods and there are already about 900 for b42 in Steam), I need to look for it in the search bar and only then I can see it and activate it. Is this the case with everyone?
Your mods are also not in the list after subscribing to Steam?

crystal canyon
#

they are usually up right away, unless you have links in the description then it might take a little bit while the content verification checks that links are not malicious

icy yarrow
#

Can take a long time if you put a private gitHub link...really trips the steam verification up

crystal canyon
#

I think I might have found a bug

#

LOG : General f:0, t:1735267741127> Unable to load video texture C:\Games\Steam\steamapps\common\ProjectZomboid\media\videos\media\maps\FishermansCabin\FishingCabin.bik.

Seems the path for the demoVideo is hardcoded

title=Cabin Spawns: Fisherman's Cabin
lots=Muldraugh, KY
description=
description= 
description= 
zoomX=11063
zoomY=10637
zoomS=14.5
demoVideo=media/maps/FishermansCabin/FishingCabin.bik
rare saddle
#

I mean do you guys see your mods in this list after signing up in steam or do you have to use search too?

crystal canyon
#

i see mine

icy yarrow
#

I'm confused on what specifically you are asking

crystal canyon
#

seems they uploaded a mod to the WS, subscribed to it, but cant see it in their mod list

#

only when searching for the mod in the mod manager it is visible

kindred grove
#

Not extremely descriptive.

#

Somewhere I can find more output?

silent zealot
#

Fun Fact: the new aiming system means if you target a zombie near your vehicle it's possible to hit the vehicle and set tire condition to zero, but not actually destroy the tire.

#

Less Fun Fact: North Muldraugh to South Muldraugh on foot at night is scary

#

actually that is kinda fun... gotta create those memorable zomboid moments somehow, and an easy loot run where nothing goes wrong is not very memorable.

rare saddle
# icy yarrow I'm confused on what specifically you are asking

Sorry, I'm using a translator.I'll try again: I signed up for a mod in steam, then I opened the game and I don't see it in the mod list if I scroll down. I have to use the search bar to find my mod and then enable it. Like I said, as far as I remember - in b41 you just have to subscribe to steam for it (mod) to work in the game

crystal canyon
kindred grove
silent zealot
silent zealot
#

And are there any non-english characters in the mod name... that sems to mess up the list of mods

drifting ore
#

hay so my map mod is crashing on game load up for b42.

crystal canyon
#

map mods dont work on 42 yet

silent zealot
#

Spawn location mods are working (technially maps, but not really) and I have seen B42 map mods on steam but not tried them

crystal canyon
#

interesting

#

I wonder what they edited

drifting ore
#

this isnt the only one ether.

icy yarrow
#

there is an unstable tool supposedly

flat relic
#

yes, on github

#

mileage may vary

icy yarrow
#

All the ones I've seen updated have issues from what their author said

restive lodge
#

Hey everyone,

I'm trying to add an overlay to a door frame as part of a mod I'm developing. This is my first time modding PZ, so I’m not sure if I’m on the right track.

Here’s the situation:

-I have a custom image, wuw_test_overlay.png, located in media/textures.
-My mod adds a security clearance system to doors. Players’ clearance levels are tied to their ID cards, so without the right card, they can’t enter.
-After right-clicking a door to set its clearance level, I use the door’s square coordinates to find door frame objects (WallType=doorframe), and I’m attempting to add a sprite overlay (a card scanner) near the door handle.

What I’ve done so far:

The overlay is added with setOverlaySprite, and when inspecting the tile, I can see:

[MAIN] walls_interior_house_03_11
[OVERLAY] wuw_test_overlay
[ATTACHED] overlay_grime_wall_01_27

However, hovering over [OVERLAY] wuw_test_overlay shows no image. It seems the sprite isn’t rendering, even though the name is correctly assigned.

elfin stump
#

Does anyone know how many IsoGridSquares are in an IsoChunk?

restive lodge
#

Here’s the relevant code I’m running:

local function attachOverlayToObject(object, overlayObjectName)
    if object then
        object:setOverlaySprite(overlayObjectName, 1, 1, 1, 1);
        object:transmitUpdatedSpriteToClients()
    else
        WUWUtilities.DebugLog("Object is nil. Cannot attach overlay.", 3)
    end
end

local function addOverlay(player, args)
    if not args or not args.x or not args.y or not args.z then
        WUWUtilities.DebugLog("Missing or invalid arguments for AddOverlay().")
        return
    end

    local sq = getCell():getGridSquare(args.x, args.y, args.z)
    if not sq then
        WUWUtilities.DebugLog("GridSquare is nil at coordinates: " ..
            tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z), 3)
        return
    end

    WUWUtilities.DebugLog("Searching for doorframe on GridSquare at: (" ..
        tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z) .. ")")

    for i = 0, sq:getObjects():size() - 1 do
        local object = sq:getObjects():get(i)

        if object then
            local objectProps = object:getProperties()
            local spriteProps = object:getSprite() and object:getSprite():getProperties()

            -- Check Object Properties
            if objectProps then
                if objectProps:Is("WallType") and objectProps:Val("WallType") == "doorframe" then
                    WUWUtilities.DebugLog("Found door frame on object properties at: (" ..
                        tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z) .. ")")
                    attachOverlayToObject(object, "wuw_test_overlay")
                    return
                end
            end
        end
    end

    WUWUtilities.DebugLog("No door frame found at coordinates: " ..
        tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z), 1)
end
#

Can overlays like this work directly with a standalone .png in media/textures, or do I need to define it in a tile pack or some other registration system?
Is there something I’m missing in how I’m applying the overlay, or how PZ handles tile overlays?
Any help is greatly appreciated as I've been stuck for a while now.

flat relic
elfin stump
#

The tool is called "TileZed"

#

If I remember that is what I used to pack image information into a special type of compressed file, I forget the extension, a .pack or .pak file maybe?

#

Start there for new tiles ^ @restive lodge

restive lodge
icy yarrow
#

I need to learn the tiled tool. Seems so confusing to me

elfin stump
#

That page has a good breakdown of it, if I remember right one of the pains is making sure to use the right template and to be very good at keeping track of those layers 🙂

icy yarrow
#

Lack of jurassic park merchandise in July 1993 has always been disturbing

rare saddle
#

Okay(no). I'm unsubscribed from game list and from steam but i still can see my mod in list, idk how this list updates works but rn all fine. Anyway, thank you all)

elfin stump
kindred grove
#

Anyone have an issue publishing a mod and the server failing to download it from the workshop?

icy yarrow
#

can you manually place it on your server?

kindred grove
#

I suppose I can try. Will it serve it to new players automatically?

#

under workshop/content/<workshopID> ?

icy yarrow
#

I have no idea

velvet forge
#

I would like to know how many times the number of zombies is greater, in the insane option

#

it would be 3x, 4 or 7 compared to vanilla

crystal canyon
#

hahahaha I definitely need to add a script to clear a radius around you for these spawns...

#

this is the remote cabin west of muldraugh

eager imp
#

for cycling do you think i should tie runner or fitness to bike stuff? like i get fitness but could runner also be tied into? like speed?

crystal canyon
#

I say fitness

eager imp
#

hrm yeah if i tie in runner it would also be less intuitive

crystal canyon
#

not all cyclists are good runners but most runners can be good cyclists personal opinion not backed by facts

eager imp
#

lmao

#

no worries

#

i think you are right

#

i might book mark the idea if i ever need it for some reason

open drum
#

heaya fellows

#

i have a question about obejct contruction method in pj

#
    local square = getCell():getGridSquare(x, y, z)
    if not square then return nil end
    local isoObject = IsoObject.new(square, spriteName, objectName, false)
    square:AddTileObject(isoObject)
    return isoObject
end```
bronze yoke
#

```lua needs to be on its own line

open drum
#
local function newObject(x, y, z, spriteName, objectName)
    local square = getCell():getGridSquare(x, y, z)
    if not square then return nil end
    local isoObject = IsoObject.new(square, spriteName, objectName, false)
    square:AddTileObject(isoObject)
    return isoObject
end```
#

thanks

#

anyways, this newobject function

#

etc

#

where is this class made in?

#

can I just do custom name .new() to create any type of obejcts?

bronze yoke
#

all java public constructors are exposed as Class.new()

open drum
#

i see

bronze yoke
#

you can see constructors on the javadocs but they'll be written there as new Class() because that's the java syntax

open drum
#

but where are those square, spritename, objectname parameters are handled in??

#

like (as a noob modder) .. i thought u need to inherite following functinons

#

from a parental document

#

so i thought to expect something like "IsoObject = ISObject(IsoObject) " to b declared somewhere

#

to make it work.. but i couldn't find it

#

maybe im asking really stupid question...

bronze yoke
#

they're implemented in the java side of the game, they aren't lua code

open drum
#

i see

#

so they are from some .class file?

bronze yoke
#

yeah

open drum
#

then why don't i see things like

#

ISButton = ISPanel:derive("ISButton");

#

for things like

#
local function newBBQPropane(x, y, z)
    local square = getCell():getGridSquare(x, y, z)
    local object = IsoBarbecue.new(getCell(), square, getSprite("appliances_cooking_01_37"))
    square:AddTileObject(object)
    return object
end```
#

like.. IsoBarbecue = IsoObject:derive("IsoBarbecue")

#

it does'nt matter what name goes before ".new" ??

#

they just automatically considered as object?

bronze yoke
#

IsoBarbecue is java so it's in a .class file, :derive() is for creating lua classes

open drum
#

when .new() function is called?

#

ah

#

then if I wanted to do like

#
local obejct = CustomNAME.new(cell,squre,getsprite)```
#

it will cause error?

bronze yoke
#

yeah

open drum
#

i see

#

then which file should i study on to make it possible?

worn mica
#

is it currently possible to set Autolearn similar to Recipe_:addRequiredSkill(Perks.Cooking, RequiredLevel_)?

open drum
#

just realized u can just use lua local isoObject = IsoObject.new(square, spriteName, objectName, false)

kindred grove
#

Does modifying the Zomboid.ini require a restart?

undone elbow
#

Does anybody know how MainScreen.instance can be nil?

#

My code is simple:

if not MainScreen.instance.inGame then

But somehow it causes the error:

attempted index: inGame of non-table: null
bronze yoke
#

the main screen isn't loaded until OnMainMenuEnter or OnGameStart

undone elbow
#
local function KeyUp(keynum)
    if not MainScreen.instance.inGame then
        return
    end
#

I guess it's a mod incompatibility, but users can't catch the bad mod and STACK TRACE in log doesn't help too.

restive lodge
plucky junco
#

hi, I've a question, before in the 41 the walls basic health were wrote in a lua file (i'm not able to code in lua, I just can play around a little) is it possible that now on the 42 are in a script?

#

i've found this

finite radish
# worn mica is it currently possible to set Autolearn similar to Recipe_:addRequiredSkill(Pe...

was curious so I looked into this. here's the bits from the parser that handle it:

else if (var5.equalsIgnoreCase("AutoLearn")) {
    this.autoLearn = new ArrayList();
    String[] var16 = var6.split(";");

    for(int var19 = 0; var19 < var16.length; ++var19) {
       String[] var21 = var16[var19].split(":");
       PerkFactory.Perk var23 = PerkFactory.Perks.FromString(var21[0]);
       if (var23 == PerkFactory.Perks.MAX) {
          DebugLog.Recipe.warn("Unknown skill \"%s\" in recipe \"%s\"", var21[0], this.name);
       } else {
          int var25 = PZMath.tryParseInt(var21[1], 1);
          RequiredSkill var27 = new RequiredSkill(var23, var25);
          this.autoLearn.add(var27);
       }
    }
}

without a proper example, I have no idea why it's trying to split on a semicolon in Lua unless it's some sort of weird varargs implementation, so I got kinda lost there, but you can probably just recreate the functionality without all the parsing by doing this:

local reqSkill = RequiredSkill.new(Perks.Woodwork, 5)
myRecipe.autolearn:add(reqSkill)

as long as myRecipe is a CraftRecipe object
(edit: whoops, wrong java codeblock, but they're pmuch the same. fixed though)

#

hopefully that's at least enough of a hint to get you in the right direction, if that doesn't work.

open drum
#
    local square = getCell():getGridSquare(3433,10904, 0)
    if not square then return nil end
    local texture = getTexture("media/textures/Build_Cross.png")
    local isoObject = IsoObject.new(square,texture, "hello", false)
    square:AddTileObject(isoObject)
    return isoObject
end``` why would this cause error
finite radish
bronze yoke
open drum
#

ah,,

#

true

#

but "media/textures/Build_Cross.png" this wouldn't work

#

if i put it directly either right?

#

tried and confirmed it's not working

#

saying no implementation found

#

i guess it only takes tile name only...

bronze yoke
#

yeah it takes a tile name

open drum
#

i thought it would work because i was reading the old Object Tutorial files

#
-- adding blue cube
                local obj = IsoObject.new(cell, sq, Cubes.sprites.blue.sprite);```
#

so it would still work but i guess new versions are changed

tacit pebble
#

texture:getName() doesn't work too? I'm curious.
it should work if second arg is for texture name. idk if it's not for texture

open drum
#

well, it's not producing any error

#

but doesn't spawn anything on the square

#

so i guess it' needs to be set as sprite

bronze yoke
#

it needs to be the name of a tile, that constructor loads the object properties from that tile

open drum
#

i see

#

guess no simple, putting .png image file in a folder and make it work

#

do the trick...

#

has putting Tile files stay unchanged from build41?

bronze yoke
#

yeah

open drum
#

gotcha

pulsar pagoda
#

anyone know why my character doesnt scream the sound i want?

worn mica
finite radish
#

that class is exposed and the list is public, so it should work, but you might need to see if you can find any similar patterns.

bronze yoke
#

you can't access fields easily without mods

finite radish
# bronze yoke you can't access fields easily without mods

weird. i guess I forgot about that. what allows syntax like this to work, from vanilla?

local list = ArrayList.new();
  for index,item in ipairs(_items) do
    list:add(item);
end

is it an issue of it being passed via copy or something like that? e.g. list is now just a lua table more or less that contains the modified object, so you'd have to reassign it like javaObj.fooList = list?

bronze yoke
#

they just aren't exposed

#

there's some weird reflection api you can use to get fields instead but it's a nightmare

#

something like this```lua
local autolearn
local fields = getNumClassFields(myRecipe)
for i = 0, fields do
local field = getClassField(myRecipe, i)
if string.match(tostring(field), "some posix pattern idr") == "autolearn" then
autolearn = getClassFieldVal(myRecipe, i)
break
end
end

#

my library just lets you do myRecipe.autolearn like you would expect

#

and does some precaching and stuff to improve the performance a whole bunch over this monstrosity

finite radish
# bronze yoke they just aren't exposed

the class being exposed doesn't expose all the public members? or is it a matter of like... well, I was going to say ArrayList not being exposed, but the snippet I just posted kinda proves that wrong I guess.

bronze yoke
#

arraylist is exposed, it's just that the exposer just doesn't expose fields whatsoever

#

only public methods are exposed

finite radish
#

ah okay, that makes sense. so even public fields are basically treated as encapsulated

#

that blows honestly but I guess I get it, just weird since that's like the whole point of field protection keywords

bronze yoke
#

keep in mind that field access even through this is strictly read-only (but that's generally fine since we're usually just trying to reach objects anyway)

finite radish
#

does that mean "read only" as in, the collection itself is immutable (no add) or the members are read-only? kinda specific to collections I guess but still

#

(or both, which would be the strictest, I suppose)

bronze yoke
#

just that the field itself is read-only, you can't do myRecipe.autolearn = ArrayList.new()

#

but since the field here is an object, you can modify the object just fine

#

you just can't assign a new object in its place

finite radish
#

ah okay, that makes sense, just no reassignment. thanks for explaining all that

grave nest
#

what is a good workflow to work on mods ? Launch game, edit lua file, reload file from F11 menu, etc... ?

#

is there a way to remote debug the lua file from vscode for example ?

bronze yoke
#

main menu reloads/f11 reloads when they work for you

#

unfortunately because of the way the game uses lua remote debugging will probably never be possible

#

but there is an improved debugger expected eventually

grave nest
#

ok thanks. is there a way to import compiled lua modules too, or is that out of questoin

bronze yoke
#

no way

grave nest
#

ok

#

and I suppose nobody tried, for fun, to import some python interpreter into this ?

bronze yoke
#

bytecode compiled for other lua implementations (pz uses a weird niche one that, as far as i can tell, literally nothing else notable has used) wouldn't be compatible and functions related to bytecode dumping/loading have been blocked off anyway

tulip cipher
#

I would suggest making completely bug free code! /S (F11 reloading always took my ass forever)

bronze yoke
grave nest
#

but wait, how do the core devs work then ? they launch a game and edit .lua files and hit reload ?

#

with only print statements for debugging ?

bronze yoke
#

as far as we can tell, probably yeah

grave nest
#

wtf

bronze yoke
#

afaik the community tools are probably more advanced than what they use 😅

tulip cipher
#

There's a good chance

grave nest
#

that's sad for them

#

and development times lol

tulip cipher
#

I remember using them a year ago and they were still well put together then

grave nest
#

using what ?

tulip cipher
#

The map editor and such

grave nest
#

ah ok

tulip cipher
#

If I remember correctly the indie stone have 1 guy doing the tools for the game

#

I regretfully don't remember their name would have to look at the credits again

bronze yoke
#

i was mostly referring to umbrella and the various bits of community documentation

paper steeple
#

What does the following mean?

attempted index: setVehicle of non-table: null

Many mods in Build 42 seem to cause an issue where vehicle dashboards don't load. The first mod I have encountered which caused this was More Traits, and the odd thing is it continued to happen even after disabling the mod and creating a new save. Currently, I am having this issue while attempting to port a Build 41 mod for my own use. I have found two files the larger error refers to: ISEnterVehicle.lua and ISVehicleDashboard.lua. The ISEnterVehicle.lua is being refered to at line 51, which reads triggerEvent("OnEnterVehicle", self.character) and the ISVehicleDashboard.lua is refered to at line 608, which reads getPlayerVehicleDashboard(character:getPlayerNum()):setVehicle(vehicle) and seems to be part of that "OnEnterVehicle" event that ISEnterVehicle.lua called for, as it is in the following:

function ISVehicleDashboard.onEnterVehicle(character)
    local vehicle = character:getVehicle()
    if instanceof(character, 'IsoPlayer') and character:isLocalPlayer() and vehicle:isDriver(character) then
        getPlayerVehicleDashboard(character:getPlayerNum()):setVehicle(vehicle)
    end
end

With this, it looks like, somehow, the mod is making the game unable to read the character.getVehicle(). The problematic line ends in "setVehicle(vehicle)" where, if I'm not mistaken, "(vehicle)" is a variable, which is defined in the second line of this function where the variable "vehicle" is set by caracter.getVehicle.

Now, I've gone through the files of this mod I'm porting, and I've not found any reference to any of these files or variables, so what gives? Is this just one of those really odd bugs in Build42 where the game just doesn't want to read this function correctly when ANY mods are installed?

shrewd bolt
#

You'll get that error if ANY mod has a recipe in the old format.

blissful urchin
#

Hello I am running on a weird issue for several hours where I cannot run a function from an event. I only have a small script that print something in response of an event but nothing happens

#

`function onCreatePlayerData()
print('Hello World')
end

Events.OnCreatePlayer.Add(onCreatePlayerData);`

#

My script is loaded fine btw

kindred grove
full escarp
#

is there a getter method for getting if the player is bitten or scratched?

undone elbow
blissful urchin
#

Is it possible to do unit tests on lua script M

round notch
#

B42 update broke my steam workshop results haha

full escarp
#

i see i assume scratch time and bite time is the remaining time a body part is scratched or bitten ?

round notch
#

Kinda, though it probably doesn't translate in an exact time. It's more a damage indicator and how far a player need to heal by. Like scratch with time 100 will take longer to heal than a 5

#

And heal rate changes depending on what you treat it with I'm pretty sure

full escarp
#

okay so i see so 0 is no scratch and then anything else is the "severity"

round notch
#

I think it depends on how the damage was given. Pretty sure if a zombie bites you it hits you with like a bite time of 20

full escarp
#

i see thank you!

#

that should work for what i am doing

round notch
#

Deep wounds will not go below 3!

#

They will remain at 3 until you treat them

green fiber
#

does anyone know how the map and structures are stored in memory? what data structures are used for the chunks/heightmap etc..

blissful urchin
#

I think it stored under the lot files in /media/maps/Muldraugh, KY/map/ but the files are encrypted

green fiber
lime socket
#

Hi everyone, hope you guys have had a good christmas!
ive been following a couple of guides for creating new tiles and mod making in the hopes of making a new place-able building and now B42 unstable has a nice new build menu im wondering if there are any resources on how add to my custom tiles to it?

#

for added context i have a tiledef and .pack file with the attributes i want from worldzed / tilezed but i dont know what the next steps would be as to add my new tiles as a building?

bitter walrus
#

Hello! I run PZ on a mac & notice two things that I want to try to make a mod to resolve, and was wondering how I should go about it (if even possible). First, the game incorrectly scales the resolution when opening up, easily fixed by changing resolution but I want to fix this if possible. The next thing is that since PZ doesn't ask for permission to use my mic, it doesn't show up as one of the applications in the list of apps that have permission to use it, so I can't use my mic in-game (wanted to use radios with friend, found out I couldn't!)

lime socket
crystal canyon
#

yeah, these seem to be bugs that should be reported to TIS

bitter walrus
#

ah ok! Thank you both for your responses!

crystal canyon
calm zealot
#

hello people i wanna make that the player can show the middle finger but the player model has one finger so the main question is how??

calm zealot
#

true

restive lodge
#

anyone have a good resource for recipes?

icy yarrow
#

check the PZ recipes

crystal canyon
#

honestly, the base game scripts are a great resource

restive lodge
#

OK ill look there

elfin stump
#

You could maybe twist it 90 and tuck it into the palm?

#

Or see if you can use the thumb as the finger somehow could work possibly too

umbral ingot
#

Anyone know how to programmatically add a dynamic light to the game?

lyric surge
#

I can't seem to load this mod for some reason. It's just a simple moodle replacer. any ideas?

#

it's not on the workshop; just a stupid meme for me and my friends

calm zealot
umbral ingot
lyric surge
paper steeple
dull moss
#

#musicmaniacpins b42 javadocs

lyric locust
#

how can I extract 3d moddels from the game?

#

for example a car

pearl prism
#

Is there a way to reduce the scale of a 3d item via script?

ebon dagger
#

Is it possible to write an in game note (like on a piece of paper) dynamically via code?

Like, add an item to an inventory that is a note with dynamically generated text in it?

pearl prism
lyric locust
#

thanks

bronze yoke
ebon dagger
#

Ok, dope. That opens quite a bit to me. Off chance, do you know if text is READABLE by code? Like, can players write a note and the code pick it up (I can parse it if I can get it lol)

bronze yoke
#

yep!

ebon dagger
#

🤯

#

Awesome.

#

Now I have a direction hahahah

pearl prism
lyric locust
#

let me search it

#

I think it cost money 😭

#

wait

#

I think I found something

#

I found a way

#

this might be interesting

#

PZ use's triangles or quads?

pearl prism
#

triangles

lyric locust
#

alr

dull moss
lyric locust
#

alr

dull moss
#

So uhm I'm a bit confused, can anyone tell me why this

local original_ISPetAnimal_perform = ISPetAnimal.perform
function ISPetAnimal:perform()
    print("ETW Logger | ISPetAnimal:perform(): caught, petting animal with ID "..self.animal:getAnimalID())
    original_ISPetAnimal_perform(self)
end

local original_ISPetAnimal_complete = ISPetAnimal.complete
function ISPetAnimal:complete()
    print("ETW Logger | ISPetAnimal:complete(): caught, petting animal with ID "..self.animal:getAnimalID())
    original_ISPetAnimal_complete(self)
end

gives 0 prints in console when petting?

ebon dagger
#

Does a more simple print work?
ie: print("test")

dull moss
#

complexity of print doesn't shouldn't matter, it would either print or error out if it would be print related

#

but i'll try

compact rampart
#

is it possible to make more variants of the same weapon?

bronze yoke
#

usually it indicates that function isn't even used

dull moss
#

ye but if you look at ISPetAnimal it kinda runs that code when you pet an animal

ebon dagger
dull moss
#

judging from this at least

function ISPetAnimal:start()
    forceDropHeavyItems(self.character)
    self:setOverrideHandModels(nil, nil)
    self.character:setVariable("AnimalSizeX", 0.01);
    local range = self.animal:getData():getMaxSize() - self.animal:getData():getMinSize()
    local current = self.animal:getData():getSize() - self.animal:getData():getMinSize()
    if current <= 0.001 then
        current = 0.001;
    end
    self.character:setVariable("AnimalSizeY", current/range);

--    print("range", range, "current", current, "total", current/range)

    self.animal:getBehavior():setBlockMovement(true);
    self.character:setVariable("petanimal", true)
    --print("set animal pet! ", self.animal:getAnimalType())
    self.character:setVariable("animal", self.animal:getAnimalType())
    if self.animal:hasGeneticDisorder("dwarf") and not self.animal:isBaby() then
        self.character:setVariable("animal", self.animal:getBabyType())
    end
    self.animal:setVariable("idleAction", "petting")
    sendEvent(self.character, "PetAnimal")
end```
#

if you check context menu code it creates the ISPetAnimal

#
    if animal:canBePet() then
        menu:addSlice(getText("ContextMenu_PetAnimal"), getTexture("media/ui/AnimalActions_Pet.png"), AnimalContextMenu.onPetAnimal, animal, playerObj);
    end

where

AnimalContextMenu.onPetAnimal = function(animal, chr)
    animal:getBehavior():setBlockMovement(true);
    local vec = animal:getAttachmentWorldPos("head");
    ISTimedActionQueue.add(ISWalkToTimedActionF:new(chr, vec));
    ISTimedActionQueue.add(ISPetAnimal:new(chr, animal))
end
#

it creates timed action

ebon dagger
dull moss
#

oh

#

wait no

#

I think

ebon dagger
#

Its just how I have seen it done in the past.

bronze yoke
#

only if the original function returned something

dull moss
#

sometimes yes sometimes no

#

ye, that

#

well i guess complete should return then but that doesnt explain how timed action skips my perform decoration

icy yarrow
#
    originalToggleClothingWasher(context, worldobjects, playerId, object)
    -- Custom logic below
end```
eager vessel
#

I have a good idea for making a mod:
A mod that adds a new plumbing system, you can connect piping to a well and then hook the piping up to a electric pump that you have to find, kind of like generators but much more rare, then you con pipe the plumbing to sinks, baths, etc.

I shall make this as soon as I learn how to mod PZ

dull moss
# icy yarrow ```ISWorldObjectContextMenu.toggleClothingWasher = function(context, worldobject...

my syntax should be correct, as an example, here's decorating another timedaction with same one:

local original_ISChopTreeAction_perform = ISChopTreeAction.perform;
---Overwriting ISChopTreeAction:perform() here to insert ETW logic catching player cutting down trees
---@diagnostic disable-next-line: duplicate-set-field
function ISChopTreeAction:perform()
    if ETWCommonLogicChecks.AxemanShouldExecute() then
        --- stuff here
    end
    original_ISChopTreeAction_perform(self);
end```
#

question is why pet won't pet PepeLaugh

icy yarrow
#

You have the require at the top?

dull moss
#

No, nor should I be needing it, I believe? At least, I never have needed it and I decoreted a bunch of other fucntions

bronze yoke
#

requiring a vanilla file never does anything

icy yarrow
#

Hmm, I thought you had to if you were overwriting

bronze yoke
#

it's basically a mass hallucination induced by the community copying vanilla files

dull moss
icy yarrow
#

So you saying I can make my file 1 line shorter CE_Pray

bronze yoke
#

all require does is:

  • run the file if it hasn't run already
  • return whatever the file returned
    all vanilla files run before all mod files and none of them return anything so requiring them does nothing
dull moss
#
local original_ISPetAnimal_perform = ISPetAnimal.perform
function ISPetAnimal:perform()
    print("ETW Logger | ISPetAnimal:perform(): caught, petting animal with ID "..self.animal:getAnimalID())
    original_ISPetAnimal_perform(self)
end

local original_ISPetAnimal_complete = ISPetAnimal.complete
function ISPetAnimal:complete()
    print("ETW Logger | ISPetAnimal:complete(): caught, petting animal with ID "..self.animal:getAnimalID())
    return original_ISPetAnimal_complete(self)
end

local original_ISPetAnimal_start = ISPetAnimal.start
function ISPetAnimal:start()
    print("ETW Logger | ISPetAnimal:start(): caught, petting animal with ID "..self.animal:getAnimalID())
    original_ISPetAnimal_start(self)
end

Im only catching start.
I think this sendEvent(self.character, "PetAnimal") at the end of start just delagates petting to server

bronze yoke
#

but there is no server...

dull moss
#

thats exactly why i am confused

bronze yoke
#

how timed actions are going to work is a bit confusing right now but all the old functions are still running as usual

dull moss
#

in b41 didnt we still have server console output even in sp?

#

or am i trippin

#

as a separate file

bronze yoke
#

no

#

singleplayer does not have a separate server whatsoever

dull moss
#

then idk, zomboid is trolling or sth. how can it start timed action but not run perform

bronze yoke
#

also from what i can tell perform is client code

#

complete seems to be the server equivalent

dull moss
bronze yoke
#

umm

dull moss
#

and i kinda need to decorate the end of petting not the start cuz I wanna do stuff when player completes the petting

bronze yoke
#

petting doesn't really look like a timed action to me

dull moss
#

I thought it is? ISPetAnimal = ISBaseTimedAction:derive("ISPetAnimal");

bronze yoke
#

well do it in-game

#

there's no timer bar

dull moss
#

hm

bronze yoke
#

even indefinite timed actions show that looping one

dull moss
#

that is true

#

maybe they did it as timed action so they can queue player walking?

#

idk

bronze yoke
#

maybe you can just do that actually

dull moss
#

oh, true, that explains no action bar

#
local original_ISPetAnimal_animEvent = ISPetAnimal.animEvent
function ISPetAnimal:animEvent(event, parameter)
    print("ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID "..self.animal:getAnimalID())
    if event == "pettingFinished" then
        print("ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID "..self.animal:getAnimalID())
    end
    original_ISPetAnimal_animEvent(self)
end```
#
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325

holy moly KekW

#

I pet 1 cow

#

why can't perform just work like a normal timed action, it has to be some weirdass stuff

#

sigh

#

guess I'll have to decorate animation event instead of perform like a normal person

kindred grove
ebon dagger
#

Ok, I'm stumped. I'm working on creating a list of item names that will be used later, and stored in the modData of a container. However, even though the logic seems right to me, when I print the length of the tables at the end, I'm getting 0. Am I adding key value pairs to the tables incorrectly?

function TKE.ProcessDeadDropIntake(container, items)
    local value = 0
    local sold = {}
    local rejected = {}
    for i = items:size() - 1, 0, -1 do
        local item = items:get(i)
        local itemType = item:getType()
        local itemName = item:getName()
        if TKE.SyndicateFactionWants[itemType] ~= nil then
            local val = TKE.SyndicateFactionWants[itemType]
            value = value + val
            if sold[itemName] ~= nil then
                print(string.format("Sold: Increment %s", itemName))
                sold[itemName] = sold[itemName] + 1
            else
                print(string.format("Sold: Add %s", itemName))
                sold[itemName] = 1
            end
        else
            if rejected[itemName] ~= nil then
                print(string.format("Rejected: Increment %s", itemName))
                rejected[itemName] = rejected[itemName] + 1
            else
                print(string.format("Rejected: Add %s", itemName))
                rejected[itemName] = 1
            end
        end
        container:getContainer():DoRemoveItem(item)
    end
    print(#sold)
    print(#rejected)
    container:getModData().DeadDropValue = value
    container:getModData().Sold = sold
    container:getModData().Rejected = rejected
    container:transmitModData()
end

Console returns the following (I put 1 44 round, 5 dollars in the container, dollars are the only thing on the Want list.)

> Rejected: Add .44 Magnum Round
> Sold: Add Money
> Sold: Increment Money
> Sold: Increment Money
> Sold: Increment Money
> Sold: Increment Money
> 0
> 0
twilit fossil
#

hey, have you by any chance figured out what itemcount means/does? I can't see any rhyme or reason for its use, but that might just be me being dumb

dull moss
#

fyi if you put lua at the start of multiblock code you'll get pretty formatting :)

marble turret
twilit fossil
marble turret
#

Seems to be used on many of the refill-style recipes

dull moss
#

your direct asignment is incorrect if I'm not mistaken

#

it should be list[integer] = value

#

you have list[string], no?

bronze yoke
#

# only counts consecutive integer keys starting from 1

#

it doesn't check the number of pairs because lua doesn't really have that concept

#

#t basically just counts t[1], t[2], t[3] etc until it hits nil

#

if you had to count the actual number of pairs you'd do a pairs() loop through the table and just increment

twilit fossil
# marble turret Seems to be used on many of the refill-style recipes

if I had to guess, maybe itemcount is supposed to be used in conjunction with drainable items, if you want that item to be used in its entirety instead of 1 use being subtracted

so item 1 [Base.BlowTorch] itemcount, means "use 1 entire blow torch item"
and item 1 [Base.BlowTorch], means "use 1 unit from the blow torch item"

marble turret
ebon dagger
crystal canyon
#

gonna make a mod that gives you money on every zombie kill :p

devout bison
crystal canyon
#

good question

devout bison
#

Trick question; Yes you can.

ebon dagger
random finch
#

Can anyone fathom a way to combine two Sprites/Tiles to make a Texture? For example, some moveables are multi place in which they have seperate parts for each square. I am using this texture for UI purposes.

devout bison
#

I feel like I'm overthinking this, but I'm about to try to add in an item to the loot pools and I'm a little overwhelmed. Do I need to dive into the procedural distribution or just the distribution to get the places for a new item to spawn?

elfin stump
proven ibex
#

You know what would be dope now with the basement feature to have like mining and we can gather resources like this

devout bison
#

It's essentially an MRE or a ration. I have the item working as intended and having it spawn in the world is the last step, at least until I tinker with it more.

elfin stump
#

Are you looking to have it spawn in various places like dead zombies as well as be found in containers?

#

I can give you an example file to get started with give me a moment.

devout bison
elfin stump
#

Its all doable and the system is solid once you know about a few kinks in it.

devout bison
#

Also, how different is the lua compared to 41? I ask because there are tons more examples for B41 but I don't want to shoot myself in the foot if those mods are too outdated

bronze yoke
#

if it's not a system that's been directly updated it's probably still quite similar

#

for example distirbutions haven't changed whatsoever (aside from some being renamed)

elfin stump
#

Depends on the systems you are using, recipes changed a lot, I think lighting may have changed, plus all the new stuff, lots of things are exactly the same too. But with B42 there are little changes too like variables for example in distribution they changed instances of "Sidetable" to "SideTable" so you can get bit by some of those.

#

I've been referencing old docs for sound and nothing has changed I can find so far, for example.

bronze yoke
#

yeah sound api's identical, that was one of the first things i looked at

elfin stump
#

Have you looked at any of the light stuff? From their examples it seems like there is a lot of new, but I haven't looked. I am curious if we can float a light around like a UFO yet 🤓

#

like light at XYZ would be so great 🙂

devout bison
#

Drones in B42 imminent

crystal canyon
#

then Ill add a coast to coast am radio station that

#

I think Art Bell started it around 1992

icy yarrow
#

Computer shut off suddenly and hadn't saved in an hour stressed

crystal canyon
#

what software were you working with? N++ and VScode should have it stored

elfin stump
icy yarrow
#

Yeah lol

bronze yoke
#

don't worry, sooner or later you'll encounter an event so traumatic you obsessively press ctrl-s after every minor change for the rest of your life

elfin stump
# devout bison Thanks so much. I was just starting with containers, but corpses could carry a s...
    --This will add an item to a generic zombie.
    table.insert(SuburbsDistributions["all"]["inventorymale"].items, "YOURMOD.YOURITEM") --This is generic male
    table.insert(SuburbsDistributions["all"]["inventorymale"].items, 100)--100 here is not percent chance, this translates to about %20-%40 chance depending on other circumstances. Verify in game with LootZed.
    table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "YOURMOD.YOURITEM") --This is generic female
    table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 100)
        
    --This will add an item to a named zombie outfit, find these in the horde manager in debugger or by searching in existing distribution code etc.
    table.insert(SuburbsDistributions["all"]["Outfit_PoliceState"].items, "YOURMOD.YOURITEM")
    table.insert(SuburbsDistributions["all"]["Outfit_PoliceState"].items, 100)
    
    --This will add an item to a named area - the rich peoples fridge
    table.insert(ProceduralDistributions.list["FridgeRich"].items, "YOURMOD.YOURITEM");
    table.insert(ProceduralDistributions.list["FridgeRich"].items, 100);
    
    ItemPickerJava.Parse()
end

Events.OnInitGlobalModData.Add(AdjustSandbox) --this event is added to adjust sandbox AFTER your mod loads, if you have sandbox settings to adjust spawn rates this is required.```
#

You can put that in a .lua file located in media/lua/server/Items

icy yarrow
#

I really should put these on my git like I do with my RW mods

bronze yoke
#

if you're doing it in OnInitGlobalModData you need to call ItemPickerJava.Parse() at the end or your changes won't actually be applied

crystal canyon
#

has any of you encountered issues with sounds? Like zombies breaking windows silently?

elfin stump
elfin stump
bronze yoke
#

InventoryItemFactory.CreateItem is replaced by instanceItem() (global function)

devout bison
elfin stump
# devout bison Thanks for this!

Of course, if you goto media\lua\server\Items\Distributions.lua that will have all the outfits you can use to spawn on zombies as well as some places.

elfin stump
#

There it is as a file if that is a bit easier.

icy yarrow
#

I noticed poking around that there is a ton of profession house spawns that are currently commented out

devout bison
elfin stump
#

I think I noticed an issue with my example file, let me reprovide it.

elfin stump
#

There you go, use this latest example the function being called was not named correctly on the prior example I gave you.

devout bison
#

What is the purpose of changing module Base to something else? Should I not do that if I'm using an already existing mesh?

elfin stump
#

You can import base if needed but you shouldn't need too. I think you can access Base items easy without the import for some reason, but I am not positive. You should be able to access the base mesh for your mod item without issue.

devout bison
#

Okay, thanks! I think I'm understanding more.

elfin stump
#

No problem, this is the central place to ask too so you are in the right direction. spiffo

crystal canyon
# elfin stump

gonna use this as well, see if I fix some broken distributions from other mods. I hate seeing errors

devout bison
#

So if I change the module in my mod info will I need to put that "prefix." before any assets I add / anything else? As far as item stats, etc

bronze yoke
#

only outside of your module

elfin stump
devout bison
#

The leniency in the coding is both convenient and also something to get used to.

elfin stump
#

Part of my like the fact that if a B42 recipe is off by a bit, it kills the whole program, it is a damn good filter haha.

bronze yoke
#

it's so refreshing to get script errors that actually tell you what you did wrong

#

most other script types don't even tell you you did anything wrong

elfin stump
#

Yeah it is nice when we get that solid feedback. Sometimes it is a void and all we get is faith as we jump haha.

devout bison
#

How come when I had the model scaled up unreasonably huge it's visible when eating it, but when I scale it down to a realistic size, the item doesn't show up in hands while eating it? Do I have to do something special with the static model?

left hinge
#

Hello, good afternoon everyone. I would like to start creating my first mod in pz, but I don't know anything about the LUA language. I know how to program in python, java and C++, but I have never worked with LUA. I understand that it is similar to javascript, so I would like to know if you can help me by guiding me on where I should start. The mod I want to build is not just a skin, I would like to start modifying traits and professions.

orchid bane
#

Hello, is there a mod that can replace the ost for multiplayer? I know true music but it only adds songs as cassetes to my knowledge. Thank you

bright fog
#

And you can't do much about it

orchid bane
#

So i have to ask my friends to manually download the mods too?

random finch
#

Bro, what are these robot sounds for in the bank files lol

bronze yoke
#

maybe just a developer having some fun with npc testing?

random finch
#

Must be lol. My only throughts. Was the case the last time I found a robot in a game where it didnt belong.

#

Yesterday, I found an unused pocket icon. Did this game ever use pockets as a containers?

bronze yoke
#

it's something they've wanted to do for a bit

random finch
#

Doesnt seem like it would be too hard to implement

bronze yoke
#

they posted a concept image of flattening all containers into one inventory and having stuff like clothing give you your basic inventory space

random finch
#

Interesting

ionic vale
#

Thank you so much for this. I was struggling until I saw this and finally got my mod to load properly in 42.

random finch
#

Anyone seen a guide on how to create sound events? Perhaps another mod that does this. Instead of assigning one sound with file, events seem to allow a variation of sounds for a given sound script. Would it require FMOD Studio?

bronze yoke
#

it would, and there's no modding suport for it (replacing vanilla files with manual file replacement only)

random finch
#

What a shame. Bank files can be huge as well. I suppose there are always workarounds if someone were insistent on doing it.

bright fog
#

You can replace sounds

#

Idk about adding any tho

#

But yeah it would be great to be able to utilize FMOD

bronze yoke
#

if we wanted to get serious about it we'd need lua api for it too

bright fog
#

Yea

restive lodge
#
module WUW_ID_Me
{
    item MOV_CardScanner
    {
        DisplayCategory = Electronics,
        Type = Moveable,
        Icon = wuw_id_cardscanner_icon,
        Weight = 5.0,
        DisplayName = ID Card Scanner,
        WorldObjectSprite = location_community_school_01_32
    }
}

Does anyone know why I cant place this item. I even tried using the wall clock sprite but nothing shows up when i try to place

ionic vale
bright fog
bronze yoke
#

i'd put a comma

#

not sure about the new script parser but in b41 basically every script type except items bugged out without closing commas

untold sun
crystal canyon
#

I need help with python. Trying to make a recipe updater.

only problem i'm having is that it throws double commas sometimes or comma after ingredients like [Base.Plank,],

silent zealot
#

Before I glue a prefix to doLiteratureMenu() and hack together something that works, is there a proper way to add a rightclick context menu option to a new item?

bronze yoke
#

add a listener to OnFillInventoryObjectContextMenu

silent zealot
#
local original_doLiteratureMenu = ISInventoryPaneContextMenu.doLiteratureMenu
-- From media\lua\client\ISUI\ISInventoryPaneContextMenu.lua

function ISInventoryPaneContextMenu.doLiteratureMenu(context, items, player)
    print("##### This is where my code would go, if I had any")
    original_doLiteratureMenu(context, items, player)
    
end
#

will work, but there may be a much better way.

crystal canyon
#

I also found errors on vanilla recipes. Strangely the game doesnt complain about them

craftRecipe MakeSawbladeCudgel
 {
    time            = 600,
    tags            = AnySurfaceCraft,
    category = Weaponry,
    needTobeLearn = true,
    SkillRequired = Woodwork:4,
    timedAction = CraftWeapon2H,
    xpAward = Woodwork:5,
    AutoLearn =  Woodwork:8;Axe:5,
    MetaRecipe = MakeSawbladeWeapon,
    inputs
     {
        item 1 tags[Hammer] mode:keep flags[MayDegradeLight],
        item 1 tags[Saw] mode:keep flags[MayDegradeLight],
        item 1 tags[Wrench]] mode:keep flags[MayDegradeLight],   <=========== Double ]]
        item 1 tags[DrillMetal] mode:keep flags[MayDegrade],
        item 5 [Base.Nails],
        item 1 [Base.CircularSawblade] flags[IsHeadPart],
        item 1 [Base.LeatherStrips] mode:destroy,
        item 1 [Base.NutsBolts],
        item 1 [Base.LargeBranch] flags[Prop2;InheritCondition],
     }
     outputs
     {
         item 1 Base.Cudgel_Sawblade,
     }
 }
bronze yoke
#
local doMyItemContextMenu = function(playerNum, context, items)
    local primaryItem = items[1]
    if not instanceof(primaryItem, "InventoryItem") then
        primaryItem = primaryItem.items[1]
    end

    if primaryItem:getFullType() == "Module.MyItem" then
        -- add to the context here
    end
end

Events.OnFillInventoryObjectContextMenu.Add(doMyItemContextMenu)
silent zealot
#

thanks

fleet bridge
#

There's no more oncanperform?

crystal canyon
bronze yoke
#

you can technically replicate it in an ontest

devout bison
#

What is LootZed? a command?

bronze yoke
#

kinda, you enable it from the debug cheats list and then right click a container icon to open it for that container

devout bison
#

ok cool, ty

restive lodge
#
-- Hook into ISMoveableSpriteProps placement validation
local originalCanPlaceMoveable = ISMoveableSpriteProps.canPlaceMoveable
--ignore warning, this is intentional
---@diagnostic disable-next-line: duplicate-set-field
ISMoveableSpriteProps.canPlaceMoveable = function(self, character, square, item)

    if item:getFullType() == "WUW_ID_Me.MOV_CardScanner" then
        for i = 0, square:getObjects():size() - 1 do
            local object = square:getObjects():get(i)
            local objectProps = object:getProperties()

            -- Check Object Properties
            if objectProps then
                -- Rotate based on door frame direction
                if objectProps:Is("DoorWallN") then
                    self:rotateMoveableViaCursor(character, square, "wuw_cardscanner_01_1")
                    return true
                elseif objectProps:Is("DoorWallW") then
                    self:rotateMoveableViaCursor(character, square, "wuw_cardscanner_01_0")
                    return true
                end
            end
        end

        return false
    end

    return originalCanPlaceMoveable(self, character, square, item)
end

can anyone help me rotate my sprite rotateMoveableViaCursor and rotateMoveable didnt seem to work

ebon dagger
#

@bronze yoke thank you for your help earlier, I got my in game notes working.

silent zealot
#

Hopefully a a simple question: how do I convert from playerNum to get a player object?

local doDIYContextMenu = function(playerNum, context, items)

I'm sure I've seen something really simple like Global.getplayer(x) or Player[x] but now I can't find any of those.

#

this might be it: local playerObj = getSpecificPlayer(playerNum)

bronze yoke
#

that's right

ebon dagger
#

Ok yall,
Anyone able to point me in a good direction (PZ code, or a mod, something like that)?
I'm looking for a way to display a png on screen similar to the way that the brochures and fliers work. I looked into the "how to add a flier" walk through, but I'm not sure thats what I need, I don't want to add the items into the randomly spawning lists, as the items are dropped off of special zeds or spawned into the world by player actions.
The eventual goal is right click > Context Option > Show Image
I've never worked with the UI before, but I'll learn.

ebon dagger
umbral raptor
#

Looking for Coders for a Project Zomboid Radio Mod

I’m working on a mod for Project Zomboid and need help with coding! The idea is an infinite government-run radio station, originally run by FEMA during the Knox Event. It broadcasts pre-recorded educational tapes by Dr. Evelyn Grant, a high-ranking FEMA official, teaching survivors essential skills like carpentry, metalworking, fishing, and more. Over time, the station is maintained by two immune scientists broadcasting from a bunker.

The station also features propaganda, bulletins, and survival content designed to help survivors rebuild civilization. I’ll handle all the writing; I just need coders to make it happen. Let me know if you’re interested!

silent zealot
#
local doDIYContextMenu = function(playerNum, context, items)
    print("##### doDIYContextMenu()")
    local primaryItem = items[1]
    if not instanceof(primaryItem, "InventoryItem") then
        primaryItem = primaryItem.items[1]
    end

    if primaryItem:hasTag("DIYSchematic") then
        print("##### It's a DIY Scematic")
        local playerObj = getSpecificPlayer(playerNum)
        readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
    end
end

Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
#

That will add a function to the context menu generator that will see if the item matches if primaryItem:hasTag("DIYSchematic") and if so, it will add a context menu entry that calls the function DIYonLiteratureItems()

silent zealot
#

I've messed up passing playernumber vs. player object somewhere in my code, but at least my code is getting called.

#

Then you steal the code for displaying the fliers and change as needed.

ebon dagger
bronze yoke
#

player numbers are a frustrating concept to be honest

silent zealot
#

Ideally, you can make a new type of object and then your code says "if objecttype=NewThing (call the existing display flier code)

bronze yoke
#

i have no idea why random parts of the code prefer them (and never specify that they do)

silent zealot
bronze yoke
#

me too 😭

silent zealot
#

In those you know damn well what is an int and what is a ZomboidPlayer

#

But before doing that, check the existing procedural distribution tables - if they list each existing type of flier explicitly for the vanilla fliers then you can just make more fliers and add them where you want

full escarp
#

where is usually client sided print statements located? in the output log console in game? or is there a log file? i heard it should be console.txt but i can't find it

silent zealot
#

both console.txt and the lua debug window

full escarp
#

where should be console.txt be located? in the game installation folder?

bronze yoke
#

%UserProfile%/Zomboid/

silent zealot
#

Lua debug window in game

full escarp
#

okay then it seems like my function won't fire correctly

topaz tangle
#

Not me doing mod development but I LOVE the devcatt’s noodles mod the guys are so silly

full escarp
#
local MULTIPLIER, STARTCHANCE

local function SetSandboxSettings()
    MULTIPLIER = SandboxVars.Immunity.Multiplier
    if MULTIPLIER == nil then
        MULTIPLIER = 1.01
    end

    print("SandboxVars were initialised")
    
end

Events.OnGameStart.Add(SetSandboxSettings)

shouldn't it print that statement when i start a new Game or load into a existing one ?

bronze yoke
#

it should yeah

full escarp
#

Neither in log nor the console.txt is anything

bronze yoke
#

is the file loading logged? there should be a line in console.txt for every single lua file loaded

full escarp
#

it seems like it loads my mod but not the lua file

#

its b41 and my lua file is inside media -> lua

#

oh i suppose im missing the folder for which device, client, server or shared?

crystal canyon
#

yeah, file cant just be in lua alone

full escarp
#

yeah it worked now, thanks!

devout bison
#

So I'm currently working on getting my new item to spawn on zeds, I go in and kill some, check LootZed and the item has a 60% chance to spawn on them but in the space for name it doesn't have the icon or the name like all other items... Where did I go wrong?

#

And for a 60% drop rate, there have been none dropping.

#

The item does show up in the itemlist and I can give it to myself, and it appears normal there with its icon.

elfin stump
devout bison
#

Yes, where other items have their icon followed by their display names, my item has neither.

I tinkered a bit with the lua and tested more. Now some zeds opened up in Lootzed have the Name in the space for name (I'm okay if the icon doesn't show up there.)

elfin stump
#

It could have been the item being added to the table was not matched to the item so it was adding an item that did not exist, so then blank, but since it still added it, it still had the chance, but a chance for nothing.

devout bison
#

I think you're right. I fixed a capitalization error and now they're starting to spawn. Although some zeds when opened up in lootzed still have that happening. I wonder if it's because they're not 'generic' zeds

elfin stump
#

Did you make sure it is correct on both male and female?

devout bison
#

🤦‍♂️

calm zealot
full escarp
#

im used to strongly typed languages so lua is a bit weird for me

how do i correctly process a parameter which came from a event? for example
OnPlayerGetDamage
i get the Character which is the IsoGameCharacter
but since my parameter of my function isn't defined its just "any" and so calling methods on it doesn't seem to work?

elfin stump
# full escarp im used to strongly typed languages so lua is a bit weird for me how do i corre...

https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md

From there I see OnPlayerGetDamage passes 3 variables that is (character, damageType, damage), when you setup your function make sure to have all three parameters on there. Then you should be able to call functions from character.

GitHub

Tool for generating Lua documentation for Project Zomboid events and hooks - demiurgeQuantified/PZEventDoc

full escarp
#

yeah okay it seems to work, but VSCode doesn't show it properly

elfin stump
#

No idea on that I do all my PZ work in Notepad++ and just use visual studio for searching the source. I don't use VSCode in this case so can't help you there.

umbral ingot
# full escarp yeah okay it seems to work, but VSCode doesn't show it properly

in lua you can pull the event params out using "..." syntax and it should return a lua table with the java objects
`Events.OnSpawnVehicleEnd.Add(function(...)
print("vehicle spawn ended")
local vehicle = ...
print("Direct vehicle access: ", vehicle)
initializeDomeLightData(vehicle)
-- check mod data content
local modData = vehicle:getModData()
printTable(modData)

-- fetch parts and create the lights
local parts = {"DynamicImposter/DomeLightFront", "DynamicImposter/DomeLightLeft", "DynamicImposter/DomeLightRight"}
for _, partId in ipairs(parts) do
    local part = vehicle:getPartById(partId)
    if part then
        Vehicles.Create.DIDomeLight(vehicle, part)
    else
        print("VehicleSpawnEnd-: no part found")
    end
end

end)`

devout bison
elfin stump
devout bison
grizzled fable
#

Hello, any advise on how i can solve this problem?
ReplaceOnUse = Base.WaterBottleEmpty, this is an item definition line, since WaterBottleEmpty dosen't exist anymore, how i can give the player an empty bottle after consuming this drink?

elfin stump
#

Do you have that outfitted zombie in your loot table?

devout bison
elfin stump
#

So the male and female only apply to zombies that do not have an "outfit" which you can think of as a profession in most cases, if they have an outfit, they will spawn instead from that loot table. For example police are Police PoliceState (there are some others I forget them, a riot guy I think).

devout bison
#

Yeah this one was OfficeWorkerSkirt

elfin stump
#

There is another layer to the generics also, I think you can use Generic01 through Generic05 as the outfit name as antoher way to spawn on Generics but the male female ones get you the most.

#

Yeah so unless you had given the outfit OfficeWorkerSkirt the item in loot table it wouldn't show up, keep in mind to do that isa different format to add them it is in that example file from before though.

#

I think it ends up being formatted as Outfit_OutfitName

devout bison
#

It's not in LootZed for her either but somehow she died and has the item

elfin stump
#

Hmm that is odd. Trying to think of potential reasons for that... Could be that male and female apply to her somehow, but if loot zed showed it wasn't there and it was, that is odd. The only time I have seen that happen is if you are changing sandbox settings without a restart of the game, sometimes lootzed will reflect the old info not the new. That can also be the case if your ItemPicker call is in the wrong place and sandbox isn't updating.

#

If you are using anything from sandbox and you don't have the itempicker call it can cause that because it will keep using the original entries but lootzed will look at the new ones. Not sure how else could cause it, feel free to share your file if you like.

devout bison
#

the lua?

elfin stump
#

yeah

devout bison
#

hm how do I put code in here

elfin stump
#

You can just hit the + and upload the file it will bring it in as an expandable block

devout bison
elfin stump
#

Looks like you don't have any sandbox calls in there, it shouldn't have an issue here I don't think. You may want to kill some more zeds and see if that repeats

#

you can use horde manager to spawn a bunch of the one you saw it on

#

it could be that you found a borked outfit, otherwise I am not sure.

devout bison
#

Where is horde manager?

elfin stump
#

Do you have your game in debug mode?

devout bison
#

I do

elfin stump
#

You should be able to do a right click, and then I think the menu is Debug > Zombies > Horde Manager from the context

#

it may be slightly off I am not lookin at it now, but its in there

#

You can spawn OfficeWorkerSkirt and see what you get from that one in LootZed, then also check another outfit that is named and see if any of your items show up.

devout bison
#

I'll try some more.

elfin stump
#

My guess is that outfit is funky. Interested to know what you find.

#

Maybe she isn't defined correctly and it is defaulting to the generic, does she spawn anything that is in her lootzed?

devout bison
#

Confirming that regular "Police" is also dropping em

#

4/10

elfin stump
#

Hmm I will have to take a peak at this, my understanding was that ["all"]["inventoryfemale/inventorymale"] would apply to zombies that are not outfitted only but it could be that "all" includes all outfits now. I will need to take a closer look, are you in B41 or B42?

devout bison
#

b42

elfin stump
#

Okay it is possible they have changed something there, I am curious about it and will dig in later, but let me see I can give you lines to change.

devout bison
#

I mean it's doing what I wanted it to, I just was going to dial it way down so the items are rare before release. Also still have to go through the procedural distribution but that's a task for after some sleep

#

In fact this saves me from finding every outfit name and putting those in lol

elfin stump
devout bison
#

Gonna tuck this away for reference... Thank you v much

#

I was considering making em more prevalent in service workers rather than generic zeds, which this will definitely help me do, but first priority is getting it ready to ship. I can tinker with those specifics when it's time to refine

#

Yeah, did another 10 zeds for kicks, Firemen this time. Looks like it's across the board.

quasi kernel
#

Anyways, @spiral pike, console.txt is available in your Zomboid folder - which is typically under your User profile on WIndows at least.

spiral pike
#

thank you

spiral pike
#

k so the moment lua is reloaded with my mod it immediately shits itself and the screen turns black

#

i dont see any errors (?)

worthy cosmos
#

does anyone know what a food item requires in order to appear in EvolvedRecipe recipes in build 42?

spiral pike
#

what even is wrong wit it

#

why do you kill pz when loaded

grizzled fable
#

any help?

full escarp
#

q1

round notch
# spiral pike 😭

You don't have the "require('NPCs/MainCreationMethods')" which you need if your calling a traitfactory method

spiral pike
#

...?

#

what

round notch
#

You need to put

require('NPCs/MainCreationMethods')

At the top of your code

spiral pike
#

like so?

#

thank you let me try loading

round notch
#

If you have that it'll probably tell you what else is wrong with your code in the console log

spiral pike
#

errh okay so the screen is still black

round notch
#

It'll be something with your OnGameBoot function if it's not going to title screen

spiral pike
#

alright hold on

#

the ongameboot doesnt match

#

this should work

#

nope nuh uh it is still shitting itself

round notch
#

Your proflist has an indentation too many by the looks of it

spiral pike
spiral pike
round notch
#

Not sure but I am lol

spiral pike
#

well it doesnt make sense either way because

#

if i completely remove the entirety of the occupationtest part

#

it works

#

i am befuddled

round notch
#

I am befuddled too, your trait gives you aiming and reloading and that's not even in the script 😂

spiral pike
#

i kept it there because i wanna see if it go down

dull moss
#
---@diagnostic disable: missing-parameter
require('NPCs/MainCreationMethods');

---Function creating trait with set parameters
---@param name string
---@param cost number
---@param isProfExclusive boolean
---@param isDisabled boolean
---@return Trait
local function createTrait(name, cost, isProfExclusive, isDisabled)
    isProfExclusive = isProfExclusive or false;
    isDisabled = isDisabled or false;
    if getActivatedMods():contains("EvolvingTraitsWorldMarkDynamicTraits") then
        return TraitFactory.addTrait(name, getText("UI_trait_" .. name) .. " (D)", cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
    else
        return TraitFactory.addTrait(name, getText("UI_trait_" .. name), cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
    end
end

local function addTraits()
    local activatedMods = getActivatedMods();
    local newTraits = {};

    if not activatedMods:contains("EvolvingTraitsWorldDisableLowProfile") then
        local LowProfile = createTrait("LowProfile", 3);
        LowProfile:addXPBoost(Perks.Sneak, 1);
        table.insert(newTraits, LowProfile);
    end

    for i = 1, #newTraits do
        local trait = newTraits[i];
        BaseGameCharacterDetails.SetTraitDescription(trait);
    end
    TraitFactory.sortList();
end

Events.OnGameBoot.Add(addTraits);
#

here's a bit different code structure

#

but it'll work

#

you can unpack createTrait func into addTraits, I got it out cuz it was easier for me

#

it returns TraitFactory.addTrait(name, getText("UI_trait_" .. name), cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);

round notch
#

Do you not need the require for maincreationmethods? Has my life been a lie?

dull moss
#

so this

        local LowProfile = createTrait("LowProfile", 3);
        LowProfile:addXPBoost(Perks.Sneak, 1);
        table.insert(newTraits, LowProfile);

is equal to this

        local LowProfile = TraitFactory.addTrait("LowProfile", getText("UI_trait_LowProfile"), 3, getText("UI_trait_LowProfileDesc"), false, false);
        LowProfile:addXPBoost(Perks.Sneak, 1);
        table.insert(newTraits, LowProfile);
dull moss
#

not sure if its needed or not, pretty sure it isnt cuz that's what's albion said and she knows pz modding pretty much better than anyone

round notch
#

I might test it later on

dull moss
#

vanilla files are loaded before mod files

#

so it's really not needed

spiral pike
#

all i see is tv static looking at that

#

but thats basically adding new traits right?

#

i got that part working at least already

#

i have trouble with custom occupation

dull moss
#

check SOTO code, i dont do occupations

blissful urchin
#

Guys, do you know how to read lotpack & lotheader ? or even reading the map data ?

spiral pike
round notch
#

I'll defer that answer to someone smarter than me. Apparently it's not necessary so ignore that message

spiral pike
#

but i am already ripping code out of something that already exist

#

the uhh marineocc mod

dull moss
blissful urchin
#

I am a bit confused with lua, is it a OOP langage ? I am not used to how they are created, it's like object with functions on them and mimic the "new" Java thingy 😄

dull moss
#

lua is more of a scripting language

ebon dagger
#

I am really enjoying playing with the code from SpecialLootSpawns.lua. Its just simple name changes and stuff, but its fun.

blissful urchin
#

Pitty that we can't use Java 😄

dull moss
#

you can but then it will be manual installation mod

round notch
#

I find it similar to python with extra steps but I don't code in java

blissful urchin
blissful urchin
dull moss
#

honestly I havent seen anything yet where I thought "man I wish this was a class" KekW

round notch
#

I was close, I put a function inside a function, but wasn't a class

dull moss
#

I mean you can pack functions in the file and then return content and use it in different parts of code

#

that's as close as you canget to classes in lua

#

unless im mistaken

#

sth like

local ETWCommonFunctions = {};

---Plays a sound if enabled in settings
---@param player IsoPlayer
function ETWCommonFunctions.traitSound(player)
    if modOptions:getOption("EnableSoundNotifications"):getValue() then
        player:playSoundLocal("ETWGainTrait");
    end
end

---Returns ETW mod data with correct type (for IDE)
---@param player IsoPlayer|IsoGameCharacter
---@return EvolvingTraitsWorldModData
function ETWCommonFunctions.getETWModData(player)
    return player:getModData().EvolvingTraitsWorld
end

---Function responsible for checking if specific trait should be gained/lost, returns true if yes and removes it from the table. Otherwise, returns false.
---@param name string
---@return boolean
function ETWCommonFunctions.checkDelayedTraits(name)
    if not SBvars.DelayedTraitsSystem then return true end;
    local player = getPlayer();
    local modData = ETWCommonFunctions.getETWModData(player);
    local traitTable = modData.DelayedTraits;
    for index = 1, #traitTable do
        local traitEntry = traitTable[index]
        local traitName, gained = traitEntry[1], traitEntry[3]
        if detailedDebug() then print("ETW Logger | Delayed Traits System: caught check on " .. traitName) end;
        if traitName == name and gained then
            if detailedDebug() then print("ETW Logger | Delayed Traits System: caught check on " .. traitName .. ": player qualifies for it; removing it from the table") end;
            table.remove(traitTable, index);
            return true;
        end
    end
    return false;
end

return ETWCommonFunctions;
#

and then u just use it in other lua files

#
local ETWCommonFunctions = require "ETWCommonFunctions";

...
if SBvars.DelayedTraitsSystem and not ETWCommonFunctions.checkIfTraitIsInDelayedTraitsTable("ProneToIllness") then
...
blissful urchin
#

I was like "what they are all caled ISButton, ISPanel" it's Indie Stone no ?

round notch
#

ModData is good for that as well, in certain circumstances

ebon dagger
#

There is the functionality around TimedActions with :New and derive. Its class-like. Kinda like how LaCroix is "fruit flavored"

dull moss
#

also kinda tru

blissful urchin
blissful urchin
round notch
ebon dagger
#

Sure, but I was just pointing out class-ish stuff in a classless system 😄

round notch
#

Anyone done anything with animals yet? Trying to make a pig explode rn but I need an onAnimalDeath event ideally lol

dull moss
round notch
#

Well if anyone is interested, even when animals are attacked they are tagged as "Zombie" but they don't trigger onZombieDead event

blissful urchin
#

Do you know guys how to reload lua files in game ?

#

Tired on leaving/entering game again and again

tacit pebble
blissful urchin
#

I mean, in game not in the menu screens 😄

tacit pebble
#

or press f11 - search specific lua file - reload

tacit pebble
blissful urchin
#

On teleportFastMove function

tacit pebble
#

crash mean your game has stopped work or something like CTD?

blissful urchin
#

The debug screen appears saying there is an error on a specific line, but my lua script did not reload

#

seems that the game catched my 'F11' as teleport key

tacit pebble
blissful urchin
tacit pebble
#

i was confused myself 😛

blissful urchin
#

Oh okay I understood ! So the debug mode appears and then I can see my files on the bottom right

#

Thanks !

#

And Thanks god that when you re-hit F11, the search text is still there and not have to re-write the file again 😄

#

Seems that I have more comfort now

#

step by step 🦾

tacit pebble
#

yep just don't try reloading wrong lua code(missing end, missing {}, etc) or game will be broken.
in this case, you will be able to see error count when you reloaded wrong lua code, once you see error count it means there's a typo or something.

blissful urchin
#

And do you know how I can trigger specific events without impacting the game ?

#

Like, I have a OnGameStart trigger Event, so I still need to quit the game 😦

tacit pebble
full escarp
tawdry moss
#

Working on a first aid mod, all the new first aid files have a “syncBodyPart” function which calls a sequence of numbers as the parameter.

Does anyone know how I’d change these to other wound types? I checked the documentation and it wasn’t helpful

#

aaaand now debug mode wont launch

#

Validated files several times, issue persists

lime socket
#

Are we able to make .java scripts for mods or just .lua?

bright fog
lime socket
#

oh okay great thank you, ill stick with lua then

full escarp
#

what would be the best way to get the information if the player is infected with the virus? is it on the BodyDamage/ BodyParts or on the Player itself?

#

i assume IsInfected() isn't for the zombie virus

winter bolt
full escarp
#

okay so IsInfected isn't referred to bacterial infection or such

winter bolt
#

theres a separate thing for wound infection i think

full escarp
#

i'll test it, i just assumed the zombie infection to be more "centralized" on the Character itself and not the bodyparts

winter bolt
#

it is on the character

#

getBodyDamage is just all of the characters health i think

full escarp
#

oh i see

#

so that makes sense

lime socket
#

Does anyone know why my mod wont show up in the mod list, i have follow nasKo's thread for folder structures but it doesnt seem to be working?

#

Heres the folder structure:

#

and here is my mod info:

tawdry moss
lime socket
#

i shall give that a go now

#

still nothing sadly, i have it in the mods folder in my PZ directory should it be there or in the workshop folder?

tawdry moss
#

There’s other stuff with new mods wanting an icon for the mod menu as well, not seeing that

#

Add an “icon=icon.png” line to your mod.info and add an icon.png image to your 42 folder

lime socket
#

thank you ill give that a go

round notch
#

Has setGhostMode been depreciated?

lime socket
#

@tawdry moss icon didnt work either, heres my new folder structure

tawdry moss
lime socket
#

sadly this hasnt worked either! i did do a fresh install in the hopes that TIS has provided a new example mode to get me started converting my old mod but it doesnt look like they have

#

thank you for the help! ill download a working mod and see what the difference is!

bright fog
#

Currently there seems to be a few weird things happening with the common folder not taking some files

#

Also you have
model -> model_X

#

It's supposed to just be model_X, that's it

#

Models are put in model_X

#

But overall it should work

#

However yeah the problem could be that some of these are not cognized in the common folder

#

I'm curious what's your full path however for these folders

lime socket
#

okay so heres the new tree based on your suggestions:

bright fog
#

Looks good

lime socket
#

this is full path:

G:\SteamLibrary\steamapps\common\ProjectZomboid\mods\DirtysFuneralPyre\42

bright fog
#

That should be good yes

#

Check the new wiki page about it if you want

#

Still being created but I've fully made the parts about the paths

lime socket
#

Sadly its still not working but thank you for your suggestions, i will look over the wiki page youve made!

lime socket
#

of courese, uno momento

bright fog
#

Your icon is named "icon.png"

#

But here you reference it as "poster.png"

#

While I don't see why it wouldn't work anyway (it should be able to use the poster), try setting it as your icon.png

lime socket
#

ah yes, pieandcheese was helping me earlier today, i can change that back

bright fog
#

Nothing looks wrong beside that tho

lime socket
#

changed back and still no luck, I'll start from scratch and make a new folder structure

bright fog
#

Is it a white icon ?

#

Can you send your icon file ?

lime socket
#

currently my mod doesnt show up atall,

placid delta
lime socket
#

heres my very inventive icon

bright fog
placid delta
#

thanks that seems to be about the file structure of how to make mods with new version. thats helpful but i was interested in reviewing the actual Java class and methods for the Animal husbandry. Its a lot easier to use that site then a java decompiler in my opinion

bright fog
#

Still getting created at the bottom tho, but you'll find a bunch of explanations already

bright fog
#

Unofficial java doc

#

Also be aware that the modding Wiki was basically useless and that I'm currently reworking it completely to actually be usable

#

So some pages will not be up-to-date

#

But a lot of stuff are getting updated

full escarp
#

is there a way to add information to the original character info panel? creating a new children for ISCharacterInfoWindow?

lime socket
#

okay @bright fog little update, i decided to put my mod in "G:\SteamLibrary\steamapps\workshop\content\108600\3389781770\mods" folder (this is where steam downloads workshop items) and it is showing in game, unsure on the behaviour behind this but could be something to do with my PZ installation being in a non standard drive? or some other wacky thing but its now being shown in the mod list

#

Thank you so much for your help and updating the wiki, going to need it now my real work is beginning!

bright fog
#

Moved to this page the folder structure

round notch
#

Has anyone managed to get the cheat commands to work on client side without running debug? This seems to have changed from my testing.

mystic vessel
#

Hello guys, I have the code above that removes insulation by crafting

And I'm trying to do the same to remove the combat debuff in this case (set it to 1)
but I've tried every way, every possible way, but it doesn't update within the game
What i'm doing wrong?

mint hawk
#

I once again made a mod that keeps the game from loading - where can I see the error log?

#

I assume that might give me some indicator as to what I messed up.

#

Found it. Zomboid/Logs/ duh.

astral wind
#

is this where i can suggest mod ideas for mod creators?

lime socket
#

Hello Again, does anyone have any resources on how i can access PZ lua classes within my mod project?

im using Rider with IntellJIdea and i want to be able inherit from and use various classes and their functions

bright fog
bright fog
#

We have an addon called Umbrella

#

Adds autocompletion

lime socket
#

ahh okay is that the pinned thread from chuckleberry?

bright fog
#

Yes

#

No ?

#

Wait what thread ?

astral wind
lime socket
#

This? @bright fog

bright fog
#

Yes

cosmic ermine
#

Does anyone have intellisense for B42?

lime socket
#

that maybe what Sir Doggy is talking about!

#

@cosmic ermine the third pin in the pinned threads on this channel

lime socket
#

ah my bad, new to this stuff

#

thats problematic for me too as i want to work with the new build menu

bright fog
#

It's B42 too

bright fog
full escarp
bright fog
#
  • Download VSCode
  • Download Lua server package
  • ctrl shift P
  • Open addon manager
  • Search Umbrella
  • Activate Umbrella unstable
#

Welp it's not showing the Unstable here for some reason

#

But you should have the Unstable too

#

@bronze yoke any idea why Unstable is not showing here ?

cosmic ermine
bright fog
#

Welp idk my PC said no I guess

#

But yeah enable unstable and that's B42

lime socket
#

up and running now, thank you kindly

cosmic ermine
#

<@&671452400221159444>

bronze yoke
full escarp
sterile belfry
#

More than 1 year waiting for an update and the game's graphics API is still not optimized, this is sad

bright fog
#

The game got optimized a fuck ton here

pine tree
#

can we get a TV chatter update? maybe different chatter for different channels?

cosmic ermine
#

Question: what does media do? If common is used by all versions and 42 is used by version 42 then what does media do by itself?

bronze yoke
#

get loaded by build 41

full escarp
#

i try to display some custom values to the characterinfo window, but struggle with updating the variable

but it shouldn't say nil

i've overriden the creation of this ui element


function ISCharacterScreen:createChildren()
    original_createChildren(self)
    
    local y = self.height
    local customLabel = ISLabel:new(250, y, 20, "Custom Info:", 1, 1, 1, 1, UIFont.Small, true)
    self:addChild(customLabel)
    
    
    y = y + 20
    local infoLabel = ISLabel:new(250, y, 20, tostring(InfectionLevel) , 1, 1, 1, 1, UIFont.Small, true)
    self:addChild(infoLabel)
end

and also the prerender to update the value

function ISCharacterScreen:prerender()
    original_prerender(self)
    updateInfectionLevel()
end
#

but i am also not sure if overriding these functions should be the way to go to implement custom ui elements into existing screens

smoky vine
#

Hey guys, i made a backpack mod a while ago, what would be required to update it so it works w b42?

sand gull
#

Does the combo getNumActivePlayers() and getSpecificPlayer(playerIndex) allow me to select online players in multiplayer or just the splitscreen players?

bronze yoke
#

just splitscreen players

sand gull
lime socket
#

@smoky vine this could be a start!

cosmic ermine
#

Is it possible to make settings for your mods now? Without mods like ModOptions?

bronze yoke
#

for online players, from the server you can do```lua
local players = getOnlinePlayers()
for i = 0, players:size() - 1 do
local player = players:get(i)
-- do something to player
end

restive lodge
#

@full escarp Maybe check out killcount mod by tchernobill. killcount directly modifies that same window

smoky vine
lime socket
full escarp
lime socket
#

Does anyone know of a mod that adds new things to the build menu that i can look at?

lapis moth
lime socket
lapis moth
#

have no idea

lime socket
#

ahaha, thank you anyway!

lapis moth
#

Try to take a look at the vanilla code. I think the formula for architecture should be similar to the synthesis of items

lime socket
#

from looking at a mod using the new crafting menu it uses alot of tags in its recipe script so im guessing its similar but its a bit of a black box

#

good idea, i keep forgetting ive decompiled it

bronze yoke
#

when you're close enough to a player for the first time you start receiving updates about them and won't stop until you disconnect

lapis moth
#

The player's position obtained by this function is not accurate, especially when in the car

#

any guide on how to put a gif in my workshop item?

cosmic ermine
#

Is it possible to add options for my mod?

bronze yoke
#

i haven't worked with it yet but b42 has native mod options, there should be a guide from dhert on them somewhere

cosmic ermine
#

OK, thanks.

crisp fossil
#

Hi how do you get the body location of a clothing?

tacit pebble
#

Does anyone knows what these args for?
setBallisticsColor(int var0, float var1, float var2, float var3)
I thought rgba at the first, but int/ float/ float/ float seems not rgba

cosmic ermine
#

Is it fine to leave common empty?

restive lodge
#

what are my options for looking at the decompiled java code. do I have to decompile it myself or is there a resource somewhere for B42

cosmic ermine
bronze yoke
#

beautiful java doesn't work out of the box with b42, i'd recommend just using vineflower

icy yarrow
#

If only IntelliJ Idea wasn't so expensive

bronze yoke
#

there's a free community edition

waxen knot
#

also, if youre studying you can get a free school license

bronze yoke
#

the reason beautiful java wants you to use idea anyway is just because it comes with fernflower which is just a slightly worse version of vineflower

bright fog
north spindle
#

Forgive me for my stupidity, but I'm trying to make my own True Music Add-on. The instructions say this. It says "For example, add your mod Workshop ID to their names:" Does it have to be their workshop ID, or can it be something else? If it has to be their workshop ID, isn't the ID created when you upload a mod to the workshop? How would I get that if the mod isn't even ready to be uploaded?

bronze yoke
#

they just need to be unique, workshop id is a good way of guaranteeing that

north spindle
#

Oh, ok. Thankyou!

restive lodge
bright fog
#

If you ever need to point someone to a guide, please point to it

sterile belfry
bright fog
#

I don't know anything on the subject but why would they need it ?

#

Are they even using any DirectX ?

bronze yoke
#

nope

sterile belfry
#

The only benefit of using Java in this OpenGL project is the cross-platform option. Even so, we don't have a version of Zomboid for Android and almost all users use Windows

bronze yoke
#

the game has native linux and mac builds, this would not be possible with direct x

north spindle
#

Another question about true music addons, if I name a file say, with Japanese characters, will it show up in-game that way, or will PZ have a brain fart and just replace it with something like □□□□□?

bright fog
sterile belfry
#

Zomboid demands so much from my video card that it's more worthwhile to play anything else

#

I love this game, don't get me wrong

bright fog
sterile belfry
#

But it is a resource black hole

north spindle
bright fog
north spindle
bronze yoke
#

the vanilla english font might not be able to render them though, not sure

north spindle
#

I'll probably just translate the song titles

winter bolt
quasi kernel
#

Is B42 currently having rendering issues to any degree? I ask because I've received 2 bug reports related to Visible Generator Range having to do with rendering (when it literally just uses the basic highlighting system) and I want to confirm that it's not an issue with my mod.

#

Not unless there's new issues associated with the highlights in B42, but even then that doesn't necessarily explain the awkward issues I've been getting reports about.

bronze yoke
#

what kind of rendering issues?

#

as all games do it has rendering issues to any degree

quasi kernel
#

"big shadow box appear in place of generator" and "shadowy ground around world-generated doors"

bronze yoke
#

hmm, i haven't seen anything like that

quasi kernel
#

It just seems so.. odd?

#

Like, all I'm doing is messing with the highlight system from B41 which - to my knowledge - hasn't been thrown out or anything.

#

And I'm not aware of any performant alternatives.

#

I don't know if it's an issue with the highlight system that appeared with B42, if I'm just going crazy, or what.

blazing osprey
#

Mods I place manually aren't showing up in the game, including the example mod. I fresh installed on both my drives and nothing's changing

pastel thorn
#

Hey! Im sorry for asking twice (I believe there were some discussions above), but anyway, wanna be sure if I dont miss anything. Could I just clone the main b from the Umbrella rep, for the 42 unstable version? Seems like my vscode dont want to define this ver and show only 41.**stable, as well as I see only one release for the stable one as well.

Sorry, Im pretty new to this (was trying to recreating stuff from necro capsid half a day and found that there is another way to make things work with umbrella :D)

bronze yoke
#

i'm not sure we've pushed anything into the umbrella repository since b42 dropped

bronze yoke
#

let me check i don't have anything local unpushed actually

storm axle
#

hii

#

i have no experience modding, but i created a mod patch and it WORKED somehow after 12 hours of dying. Now i need to create a version of the base mod Shops for build 42 but i dont know what should i change

bronze yoke
#

there's actually a bunch of long standing issue fixes in there that haven't actually been pushed to the addon manager so you'll be (temporarily) using a better version than everyone else

icy yarrow
#

Well I think I got this as good as I can get it until MP comes out

tacit pebble
tacit pebble
#

and then if you encountered any errors or weird situation, you can ask them 😉

storm axle
#

Just did that, now I am trying to figure out what else must be changed. The mod introduces barely 2 new 2D items which are the coins and that’s all

cosmic ermine
#

My files aren't reloading? I've updated the code and files but the game is still loading the old version.

#

Is Workshop prioritized than mods?

#

It is... drunk

ebon dagger
#

Ok, I have made a mod that allows you to do "Dead Drop" trades with offscreen NPC factions. With reputation, values, specific wants etc.

My question:
The code that give the player items when the Dead drop is complete. Does it matter if that is on /server or /client? Should code that adds items to worldObjects be on the server?

cosmic ermine
#

How do I add sandbox options for my mod?

ebon dagger
#

That should have a lot of info on adding sandbox options

storm axle
#

I know I have to make a build 42 file but what am I supposed to put in there?

bright fog
#

It's the same thing, media folder etc

#

But you need to put things in versioning or common folders now

#

You have the comparison of both on that link

#

B41 and B42

outer crypt
#

is there a list of functions around the fluid containers yet? looking for a way to add fluids to a container. thank you

outer crypt
#

thank you very much, Albion. I appreciate you 🙂

umbral raptor
#

Hey, I’m encountering a problem modding a TV channel. My TV channel works, and the text colors and skill changes, but for some reason all text is the Entry ID for each dialogue.

#

Does anyone know how to fix that?

bright fog
#

I'm not familiar at all with modding these however

umbral raptor
#

I don’t think so. Everything works except the displayed text

#

Found the error

bright fog
#

👌

cosmic ermine
#

Where can I find vanilla scripts?

bright fog
#

Should be something like that

cosmic ermine
#

Thanks.

tranquil reef
#

Anyone have any luck finding where the animal items are?

#

You can pick them all up but I don't see any item for them in the scripts files

bright fog
#

I believe there's some weird things with that

#

I wouldn't be able to point you in the right direction, but I believe for furnitures it's a system where it's not an item too or some shit like that

ebon dagger
bright fog
#

Not me, but there's mods that add custom radio channels

ebon dagger
#

Not the XML based ones, but the Dynamic ones.

bright fog
#

However I do not know if that guide is up-to-date, I'm interested to know if it is bcs I'm reworking the modding wiki

ebon dagger
#

Like the Emergency Broadcast that changes based on the weather etc.

bright fog
#

Hmm

#

Maybe

#

Maybe:

  • True Music Radio
  • Braven's radio mod
#

Check these out if they use it, ik they do some radio stuff

ebon dagger
#

That guide is pretty extensive, but something about the way the author explains it, just doesn't calculate in my brain.

bright fog
#

Which don't involve the XML if I'm not mistaken

ebon dagger
#

I'll go look! thanks for the direction. 😄

bright fog
#

I can take them

crystal canyon
#

why is this recipe screaming at me?

java.lang.Exception: unknown recipe param: Base.PropaneTank at InputScript.Load(InputScript.java:551).

craftRecipe RefillPropaneTank {
    timedAction = Refill,
    Time = 50,
    OnTest = Recipe.OnTest.RefillPropaneTank,
    OnCreate = Recipe.OnCreate.RefillPropaneTank,
    Tags = Welding;Refill,
    category = Welding,
    inputs {
        item 1 Base.PropaneTank mode:destroy flags[NotFull], /* Empty or partially used Propane Tank */
        item 1 TW.HugePropaneTank flags[NotEmpty], /* Huge Propane Tank with remaining fuel */
    },
    outputs {
        item 1 Base.PropaneTank, /* Refilled Propane Tank */
    },
    CanBeDoneFromFloor = true,
}
forest vault
#

I'm quite new to modding and I'm trying to just add a few items/recipes to b42 and get familiar with the system, I'm struggling to make an edit to an existing base item (making Base.Flour drainable, as it just creates two distinct items), any help to fix this would be apprechiated!

ebon dagger
crystal canyon
#

testing again thanks

crystal canyon
#

nah, still get the error

module TW
{
imports
{
Base,
}
craftRecipe WeldingPropaneTank {
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.WeldingPropaneTank,
Tags = Welding;InHandCraft,
category = Welding,
inputs {
item 1 Base.PropaneTank mode:destroy flags[NotFull],
item 1 TW.HugePropaneTank flags[NotEmpty],
},
outputs {
item 1 Base.PropaneTank,
},
}

}

#

this is the vanilla recipe for reference
craftRecipe RefillBlowTorch
{
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.RefillBlowTorch,
Tags = InHandCraft;Welding,
category = Metalworking,
inputs
{
item 1 [Base.BlowTorch] mode:destroy flags[NotFull],
item 1 [Base.PropaneTank] flags[NotEmpty],
}
outputs
{
item 1 Base.BlowTorch,
}
}

#

i see, commas

cosmic ermine
#

How to do \n/newlines with texts?

random finch
crystal canyon
#

apparently

bronze yoke
#

Recipe is deprecated, look at CraftRecipe

crystal canyon
bronze yoke
#

yeah

clever surge
#

How can I override the tooltips that show when hovering items in inventory and containers? Trying to add and remove parts of them

outer crypt
#

seems like this should work, it doesn't do anything, not even throwing an error... I can see the container and verify it's empty but it won't take the add... container:getFluidContainer():addFluid(Beer, 1)

umbral raptor
#

can someone help me? i literally cannot get this mod to work. the text displayed in-game in the TV channel i modded in is the RD_ followed by the entry ID

ebon dagger
outer crypt
ebon dagger