#mod_development

1 messages ยท Page 358 of 1

drifting wigeon
#

its weird

bright fog
#

Maybe we should add credits on the Modding project pages on the wiki

bronze yoke
#

when 'i' update the luadocs i actually just click a button after omar has done all the work on the data ๐Ÿ˜…

frank elbow
#

I really was just poking fun at the message lol, I don't mind not getting credit

bright fog
#

Yes, if it uses the online workshop version of your mod

frank elbow
#

The lua stubgen code is secretly a mess so the less people know about it the better ๐Ÿ‘€

bright fog
drifting wigeon
#

nah my code doesnt work for some reason

#

and it should

#

server doesnt recieve client commands

sour wave
#

thanks boss

bright fog
#

Sorry I forgot to answer you after being on the phone with someone, but the translation files don't really use -- comments like @frank elbow explained, I believe the reason this works is simply because if a line doesn't have the right format it is ignored

#

Usually we attribute to translation files the same format as scripts

sour wave
#

So really, i could just type a sentence, and as long as it doesnt contain syntax cues, it should work?

bright fog
bright fog
#

The reason I suggest Java comments, is that you can use the PZ Script highlight extension available on VSCode to make scripts more easily readable, which works really really well for translation files too

frank elbow
#

For translation files, there actually is a specific carve-out for -- that other scripts don't have

bright fog
#

Interesting

#

I believe the PZ Script highlight extension doesn't recognize those tho, let me try

frank elbow
#

Also anything after the last quote on a line is ignored, so if you wanted to get wild you could do UI_string = "translation" // java-style comment

bronze yoke
#

i think the translation files must have actually been lua tables in some build before 41, they're too weird otherwise

frank elbow
#

That'd make sense, with the loose Lua-like syntax

frank elbow
bright fog
#

Actually yes

frank elbow
#

We love separate parsers for different script types

#

Nah, true for other scripts but not translations

bright fog
#

Yes they do ๐Ÿ˜…

#

Translations entries do not work if you don't have a comma

frank elbow
#

I could've sworn they didn't, let me check

bright fog
#

It is also a very recurring mistake of translations

bronze yoke
#

i do seem to remember this coming up but i might be thinking of people forgetting to put commas on the script lines that reference the translations (specifically in sandbox options)

frank elbow
#

There's no check for commas in the translation file parser

sour wave
frank elbow
#

It certainly is true for other scripts

cinder storm
#

it is a viable strategy to just.. copy the way the game does things and implement it into your own mod?

im looking at foraging definition files right now for 42.13, would it be wise to just c&p them and substitute in my own items, and/or is there anything else to look out for when implementing foraging for items from your own mod

bright fog
#

I swear to god translation files caused issues with commas before and I had already told people the reason their translation don't work is because of commas

frank elbow
#

I'd just write a translation file just to confirm but I moved all my translations to Fluent & can't be bothered

sour wave
#
    java.lang.RuntimeException: invalid or missing VERSION at CustomPerks.parse(CustomPerks.java:115).
    Stack trace:
        zombie.characters.skills.CustomPerks.parse(CustomPerks.java:115)
        zombie.characters.skills.CustomPerks.readFile(CustomPerks.java:94)
        zombie.characters.skills.CustomPerks.init(CustomPerks.java:36)
        zombie.GameWindow.initShared(GameWindow.java:207)
        zombie.GameWindow.init(GameWindow.java:1179)
        zombie.GameWindow.mainThreadInit(GameWindow.java:690)
        zombie.GameWindow.mainThreadStart(GameWindow.java:560)
        zombie.MainThread.mainLoop(MainThread.java:58)
        java.base/java.lang.Thread.run(Unknown Source)```Anyone know what might be causing this? it's not throwing an error specific to my mod so Idk
bright fog
#

Also here's what that extension does with the formatting of translation files, way easier to read that way

sour wave
#

Or is this just a base game error?

bright fog
#

And comments

frank elbow
#

So you have some script (from context, a perk) that should be setting VERSION to a value

frank elbow
#

Fwiw I remember having missed commas & them working fine too

bright fog
#

Ok interesting, so I guess commas are no longer mandatory for translation files, but I swear to god they were needed

frank elbow
#

I always included them anyway because force of habit

#

At least as of b41 they weren't needed, idr before that

bright fog
#

I guess I'm missremembering, I arrived at the last B41 version

bleak remnant
#

hello, can someone help me?

sour wave
bronze yoke
#

you might have been thinking of people forgetting to put commas on the translation line of sandbox options

#

i remember that coming up multiple times for some reason

bleak remnant
#

i am gaving a problem with my code... honestly, with anything that have "player:" in it

frank elbow
bright fog
#

TIS and their freaking custom text based data ๐Ÿ’€

bleak remnant
#

this mod is suposed to track if you are holding an item with blood on it, but it bitches about it everytime i try to use... It worked fine before 42.13

#

"function BloodyHands.evaluateProtection(player)
local hazmatSuit = BloodyHands.getHazmatSuit(player)
local hasHazmat = false
local protectionLevel = "none" -- "none", "fingerless", "damaged", "good", "hazmat"
local gloveHoles = 0
local isFingerless = false

if not player or not player.getWornItem then
    return hasHazmat, protectionLevel, gloveHoles, isFingerless
end

if hazmatSuit then
    local holes = hazmatSuit.getHolesNumber and hazmatSuit:getHolesNumber() or 0
    if holes <= 0 then
        hasHazmat = true
        protectionLevel = "hazmat"
        return hasHazmat, protectionLevel, 0, false
    else
        protectionLevel = "hazmat_damaged"
        return hasHazmat, protectionLevel, holes, false
    end
else
    local glove = player:getWornItem("Hands")
    if glove then
        local fullType = glove.getFullType and glove:getFullType() or nil
        isFingerless = fullType and FINGERLESS_GLOVE_TYPES[fullType] or false
        gloveHoles = glove.getHolesNumber and glove:getHolesNumber() or 0
        
        if isFingerless then
            if gloveHoles > 0 then
                protectionLevel = "fingerless_damaged"
            else
                protectionLevel = "fingerless"
            end
        else
            if gloveHoles >= MAX_CALC_HOLES then
                protectionLevel = "damaged"
            elseif gloveHoles > 0 then
                protectionLevel = "damaged"
            else
                protectionLevel = "good"
            end
        end
    else
        protectionLevel = "none"
    end
end

return hasHazmat, protectionLevel, gloveHoles, isFingerless

end
"

bronze yoke
frank elbow
bleak remnant
#

Can someone help?

frank elbow
frank elbow
#

Fluent allows custom functions so I also added a function for determining the correct Korean particle to use for the given text (before it had to be ์„/๋ฅผ, now it's smart enough to pick)

#

So, asymmetric translation example:

# in en:

# @param $name string The name of the player who drew a card. This may include rich text formatting.
# @param $card string The full name of the card that was drawn.
# @param $rawName? string The name of the player who drew a card, without formatting.
# @param $space? string The rich text space to include after the name, or an empty string if not rich text.
command-card = { $name }{ $space } draws { $card }

# in kr
command-card = { $name }{ KR_PARTICLE($rawName, type: "subj") }
    { KR_WITH_PARTICLE($card, type: "obj", numeral: "sino") } ๋ฝ‘์•˜์Šต๋‹ˆ๋‹ค
open fossil
#

I feel like I picked a shit time to try to learn to mod.

frank elbow
sour wave
#

-_- so everything now needs in a content folder lol

bright fog
sour wave
#

but not to just slap it in the mods foler?

open fossil
bright fog
frank elbow
#

Workshop mods have always required Contents

frank elbow
#

The mods folder is a separate thing

bright fog
bleak remnant
#
    local hazmatSuit = BloodyHands.getHazmatSuit(player)
    local hasHazmat = false
    local protectionLevel = "none"  -- "none", "fingerless", "damaged", "good", "hazmat"
    local gloveHoles = 0
    local isFingerless = false

    if not player or not player.getWornItem then
        return hasHazmat, protectionLevel, gloveHoles, isFingerless
    end

    if hazmatSuit then
        local holes = hazmatSuit.getHolesNumber and hazmatSuit:getHolesNumber() or 0
        if holes <= 0 then
            hasHazmat = true
            protectionLevel = "hazmat"
            return hasHazmat, protectionLevel, 0, false
        else
            protectionLevel = "hazmat_damaged"
            return hasHazmat, protectionLevel, holes, false
        end
    else
        local glove = player:getWornItem("Hands")
        if glove then
            local fullType = glove.getFullType and glove:getFullType() or nil
            isFingerless = fullType and FINGERLESS_GLOVE_TYPES[fullType] or false
            gloveHoles = glove.getHolesNumber and glove:getHolesNumber() or 0
            
            if isFingerless then
                if gloveHoles > 0 then
                    protectionLevel = "fingerless_damaged"
                else
                    protectionLevel = "fingerless"
                end
            else
                if gloveHoles >= MAX_CALC_HOLES then
                    protectionLevel = "damaged"
                elseif gloveHoles > 0 then
                    protectionLevel = "damaged"
                else
                    protectionLevel = "good"
                end
            end
        else
            protectionLevel = "none"
        end
    end

    return hasHazmat, protectionLevel, gloveHoles, isFingerless
end
bronze yoke
bleak remnant
bleak remnant
#

ah, ok, let me try again

#

let me try that somewhere else until it be that way

bright fog
#

Just modify your messages

frank elbow
bright fog
#

That way you don't constantly repost your message

bleak remnant
#
-- function BloodyHands.evaluateProtection(player)
    local hazmatSuit = BloodyHands.getHazmatSuit(player)
    local hasHazmat = false
    local protectionLevel = "none"  -- "none", "fingerless", "damaged", "good", "hazmat"
    local gloveHoles = 0
    local isFingerless = false

    if not player or not player.getWornItem then
        return hasHazmat, protectionLevel, gloveHoles, isFingerless
    end

    if hazmatSuit then
        local holes = hazmatSuit.getHolesNumber and hazmatSuit:getHolesNumber() or 0
        if holes <= 0 then
            hasHazmat = true
            protectionLevel = "hazmat"
            return hasHazmat, protectionLevel, 0, false
        else
            protectionLevel = "hazmat_damaged"
            return hasHazmat, protectionLevel, holes, false
        end
    else
        local glove = player:getWornItem("Hands")
        if glove then
            local fullType = glove.getFullType and glove:getFullType() or nil
            isFingerless = fullType and FINGERLESS_GLOVE_TYPES[fullType] or false
            gloveHoles = glove.getHolesNumber and glove:getHolesNumber() or 0
            
            if isFingerless then
                if gloveHoles > 0 then
                    protectionLevel = "fingerless_damaged"
                else
                    protectionLevel = "fingerless"
                end
            else
                if gloveHoles >= MAX_CALC_HOLES then
                    protectionLevel = "damaged"
                elseif gloveHoles > 0 then
                    protectionLevel = "damaged"
                else
                    protectionLevel = "good"
                end
            end
        else
            protectionLevel = "none"
        end
    end
#

way too long

#

this part is the end

#
-- return hasHazmat, protectionLevel, gloveHoles, isFingerless
end
frank elbow
#

It'd also be helpful to know what the error is (or errors are)

#

A lot changed in 42.13

bright fog
frank elbow
#

I don't know if it's really good enough to warrant a spot among the greats lol, but will do

bleak remnant
#

this worked just fine before the update

frank elbow
#

What is line 7

bright fog
bleak remnant
#

everything that uses "player:" don't work

bright fog
#

If that makes it better for you

bleak remnant
bronze yoke
#

i'm definitely interested to see what's in your library

bright fog
#

The objective is to document technical modding projects made for modders

frank elbow
#

I'll let y'all know when it's out, but it really is just an eclectic collection of stuff I'll use in other mods + some UI stuff

bright fog
#

A lot of those projects never see actual use, but if someone wants to work on something that doesn't X Y Z, they can easily find other projects similar

bleak remnant
#

anyway

bright fog
bronze yoke
#

i dress it up but it's just 'i needed this for a mod so i made it'

bright fog
#

๐Ÿ˜…

bleak remnant
bright fog
#

Jesus

#

Split it in files

frank elbow
#

Line 7 of GlovesInventoryTransfer.lua

bleak remnant
#

it is one of the codes that is giving me the same problem

frank elbow
#

That's that file?

bleak remnant
bright fog
#

Gosh I need to write that guide for errors

bleak remnant
#

but it have like... a lot

#

that shares the same problem.

#

can i send it here?

cinder storm
#

is itempicker necessary for distributions in 42

bright fog
#

No idea what that is

cinder storm
#

Items/ItemPicker

bleak remnant
cinder storm
#

ive seen it on some mods distributions before

bronze yoke
#

no

#

ItemPicker is b40 code

bleak remnant
#

sorry if the comments are in portuguese

#

anyway, this whole project is tied to a "database" called ModState

#

it saves icons and only work if the right icon is on

#

so you probably won't be able to use it if you try

#

but still... about the problem

#

i guess something change with the way you use the code like that one i just shared here

cinder storm
# bronze yoke ItemPicker is b40 code

i see, im trying to figure out distributions again since i made an attempt to convert a mod from b41 to b42. my main issue is with changes to distribution, sandbox options and foraging syntax

drifting wigeon
#

sendclientcommand doesnt seem to work

cinder storm
#

i think i could figure things out with pzwiki, the javadocs and the game files as examples

#

but if im confused ill ask

bronze yoke
#

nothing has really changed about the syntax for distributions

#

a couple container/room names changed but that's mostly it for breaking changes

bleak remnant
bronze yoke
#

no don't worry

cinder storm
bleak remnant
#

ok

cinder storm
#

i just added itempicker just incase

#

there are sandbox options and i looked at them, nothing seems off when comparing the pzwiki syntax and the sandbox options txt

#

ill drop that aswell

#

probably the "version = 2" thing throwing it off? since i dont see that anywhere from examples

drifting ore
#

What does ItemPickerJava.Parse() do?

cinder storm
#

i think it had something to do with parsing distributions

bright fog
#

It shouldn't be needed

cinder storm
# cinder storm

ill just test removing the version bit to see if it fixes anything or if i encounter anything new

drifting ore
#
table.insert(ProceduralDistributions.list["BedroomDresserRedneck"].items, "ReeferMadness.Joint")
table.insert(ProceduralDistributions.list["BedroomDresserRedneck"].items, 0.01)```
drifting ore
#

I removed that, that is a local function I wrote for adjusting spawn rates with sandbox options

cinder storm
#

i had this for suburbs

 -- Male
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, "CKRations.CannedCRationBUnit");
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, CRationBUnitRolls);
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, "CKRations.CannedCRationMUnit");
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, CRationMUnitRolls);
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, "CKRations.KRation");
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, KRationRolls);

        -- Female
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "CKRations.CannedCRationBUnit");
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, CRationBUnitRolls);
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "CKRations.CannedCRationMUnit");
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, CRationMUnitRolls);
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "CKRations.KRation");
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, KRationRolls);```
#

i just had a simple variable that should link to SO

cinder storm
drifting wigeon
#

send client command doesnt seem to work

cinder storm
drifting ore
#

Yeah ignore the value, it gets changed in my code

drifting wigeon
#

doesnt work for me

cinder storm
cinder storm
drifting wigeon
#

sending a signal

cinder storm
#

so you're just testing it out

drifting ore
#

Your Proced is table.insert(ProceduralDistributions["list"] instead of table.insert(ProceduralDistributions.list

#

Idk if that means the same thing

bronze yoke
#

it means the same thing

drifting wigeon
bronze yoke
#

in lua table.string is syntactic sugar for table["string"]

cinder storm
#

the issue might actually have to do with MP, would I have to move foraging to either client or shared?

#

or does it stay in server regardless

drifting wigeon
#

i mean nothing's wrong with this as far as i know

#

but it doesnt reach server

#

is this normal on a self hosted server or sum?

frank elbow
#

Can you show your code for receiving it on the server?

drifting wigeon
#

all prints on onserverstarted print

frank elbow
#

When/where are you calling sendClientCommand?

drifting wigeon
#

so i assume its hooked

bronze yoke
#

i think it's too late to send a command when OnDisconnect triggers

drifting wigeon
#

i mean it should send correctly

#

but doesnt

frank elbow
#

See what albion said

bronze yoke
#

you're sending a command after you've disconnected from the server

drifting wigeon
#

thats the thing

bronze yoke
#

that one is the result of a bug

#

the client can't send commands until one tick after loading in

cinder storm
#

everything seems to be fine in SP

drifting wigeon
frank elbow
frank elbow
cinder storm
drifting wigeon
#

like by a tick

#

then

cinder storm
# cinder storm not spawning on zeds

its sandbox options because its not showing up in sandbox settings meaning nothing is going to spawn since its relying on variables from sandbox settings that dont exist

frank elbow
drifting wigeon
#

isnt onplayerupdate bound to player instance? and doesnt fire until player is spawned?

frank elbow
#

I was thinking of OnPlayerMove, I think, but that's moved to the server now. Yes, update is tied to the instance, but same problem with OnCreatePlayer in that you'd have to do it on the tick after loading in

drifting wigeon
#

hmm

#

how i can get this solved

drifting wigeon
#

it will be the same thing

#

i wanted to get there

drifting wigeon
#

onplayerupdate?

bronze yoke
#

i think you still need to wait one tick even if you use OnPlayerUpdate

drifting wigeon
#

btw client lua will reload each time you join a server right?

frank elbow
#

At least with OnTick I've had success just listening until the player is available

drifting wigeon
#

so i use on tick

#

and then when ontick fires

#

i fire the sendclientcommand

#

and remove the ontick callback

#

?

frank elbow
#

Yeah

drifting wigeon
#

i will just make a wrapper for this

cinder storm
#

now what could be causing this

#

lack of translation file?

#

thats pretty much my only issue left

frank elbow
# cinder storm now what could be causing this

What is the relevant code? The unpaired ] makes me think this is a garbled [img= BBCode tag, maybe due to the [B42] in the directory. But that's a shot in the dark, unsure off the top of my head whether the parser would fail on that

cinder storm
#

besides the rations option for foraging being above everything else

frank elbow
#

I don't know why it would have the full path, though

#

So I think it might be something else

cinder storm
drifting wigeon
#

would this work?

#

hmmm

frank elbow
# drifting wigeon would this work?

Events.OnTick.Remove (not :Remove) and you should be checking for the player before trying to send, assuming this is the create player one. I can never remember whether Lua (or Kahlua) handles forward-declaration with local functions, but assuming it does then that should be all

drifting wigeon
#

that fires after a tick

#

always

frank elbow
#

I see, then just the .Remove

drifting wigeon
opal laurel
#

thanks for your help omar

drifting wigeon
#

FINALLY

cinder storm
drifting wigeon
#

is onlineid the playerIndex?

#

bc for me its 0

#

and im alone in my server

#

if its like this

#

i wouldnt like to use it to keep track of players

#

can i do like table[isoplayer] = this

#

?

frank elbow
#

They won't be reused in the same session, so if the data doesn't need to be persistent it can be used to keep track of players

small topaz
#

Take that, refactored build 42.13 profession system!

pearl prism
#

Does anyone know how to deal with this type of error in the log:
ItemPickInfo -> cannot get ID for container:

My custom containers for my vehicles keep giving this error and I have no idea what I need to configure to fix it.

bright fog
small topaz
# bright fog Why is it printed in the logs ? ๐Ÿง

That's console output from my version 42.12 profession mod. I just printed everything from there to the console in the new 42.13 format. I'll use this for copy-paste when updating it to 42.13 (there around 40 professions I have to update, so it will be much faster doing it this way)

bright fog
#

What ????

#

Oh you automatically formatted it to the new format ?

small topaz
#

Yeah. But that's just some easy quick and dirty lua scripting. Nothing difficult.

bronze yoke
#

the old and new trait systems are barely different, it's just the input format that has changed

#

CharacterTraitDefinition is almost identical to TraitFactory.Trait but has some extra functionality

small topaz
#

btw traits: is it possible to give the player a new trait on server side and so that it works in mp?

frank elbow
bronze yoke
#

oh yeah you're right

#

it's all a little confusing ๐Ÿ˜… skills are perks even though 'perk' is the term usually used for things similar to traits, which are just traits, and occupations are professions

frank elbow
#

I do wonder why they stuck with 'Perk' when (iirc?) the UI refers to them as skills, but maybe just a holdover that didn't make sense to change

#

Hopefully considered for a rename if/when they change like the other defs

bronze yoke
#

you used to have to buy them with points, which is a bit more like a typical 'perk', but i think they were still called skills even then

#

if they predated traits that'd make a bit more sense but i don't think they do...?

frank elbow
#

Their addition was before my time, but either way they've always seemed skill-like to me

#

Which would explain the UI naming, I suppose, but not the code

bronze yoke
shy mantle
#

Can someone try opening a fresh vanilla save and try to use split screen? My game is borked all of a sudden and I'm pretty sure it's not my fault, but it could be on just my end

#

I often see small updates getting queued

#

I'm wondering if they did something that broke split screen

#

I don't want to reinstall with my current internet :P

arctic kayak
#

Hello guys... I'm really strugling with those damn new methods... Does anyone know how to add and remove traits? I've seen that now "getTraits" became "getCharacterTraits", but i can't find anywhere how to get the right type of arguments... I don't know shit about java and decompiling game files to find the right method... does anyone know where we can find the changes?

drifting wigeon
drifting wigeon
#

Hey a question, is it legal to modify .lua files on pz game folder?

bright fog
#

Yes

#

As long as you don't reupload their ENTIRE game

arctic kayak
# bright fog Yes

I don't want to create a new trait, i want to dynamically add or remove one allready existing (smoker)
I manage to find the right method for add and remove (getPlayer():getCharacterTraits().add and getPlayer():getCharacterTraits().remove) but i can't find the right type of argument

bright fog
#

But reuploading their files into your mod modified is fine

drifting wigeon
#

Oh okay thanks

bright fog
bright fog
#

For compatibility reasons, this is way less aggressive and will both improve your mod and make it less annoying whenever they update that specific file

drifting wigeon
#

I need to see how can i let the server know the player left

#

Via event

arctic kayak
#

I have read the Migration guide there nothing about traits... When i try :"getPlayer():getCharacterTraits().add("base:smoker")", it says "expected argument of type ResourceLocation, got String". And i don't understand what is the type "ResourceLocation" or how to deal with it... (English is not my native language...)

bronze yoke
#

you're supposed to add the CharacterTrait, not a string

#

in this example, CharacterTrait.SMOKER

#

for modded traits you need to keep the CharacterTrait somewhere accessible after rgeistering it

bright fog
#

I sent you a link

#

Actually read it ๐Ÿ’€

arctic kayak
#

42.13 broke sooooo many things... I have past the last days trying to fix mods that are not supported by their author anymore... my brain is melting... ๐Ÿ˜…

arctic kayak
#

@bright fog Thank you too!

arctic kayak
mellow frigate
arctic kayak
#

But you guys are awesome!

bright fog
arctic kayak
dull moss
bronze yoke
#

store them after you register them

dull moss
#

aka

ETWRegistry = ETWRegistry or {}


ETWRegistry.AVClub = CharacterTrait.register("ETW:AVClub")
ETWRegistry.AxeThrower = CharacterTrait.register("ETW:AxeThrower")
ETWRegistry.Bloodlust = CharacterTrait.register("ETW:Bloodlust")
ETWRegistry.BodyWorkEnthusiast = CharacterTrait.register("ETW:BodyWorkEnthusiast")
ETWRegistry.FurnitureAssembler = CharacterTrait.register("ETW:FurnitureAssembler")
bronze yoke
#

yes

dull moss
#

and then pull from registry?

bronze yoke
#

yeah

dull moss
#

ok cool ty

#

out of curiosuty did they cook something with weight or the only way for multiple mods that modify carry weight to sync is still just 1 mod overwriting all others while mimicking their logic?

#

also I wonder if I should keep my registry uppercase to follow base game convention but I dislike upper registry so much

bronze yoke
#

they are constants, so the convention of full uppercase makes sense

#

however it is your mod and your conventions are up to you

dull moss
#

ye I know PepeLaugh

frank elbow
#

I failed to mention I wrote an analyzer with neat GitHub actions support when talking abt Fluent earlier

#

I also included support for run summaries which is less straightforward, but there's a node package GitHub has for it (it's just writing to a file specified in an env variable instead of writing output)

cold skiff
#

I'm desperate with the body location changes; I have four outdated mods and nothing works. I'm currently working on the simplest one, the Legendary Satchel, which creates a new body location so I can equip it along with the backpack and/or fanny pack. Here's what I've done so far:

LSBodyLocation = {}
LSBodyLocation.ItemBodyLocation = {}

LSBodyLocation.ItemBodyLocation.LSsatchel = ItemBodyLocation.register("lsbodylocation:LSsatchel")

--in media/scripts/LSitems.txt

    /* === GREY === */
    item Bag_LegendarySatchel_Grey
    {
        DisplayName = Legendary Satchel (Grey),
        DisplayCategory = Bag,
        ItemType = base:container,
        Weight = 1,
        IconsForTexture = LegendarySatchel_GreyIcon,
        BloodLocation = Bag,
        BodyLocation = LSsatchel,
        CanBeEquipped = LSsatchel,
        Capacity = 49,
        CloseSound = CloseSatchel,
        ClothingItem = Bag_LegendarySatchel_Grey,
        EquipSound = EquipSatchel,
        OpenSound = OpenSatchel,
        PutInSound = StoreItemSatchel,
        ReplaceInPrimaryHand = Bag_LegendarySatchel_Grey_RHand holdingbagright,
        ReplaceInSecondHand = Bag_LegendarySatchel_Grey_LHand holdingbagleft,
        RunSpeedModifier = 0.99,
        WeightReduction = 99,
        WorldStaticModel = Satchel_Military_Ground,
        Tags = base:isfiretinder;base:isfirefuel,
    }    
--in media/lua/shared/NPCs/LS_BodyLocations.lua

require "BodyLocations"

local group = BodyLocations.getGroup("Human")
group:addLocation("lsbodylocation:LSsatchel")

or

require "BodyLocations"  

local group = BodyLocations.getGroup("Human")
group:getOrCreateBodyLocation("lsbodylocation:LSsatchel")```
bronze yoke
#

group:getOrCreateBodyLocation(LSBodyLocation.ItemBodyLocation.LSsatchel)

small topaz
#

hmm... although I updated my largest mod for single player (not yet mp), subscriber numbers are still going down as hell ๐Ÿ˜ญ

winter bolt
last edge
#

Yes, big change there. Satchels and slung water canteens fight for that slot now

mossy steeple
#

so... is there any little quick description on what changed with the way professions are done now? hoping to get my lil profession rebalance updated for mp here

small topaz
#

is there an easy and secure way to check whether a profession comes from the vanilla game and is not a modded one?

dull moss
#
    character_trait_definition ETW:GymRat
    {
        IsProfessionTrait = false,
        DisabledInMultiplayer = false,
        CharacterTrait = ETW:GymRat,
        Cost = 6,
        UIName = UI_trait_GymRat,
        UIDescription = UI_trait_GymRatDesc,
        XPBoosts = Fitness=1;Strength=1,
        MutuallyExclusiveTraits = base:unfit;base:emaciated;base:very underweight;base:underweight;base:out of shape;base:weak;base:feeble,
    }

PepeThink why mutually exclusive traits don't work (aka I can still pick them), I double checked in base game code and the names align

#

aka anyone knows where's the mistake? xd

spring wind
#

Is there a mod that allows sharing of player builds? My naive version would just use a block of JSON but in my ideal world we'd base64-encode or something to make it like sharing blueprints in Factorio.

dull moss
#

out-of-the-box - no, afaik

bright fog
bronze yoke
spring wind
#

I can see why a person would think I was talking about Player Buildings.

bright fog
#

Oh bruh lmao

#

Yea that's completely different hahalol

bronze yoke
#

the game already lets you save and load builds to file, you just need to transmit them

bright fog
#

True yea

#

Forgot about that, you can save your trait build

spring wind
bright fog
#

And directly use that

spring wind
#

I was hoping for something a bit more turn-key for those who might be averse to navigating filesystems and the like but that's a good place to start. Thanks!

bright fog
#

I saw this concept being applied recently, but you can technically pass any information you want through URLs when going on a website, and a modder used this to pass directly in-game data to a website he had setup

#

Extremely interesting system

frank elbow
#

Very curious as to how this was done with b42's limiting of requests, hoping it's something I missed & not the URL trick I'd considered as a possibility

#

Wow, that was not the URL trick I considered but it's much smarter than mine

#

I have a feeling that'll be patched ๐Ÿ˜“ but good to know

bright fog
#

They simply pass an entire dataset through the URL

frank elbow
bright fog
#

It is kind of sus security wise lmao

frank elbow
#

I'm referring to the way they have to do the actual request in b42, since it's now an allowlist of URLs

bright fog
#

Nothing new

frank elbow
#

string.format("https://steamcommunity.com/linkfilter/?u=https://%s?%s", url, query)

bronze yoke
#

i assume they use the steam trick

bright fog
#

That has always been like that

frank elbow
#

It hasn't

bronze yoke
#

it is new yeah

bright fog
#

Is it B42 new ?

#

Thought that was in B41 too

frank elbow
bright fog
#

But the trick anyway is absolutely not new lol

bronze yoke
#

i first heard it around b42 release ๐Ÿ˜…

bright fog
#

That's been known since that problem appeared at least

frank elbow
#

Maybe it was true for openUrl? Before we had getInputDataStream or whatever

#

Which was effectively a GET request

bright fog
#

Chuck was the first to use it to my knowledge

#

I personally used it in Wiki That until the official pzwiki link got added to the whitelist

limber solar
#

ive just created 2 separate mods to fix resting on chairs and ground and nimble

#

someone was interested earlier

frank elbow
#

Checked, it was anything starting with http:// or https:// in b41 (for getUrlInputStream. openUrl didn't have such a check, which come to think of it is pretty concerning ๐Ÿ˜…)

verbal yew
#

It act like it starts crafting with the white text "Crafting bobby pin" then immediately disappears
whats wrong?
media\scripts\generated\recipes:

module BetLock
{
    imports
    {
        Base
    }

    craftRecipe CreateBobbyPin
    {
        Time = 20,
        NeedToBeLearn = true,
        timedAction = Making,
        AutoLearnAll = Nimble:3,
        Tags = InHandCraft,
        category = Miscellaneous,
        inputs
        {
            item 1 tags[base:pliers] mode:keep flags[Prop1],
            item 1 [Base.Paperclip],
        }
        outputs
        {
            item 1 BetLock.HandmadeBobbyPin,
        }
    }
    
    craftRecipe CreateBobbyPin2
    {
        Time = 60,
        NeedToBeLearn = true,
        timedAction = Making,
        AutoLearnAll = Nimble:3,
        Tags = InHandCraft,
        category = Miscellaneous,
        inputs
        {
            item 1 tags[base:pliers] mode:keep flags[Prop1],
            item 2 [Base.Wire],
        }
        outputs
        {
            item 10 BetLock.HandmadeBobbyPin,
        }
    }
}

media\scripts\generated\items

module BetLock
{
    imports
    {
        Base
    }
    item HandmadeBobbyPin
    {
        DisplayCategory = Tool,
        ItemType = base:normal,
        Weight = 0.01,
        Icon = HandmadeBobbyPin,
        Tooltip = Tooltip_BetLock_BobbyPin,
        WorldStaticModel = Paperclip,
    }
}
#

recipe presist in list, but in debug item list HandmadeBobbyPin with line Craft = False

small topaz
#

Do the player modData behave somehow differently when they are stored and retrieved on client side?

#

(in MP)

young trellis
#

Has the file struture for mods changed in the last two months by any chance?

verbal yew
tame mulch
# verbal yew yes

Exist bug now: in MP craft recipes not work, if recipe not from Base module. Fix WIP ๐Ÿ™‚

young trellis
#

For B42 do you still use the mods folder to work on mods locally or do you use the workshop folder?

winter bolt
willow tulip
cold skiff
jaunty iris
#

does some here know wheere i can get a .fspro template file?

jaunty iris
#

to make a cutom sound mod

trim yacht
#

Is there a way to post a message from the system or server so that the discord bot will pick it up? Bonus points: even when a player isn't logged in? Use case is for posting about server restarts which may happen even if there isn't a user on

mighty forum
#

How hard would it be to edit a mod to change clothing protection stats with no knowledge of Lua?

cold skiff
verbal yew
#

@tame mulchstrange thing, even if all recipes and items be module base - it's not work.

yep. it's fixes issue with insta cancel without result - anims work, times goes into craft, but without result, without items spend

module Base
{
    craftRecipe BetLockCreateBobbyPin
    {
        Time = 20,
        NeedToBeLearn = true,
        timedAction = Making,
        AutoLearnAll = Nimble:3,
        Tags = InHandCraft,
        category = Miscellaneous,
        inputs
        {
            item 1 tags[base:pliers] mode:keep flags[Prop1],
            item 1 [Base.Paperclip],
        }
        outputs
        {
            item 1 BetLock.BetLock_HandmadeBobbyPin,
        }
    }
}
module Base
{
    item BetLock_HandmadeBobbyPin
    {
        DisplayCategory = Tool,
        ItemType = base:normal,
        Weight = 0.01,
        Icon = HandmadeBobbyPin,
        Tooltip = Tooltip_BetLock_BobbyPin,
        WorldStaticModel = Paperclip,
    }
}
#

I don't know if I'm doing something wrong, but at least in the debug in the item list, the Base.BetLock_HandmadeBobbyPin has a True value for Craft now.

#

so any new recipe doesn't work in mp?

#

BetLock.BetLock_HandmadeBobbyPin...
Jesus...
Base...

#

Nope, not working

bright fog
mighty forum
tulip valve
#

How do I support B42.12.3 for my mod? Do I simply create a new folder called 42.12.3 and put my files there?

willow tulip
#

the proper way is make a B42 and B42.13 folder. B42 folder for B42.0 through B42.12.x and B42.13 folder for B42.13+

tulip valve
#

Alright thanks ^^

#

And that is confirmed to work?

willow tulip
#

Yes

mellow frigate
#

#MakeA42.13Folder

worldly folio
#

Are there any users here who can build me a mod that I need to translate into Hebrew for a fee?

tulip valve
#

I just had my folder called 42, so I guess its fine to also call it B42

mellow frigate
bronze yoke
willow tulip
bronze yoke
#

i haven't used it but i've seen the code for it and it seems like it should work

mellow frigate
worldly folio
#

I feel invisible, they don't even respond to me once.

willow tulip
bronze yoke
#

yeah i can't imagine needing a bugfix-specific directory

willow tulip
#

yea b42.12.x hotpatches changed so little.

#

IMO people want the 42 and 42.13 dir

willow tulip
grizzled fable
#

how to use getInventory():AddItems to work properly in multiplayer, anyone have a solution?

grizzled fable
willow tulip
#

you also have to use the sendaddtocontainer function or whatever its called.

#

see the migration guides

bronze yoke
willow tulip
#

poor GOG users

tulip valve
# mellow frigate

Will the game automaticly detect B42.13 or previous with this setup?

mellow frigate
# tulip valve Will the game automaticly detect B42.13 or previous with this setup?

common folder content is used by every version (starting with B42). then 42.13 folder overrides or patches only if game version is at or above B42.13. then 42 folder content overrides or patches only if game version is above B42 and below B42.13 (mine is empty except for mod preview & icon png because it was required in previous versions).

bronze yoke
#

that's not quite right, only files from the highest version folder that doesn't exceed the current game version will be used

#

so if you have a 42.13 folder and you're playing in 42.13, nothing in 42 will be loaded

willow tulip
tulip valve
#

I just tested, loaded up 42.12.3, game loaded that version of my mod, then went back to 42.13 and game loaded the that version instead, so it works

grizzled fable
bronze yoke
#

of course it's possible, you just need to do it on the server and transmit it afterwards

grizzled fable
# bronze yoke of course it's possible, you just need to do it on the server and transmit it af...

i did like this why is not working?
`local function onZombieDead(zombie)
if not zombie then return end

local zombieId = zombie:getObjectIndex()
local attacker = lastAttacker[zombieId]

if attacker and attacker:getInventory() then
    local amount = ZombRand(1, 4) -- 1-3 soldi
    local inventory = attacker:getInventory()

    for i = 1, amount do
        local money = instanceItem("Base.Money")
        inventory:AddItem(money)
        sendAddItemToContainer(inventory, money)
    end

    attacker:setHaloNote("+" .. amount .. "$")
end

lastAttacker[zombieId] = nil

end`

#

you mean i should trasmit after the loop?

#

can you point me to an actual working code for doing this?

bronze yoke
#

i don't think this is a server event

#

the client cannot add items

grizzled fable
#

this script it's inside server folder

#

or you mean the OnZombieDead event

bronze yoke
#

the folders are just for organisation, server folder runs on both

grizzled fable
#

so what do you mean when you say it's not on server side?

bronze yoke
#

i think that event is a client event which means that code is not running on the server

grizzled fable
#

when you say "that event" you mean OnZombieDead?

bronze yoke
#

yeah

green berry
#

I'm pretty sure Events.OnZombieDead is firing on the server, let me check 3s

grizzled fable
green berry
#

yeah Events.OnZombieDead should fire on the server,but to add item to clients from the server i'm using commands instead of trying to add item from the server side. So i kind of have the same issue

grizzled fable
#

it's working with commands?

green berry
grizzled fable
#

can you show me an example for adding an item with commands?

green berry
tulip valve
#

anyone know what CharacterStat food sickness is called? is it just FOODSICKNESS? lol

fleet bridge
#

iirc onzombiedead was a client event, not a server event

tulip valve
#

thanks

green berry
fleet bridge
#

on MP?

green berry
# fleet bridge on MP?

yeah, i've ran more test with a dedicated and the event is firing on both the server and the client :
On server : LOG : General f:299, t:1765815805205, st:581ร”ร‡ยป721ร”ร‡ยป580> [Quest] [KillDetector] Zombie killed by player
On client : LOG : General f:873, t:1765815805568, st:581,721,921> [Quest] [KillDetector] Zombie killed by player

grizzled fable
green berry
grizzled fable
#

i do like this
local amount = ZombRand(1,4)
for i = 1, amount do
local money = instanceItem("Base.Money")
attacker:getInventory():AddItem(money)
sendAddItemToContainer(attacker:getInventory(), money)
end

#

cause i also used getPlayer():getInventory():AddItem(itemType) but ghost happens

green berry
#

locally i don't think you need to instantiate the item like that (don't quote me though), and i never used sendAddItemToContainer i think. But that could be bad practices on my part to be perfectly honest ๐Ÿ™‚

grizzled fable
#

so you using getPlayer():getInventory():AddItem(itemType) on mp and it's working fine?

green berry
#

Well, the server is "commanding" the client to do so, passing the itemType and quantity. The server isn't doing the adding himself. But yeah that does work.

grizzled fable
#

do you have the DoLuaChecksum disabled?

green berry
#

"# ร‰jecte les clients dont les fichiers ne correspondent pas ร  ceux du serveur.
DoLuaChecksum=true"

grizzled fable
#

ty

mellow frigate
#

When I run as a HOST (non dedicated server), what are the values returned by isServer() and isClient() ?

bronze yoke
#

in-game hosted is just running a dedicated server in the background and connecting to it as a regular client

#

so there is still a separate server and client which return the expected values

bright fog
willow tulip
bright fog
#

Also that's now you name the versioning folders

willow tulip
#

I meant the 42.12.x part

willow tulip
#

remind me not to help before my coffee...

#

I make too many mistakes.

bright fog
willow tulip
dull moss
#

How are we supposed to edit registry of base game traits?
Like I have

    character_trait_definition ETW:GymRat
    {
        IsProfessionTrait = false,
        DisabledInMultiplayer = false,
        CharacterTrait = ETW:GymRat,
        Cost = 6,
        UIName = UI_trait_GymRat,
        UIDescription = UI_trait_GymRatDesc,
        XPBoosts = Fitness=1;Strength=1,
        MutuallyExclusiveTraits = base:unfit;base:emaciated;base:very underweight;base:underweight;base:out of shape;base:weak;base:feeble,
    }

and it works if I pick one of exclusive traits first, my trait disappears. However if I pick my trait first I can still pick mutually exclusive traits. I checked base game and if trait A is exclusive with B, they have each other in mutually exclusive traits.

willow tulip
dull moss
#

Elaborate?

willow tulip
#
    character_trait_definition base:unfit
    {
        MutuallyExclusiveTraits = ETW:GymRat,
    }
#

or something.

#

I dunno if base:unfit is correct.

dull moss
#

it is but question is does it append or overwrite

willow tulip
#

zedscript is... funny like that.

dull moss
#

k, will try, ty

willow tulip
#

Like I haven't tried it for this purpose, but thats how it works for just about everything else that takes multiple tags in seperated by ;

bronze yoke
#

they don't actually have 'types' in zedscript so the behaviour of any one property is up to whoever wrote it

dull moss
#

yea no it crashes the game on loading scripts PepeLaugh

bronze yoke
#

in that case you can get the definition in lua and add it there

dull moss
#

is trait factory still there?

#

Cuz its the only way I know

mellow frigate
#

Before I bother Aiteron, can any of you answer about ItemActions: It is necessary to split the โ€œperformโ€ function into 2 functions: โ€œperformโ€ and โ€œcompleteโ€. Both of these functions are executed at the end of Timed Action execution. The client executes only the โ€œperformโ€ function, and the server executes only the โ€œcompleteโ€ one. Singleplayer first executes โ€œperformโ€ and then โ€œcompleteโ€. In MP client-server (Host or dedicated), what are the odds of a sendServerCommand initiated in a complete() call being received client-side before the perform() is called ? what are the odds of a sendServerCommand initiated in a complete() AFTER an item change being received client-side before the item change is taken into account client-side ?

bronze yoke
bronze yoke
dull moss
#

ty for snippet

bronze yoke
bronze yoke
shy mantle
#

Is there anything I need to worry about when using player:getStats():remove(..., ...) for multiplayer?

willow tulip
bronze yoke
willow tulip
#

I don't think your guaranteed that execute occur after all client updates/performs, and would at least put nil checks on your items and stuff in update/perform -_-;

#

I really wish people would just run my mod and install the java part if it asks them to, instead of asking me to personally guess if they need to reinstall it based on the absolute 0 information they have given me about the last time they installed it.

mellow frigate
bronze yoke
#

hmm that's a fair reason yeah

willow tulip
#

on receive packet, if perform has completed you do the next action

#

else, save value and tell perform to do it when it completes

#

Syncing time between clients and servers, along with lag compensation make when stuff occurs kinda.. fuzzy.

ashen charm
#

Is there a mod that adds a like 70s amc pacer?

dull moss
#

thx

young trellis
#

Is there a link or article explaining how to do traits now, I have my old trait mods from a few months ago I want to update to this new way but I havent found the resource

young trellis
#

Thank you

mellow frigate
# bronze yoke for the first question, i would not expect this to ever happen

unfortunately, I receive client side OnMechanicActionDone (sent by dedicated server in ISUninstallVehiclePart:complete) before ISUninstallVehiclePart:perform is called```
LOG : General f:833, t:1765824768687, st:19,564,461> receiveObjectChange mechanicActionDone
LOG : Lua f:834, t:1765824768691, st:19,564,465> AutoMechanics ISUninstallVehiclePart:perform IsoPlayer{ Name:null, ID:145 } zombie.vehicles.VehiclePart@53a568cd nil
DEBUG: Action f:834, t:1765824768692, st:19,564,466> ActionManager.remove > ActionManager remove action { "NetTimedActionPacket": { } , "NetTimedAction": { "type" : "ISUninstallVehiclePart", "name" : null, "actionArgs" : {"character": "IsoPlayer{ Name:null, ID:145 }", "part": "zombie.vehicles.VehiclePart@53a568cd", "workTime": 100.0}, "isUsingTimeout" : true } , "Action": { "id" : 123, "state" : "Done", "playerId" : { "PlayerID": { "playerIndex" : 0 } , "IDShort": { "id" : 0 } }, "duration" : 1866 } }

#

the good thing is: it occured on each test. so it is likely to be reliably sequenced

#

so I can now rework (and I do not like rework) my state machine on a reliable base (and I like reliable).

#

erf even that may be wrong: my server and client are local.

#

@tame mulch about ItemActions:

and โ€œcompleteโ€. Both of these functions are executed at the end of Timed
Action execution. The client executes only the โ€œperformโ€ function, and the
server executes only the โ€œcompleteโ€ one. Singleplayer first executes
โ€œperformโ€ and then โ€œcompleteโ€.```
 In MP client-server (Host or dedicated), what are the odds of a sendServerCommand initiated in a complete() call being received client-side before &and after the perform() is called ? what are the odds of a sendServerCommand initiated in a complete() AFTER an item change being received client-side BEFORE the item change is taken into account client-side ?
#

On a local dedicated server + client, when uninstalling a part for a vehicle, the client receives OnMechanicActionDone before ISUninstallVehiclePart:perform is called. mechanicActionDone is initiated in ISUninstallVehiclePart:complete

willow tulip
frank elbow
small topaz
#

Hi! I want my mod in two versions for B42, one for 42.13 and one for 42.12 and older. Currently I do this by having two folders: 42.12 and 42.13. So my mod's folder structure is this

myMod
-- 42.12
-- 42.13
-- common
-- media (the B41 version)```
Is this the best way of doing this?
#

It seems to work fine but just asking cause I am not sure whether this is the "state-of-the-art" solution.

wicked summit
#

Serious talk are there any videos about how to edit the Occupation Skill points, and make custom jobs? I'm wanting to learn how to do this.
Assuming it's pretty simple but I'm just hoping for a point in the right direction as I am oblivious on modding.

small topaz
# wicked summit Serious talk are there any videos about how to edit the Occupation Skill points,...

Basic infos about making new occupations can be found here: https://theindiestone.com/forums/index.php?/topic/88499-modding-migration-guide-4213/, the Migration Guide.pdf and the testmod_registries.zip for your case.

wicked summit
#

I'm mainly just needing to edit a few jobs so they're stronger, and better for a server I'm working on.

wicked summit
bright fog
#

A video on how to do that ?

small topaz
wicked summit
willow tulip
bright fog
analog tapir
#

Any chance someone could put the 3 guides for mod authors here? I'm curious to read them but it won't let me sign up. Security check is bugged and I;m stuck in a loop

small topaz
#

Does anyone else have the issue that their subscriber numbers go down although the mods are updated for 42.13? I don't even get any bug reports. The numbers are just going down in a way I never noticed before.

drifting ore
analog tapir
bright fog
#

np

young trellis
small topaz
small topaz
young trellis
small topaz
# young trellis So for example the mod when you eat cheese or dairy whatever in game your charac...

so you pbbly have some code running in game which goes like this:

  -- apply negative effects...
end```
????
In that case, you have to use the new trait description system and use smth like
```if player:hasTrait(MyModRegistries.MyTrait) then```
To make this work, your mod's registries.lua should look like this
```MyModRegistries = {}

MyModRegistries.MyTrait = CharacterTrait.register("mymod:mytrait")```
ofc, using some unique names instead of `MyModRegistries` and `"mymod"`.
young trellis
small topaz
#

That's only the trait definition. it won't do anything in game when your character has the trait. Are you the mod's author?

young trellis
#

Yeah this is my project, I'm still new tryna grasp the ideas lol

small topaz
# young trellis Yeah this is my project, I'm still new tryna grasp the ideas lol

Haha ok. Yeah so, to make your trait have any ingame effect when player eats smth, you need explicit lua code which runs during actual gameplay and which applies those effects. Just defining a trait correctly will ony show it in the user interface and make it selectable. But it won't apply any in-game effects without additional coding work.

#

That was also the case pre 42.13 (and even in B41)

young trellis
#

This is the additional lua code, I had it working a few months back but decided to sit on it because I figured something would break things before 42s release which it has lmao I had ai write it up so I could understand how it worked but its still a work in progress figuring out what does what and why etc

small topaz
cinder storm
#

testing on mp 42.13, ive had reports the rations werent opening for some reason. everything appears but it doesnt let the player open them. works fine on sp?

#

do i need to move stuff, theres nothing in client

young trellis
small topaz
# young trellis LactoseIntolerant = CharacterTrait.register("lrrp_traits:lrrp_lactose") So the "...

yeah but the "hasTrait()" requires a CharacterTrait object, not the stringID. see here: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/ILuaGameCharacter.html#hasTrait(zombie.scripting.objects.CharacterTrait) . maybe it also works with a string but then you need at least the full "lrrp_traits:lrrp_lactose" (never tried that though)

also, the command is "hasTrait()" and not "HasTrait()". did you write this code by yourself?

young trellis
small topaz
#

Ok. But then the main debugging is up to you ofc. ๐Ÿ˜‰ Better just ask the original coder about it.

young trellis
small topaz
young trellis
cinder storm
#

can oncreate functions break craftrecipes in MP

cinder storm
#

but the mod still doesnt work, and it only doesnt work in mp

#

the console spits out this every time i try and open the kration too

#

and the recipes

bronze yoke
#

i have heard that recipes outside of the Base module are not working properly right now

cinder storm
#

FUCK

#

alright i guess ill shove everything into base

#

just the craftrecipes right?

#

i dont need to change everything else and put it into base

#

ill test

cinder storm
#

they arent

cinder storm
#

alright so

#
local item = getScriptManager():FindItem("CrateOfPlanks",true) -- true means it will use Base.
item:setActualWeight(5)
local item2 = getScriptManager():FindItem("BoxOfScrapWood",true) -- true means it will use Base.
item2:setActualWeight(1.5)
local item3 = getScriptManager():FindItem("CrateOfTreeBranches",true) -- true means it will use Base.
item3:setActualWeight(5)```
#

this stopped working for 42.13

#

this is a lua script in the server folder

#

the mod is a submod of an existing mod and this is the only thing in the mod

#

did they change something

cinder storm
tranquil reef
#

Is there any way to make debugging errors easier

#

Like a modded debug menu or something? My mod has too many moving pieces to understand what's wrong

cinder storm
cinder storm
tranquil reef
#

It sucks ass sadman. Spits out 3 script names and the line, each of them redirect to a different function that has like 100 lines of code, doesn't get any more specific unless I hack away at my entire mod to try to single it out

#

Not to mention the entire debug menu has almost 0 quality of life support

#

You fix an error, reload lua, can't clear the log history unless you restart. Unless there's a hidden button or something, but pretty sure I've asked before and nobody has given me an answer

cinder storm
cinder storm
tranquil reef
#

A button to clear the console, the ability to drag to copy text, countless other small things I'm not currently thinking about. There's a ton they could pretty easily fix, they just don't want think it's high priority lol

#

Given how big modding is in this game, if I were running it I'd honestly prioritize that more than the content updates. Though making a non-shitty debug console shouldn't hinder content updates if the company is ran well

#

Either way, hope they improve it. Really hope someone makes some sort of mod for it if possible otherwise

cinder storm
#

still need help!

local item = getScriptManager():FindItem("CrateOfPlanks",true) -- true means it will use Base.
item:setActualWeight(5)
local item2 = getScriptManager():FindItem("BoxOfScrapWood",true) -- true means it will use Base.
item2:setActualWeight(1.5)
local item3 = getScriptManager():FindItem("CrateOfTreeBranches",true) -- true means it will use Base.
item3:setActualWeight(5)```
small topaz
#

for me, I have problems when doing this on server folder while playing single player

#

but not sure how it behaves in mp when you also use some of the new sync commands (never tried so far)

young trellis
#
{
    character_trait_definition lrrp:lactose
    {
        CharacterTrait = lrrp:lactose,

        UIName = lactose intolerance,
        UIDescription = Causes stomach issues when consuming dairy products.,

        Cost = -1,
        IsProfessionTrait = false,
        DisabledInMultiplayer = false,

        Texture = media/ui/traits/trait_lrrp_lactose.png,
    }
}

So what am I missing here, everything is right as far as lower case etc the png listed is the exact one I've used prior however now I can edit the name and description fine to reflect at the trait selection screen however my icon wont show up now, i've tried moving the destination to 42 ui traits instead of common and no dice there either

true nova
#

i dont see any uses of it with a boolean rn

#

seeing what it does in java i dont see why it shouldn't work

small topaz
#

does anyone where the the right-click "Walk to" options is realized in lua? I searched the translate file and found a ConextMenu_Walk_to string but I cannot find this anywhere in the lua code???

small topaz
#

do you happen to know whether there is a way to detect when the player goes into the "stand up" animation when quitting the Sit-On-Ground animation?

true nova
small topaz
#

it's "getup" which saves my A**!!!!!!! many thanks!

small topaz
#

Is there a way to mark your as "not availabe in multiplayer" so that it is not shown in the mp's mod menu?

#

would be quite handy when it comes to user-friendliness

bright fog
#

You could throw an error if the mod is activated in MP

#

Or completely deactivate your code too

kind forge
#

anybody else having issues with tracer effects not identifying custom ammo types?

#

i get a CTD immediately upon firing a weapon with custom ammunition

raven epoch
#

or how i can make isoplayer run

#

i tried
NPCObject:NPCSetRunning(true)
NPCObject:setForceRun(true)
NPCObject:setRunning(true)
but isoplayer seems to run for a second before reverting to walking

unreal pewter
#

were there any b42/42.13 changes to assigning weapon models or something? im assigning WeaponSprite to my defined model but it just refuses to recognize it and just keeps rendering it as the icon when dropped in the world

mellow frigate
unreal pewter
#

ive read those a couple of times and i might be missing the part that talks about the model system changing

kind forge
empty gate
#

Hello!

Iโ€™m curious whether itโ€™s possible to create a mod that allows players to cut down traffic signs and use them as weapons.

How complex would it be to implement something like this in Project Zomboid? Would it require heavy engine work, or is it achievable with Lua and existing modding tools?

clear aurora
#

Hello, im doing a mod trying to mod an object, and after some lines of codes, im able to move it to the new position but if the player has seen the object before the move it moves then you cannot see the object in the new location but you cant go through it, you can still see it in the first location but you can pass through it

#

here is the code

stiff fiber
#

Hey guys! I just noticed that the subscriber count of my vehicle mods started a sharp fall since the release of B42 Multiplayer. Did the devs change something with vehicles which causes mods to break?

cold skiff
#

I'm having serious trouble finding information on how to apply bodylocations in version 42.13. My addons place a weapon holster on a part of the body where I then store those weapons.

Until now I did this with the following files:

--in \media\lua\shared\NPCs\LK_BodyLocations.lua

local LKLocations = { 
"KatanaSheath", 
"KatanaSheathHip",
}

local group = BodyLocations.getGroup("Human")
for _, location in ipairs(LKLocations) do 
local bodyLocation = BodyLocation.new(group, location) 
group:getAllLocations():add(bodyLocation)
end

--in\media\lua\shared\NPCs\LK_AttachedLocations.lua
 
local group = AttachedLocations.getGroup("Human")


group:getOrCreateLocation("Katana in Sheath (Back)"):setAttachmentName("Katana_Sheath")

if getDebug() then 
group:getOrCreateLocation("OnBack"):setAttachmentName("back")
end

group:getOrCreateLocation("Katana in Sheath (Hip)"):setAttachmentName("Katana_Sheath_Hip")

if getDebug() then 
group:getOrCreateLocation("OnHip"):setAttachmentName("hip")
end

--in \media\lua\client\Hotbar\LK_ISHotbarAttachDefinition.lua

require "Hotbar/ISHotbarAttachDefinition"
if not ISHotbarAttachDefinition then 
return
end

local KatanaSheath = { 
type = "KatanaSheath", 
name = "KatanaSheath", 
animset="back", 
attachments = { 
Katana = "Katana in Sheath (Back)", 
},
}
table.insert(ISHotbarAttachDefinition, KatanaSheath);

local KatanaSheathHip = {
type = "KatanaSheathHip",
name = "KatanaSheathHip",
animset = "belt left",
attachments = {
Katana = "Katana in Sheath (Hip)",

},
}
table.insert(ISHotbarAttachDefinition, KatanaSheathHip);```

Would someone please tell me how to migrate this code to version 42.13? I've tried a thousand things with registries.lua, etc., but without success. I need documentation, an example, or a mod that does the same thing so I can review the code. I can't find any information and I'm frustrated.
#

here item code

module LK
{
    item LegendaryKatana
    {
        DisplayName = Legendary Katana,
        DisplayCategory = Weapon,
        Type = Weapon,
        Weight = 1.5,
        Icon = LegendaryKatana,
        AttachmentType = Katana,
        BaseSpeed = 1,
        BreakSound = KatanaBreak,
        Categories = LongBlade,
        ConditionLowerChanceOneIn = 100,
        ConditionMax = 100,
        CritDmgMultiplier = 9,
        /* CritDmgMultiplier = 10,*/ /*commented out conflicting values */
        CriticalChance = 35,
        /*CriticalChance = 30,*/
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        DoorDamage = 8,
        DoorHitSound = KatanaHit,
        DropSound = KatanaDrop,
        HitAngleMod = -30,
        HitFloorSound = KatanaHit,
        HitSound = KatanaHit,
        ImpactSound = KatanaHit,
        KnockBackOnNoDeath = TRUE,
        KnockdownMod = 0,
        MaxDamage = 14,
        MaxHitCount = 10,
        MaxRange = 2.0,
        MinAngle = -0.3,
        MinDamage = 8,
        MinRange = 0.21,
        MinimumSwingTime = 3,
        PushBackMod = 0.5,
        RunAnim = Run_Weapon2,
        SubCategory = Swinging,
        SwingAmountBeforeImpact = 0.02,
        SwingAnim = Bat,
        SwingSound = KatanaSwing,
        SwingTime = 3,
        Tags = IgnoreZombieDensity;HasMetal;FullBlade;Sharpenable;RepairKatanaSheet;RepairKatanaScrap,
        TreeDamage = 1,
        TwoHandWeapon = TRUE,
        WeaponLength = 0.4,
        WeaponSprite = LK.LegendaryKatana,
                
        Sharpness = 5.0,
        OnBreak = OnBreak.Katana,
        ResearchableRecipes = MakeLegendaryKatana,
    }```
grand gazelle
#

did barricade code get updated

bright fog
bright fog
cold skiff
# bright fog Pinned messages, read the notice

I've already reviewed all the information about the news pin, but I can't figure out how to apply it without errors, so I'm asking if there's a practical example or an updated mod to see how they solve it.

mellow frigate
#

Hello there, anyone has a clue on why a modded item that is the output of a miscellaneous craft recipe could have its craft flag set to false in the item list ? (B42.13)

merry orchid
#

I'm trying to homebrew NecroForge to work for 42.13 MP. I get it to work for 42.13 SP, but not for MP. Any tips?

It doesn't need to work well. Just a bit. The functionality I need works in singleplayer 42.13.

sacred matrix
#

I've successfully created a Java mod loader for PZ. I made it so the Furry Mod could avoid using clothing and set player models directly, but it is a general mod loader. It uses a Java agent and AOP to avoid distributing copyrighted code. What is Indie Stone's policy on distributing such things?

bronze yoke
#

they don't care

mellow frigate
merry orchid
mellow frigate
merry orchid
#

Oh yeah, that is my final solution. Losing kills and time alive will hurt, but it's game wise ok.

knotty stone
#

why is Recipe.OnCreate crashing on world load with the new version?

bright fog
knotty stone
#

meh to tired for this xD
but the function is working fine when crafting, what do i need to change to get rid of the error on gameload? ๐Ÿ˜ตโ€๐Ÿ’ซ

mellow frigate
knotty stone
#

wow i rly havent looked at that mod a while, i alrady had chance based output in the script, no need for the on create lul

#

anyone found the reason for ppl not being able to enter some cars? (just the door opens)

bleak remnant
#

hey, it is me again...

#

And i need help

#

and i cannot run it

#

i allways have an error here "local glove = player:getWornItem("Hands")"

#

it used to work just fine on 42.12

#

i have tons of error like this on my project now

#

it is on the client side btw

#

i have moved all the timed actions to the right place

#

so, part of my mod works again

#

but i still having trouble with code like this one

#

and i don't know why

mellow frigate
bleak remnant
#

they have a new structure?

#

let me check

knotty stone
# knotty stone anyone found the reason for ppl not being able to enter some cars? (just the doo...

https://streamable.com/zclh72
https://streamable.com/wuuld8

zomboid at its best, so when the vehicle moves when you attach its bugged ๐Ÿ™„

Watch "Project Zomboid 2025.12.16 - 17.52.24.02" on Streamable.

โ–ถ Play video

Watch "Project Zomboid 2025.12.16 - 17.59.33.03" on Streamable.

โ–ถ Play video
true nova
peak furnace
#

what data is associated with egg fertilisation?

#

i understand eggs as inherited from food.txt have some sort of modifier tacked on for tracking their development, but i'm not sure where i'd find it

#

also, is there any exposed files for chickens bc i'd really like solid numbers

raven epoch
#

?

#

๐Ÿ˜ญ

shy mantle
#

If I flag a floor tile to solid, is that floor tile also solid for other players in a multiplayer server if it is set to solid in the client side of the other player? I can't test it myself, and I would prefer if it was for the client side that did it only, even if I need people to disable an anticheat whenever that's added back

bronze yoke
#

it will not affect other players

shy mantle
#

Good, just needed to confirm

#

Thanks

cold skiff
#

Does anyone know what might be happening to me? I have all the mods I'm developing in C:\Users\username\Zomboid\Workshop, but I deleted and copied the entire mod folder again after downloading it from Steam, and now it doesn't appear in the mod list in the game. The structure is correct, because I tried using the same mod I already uploaded to Steam after downloading it, and nothing changed.

willow tulip
small topaz
#

Anyone else the problem that the "MutuallyExclusiveTraits" in the new trait.txt does not work properly for modded traits? For me in 42.13, this doesn't seem to work for modded non-profession traits.

brittle swift
#

Is there some new trick for creating skill literature? Specifically magazines to teach recipes? I've been working to migrate my mod to 42.13 and it appears everything is working correctly except that the custom magazines I created will not teach the custom crafting recipes added and I cannot figure out why.

mellow frigate
willow tulip
#

with LUA

willow tulip
#

linked post has code snippet for doing that.

#

also note that traits (may?) have module qualifiers now (ie base:) if your looking them up via text or whatever.

#

(But you should likely use the new trait registry values for vanilla traits instead, and pass a global from where you registered your trait, so that no typo-prone string lookups occur)

bronze yoke
#

do not look them up by text, this defeats all benefits of using a registry system

fathom forum
#

is there a getting started page for pz modding

bronze yoke
#

there are some getting started resources in the pinned messages

fathom forum
#

i see. thank you.
i really just want to run a server side mod to script some stuff
is that process different?

willow tulip
#

(Both are false if single player)

#

also note that the client runs files in \server\ because of course it does.

willow tulip
low solstice
#

am I missing something or did Zomboid recently start ignoring local mods in the Workshop folder be it in the client directory or the user directory?
Don't remember it doing that in B41 when I last played around with it

willow tulip
#

ie: C:\Users\Black Moons\Zomboid\Workshop\Realistic Car Physics\Contents\mods\Realistic Car Physics\common

#

(and then a \42 dir as well as the \common)

#

common also needs to be lower case on linux/mac

#

.. and must exist.

low solstice
#

well the common folder is there; is a poster img required nowadays?

willow tulip
#

Don't think so.

#

should post a little more of your path but yea

low solstice
#

well it's also weird that the template mod folders are not visible Kelly_think_FB

willow tulip
low solstice
#

well I copied the files into both the User/Zomboid/Workshop directory as well as the SteamInstall/Workshop directory

low solstice
#

Windows user?

#

Then yes.

willow tulip
#

like, if your files are in C:\Users\Black Moons\Zomboid\Workshop\Realistic Car Physics\Contents\mods\Realistic Car Physics\common
And your logged into windows as 'admin' or 'phil' or whatever and not 'black moons' it may not see it.

low solstice
#

well recopied to local user directory works now but it seems to ignore the install directory one

willow tulip
#

yea I dunno, I only use the user one

low solstice
#

Sigh just to figure out w/e the next issue with the id is

verbal yew
#

all the new crafts not working in MP [42.13]?

bright fog
#

It's not in the right folder

low solstice
willow tulip
bright fog
brittle swift
#

For the life of me I cannot get my mod to link a learned recipe on an item and cannot figure out why. Here's a snippet of what I've got if anyone can see the problem that I've been running in circles on for the last 5 hours.

    {
        DisplayCategory = SkillBook,
        ItemType = base:literature,
        Weight = 0.5,
        Icon = MagazineMechanic1,
        TeachedRecipes = MakeEnginePart_blacksmithingEnginePart,
        StaticModel = Magazine,
        WorldStaticModel = MagazineKnit1Ground,
        Tooltip = Tooltip_DIYR_GeneralMagTS,
    } ```
```    craftRecipe MakeEnginePart_blacksmithingEnginePart
    {
        timedAction = MakingHammer_Surface,
        Time = 600,
        Tags = Forge,
        category = AutoParts (Universal),
        needToBeLearn = true,
        SkillRequired = Mechanics:6;Blacksmith:3,
        inputs
        {
            item 2 [Base.ScrapMetal],
            item 2 [Base.SmallSheetMetal],
            item 4 [Base.Screws],
            item 1 [Base.MetalworkingPliers] mode:keep flags[Prop1;MayDegradeLight],
            item 1 [Base.Tongs] mode:keep flags[Prop2;MayDegradeLight],
        }
        outputs
        {
            item 20 Base.EngineParts,
        }
        xpAward = Blacksmith:10;Mechanics:5,
        AutoLearnAll = Mechanics:9;Blacksmith:4,
        AllowBatchCraft = true,
    }```
#

The magazine loads and is readable but teaches nothing. The recipe loads and is craft able if I enable all recipe knowledge with debug. I just can't get the two to link.

verbal yew
#

@brittle swift in MP all my recipes not working, if items not Base module - time on craft skip without result and items don't spend. When items Base module - time on craft work fine, animation in craft work, but after end - without result, items don'w spend

#

in SP all work fine

brittle swift
#

Ah, I understand your question now. Sadly I don't have an answer as you can see I'm still stuck getting mine to work in SP still so you're ahead of me there ๐Ÿ˜…

verbal yew
#

without _

brittle swift
#

I'll give that a shot & report back. I have a lot of those in here ๐Ÿ˜ฐ

verbal yew
#

AH SHI

#

NOPE NOPE

#

use LearnedRecipes

#

not Teached

verbal yew
#

LearnedRecipes = MakeEnginePart_blacksmithingEnginePart,

fathom forum
bright fog
fathom forum
#

i suppose thats fine
i just want to make some server commands available to admin
radio stations to start with
i dont intend to distribute on workshop
i gather that means i can just put my files in the username/zomboid/mods folder in this case

willow tulip
fathom forum
#

makes sense

willow tulip
#

everyone needs the mod or the server won't let them join.

young trellis
#

For whatever reason I can't get any of my traits to show their respective pictures in the selection screen ``` module LRRP_Professions_B42
{
character_trait_definition lrrp:lactose
{
CharacterTrait = lrrp:lactose,

    UIName = UI_trait_lrrp_lactose,
    UIDescription = UI_traitdesc_lrrp_lactose,

    Cost = -1,
    IsProfessionTrait = false,
    DisabledInMultiplayer = false,

    Texture = media/ui/traits/trait_lrrp_lactose.png,
}

}

willow tulip
#

the best you can do, is make a workshop mod that loads LUA at runtime from a certain folder

#

and then not distribute that lua file.

#

if you don't want people peeking at your admin commands.. but security by obscurity is a bad idea generally, its better to have passwords/depend on admin access level or something

fathom forum
#

they can look i dont care

bronze yoke
#

wait

#

nevermind

willow tulip
bronze yoke
#

yeah but i was trying to correct you to the wrong behaviour ๐Ÿ˜…

willow tulip
#

you use isClient() to make it execute on server OR sp

#

admin commands prob have less use in SP, but likely you wanna develope them in SP just cause its faster to load ๐Ÿ˜›

#

And do the final polishing in MP to make sure they work properly

bronze yoke
willow tulip
#

oh yea.

mellow frigate
willow tulip
bronze yoke
#
if isClient() then
    return
end
willow tulip
#

this lets you code execute on server OR sp.

#

(code below said statement)

#

Note: Early out is preferred over things like

if not isClient() then
   All your code, except indented 1 more tab over.
end -- Or maybe its an else? you'll have to scroll past all your code to find out!
#

Seems like a trivial change until you do it 5 times in a row for 5 different errors and 3 of them have else clauses.

fathom forum
#

okay i have some questions

willow tulip
#

. and now all your code starts over here

fathom forum
#

on windows i have a folder called zomboid in my username folder

#

but i also have the dedicated server installation folder from steam

#

i assume i dont want to touch the dedicated server folder at all

brittle swift
#

Both the client and dedicated server apps use the Zomboid folder for configuration storage

willow tulip
bronze yoke
#

yeah, Zomboid is your cache folder, that's where you should be doing things, dedicated server should be left alone

willow tulip
#

Has anyone posted a guide on how the hell to even get mods working on dedicated servers so I can just link that on my mod and delete the 80% of my comments that are 'doesn't work on my dedicated server! (And neither do any other mods iv tried but I won't mention that)'

bronze yoke
#

you will want to look inside the game install but don't touch, all your changes should be in the cache folder

fathom forum
#

ClientCommands.lua

if isClient() then return end
...
small topaz
#

So excluding traits for non-profession traits currently only works via lua command trait:getMutuallyExclusiveTraits():add(MyRegsitry.Trait)?? Using the script txt entry MutuallyExclusiveTraits = does nothing for me. But using the lua commands seem to work.

fathom forum
#

lol

#

i can just put a lua file in the server folder

willow tulip
#

Server folder doesn't stop the client from executing it, in TIS's infinite wisdom.

willow tulip
fathom forum
#

i cant even imagine how cynical being a pz modder would make a person lol

willow tulip
#

thats is why you need the LUA

#

because else you can add trait A and then B, but not B and then A

#

they only check exclusivity in one direction

brittle swift
small topaz
#

Btw, in my case I want a modded trait to exclude a vanilla trait.

bronze yoke
#

the script should work for the modded trait, that's odd

willow tulip
#

but you still need the LUA if your not gonna override the other vanilla trait (I believe a partial zombscript should work)

#

setting it via script.txt on one trait, only prevents you from adding A after B. but not B after A

#

order matters lol

#

You could even make some totally bizzaro game of unidirectional exclusive traits for madddnnesss

small topaz
#

Really tested this a lot. But what works fine is excluding traits via script if the new trait is an IsProfessionTrait.

Still can solve the issue by setting both via lua code which is fine. Just weird...

willow tulip
#

Fluid blacklists work the same way btw -_-;

#

you can add oil to water, but not water to oil in PSC -_-;

bronze yoke
#

how are you testing that if one of them is a profession trait?

willow tulip
small topaz
bronze yoke
#

has this been reported as a bug btw?

willow tulip
verbal yew
#

as if I don't know where I can't apply it, or what?!

or dilute the fuel with water in the percentage while it is still fuel to refuel the car?! Stonks?!

willow tulip
#

though if you can find a barrel of spiffo juice and vodka you can just live off that stuff without any need to sleep or eat.

#

in the proper mix

verbal yew
#

jesus...

#

wheres my energy drink and goth girl spit...

willow tulip
#

-_-

verbal yew
#

lol)

fathom forum
#

if i dont intend to differentiate mod for different versions i can just put my mod.info in the common folder i assume?

#

its just weird on the website under the b42 section it shows mod.info and poster.png in every other folder except the common one

#

ok it has to be in the 42.13 folder to even show up

#

i have to restart the whole game to see changes too lol

#

good grief

wet sandal
#

I'm seeing that my mods aren't able to save moddata in MP.
Draw On The Map, for example, clears the map every time I sign back in.

#

Thats not even mod data

#

ignore me

bright fog
#

The problem too with with putting your mod.info and poster files in the common folder was that the poster file was not recognized from the common folder, which possibly have been fixed but we haven't tested since last update

bright fog
#

It can be in the 42 folder too

#

Unless you meant common versioning folder wise

bright fog
brittle swift
fathom forum
#

it shows up in single player
but the server is saying
required mod "impradio" not found

#

thank you for responding btw

#

appreciated

bright fog
brittle swift
#

Do they? Well, back to the drawing board ๐Ÿ˜–

willow tulip
#

also crc has to be turned off

bronze yoke
#

i've tested all of my b42 mods in multiplayer

wet sandal
#

Same, working fine for me

#

Although I am using -nosteam

brittle swift
fathom forum
#

i have my mod im making in my workshop folder
it loads in single player but the server says
required mod "impradio" not found

brittle swift
bronze yoke
#

hosted

wet sandal
#

Hosted on Linux vs Windows?

bronze yoke
#

windows

#

it does seem like there are some weird obstacles to enabling mods right now, probably relating to the steam workshop, but it's hard to tell because these problems appear exactly the same as the user configuration errors modders get hassled with literally all the time anyway ๐Ÿ˜…

#

i haven't heard of anyone having issues with local mods

fathom forum
#

so perhaps i shouldnt bother with this right now

green berry
#

i'm testing dedicated local and i have no issue, mods in workshop folder though, not via steam

willow tulip
#

RIP TIS Q/A team

fathom forum
#

okay im testing in single player then whatever

worthy pawn
#

Hello! Hope everyone is well! Updating my Handlebar's Vintage Camo mod. I've been reading guides, and it seems fairly simple, make a 42 folder and common folder, move all media contents into 42 folder.

My items are spawning in containers, however I'm unable to equip any of my lovely camos. I'm trying to find what they've changed as far as clothing in B42, it seems my mod is not the only one. Thanks for any assistance.

#

I think I have figured it out. It has to do with the new typing of Type vs ItemType

brittle swift
#

Ok, I got to the bottom of the mod loading issue on dedicated server. Unlike build 41, it requires a " \ " at the front of our mod ID in the ini file. Example, my mod's ID is "DIYR" so previously it would've been "Mods=DIYR" in the ini file to load just my mod but it's now "Mods=\DIYR". @fathom forum this should be the solution you're looking for.

bright fog
#

@bronze yoke lmao I kind of didn't expect it to be the reason everyone had problems but it makes so much sense now

#

Oh boy I can't wait for the moment devs will fix this and it won't be needed anymore, and it'll nuke every servers LOL

fathom forum
#

should my main lua file be named main
is that bad
what did it override lol

brittle swift
#

The files in your mod should never match file names of the vanilla files

fathom forum
#

what do you mean by that

brittle swift
#

does your mod include a media/lua/main.lua in it?

cinder storm
bright fog
fathom forum
#

should it? does it have to?
i dont want to override anything
will it load everything in my lua folder?

bright fog
bright fog
#

I invite you both to go read the Lua API wiki page, and more specifically the section about Lua file structure

fathom forum
#

thank you

bronze yoke
#

they will re-add the workshop ids to mod ids in the future

bright fog
#

Even Aiteron recently mentioned they wouldn't do that

bronze yoke
#

it will not affect modders

bright fog
bronze yoke
#

requires will not specify workshop id

bright fog
#

Interesting

small topaz
# cinder storm both, it doesnt work for either

In single player 42.13, I can still use item:setActualWeight(5) if then item is an InventoryItem. For the Class Item objects which you get by the ScriptManager, you may try the DoParam command instead.

#

So smth like item:DoParam("ActualWeight = 5"). But this will change the weight for all items of that type and should be called on GameBoot.

fathom forum
#

how do i view the errors from my mod?

cinder storm
cinder storm
#

its calling to change the size of an already modded item

#

it would also be inconvenient for anyone since it has to be called on gameboot

small topaz
cinder storm
#

i'll test it out

fathom forum
#
Events.OnInitGlobalModData.Add(function()
    print("iradio.lua loaded ")
end)

function OnServerCommand(module, command, args)
    print("OnServerCommand test:")
    print(command)
    print(args)
end

Events.OnServerCommand.Add(OnServerCommand)
#

it should be local function

small topaz
# fathom forum for https://pzwiki.net/wiki/OnServerCommand it says ```Fires when a server comma...

according to the dev's pdf, this event is triggered when server sends a command to client via a specific lua command. see here: https://theindiestone.com/forums/index.php?/topic/88499-modding-migration-guide-4213/, API for inventory items.

cinder storm
#

did not work

this is the new code i based on yours

local item = instanceItem("Base.CrateOfPlanks") -- create a specific item of that type
item:setActualWeight(5)
local item2 = instanceItem("Base.BoxOfScrapWood") -- create a specific item of that type
item2:setActualWeight(1.5)
local item3 = instanceItem("Base.CrateOfTreeBranches") -- create a specific item of that type
item3:setActualWeight(5)```

i think ill also drop this other image of where the lua file is, which could be affecting it. its in a submod to the main mod and its only purpose is to change the weight of certain items to make sense with certain weight reduction mods
small topaz
cinder storm
small topaz
#

yes. item has both, weight and actualWeight field

small topaz
#

I don't know how to do this on server. You then have to use some specific sync commands but I have never tried it.

cinder storm
#

ill do shared

#

still nothing

#

ill put setactualweight on instead

small topaz
#

single player only ofc

cinder storm
#

i might not be pulling the item right

#

its in base

small topaz
#

do you also make sure to put the item somewhere to the map so that your player can interact with it? for example putting this in player's inventory?

cinder storm
#

it can naturally spawn with a different distributions submod

#

and it can also be created by packing different items into it

#

so for example lets say we have a box of scrap wood

#

it weighs 10

#

its supposed to carry 12 of them

#

the base game has its weight at 1

small topaz
#

With the item:setWeight() or setActualWeight() you will only change weight for that specific item. So before applying this command, you have to grab the item you want to apply it to. instanceItem() creates a new item and was just used as an example by me.

fathom forum
#

i think i am going to have nightmares about this

#

the scarriest thing about project zomboid, the most brutal part of it
is attempting to make a mod for it

#

how can something have this much technical debt

#

this game should fall apart under its own weight

fathom forum
#

good luck to the poor souls who are working with this

cinder storm
#

ohh i get it

#

i thought you meant ItemType like base:normal and similar not that

#

since you deleted it is it wrong?

small topaz
#

in my last message, I just copied pasted smth wrong, therefore deleted. so ignore.

using the ScriptManager and setting weight will change the weight for all items of that type "Base.CrateOfPlanks"

cinder storm
#
local item = getScriptManager():FindItem("CrateOfPlanks",true) -- true means it will use Base.
item:setActualWeight(5)
local item2 = getScriptManager():FindItem("BoxOfScrapWood",true) -- true means it will use Base.
item2:setActualWeight(1.5)
local item3 = getScriptManager():FindItem("CrateOfTreeBranches",true) -- true means it will use Base.
item3:setActualWeight(5)```
#

this was my original code, which used that same method you just described

#

ill test it out real quick in the shared folder

#

since i moved the file

small topaz
cinder storm
#

and then made sure it would work (in versions previous to 42.13) by checking in this channel

#

ill try doparam

small topaz
#

if that worked in 42.12, it should also work in 42.13 single player as long as your code is in shared and you may use doparam. they didn't change anything about that

fathom forum
#

how do i find all the datamember names for different items?
i want to create a magazine object full of bullets and add it to the player

fathom forum
#

media/scripts/generated/items/normal.txt
i find:

item 9mmClip
    {
        DisplayCategory = Ammo,
        ItemType = base:normal,
        Weight = 0.2,
        Icon = BerettaClip,
        AmmoType = base:bullets_9mm,
        CanStack = false,
        GunType = Base.Pistol,
        MaxAmmo = 15,
        StaticModel = GunMagazine,
        WorldStaticModel = Gun_Pistol_Magazine,
        Tags = base:hasmetal;base:pistolmagazine,
    }
#

but there is no member for how many bullets are actually in the fucking thing

fathom forum
#

am i missing something or is there a lack of transparency here

#

obviously this is the base class. sure.
its derived into something else somewhere down the line. sure.
how do i find this information

terse mason
# fathom forum obviously this is the base class. sure. its derived into something else somewher...

In the PZ files, under "media/lua/shared/Items/SpawnItems.lua", they have this snippet for getting clip and gun ammo count and fiddling with it in the addBunkerStuff function.

local function addBunkerStuff(playerObj)       
    local guns = {};
    local clips = {};

    table.insert(guns, crate:getContainer():AddItem("Base.AssaultRifle"));
    table.insert(guns, crate:getContainer():AddItem("Base.AssaultRifle2"));

    for i = 0, 4 do
        table.insert(clips, crate:getContainer():AddItem("Base.556Clip"));
        table.insert(clips, crate:getContainer():AddItem("Base.M14Clip"));
    end

    for i,gun in ipairs(guns) do
        gun:setRoundChambered(true)
        gun:setContainsClip(true)
        gun:setCurrentAmmoCount(gun:getMaxAmmo())
    end

    for i,clip in ipairs(clips) do
        clip:setCurrentAmmoCount(clip:getMaxAmmo())
    end
end```
fathom forum
#

may have been moved?
spawnitems.lua is in
media/lua/shared/items/SpawnItems.lua

terse mason
#

Oh, whoops. Wrote the path manually and forgot Items

fathom forum
#

its acutally called addbunkerstuff lol
what is this function for exactly?

#

loot table?

#
        for i,gun in ipairs(guns) do
            gun:setRoundChambered(true)
            gun:setContainsClip(true)
            gun:setCurrentAmmoCount(gun:getMaxAmmo())
        end

        for i,clip in ipairs(clips) do
            clip:setCurrentAmmoCount(clip:getMaxAmmo())
        end
#

ah yes

#

heres what we are looking for

terse mason
#

Looks like it targets a square on the map and fills the crates with ammo and guns, then maxes out the ammo and guns in the crates filled

#

Kinda a manual loot table lol

fathom forum
#

its this thing

terse mason
#

ye, Bunker

#

new to Build 42

fathom forum
#

i have avoided exploring the new map
waiting to do with my friends in b42mp