#mod_development

1 messages ยท Page 275 of 1

spare burrow
#

how exactly? is there any example in the vanilla files?

bronze yoke
#

literally just```lua
local myColour = Color.new(0.5, 0.2, 0.8)

spare burrow
#

oh interesting

bronze yoke
#

the arguments are rgb and i'm pretty sure they're 0-1

spare burrow
#

yeap

#

ty, did not knew this!

grand cloak
#

I just tested those but none of them worked

#

i suppose its because im using a modded fluid

#

how can I work with that?

bronze yoke
#

i think you pass the name of your fluid as a string

#

:contains("MyFluid")

#

i haven't worked with custom fluids yet but that looks like how it's meant to work

ashen mist
#

is there an easy way to patch recipes in B42

#

i want to make clothing ripping faster

clever surge
#

@late hound did you ever solve this? I'm getting this as well

old ginkgo
junior jewel
#

can anyone give me a run down of how the evolved recipe system works. example; making food on the stove ect.

grand cloak
#

but it didnt work

maiden thistle
ivory gyro
#

New mod for Coop/Multiplayer ?

dark wedge
# maiden thistle So how do i fix the instant actions problem

It's by design. The "ISClothingExtraAction" has a time set of 1, so it's basically instant. This is how you fix it:

local _ISClothingExtraAction_new = ISClothingExtraAction.new
function ISClothingExtraAction:new(...)
    local o = _ISClothingExtraAction_new(self, ...)
    o.maxTime = 25
    if o.character:isTimedActionInstant() then
        o.maxTime = 1
    end
    return o
end```
#

I personally found "25" to be a good value for that, but tweak it to whatever you want.

ashen mist
#

found the bugged recipe for crude whetstones in 42

iron siren
#

I have a mod which works fine in B41, but fails with B42 (shocking, I know ) ```
function RicksMLC_ChatIO:Load(delim, resetComments)
self:DebugModId()

DebugLog.log(DebugType.Mod, "RicksMLC_ChatIO:Load()" .. " modId: '" .. self.modID .. "' path: '" .. self.saveFilePath .. "'")
local fileReader = getModFileReader(self.modID, self.saveFilePath, true)
if fileReader and fileReader:ready() then

...

ivory gyro
dark wedge
ashen mist
#

making a crude whetstone mod rn

#

making it so you can make one with one rock

#

since i think having two is the issue with the current one

#

im calling it cruder whetstone

grand cloak
#

how can I add new properties to modded fluids?

maiden thistle
crimson spindle
maiden thistle
bright fog
#

Might require something else

grand cloak
#

oh right

#

thx

ashen mist
#

is there something wrong with this?

#

it's not showing up in game for some reason

#

same structure worked for my rope mod

elfin stump
#

no spaces on craftRecipe names

elfin stump
mellow frigate
#

@dark wedge I will call my ModOptions file ExampleModOptions.lua

iron siren
tranquil reef
#

Making mods that affect .class files, would decrypting, and then re-encrypting, make it work the same as it did before?

ashen mist
#

what the fuck

#

my recipe mod

#

it doesn't work anymore

round notch
#

Rat your rope mod had mod id of "ModTemplate" I forgot to say

ashen mist
#

shit

stone garden
#

?

ashen mist
#

what the SHIT

#

the recipe worked like an hour ago what the fuck happened

round notch
#

I spent 4 hours rewriting my anim script I'm done tonight mate ๐Ÿ˜‚

ashen mist
#

why does it break AFTER being uploaded

#

god damnit

#

now the mod id wont update???

#

i changed the fucking files why are you stagnant

#

wait, maybe its the folder im storing developed mods in

#

i'll move that

#

okay that was it

#

reminder for modders then, dont store developed local mods in a folder within the workshop folder

#

store them elsewhere

#

it worked for me in B41, so i did it by force of habit

small topaz
#

has anyone managed to figure out how to properly set up the mod.info file or to properly fill the "Version", "Author" etc. slots in the game's mod menu?

bronze yoke
ashen mist
#

okay i learned what it was

#

SO

#

my rope mod

#

uses recipes.txt

#

the whetstone one did too

#

so i changed it to recipes_fixing.txt

#

suddenly, it shows up and works

bronze yoke
#

oh my god don't use generic names like that

lilac mural
#

How to make character pick up an item, before using it through custom timed action?

bronze yoke
#

every file name in your mod should be unqiue to your mod or you'll accidentally override or get overriden by something

ashen mist
#

ah

#

okay

#

so i should do smth like

#

recipes_MRAT.txt ?

bronze yoke
#

i like to do something like e.g. scripts/ModName/ just so that i don't have to give the files weird names because the folder name already covers it

#

for a smaller mod something like recipes_ModName.txt makes sense

lilac mural
bronze yoke
#

yeah, that sort of thing

ashen mist
#

alright, gonna update MRAT with that then

#

thanks again albion, you're a lifesaver

small topaz
lilac mural
#

B42

lilac mural
ivory gyro
#

2KG The deer ?lol

mellow frigate
small topaz
lilac mural
#

That's what I'm doing and rn it says ISTimedActionQueue:tick: bugged action, cleared queue and I don't know how to make it say where's the problem

elfin stump
bronze yoke
#

bugged action usually means an isValidStart failed

#

check the isValidStart functions of the timed actions you're calling

lilac mural
#

Ok, I'll check

elfin stump
#

If anyone figures out how to create an item that can be used in prop1 and prop2 successful, please let me know! ๐Ÿ™‚

lilac mural
elfin stump
queen oasis
sick yew
#

Not sure if this is the place to ask, but the music folder. Where is the Untitled "34" song located? I went through the music folder in media and couldn't find it.

small topaz
lilac mural
#

Yeah, I'm going through isValid part of ISInventoryTransferAction and still can't find what's wrong could be..

queen oasis
lilac mural
#

Am I using the wrong thing for this?

dull moss
#

#musicmaniacpins all mod.info parameters b42

queen oasis
#

I'll have a look but I use:

ISTimedActionQueue.add(ISGrabItemAction:new(playerObj, object, time))
lilac mural
#

I also have used this one, but I'll try again...

queen oasis
#
local time = ISWorldObjectContextMenu.grabItemTime(playerObj, o)
ISTimedActionQueue.add(ISWalkToTimedAction:new(playerObj, square))
ISTimedActionQueue.add(ISGrabItemAction:new(playerObj, o, time))
#

could maybe just throw it into

ISWorldObjectContextMenu.onGrabWItem
bronze yoke
#

this is what i usually use```lua
local inventory = character:getInventory()
if not inventory:contains(item) then
ISTimedActionQueue.add(
ISInventoryTransferAction:new(
character, item,
item:getContainer(), inventory))
end

lilac mural
bronze yoke
#

if it's the same then i'd make sure the arguments you're passing are good

#

like is the item definitely an item?

lilac mural
#

Yeah, I'm checking this rn

queen oasis
#

and I'm just bad at this

small topaz
lilac mural
#

Is :zombie.inventory.types.ComboItem is an item?

bronze yoke
#

yeah, that should be correct

lilac mural
#

I'm trying to use :getItem() on it and it doesn't work for some reason

queen oasis
random finch
#

I thought DisplayName would be the name displayed here?

    item Mov_PCZCore
    {
        DisplayCategory = Furniture,
        Type            = Moveable,
        Icon            = pczcore,
        Tooltip = Tooltip_ItemTraps,
        Weight              = 10,
        Capacity        = 20,
        UseWhileEquipped = FALSE,
        DisplayName        = PCZ Core,
        WorldObjectSprite    = pczcore_0,
    }    
tranquil reef
#

How do I reference one script from another

random finch
# random finch I thought `DisplayName` would be the name displayed here? ```lua item Mov_PC...

Here is a snippet from ISBaseIcon. It seems to be using :getDisplayName().

            local bpItem = backpack and backpack.inventory and backpack.inventory:getContainingItem();
            if bpItem then
                if not backpack.inventory:getOnlyAcceptCategory() or (self.itemObj:getCategory() == backpack.inventory:getOnlyAcceptCategory()) then
                    local backPackOption = subMenu:addOption(getText("ContextMenu_PutInContainer", bpItem:getDisplayName()), self, self.onClickContext, 0, 0, contextMenu, backpack.inventory, {self.itemObj});

........
ashen mist
#

i have a problem

#

im making my fourth mod

#

it has to be an addiction

lilac mural
bronze yoke
#

come to think of it i don't think i've ported any of my mods actually using that code yet, so it's possible something changed in b42...?

sly gazelle
lilac mural
ashen mist
bronze yoke
#

well i took a look and the transfer action looks unchanged, so i have no idea what's going on

#

when are you adding the action?

lilac mural
#

In :isValid()

bronze yoke
#

ah, that's not a great idea, isValid is called every tick while the action is running ๐Ÿ˜…

lilac mural
#

Damn..

bronze yoke
#

you want to add the transfer action before adding your action

lilac mural
#

Should I call it before calling custom timed action?

#

Okay

lilac mural
iron siren
#

Does anyone know or have the Keyboard. list of keybinds? I have used OnKeyPressed(key) if key -- Keyboard.KEY_F10 then , but that is for taking screenshots. There must be a list somewhere?

lilac mural
#

Okay, uh... How to correctly check if player is nearby the item that he's trying to pick up? Cause you can open context menu, walk away, and only then press the button

molten hornet
#

working hard or hardly working

queen oasis
#

that will make your player walk back if they have walked away

clever surge
#

no matter what I do getAllRecipes() always returns an empty list. Am I doing something wrong? :/

lilac mural
bronze yoke
clever surge
queen oasis
#

it looks like a global in 42? but yea, it returns nothing

olive radish
#

One message removed from a suspended account.

sick yew
#

Anyone know where the new B42 music is? It's not in media/music

queen oasis
ashen mist
#

i might need to make a fifth mod today

#

i've found that combining thread is broken

#

and the pick thread recipe only grants a single unit

olive radish
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

lilac mural
iron siren
#

Trying to use the InventoryItemFactory now gives the error "attempted index: CreateItem of non-table: null". Is the InventoryItemFactory class changed? ```
function RicksMLC_VendingMachineConfig:MakeContainer(containerList)
-- Returns: ContainerItem with items.

local container = InventoryItemFactory.CreateItem(containerList[2])
if not container then

...```

#

Ah.. checking the B42 LUA it calls instanceItem() ... dunno where that is in the java code tho

bronze yoke
#

InventoryItemFactory is no longer exposed

#

instanceItem() seems like the alternative

lilac mural
#

When creating custom model - you can only add texture file to it or something else? Like roughness or normal

clever surge
#

https://steamcommunity.com/sharedfiles/filedetails/?id=3387462212

Just made a small mod that increases the lifetime of batteries. It's my first real mod so would appreciate some feedback!
Not sure if my approach is the best way, I was trying to achieve this without hardcoding stuff, and so far everything seems to work. I'm just scanning for input items on the InsertBattery recipe. Sadly this won't work for radios and similar devices.

Code is here: https://pastecode.io/s/dgec4a9a

pearl prism
woven brook
#

Have multi z level cars been added in unstable?

open drum
#

friends! remember we used to have remove result item parameter from Recipe script?

#

how that it doesn't work

#

is there any way to do the same thing? withouth using Lua?

woven brook
bronze yoke
#

i think you don't need to add a result at all anymore

open drum
spare burrow
open drum
#

and it stopped the recipe from showing up in the crafting

spare burrow
#

i went down the construction basemenet on riverside at least

woven brook
#

Finally I can make that Rocky Mountain map

#

Out of town right now though

open drum
#

i have it '''
craftRecipe Use Elixir
{
time = 100,
tags = Survivalist;CanBeDoneInDark,
category = Wuro_Recipe,
needTobeLearn = false,
timedAction = MakingHammer_Surface,

    inputs
    {
        item 1 [Base.Elixir],

    }
    outputs
    {
    }
}

'''

#

but this doesn't show up in the crafting area

ebon dagger
#

Anyone managed to get custom items to generate as loot yet? My Scavenger Skill mod is updated aside from getting the books to populate. I get no errors, but also no books lol

elfin stump
open drum
elfin stump
open drum
#

maybe i need this tag

#

Tags = InHandCraft,

elfin stump
#

Yeah if you want to do it standing anywhere I believe you need that

bronze yoke
#

i think you need InHandCraft or AnySurfaceCraft or it won't show up

woven brook
#

Wonder if devs will release documentation for tile biome generation ๐Ÿค”

last edge
#

does anyone happen to know if anyone's working on a b42 player respawn mod yet

open drum
#

wish someone would make the new tall grass to spawn more abundant even in house and roads

#

so it looks more 10 years later type scene

viral spire
#

Haha, what if someone made a mod that made rats transmit the disease so you could pretend it's the Rat Plague from Dishonored, haha wouldn't that be crazy

ebon dagger
#

Ok, checking Lootzed, my books ARE in the distro list, but my "BookScavenging1" has the same spawn chance as "BookMetalworking5" even though, they dont have the same value in the BookstoreBooks table. Or at least should.

mint girder
#

Is this guide not useful anymore? i wanted to try and make a mod but in the PZ files recipes have input and output

open drum
#

does anyone know how this works?

#

they are doing splitscreen multiplayer

late hound
gaunt storm
#

I guys. I create maps for project zomboid, but this time I had a terrible problem that had never happened before: "The mod.info file does not exist in your mod" can you help me?

clever surge
junior jewel
#

does anyone know where i can find the script for the campfire moveable?

bronze yoke
#

you can do it through steam remote play but it won't be a good time with any significant amount of ping

#

and controller controls for build 42 are unfinished

brittle geyser
#

hi all, what is the best way to update my mod with the b42 structure, but also test both b42 and b41 functions remain the same? Should I make changes and then try launching both versions?

cerulean yew
#

Hi Folks, sorry to bother you, but i need your help. I am experimenting the game with patch 42, but I have a small problem. I can't increase the capacity of the duffle bags/backpacks, as I did in the previous version of the game. It seems the capacity is stuck at 49, whereas I could make it go well beyond that value. Can you tell me if there are any values in other files that need to be changed? (sorry for my terrible english)

brittle geyser
sacred harness
sacred harness
elfin stump
#

When spawning a waterbotte with a recipe output, is there a way to spawn it in an empty state?

sacred harness
# elfin stump When spawning a waterbotte with a recipe output, is there a way to spawn it in a...

Here is the item object definition for WaterBottle:
item WaterBottle
{
DisplayName = Water Bottle,
DisplayCategory = Water,
Type = Normal,
Weight = 0.1,
Icon = WaterBottle,
IconColorMask = WaterBottle_Mask2,
IconFluidMask = WaterBottle_Mask,
CookingSound = BoilingFood,
CustomEatSound = DrinkingFromBottlePlastic,
FillFromDispenserSound = GetWaterFromDispenserPlasticMedium,
FillFromLakeSound = GetWaterFromLakeBottle,
FillFromTapSound = GetWaterFromTapPlasticMedium,
Tooltip = Tooltip_item_OnlyPurifyMicrowave,
StaticModel = WaterBottle,
WorldStaticModel = WaterBottleFull,
Tags = CookableMicrowave,
/* OnCreate = SpecialLootSpawns.OnCreateWaterBottle, */

        component FluidContainer
        {
                ContainerName   = BottlePlastic,
                capacity        = 1.0,
        PickRandomFluid    = true,
                Fluids
                {
                    fluid           = Water:1.0,
                    fluid           = CarbonatedWater:1.0,
                }
        }
}
open drum
sacred harness
# elfin stump When spawning a waterbotte with a recipe output, is there a way to spawn it in a...

Here you go:
craftRecipe MakeImprovisedGasMask
{
timedAction = Making,
Time = 80,
NeedToBeLearn = True,
Tags = InHandCraft;Engineer,
category = Survival,
xpAward = Tailoring:5,
inputs
{
item 1 tags[Scissors;SharpKnife] mode:keep,
item 2 [Base.DuctTape],
item 1 [Base.RippedSheets] mode:destroy,
item 1 [Base.PopBottle;Base.WaterBottle] flags[IsEmpty],
}
outputs
{
item 1 Base.Hat_ImprovisedGasMask_nofilter,
}
}

elfin stump
#

nice!

sacred harness
#

Change your output to be:
item 1 [Base.PopBottle;Base.WaterBottle] flags[IsEmpty]

elfin stump
#

got it, I see the flag there

#

Thanks!

sacred harness
#

Happy to help

floral minnow
#

Hey y'all, I am not sure how to word my question so bear with me. I am trying to update a mod for my own use until it is properly done by the original author. I got the file structure setup correctly and was able to find the mod in the in-game modlist, however, after activating and reloading the Lua I got a CTD. Digging through the log I am finding the following: ERROR: General f:0, t:1734665280096> Item.OnScriptsLoaded > Could not find evolved recipe or template: 'Pasta' in item = Base.CannedTomatoOpen. However, the recipe file itself never makes mention of the base item so I am not sure what the best way to fix this for the time being would be. Any insight would be greatly appreciated!

north heron
#

anyone have ideas why my items/models are now clipping into the floor? never had this issue in b41 lol???

sacred harness
winter thunder
winter thunder
jaunty gate
floral minnow
cerulean yew
winter thunder
dusk saddle
#

Howdy there lads and lassies, I'm struggling to recollect where (or even if) there's a file that lists the various item types that can be used in crafting. I think I've gotten reasonably close to patching my simple craftable PAWS characters mod, although I'm trying to see if there's a general item type for paper, sort of like how there's the tags[Write] for pens, pencils, markers, etc.

#

Speaking of which, Spiffo pens! Didn't know they were a thing, but they showed up when testing the recipe haha

cerulean yew
winter thunder
dusk saddle
#

Things that can be written on, I suppose. The old recipe used to be just for a sheet of paper, but there are tons of new writable items now outside of those and journals

winter thunder
dusk saddle
#

Ah, good stuff!

#

And do we know what file is where they keep the 'recipe' information for looking at notes, etc.?

winter thunder
dusk saddle
#

Is there a lua file or something along those lines that contains some of the information on the 'Look at X' or 'Read X?'

#

I'm not quite sure how to properly explain it

winter thunder
#

My windows explorer is freaking out for some reason ๐Ÿ˜ญ

dusk saddle
#

You're all good haha

#

Thanks a ton!

floral minnow
winter thunder
copper abyss
#

Acouple issues now with my gun mod in b42...
-MuzzleFlash In Incorrect location
-Single Fire glitchs out the player
-Muzzle Offset location doesn't show in attachment editor

If somebody could help diagnose and fix these problems I would be very thankful.

winter thunder
floral minnow
#

Y'all are the best. Thanks so damn much!

sacred harness
#

Just rename the file to what it is current in the mod folder and replace the one in the mod folder

#

๐Ÿ˜„

winter thunder
#

The issue is that the new evolved recipes use the Template: line, while the old ones dont

sacred harness
#

And minimumwater

winter thunder
#

Btw, that mod legit just doubles the number of allowed items in evolved recipes, dont feel bad about tweaking it lol. Its 99.9% base game stuff

sacred harness
#

Yeah, when I saw that, I just told ChatGPT to double maxitems in this file and send me back the new one LOL

cerulean yew
#

@sacred harness can you help me, friend?

sacred harness
#

Trying to see if there is a LUA file out there with max capacity on the bag item category

cerulean yew
sacred harness
#

Its all good. Everything I know I've pretty much picked up in the last two days....

cerulean yew
winter thunder
sacred harness
winter thunder
#

What is the issue? I can take a looksie too

sacred harness
#

For example, have a bag with 100 capacity and 99 weightreduction

cerulean yew
# sacred harness I thought you were trying to increase the bag capacity?

Yes, indeed, but I have the impression that the capacity of the bag is limited by a character value, probably. You can modify the bag all you want, but it doesn't go beyond a value of 49, and if I'm not mistaken, 49 is a capacity limit that the character has, without wearing a backpack. It was just a thought to get to the point

sonic needle
#

for the love of god. make the zoom mod.

sacred harness
#

Okay, so the bag capacity still says 49 even though you set it to 100?

cerulean yew
cerulean yew
#

The staff does not want us to OP the character xD

sacred harness
#

Can you post a screenshot? I just want to make sure I'm understanding it right.

winter thunder
#

Can you send the item script of the item you made/modified as well? Just to be sure

cerulean yew
winter thunder
cerulean yew
# winter thunder Can you send the item script of the item you made/modified as well? Just to be s...
    {
        DisplayName = Duffel Bag,
        DisplayCategory = Bag,
        Type = Container,
        Weight = 1,
        /*Icon = Duffelbag,*/
        IconsForTexture = Duffelbag;DuffelBag_Green;DuffelBag_Grey;DuffelBagBlue;DuffelBagRed;Duffelbag_Sport;Duffelbag_Sport2,
        CanBeEquipped = Back,
        CanHaveHoles = FALSE,
        Capacity = 960000000,
        CloseSound = CloseBag,
        ClothingItem = Bag_DuffelBag,
        EquipSound = EquipDuffleBag,
        OpenSound = OpenBag,
        PutInSound = PutItemInBag,
        ReplaceInPrimaryHand = Bag_DuffelBag_RHand holdingbagright,
        ReplaceInSecondHand = Bag_DuffelBag_LHand holdingbagleft,
        RunSpeedModifier = 0.95,
        SoundParameter = EquippedBaggageContainer DuffleBag,
        WeightReduction = 100,
        WorldStaticModel = DuffelBag_Ground,
        Tags = IsFireFuel;IsFireTinder,
    }```
#

The question I ask myself is, does this apply to you? Or can you safely change the capacity of the bags?

winter thunder
quasi kernel
#

My lootbox mod has given me the superior fit this run,,

dark wedge
#

It seems like the capacity is hard-coded to not exceed 50. In the Java under "DoParam"

else if (var1.trim().equalsIgnoreCase("Capacity")) {
   int var23 = Integer.parseInt(var2.trim());
   if ((float)var23 > 50.0F - this.ActualWeight) {
      var23 = (int)(50.0F - this.ActualWeight);
   }

   this.Capacity = var23;
}

That's called on all scripts when being loaded.

cerulean yew
#

omg....

#

we are fucked

dark wedge
#

I don't see any bags that have that high of capacity, just world containers. And those aren't impacted by that

winter thunder
dark wedge
#

B41 definitely didn't do this

cerulean yew
#

I would like to know why the staff has to make these changes to complicate things for the players. I understand that it bothers having a character who can put everything in his backpack and therefore gives the idea of the OP, but what the heck, doing it this way means restricting the player's freedom.

winter thunder
#

WAIT I THINK I KNOW WHAT IS GOING ON lmfao

dark wedge
#

that might be a visual bug?

#

or if weight reduction was changed, you suddenly have more weight

winter thunder
#

@cerulean yew What is your characters inv weight at?

cerulean yew
#

inventory?

winter thunder
#

Yea, like not the bag

cerulean yew
#

wait a moment

floral minnow
#

I will add that a modified bag will show less capacity than it actually has:

dark wedge
#

You have Weight = 1,, and the Capacity is set to 49. So the logic I provided seems like that's it.
The code takes 50-Weight to determine the bag's capacity when it's set over 50

cerulean yew
#

Strentgh is at max

winter thunder
#

Because that is the only thing modifying the 50, so somehow its seeming making it go above 50

cerulean yew
winter thunder
cerulean yew
winter thunder
#

Can you open the bag lol

cerulean yew
dark wedge
#
else if (var1.trim().equalsIgnoreCase("Weight")) {
   this.ActualWeight = Float.parseFloat(var2);
   if (this.ActualWeight < 0.0F) {
      this.ActualWeight = 0.0F;
   }
}
#

and the capacity in the screenshot showed it was 49.

winter thunder
dark wedge
winter thunder
#

Unless it is just a visual bug*

#

This all being said, you are in debug mode, so you can literally just turn on the setting for unlimited carry capacity

copper abyss
#

Acouple issues now with my gun mod in b42...
-MuzzleFlash In Incorrect location
-Single Fire glitchs out the player
-Muzzle Offset location doesn't show in attachment editor

If somebody could help diagnose and fix these problems I would be very thankful.

#

reposting this just so that I can get some help-

cerulean yew
dark wedge
sacred harness
#

We might need to think outside the box here ๐Ÿ™‚

#

If we cant mod the bag capacity over 63, then we could mod the ability to carry bags that are too heavy..

#

So you could carry three bags, full to the brim at 63, for a total of 189...

#

Just change this:
local willBeOverMaxWeight = function(character, item)
-- note this assumes the item is equipped. this check is not performed here
if not character or not item then return end
return not character:isUnlimitedCarry() and character:getInventory():getCapacityWeight() - item:getEquippedWeight() + item:getUnequippedWeight() > character:getInventory():getMaxWeight()
end

#

to this:
local willBeOverMaxWeight = function(character, item)
-- note this assumes the item is equipped. this check is not performed here
if not character or not item then return end
return not character:isUnlimitedCarry())
end

sonic needle
sacred harness
#

Otherwise... you might as well add a trait which gives you the ability to carry as much as you want.

copper abyss
onyx valve
sacred harness
sonic needle
#

yeah thats a you guys problem xD

#

i had none of that

cerulean yew
copper abyss
sacred harness
#

Yeah, it would be a lua

sonic needle
copper abyss
#

if making my models into .x will fix these issues then please tell me how

copper abyss
#

I know

sonic needle
#

.x is a...pretty bad choice ๐Ÿ˜ฆ

it wont. he likely did somehting else. as file type wont fix it.

copper abyss
#

ah.

#

I see

#

I had so many awesome gun mods in the works

sonic needle
#

your rotation attachments etc are all wobbly, is what is wrong.

copper abyss
#

kinda sucks now all my hard work is gone

copper abyss
sonic needle
#

pz gets its info from a ton of spots. script, model, attachmentdata, etc
42 changed some. melee weapons got up/down flipped for instance

dark wedge
#

uuughhhhh. this is hard-coded in the ItemContainer itself too:

private int MAX_CAPACITY = 100;
private int MAX_CAPACITY_BAG = 50;
private int MAX_CAPACITY_VEHICLE = 1000;

Even calling setCapacity directly on an inventory craps out:

public void setCapacity(int var1) {
   if (this.parent instanceof BaseVehicle && this.Capacity > this.MAX_CAPACITY_VEHICLE) {
      DebugLog.General.warn("Attempting to set capacity of " + this + "over maximum capacity of " + this.MAX_CAPACITY_VEHICLE);
   } else if (this.containingItem != null && this.containingItem instanceof InventoryItem && this.Capacity > this.MAX_CAPACITY_BAG) {
      DebugLog.General.warn("Attempting to set capacity of " + this.containingItem + "over maximum capacity of " + this.MAX_CAPACITY_BAG);
   } else if (var1 > this.MAX_CAPACITY) {
      DebugLog.General.warn("Attempting to set capacity of " + this + "over maximum capacity of " + this.MAX_CAPACITY);
   }

   this.Capacity = var1;
}

That's so annoying. Not sure how I'm going to get around that when attempting to merge inventories in one of my mods.....

copper abyss
#

I had to completely flip and rotate my rifle for 42

sonic needle
#

mine, work good. but im ...a bit nuts when its this.

winter thunder
cerulean yew
onyx valve
copper abyss
winter thunder
dark wedge
copper abyss
#

idk if ash if correct or not, but I think they might be right

sonic needle
#

rotation. of the model. in blender.

cerulean yew
#

mmh... clear

sonic needle
#

after that. set new attachdata for muzzle etc.

floral minnow
#

I'd def trust Ash on this lol. Go look at their mods

copper abyss
#

the attachment viewer in debug is broken

#

so locating attachdata with the new flipped models is difficult

cerulean yew
sonic needle
#

yeah look. whoever was behind a ton of the code lately Fumbled the keyboard like a 5 year old.

#

they call it unstable for a reason.

winter thunder
sonic needle
cerulean yew
#

End of the fun... goodbye endless weight in backpacks

onyx valve
#

The truth is I don't know the reason, what I did was redo the models in .x and everything was fixed and I just arranged the muzzles and that's it. The only thing that's still broken is my MP9, the character contracts up to the waist, that's the only thing I'm investigating.

sonic needle
#

i am TELLING YOU.

copper abyss
#

so in the player/hands it is fixed

#

the only thing that is broken is the single fire and the attachment data

sonic needle
#

time to go edit the txt file attachdata ๐Ÿ™‚

#

take one of them that has all 00's from a pz gun.

match the gun to yours sizewise before choosing

ie dont use m9 attachdata for a rifle...

#

then edit from there.

copper abyss
dark wedge
winter thunder
sonic needle
#

fumble that odd probably sets it to false ( ie, no shop for you. )

cerulean yew
sonic needle
#

yes.

copper abyss
#

ah! I c I c

#

So far I have just had 2 major projects

#

This Aliens Pulse rifle

tacit pebble
sonic needle
#

my gun stuff isnt out yet. it was being remade for months. but got hit all the same by 42.

copper abyss
#

and another... that I don't wanna say because somebody might steal my idea...

sonic needle
#

your ideas are already done. or being done.

sonic needle
#

dont let it stop you aha.

copper abyss
#

idkkk

#

its a gun that you would be suprised isn't a mod yet

#

I ALMOST had it ready for 41

sonic needle
#

DM it. i will be suprised.

onyx valve
winter thunder
sonic needle
#

i had just started rotating boltcycle testing. its ruined. so yeah we all got hit

cerulean yew
sonic needle
#

wasnt suprised, but idea is good

cerulean yew
#

@winter thunder @dark wedge However, in the next few days I will try to contact the staff or post on the forum to see if this weight thing can be changed, at least allow us to customise the values beyond a certain amount

copper abyss
#

I hate it

#

I'm just a freshy modder guy

#

I dont wannttt everything I knowww to chaangeee

sonic needle
#

its the best time ever for PZ and modding.

cerulean yew
onyx valve
copper abyss
#

whatever, only positive I see is that now at least there is acouple cooler stuff I can poke and make something cool eventually

tacit pebble
cerulean yew
tacit pebble
#

dont know this will even work because ive never changed something's weight before

#

with this

cerulean yew
spare burrow
#

What could be causing my mod to be displayed and acceptable on build 42, but when a save is loaded the mod content is just not there? No errors or indicators something is going iffy

tacit pebble
cerulean yew
tacit pebble
#

ah i just realized what you mean D: thought you wanna create a magical backpack

sonic needle
tacit pebble
#

sorry i came in middle

sonic needle
#

pathing issue, is likely

spare burrow
#

i'm checking by triage now (removing folders to see what happens)

winter thunder
#

if your file structure is wrong, it can cause this. I would download a mod off the workshop that is b42 compat and make sure your format is the same

#

They changed the file paths, so the typical structure for b41 doesnโ€™t work anymore

spare burrow
#

i know, 42.0/common/41.0 subfolders and the like

#

gonna check a complex mod nevertheless

winter thunder
#

๐Ÿซก

sacred harness
#

Dont use 41.0

#

Doesnt work

#

Its 42+

spare burrow
sacred harness
#

Correct

#

Basically, you are adding a 42 and copying your media folder into that 42 folder.

#

Alright, I'm off for now. Till tomorrow!

#

NIGHT!

onyx valve
#

But what would be the way to make a mod for the 42? Because this is just to update existing ones, right?

#

Or not?

sonic needle
#

make them all seperate if they are decently sized

small mods are ok for now

merry grove
#

Heh, updating for new version be like

#

Also a lot of new visitors, normally most of my subs are from Collections

winter thunder
#

Yeah, definitely prime time to be releasing / updating

merry grove
#

I jumped in becuse I noticed a Dip in my subs

floral minnow
merry grove
#

You worry when this is the general trend

floral minnow
#

Lol ok, fair enough

boreal crane
#

that's a weird dip

merry grove
#

That's a 42 realsed Dip

#

Still need find out about new evolved recipies

#

Also should update the picture of the friuts and cut out the wild apples as they are in base game now

#

I cut them from the code, but I still should update the pic

#

Also Collections are your friend

#

I really need to get the Sandbox settings done.
Could be good idea to also allow pepole to change the forging skill required I guess

#

But for that I wait for the new docs

#

I still have no clue how to repeat this

silent zealot
#

big spike in views for being early to update to B42.

merry grove
#

It's nice

silent zealot
#

Probably a bunch of people thinking "surely this doesn't do what it says it does...."

merry grove
#

Oh no

humble cosmos
#

Hey y'all I am extremely brand new to trying to mod, I don't know java or lua but I did get something to work. Can anyone explain how overwriting lua codes works in modding? More info: I have a lua I've edited and it's in a mod folder but I left the name the same. what do I need to do to get the game to pull in and use my lua as opposed to the base game? It's uploaded on the workshop but doesn't show up in the mod list in game. Currently going back to old build to even be able to upload to the workshop,, and then switching back to b42 unstable to check if it's there

merry grove
silent zealot
#

The proper way is (over simplified) you rename the original, then make a new function with the original name that calls the renamed original

#

That way you can have multiple mods adding stuff before/after the function without stompiong on each other.

silent zealot
#
-- C:\Games\Steam\steamapps\common\ProjectZomboid\media\lua\client\Vehicles\ISUI\ISVehicleDashboard.lua


function ISVehicleDashboard:prerender()
    
    original_dahboardPrerender(self)

    if not self.vehicle or not ISUIHandler.allUIVisible then return end  -- don't run if not in a vehicle or UI is off... otherwise throws an error when getting out of a vehicle when it excutes one final time.
    local alpha = self:getAlphaFlick(0.65); -- flickering from crashes etc
    local chargelevel = self.vehicle:getBatteryCharge()
    
    if self.vehicle:isEngineRunning() or self.vehicle:isKeysInIgnition() then
        
        --print ("#### Battery Charge is " .. chargelevel)
        
        if chargelevel > 0.75 then
            self.batteryTex.backgroundColor = {r=0, g=1, b=0, a=alpha};
        elseif chargelevel > 0.50 then
            self.batteryTex.backgroundColor = {r=1, g=1, b=0, a=alpha};
        elseif chargelevel > 0.25 then
            self.batteryTex.backgroundColor = {r=1, g=0.5, b=0.1, a=alpha};
        elseif chargelevel > 0.01 then
            self.batteryTex.backgroundColor = {r=1, g=0, b=0, a=alpha};
        else
            self.batteryTex.backgroundColor = {r=0.5, g=0, b=0, a=alpha};
        end
    end    
end```
#

that is the lua from colored battery indicators (which is now in vanilla)

merry grove
#

HOW MANY MODS are now vanialla ? is the top 50 mods just in Vanilla now?

silent zealot
#

you can see I copy ISVehicleDashboard.prerender, then make my own ISVehicleDashboard.prerender that calls the original but also does extra stuff after.

silent zealot
humble cosmos
#

So what I'm changing is ISShovelGround.lua, I just copy the entire thing even if i am only adding a small paragraph?

silent zealot
#

BTW> the vanilla version of "open a can with a knife" risks stabbing yourself in the hand and bleeding to death because you were distracted by the knife becoming blunt and worn.

merry grove
#

I know I need my start as mr Fatty fat fat trait back

humble cosmos
#

is that simpler than trying to inject a small change

merry grove
#

Wait did anyone bring back Obiste trait yet?

silent zealot
merry grove
#

Oh nobody did >:)
I guess I going to work on bringing back weight traits

spare burrow
merry grove
#

Why?

shrewd bolt
#

Can't say I've ever had a problem with that, on all the mods I've ported over, they all have the same ID as their B41 version.

spare burrow
#

I have no clue why, but i just renamed the root mod.info id to whateverbase and the b42 as the legit one

#

mod is done from scratch tho, may be the cause

winter bolt
cerulean yew
merry grove
#

Huh the code for weights is still in the game?

#

Ah it's for in game

#

Alright hm

silent zealot
#

As in, if you lose/gain too much weight you get the trait?

merry grove
#

Yeah

#

Also all the excusives are still there

silent zealot
#

I think all you need to do is change the cost from 0

#

When I made a quick "betatester" trait to avoiding having to grind initial skill levels to try B42 it didn't show up as selectable, when I made it cost 1 point it did.

merry grove
#

So just make a TraitFactory addTrait and modify the cost?

silent zealot
#

I assume so.

#

But there would also be code somewhere for "on starting new game if they have this trait adjust their weight"

#

That might be missing in B42

cerulean yew
#

I just don't understand why they have encoded a lot of files, to which novices like myself can no longer have access for obvious reasons of computer ignorance >_>

silent zealot
#

What do you mean "encoded"?

cerulean yew
#

hard coded sorry

silent zealot
#

You mean the stuff in the java side of the game?

merry grove
#

It's called Technical Debt

cerulean yew
#

If we talk about debts, we can take up a collection ^_______^

cerulean yew
merry grove
#

Well the game is over 12 years old now

devout abyss
#

Quick question - is a recipe for a custom item written in its own recipe file, or does it go into the item file?

elfin stump
#

items into ../42/media/scripts/items/YOURMOD_Items.txt

merry grove
#

Oh I hate they changed the name to "very high weight"

#

Also! weight works out of the box!

#

So just need to fix names and such make a pic and I can post

#

How do I check what errors is Lua throwing out?

#

Where are the icons?

#

As in Trait icons

#

There is like 1/10th of them in the actual folder labled Traits

elfin stump
humble cosmos
sand saddle
#

Has someone managed to get "Require" (in mod.info) to work? no matter how i set up my mods i cant get it to recognize the required mod on b42.

merry grove
#

I am not good at making thumbnails <w>

bronze yoke
#

they're supposed to be WORKSHOP-ID\MOD-ID but they're bugged right now to be just \MOD-ID, so heads up that you will have to change all of your requires when they fix it

sand saddle
sand saddle
#

i wonder how it will work with newly released mods then. they dont have a steam number till you have uploaded it...

near hull
#

You need to create a "42.0" folder and a "common" folder, inside 42.0 will be all the content of the mod (if there are no changes with respect to 41, then they will literally be duplicate files. Since those in 41 are the ones in the root folder

sand saddle
merry grove
#

I think that's better

near hull
#

On the other hand, is anyone managing to get the new translations working? I've taken the time to translate everything into Spanish (based on the EN folder, obviously), but despite coding it to ANSI so that it accepts the accents and other characters, the game doesn't recognize the translation, which is why it looks weird.

#

For example, let's say here it should be marked as "cinturรณn", but it looks like "cintur?n"

sand saddle
#

could the games font maybe not support it?

spare burrow
near hull
#

Mmm, tendrรฉ que revisarlo, pero suponiendo que la base de la 41 a esta no haya variado en gran medida (mรกs allรก de la infinidad de lรญneas), deberรญa ser la correcta

sand saddle
#

try replacing the รณ with รณ

#

some games axccept html code

merry grove
#

What the hell?
My Translation file just up end and DISAPPEARED

sand saddle
#

also unrelated : does someone know of a good cheat mod for b42? so i can run around and test my mod unbothered by the brain eating residents?

spare burrow
near hull
merry grove
#

Literally the entire EN catalog was gone

#

oh well it wasn't a lot so I remade it

#

I have no clue and I wanna see what will happen

random finch
#

Ive set the containerType in tile definitions and added the container to PropertyValueMap. Still the container name does not appear. Any ideas?

function PlayerConstructionZone.addContainerTypes()
    local containerVals = IsoWorld.PropertyValueMap:get("container") or ArrayList.new()

    if not containerVals:contains("core") then 
        containerVals:add("core") 
    end
end

Events.OnInitWorld.Add(PlayerConstructionZone.addContainerTypes)```
bright fog
#

Why do you want a cheating mod

merry grove
#

WHY IT DOUBLE

bright fog
#

Just use debug mode

bright fog
#

If I had to guess

merry grove
#

It worked fine before

merry grove
#

The problem is if I don't do Set MutuallyExlusives in my code it doesn't do Exlusive if I do it for some reason doubles them

#

Ah I SEE

#

Alright

#

I was just doing it wrong

#

that should fix it

#

Also is there a shortcut to reload LUA?

#

Alright I think it works now

bright fog
#

You should have a reload lua button bottom right of the main menu

sand saddle
#

steam hiccup.

#

try again

merry grove
#

Nope

#

Weirdf

#

It's set to public

round notch
merry grove
#

Well it's working now

#

and out

bronze yoke
#

steam takes a few minutes to scan new mods so it shows as private for a second

bronze yoke
#

the embed is going to be broken for a while because it's cached

round notch
humble cosmos
#

will a mod not show up in game unless I make it public

#

like the files downloaded to my computer after I uploaded to workshop and subscribed

#

it may be broken and not working but I feel like it should at least show up in my mod list if it downloaded

bronze yoke
#

it should show up as long as you're subscribed to it

onyx valve
#

Now I'm going to sleep, good luck to everyone and remember to enjoy the journey

humble cosmos
#

I don't know anything about modding, lua, java, etc so I think 10 pm was a bad time to start learning and trying to do this in one night

#

All I am trying to do is get

round notch
#

Can you see it in your mods window when your subscribed to it?

humble cosmos
#

not in game

#

but in the properties I can

#

and it has a file size

#

I think I fundamentally misunderstand how functions work

#

I was trying to copy the example posted earlier

#

All this does it make it so you get clay sometimes when you fill a bag with sand/gravel/dirt but also you can still get worms

round notch
#

You'll still see your mod even if your lua files are wrong. I'd make sure your using the right file structure, including mod info

bright fog
#

Or give a variant of the link

#

So I think adding & fixes it

#

Yeah

merry grove
#

Ah nice

bright fog
merry grove
#

Yeah I messed up

#

Forgot to resize it to size after I cropped to content

humble cosmos
round notch
#

Yeah. If your doing a B42 mod, you can subscribe to one on the workshop and see the structure that way and compare to yours

#

I imagine there's a thread for it but I'm on mobile and can't see one ๐Ÿ˜ญ

#

But your mod should be visible in the mod loader in game, if it's not, then the game isn't registering your mod properly which sounds like your structure is slightly off

humble cosmos
#

I think I just am illiterate in looking at file structures in the threads

#

that people have posted

round notch
#

Have you got mod info in your B42 directory?

merry grove
#

Me looking at my mods after updating them

humble cosmos
#

o that's progress

#

it's got an icon and everything

#

wow

#

I bet it works too

#

red errors are good right

round notch
#

Welcome to B42 ๐Ÿ˜Ž

humble cosmos
#

can I just name my lua PatchISShovelground.lua to overwrite the basic one

#

or is that outdated

merry grove
humble cosmos
#

add icon to your mod info

quasi kernel
humble cosmos
#

32xx32

quasi kernel
#

Only thing I can think to do next is update items in the item stories thing but eh

humble cosmos
#

is it possible for me to put a second value to make the randomizer more likely to hit

#

or do i need to add another elseif

merry grove
#

This looks better

humble cosmos
#

thanks for all the help to all the ones who helped

opal temple
#

I want to spawn a Super Bulldozer after crafting a recipe. I am a beginner in coding, so I asked ChatGPT to generate this code, but itโ€™s not working properly. I have already set up OnCreate: spawnSuperBulldozer.
May I ask why?

#

This is B41

loud flare
#

What are the lua codes in B42?
If this works in 41 stable, how has it changed from it to B42?

local item = ScriptManager.instance:getItem("HazmatSuit")
if item then
item:DoParam("BiteDefense = 65")
item:DoParam("ScratchDefense = 65")
end```
elfin stump
#

addVehicleDebug(String scriptName, IsoDirections dir, Integer skinIndex, IsoGridSquare sq) - that is the parameters you are shooting for I think.

ebon dagger
#

I don't know what I am doing. But working on my first mod.

Here's Roxy saying Ara Ara

(I own the use/distribution to the audio, commissioned by the very Lovely Alexia Renaldis)

bright fog
opal temple
elfin stump
#

You made need to search back on this channel to find more info on addVehicleDebug if that doesn't work.

dull moss
#

am I missing something?

name=Evolving Traits World (ETW)
poster=poster.png
require=2859296947/MoodleFramework,2553809727/KillCount
url=https://steamcommunity.com/sharedfiles/filedetails/?id=2914075159
id=2914075159/EvolvingTraitsWorld
versionMin=42.0
modversion=9.0.0
icon=icon.png
description=Makes majority of vanilla traits dynamic (meaning you can earn them as you play). Additionally, adds a few traits, making all of them (optionally) dynamic.
authors=MusicManiac
shrewd bolt
#

Requires need to start with \. In your case, require=\2859296947/MoodleFramework,\2553809727/KillCount

dull moss
#

ah

#

uuuh

#

that didn't help thinking

#

modID for both dependenies do not have their workshopID in the modID field in mod manager

#

is that intended?

shrewd bolt
#

It needs to match their mod ID field, so if they don't have their workshop ID in their mod ID, then don't add it.

opal temple
dull moss
shrewd bolt
#

It's recommended, yes, but not required.

dull moss
#

thread said that now all modIDs needs to be prefixed with workshopid

#

ah

shrewd bolt
#

Still need to have the \.

dull moss
#

oh

#

oh right cuz it expects workshopid

#

makes sense

#

ty, works

#

surely I will be able to launch the game and not get any errors

sour island
#

Does it work with workshop ID yet? Last time I tried it did not.

So you'd just need the \ in front.

#

Which is also a bug that would be fixed soon.

#

Technically you shouldn't need a \ if you don't include a WID

shrewd bolt
#

It needs to match whatever the mod Id is that the mod maker used. So if they did it wrong, for example didn't use the workshop ID, it won't work.

sour island
#

So it's been fixed?

shrewd bolt
#

It's not really a bug from what I can see.

#

People should use <workshopid>/<modid>, but not all do.

#

So you need to use whatever they used.

sour island
#

Im fairly certain the workshop ID inclusion is optional

#

And requiring a \ is a bug

shrewd bolt
#

It is optional, as I'm saying. The whole requiring \ might be a bug, however considering how many mods now have that, I doubt they'll change it.

sour island
#

๐Ÿคทโ€โ™‚๏ธ Better to pull the bandaid off sooner than later imo.

merry grove
dull moss
#

Been on workshop for a year

#

Literally DT but better

tiny valve
#

Can anyone tell me which file is responsible for moodle background color? Previously it was UI.pack, but it seems to work differently now. Or I'm a fool and I'm doing something wrong.

dull moss
#

When exactly PZAPI is going up? in b41 with modoptions mod I was able to fetch mod options into shared lua files, now if I have in my shared folder

local modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");

It fails to fetch them

function: ETWCombinedTraitChecks.lua -- file: ETWCombinedTraitChecks.lua line # 8 | MOD: Evolving Traits World (ETW)

ERROR: General      f:0, t:1734703794509> ExceptionLogger.logException> Exception thrown
    java.lang.RuntimeException: attempted index: ModOptions of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).

PepeThink
What was the floders load order again? shared -> server -> client?

#

funny I was about to ping you :D

dark wedge
#

PZAPI is in client. If you're wanting to access it in shared, then you'll have to do it in an event like OnGameBoot

dull moss
#

could you elaborate a bit?

#

Like i know how events work

#

But I don't exactly get wdym

#

If I have a file with a bunch of common utility functions in my shared, they are called from other lua files

#

ah I see the problem

#

Thing is I was declaring them inside the file instead of functions, for example, this is the beginning of my file

local ETWCombinedTraitChecks = {};

local ETWCommonFunctions = require "ETWCommonFunctions";

---@type EvolvingTraitsWorldSandboxVars
local SBvars = SandboxVars.EvolvingTraitsWorld;

local modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");

---@return boolean
local notification = function() return modOptions:getOption("EnableNotifications"):getValue() end;
---@return boolean
local delayedNotification = function() return modOptions:getOption("EnableDelayedNotifications"):getValue() end;
---@return boolean
local debug = function() return modOptions:getOption("GatherDebug"):getValue() end;
---@return boolean
local detailedDebug = function() return modOptions:getOption("GatherDetailedDebug"):getValue() end;```
so when game loads it won't be up yet
#

while modoptions were up already

dark wedge
#

ModOptions was in shared before, but it didn't need to be as it was client only. The new system is definitely client only.
So you need to move those types of functions into client, or delay them until the game has booted.

dull moss
#

gotta do it in fucntions now Sadeg

#

i just have to move it inside functions, as when game boots it runs the lua file and thats why it errors

#

functions inside those files are called in-game only so it'll be fine

bronze yoke
#

why do you need client only code in a shared function anyway?

dull moss
#

its not client only

bronze yoke
#

well the options are

dark wedge
#

ModOptions are intended to be client only.
Sandbox options are the only ones that are "shared" to client and server

dull moss
#

as example: I give repair mechanic or whatever when client repairted x % durabiltiy of cars and got y levels of skill
problem is repairs are done on server side so if i want to have printouts to console (which is a mod option setting, not a sandbox setting so in MP it's not forced on everyone who doesn't want it), I have to have the check which gives repair mechanic in shared

#

its really just debug stuff

#

if i ditch all my debug prints it'll work as is

bronze yoke
#

how are you checking their specific options and printing to their log from the server?

dull moss
#

worked in b41 with modoptions

#

it was printing to server console I believe

#

I don't remember at this point, been a while since i done server stuff

bronze yoke
#

if it's printing to the server console shouldn't it be up to the host and not each individual client

dull moss
#

I honestly don't remember

#

i mostly played SP and i didnt get any reports of stuff not working

#

and with limited testing i done with friend it was working as intended

ocean venture
#

Hello,
I'm working on a mod for Project Zomboid and need help retrieving the direction of a tile. Specifically, I want to know how to calculate or get the direction of the tile. I look in the API I'm lost ๐Ÿ˜ข
Thanks in advance for your help!

ocean venture
#

I want to target the rails underneath a vehicle to lock its direction based on the orientation of the rail. The problem I'm facing is determining the exact direction of the rail relative to the vehicle.

Initially, I thought about calculating the alignment by checking every adjacent tile and comparing coordinates, but this approach seems overly complicated and error-prone. I'm not sure how to make this more efficient or reliable.

Does anyone have suggestions or ideas on how I can accurately and efficiently determine the rail direction under the vehicle without having to perform complex calculations for each tile? Iโ€™m a bit stuck and would really appreciate some guidance!

Thank you!

#

Yes it's to make a train.

#

But I have problems with the axes, the problem is what am I going to do when the rails turn ๐Ÿ˜ฌ

dull moss
#

shouldn't this work? PepeThink

local modOptions;
local notification = function() return modOptions:getOption("EnableNotifications"):getValue() end;
local function weightSystemETW()
    if notification() then ... end
end

local function initializeModOptions(playerIndex, player)
    modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
end

Events.OnCreatePlayer.Add(initializeModOptions);

attempted index: getValue of non-table: null

EDIT: nevermind im fucking stupid, when chaning my settings from modOptions to new mod options i missed this setting it's literally just not there cuz it was never created

mint hawk
#

Is there a way for me to overwrite a specific vanilla recipe? I want to mod a fix for the Crude Whetstone recipe and maybe a few others if I find some more bugged.

dull moss
#

why not just submit a bug report? it's unstable meaning it's being actively developed

mint hawk
#

Yea, it's been reported. But just to make the thing craftable until it's fixed.

drifting ore
#

hay my mod just isn't showing up in the mod list.

dull moss
#

b42? make sure you have mod.info in proper places, check pins

grand cloak
#

why the hell my zombies are not biting anymore

#

did they change something in the code

dull moss
#

show you folders structure. if mod doesnt show up in mod manager than either folder struct is fucked or mod.info

drifting ore
dull moss
#

check the forwarded msg above

gaunt mantle
#

Big thanks to everyone making mods for b42 or updating current mods to b42, we appreciate you ๐Ÿ’ฏ

drifting ore
dusk saddle
#

Heya, back with another question here for Build 42. How are custom crafting sounds done now?

tacit plover
dusk saddle
#

Hmm, I suppose I'll give it a look

#

Shoot, I'm not seeing anything for the animation for writing something down. Would you happen to know where that'd be located? Trying to get an animation for the character to write down a note

mint hawk
#

Ok well - I got the crude whetstone recipe fix working. But I don't think I can get it to overwrite the vanilla recipe? Not sure how to do that or if it's possible.

marble turret
#

Hey everyone, I'm attempting to make a mod to fix the empty welding torch refill bug for b42. The recipe works when I hardcode the change into the game's recipes, but doesn't seem to appear ingame. Do I need to add anything aside from the recipe script to add a new recipe? The mod appears and seems to load fine, logs don't indicate any errors.

#

Here's the recipe script

{
        craftRecipe RefillBlowTorch
    {
        timedAction = Welding,
        Time = 50,
        OnCreate = Recipe.OnCreate.RefillBlowTorch,
        Tags = InHandCraft;Welding,
        category = Metalworking,
        inputs
        {
            item 1 [Base.BlowTorch] mode:destroy flags[NotFull] itemcount,
            item 1 [Base.PropaneTank] flags[NotEmpty],
        }
        outputs
        {
            item 1 Base.BlowTorch,
        }
    }
}
dull moss
#

use tripple ` for multi-line code

mint hawk
#

Why does my recipe not have spaces between the words in the crafting menu? ๐Ÿ˜ญ

#

It should be showing like the vanilla recipe (Make Crude Whetstone) but instead it's showing up without spaces?

gilded crescent
mint hawk
#

Ooooh okay. I figured we couldn't use spaces directly. It has been probably 10+ years since I really messed with Lua.

gilded crescent
#

definitely look into tranlate files later on though, probably a lot better of a way to do it honestly

mint hawk
#

I'll probably copy it from Common Sense - I can kind of see how it works I think

gilded hawk
#

Is it just me or the common folder does not seem to work well? I have put my mod.info in it, but it's not loading the poster or the icon

gilded crescent
gilded crescent
gilded hawk
#

I have the 42 folder, but the poster.png is still not loaded

#

Something is clearly not working ๐Ÿ˜…

gilded crescent
gilded hawk
gilded crescent
gilded hawk
#

I'll try

#

Yeah, good call, thank you

marble turret
autumn temple
#

How do I view the new PZ animations in blender?

gilded crescent
mint hawk
marble turret
mint hawk
mint hawk
gilded crescent
#

at one point I had 3 mod.infos

mint hawk
#

We should be able to keep it in the common folder but I guess that doesn't work right now.

autumn temple
#

I tried to import a .X file into blender but it wouldnt add the animations, so if anyone knows how to view the vanilla animations in blender?

gilded crescent
#

since it's pulled from all versions

mint hawk
#

Yea.

marble turret
dull moss
#

this is more for coding stuff

thorny badger
#

I wish to make a building sign(A logo for a business on a server). Something that will go on the wall of the building.
Does this come under mapping or modding? What if I wanted the sign to be neon like the open signs and use electricity to light up? Does it go into modding territory then?

dull moss
#

there are no real rules on where to ask questions, it's just more likely you'll find help if you ask in correct channels

#

probably both in you case depending on issue you're fixing

bronze yoke
#

generally any kind of tile stuff goes to mapping

dull moss
#

was UI code changed? MichaelDespair
Can't get my UI to update properly

coarse sinew
dull moss
#

and it's a bit borked

#

imma go google if it's possible to have 2 steam game installs so i can have b41 next to b42

mint hawk
#

You can copy the entire project zomboid folder and just direct steam to that one in launch options when you want to swap versions.

gilded crescent
#

sorry moon didn't mean to ping with that

gilded crescent
mint hawk
#

So for example my default path is /home/deck/.local/share/Steam/steamapps/common/ProjectZomboid/projectzomboid
All I need to do is add
/home/deck/.local/share/Steam/steamapps/common/ProjectZomboid/projectzomboid %command% and it will open the default install of Project Zomboid. But I copied B41 to it's folder so to change that all I need to do is /home/deck/.local/share/Steam/steamapps/common/ProjectZomboid41/projectzomboid %command%
Since my build 41 is just in ProjectZomboid41

#

I'm on Arch (steamdeck) so for a windows machine you obviously need to figure out what your path is and direct it there.

dull moss
#

i'll just rename the folder lol

#

and dl it again

bronze yoke
#

it'll still load steam workshop and track playtime, it's still connecting to steam

autumn temple
#

I must resist...

But you can just rightclick the game on steam and open file location

bronze yoke
#

you can't even launch the game without it connecting to steam unless you turn off steam mode

autumn temple
#

then go back a single directory to choose build41

gilded hawk
#

Did anyone figure out how to use keybinds in B42? I saw the "B42 Native ModOptions Example" but I don't see how to actually listen for the keybind to be used

bronze yoke
#

wouldn't you just compare it to the option value OnKeyPressed?

dull moss
#
---Function responsible for opening up ETW UI
---@param keynum number
local function ETWShowUI(keynum)
    if keynum == PZAPI.ModOptions:getOptions("ETWModOptions"):getOption("UIToggle"):getValue() and getPlayer() then
        local playerObj = getSpecificPlayer(0)
        xpUpdate.characterInfo = getPlayerInfoPanel(playerObj:getPlayerNum());
        xpUpdate.characterInfo:toggleView(xpSystemText.ETW);
    end
end

Events.OnKeyPressed.Add(ETWShowUI);
#

as example

gilded hawk
#

Ah. very nice, thank you for the perfect example!

dull moss
#

ISUIElement.lua got +200 lines in b42

marble turret
#

@mint hawk Still haven't gotten mine to work, but it looks like "MetaRecipe: [Base game recipe name]," may solve your problem

sour island
#

Haven't had a chance to sit down with anything other than just playing the game.

mint hawk
red tiger
dull moss
red tiger
#

I think I might just replace all the UI in the game.

dull moss
marble turret
bronze yoke
#

old ui is supposed to still work but xui seems to be intended to be the modern, easier approach

gilded hawk
#

My baby is coming to B42

dull moss
#

Kpog albion new pfp

bronze yoke
#

most of the game still uses the old ui anyway so it's not like it's deprecated

dull moss
#

ye so my assumption is that there's some fuckery going on with my mod options cuz i use them in ui as well

red tiger
#

Would be fun to just walk in and redo all the UI when they're also looking at upgrade from 2000's UI to 2008 UI.

dull moss
#

2008 UI was fire

dull moss
#

just to be sure it doesn't really matter that lua file is in ui folder, right? I still can throw this at the bottom of it, right?

local function initializeModOptions(playerIndex, player)
    modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
    nonBarsEntriesPerRow = PZAPI.ModOptions:getOptions("ETWModOptions"):getOption("TraitColumns"):getValue();
end

Events.OnCreatePlayer.Remove(initializeModOptions);
Events.OnCreatePlayer.Add(initializeModOptions);
red tiger
#

I mean I could write a React UI library for PZ with PipeWrench. xD

gilded hawk
#

is there a way to reload all the localization files while the game is still running?

dull moss
#

afaik no

bronze yoke
#

subfolders don't matter whatsoever

#

they're still part of the file path so they affect load order but there aren't magical properties given to your script by putting it in named subfolders like some people seem to think

dull moss
sacred harness
#

They should try and work in some sort of logical way of loading mods. Not sure what the best way of doing it would be but that would be really nice. Dependencies are great, however its mod to mod dependencies. If I have a mod that modifies backpacks and someone loads a backpack mod after mine, those backpacks arent affected.

mint hawk
round notch
bronze yoke
#

you can avoid most load order issues with good code

gilded hawk
#

Do we know if the new new ModOptions and Keybinds allow you to have different keybind for split screen? Like, I want to be able to do split screen and have two different toggles for the prox inventory

dull moss
#

^

bronze yoke
sacred harness
#

LOL true, however thats asking everyone to be something they arent

bronze yoke
#

shared first, then client if it's not a server, then server (even if it's a client) (in singleplayer this is delayed until you actually start a game)

dull moss
#

if you done your mod properly so it modifies modded and non-modded backpacks then you can just add workshop ids into loadAfter in mod.info

mint hawk
#

It appears MetaRecipe = does nothing :c

bronze yoke
#

if you modify items through lua, all item scripts are loaded by the time any lua runs anyway, so you don't run into load order issues with that

sacred harness
#

If I could add loadAfter all containers.... then I wouldnt have to add anything else ๐Ÿ™‚

gilded hawk
#

Is anyone interested in reviewing my code? I'm re-writing Proximity inventory for B42 and I welcome any kind of feedback

dark wedge
# gilded hawk Is anyone interested in reviewing my code? I'm re-writing Proximity inventory fo...

I'd be down to take a look in like 2 hours, about go run some errands. One thing I'm curious about is that inventories associated with bags now have a max capacity of 50, so is the new merged inventory limited by that?
P.s. I haven't worked on my inventory merging feature yet (ours run pretty different except for the actual transfer function, not trying to make it seem like i'm trying to steal your code)

gilded hawk
#

200 items in the prox inv

dark wedge
#

phew. glad to hear that the AddItem functions just forces stuff in there. after finding that limitation, was worried we were screwed.

gilded hawk
#

I'm currently using proximityButtonRef.inventory:getItems():addAll(items) addAll

quasi kernel
#

Question of the day, do I bother to update my Magnet Fishing mod for B42 at the given moment,,,

dark wedge
#

Nice. I do the same thing for external bags. nice to see that works.

quasi kernel
#

To my understanding they overhauled like everything in regards to fishing so I'll basically have to reprogram half the mod

dark wedge
#

Feel free to DM me when you want to share the mod, and I'll take a look when i can. like i said, probably about 2 hours until i'll be back at my desk though. ๐Ÿ‘

gilded hawk
#

Thank you I will once I'm done working on it ๐Ÿ˜„

lilac mural
#

When I'm using script manager on custom scripts it sometime gives out error parsing error. out of bounds. Does someone knows what could be the problem?

marble turret
#

I've been at this for an embarrassingly long time and simply can't get this recipe to appear in game. It works fine when modifying the vanilla recipe, but this one just doesn't show up. Any ideas what may be wrong? Mod structure? Naming? The only change vs vanilla is the addition of itemcount, as underlined

quasi kernel
#

Just realized that in order for me to update my magnet fishing mod I have to manually go through and find everything that'd be magnetic again

elfin stump
elfin stump
gilded hawk
elfin stump
quasi kernel
#

It may add more hassle than it solves if it's legacy.

#

Wait, nevermind I misread

floral minnow
quasi kernel
#

You said hasMetal tag, not :getMetal()

#

I wonder if I could manage to dynamically sort into tiers that way.

elfin stump
# quasi kernel You said hasMetal tag, not :getMetal()

Yeah there is a tag hasMetal in the item lists in scripts/items. You could either write a program to parse everything and find all hasmetals and give you a list, or you could find the tag somehow in your code. - AI coders are good at writing parsing apps if you don't want to waste your time with that to get a fast list out.

quasi kernel
#

So hasMetal is unique to B42?

elfin stump
#

I believe it is, I am not sure that we had tags at all before, maybe we did? But I am fairly certain this is brand new.

quasi kernel
#

Tags have been around since B41 at least, doing a quick search demonstrates hasMetal has been around for a bit, hm.

#

I'll run some code to get an idea of what items I can expect to see from it and work from there.

elfin stump
#

Might be what you want, I do think has metal doesnt specifiy if the metal is magnetic or not though, like BeerCan is hasMetal but by 1993 those were all aluminum. So there is that to consider, lots of non magnetic metals to worry about in here if you wanted to be accurate.

quasi kernel
#

True..

#

Probably best to avoid it perhaps.

#

Unless I want to sort with an exclusion list

#

Which could work, depends on how much hasMetal returns.

elfin stump
#

Yeah, might need to consider your options but hopefully that helps! ๐Ÿ™‚

quasi kernel
#

Appreciate it, last time I was working on this I was exclusively looking at :getMetal()

#

Which was prior to even B41 to my knowledge.

#

(In terms of implementation, not since I've been modding. I started making mods in B41)

elfin stump
#

It is kinda fun looking back at all the old code, I don't remember writing most of it anymore haha

gilded hawk
elfin stump
elfin stump
#

module Base
{
craftRecipe RefillEmptyBlowTorch
{
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.RefillBlowTorch,
Tags = InHandCraft;Welding,
category = Metalworking,
inputs
{
item 1 [Base.BlowTorch] mode:destroy flags[NotFull] itemcount,
item 1 [Base.PropaneTank] flags[NotEmpty],
}
outputs
{
item 1 Base.BlowTorch,
}
}
}

marble turret
elfin stump
marble turret
#

Does your mod have a similar structure?

elfin stump
#

It does in that it has recipes as well. All I did was create a separate text file in my recipes folder and inserted that code. If you have multiple recipes on one file, it could be an issue with syntax. - is console.txt reporting anything when it fails?

crystal canyon
#

I need help making a function with the new liquid system. in b41 it was easy but now its a mess unless im looking at the wrong systems. Basically im making a teetotaler trait that prevents smoking and drinking alcohol. the smoking block works, but not the alcohol. I can still drink.

https://gist.github.com/KuroNeko87/03ee9ec919b3464696ae34228f7318d3

Gist

GitHub Gist: instantly share code, notes, and snippets.

marble turret
elfin stump
dusty umbra
#

Hello everybody! I'm very unexperienced with Lua and PZ modding, so excuse maybe a dum-dum question, but I'm trying to create a small mod which will alter zombie stats. So I'm trying to figure out which function do what and what should I use in a code. At this point I have working barebones but still have to figure out a correct method to use. I'm referencing javadoc but unsure what results I'll get. So the questiong is: is there any way to use method in a console/debug to see what response I'll get? For example, for zombie.characters.IsoGameCharacter method getSpeedMod()

elfin stump
#

A difference I see between yours and mine is you have "42.0" and I have "42" but I am not sure that matters at all.

mellow frigate
marble turret
#

The manual transcription was the cure afterall lol

elfin stump
dusty umbra
elfin stump
# dusty umbra I'll take a look thanks, kinda a lot of resources to look into ๐Ÿ˜…

You will put a script in ../media/lua/server and within that put the example that is on the OnZombieUpdate page, where it says "--Your Code Here" you can start with print(tostring(zombie)) - if that doesn't work you can find or generate a lua script to print a table and try passing zombie to that. - That should start getting you closer to where you need to be.

elfin stump
# north heron bump, still need help w/ this

It isn't just you, I have noticed that models that are thin and clipping on the floor as well. I think that the ground plane is shifted or something as it seems to affect a lot of models including vanilla ones. Things like magazines that are very flat seem to have the issue. It could have to do with your models origin and scaling as well. If you are able to take your model into a 3d program and move it upward so its origin is a bit lower, that might fix your issue - though it might be an issue they have on the radar since I have seen it with vanilla items too.

north heron
elfin stump
# crystal canyon I need help making a function with the new liquid system. in b41 it was easy but...

I would recommend filling that script with a lot more output to console to report what is happening. Your trait detection is working as shown by the smoking one, so you could add print("YOURMOD_CONSOLE: "..informationHere) along each step of the way. You have output for detection of alcohol but not for not detection of alcohol etc. I would fill it out with a lot of debug logging so you can track where exactly the failure is.

mellow frigate
#

Hello Lua perf people, I need advice: ```lua
--I have self being a lua table and use the following code in some render
self.instanceParam[stringKey].var1 = val1
self.instanceParam[stringKey].var2 = val2
self.instanceParam[stringKey].var3 = val3
self.instanceParam[stringKey].var4 = val4
self.instanceParam[stringKey].var5 = val5
-- and so on

--Is the following code an improvement or just added complexity ?
local param = self.instanceParam[stringKey]
param.var1 = val1
param.var2 = val2
param.var3 = val3
param.var4 = val4
param.var5 = val5
--and so on

autumn temple
#

quick question since I saw you typing. is there anything special I need to do with my code that uses MoodleFramework for B42?

#

getting a weird issue where my mod wont let me enable it because it says I need MoodleFramework, but I have it installed and enabled but its still giving me a dependency error

mellow frigate
#

notice the "\"

autumn temple
#

ah, ok

grand cloak
#

am I able to see fluid names in debug mode?

mellow frigate
#

if you do it: when TIS will change their dependency check system, it may break

autumn temple
#

thanks ๐Ÿ™‡โ€โ™‚๏ธ didnt know we needed to add the \ now

mellow frigate
#

if you do NOT do it, you wil have users complaining : "mod does not work"

#

they will just have not activated the framework

quasi kernel
#

Is it weird that I'm not really worried about crazy version control in B42 so far..? I kinda released an update pre-emptively for visible generator range that accounts for the new height limits when the game doesn't actually do that yet, but the developers will probably fix in a hot fix soon.

#

Like, why have the specific version at the moment when B42 is still in unstable? I can understand down the line but atm it feels a bit redundant when you probably won't be able to fall back to previous versions of unstable.

#

I might just be weird for it, I dunno.

fluid current
#

id 'io.pzstorm.capsid' version '0.4.2' is in my build.gradle tho

#

dont have any experience with gradle but i'd assume this just pulls a package from somewhere

mellow frigate
fluid current
#

cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=8, vendor=any vendor, implementation=vendor-specific} for WINDOWS on x86_64.

#

i have java 8 installed and openjdk 17.0.13

#

ok just had to add java toolchain to the build.gradle

drifting stump
#

most of the performance hit is calling into java from lua

elfin stump
# gilded hawk <@597362304614662144> <@255358282862952449> Hey guys I think I'm done porting ...

The code looks good to me, I am no lua master but I couldn't see anything that was going to break or make anyone mad.

I also temporarily added the code to my test platform and did a stress test as well found all functionality to be working and I was not able to generate any errors or exceptions.

-Auto looting from entire selection works.
-Looting individual item works.
-Looting a control-clicked selection works.
-No error or odd behavior if user tries to put item in prox inventory icon.
-looting between zombies and containers works
-looting only containers works
-looting only zombies works

-Zombie Only Sandbox Setting: This has the only issue I found.
I am prevented from looting containers, however they still get highlighted by the system.
Potential Issue: Users that do not know this setting is on or forget that may believe that containers are empty when they are not.

Overall everything looks great, that one issue when using Zombie Only setting is the only thing I could find.

I removed all code from my test platform as well.

Looking forward to the release of this one! ๐Ÿ™‚

fluid current
#

damned if i do, damned if i dont

autumn temple
#

im just really confused on why this is erroring in B42?

elfin stump
autumn temple
#

oh? I saw it on the list of distributions

elfin stump
#

Let me verify but it was the same one breaking my code yesterday. Could maybe also be the casing.

autumn temple
elfin stump
#

Ahh they corrected the casing.

#

Sidetable not SideTable

#

They must have not removed it but correct the casing of the word, which brokes our existing BedroomSideTable reference.

#

Change to "BedroomSidetable"