#mod_development

1 messages · Page 284 of 1

bright fog
bronze yoke
#

no

bright fog
#

Not even for manual downloads ?

bronze yoke
#

for manual downloads yeah i guess

crystal canyon
#

LOG : General f:12649, t:1735541356597> -----------------------------------------
STACK TRACE

function: doLiteratureMenu -- file: ISInventoryPaneContextMenu.lua line # 1005 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 738 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1459 | Vanilla

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

I get this error and cant read skill books

bronze yoke
#

i'm not really keeping the main umbrella repo up to date at the moment

bright fog
#

Also could you write a small description of Umbrella please ?

bright fog
crystal canyon
#

anyone knows how to set up an entity?

I have

    entity Metalworkbench
    {
        component UiConfig
        {
            xuiSkin         = default,
            entityStyle     = ES_Metalworkbench,
            DisplayName     = Metal Workbench,
            uiEnabled       = true,
        }

        component CraftBench
        {
            Recipes             = MetalWorkbench,
        }

        component SpriteConfig
        {
            face S
            {
                layer
                {
                    row = crafted_02_0 crafted_02_1,
                }
            }
              face E
          {
                layer
                {
                    row = crafted_02_3,
                    row = crafted_02_2,
                }
            }
        }
                                
        component CraftRecipe
        {
            timedAction   = BuildWoodenStructureMedium,
            time          = 150,
            tags          = Blacksmithing,
            inputs
            {
                item 1 [Base.BenchAnvil],
                item 1 [Base.CrudeBenchVise],
                item 1 tags[Hammer] mode:keep flags[MayDegradeLight],
                item 1 tags[Saw] mode:keep flags[MayDegradeLight;Prop1],
                item 6 [Base.Plank] flags[Prop2],
                item 20 [Base.Nails],
            }
        }
    }
steep vortex
#

Hiya, may I ask where you can find the values for getTextureName()?

crystal canyon
#

but appears in miscellaneous and display name not working

bright fog
steep vortex
bright fog
#

Should be that

steep vortex
#

Thanks

bright fog
bright fog
#

That's a tile

#

So that's not going to be how you access it

bronze yoke
#

afaik all tiles are in texture packs

bright fog
#

And I doubt you can do getTextureName()

loud viper
#

hey lads, ive got a question, im working on a map and i would like for canned foods and different items to spawn in certain counters on the map, does anyone know how to set this up?

crystal canyon
#

holy crap, this got actve all of a sudden

steep vortex
# bright fog What's the wall vault ?

This thing. Oh? What should I be using? getTextureName() worked for mailboxes in an example I'd seen (obj:getTextureName() == "street_decoration_01_11")

bronze yoke
# bright fog Also could you write a small description of Umbrella please ?

Umbrella is a collection of Lua type stubs for Project Zomboid's modding API. It tells your IDE about Zomboid's classes and functions in order to provide autocomplete and type checking. It can be used with any IDE that supports LuaCATS annotations, but is primarily designed for VSCode's Lua plugin.

bright fog
crystal canyon
#

okay, got it mostly working

#

it still doesn't want to set the localized name

umbral raptor
#

Hey. So I am making a TV broadcast and I want a section to level up tracking or butchering (the new skills) where can I find the three letter code for them?

#

For example; Carpentry is CRP in the xml for the radio/TV

crystal canyon
#

C:\Games\Steam\steamapps\common\ProjectZomboid\media\lua\client\RadioCom\ISRadioInteractions.lua

#

actually, new ones aren't here. you will need to add them to the table

loud viper
#

Can we already make maps for B42 or do we need to wait for tilezed and worlded to get updated

crystal canyon
#

@umbral raptor only a few of the new ones are defined such as
Interactions.POT = function(_player, _amount) doSkill(_player, _amount, getText("IGUI_perks_Pottery"), Perks.Pottery); end
Interactions.FKN = function(_player, _amount) doSkill(_player, _amount, getText("IGUI_perks_FlintKnapping"), Perks.FlintKnapping); end
Interactions.CRV = function(_player, _amount) doSkill(_player, _amount, getText("IGUI_perks_Carving"), Perks.Carving); end

crystal canyon
crystal canyon
#

no official tools are out yet

loud viper
#

thanks for informing me spiffo

zenith harness
#

Any good modding videos to watch to help with development?

bright fog
zenith harness
bright fog
red tiger
#

@crystal canyon Always nice to read chat history and see links to works.

crystal canyon
#

what did I linK? Ive linked many things :v

red tiger
#

Umbrella

crystal canyon
#

Ah yeah 😄

red tiger
#

I did the Java API side of Umbrella.

#

<3

crystal canyon
#

thank you and thank albion!

red tiger
#

@bronze yoke Did the silly events

#

:D

#

We all didn't know when 42 would come out but some projects prepared for that back as far as 2022.

silent zealot
#

Found this in the item definitions... I need to try a BOHEMOTH DETONATOR WARHAMMER run now.

crystal canyon
#

hahaha

#

i love when devs have fun like that

umbral raptor
crystal canyon
#

look a bit further up on the messages. I left the file name that has that info

#

-- ["GloveBox"]
table.insert(VehicleDistributions["GloveBox"].items, "YOUR GLASSES");
table.insert(VehicleDistributions["GloveBox"].items, 0.1); <--- Your Chance

fading horizon
#

on to my fourth mod update of the day

#

b42 is cool

#

im not looking forward to trying to update the stuart little mod especially with the state the crafting system is in

crystal canyon
crystal canyon
#

the original event also runs on game boot
Events.OnGameBoot.Add(function() ISRadioInteractions:getInstance(); end);

silent zealot
#

Speaking of butchering, I found out why deer are so hard to find - they are TINY!

#

5 to 7 encumbrance per deer.

crystal canyon
#

hahahaha

bright fog
#

That's me hola

silent zealot
#

Average Kentucky deer

bright fog
#

It has a more up to date version too

silent zealot
#

Can't drink from a bucket of blood like a savage

rugged latch
#

too big to drink?

silent zealot
#

Should let you drink but also cover your clothes in blood

rugged latch
#

thatd be cool lol

rugged latch
#

if college boys can guzzle beer kegs i should be able to pour blood into my mouth from a bucket like a frat-vampire

silent zealot
#

We know hunting/trapping is on the to-be-fixed list for B42, so it's not worth modding now unless it's a very easy mod.

crystal canyon
#

Blood for the Blood GOD!!

#

Loved that mod, sneaking around the forest and shooting at everything that popped in my screen

silent zealot
#

Blood for the blood god! ...but not from a bucket, fancy glassware only.

silent zealot
#

Also, deer hunting looks near impossible to find deer unless you use the "show animal tracks" debug feature on the map... otherwise you just wander all over kentucky hoping to find a spawn location.

crystal canyon
#

Right now I'm trying to modify a cistern trailer to have the new fluid container function

silent zealot
#

Finally, a way to handle bulk coffee deliveries

crystal canyon
crystal canyon
#

And here

silent zealot
#

This is how I found where to look:

crystal canyon
#

Those I found during normal gameplay

silent zealot
#

I found one in a sideroad just off the highway between Rosewood and echo creek, while grabbing a trailer from a crashed vehicle.

#

It startled and ran off... but that means that there is a deer spawning "circle" there

#

But that's a long way to go, and dense forest makes it had to get close enough to shoot

crystal canyon
#

how can I delete vehicles in debug mode?

crystal canyon
#

hmmm, it sorta works

#

but cant interact with it as a fluid container. I might be missing something

silent zealot
#

Fluid system feels half-done, that won't be helping.

crystal canyon
#

HAHAHAHA Fuck yeah!!!

#

I need to adjust the amount

silent zealot
#

Nice!

crystal canyon
#

and is craftable

silent zealot
#

One step closer to DIY biodiesel!

crystal canyon
#

yup

silent zealot
#

And the ultimate in redneck cocktails.

crystal canyon
#

can I mutate a tile with a right click interaction?

crystal canyon
#

great! My whole country has a general blackout.

blazing osprey
#

I'm sure this has been asked a million times, but why won't my custom map show up in the spawn locations list? it's enabled in the mod menu and i followed all the steps and troubleshot for hours to no avail.

crystal canyon
#

is it a custom location or a custom spawn map? B42?

blazing osprey
#

@crystal canyon custom location, b42

#

i've tried with my own and custom maps i found online, none show up

#

copied the folder structure from daddy dirkie, modified for b42

crystal canyon
#

put the maps folder in common

#

there seems to be an issue where it doesnt want to load maps from 42

#

common/media/maps

blazing osprey
#

well ill be damned

#

thank you

#

that worked

crystal canyon
#

😄

undone elbow
#

Why "common" exists? Why not to put everything in 42? What is the idea?

round notch
#

For version control. Normally used for things like assets which are used across all versions

#

Definitely will be handy when B43 comes out

#

It probably won't see much use at the moment cause B41 doesn't use it, but in theory if you had 20 builds the common folder prevents duplication of assets which in turn would reduce your mod size

silent zealot
#

If you imagine a mod that support B42, B42.03, B42.1 and B43 having all your models and files that don't change in common saves a lot of duplication, you just need to put the files that need updating in the other folders.

#

Plus it's easier to manage - if you change a model you update it one place, not five.

#

Idea I just had: since animals have static spawn locations, we can mod in maps to find like this to give hunting locations.

#

...but after the hunting/trapping update since I'm don't want to spend hours making a list of locations and then find the whole system changed.

#

(that's a real hunting spot too, easy to get a shot in if the deer are on the road)

round notch
#

I'm a vegetarian in B42, I can never catch the things. Takes about 7 bullets to kill a pig

#

I think the dev's need to make animals weaker imo

#

or a mod to do it

silent zealot
#

What are you shooting them with?

#

Please don't say "my freebie starter M9" 😂

worthy cosmos
#

is there a way to add an evolvedrecipe through lua?

silent zealot
#

shotgun for zombies and a .308 rifle with 8x scope for hunting

worthy cosmos
#

setting recipes for an item using :DoParam() doesn't work

silent zealot
#

(link is for B42)

#

lots of get methods but I don't see a lot of set

worthy cosmos
#

yeah that's what i'm talking about

silent zealot
mossy crypt
#

anybody have any ideas on what to do about the game not loading a lua file? i've got three files in the proper folder structure, one main file (working fine) and the other two are "included" using the require function. one of the "included" files loads and works fine, but the other one does not show up in the Lua debugger in game

CRLF is funny, solved

crystal canyon
silent zealot
#

No idea, probably the former - set locatiosn but no every one will be active every game.

crystal canyon
#

anyone know how can I use a tile as a UI icon?

silent zealot
#

Make a copy of it with the name for the UI thingy?

sonic dome
#

I am trying to bring back biofuel mod from b41 by another modder for self-use. I know that this patch introduced new liquid system.

In the old mod, it required 25 units of water like so

    recipe Make Biofuel From Potatos
    {
    Potato = 20,
    Water = 25,
        CanBeDoneFromFloor:true,
    destroy EmptyPetrolCan,
        Category:Cooking,
    SkillRequired:Cooking=6,
    Result:PetrolCan,
        Time:1000.0,
    }

I am trying to add water to the recipe like so

    craftRecipe Make Biofuel From Cabbages
    {
    timedAction = MakingElectrical,
    time = 80,
    category = Cooking,
    needToBeLearn = true,
    autoLearn = Cooking:6,
    skillRequired = Cooking:6,
    tags = AnySurfaceCraft,
    inputs {
        item 20 tags[Cabbage],
        item 25 tags[Water],
    }

Would this work or is there any other way to use water object? Thank you

#

Please ignore timedAction = MakingElectrical as I will change it later to proper value

sonic dome
# sonic dome I am trying to bring back biofuel mod from b41 by another modder for self-use. I...

Ok it seems everything that I did was wrong but I checked other modders' work and corrected the script

module Base
{
    craftRecipe Make Biofuel From Tomato{
        timedAction = MixingBucket,
        time = 80,
        tags = AnySurfaceCraft,
        category = Cooking,
        skillRequired = Cooking:6,
        OnCreate = Recipe.OnCreate.GetBottle,

        inputs {
            item 1 [Base.PetrolCan] flags[IsEmpty] mode:destroy,
            item 1 [25:Base.Tomato],
            item 1 [*],
                -fluid 25.0 [Water],
        }
        outputs{
            item 1 Base.PetrolCan,
        }
    }
}

now my issue is to get 25 liters of water. I already built a rainwater collector and filled it 30 liters of water. When I am next to it, it does not recognize, I think I need something looks for water sources nearby. Any ideas please? Thank you

icy yarrow
#

Fluid system isn’t fully integrated yet

sonic dome
#

Oh I see 😦

#

Well I guess the workaround would be to set the water amount equal to something that can be used like 10 liter or 15 liter and now the recipe seems to work

icy yarrow
#

Could do it say one liter at a time

#

Just return the can amount + added

sonic dome
#

yea that could work also. I am n00b when it comes to modding, any idea how I would do it?

#

also one thing I noticed is that even though there mode:destroy, my original empty petrolcan is not destroyed. Any idea why that might be?

module Base
{
    craftRecipe Make Biofuel From Tomato{
        timedAction = MixingBucket,
        time = 80,
        tags = AnySurfaceCraft,
        category = Cooking,
        skillRequired = Cooking:6,
        OnCreate = Recipe.OnCreate.GetBottle,

        inputs {
            item 1 [Base.PetrolCan] flags[IsEmpty] mode:destroy,
            item 1 [25:Base.Tomato],
            item 1 [*],
                -fluid 10.0 [Water],
        }
        outputs{
            item 1 Base.PetrolCan,
        }
    }
}

opal temple
#

My model uses a custom clothing location, and its position looks odd after equipping it. How can I adjust its position?
It’s a belt, and I want to keep the custom clothing position.

sonic dome
#

Hey @old ginkgo , have you found a solution? I am having the same issue

tranquil kindle
opal temple
tranquil kindle
#

Open xml file of clothing item

opal temple
tranquil kindle
# opal temple

Nope, thats not it, it should be in media>clothing>clothinitems>thatitems xml file, Its name should be on item script " ClothingItem = SteamGirlHat," for example

tranquil kindle
tranquil kindle
opal temple
#

How do I use Blender? chickenEatingHand

tranquil kindle
#

But being serious, It would take me a while to explain. If you never used blender, first get a basic knowledge before you try it. Watch some tutorials on basics + weight painting

opal temple
#

Sorry, I'm still starting from scratch to study the code of this game.

#

I will take a look, thank you!

sonic dome
#

Guys I found why mode:destroy does not work!!

module Base
{
    craftRecipe Make Biofuel From Tomato{
        timedAction = MixingBucket,
        time = 80,
        tags = AnySurfaceCraft,
        category = Cooking,
        skillRequired = Cooking:6,
        OnCreate = Recipe.OnCreate.GetBottle,

        inputs {
            item 1 [Base.PetrolCan] flags[IsEmpty] mode:destroy itemcount,
            item 1 [25:Base.Tomato],
            item 1 [*],
                -fluid 10.0 [Water],
        }
        outputs{
            item 1 Base.PetrolCan,
        }
    }
}

Basically from what I gathered, if you are using objects like battery, candle, propane lantern or pack of stuff (back of beer) you need to use itemcount next to mode:destroy and it destroys the item.

#

@old ginkgoIf you are still looking for solution please see my reply above, I do not know why we need it or what it does but it works 😄

round thorn
#

Hey all, as my day job I program in C++ (used in UE5) but have never touched Lua before, any reccomended learning sources before I randomly pick one? Or just the modding section of the wiki I suppose?

sonic dome
#

Hi it is me again. Sorry for spamming here but now my issue is that I can still use full petrol can in my recipe even though the flag is set to isEmpty. Any idea why that might be? Thank you

Edit:

Found the solution. If you are using a fluidContainer and if it is in Input in a recipe it also needs to have a flag of ItemisFluid;IsEmpty and that fixes the issue. Actually there is a example_recipe in the game folder that explains recipes quite well. The location of the file is Steam\steamapps\common\ProjectZomboid\media\scripts\entities and the name is dbg_example_recipes

nimble badger
#

How can I get a radius action to play audio on use? a dance for example

old ginkgo
sonic dome
#

Yea that is a good way to do it as well. Glad that you figured it out 🙂

hybrid tiger
#

Okay so I wasn’t going crazy

#

I also had a magical jar that wouldn’t go away

sonic dome
#

I suggest taking look at this file from that exists in original game folders. It explains new crafting recipe system well. That is how I learnt

wild canopy
bright fog
#

Is my bet

#

My bet is you did a mistake for the folder structure, as it's not the same as B41

wild canopy
#

i've thrown mod.info and poster.png everywhere as a test. it should only be in the 42 folder for fresh downloads

bright fog
wild canopy
tacit pebble
#

BTW just in case I'm asking, do you have same mod ID both workshop folder and 3396981014?

wild canopy
#

i've removed it from the workshop folder just in case there was a conflict

tacit pebble
wild canopy
#

thx

tacit pebble
#

Is this yours?

#

you missed common folder

wild canopy
#

ah didn't realise that was still needed when it was version specific

tacit pebble
#

yep it can be empty but it should be existed

wild canopy
#

arghsajdgajshdgalhjkredgakildga,shdbasjhdasgdjada

#

and there it is. thanks 🙂

bright fog
tacit pebble
# bright fog Really ?

I've uploaded two mods already and they both needed common folder even i didn't put anything inside of folder.

#

so i guess

bright fog
wild canopy
#

sighs

#

spending 5 minutes resorting the files so they were actually organised per what needed to be version specific would have saved me about 2 hours faffing with this

tacit pebble
#

you should come here earlier XD

wild canopy
#

i dunno, i had fun this morning porting the mod in the first place. first time playing with PZ modding, had to learn the old vs new way of recipes, translate the old ones, then track down why the functionality wasn't working, which was also my first play with LUA

#

actually pretty fun

tacit pebble
#

then you have a potential to be a modder drunk it's same to me, always with pain but acutally, it's fun

wild canopy
wild canopy
bright fog
#

👌

#

It's only been a viable page since I reworked it

#

So trying to push people to check the wiki more now that it's actually useful for modding

wild canopy
#

Still getting an error, but it's from the server-side LUA, which is currently irrelevant. i don't even know what that code is doing...

#

doesn't effect the SP functionality, so I'm just gonna go stove some zombie heads in for now

bright fog
#

Can't find any relevant error in there ?

wild canopy
#

bottom of the full page

tacit pebble
#
function Drops(Item,SpawnMod,Table,Value)
    if Round2(Value*SpawnMod) > 0 then
        for i,v in pairs(Item) do
            for i2,v2 in pairs(Table) do
                table.insert(ProceduralDistributions.list[v2].items, v);
                table.insert(ProceduralDistributions.list[v2].items, Round2(Value*SpawnMod));
            end
        end
    end
end

items return nil

wild canopy
#

i've had a lot of things that used to return objects return nil; that was what i had to fix with thread consumption

#

i've no idea what that function does. without reverse engineering the whole code...i'll just ask the original author 🙂

#

when are containers populated with loot? cell load or first viewed?

bronze yoke
#

when the chunk is loaded

cobalt bridge
#

how to fix items appearing gigantic when dropped on the ground? I saw the same happen in some mods from the workshop

#

I assumed reducing the scale in models_items.txt would work but it seem to be doing nothing

icy yarrow
#

Why people keep asking for new features for a mod that is just basically a bug fix until stuff changes in the unstable

wild canopy
#

because people

#

same reason some ungrateful fuck was bitching about there being no animations in the bag throw mod, and telling the author that it's their problem

icy yarrow
#

Is Dragging modified by fitness or strength? I can't seem to find where in the code it is

sonic dome
#

Thank you everybody. I finally published my first small mod to the workshop thanks to the info that I got from here 🙂

cobalt bridge
icy yarrow
#

Just my simple fix for cleaning rags at the sink until it's all integrated

ancient grail
unreal copper
#

hey, where can you find the folder to change the lighting color for objects like streetlights? and what do you do from there?

autumn temple
#

Anybody know the new crafting system enough to assist me with a question.

opal temple
#

My English is so bad that I didn't recognize what it was at first.

autumn temple
little harbor
autumn temple
crystal canyon
#

It is now 6:22PM the whole country is still in a general blackout. What a great fucking way to say good bye to 2024 and welcome 2025

autumn temple
#

I hope you get power soon

cobalt bridge
#

if I add a clothing item to the lists of procedural loot distribution, do zombies start spawning with said item or do I have to do something else?

autumn temple
crystal canyon
#

as long as it is configured correctly

cobalt bridge
#

alright, thank you

autumn temple
#

I did write a suggestion post about that idea but so far it's been ignored to my knowledge

north rain
#

how do you make it so that a created clothing is able to be used in character creation?

tranquil kindle
#

Though you have to insert them in lua through separate file, because if you copy same thing, you will override it.

north rain
tranquil kindle
#

yes

tranquil kindle
north rain
#

Thank you

tranquil kindle
#

There is only one lua file there in shared, hard to miss it

#

I think you can pretty much reuse it.

tranquil kindle
#

I would appreciate checking out mod too care

north rain
#

ofcourse, i already gave it the like. I suppose i can award it too :)

tranquil kindle
#

No need, but i would for sure love for people to use it(the mod)

mellow frigate
#

Happy steam workshop new year !

#

(wait 6 hours for Kentucky)

crystal canyon
#

yay power back on!!!!

north rain
willow mountain
#

is there anyway to reuse textures that already in game without making hardcoded path?

I need to get moodles icons and if new will be added it will get path too

#

haven't found anything that does this on modding wiki like getTexturePath

#

maybe getSharedTexture is what i searching?

silent zealot
#

You mean without making a copy of the texture in your mod with a different name?

willow mountain
#

i'd like to reuse them but even making a copy is good

silent zealot
#

That's what I've done, but when you're talking about two tiny icons it's not a big deal.

willow mountain
#

i mean i need all moodles icons

silent zealot
#

Just make your own copies, they won't use much space.

#

A lot of the texture stuff seems tied to object names, bu I will be honest I've not looked into overriding that

willow mountain
#

i mean i don't need to copy them all i need it's to get their path like on screenshot but i though there was more clever way to get their path without hardcoding it

#

i know for sure there same textures in MoodlesUI

silent zealot
willow mountain
#

it's not Moodles it's MoodlesUI

bronze yoke
#

moodles are extremely hardcoded, don't expect anything like this

willow mountain
#

dawg

silent zealot
#

Can you get the texture path if you give a name?

bronze yoke
#

most moodle methods are just giant switch statements lol

willow mountain
tranquil kindle
silent zealot
#

you could get the list of all moodle and then if the texture names (not paths) match...

#

Just hardcode the paths and worry about in in B43

bronze yoke
#

iirc at least in b41 they were not actually consistently named

willow mountain
#

Hypothermia = Status_TemperatureLow
Endurance = Status_DifficultyBreathing

#

anyway i think i should then just remain hardcoded paths

bronze yoke
#

i just wouldn't worry about it, they don't add new moodles often at all and it doesn't seem like it would be that much work to update if they did

silent zealot
#

At least they are all in english - it's fun modding a game and finding half the internal objects use spanish names.

#

That was the least of the issues modding Traveller's Rest, but at least it was in C#/Unity instead of half java blackbox

#

It's amazing Zomboid does so well with modding when so much is effectively locked out of being modded.

willow mountain
#

oh wait

#

local testtest = MoodlesUI.minusGreen

and it got texture

aand it doesn't work on other only on

minusGreen
minusRed
plusGreen
plusRed

bronze yoke
#

only public static fields are exposed

crimson ore
#

where do lua files go, non vanilla ones that is

#

obv in lua but do they need to be in any of the subfolders

bronze yoke
#

they must be in client, shared or server

willow mountain
late hound
#

has anyone used the attachment editor in the new build?

#

which makes the tool unsable at that point, breaks the UI

old ginkgo
#

I’ve used it to pretty good success. Not at my PC so I can’t see the text doc what seems to be happening?

late hound
#

(I am trying to fix this orientation issue)

#

then the UI breaks when I get a player model in, then I can't assign a parent for the individual models

grizzled marsh
#

How can I make my mod appear on the 42 build? It doesn't appear on the list when I set the game to the unstable version

umbral raptor
#

Why isn't this working? I'm trying to make TV broadcasts increase the new skills

silent zealot
grizzled marsh
#

I'm just learning how to create models but I had to revert to 41 to be able to test it

crimson ore
late hound
#

@old ginkgo Is there a way to extend/widen the whole sidebar? All my names are cut off. Not really liking this change

grizzled marsh
silent zealot
#

no, you move everything into 42

#

or copy, if you want the mod to still work in B41

#

eg: top level folder, has files left there for B41

#

42 and common have files for B42:

grizzled marsh
#

Oh got it

#

Thanks!!

silent zealot
#

(you can shove it all into 42, using common is not realy helpful yet but will be once more versions of teh game need more mod changes)

tranquil kindle
silent zealot
#

B41 will look in the top level, B42 will look in common, 42, 42.0, and 42.0.2 and use the most specific version of a file it finds.

tranquil kindle
#

42 can be empty, but then your mod will not have poster image when you go to mod manager ingame to select your mod.

silent zealot
#

I think map mods are also fussy and need some things to be in either 42 or common specifically...

#

things like that are bugs and might get fixed, but easy to work arond for now.

grizzled marsh
#

The only thing I wasn't able to do so far was the icon, I placed it at /textures/

silent zealot
#

I need to check the poster thing for my mods... I might need to redo that for the B42 versions. Not a big deal, but I've not aactualy checked to confirm teh poster shows on the mod selection screen.

#

I see why people are saying the second amendment store has too many zombies... this is just stopping near the entry.

#

Some idiot shot up my car with a shotgun while I was dealing with the horde!

late hound
#

so they really broke their own tool huh?

#

fml

#

left image is from 41, right is 42. The sidebar is jacked. No mods enabled.

brittle osprey
#

Did you ever have any luck with this? I'm trying the same thing now specifically for B42 so I can aim guns on steam deck

hidden compass
#

Hello and Happy New Year!

Sorry to ask a very rudimentary question, but is it correct that Global ModData in multiplayer is shared on a per-client basis, so that if multiple clients (=people) are participating in MP, it is not shared between clients, but by multiple players within that client?

Or, in multiplayer, is Global ModData shared by all clients (all characters)?

bronze yoke
#

global mod data is separate for each client and the server

late hound
# late hound so they really broke their own tool huh?
    local ui = EditAttachment:new(UI_BORDER_SPACING+1, UI_BORDER_SPACING+1, getTextManager():MeasureStringX(UIFont.Small, getText("IGUI_AttachmentEditor_RemoveFromScene"))+20, self.height - 100, self) --widest button in the panel is "REMOVE FROM SCENE"
#

why did they do this?

hidden compass
tranquil reef
#

If you use someone's code with their permission to create a new mod, are they able to retroactively take away that permission and DMCA you?

bronze yoke
#

no

#

unless they specifically reserved the right to take away your permission it's indefinite

late hound
#

It makes no sense why they made it so narrow

#

oh my god I can FINALLY read all the data

north rain
#

What's that, an animator?

#

Got so much on the workshop side I got to do until I can finally update my mod with new hoodies and sweaters stressed

crystal canyon
#

Happy new year from the middle of the atlantic!!

icy yarrow
#

Really wish the PZ community would use CC licensing

crystal canyon
#

remote cabins in the middle of the woods with hundreds of zombies?? give me a break!

silent zealot
#

Technically they are working, just with bad data

#

Overall I like it more than B41 with super crowded highways

crystal canyon
#

that part Im happy with

tacit pebble
#

Guys, Someone knows why i can't call function like screen shot?

function: console -- file: MyCar.lua line # 1 | MOD: Did I Have A Car?
LOG  : General      f:2585, t:1735709280760> Object tried to call nil in console

so the console don't wanna call my function?
type print(ZombRand(5)) is fine
type myCarDebug() returns error

actually, all functions inside of MyCar.lua returns same error when i tried to call.

ancient grail
#

i dont believe so

icy yarrow
#

Is it possible to override a timed actions lua?

#

Without just completely replacing it in whatever calls it

ancient grail
crystal canyon
#

sorry, forgot to specify, its for a script, not a lua function

ancient grail
tacit pebble
icy yarrow
#

Unfortunately, it seems the grabbing corpses is deeply nested and would be even messier to try and change it.

#

I'm trying to get the dragging of corpses endurance costs to modified by Strength

#

But it looks like the Lua doesn't seem to change how much endurance is used, just how much calories you are burning

ancient grail
tacit pebble
crystal canyon
#

Can I get a fresh set of eyes and tell me what could be going on with this panel?
I'm getting error:
Callframe at: getComponent
function: render -- file: ISFluidBarrelPanel.lua line # 67 | MOD: Storage Barrels

#

Used ISEntityWindow.lua as base/inspiration

icy yarrow
#

It's not liking your loop

#
    print("Debug: Listing components attached to the entity:")
    for i = 0, self.entity:componentSize() - 1 do
        local component = self.entity:getComponentForIndex(i)
        print("Component #" .. i .. ": " .. tostring(component:getComponentType()))
    end```
crystal canyon
#

it is on an entity

ancient grail
#

found some interesting stuff
bot sure if these are old tho

crystal canyon
#

google auth for servers? interesting

north rain
#

Hey, can anyone check if b42's hoodie hood not showing for anyone else? It not showing for me when I have no mods and fresh reinstall

Nevermind, i got it showing again. the save got messed up and stopped showing the hoods

icy yarrow
#

@crystal canyon I'm not super familiar with how Lua does stuff, but does the component actually exist? I'm not sure if they could have a null entry in that list you are accessing at local component = self.entity:getComponentForIndex(i)

crystal canyon
#

it does, i had run some debug before and got these components

LOG : Lua f:2230, t:1735651433080> ISXuiSkin -> ISXuiSkin -> could not find style for 'ISFluidBarrelPanel', style = '(default style)'...
LOG : Lua f:2232, t:1735651433105> Entity Components:
LOG : Lua f:2232, t:1735651433105> Component #0: SpriteConfig
LOG : Lua f:2232, t:1735651433106> Component #1: UiConfig
LOG : Lua f:2232, t:1735651433106> Component #2: FluidContainer
LOG : Lua f:2232, t:1735651433107> Component #3: CraftRecipe
LOG : Lua f:2232, t:1735651433107> Component #4: Script

icy yarrow
#

Causing an error on the print (referencing my above statement)

crystal canyon
#

so FluidContainer IS part of the components of the entity. Thats what i dont understand

#

I ran this on the code

    -- Debug: Log all components on the entity
    print("Entity Components:")
    for i = 0, self.entity:componentSize() - 1 do
        local component = self.entity:getComponentForIndex(i)
        print("  Component #" .. i .. ": " .. tostring(component:getComponentType()))
    end
ebon dagger
#

So. What are the pitfalls of overwriting base files. I will always try and just expand instead of overwriting, but sometimes, that is impossible.

Other than:

  • When IndieStone updates, it might cause crashes/break the mod
  • If another mod overwrites it too

if the file is a rarely used file, what other drawbacks does anyone see?

crystal canyon
#

I only see those 2

broken halo
#

dying light weapon and clothing pack (i cant believe someone even has to say this) 🙏🏻 please

crystal canyon
#

What's Dying Light? That a game?

tranquil reef
#

do I use perform or stop for an action ending?

grizzled fulcrum
#

If it's Java, those two are the only things I can see that are valid. If it's lua, why not just hook stuff if possible?

crystal canyon
#

Just like this file. Kinda hard for someone inexperienced to add to the Interactions table from an external file because it is local and not global. Someone inexperienced (like me) might just want to overwrite the file completely and add the missing info to the table on the mod

grizzled fulcrum
#

hmm yes stuff like that is impossible to work around without overwriting, but at least make it a global module if you overwrite it

#

well I guess other mods probably wont need to use it anyway?

crystal canyon
#

yeah, unless another mod really needs that file, youre "safe" lol

#

maybe adding it on gameboot?

Events.OnGameBoot.Add(function()
    if Interactions then
        Interactions.BUT = function(_player, _amount)
            doSkill(_player, _amount, getText("IGUI_perks_Butchering"), Perks.Butchering)
        end
    else
        print("Interactions table is not accessible.")
    end
end)
grizzled fulcrum
#

Interactions is local table too no?

crystal canyon
#

yeah

#

but Im sure the devs will add the missing perks at some time in the future, so meh. Its not that important

umbral ingot
#

Anyone know the diff between a Vehicle_X model and a Vehicle_X_NoRandom model?

undone elbow
#

How to find out the class of variable obj?

crystal canyon
#
if obj and obj.getClass then
    print("Class of obj:", obj:getClass())
else

would this work?

#

the ones I see here are getClassField getClassFieldVal and getClassFunction

crimson ore
#

whats the difference between the room defs found within the distro files and the other "empty" room defs. rooms that have a name but nothing associated with them in the files

full escarp
wild canopy
#

Hehehe I just thought of something fun. A bag of devouring. I'll need to bastardise the trash can delete all function, and also add a timer (every hour maybe) so it's useless as a bag. Probably set WR to 0 too. Then I'll need to figure out how to add a right click>feed corpse option.

#

Allow it in a fanny pack slot, and you've got a portable trash can and corpse disposal. Short timed action and upper body fatigue from wrestling the corpse in. Yeah think that'll work.

tranquil reef
#

Does it do anything or does it just eat corpses

undone elbow
#

How expensive is pcall()?

wild canopy
#

I find decorpsing areas tedious.

crystal canyon
#

I guess it has more use now with the corpse sickness having a stronger effect

silent zealot
#

I think having more corpses in an area deteriorates respirator filters quicker too

#

Trying to get into second amendment, and with this many corpses on the floor my brand new filters died after less than an hour.

wild canopy
#

I'd consider it a mini cheat

silent zealot
#

...then triple sprinter suprise got me.

crystal canyon
#

RIP

wild canopy
#

F

silent zealot
#

Related: shooting through chain link fences is very janky

devout bison
#

Happy new year everyone! 🥳

tranquil reef
#

Does "addFluid" not work for modded fluids?

#

oh my god, 30 minutes down the drain and I realize I was trying to add it to the item itself and not the fluid container

crystal canyon
#

😮

bronze yoke
#

it can't actually prevent errors

#

the only time it works is pcall(error) lol

#

in standard implementation lua it isn't terribly expensive so i'd probably expect it to be similar

full escarp
#

is it possible to have B41 and B42 installed at the same time?

crystal canyon
#

I do have them, with a caveat

#

I own PZ in both GOG and Steam. GOG version is in B41, steam B42

full escarp
#

but i can't upload mods with the GOG Version or can i ?

#

its annoying that when uploading a mod from B41 it doesn't allow the B42 Tag

crystal canyon
#

If I were in that situation, I would test the mod in b41 on the gog version, edit the mod, test again, etc then upload it using the steam version. Its weird because both versions of the game share the same data folder

#

so gotta be careful when loading saves. Alternatively you can specify a different folder using a startup option

dusty geode
#

any mods for dogs, cats and any other animal out yet?

undone elbow
#
pcall(function()
  print(x.x.x)
end);
print(123);

prints 123

undone elbow
#

It does not prevent red errors but it's ok because you can always mark your code as bad and drop till end of the game.

local is_fine = true

.....

if is_fine then
  if not pcall(DangerFn) then
    is_fine = false
  end
end
crisp fossil
#

Hi how do search all the items inside the containers worn? I already know how search my inventory by player:getInventory():getItems() but I don't know how to search for items in my bag, fanny pack, etc

silent zealot
#

I suggest looking at the code for proximity inventory

#

That mod looks at everythingin every container and shows it all in one list, so somewhere it will be iterating through all teh possibel containers of stuff

undone elbow
silent zealot
#

oh wait, worn container.s.. nevermind.

#

Turns out it's impossible to shoot a zombie that isn't moving.

#

Their idle animation makes them invulnerable to gunfire.

#

Was trying to work out why some of the aiming system jank was happening, and testing with "invisible" on makes it obvious

trim yacht
#

Is there any way to see if a context menu entry already exists, and if so... add a submenu to it? I am looking to consolidate my mods menus. Here is what I have tried:

function PW:showContext(playerObj, context, worldobjects)

    if isAdmin() or isDebugEnabled() then

        local mainMenu = nil
        -- iterate through all options to try and find the main menu
        for _, v in ipairs(context.options or {}) do
            if v and v.name == mainName then
                mainMenu = v
                break
            end
        end

        if not mainMenu then
            -- there isn't one so create it
            mainMenu = context:addOption(mainName, worldobjects, nil)
        end

        -- add the submenu
        local sub = ISContextMenu:getNew(context)
        sub:addOption(subName, worldobjects, function()
            local player = playerObj and getSpecificPlayer(playerObj) or getPlayer()
            PW.ui.admin.OnOpenPanel(player)
        end)
        context:addSubMenu(mainMenu, sub)
    end

end
undone elbow
#

For syntax highlighting use ```lua instead of just ```

raven eagle
#

Is there a way to remove items that are supposed to be consumed in custome recipes, but are not? Made a recipe for emptying sacks of sand, dirt and gravel... but unsurprisingly these sacks are getting copied. Any way to fix that?

silent zealot
#

I wouldn't bother, that will be fixed in a future update

raven eagle
#

And how many more years of waiting would that be? xD

#

Anyway, would still need a way to get rid of them. kinda pain in the ass to travel to closest zombie (corpose) to deposit them.

silent zealot
#

I expect early next year when they resume work on B42

raven eagle
#

Has it been said it's something they're working on? That bug has been there for quite while

silent zealot
#

The duplication seems a lot worse in 42 to me

raven eagle
#

Well can always hope

trim yacht
# raven eagle Is there a way to remove items that are supposed to be consumed in custome recip...

Not sure if this will help, but its what I do to remove the training disks from Machines mod once used

local allRecipes = getAllRecipes()
local toRemove = {
    ["Train Electrical"] = true,
    ["Train FirstAid"] = true,
    ["Train MetalWorking"] = true,
    ["Train Mechanic"] = true,
    ["Train Tailoring"] = true,
    ["Train Cooking"] = true,
    ["Learn Engineering"] = true
}
for i = 0, allRecipes:size() - 1 do
    local recipe = allRecipes:get(i)
    if recipe:getModule() and recipe:getModule():getName() == "MCH" then
        if toRemove[recipe:getName()] then
            recipe:setRemoveResultItem(true)
        end
    end

end
raven eagle
#

Thanks, I'll give it a try.

#

Just need to make adjustments to work with recipes that cause items to dupe, or does it work as is for most items?

trim yacht
#

I suppose it depends on the reason for the dupe. If the recipe has a result property that you don't want, the above will work. If its just a bug, it probably won't

fading horizon
#

when i set an items' texture with item:getVisual():setTextureChoice(textureChoice), how do i make it reload the visual? Currently i can set the texture, but to get it to actually change, the item must be unequipped and re-equipped

low yarrow
#

What is currently the proper way to add loot to the tables in a non destructive way?
Before it was something like this as far as i know:

table.insert(ProceduralDistributions["list"]["GunStoreShelf"].items, "BCGRareWeapons.ReinforcedBaseballBat");
table.insert(ProceduralDistributions["list"]["GunStoreShelf"].items, 100.0);
#

(Talking about B42)

tranquil kindle
#

I don't think anything changed about inserting into loot tables.

#

I'm doing them exacly like in b41 and it works.

low yarrow
#

Oh i see, thanks.
Then probably the name of the table has changed or something

tranquil kindle
#

Could be, when i was doing clothing for general clothing, some wardrobes were changed, but some old ones were marked as equal to new ones, so it in theory should still work.

low yarrow
#

Ah, Deprecated 😄

fleet bridge
warm yacht
#

Can someone point me in the direction of the drainable script please ❤️

silent zealot
#

What Drainable script is that?

#

B42 drainables are currently bugged and like to drain for no reason when you're not looking.

warm yacht
#

Yeah i am looking for the lines of code, that "define" what a drainable is

silent zealot
#

You mean a drainable item?

warm yacht
#

Yeah, not the delta function tho

silent zealot
#

All the vanilla items are in C:\Games\Steam\steamapps\common\ProjectZomboid\media\scripts\items

#

Drainables will have a "UseDelta" parameter

warm yacht
silent zealot
#

Which is how much gets used per "use" with a full item being 1.0

warm yacht
#

But where would be the amount's

#

Like how does the game determine how full a battery is

silent zealot
#

First , an important thing I think you're missing: when you put a battery in something that battery is gone

#

no more battery item, instead the item you put it in has it's drain level changed

warm yacht
#

Ahhhh

#

So would be causing items to drain on a save reload. The actual main inventory?

silent zealot
#

A bug in the java code.

warm yacht
#

Ahh so it's not going to a be a Lua thing then

silent zealot
#

I saw a fix, but... it was a "download this java file from this random site" and I was not willing to do that

warm yacht
#

Nah F that

silent zealot
#

My guess (based on symptoms only, and could be wrong) is something gets screwed up when objects get saved and reloaded.

#

For now I just play in debug and edit batteries back to full when they should be full.

warm yacht
#

Yeah i think i may have to do the same, well thank you for the talk, informative.

crisp fossil
#

hey guys how do i get the capacity of an ItemInventory. getItemCapacity and getMaxCapacity all returns -1

undone elbow
#

What is ItemInventory?

crisp fossil
#

i mean InventoryItem sorry

bright fog
#

Or you mean it's weight ?

crisp fossil
#

yes the capacity of a backpack but its in ItemInventory right now

bright fog
#

If it's a backpack, then it will give a capacity

crisp fossil
#

omg I ddnt know its a subclass. thank you

bright fog
icy yarrow
#

Wow peach got AuthenticZ updated was not really expecting that until stable. (Edit: Nevermind it just has a build 42 tag without being 42...)

fiery locust
#

How do you have the code detect if a item for example steak is rotten?

bronze yoke
#

food:isRotten()

grizzled marsh
#

Happy new year everyone! Where to place the file for the icon of a new item?

bronze yoke
#

in media/textures/ - keep in mind that whatever you give to the item's Icon = property will have Item_ added to the start of it when it looks for the texture

#

so Icon = MyItem looks for media/textures/Item_MyItem.png

eager imp
#

on the topic of textures where are all the icons at? i look it that folder and i see a ton of them but i need to find all of them

#

specifically food items

grizzled marsh
#

Oh I see, thanks!

#

I was referring Item_ in the file

bronze yoke
eager imp
#

making a practice mod

#

adding raisins

grizzled marsh
#

I have a question that the tutorial I read didn't mention. How do I make my item appear in the world?

#

It is working but I want to set it to spawn in certain places

#

or maybe create a recipe with a magazine

eager imp
#

lord this is frustraiting

#

i cant seem to find an extract option and when i try to open it, it just gives me this

#

ive tried messing with this pack veiwer but it doesnt seem to do anything related to what i need it to do yet

low yarrow
#

Is it technically possible to get the "HatCategory" of the Clothing XML files with lua?

I realized that the game turns Mohawk Hairs into mohawk flat if wearing a hat, makes sense to me and i don't want to delete it with fluffy hair. But i would like to make Bandanas and bandages not be affected by it.

I digged a bit but i havent found a reference about "HatCategory" in the lua code.

The Function i am talking about:

function ISWearClothing:complete()
    if self:isAlreadyEquipped(self.item) then
        return false;
    end

    -- kludge for knapsack sprayers
    if self.item:hasTag("ReplacePrimary") then
        if self.character:getPrimaryHandItem() then
            self.character:removeFromHands(self.character:getPrimaryHandItem())
        end
        self.character:setPrimaryHandItem(self.item)
    end

    if (instanceof(self.item, "InventoryContainer") or self.item:hasTag("Wearable")) and self.item:canBeEquipped() ~= "" then
        self.character:removeFromHands(self.item);
        self.character:setWornItem(self.item:canBeEquipped(), self.item);
    elseif self.item:getCategory() == "Clothing" then
        if self.item:getBodyLocation() ~= "" then
            self.character:setWornItem(self.item:getBodyLocation(), self.item);

            -- here we handle flating the mohawk!
            if self.character:getHumanVisual():getHairModel():contains("Mohawk") and (self.item:getBodyLocation() == "Hat" or self.item:getBodyLocation() == "FullHat") then
                self.character:getHumanVisual():setHairModel("MohawkFlat");
                self.character:resetModel();
            end
        end
    end
    return true;
end
eager imp
icy yarrow
#

Why PZ be renaming stuff...BedroomSideTable -> BedroomSidetable stressed

steep vortex
#

Hiya, what's the appropriate way to reference a newly created item or modify its values?
For example, the following code just uses the default values of result rather than the modified ones when adding extra to the player inventory.

        fillet:setBaseHunger(hunger / filletAmount);
        fillet:setHungChange(hunger / filletAmount);
        fillet:setActualWeight((fish:getActualWeight() * 0.9) / filletAmount)
        fillet:setWeight(result:getActualWeight());
        fillet:setCustomWeight(true)
        fillet:setCarbohydrates(fish:getCarbohydrates() / filletAmount);
        fillet:setLipids(fish:getLipids() / filletAmount);
        fillet:setProteins(fish:getProteins() / filletAmount);
        fillet:setCalories(fish:getCalories() / filletAmount);
        fillet:setCooked(fish:isCooked());
        player:getInventory():AddItems(fillet, filletAmount);```
#

The point of this is to make it so larger fish result in more fillets and the values of the original fish are divided between them

#

But instead it just adds fillets with default values

#

I assume I need to create it then reference it. What's the right syntax there?

#

Oh, found
variable = inv:addItem
Will try that

#

That looks like it's fixed the issue although running into another now. I don't suppose anyone can tell what the issue with the second loop here is please? It's saying that i is an unused local

#
    local fish = nil;
    for i=0,items:size() - 1 do
        if instanceof(items:get(i), "Food") then
            fish = items:get(i);
            break;
        end
    end

    -- Get hunger. Loop. For every 15, make a fillet. If less than 15, turn the remainder into a fillet. Single fish with 8 hunger? One fillet. Fish with 90? 6 fillets.
    -- Divide by 15, use math.floor. Make that amount + 1 fillets. Divide each value by the amount of fillets. 

    if fish then
        local hunger = math.max(fish:getBaseHunger(), fish:getHungChange())
        -- 1-14 hunger: 1 fillet, 15-29 hunger: 2 fillets, 30-44 hunger: 3 fillets, etc.
        local filletAmount = math.abs(math.floor((hunger*100)/15))

        player:Say("+ " .. filletAmount)

        for i=0,filletAmount do
            local fillet = player:getInventory():AddItem(result);
            fillet:setBaseHunger(hunger / filletAmount);
            fillet:setHungChange(hunger / filletAmount);
            fillet:setActualWeight((fish:getActualWeight() * 0.9) / filletAmount)
            fillet:setWeight(result:getActualWeight());
            fillet:setCustomWeight(true)
            fillet:setCarbohydrates(fish:getCarbohydrates() / filletAmount);
            fillet:setLipids(fish:getLipids() / filletAmount);
            fillet:setProteins(fish:getProteins() / filletAmount);
            fillet:setCalories(fish:getCalories() / filletAmount);
            fillet:setCooked(fish:isCooked());
        end
    end
end

CutFish_OnCreate = Recipe.OnCreate.CutFish```
#

Specific issues with for i=0,filletAmount do

#

This loop runs but only once, even if filletAmount is 2 or more

steep vortex
bright fog
#

Where does it error exactly ?

bronze yoke
#

it is unused, that doesn't matter

#

unused locals don't cause errors

steep vortex
#

The loop at the end only runs once even if filletAmount is higher. I assume I'm screwing up Lua syntax although it looks like it matches what it's meant to be to my unaccustomed eyes.

#

Or, at least, it only spawns one item.

#

I'll throw in a say to check if it's running multiple times or just doing weird stuff with spawning

bright fog
#

I suggest adding some prints to verify some of these values

bronze yoke
#

you have a say for fillet amount, is it defintiely more than one then?

steep vortex
#

Currently throwing in a say for the i in the loop to check if it's running the loop multiple times and not spawning properly, or not running the loop multiple times

#

The loop runs properly. One more time than it should, actually. It's just the item spawning that I've messed up

bronze yoke
#

yeah, in lua you should usually count from 1 (so for i = 1, etc)

#

otherwise it does an extra one

#

oh

#

it only happens once because you're not spawning a new item

#

you're just adding and editing the same result item to the player's inventory repeatedly

steep vortex
#

Fiddlesticks. Sorry, would have assumed that a local variable only lives within its loop.

bronze yoke
#

local fillet = player:getInventory():AddItem("Base.WhateverTheFilletItemIsCalled")

steep vortex
#

Thank you very much.

#

And now I feel a little dumb cause that should have been clear that it was by reference

#

Thank you though

#

That's now workly perfectly; thank you

mossy crypt
#

is there any way to programmatically modify the weight of a placeable object? attempting to set the weight based on another value

#

wasn't sure if it was possible with placeable objects. i can see its functional for fillable containers where they have a range of weight based on the contents but not completely understanding how that works or if it applies to what im trying to do

viral karma
#

Does anyone have a list or documentation of the mod changes between b41 and b42 (besides the mod package structure)?
eg. BedroomSideTable -> BedroomSidetable
context: I'm writing a tool to help add b42 support to a mod by automating some tasks (creating 42 folder, modinfo, common) and using ast-grep to check for changes and apply fixes if possible.

bronze yoke
#

one i can point you to is InventoryItemFactory.CreateItem -> instanceItem (global function)

frank swan
#

Hey guys, I need some help if anyone has a chance, I'm so frustrated over this structure.. is this correct? .. ffs..

#

C:\Users\PCNAME\Zomboid\mods\Ashtray_Settings
├── media
│ ├── lua
│ │ ├── client
│ │ │ └── Ashtray-Settings-SandboxVars.lua
│ │ └── server
│ │ └── Ashtray-Settings-Logic.lua
├── mod.info
├── poster.png

#

My mod is literally just to adjust the needed amount of cigarettes... not sure why my server wont load this....

bronze yoke
frank swan
#

yeah im doing it for b41.

#

sweet thank you im happy to hear at least that's right

#

I'm looking in my servers log, and i see this error, what does it mean? WARN : Mod , 1735776075793> 711,796,087> ZomboidFileSystem.loadModAndRequired> required mod "Ashtray_Settings" not found

bright fog
bronze yoke
frank swan
#

sure.

bronze yoke
#

remove the require= line, not sure why you're getting the error you are but it's probably because of that

frank swan
#

I think everything looks good here right? I can't think of what I might have done wrong.

#

10-4 I'll try that

bright fog
#

You have another mod which requires that mod ?

frank swan
#

not at all. I just wanted to make my own mod that allows users to adjust the smoking times. every 30 min irl time or 1 hour ect ect.

viral karma
# bronze yoke i wish i could help you a bit more because your mentioning of ast-grep solves a ...

Thanks! I wanted to update some old (2+ years) mods I started writing but never finished, those depend on some other mods that haven't been updated. Figured I can try writing a tool to help others.
I should be pushing up my work later tonight and will link it here
I'll probably diff the Lua between b41 and b42 and cherry-pick it for changes that happened in the base game, then write a few rules to at least alert people of those changes (like BedroomSideTable and InventoryItemFactory.CreateItem).

frank swan
bright fog
#

Removing it removed the warn ?

frank swan
#

yeah 100%

#

that fixed it! thanks.

bright fog
#

Alright I'll had some bit about it on the wiki

frank swan
#

now I'm just looking into why my mod isn't populating the options into the sandboxvars.

#

yeah ill do a doubletake!

winter bolt
old ginkgo
#

A couple generic freezer spawns were also removed and moved to more specific resteraunt named spawns.

#

I don’t have the list but I ran into a few when making distros for my mod.

icy yarrow
#

Some counter tops were removed. Spiffo ones I think

crystal canyon
#

@wild canopy were you able to resolve the script errors with the recipes in the upgradeable bags mod?

silent zealot
#

I'm going to port the old Item Tweaker API mod to B42, mainly because I want more modders to be aware they can change specific item parameters without replacing the entire item. I also want to add some different API interfaces, because I have the way Item Tweaker works. So my question is: what would you want from a API for tweaking items?

wild canopy
silent zealot
#

My personal preference is just have a function you call with TweakItem("itemname", "parameter", "value")

silent zealot
bronze yoke
#

that api does shit all and causes performance issues and incompatibilities

silent zealot
#

hahahahaha

bronze yoke
#

it was a massive issue a couple years ago

wild canopy
#

When I crank the chance up, I get stuff spawning so they're in the tables, but I've not found any naturally in my latest platform

silent zealot
#

good to know, it did seem to have a convoluted way of doing things

bronze yoke
#

item tweaker is *the* reason so many older modders are now resistant to using dependecnies

crystal canyon
tranquil reef
#

Is there a way to make the player unable to hear a specific sound? So if a mod adds constant screaming in the background or something, individual people can turn it off on their end?

#

Or is this impossible

crystal canyon
icy yarrow
#

Last updated 2015 zombie

bronze yoke
#

shockingly still works, and i'm sure by just moving folders it'd still work in b42 too

silent zealot
#

In that case I'll just make a new API - I find I keep wanting this myself and copy-pasting the same function into mutliple places

icy yarrow
#

Just create your own framework if you want something for all your mods

silent zealot
#

What I really want is for modders to stop redefining entire items to change one value. 😂

wild canopy
# crystal canyon

Hmm not seen that myself. Can you do a test with just the upgrades mod loaded? Not seeing anything there that suggests incomparability but I'm not sure why else it'd be different for you than me

bronze yoke
#

i usually just use raw doparam or write an itemtweaker-esque wrapper if i'm doing it a lot

#

the reason it came into such common usage is just because people didn't know they could easily do it without it

silent zealot
#

Hard to teach when so many existing mods do that so if you look for an example it probably has a copy of the item with one line changed

#

So I don't blame people - that's how I started with personal mods. It works and is easy, until two mods fight over an item.

#
    local x = ScriptManager.instance:getItem(item)
    if x then
        x:DoParam(newparam)
        print("NepTweaks: item updated: "..item.." "..newparam)
    else
        print("NepTweaks: unable to find item "..item)
    end    
end```
#

That's what I've been using

wild canopy
#

Can't even see what the actual cause is in your console. Not that I've got much experience.

bronze yoke
#

i honestly genuinely think encouraging people to copy paste this kind of thing is all we need, it's not so complex that it needs to be a standalone dependency

#

i will say that those prints should be removed in production code though

#

at least the 'everything is okay' prints anyway

silent zealot
#

Agree, and I intend to make that clear in the mod - copy paste the copy to remove the dependency, it's a trivial API

icy yarrow
#

I think people are afraid to look at how other mods do stuff

bronze yoke
#

the prints are why itemtweaker causes performance issues, i remember a big server host found after removing item tweaker's print their server started up ten seconds faster

silent zealot
icy yarrow
#

How often are they restarting their server?

tranquil reef
bronze yoke
#

the BIG issues with item tweaker that caused a lot of modders to move away from dependencies entirely were caused by some mods not just copy pasting the entire mod but then changing the api 😭 breaking literally every other mod that tried to use it

tranquil reef
#

I've seen multiple B42 mods changing things they probably should not be touching for the sake of fixing bugs before TIS does, sounds like a disaster since people use hundreds of mods at a time

silent zealot
#

That will always be the case - best you can do is make your mod as robust as possible and tell peopel to move it to the bottom of the load order.

bronze yoke
#

god i hope they revert the load order changes

silent zealot
#

prefix/postfix function addons are also much better than replacing entire functions, even if replacing an entire function to edit one line in teh middle is often much easier.

#

I can't rmember how it used to work - what changed in the load order?

bronze yoke
#

basically lua files now actually respect load order

icy yarrow
#

My clean rag mod overwrites the base lua, but I really don't care

bronze yoke
#

in b41 lua files from all mods just load alphabetically, in b42 they load per-mod in load order

silent zealot
#

Sounds like a good thing? As long as "require path/to/file" stuff works.

bronze yoke
#

it's a bad thing because now load order is up to the user instead of the mod developer

silent zealot
#

Make a mod load order mod, I've seen those for other games.

#

😂

icy yarrow
#

They need to add a mandatory load after/before like how RW does if load order matters

bronze yoke
#

if it made sense for my file to load as early as possible i'd just give it a name that would alphabetically sort it early, now i have to rely on the user to sort it earliest

silent zealot
#

Rimworld is IMO the pinnacle of good design for modding.

icy yarrow
#

But would probably require rewriting their ingame mod manager

bronze yoke
#

they do actually have this in b42, you can specify mods to force to load before/after yours if they're enabled

icy yarrow
bronze yoke
#

but that requires me to know and list every single mod i need to load before/after

silent zealot
icy yarrow
#

I would kill for a java equivalent of harmony

silent zealot
bronze yoke
#

it doesn't really change anything from the user perspective because nearly everyone thought it worked this way anyway, it's just frustrating for developers now having less tools than before (and i'm not confident they actually changed this on purpose lol)

tranquil reef
silent zealot
#

You only need to specify before/after when it matters, so add it when a problem is found - don't go test everything yourself.

bronze yoke
# silent zealot Just add them as you find issues.

an example of something affected by this is one of my mods reimplements the entire event system for performance as well as extending api, it *must* run before any event handlers are added or it cannot catch those handlers and they'll be invisible to the api

icy yarrow
#

Debating if I should update spoon's mods. Since they stated its up for grabs and they are done modding

silent zealot
#

Wait for someone to post "this mods breaks when mod X is installed"

wild canopy
#

@crystal canyon if you can send me your mod list, I'll look at it tomorrow.

icy yarrow
#

Atleast the stuff that didn't get put in the base game

bronze yoke
#

before i could do this by just prefixing my filename with !!!!, now it's literally impossible for me to guarantee it

silent zealot
#

But now you're not fighting with teh guy who prefixed his filenames with !!!!!

bronze yoke
#

that's fine, he knew what he was doing

icy yarrow
#

Pretty sure most of my 41 mods have been update/have equivaletns except for all the maps and KI5 vehicles

viral karma
#

They should include a priority in the modinfo if the load order is kept
Honestly I think the mod order could be good to help resolve conflicts or for patching, though in its current state nah

bronze yoke
#

to me, b41 was the ideal state where load order rarely actually mattered and was mostly in the control of the mod author

#

in b42 it matters a lot more and (despite the new tools like forced load sequence of specific mods) we have less tools to deal with it

viral karma
#

Looking at client/OptionScreens/ModSelector, the "autoSort" just sorts based on modId comparison

icy yarrow
#

I mean it's not really your fault. Up to the users

wild canopy
viral karma
#

Yeah, tooling is a big thing - the debug tooling is still rough too...

viral karma
bronze yoke
#

if there's anything good to come out of this though, it probably will encourage people to use requires more, and hopefully modules too

icy yarrow
#

It's not like they are having to Wrye bash your stuff with another mod to get them to play nice

silent zealot
#

"If your mod is getting overwritten set priorty to 2147483647 to fix this"

viral karma
#

Maybe priority isn't the right option, but a basic 0-10 with 5 being standard, 0 being "load first", 10 being "load last".
You can't control what other mod authors do, I'm not sure of the moderation around mods.

crystal canyon
wild canopy
#

Thanks

bronze yoke
#

the amount of b41 mods that say 'you MUST put this as late in your load order as possible' despite that not doing anything at all for 99% of mods indicates to me that people will just always set it to whatever gives the most priority

viral karma
#

gotta start breaking shins

silent zealot
#

"Load after other mods that also change <thing>" would be much better advice - that's what I say for mods where order matters (not anything in Zomboid, but happens in some of the things I made for Stalker 2 or Pacific Drive because Unreal engine mods without proper modding tools are just complete replacements of files in the .paks)

crystal canyon
#

strangely, mod load order in zomboid sometimes has an impact on hevily modded scenarios. I got to over 1k mods loaded at same time in b41 one time. was running alright, no major errors or broken things. I used the auto sort in the 41 mod manager and everything was broken lol

silent zealot
#

I cut down the number of mods I have by grabbing the code/changes from trivial mods and putting them in my own personal tweaks mod.

crystal canyon
#

shit, now something broke everything

wild canopy
crystal canyon
#

cant even look at mods screen

silent zealot
mossy crypt
#

im attempting to make a movable object with dynamic weight based on a different value in Lua, but coming up with nothing. my research has led me to setup a set of items in a script with varying weights but setting the CustomItem property changes it to a random radio item (specifically Radio.TvWideScreen)

#

does the CustomItem property only work with the radio object?

wild canopy
# crystal canyon

Argh too much debug spam to open on my phone. I think you've got more problems than just my mod 🙂

crystal canyon
#

thing is that is not letting me disable mods

#

this was after verifying files tru steam

#

a mod I downloaded must be breaking somethig without it being loaded

wild canopy
#

Can you delete the load order file? Don't know how pz handles it if that goes

crystal canyon
#

oh right

silent zealot
frank swan
#

Hey guys, if i want my mod to add it's setting into the SandboxVars.lua for people's server is there another file I have to create in order to do that? or will that automatically happen when my server downloads the mod I created to adjust vanilla values?

crystal canyon
#

I deleted nearly everything from Zomboid user folder

#

ERROR: Mod f:0, t:1735783561481> ChooseGameInfo.readModInfoAux > invalid versionMin: invalid game version "42"

wild canopy
#

Good call, stalker

#

Any idea what mod that's from?

crystal canyon
#

about to perform a search

#

found it

#
name=MontyPythonTV
id=MontyPythonTV
description=Enjoy the best of Monty Python skits and music!
poster=preview.png
icon=icon.png
pack=MontyPythonTV
versionMin=42
wild canopy
#

A worthy mod

crystal canyon
#

looking at the comments of the mod, it is indeed the culprit

wild canopy
#

I'm going to bed. Let me know if you're still seeing errors from the upgrades mod once you're sorted out

crystal canyon
#

I do. Only dynamic backpack upgrade loaded

wild canopy
#

Mmmmmm

crystal canyon
#

you go to bed. Ill check the code and share fixes with you through PM

wild canopy
#

Thanks

#

This is my first foray into both pz modding and lua, so I'd be surprised if I've not ballsed something up

wary veldt
#

someone should make a map with realistic brands like mcdonalds and nike etc

crystal canyon
crystal canyon
tacit pebble
#

ohh so quick XD

crystal canyon
icy yarrow
#

You will need to setup a translation key to get it showing right for any language now

crystal canyon
#

@wild canopy lastly, to solve the issue of the recipe consuming your worn fanny pack, use the flag isNotWorn

wild canopy
#

Where would that flag go?

nimble badger
#

Guys, how to import animation files into zomboid?

wild canopy
#

Think the spaces were the root cause of the issue you were seeing?

tacit pebble
crystal canyon
#

testing my changes and will send you the fixed script

wild canopy
#

Awesome, thanks

crystal canyon
#

witha sort of changelog so you can see what was causing issues

cobalt swift
#

I just got into modding project zomboids so this is all still very new to me but I was wondering what's the proper way of storing data for a specific player that is carried over even after the game is closed, I'm pretty sure it has something to do with Moddata but I don't really know what that does or how it works.

viral karma
crystal canyon
#

sure

tacit pebble
crystal canyon
tacit pebble
#

Another multiple victims from MontyPythonTV 😬

crystal canyon
#

at least my comment is helping others already XD

tacit pebble
#

btw guys you may know "missing dashboard" issue with wrong recipe code, anyone figured out how to find the mod causing the issue?
because log just says it's vanilla, I've been looking for clue but no luck.
function: onSwitchVehicleSeat -- file: ISVehicleDashboard.lua line # 622 | Vanilla


could this be a recipe that causing the issue?

ERROR: General      f:0, t:1735785036863> FluidContainerScript.load           > Sanitizing container name 'Large Bucket', name may not contain whitespaces.
LOG  : General      f:0, t:1735785037016> Load Scripts: Recipe, loadMode = Init
ERROR: General      f:0, t:1735785037017> Recipe.Load                         > Could not assign [key]: 'Result' : 'HearingAid'.
ERROR: General      f:0, t:1735785037018> Recipe.Load                         > Could not assign [key]: 'Time' : '100.0'.
ERROR: General      f:0, t:1735785037018> Recipe.Load                         > Could not assign [key]: 'Category' : 'Health'.
ERROR: General      f:0, t:1735785037018> Recipe.Load                         > Could not assign [key]: 'SkillRequired' : 'Doctor=6;Electricity=2'.
ERROR: General      f:0, t:1735785037019> Recipe.Load                         > Could not assign [key]: 'CanBeDoneFromFloor' : 'true'.
ERROR: General      f:0, t:1735785037019> Recipe.Load                         > Could not assign [key]: 'NoBrokenItems' : 'true'.
ERROR: General      f:0, t:1735785037019> Recipe.Load                         > Could not assign [key]: 'NeedToBeLearn' : 'true'.
crystal canyon
#

yes

tacit pebble
#

I don't have any mods that causing the issue, so it's hard to figure out with Only Console.txt

crystal canyon
#

thats 100% one or all of those recipes causing the dashboard issue

tacit pebble
crystal canyon
#

HearingAid the mod that adds this item

tacit pebble
#

ho HUGE thank you

crystal canyon
#

that recipe is completely broken

eager imp
#

Was working on a practice mod and i lost all motivation til i start scrambling on the bike mod again

#

The bike must be made

ornate sand
#

I'm trying to be clever and get detachable gun magazines to work.
Well they're working real fine with a simple function, but the daggum things won't update unless I manually unequip/re-equip 'em 😄

tacit pebble
ornate sand
#

For my gun mod I want the gun mags to visually go away when a magazine is ejected.
I saw how Hyzo did it, that was really clever.
I thought I'd do it with just one function, and it's working. But I can't get the model to update in real time.

kindred grove
#

Wonder if its possible to mod a hydraulic car stacker for garages

#

My collection keeps growing

ornate sand
#

Is there some sort of list for all the possible Events? Guessworking isn't all that fun 😄

crystal canyon
ornate sand
crystal canyon
#

I have everything I can Bookmarked for ease of access lmao

ornate sand
#

Lmaooooooo that worked perfectly.... Except that now it's in reverse. 😂 Inserting a mag makes the mag disappear and ejecting it makes it appear fml

last bane
#

Hello! so I wanted to make the PZ Discord integration to send in game roleplay chats such as /say messages to Discord too, I use a mod that alters how chat works so I edited it abit to add the following lines (I copied that from "general" channel's code which sends /all messages to Discord)
It actually worked but I can't figure out how to make this actually look like "rubyd115 says, "just testing.."" or even just like rubyd115: /SAY: just testing..
Maybe it's actually pretty easy or impossible but I have 0 experience with coding stuff so got no idea 😅
Can someone help out please?

mossy crypt
#

but if the second option works fine enough, you can use message = "/" .. args.type .. ":" .. args.message

#

that should output it as rubyd115: /say: just testing,,

crystal canyon
#

ServerSend.Command(player, 'DiscordMessage', {
message = "says, " .. args.message,
})

#

If args.message contains "We are being surrounded!", the resulting message sent will be:

says, We are being surrounded!

mossy crypt
#

do keep in mind that the beginning of the message will still be Username: with the colon

last bane
#

Yeahh that should work fine enough until I decide and try to figure out editing that function
Thanks a lot!

open drum
#

heya guys

crystal canyon
#

hallo

open drum
#

i have a problem with a UI mod that im making

#

can anyone help me to solve this problem?

open drum
#
function CostomWuroPanel:onClickItem(atm)
    print("hi",atm)
end```
#

so.. my problem is this

#

i have this scrolinglistbox

#

and when i click on the added names of lists

#

i want it to send the name of item that i clicked to the param. of CostomWuroPanel:OnClickItem(atm)

#

so i can use it to do other function such as addItem to inventory

#

problem is = i dun know how to

#

since (god knows why) setOnMouseDownFunction(self.onClickItem) is written this way not clickItem()

ornate sand
#

I might also have to toss my function in here at some point but I'll let you people help ^ first.
Because currently my no magazine updates perfectly on OnEquipPrimary only.
Adding it to the PressReloadButton Event makes it A) happen instantly and B) in reverse.
I'll take a break and come back later with my almost functioning function. 😄

open drum
#

i used this

#

and ingame the console shows this

#

closure?

tacit pebble
#

use name()

#

not just name

open drum
#

at where?

tacit pebble
#

print("item ", name())

open drum
#

nope, that caused error

tacit pebble
#

oh wait let me see your code rq

open drum
tacit pebble
#

quickly, meaning of closure is something like It's a function. it's not table, not string or not number.
sorry, im at my work now so replies will be late

undone elbow
# open drum
local translated_name = list:get(i-1):getDisplayName()
#

btw translated_name works for UI only

-- it doesn't work for non-English strings:
print(translated_name);
-- it will be something like "???? ??????" in console
open drum
#

which isn't suprising because getName()and get DisplayName() both produce string type output

tacit pebble
open drum
#

yea

#

well lua self.scrollingList:setOnMouseDownFunction(self, self.onClickItem);

#

when i go and see the scrollinglistBox.lua

#

to see how that setonmousedownfunction works

#
function ISScrollingListBox:setOnMouseDownFunction(target, onmousedown)
    self.onmousedown = onmousedown;
    self.target = target;
end```
#

looks like it's not passing any param other than self, and the function

#

so.. it's impossible to pass the info of what's being pressed.

#

so each of these "lists" are considered as its own instances

#

though.. there must b a way to have its name stored somewhere...

mossy crypt
#

setOnMouseDownFunction just defines what the function its gonna run is

#

the parameters for onMouseDown are in ISScrollingListBox:onMouseDown

#

here's where it gets run in onMouseDown

#

so your onClickItem function needs two parameters

vivid imp
#

How do I create a valid mod.info file for a local mod I'm testing without the workshop? Was looking at the pins and apparently the ID entry now requires a WorkshopID, but I don't have one.

ornate sand
vivid imp
#

Hmmmm ok, I just have the ID of "ClothingTest" yet whenever I check it in the game it says "Mod is missing mod.info file"

ornate sand
#

You gotta have the mod.info file in two places (at least).

vivid imp
#

Alright, I have it in the common folder, where else should it go?

ornate sand
#

First one in: workshop/yourmodname/contents/mods/yourmodname
The other one in 42

vivid imp
#

Ok thanks!

ornate sand
#

Allrighty I've got a fresh cup 'o joe and I'm getting ready to either give up and do the no magazine thing the long way around, OR get this function functional.

#
function NoMagazine(wielder, weapon)
  if weapon == nil then return end
    if not weapon:IsWeapon() or not weapon:isRanged() then return; end
    local scriptItem = weapon:getScriptItem()
    local WeaponSprite = scriptItem:getWeaponSprite()

    local AK47 = "Base.AK47"
    if AK47 then
        if not weapon:isContainsClip() then
              WeaponSprite = WeaponSprite .. "_NoMagazine"
        else
              WeaponSprite = WeaponSprite .. "_HasMagazine"
         end
     end
    weapon:setWeaponSprite(WeaponSprite)
end

Events.OnEquipPrimary.Add(NoMagazine);

Events.OnGameStart.Add(function()
    local player = getPlayer()
    NoMagazine(player, player:getPrimaryHandItem())
end)```
#

So that script works, in a way. It updates the weapon model but only when equipping it.
I'd like to have it update the model when the ContainsClip turns one way or the other instead.

tacit pebble
ornate sand
#

No, it's about the weapon model itself changing from a model that has a magazine in it to the model that doesn't have the mag

tacit pebble
#

ugh i thought meaning of sprite is 2d icon. 😛 my bad english

undone elbow
#

@ornate sand you can use ```lua [your code] ```

winter bolt
vivid imp
ornate sand
#

But to confuse us all, weaponsprite actually goes to get a 3D model lol

vivid imp
#

Wait, what? lmao

mossy crypt
ornate sand
#

I am a complete newb to lua too so I have no idea how to answer that.
But the function "works". As in it does replace the weapon model, but only after equipping it.
What I'm looking to make it do is to replace the weapon model as soon as the magazine is ejected/inserted

mossy crypt
undone elbow
ornate sand
#

Visually nothing, but if I eject a magazine and then unequip/re-equip the weapon, then the model changes to the one without the mag.
And the same happens when inserting a mag. Nothing while equipped, but after unequip/re-equip the mag shows up.

undone elbow
ornate sand
#

Cool 😄

wild canopy
#

is this the right way to add multiple flags to a recipe input?
item 1 [Base.Bag_FannyPackBack;Base.Bag_FannyPackFront;DynamicBackpacks.UpgradeCapacityCloth;DynamicBackpacks.UpgradeCapacityJean] mode:destroy flags[IsNotWorn;IsEmptyContainer],

#

potential problem i'm seeing is that it'd work fine for fannypacks, but as the upgrades aren't containers themselves, they might fail the check

ornate sand
#

I guess I could try overwriting the IsEjectMagazine and IsInsertMagazine somehow before I totally give up and do the whole thing the really long way around

undone elbow
# ornate sand Cool 😄

rewritten a bit

local AK47 = "Base.AK47"

function NoMagazine(wielder, weapon)
  -- Need to be sure that it's an item
  if not weapon then
    return
  end
  -- This is an unnecessary check, because we check below if it's AK47
  if not weapon:IsWeapon() or not weapon:isRanged() then
    return
  end
  
  -- Need to be sure that it's AK47
  if weapon:getFullType() ~= AK47 then
    return
  end

  -- Now it's AK47 for sure.
  local scriptItem = weapon:getScriptItem()
  local WeaponSprite = scriptItem:getWeaponSprite()
  if not weapon:isContainsClip() then
    WeaponSprite = WeaponSprite .. "_NoMagazine"
  else
    WeaponSprite = WeaponSprite .. "_HasMagazine"
  end
  weapon:setWeaponSprite(WeaponSprite)
end
tacit pebble
# ornate sand I guess I could try overwriting the IsEjectMagazine and IsInsertMagazine somehow...

You can hook function like this

require "ISUI/ISInventoryPaneContextMenu"
local vanillaPaneContextMenu = ISInventoryPaneContextMenu.createMenu

ISInventoryPaneContextMenu.createMenu = function(player, isInPlayerInventory, items, x, y, origin)

    vanillaPaneContextMenu(player, isInPlayerInventory, items, x, y) -- Load original function first
    
    if isWeapon and instanceof(isWeapon, "HandWeapon") then -- and I will edit this point from original function
        local playersp = getSpecificPlayer(0)
        local playerNumber = playersp:getPlayerNum()
        local playerInventory = getPlayerInventory(playerNumber)
...

So you can edit specific point of the original function without overwrite whole file

tacit pebble
undone elbow
#

```lua - with no space

tacit pebble
vivid imp
#

I must be doing something wrong here, I have this mod.info file in both the main mod directory and the 42.0 folder yet the game keeps saying "Your mod doesn't have a mod.info file"

name=Clothing Test
id=ClothingTest
description=Test for creating a mod.
author=Paddlefruit
poster=poster.png
versionMin=42.0.1
ornate sand
#

is it an actual .info file? because re-naming a .txt file isn't enough.

vivid imp
#

projectzomboid/Workshop/ClothingTest/Contents/mods/ClothingTest

#

Is this a correct file structure?

ornate sand
#

noooonononono.
Users/yourusername/zomboid/workshop

vivid imp
#

Ahhhhhhhhhhh

#

Thanks!

#

Ok yay that worked thanks for the help

wild canopy
#

mod updated. thanks @crystal canyon. Also found a flag for IsEmptyContainer so it won't eat fanny packs that contain items now.

#

where do you see/set what loot tables an item exists in?

#

ah got it

winged cape
#

Stupid question for mod makers.... would it be possible to have a train model that drives on the tracks? and have buildable tracks?

undone elbow
#

Yes

winged cape
#

Is there a mod that already does this?

undone elbow
#

But it's a ton of work.

winged cape
#

I see all the train tracks all over the PZ map, but no like train vehicle or anything related to it

#

I'm surprised noone has made a train for like a Server or something? (like load up a train full of people crash into a barricade shoot the hell out of the fort?)

undone elbow
#

Because all trains were cancelled due to the zombie apocalypse. 🙂

winged cape
#

Steam locomotives can burn anything?

vivid imp
#

Trying to make a simple mod that adds just some pants as of now (not adding a mesh or anything, just a texture), heres the xml code I have for the item

<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel>skinned\clothes\bob_trousers</m_MaleModel>
    <m_FemaleModel>skinned\clothes\kate_trousers</m_FemaleModel>
    <m_GUID>e3e4b0cd-9adb-4b10-8a5a-8da2dcde21f7</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone></m_AttachBone>
    <m_Masks>14</m_Masks>
    <m_Masks>15</m_Masks>
    <m_Masks>7</m_Masks>
    <m_Masks>9</m_Masks>
    <textureChoices>clothes\trousers_mesh\trousers_yasogami</textureChoices>
</clothingItem>
winged cape
#

Like i've seen giant Tiger Tank crashing and breaking stuff, i'm like... where da train at? so i can ram a gate or something... :?

undone elbow
#

In theory, you need only heat to produce steam.

#

Heat and water

winged cape
#

I'm just sayin, ders alot of trees still in the apocalypse... XD

vivid imp
ornate sand
#

Is your GUID unique?

vivid imp
#

Should be, used a generator for it

ornate sand
#

Hmm, I do remember getting a headache and a half adding my military "fannypacks" into the game. Hard to say exactly what's missing/wrong

vivid imp
#
module Base
{
    item Trousers_Yasogami
    {
        DisplayName = Yasogami Pants,
        DisplayCategory = Clothing,
        Type = Clothing,
        Icon = Trousers_White,
        BloodLocation = Trousers,
        BodyLocation = Pants,
        ClothingItem = Trousers,
        FabricType = Cotton,
        Insulation = 0.50,
        WindResistance = 0.40,
        WorldStaticModel = Trousers_Ground,
        Tags = RipClothingCotton,
    }
}
#

Yeah let me tinker around a bit, its good practice for getting used to PZs item systems at least

ornate sand
#

Oh, for one. My packs don't have any masks entries?

vivid imp
#

Hmmm ill try deleting them

#

That didn't seem to do it, maybe deleting the first two lines relating to an actual 3d model might help

#

Hmmmmmm drunk

ornate sand
vivid imp
#

So I figured that you don't delete those two lines entirely, you just delete the 'skinned\clothes\bob_trousers' in between

#

Now I think I just have to fix the texture pointer

ornate sand
vivid imp
#

He is here to save Checktucky

cobalt swift
#

quick question is there a way to make an item invisible in the inventory or that they cant drop it

ornate sand
#

Welp I'll go throw some more **** at the new AnimSets and stop trying to make this nomagazine thing happen. Just for variety of headache, you know?

vivid imp
#

Its good to diversify

tacit pebble
crystal canyon
#

time to stop working on this dang mod and play for a bit

frank swan
#

Hey guys, I'm looking to create a mod that allows users to change the smoking logic in b41, such as the SmokingFrequency,CravingIntesnity, Stressreleif, WithdrawIntensity, ect ect I'd like for the mod to populate into the SandboxVars.lua, do I have to make a scrip in the media folder structure to populate this? or will it automatically pick up when my mod is created? all it would do is pull vanilla values to be able edited for smoking logic. Please @ me

crystal canyon
#

you would need to create a sandbox script it goes in media/sandbox-options.txt

crystal canyon
#

there are various types for the options:
enum
boolean
double
integrer
string

#

then you need to call these sandbox vars in your lua code

crisp fossil
#

crafting threads seems to max at 100, is it possible to bypass that?

silent zealot
#

You mean the slider for how many of something you want to craft?

#

I assume that can be changed in the UI files

ornate sand
#

Finally got the ejecting magazines to work like I want them to but now I got the aim=crash bug 😂
🎶 99 little bugs in the code, 99 little bugs
Take one down, patch it around
42981 little bugs in the code🎶

crisp fossil
silent zealot
ornate sand
#

Yeah no I think it was just B42 unstable trying to scare me off. It happened once, I didn't change anything and it hasn't happened since.
Can't get rid of me that easy gosh darnit!

umbral ingot
#

Does the ScriptManager run all of its parsing and loading OnGameBoot or OnInitWorld?

silent zealot
#

First time I went to Guns Unlimited is was deserted inside. I picked up an M14, hit aim, crash. Load back in, the place was full of the normal number of zombies and I was in the very middle.

umbral ingot
#

Thanks! I'm trying to figure out how to inject new parts into vehicle scripts without overwriting the original to be compatible with other mods.

silent zealot
#

Like Item:DoParam() for vehicles?

#

Let me know if you figure that out.

eternal hound
#

Can someone explain to me how to get a custom animation to work? I've made an xml file pointing to the correct animation file in anims_X and tell the code to play it with self.setActionAnim but my character just throws their arms in the air when the action plays instead of the animation. Error I get is "WARNING: did not find node with condition 'PerformingAction = TestAnim' in player/actions/" in the console

hexed mountain
#

Hi all, is the modding tutorial on the forum is still update?

umbral ingot
# silent zealot Let me know if you figure that out.

I'm not sure what the function does exactly but contextually it sounds like itlol. Vehicles don't have a AddPart() method anywhere so I'm trying to use the FileReader and FileWriter to append my parts to the .txt files and reload the scripts

silent zealot
#

You mean alter the game's script files?

umbral ingot
#

Yes

silent zealot
#

That sounds like a realy bad idea; if anything goes wrong uninistalling the mod won't fix the files.

#

Can't disable it either, because the vanilla files are no longer vanilla

#

Or are you only editing the .txt files in your mod?

umbral ingot
#

Whats the typical flow for adding in content to ensure it doesn't conflict with other mods? If everything goes in MyModule {} zone then it won't overwrite the base files correct? I'm trying to add dome lights to vehicles dynamically without giving a bunch of custom vehicle.txt scripts with domelights because then there would just be a spawn pool with cars with dome lights and cars without yea?

silent zealot
#

Typical flow: have idea, look at what is needed to make it happen, find the Java API lacks what is needed, give up on idea. 😂

umbral ingot
#

LOL

#

im so close

#

Already had to give up swapping shaders in and out for window glow

silent zealot
#

For something like a dome light, I'd expect to see it on modded vehicles and not retrofitted to vanilla.

silent zealot
#

You could look at how the "make armor for vaniila cars" mod works, but I can't rmember the name.

umbral ingot
#

Well it doesn't have a model, and it lacks a real world 3D part. I've got everything plugged in perfecty to the vanilla vehicle creation flow, but in my current implementation if I want every vehicle to have a domelight then I need to manually add the parts the scripts and then I guess collobarate with anyone who wants them in their custom car mods. Maybe its not such a big deal

silent zealot
#

Dome light API for vehicle modders?

blissful urchin
#

Hello everyone

silent zealot
#

Hello!

umbral ingot
#

Need a Parts API for me first 😂

blissful urchin
#

Are there any LUA script provided to customize the sandbox options ? I see that the lua ServerSettingsScreen.lua can be modified to add my own options but I have some error because it relies on the class SandboxOptions that I don't have any control on it. Do you know guys how to create sandbox options easily ? Or should it be done manually without relying on current API ?

silent zealot
#

Add sandbox options to your mod?

blissful urchin
#

Yes I want to add sandbox options to let players customize the mod

silent zealot
#

sandbox-options.txt in the media folder

umbral ingot
#

there is getSandBoxFileWriter, getSandboxOptions, and getSandBoxPresets?

blissful urchin
silent zealot
#

Subscribe to that mod, go to C:\Games\Steam\steamapps\workshop\content\108600\3396742825\ to see the downloaded files

#

Sandbox Options:


option NepHeadlightsNeverDie.HeadlightsEnable
{
    type = boolean, default = true,
    page = NepHeadlightsNeverDie, translation = NEPHLHeadlightsEnable,
}

option NepHeadlightsNeverDie.HeadlightsMinCondition
{
    type = integer, min = 1, max = 100, default = 50,
    page = NepHeadlightsNeverDie, translation = NEPHLHeadlightsMinCondition,
}

option NepHeadlightsNeverDie.DebugMode
{
    type = boolean, default = false,
    page = NepHeadlightsNeverDie, translation = NEPHLDebugMode,
}```
#

use in lua script:
local targetcondition = SandboxVars.NepHeadlightsNeverDie.HeadlightsMinCondition or 50

#

And there's a translation file to give everything names and tooltips in the sandbox options

blissful urchin
#

Thanks will look at it

silent zealot
#

Really easy to do.

#

There is also ModOptions, which I have not played with but puts settings here:

blissful urchin
blissful urchin
bright fog
#

Check that wiki page

silent zealot
#

I guess the proper question is "should it be something set as a property of the world, or something each player can change personally?"

#

People are used to sandbox options for mod options, because in B41 mod options was a mod.

bright fog
#

Mod options are for things that should only impact one client

#

Personal choices

#

Sandbox options are for things that should be the same for every players

#

As such you can have UI customization options as Mod Options