#mod_development

1 messages Β· Page 304 of 1

silent zealot
#

Running slower from clothing placebo - waterproof overalls with a huge speed penalty do nothing.

#

Maybe running faster with sneakers works. I won't check, so you can keep the placebo effect going πŸ˜›

bronze yoke
#

it doesn't

silent zealot
#

You're saying spending $500 on a pair of Nike Placebos was a ripoff?

vast pier
#

Wow so there is genuinely zero reason to use sneakers over military boots

silent zealot
#

no

vast pier
#

that's kinda stupid ngl

silent zealot
#

there is one very good reason:

#

Fashion.

vast pier
#

I don't regret adding discomfort value to boots

bronze yoke
#

fashion takes priority here

#

the upsides aren't that major

vast pier
#

They are for me, I made a mod that makes footwear take durability and I plan to add in negative effects to prolonged dirty/wet socks/shoes

silent zealot
#

feels like a lot of hassle, but on the other hand it would give you a personal pair of boots you care about and would repair when they break instead of just swapping them.

bronze yoke
silent zealot
vast pier
silent zealot
#

Or a Moddata value

vast pier
#

well I mean I did put durability in quotes, it's just whatever value you wanna track

silent zealot
#

I think discomfort is one of the values that gets reset on every game load from the values in the script files, so you'd ave to restore that on game load too.

vast pier
#

or just replace the boots with an identical version that doesn't have that value, and stops trying to track the mod data

vast pier
#

idk anything about it

silent zealot
#

Bad news: items just return discomfort from the script values, they don't have a local value at all.

vast pier
#

that's fine, just replace the item then

#

πŸ‘

silent zealot
bronze yoke
#

it's just a table attached to the object

vast pier
#

as an example, how would I add a tracker to an item?

grizzled fulcrum
#
local mdata = item:getModData()
mdata.SomeVariableToStore = 123
scarlet shore
#

It's probably a good idea to add a creator prefix to whatever you add to moddata to avoid conflict with other mods.

grizzled fulcrum
#

yeah I do this too, it was just a short example

silent zealot
grizzled fulcrum
#

I use a sub-table like

local mdata = item:getModData()[mod_constants.MOD_ID]
mdata.Thing = 123

then you dont have to prefix everything

vast pier
#

?

bronze yoke
#

that only edits the Oreos variable, not the mod data

vast pier
grizzled fulcrum
#

as long as you have an index operation in the statement it will let you add to the mod data like

item:getModData().SomeThing = 123 -- updates correctly
mdata.SomeThing = 123 -- updates correctly

local thing = mdata.SomeThing
thing = 123 -- incorrect
print(thing) -- prints "123"
print(mdata.SomeThing or "nil") -- prints "nil"
grizzled fulcrum
#

ya, its great not having to worry about name conflicts

vast pier
#

I'm not understanding πŸ˜”

grizzled fulcrum
#

you really should try to understand lua better no offense

vast pier
#

😒

#

I am just a pretzel oreo, the fact I have gotten this far is amazing by itself

grizzled fulcrum
#

in the example "function", you are using local to specify a new variable, so instead of updating the prevous Oreos variable it will just create a new one

grizzled fulcrum
vast pier
#

so remove the local in the function and it'll work at intended or?

tacit pebble
bronze yoke
#

it makes much more sense to just do mdata.SaltyOreosStores = mdata.SaltyOreosStores + 1 than repeatedly moving it into and out of a local variable

grizzled fulcrum
bronze yoke
#

you'd also most likely need to retrieve the mod data inside the function, and probably lazy init the value too

vast pier
#

was supposed to be stored not stores πŸ˜΅β€πŸ’«

vast pier
bronze yoke
#

here's an example of how i would use mod data```lua
---@param item InventoryItem
local function updateModData(item)
--get the item's mod data table
local moddata = item:getModData()

--check if our key already exists
if not moddata.SaltyOreosStores then
    --if it doesn't, set it to a default value
    moddata.SaltyOreosStores = 0
end

--increment the counter in the mod data
moddata.SaltyOreosStores = moddata.SaltyOreosStores + 1

end

bronze yoke
#

that's not how object mod data works

grizzled fulcrum
#

its only for global mod data

bronze yoke
#

object mod data is literally just a table

silent zealot
#

<confusing messages removed>

#

I hope my cows breed soon otherwise I'm going to have to write an artificial insemination mod and that means researching things like "how many calories in bull semen" so I can get the fluid stats correct.

grizzled fulcrum
#

object mod data is an object-specific mod data table that can be accessed via thing:getModData() and is usually an item or vehicle.

vast pier
pseudo sleet
#

is it normal for blood to not show up on the hood of the car im working on?

#

i did texture it and all that. and painted the blood onto it

#

but when i activate the blood functions ingame and set them all to 100% it never gets bloody

#

i'm guessing if its all divided in the first place i'm supposed to reassign it somewhere, but i don't know where to do that

vast pier
plush wraith
#

Is it possible to inject Tags into items?

vast pier
#

This one I have adds the FitsKeyRing tag to various items

module Base
{
    item MagnesiumFirestarter
    {
        Tags = FitsKeyRing,
    }

    item Locket
    {
        Tags = FitsKeyRing,
    }

    item PenLight
    {
        Tags = FitsKeyRing,
    }

    item Glasses_Cosmetic_MonocleLeft
    {
        Tags = FitsKeyRing,
    }

    item Glasses_Cosmetic_MonocleRight
    {
        Tags = FitsKeyRing,
    }

    item MilitaryMedal
    {
        Tags = FitsKeyRing,
    }

    item Glasses_MonocleLeft
    {
        Tags = FitsKeyRing,
    }

    item Paperclip
    {
        Tags = FitsKeyRing,
    }

    item JigLure
    {
        Tags = FitsKeyRing,
    }

    item MinnowLure
    {
        Tags = FitsKeyRing,
    }

    item Bobber
    {
        Tags = FitsKeyRing,
    }
}```
#

just be sure to have the txt file named something unique to prevent file overwrites

plush wraith
#

Ah nice, and that doesn't overwrite items so it's save game compatible ya?

vast pier
#

Most params done this way will replace the param, but tags are unique and instead adds to them

vast pier
#

don't need the entire item, just the params you wanna change

vast pier
tacit pebble
vast pier
vast pier
tacit pebble
#
/* Vanilla Script */
    item Lemon
    {
        DisplayName = Lemon,
        DisplayCategory = Food,
        Type = Food,
        Weight = 0.2,
        Icon = Lemon,
        FoodType = Citrus,
        Spice = true,
        DaysFresh = 7,
        DaysTotallyRotten = 9,
        HungerChange = -10,
        ThirstChange = -5,
        Calories = 17,
        Carbohydrates = 5.41,
        Lipids = 0.17,
        Proteins = 0.64,
        CustomEatSound = EatingFruit,
        StaticModel = Lemon_Ground,
        WorldStaticModel = Lemon_Ground,
        Tags = HerbalTea,
    }
myHelloWorldScript.txt

    item Lemon
    {
        Tags = someTags,
    }

then Lemon has Tags = HerbalTea;someTags, ??

plush wraith
vast pier
tacit pebble
vast pier
tacit pebble
vast pier
#

Yeah, idk if it's entirely intentional or not though.
So there may be a future update that breaks mods doing it this way.

#

That goes for any mod tho, so I wouldn't worry too much about it

#

wouldn't be modding an unstable version if you were scared of updates breaking mods

tacit pebble
#

I had another question related.
Do you know what will be happened, will this be also working if I just want to simply overwriting Weight, or should I redefine all params?

myHelloWorldScript.txt

    item Lemon
    {
        Weight = 99,
    }
vast pier
#

Wesch taught me this a couple days ago.
Well they specifically taught me that you can edit params with script and not specify the rest of the params. I learned the tags thing later.

vast pier
#

like normal item scripts

#

changing the module means it will create a new item instead of editing the existing vanilla item

#
{
    item PotForged
    {
        FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
        FillFromLakeSound = GetWaterFromLakeSmall,
        FillFromTapSound = GetWaterFromTapMetalMedium,
        FillFromToiletSound = GetWaterFromToilet,
        Tags = Cookable;HasMetal,
            component FluidContainer
            {
                ContainerName   = Pot,
                RainFactor    = 0.8,
                capacity        = 1.5,
                CustomDrinkSound = DrinkingFromMug,
        }
    }
}```
https://steamcommunity.com/sharedfiles/filedetails/?id=3428502992
tacit pebble
vast pier
#

If I'm not messing with tags and I'm editing a lot of items at once tho, I like to use lua instead

#

as tags are mainly important for recipes

vast pier
# vast pier If I'm not messing with tags and I'm editing a lot of items at once tho, I like ...
local UncomfortableFootWear = { -- List of shoes/boot to add discomfort to
    "Base.Shoes_BlackBoots",
    "Base.Shoes_RidingBoots",
    "Base.Shoes_Wellies",
    "Base.Shoes_HikingBoots",
    "Base.Shoes_ArmyBoots",
    "Base.Shoes_ArmyBootsDesert",
    "Base.Shoes_CowboyBoots_Brown",
    "Base.Shoes_CowboyBoots",
    "Base.Shoes_CowboyBoots_Black",
    "Base.Shoes_CowboyBoots_Fancy",
    "Base.Shoes_CowboyBoots_SnakeSkin",
    "Base.Shoes_WorkBoots"
}
for i=1, #UncomfortableFootWear do -- this gets the amount of items in UncomfortableFootWear, and then does the code below that amount of times
       local ItemName = UncomfortableFootWear[i] -- this would be getting each item from the list one at a time
        local item = ScriptManager.instance:getItem(ItemName) -- Item name references the UncomfortableFootWear[i] which is the individual item in the list
        if item then
    item:Load(item:getName(), 
    [[{

    DiscomfortModifier = 0.1,

    }]])
end
end

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

#

The script I use in trench foot to add 0.1 discomfort to all the vanilla boots

#

editing params this way also makes it so they don't get smudged with the "overridden by mod" text

#

But like I said, this method doesn't work for adding tags for recipes due to lua being loaded too late for recipes.

plush wraith
#

Ahh this works so well TY again @vast pier spiffo

vast pier
#

glad to hear

#

I just realized my first message here was me asking a question about something for a mod I was working on before joining the discord.
Was I just reverse engineering the game or something? I didn't look up any guides or talk to any modders and yet my first question is about a partially implemented mod feature I made??

#

I remember now, I literally joined the discord server because I didn't know how the translation stuff worked. My first mod "Semi Realistic Fluid Containers" was being developed by literally just reverse engineering game files and a mod I had downloaded before losing internet

#

My unlisted test mod upload time vs my first ever message in this server

grand raven
#

Hi mates

Is there any way to add rotten fruits to craft?
Trying it by Base.GrapesRotten
And game just crushes on loading save : /

vague marsh
vast pier
#

that's why I said the script method

#

instead of lua

vague marsh
vast pier
#

If you add tags to items via lua then those tags won't be picked up by recipes that use that tag

vague marsh
vast pier
#

just with special data

#

some items transform into new items when they rot, but most don't

#

yeah it's a boolean value

#

idk how you would check for rotten food in recipes

grand raven
#

Meh
Thx for info

vast pier
#

What are you wanting to use rotten grapes for?

grand raven
#

For wine

vast pier
#

you could maybe do a workaround by creating a new rotten grape and call it Fermented Grapes or something, and have the original grapes transform into that item when they rot

grand raven
#

Wanna use fresh OR rotten grapes πŸ‡

#

Its gonna be to hard for me : (

vast pier
#
    {
        DisplayName = Rice,
        DisplayCategory = Food,
        Type = Food,
        Weight = 3,
        Icon = PotFull,
        BadInMicrowave = true,
        CookingSound = BoilingFood,
        EatType = Pot,
        PourType = Pot,
        ReplaceOnUse = Pot,
        DaysFresh = 1,
        DaysTotallyRotten = 1,
        UnhappyChange = 30,
        Calories = 387,
        Carbohydrates = 100,
        Lipids = 0,
        Proteins = 0,
        StaticModel = CookingPotGround_Fluid,
        WorldStaticModel = CookingPotGround_Fluid,
        Tags = HasMetal,
        HungerChange = -30,
        SoundMap = DumpContents EmptyPot,
        ReplaceOnRotten = SugarBeetSugarPot,
    }```
tacit pebble
#

unless you want to allow only rotten food (Not stale or fresh one)

grand raven
#

That or that

#

Thx!

vast pier
#

If you want the wine to ferment then use

        ReplaceOnRotten = SugarBeetSugarPot,```
to transform it into a new item when it rots
grand raven
#

Thx!!!

vast pier
#
        DaysFresh = 1,
        DaysTotallyRotten = 1,```
I think this means it rots into SugarBeetSugarPot in 2 days
#

not entirely sure

bronze yoke
#

yeah

plush wraith
#

What do I need to call to perform the ClothingItemExtraOption on items that have them?

#

ISInventoryPaneContextMenu.onClothingItemExtra()??

wooden falcon
#

When looking at the decompiled java or the zomboid modding docs website, how can I tell if a particular java class / field is exposed to the lua?

plush wraith
winter bolt
inner cobalt
#

Is it possible to fix the font size in UI?
I want to prevent the font size from changing depending on the option.

bright fog
inner cobalt
bright fog
#

I suggest you check the vanilla code for a bunch of UI, ik I've seen it already, but I don't remember exactly how

inner cobalt
#

I want to prevent the text in the UI I'm writing from leaving the desired location.

bright fog
#

It involves the Font java object, that I know of

bright fog
inner cobalt
#

There are too many UIs to create UI by font size. lol
If I can't find a way, I'm going to make it work only for a specific font size.

wooden falcon
#

When looking at an object in the debugger, is there a way to sort, filter, or dump the columns?

gilded glade
#

I'm wondering if it would be possible to have a mod that keeps the street lights on even after the power cutoff. I really like the ambiance it creates at night and it's a shame I can't experience it as much as I would want to. But I also like the added intensity of looting a pitch black building, so having electricity always on is not an option really.
Since I've never done any mod, I'm wondering if this could potentially be doable with the modding API? I have a background in software engineering so technically it should be ok. I just want to know if it's worth investing time in this as maybe it's not technically possible with the current API.
Do you guys have any idea maybe?

tacit pebble
bright fog
brave bone
#

so me and some friends are making a simple mod , where when near a tent the character wetness should stop accumulating from the rain, but we don't know how to do that LOL* (since we are just a bunch of idiots trying to coding, TOGETHER WE ARE APES!!! lol)* we are kind of stuck and don't know what to do, we manage to make it work but it only resets wetness = 0, but what it should do is stop the wetness accumulation under/near the tent so we can wring it out. can someone check the code?

bright fog
#

You'll have to store the last wetness value and calculate the delta

frank jetty
#

Hey guys

#

I have limited knowledge about the new fluid system and recipes

#

for example, how I can replicate the effect of opening any can or bottle with custom items, so for mods

#

So, like, I know the basic scripting of creating models or items, but I don't know how I can create a proper custom recipe (so it also appears in the context menu) that can convert a "sealed can" already with fluid in it, to a "opened can", where the player then drinks out of it.

Since b42, food and drinks are more separated, now with the fluid and stuff

silent zealot
#

Have a look at the vanilla item scripts.

    item BeerCan
    {
        DisplayName = Beer Can,
        DisplayCategory = Food,
        Type = Normal,
        Weight = 0.3,
        Icon = BeerCan,
        EatType = popcan,
        Packaged = TRUE,
        StaticModel = BeerCan,
        WorldStaticModel = BeerCan_Ground,
        FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
        FillFromLakeSound = GetWaterFromLakeSmall,
        FillFromTapSound = GetWaterFromTapMetalMedium,
        FillFromToiletSound = GetWaterFromToilet,
        Tags = LowAlcohol;HasMetal;EmptyCan;SealedBeverageCan,
        EatTime = 160,

            component FluidContainer
            {
                ContainerName   = CanBeer,
        Opened    = false,
                capacity        = 0.3,
        CustomDrinkSound = DrinkingFromCan,

                Fluids
                    {
                    fluid           = Beer:1.0,
                    }
            }
    }
#

This is where we actually get to see the benefit of the new tags/recipe/fluid system instead of suffering because of it - if you make an item with the same tags/properties then it will get picked up by the "open sealed can" recipe.

#

when opened by the recipe the item's fluidcontainer will be updated, and the displayed name will go from sealed -> open and you can drink from it.

#

No need to make separate items for sealed can, open can and empty can with a decicated recipe for each type of can like you would need to do in B41 (which is why in B41 there was no "open can" step)

brave bone
silent zealot
#

One suggestion: if you attach your code to OnPlayerMove OnPlayerUpdate it will be running constantl checking the surrnding tiles for tents and making API calls to get the wetbness of player and all their clothes.

brave bone
silent zealot
#

You don't need to handle this every frame' wetness isn;t that quick. Either use an event like function like EveryOneMinute or EverTenMinutes

#

or add a very simple tick counter so your code only runs every X ticks

#
local ticksPassed = 0
local runEveryX = 500

local function StopRainAndClothesExposure()
  if ticksPassed < runEveryX  then
    ticksPassed = ticksPassed +1
    return
  end
  ticksPassed = 0
  <expensive code here>
end
brave bone
silent zealot
#

you can also add a player parameter to StopRainAndClothesExposure() instead of using getPlayer(), since OnPlayerUpdate passes the player object of the player being updated. (you already do this for CheckTentState)

#

That way you don't need to worry about what getPlayer() will return when multiplayer is added

brave bone
silent zealot
#

It looks really good for a first mod.

brave bone
#

we just hope it doesnt break saves because jesus christ our lord we dont want that ;_;

silent zealot
#

I don't see any risk of that - you're not changing anything that will get saved.

frank jetty
silent zealot
#

I mean if you just copy the item script for the vanilla item and change the name/fluid inside/etc it should just work.

#

No need to mess around with recipies or lua functions.

frank jetty
#

Nah, I mean I've looked up the vanilla recipe for beercan and beverage yesterday

#

I've somehow read "Beer" for all three

#

I'm not sure, not on my PC rn

silent zealot
#

Here's a quick test; obviously changing the model to use a different texture would make more sense.

module Base
{
    item NepFunCan
    {
        DisplayName = Can of Fun,
        DisplayCategory = Food,
        Type = Normal,
        Weight = 0.3,
        Icon = BeerCan,
        EatType = popcan,
        Packaged = TRUE,
        StaticModel = BeerCan,
        WorldStaticModel = BeerCan_Ground,
        FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
        FillFromLakeSound = GetWaterFromLakeSmall,
        FillFromTapSound = GetWaterFromTapMetalMedium,
        FillFromToiletSound = GetWaterFromToilet,
        Tags = LowAlcohol;HasMetal;EmptyCan;SealedBeverageCan,
        EatTime = 160,

            component FluidContainer
            {
                ContainerName   = CanBeer,
                Opened    = false,
                capacity        = 0.3,
                CustomDrinkSound = DrinkingFromCan,

                Fluids
                    {
                    fluid           = Tequila:1.0,
                    }
            }
    }
}
#

So I should change the ContainerName as well, and add translationd strings

#

But that's the functionality working without any work beyound adding the one item definition

frank jetty
#

ah, I get it now, it was propably because the function name of opening cans is "OpenBeer"

#

and I first thought it was kinda wrong or i missed soemthing looking around

silent zealot
#

There is a lot of stuff like that, where the generic name is the name of the first version that was coded.

frank jetty
#

yeah

#

but

#

would changing its name in the vanilla files break the game?

#

or is it pretty easy to do it?

#

so maybe there will be a patch in the next updates

silent zealot
#

You don;t change any vanilla files, you add a new item

#

Recipes have already been broken twice since B42 came out.

frank jetty
#

ok

silent zealot
#

Don't stress about that, just update when needed.

frank jetty
#

And container name? Is it important to change the name or can I leave it as "CanBeer"?

#

or "CanPop"?

silent zealot
#

You want to change that because it's the displayname

#

Im just confirming now:

frank jetty
#

ok

silent zealot
#

That works

#

The Tequila works too. πŸ˜‚

#

It's not doing the partly-squished-can model when empty, so I assume that is something to do with having a model with special name for when empty.

robust locust
#

Hey peeps, for items that have multple sprites/textures to choose from, whereabouts would i find the code that does the selecting?
eg below

    {
        DisplayName = Electric Guitar,
        WeaponSpritesByIndex = Guitar_ElectricBlack;Guitar_ElectricBlue;Guitar_ElectricRed,
        IconsForTexture = GuitarElectricBlack;GuitarElectricBlue;GuitarElectricRed,
        DisplayCategory = InstrumentWeapon,```
#

i've tried re-making the item to only have 1 weapoon sprite and icon, but it's still changing between black, red and blue

silent zealot
#

There is probably an associated .xml

#

I know that's how clothing works.

#

I seem to be wrong on that, or at least it's not handled the same way.

sleek pebble
#

anyone knows how to fix it i don't know what it means

#

LOG : Mod f:0, t:1739801201851> mod "\VoiceKrysitanChang" overrides media/voicestyles/voicestyles.xml

silent zealot
#

That means your file has the same name as a file in vanilla/another mod.

#

normally you want to avoid that BUT sometimes it is the correct way to make things work, like with translation files

#

Or rubbish like this: mod "\82porsche911" overrides icon.png .

#

No idea if that is an issue with voicestyles.xml, but if all the vanilla voice styles vanish after enabling your mod the first thing to do is rename that file.

robust locust
#

yea im trying to override that item with a modified script item within a base module.
Im using my own models and textures in the folder, which are being used correctly.
I've made my own items for the red and blue variants for both electric and bass guitars. but when i grab a black one, it will often change to a red/blue one.

copper sleet
#

i love you

frank jetty
#

Hey, with everything now applied for my mod, I can't start my game, because it crashes ;/

#
ERROR: General      f:0, t:1739805254164> FluidDefinitionScript.Load          > Unknown block 'fluid' val(JuneBerryFluid) in fluid definition: goenergy.JuneBerryFluid
LOG  : General      f:0, t:1739805254166> [fluid] removing script due to load error = JuneBerryFluid
ERROR: General      f:0, t:1739805254167> ExceptionLogger.logException> Exception thrown```
#

My Code :```module goenergy {
imports {
Base
}
item JuneBerry
{
DisplayName = Goenergy JuneBerry Can,
DisplayCategory = Food,
Type = Normal,
Weight = 0.5,
Icon = JuneBerry,
EatType = popcan,
Packaged = TRUE,
StaticModel = JuneBerry,
WorldStaticModel = BeerCan_Ground,
FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
FillFromLakeSound = GetWaterFromLakeSmall,
FillFromTapSound = GetWaterFromTapMetalMedium,
FillFromToiletSound = GetWaterFromToilet,
Tags = HasMetal;EmptyCan;SealedBeverageCan,
EatTime = 160,
component FluidContainer
{
ContainerName = CanGoenergy,
Opened = false,
capacity = 0.5,
CustomDrinkSound = DrinkingFromCan,

        Fluids
            {
            fluid           = JuneBerryFluid:1.0,
            }
    }
}


model JuneBerry
{
    mesh = JuneBerry,
    scale = 0.005,
    static = true,
    texture = JuneBerryTex,
}
fluid JuneBerryFluid
{
    Color = 0.522 : 0.047 : 0.365,
    DisplayName = JuneBerry

    Categories 
    {
        Beverage,
    }
    
    Properties
    {
        fatigueChange           = -20,
        hungerChange            = -10,
        stressChange            = 0,
        thirstChange            = -20,
        unhappyChange           = -10,
        calories                = 10,
        carbohydrates           = 0.5,
        lipids                  = 0,
        proteins                = 0.5,
        alcohol                 = 0,
        fluReduction            = 0,
        painReduction           = 0,
        enduranceChange         = 0,
        foodSicknessReduction   = 0,
    }
}

}```

robust locust
#
        DisplayName = JuneBerry``` should there be  a comma after the JuneBerry?
frank jetty
#

Oh

#

Bruh

robust locust
#

comma's and brackets are silent killers

#

hope that fixes it

frank jetty
#

yea

#

now it works

#

but I was kinda confused because the debugging said that only the script loading failed

#

and that the entire block was unknown

robust locust
#

noice!
yea the logs can be a little confusing.
always good to keep an eye out for syntax when shit goes wrong, is the cause 90% of the time

slim swan
#

anyone know how to use the isDrawDirty()

#

when the items add or remove frome the itemcontainer , the isDrawDirty() didn't change

frank jetty
#

another question:

#

If I drink my container until it's empty, how can I then make it turn into the item, that was designed as a placeholder for the original Item, if it gets emptied ("Empty XYZ Can")?

#

I have both items in my script rn but I'm just stuck at making the one turn into another when I empty it

mortal escarp
#

Anyone have best practices for multiplayer synchronization? I have a custom timed action that plays an animation, plays sound, and a muzzle flash. This is all client side. I want to ensure all players see these effects though. I can't tell if I should run sendClientCommand() to handle the effects or if I am good the way it is now? I'm also curious about "best practices" here.

robust locust
#

@frank jetty @mortal escarp Sorry, can't help, I don't know anything about either... πŸ˜„

bright fog
bright fog
#

You only need a single item

bright fog
mortal escarp
bright fog
#

But yeah timed actions should be synced

mortal escarp
#

I just figured out the "-nosteam" argument when launching the game, so that is super helpful for testing

bright fog
vast pier
#

neat

pseudo sleet
#

hey guys

#

quick question

#

when working with a vehicle mod do i have to restart the game every time i make a change?

#

or can i just go reload lua via mods tab and open it again

#

ive lost a lot of time to restarting constantly

gleaming wedge
pseudo sleet
#

this should make the tuning process easier

#

if only the loadtimes were faster haha

#

wait actually

prisma imp
#

Anyone know if this is implemented? Doesn't seem to work properly for me and searching in lua folder it is only referenced in the foraging script.

gleaming wedge
# pseudo sleet oh, thanks

for txt in 42 you need to also click "reload lua", and sometimes it's not working good and a restart is better

pseudo sleet
#

noted

#

btw

#

is there a way to open up some debug map that's just flat with nothing on it

#

so i dont haveto load the whole world

#

ik you could do this in stalker and that was very convenient, would be nice if there was something like this here

gleaming wedge
#

no clue on that sorry

pseudo sleet
#

what the hell man

#

horrific

#

how are the TIS devs dealing with the loadtimes every time when trying to debug stuff LOL

prisma imp
gleaming wedge
#

ItemName_EN = {
ItemName_CreditCard_Player = "Personal Credit Card",
}

getText("ItemName_CreditCard_Player")

Someone have a clue why the get text doesn`t return the readable text instead of variable name?

#

i've also tried getText("CreditCard_Player") with no luck

mortal escarp
#

Anyone know how to get "getPlayer():startMuzzleFlash()" working on multiple clients at once? This code is simplified but the final piece I'm dealing with is a player obj and it is calling that exact function. This happens from within a time action. For the user that starts the timed action, they see a muzzle flash. For other clients connected to the game, there is no muzzle flash.

I know this is a client/server type of issue but I am really struggling to solve it.

@bright fog It sounded like you had some multiplayer experience from my question earlier? You have any ideas on how to approach a fix to this?

#

@gleaming wedge I had a very similar issue but it was with Sandbox_EN.txt. I was missing a final trailing comma (","). Looks like you have that though. This is tricky to debug without knowing more. I guess I'd double-check your file structure? I doubt that is the issue if you have even one other translation working though

bright fog
#

I have no idea sry

gleaming wedge
mortal escarp
#

@gleaming wedge This may seem silly but try removing the trailing comma? I don't know man, this looks correct from the outside. Dealing with translation problems is annoying af

#

@gleaming wedge I haven't dealt with this particular translation file but when I compare what you posted to the source translation files in B41, it is a little different. They are using "." character in there instead of "_" characters. I don't know how that would realistically affect anything though.

plush wraith
gleaming wedge
#

WORKED, genius πŸ˜„

vast pier
plush wraith
vast pier
#

For build 42 it should append? not entirely sure for doing it via lua tho

sonic flame
vast pier
#

Cuz if you just wanna add tags to items for recipe purposes, you can use item scripts instead of lua
#mod_development message

sonic flame
#

editing them

#

want to change some inputs/outputs

vast pier
#

Still limited then, yeah

vague marsh
# plush wraith Can you append Tags with this method?

yes, heres an example on how i do it:

local function appendSample()
    if not ScriptManager.instance then return end  -- Ensure ScriptManager exists  

    local item = ScriptManager.instance:getItem("Base.Item")
    if not item then return end  

    local currentTags = item:getTags()
    local newTagsList = {"Tag1", "Tag2"}
    local tagsSet = {}  -- use  set to avoid dup tags  

    -- here we add existing tags to the set  
    if currentTags and not currentTags:isEmpty() then
        for i = 0, currentTags:size() - 1 do
            tagsSet[currentTags:get(i)] = true
        end
    end
    -- add new tags  
    for _, tag in ipairs(newTagsList) do
        tagsSet[tag] = true
    end
    -- convert the set back to a list and update it
    local mergedTags = {}
    for tag in pairs(tagsSet) do
        table.insert(mergedTags, tag)
    end
    item:DoParam("Tags = " .. table.concat(mergedTags, ";"))
end

Events.OnGameBoot.Add(appendSample)
prisma imp
#

How do I refer to every Base.Hat_* etc. item like the world item removal sandbox option seems to do? Got a custom item removal lua working but I'd rather not have to make an entry for every subitem like that.

#

nvm looks like lua has wildcards, testing

silent zealot
#

If you're iterating through all items you can check for name:find("Hat_") to see if the string name contains "Hat_"

#

Or a dozen other ways to do the same thing.

prisma imp
#

    for _, item in ipairs(items) do
        RemoveItemFromDistribution(Distributions[1], item, nil, true)
        RemoveItemFromDistribution(ProceduralDistributions.list, item, nil, true)
        RemoveItemFromDistribution(SuburbsDistributions, item, nil, true)
    end
end

removeItemsFromDistributions(itemsToRemove)```
#

with itemsToRemove being array of strings

silent zealot
#

is RemoveItemFromDistribution a vanilla function?

#

I've never had cause to remove items from distribution.

ancient grail
# mortal escarp Anyone know how to get "getPlayer():startMuzzleFlash()" working on multiple clie...

try to fetch the other player by using getPlayerFromId or something like that
or from.the square
and put the muzzle on that playerobject

see if it works
i mean if you see that the player shows the muzzle flash
tho on their perspective they wont be able to see it

once you acomplish this then just send a command to server and server to client then everyone on the server recives the command that triggers the muzzle flash from a specific player object

vast pier
#

What math is used to determine maintenance xp gain?

silent zealot
#

@prisma imp For converting to a wildcards, do you need it to be done at runtime or would it be enough to get a list of all Hat_ items in vanilla and add that manually to the itemsToRemove list?

hot patrol
silent zealot
#

The spongie skin/character customizer has no nipples, so I made my own.

hot patrol
#

lmao you got to release that

#

I had thought it looked different

silent zealot
#

I'll post it to workshop shortly, probably called "Adult bits of spongie's customiser" or some such.

silent zealot
#

It's been delayed while I spend time trying to add genetalia - a very simple "it's a bit like a vagina" wasn't hard but I have decided that getting a penis that doesn't look like a weird tumor is impossible with the resolution and UV distortion in that area.

prisma imp
hot patrol
prisma imp
#

B42 has new option to do that in sandbox settings but it doesn't work reliably and I wanted to implement my own method mostly to have more customization and ease of use. And to learn Zomboid modding / Lua.

hot patrol
#

oh yea they are actually in the coments fairly recent

silent zealot
#

(sentences I never expected to say)

hot patrol
#

lmao

silent zealot
#

I think it would be much easier to do an erect penis rising up, but I'm not trying to add sexytime bits here... it just threw off immersion whenever I was swapping outfits/wringing out wet clothes and I saw my character with a flat barbie-doll like chest.

hot patrol
silent zealot
#

Ra actually adds a 3d penis model

vast pier
#

PenisTurnAround.fbx

hot patrol
finite scroll
#

oh the chat is talking about naked mods

#

that makes slightly more sense

sharp plinth
#

Mod Manager: Standalone: v1.0.8 https://steamcommunity.com/sharedfiles/filedetails/?id=3422448677

Pretty excited to get this working for my mod manager so I thought to share πŸ™‚

  • Automatic Mod Scanning:
    The tool automatically scans your workshop (or mod) folder to check each mod for required files like mod.info and modinfo.json. It looks for error logs, missing files, and even custom error notes that you might add.

  • Error Reporting & Suggestions:
    If any mod has issuesβ€”like missing files or non-empty error logsβ€”the tool displays detailed error reports. It even provides fix suggestions to help you resolve common problems.

  • Tag Management:
    Each mod can be tagged with statuses such as in progress, bugged, broken, or fixed. You can update these tags through a simple GUI. This helps you keep track of which mods are working properly and which ones need attention.

  • Custom Error Notes:

You can add or edit custom error notes for each mod. This is useful if you need to record additional information or troubleshooting steps that aren’t automatically detected.

  • Discord Webhook Notifications:
    One of the coolest features is the integration with Discord. When you update a mod’s tag to one of the monitored statuses (in progress, bugged, broken, or fixed), the tool sends an embedded message to your designated Discord channel. This means you and your team get real-time notifications about mod issues or fixes!

  • Report Exporting:
    Need a record of what’s happening? You can export detailed error reports to a text file for further review or record-keeping.

  • User-Friendly Interface:
    The entire tool is built with a clean, intuitive GUI so that even if you're not a tech expert, you can easily manage and monitor your mods.

brave bone
#

hello, where can I find resources about wringing clothes for b42?

tacit pebble
# brave bone hello, where can I find resources about wringing clothes for b42?

lua\client\ISUI\ISInventoryPaneContextMenu.lua (Line #2357)

ISInventoryPaneContextMenu.onWringClothing = function(items, player)
    local playerObj = getSpecificPlayer(player)
    items = ISInventoryPane.getActualItems(items)
    for _, item in ipairs(items) do repeat
        if not instanceof(item, "Clothing") then break end
        ISInventoryPaneContextMenu.transferIfNeeded(playerObj, item)
        if playerObj:isEquipped(item) then
            ISTimedActionQueue.add(ISUnequipAction:new(playerObj, item, 50))
        end
        ISTimedActionQueue.add(ISWringClothing:new(playerObj, item))
    until true end
end

and
lua\shared\TimedActions\ISWringClothing.lua (Whole codes)

Especially this one

function ISWringClothing:complete()
    if instanceof(self.item, "Clothing") then
        if self.item:getBodyLocation() == "Shoes" then
            self.item:setWetness(math.min(self.item:getWetness(), 60))
        else
            self.item:setWetness(math.min(self.item:getWetness(), 10))
        end
    end
    syncItemFields(self.character, self.item)
    return true
end
tacit pebble
brave bone
drifting ore
#

common sense mod needs to add the ability for bolt cutters to cut locks off doors (aka just unlocking the doors)

#

only certain doors this would work on mainly the armory doors and stuff that use actual locks

sand blade
#

How to make a sound replacer? I know I can replace the bank file. Just wondering if there is a easier way.

brave bone
#

This timedactions is killing us lol.. our tiny brain....it hurts...

plush wraith
brave bone
plush wraith
#

Np feel free to ask questions if you have em

prisma imp
#

Adding reference to BoobTube (ID for Bandeau) made the AI extension stop working. Thanks "Responsible AI service" D:

undone heron
#

are custom perks still added viva the perks.txt in the media folder?

bronze yoke
#

yeah

autumn sierra
#

anyone happen to know where blood sprays and splatters are controlled? im looking into making blood splatters travel less distance when a zombie is killed

silent zealot
silent zealot
# vast pier What math is used to determine maintenance xp gain?

CombatManager.java:

if (!handWeapon.hasTag("NoMaintenanceXp") && !isoGameCharacter.isShoving() && !isoGameCharacter.isStomping()) {
    float _float = 2.0F;
    if (handWeapon.getConditionLowerChance() > 10) {
        _float = _float * 10.0F / (float)handWeapon.getConditionLowerChance();
    }

    if (GameServer.bServer) {
        GameServer.addXp((IsoPlayer)isoGameCharacter, PerkFactory.Perks.Maintenance, (float)((int)_float));
    } else {
        isoGameCharacter.getXp().AddXP(PerkFactory.Perks.Maintenance, _float);
    }
}
#

that's from processMaintanenceCheck, that gets called from attackCollisionCheck which is a huge function so I'm not going to try tracing out the logic there.

undone heron
#

dang, if you set a custom skill as passive = true, it still doesn't auto set it to level 5 when you generate a new character in B42

prisma imp
#

Uh, if I want to remove jewelry from zombies then I'd have to edit every zombie outfit and look for each GUID?

silent zealot
#

guids are only used for textures/models

#

They're the big string of hexidecimal that looks like 4aea6778-deef-488d-b47c-2576f499aabf

#

Do zombie outfites use those, or do they use lists of items? I assumed they woudl use itemnames

bronze yoke
#

nope, they use the guids

prisma imp
#

pain

bright fog
#

Tho the least intrusive way would be to intercept the zombie visuals

hardy oar
#

Can someone create a mod where HP doesn’t drop to zero but the character can still take injuries, etc.? Without making NPCs in SuperbSurvivor immortal as well. or exist such a mod already? Thanks for any answers

tacit pebble
#

shit im crazy

silent zealot
#

Just disable the other features, and enjoy immortality when you end up swarmed by zombies unable to move while they eat you forever.

bright fog
#

that's cool

silent zealot
#

It perfect for when you want a casual game, no stress about dying. Plus being cursed with immortality in a world devoid of other living humans seems very appropriate.

junior tapir
#

Hi does anyone know why that script doesn't work? I'm not really familiar with lua language but I don't see any mistakes in code nor I don't get any errors in game. I wanted to play a sound when reaching a specific level of skill but LevelPerk event doesn't seem to work...

hardy oar
silent zealot
#

change the funcetion definition to local function LevelPerk(character, perk, level, increased)

#

Even though you called it "level" the first parameter is the player object, which is never going to be == 1

#

You can also replace getPlayer() with character; no need to make anAPI call to get that info when you're being handed the player object.

thick hound
#

are there certain gun mods that have infinite ammo? I mean like, the m4 rifle mod with infinite ammo, but other rifles still have finite ammo

silent zealot
#

None that I know of, but you could make one if you wanted.

#

You can probably attach code to OnWeaponSwing which I think triggers for firearms too, and then "if Item in primary hand is an M4 fill it full of bullets"

junior tapir
silent zealot
#

Glad it was an easy fix!

hardy oar
#

Mark of Cain mod is great, thats what I looked for, but one more question I hope de Npcβ€˜s from the Superbsurvivor mod wont get that perk too?

silent zealot
#

Try it and see.

#

They probably won't get the benefit, because I expect that mod works by doing stuff to the player while survivors are just zombies in disguise.

thick hound
#

Do you know how to make a specific gun that have infinite ammo but the rest of the other guns still have limited ammo?

silent zealot
#

With reloading? Take my mod (I give you permission to use the code) and you'll have to re-combine it with the vanilla code, selecting which bits to run based on the gun being held. Or re-do my changes to vanilla with conditionals. Not trivial, but not too hard if you know some lua and are willing to work through it steadily.

#

Without reloading? Like I said, try a function on the OnWeaponSwing event that refills bullets if the player is holding a gun of the correct type.

thick hound
silent zealot
#

No promises that I did things the best way (I definitely did not!) but you'll at least be able to see all the functions that control the process of getting more bullets into a gun instead of needing to track everything down.

thick hound
silent zealot
#

I'm going to ignore Britas/Gunslinger because they do a lot of crazy stuff to firearms, but in vanilla code there is an assumption that every gun has a number of bullets in it that decreases by one when fired. What you could do is mash some code in so the pistol uses a virtual item (i.e.: one that never gets used outside the pistol) as ammo, and when you hit reload you do something that fills that back up. Maybe you put a battery in and the bullet count gets set to some value based on battery charge. Maybe you can only charge it by hooking it up to a car battery charger for a few hours.

#

And when you remove it, you get a battery with charge based on the remaining bulletcount.

#

I don't think there is any way to change the look of the projectiles though, that's all hardcoded in the java stuff.

#

(I have no idea what Tracer's gun looks like in overwatch, all I know is there was a period of time a few years ago when Tracer cosplay was really popular.)

thick hound
silent zealot
#

Unless you want one battery = one bullet you'd need to so some lua changes to make it work.

vast pier
#

I wish there was a way to remove tags from items for recipe purposes that didn't involve overwriting the item file
cuz wdym a wrench is SmeltableIronSmall but a kitchen knife blade and fillet knife are double the amount of metal with SmeltableIronMedium ?
And why is a kettle SmeltableIronSmall ?
You really tryna tell me a kettle has the same amount of metal as a can opener?

silent zealot
#

I can see a simple sheet-metal kettle being small, they weigh less than a wrench

vast pier
#

nah nvm, even more absurd. Kettle is equal to a spoon

silent zealot
#

but more than a can openers, unless it's a castiron can opener

#

Remember the game is set in an alternate history where zombies are real and chickens weigh three times as much as deer.

vast pier
#

Encumbrance is more of a measurement on how hard something would be to carry, not inherently its weight (I think). But yeah deer should def still be more

thick hound
vast pier
silent zealot
thick hound
#

Thanks in advance, but i have to learn to make the lua script for that

#

I reallyΒ² have no idea for modding like this cz never down into modding

vast pier
#

Everything I know about lua, I learned from modding this game

#

You'll pick it up quickly if you ask the right questions and talk to the right people

#

I wouldn't consider myself great with lua, but that's what the questions are for :P

silent zealot
#

For this, there are so many ways you could do it that have different approaches.

thick hound
silent zealot
#

So decide how you want it to work, start making that happen, and if you realize it would be a lot easier to do it a diferent way instead you can just do that... big advantage of making a mod vs. working professionaly is you're not obligated to stick to the original design.

silent zealot
#

A lot of the time the best help is someone giving you pointers for how/where to get started.

thick hound
silent zealot
#

If it was me, I'd start by first making the gun work using some generic existing ammo

thick hound
#

Like vanilla ammo?

silent zealot
#

That doesn't need any lua, just script files/models/textures

#

Yeah, make it use an M9 pistol magazine or somesuch to start with just to get framework down before changing stuff.

vast pier
#

either make a unique model, or find a vanilla model you feel fits the look you want

vast pier
# vast pier

This is an actual thing btw, those are considered the same amount of metal by the current crafting system

silent zealot
thick hound
silent zealot
#

I'd start with the absolute minimum viable gun mod and make a new gun that is just a copy of an existing one. Then you work in several directions: replacing the model, changeing sound effects, changing gun stats, making new ammo, making the ammo work in a nonstandard way.

#

Probably more stuff I'm forgetting you will see as you go.

vast pier
#

Putting a sawblade on the bat shrinks it to SmeltableIronSmall

silent zealot
#

Don't look at weight/calorie changes when cooking.

#

Just... don't. That way lies madness.

vast pier
#

Putting bolts on the bat makes it impervious to smelting

silent zealot
#

The problem isn't the bolts, it's that you adsed nuts and bolts.

#

And the smelter is allergic to nuts.

vast pier
silent zealot
#

Maybe use encumberance as a way to get the amount of metal produced? Will still be janky, but less janky.

vast pier
#

I think a system like this needs a careful item by item setup

#

The generic small/medium/large setup is why I'm considering this in the first place, cuz it doesn't work

silent zealot
#

What if the smelter had an inventory you put items in, then clicked a button (like "start washing machine" or "turn on stove" in the UI) and it replaced the contents with metal chunks?

#

No more trying to find four matching small items or whatever

vast pier
#

I mean the system I’m proposing wouldn’t need multiple matching items anymore either

#

As the recipe would only check for a single item with the tag, and the outputs would be handled by the lua

#

Like, identically to how dismantling electronics is handled

#

The outputs are still affected by the type of item and the skills of the player, but it’s handled by lua

vast pier
vast pier
#

what does OnTest do

slim swan
#

what code can get the icon name

vast pier
#

laying out some ground work for the idea, may go a different route than lua. Unsure currently

ancient grail
#

anyone knows if spawning items onto containers can be done via server? or just from client?

umbral raptor
#

VGC uses it for example to make sure that your house has a TV and electricity to allow u to play the consoles

ancient grail
fleet bridge
#

or if you know which container it is and that the square is active

ancient grail
# fleet bridge can be done via server using onfillcontainer event

ok thnx
im not really sure what event to use yet, basically i want containers to force spawn items based on schedule
doing server side lua does limit my ability to debug but the code would be shorter since i dont need to send result to all clients iguess

do you happen to know if i use setExplored and im near the container will it auto revert since the player is there? or?
(if setExplored is even responsible for making the contgainers not spaw items)

fleet bridge
#

it will just go back to false

#

or true

#

(whatever the boolean is when someone is in there)

#

if you can figure out a way to set the boolean without someone being inside the bldg you're probably ok

bronze yoke
#

items spawn as soon as the container loads

fleet bridge
#

onfillcontainer is on the loot respawn timer, but as albion points out it only fires when the square is loaded

#

and only if loot respawns in that container too

bronze yoke
#

on the server you can also add items to containers at any time and call sendItemsInContainer(object, container)

#

it doesn't work for corpses though

ancient grail
ancient grail
#

and irc moddata is synced when its saved to containers/tile objects right

fleet bridge
#

you need to transmit the item

ancient grail
ancient grail
#
Commands.object.clearContainerExplore = function(player, args)
    local sq = getCell():getGridSquare(args.x, args.y, args.z)
    if not sq then
        return
    end
    if sq and args.index >= 0 and args.index < sq:getObjects():size() then
        local o = sq:getObjects():get(args.index)
        if o ~= nil then
            if args.containerIndex == -1 then
                local container = o:getContainer()
                container:setExplored(false)
                container:getSourceGrid():getRoom():getRoomDef():getProceduralSpawnedContainer():clear()
            else
                local container = o:getContainerByIndex(args.containerIndex)
                container:setExplored(false)
                container:getSourceGrid():getRoom():getRoomDef():getProceduralSpawnedContainer():clear()
            end
        end
    end
end

#

found this

fleet bridge
#

what does clear() do in this instance?

queen oasis
fleet bridge
honest peak
#

here's a cool mod idea, mineble boulders

ancient grail
ancient grail
queen oasis
ancient grail
#

LuaEventManager.AddEvent("OnExitRoom")

ForceSpawner = ForceSpawner or {}
function ForceSpawner.OnExitRoomTrigger()
   local pl = getPlayer() 
    local csq = pl:getCurrentSquare()
    if not csq then return end    
    local currentRoom = csq:getRoom()
    local lastRoom = ForceSpawner.lastRoom
    
    if lastRoom and lastRoom ~= currentRoom then
        triggerEvent("OnExitRoom", pl, math.floor(csq:getX()), math.floor(csq:getY()), csq:getZ())
    end    
    ForceSpawner.lastRoom = currentRoom
end
Events.OnPlayerMove.Add(ForceSpawner.OnExitRoomTrigger)



Events.OnExitRoom.Add(function(pl, x, y, z)
    local sq = getCell():getOrCreateGridSquare(x, y, z); 
    if sq then
        local flr = sq:getFloor()
        if flr then
            flr:setHighlightColor(1, 0, 0,1)
            flr:setHighlighted(true, true)
            print("OnExitRoom: ")
            pl:addLineChatElement("OnExitRoom: ")
            
        end
        local room = sq:getRoom()
        if room then            
            local def = room:getRoomDef()
            if def then
                def:setExplored(false)               
                local msg  = "isExplored: "..   tostring(def:isExplored())
                print(msg)
                pl:addLineChatElement(msg)                
            end
        end
    end
end)


fleet bridge
#

neat

#

i use OnFillContainer to spawn items and respawn zombies inside of rooms

#

im not quite sure how, but this might be interesting

ancient grail
#

i want to use lootzed version of spawning items
tho theres a sync problem with that

the spawn happens locally or remotely if the player is nearby and also got that container loaded

#

if they are offline or far they wont know that the container spawned lootzed item,, so my idea is to use lootzed only to be able to capture the items that are being spawned, despawn them again then spawn it again

#

weird right ?

#

but what the heck...

vast pier
#

Trying to make it so almost everything is handled by tags I'm setting up myself. Very tedious, but will be far more tuned than the current smelting system. And will instantaneously become obsolete once vanilla smithing is expanded on.
Though the way it seems to be going, I'll probably still make an overhaul anyway as I don't see myself enjoying vanilla smithing once it's complete

sonic flame
#

nah this is good either way

#

support for smelting down jewelry would be neat. zombies as a metal source chefskiss

vast pier
#

Oh it's gonna be more than just jewelry, it's gonna be smelting in general

#

That's just the oncreate for silver, currently doing iron

#

which is probably the largest category

#

for obvious reasons

#

The current idea for smithing is
Extract Metal - Smelt down Metal into workable material - Work the metal - Profit?

#

I'm just hoping it gets done before there's a smithing overhaul lol

#

at least then I have a baseline I can work off of when I want to overhaul whatever forging system they put in place. Mostly cuz I'm ready to be disappointed by it.

sonic flame
#

yeah that's the thing. I have a ton of ideas for 42 after putting some time into it, but a lot of it feels like stuff that will probably be hit by TIS in the short term

vast pier
#

It's also just fun to do πŸ€·β€β™€οΈ

vast pier
#

possibly even more tbh, as with that value then you could theoretically make an iron mask out of 2 forks

#

but I think that issue stems from how cheap some of the forging recipes are

#

It's funny because 2 forks would actually be more expensive than current vanilla, which is equal to 1 fork

#

1 fork = 1 iron chunk = 1 small steel sheet = 1 metal mask

#

It's kinda silly

sonic flame
#

1 fork = 1 steel sheet is wild

vast pier
#

But I think that issue stems from the mask using a small sheet instead of large sheet

#

but yeah 1 IRON chunk turning into 1 small STEEL plate is strange

sonic flame
#

even then, a fork is not going to get you that much metal.

#

feels like something that would benefit from smaller units overall

vast pier
#

I'm thinking fragments either be 3:1 or 4:1

#

even extreme enough, maybe even 6:1

#

4 forks for a chunk of iron sounds more reasonable

sonic flame
#

I'm honestly a fan of higher numbers for the granularity, but it means you have to balance pretty precisely all the way down

vast pier
#

1 chunk = 1 small sheet doesn't make sense still

#

I feel like at minimum you should have to treat the iron to make it steel first

sonic flame
#

yeah but the fork should start out as steel if that's the case

#

idk if I've ever seen a pure iron fork

vast pier
#

Does smelting down steel degrade it and reduce the alloy? Making it more into iron each time? idk

#

The game's implementation of iron vs steel sucks really bad and is hard to work around for stuff like this

sonic flame
#

apparently you can burn the carbon off of steel

#

but that might be industrial complex-level stuff

#

I mean a lot of games do play pretty loosely with iron vs steel

vast pier
#

yeah but this game plays it really really loosly despite having both, it hurts my brain sometimes

#

There are iron bars, and iron rods.
Then there are steel bars, and steel rods.

#

They act identically, other than maybe using them directly as melee weapons

#

crafting wise, they are treated identically

sonic flame
#

the low level wood carving has a handful of cases like that too

vast pier
#

I'm just gonna treat everything that doesn't explicitly state that it's steel, as iron

#

just for my own sake

#

that also will give more emphasis on processing iron into steel for better material crafting

#

so it works gameplay wise πŸ‘

umbral raptor
#

speaking of smelting

vast pier
#

don't even mention the fact that I plan on adding in bronze fragments and try to determine what items use bronze that don't explicitly state it

umbral raptor
#

im adding a mini-furnace to my mod

vast pier
#

oh?

umbral raptor
#

yeah, replaces the forge

vast pier
#

any particular reason?

umbral raptor
#

portable forges?

#

cool feature

vast pier
#

also now that I'm thinking about it, I feel like I should add the option to use cooler burning materials like wood for low heat metals like tin

umbral raptor
#

honestly, it'd be cool to have some alloy system

#

and a mining too

vast pier
#

I'm gonna be adding alloying to a degree for steel, brass, and bronze

umbral raptor
#

imagine making steel from your backyard like a chinese peasent in 1960

umbral raptor
#

if u wanna collab im up for it

#

i can help u

#

looks kinda weird but wont look ig haha

#

its AI generated, pretty awesome

#

it was more HD

#

but i decimated the shit out of it to make it work for PZ's low poly count

#

heres an HD model

#

pretty useful for modding

#

will actually help u alot unlike GPT and other LLMs lol

silent zealot
#

Which AI are you using to generate models?

umbral raptor
#

its pretty rad

#

it understands the image most of the time

#

and generates an HD model

#

sometimes the angle is awkward so it generates pretty shitty stuff

#

but you'll need to do some afterwork in blender

#

mostly decimation and UV mapping

#

you can texture it too on that website

#

but the texture will feel like the model had a small seizure

silent zealot
#

One day IO'll get around to learning how to texture in blender - becasue all my experince if with models for 3D printing I've skipped over texturing.

#

But gotten good at making things actual 3D solid items, given how many broken models I've fixed.

vast pier
#

I meant steel

#

I typed iron

#

they crushed chicken bones into their metal, the carbon from the bones made rudimentery steel. They thought it was chicken spirits

umbral raptor
#

thats interesting

#

but to be fair, thats the difference between the common man making metal and between a veteran blacksmith.

vast pier
#

alloying is gonna be magazine/level locked

umbral raptor
#

chinese peasents picked shitty low-quality iron and made types of steel that couldn't be used in heavy industries, so china ended up with a huge amount of useless low-quality steel

#

plus backyard smelting def will have more defects than factory produced

#

in a factory you could essentially make a roll of steel or steel bars, while in a zomboid smithery you'd be lucky to make a high-quality steel plate (as an average guy)

umbral raptor
#

where you collect various books related to alloying to combine them and make a "Steel-making process" set

#

that the player can then read

#

could be 2-3 books per alloy.

#

can be easily done through recipes

silent zealot
vast pier
#

This is already a tedious mod concept lol

umbral raptor
silent zealot
#

I'm really hoping they add some sort of low quality input -> low quality output modifiers in crafting

vast pier
vast pier
silent zealot
#

Using two rocks to bang metal into shape shouldn't be as good as an anvil and collection of smithing hammers

vast pier
#

Yeah you can handle all of that with OnCreate lua

#

You could if you wanted

silent zealot
vast pier
#

Yeah, tryna get as much of this mod made as i can before the next patch lmao

#

Having everything work and then adjusting to changes as they’re made would be ideal compared to shifting gears in the middle of work

silent zealot
#

They also need to rethink the skill levels needed... they are based on how useful things are in-game, but a sledgehammer isn't exactly a piece of precision crafting.

vast pier
#

How does the reverse engineer recipe work anyway? Do you have to add it or is it automatic?

silent zealot
#

Making a machete from a metal plate is as easy as "cut out machete shape, sharpen edge, wrap something around the handle end.

#

Looks like a property on items.

vast pier
silent zealot
#

eg: gasmask has ResearchableRecipes = MakeCraftedGasMaskFilter;RechargeFilters;MakeImprovisedGasMask,

silent zealot
vast pier
#

Such a significantly higher amount of information access

silent zealot
#

For forging a long swrod where getting the metal composition/crystal structure/etc is important to have something that doesn't break, sure... but if you can make a small knife you can scale that up to a large knife by doing the exact same thing.

vast pier
#

And you also have to consider the process, how do you get from the point of cold metal bar to sharp blade? What tools are needed? How hot does it need to get? How often should you be working the metal before heating it again?

#

You could make it the shape of a machete and sharpen it, doesn’t mean it’s gonna make a good machete

silent zealot
#

Realistically you're never going to run out of industrial crafted metal pieces to use for raw material, so instead of needing to know raw iron -> blade you are reshaping existing steel

#

Just like hobby blacksmiths love railroad spikes.

vast pier
#

Also how do you sharpen things? What is the motion? At what point should you stop sharpening it to prevent breakage? How thin can the metal stay sharp while hitting things and become blunt instead of cracking or chipping?

#

These are all things we can easily look up, or may just already know due to day to day experience on the internet

sonic flame
#

I was thinking the same thing. there's a portion of the population that wouldn't even know what to sharpen a machete with, and then another portion that has no idea how to use something like a whetstone even if they know what it is

silent zealot
sonic flame
#

there's a ton of minor steps involved in these things that are effortless to know right now, and impossible to know in an apocalypse

vast pier
#

The modern internet is genuinely such a large information source that it’s difficult to comprehend just how much of a difference it makes

silent zealot
#

Sure, but zomboid has no concept of "if I know this thing I should be able to also make this very similar thing"

vast pier
#

Like sure somebody taught you that thing, but where did they learn it? Was it another person? Was it a book? How did they meet that person? How did they get that book?

silent zealot
#

You can't even try using duct tape to attach magazines to your arms without a recipe or finding some existing magazine armor.

vast pier
#

Wasn’t that changed to be a level requirement?

silent zealot
#

I hope so.

#

And I hope it's a very low level.

#

(what skill do you even use for "apply duct tape" recipes?)

vast pier
#

Things like that should just be inherently know

vast pier
#

For armour at least

#

You would be surprised how much people dont think about paper as a durable and semi flexible material when packed together because individual papers are so weak

sonic flame
#

time to make the phone book a blunt weapon

silent zealot
#

And to be fair to the source material, ideas like "lets wear sports gear for protection" are only allowed to be used once per TV series and then never spoken of again.

sonic flame
#

the walking dead let them use it for at least like 3

#

also boats and islands are not allowed

silent zealot
#

I just imagine that most survivors are using boats/armor/disguising themselves with blood/etc and having a much easier time of it elsewhere, but the TV series follows the interesting people who refuse to do that.

sonic flame
#

twd is just a show about the idiots lol

silent zealot
#

Reality TV the other survivors watch and laugh at

sonic flame
#

y'all know of anything that uses this mod? it's got like 200k subs so there has to be something

#

found my old highway signs mod and now I'm tempted to pick it back up, but it's pretty reliant on LoadGridsquare

vast pier
silent zealot
#

No idea who they are

sonic flame
#

they wore taxidermy zombie masks and blended in. it was iffy imo

silent zealot
#

I stopped watching when it became "lets sit in our prison base being stupid"

vast pier
#

The walking dead spoilers:
||They disguise themselves as zombies and whisper to the zombies to influence their horde behavior||

sour island
silent zealot
#

"this better work" who makes that sort of comment on a mod?

vast pier
silent zealot
left hedge
#

thinking about making a playlist mod soon for truemusic. anybody with relevant experience have advice

umbral raptor
#

i hated his fucking ass and just stopped watching the show when he did what he did

silent zealot
#

He was the guy just randomly torturing/maiming/killing characters?

umbral raptor
#

you know if you watched

umbral raptor
#

and leather jacket

left hedge
#

i think bob kirkman just kinda sucks drunk

silent zealot
#

That;s teh extent of my Negan knowldge... pretty sure I would have also quit at that point if I'd kept watching too.

umbral raptor
#

he killed some great characters man

silent zealot
#

If you're going to give all the characters plot armor don't randomly take it away for needless shock value

vast pier
#

I think part of why you hate negan is because he lost some of his comic characterization as well

umbral raptor
#

its like the creators said "what should we do to make this season eventful? the fans have been saying the show is getting boring", "let's fucking kill 1/6 or smthin of our current characters!"

#

"fuck yeah"

left hedge
#

the only kirkman property i care about at this point is rick grimes 2000

#

let's just see how dumb it can get

silent zealot
#

||They made Zombie Jesus and then killed him?||

umbral raptor
#

||they made a dude with a lion a king like its game of thrones||

#

tiger*

silent zealot
#

In a complete anarchy anyone can call themselves "king"

#

Then I can call myself Emperor. shrugs

umbral raptor
#

i call dibs on project zomboid

silent zealot
#

I assume whoever this was actually had a power base to back up being a "king"

umbral raptor
#

yeah

#

but it was lame

silent zealot
#

I shall be known as King John Zomboid, First of His Name,

#

Master of Mauldraugh, Ruler of Rosewood, Emperor of Ekron, Prince of Pony Roam'O

vast pier
#

I wish I had been wrong

#

wait omfg I'm so fucking stupid holy shit

#

wait no I didn't do it like that because of steel items, nvm

silent zealot
#

I assume you're classifying steel as iron for purposes of smelting?

#

Or are you keeping them seperate?

vast pier
#

Items that have steel in the name are separate

#

everything else is assumed iron fragments

#

If I was including steel, I wouldn't need 134 entries like this

silent zealot
#

Not the other way? I'd assume most metal things in teh game are steel, not iron.

vast pier
#

Balancing purposes mostly

silent zealot
#

Other than cast iron cookwear, where do you even get get iron objects these days?

vast pier
#

This is going to extend beyond just smelting, so having them separate will make sense

#

smithing in general

silent zealot
#

...and also does having steel do anything having iron doesn't, because in vanilla they seem 100% interchangable for crafting.

vast pier
#

Well that's why I said it's gonna go beyond that. I plan on making improvised weaponry and armour account more for the material it's made of

#

It's going to be a long process

silent zealot
#

makes sense, especially for anyone bootstrapping on a wilderness playthrough.

#

If you dig up raw ironstone you're in the iron age, not steel age

#

MEanwhile I've been taking cars apart and have more steel than I will ever need.

vast pier
#

Iron is gonna be the baseline material, so having it be the most common material you come across makes sense.

silent zealot
#

yeah, adding bronze age stuff would be silly

vast pier
#

I mean it will certainly be an option, but will mostly serve as a trophy type thing

#

like how you can make gold and silver masks in vanilla, but why would you do that

silent zealot
#

we already have stone/bone/wood era tech.

vast pier
silent zealot
vast pier
#

also, why are they three recipes instead of one recipe using the new item mapper thing?

silent zealot
#

Probably written before item mapper was a thing and not updated.

modern garnet
#

Hello guys someone here know where i can find the craft code of Refill a BlowTorch in the game ?

vast pier
#

The thing I'm the least looking forward to is implementing retextured armour/weapons

umbral raptor
modern garnet
#

thx

vast pier
silent zealot
#

(I use powershell to look for strings in all the lua & txt files to help find stuff like this)

silent zealot
vast pier
# modern garnet Hello guys someone here know where i can find the craft code of Refill a BlowTor...

scripts\recipes\recipes_metalWelding.txt craftRecipe RefillBlowTorch { timedAction = Welding, Time = 50, OnCreate = Recipe.OnCreate.RefillBlowTorch, Tags = InHandCraft;Welding, category = Metalworking, inputs { item 1 [Base.BlowTorch] mode:destroy flags[NotFull;ItemCount], /*item 1 [Base.RubberHose] mode:keep,*/ item 1 [Base.PropaneTank] flags[NotEmpty], /*item 1 tags[OxygenTank] flags[NotEmpty],*/ } outputs { item 1 Base.BlowTorch, } }
lua\server\recipecode.lua

-- Fill entirely the blowtorch with the remaining propane
function Recipe.OnCreate.RefillBlowTorch(craftRecipeData, character)
    local items = craftRecipeData:getAllConsumedItems();
    local result = craftRecipeData:getAllCreatedItems():get(0);
    local previousBT = nil;
    local propaneTank = nil;
--     local oxygenTank = nil;
    for i=0, items:size()-1 do
       if items:get(i):getType() == "BlowTorch" then
           previousBT = items:get(i);
       elseif items:get(i):getType() == "PropaneTank" then
           propaneTank = items:get(i);
--        elseif items:get(i):hasTag("OxygenTank") then
--            oxygenTank = items:get(i);
       end
    end
    result:setUsedDelta(previousBT:getCurrentUsesFloat() + result:getUseDelta() * 30);

    while result:getCurrentUsesFloat() < 1 and propaneTank:getCurrentUsesFloat() > 0 do
--     while result:getCurrentUsesFloat() < 1 and propaneTank:getCurrentUsesFloat() > 0 and oxygenTank:getCurrentUsesFloat() > 0 do
        result:setUsedDelta(result:getCurrentUsesFloat() + result:getUseDelta() * 10);
        propaneTank:Use();
--         if oxygenTank then oxygenTank:Use(); end
    end

    if result:getCurrentUsesFloat() > 1 then
        result:setUsedDelta(1);
    end
end```
modern garnet
#

thx

vast pier
#

you need both the script and lua, idk if it calls for any other parts in recipecode.lua

silent zealot
#

Would be nice if everything using "item.blowtorch" was replaced with "tag:blowtorch" so I could make a bigger, heavier blowtorch.

#

Mainly so it could hold more fuel without feeling like cheating lots of fuel into a tiny handtorch.

vast pier
vast pier
# vast pier

This isn't everything btw, this is just everything that had one of the existing smeltableiron tags

#

I still have to go through and group them into sizes to tag them with lua for crafting purposes

#

No I couldn't have used the existing smeltable iron tags. You ask why? Aluminum foil would be included in that list if I did.

#

same with steel

#

I could have for the smeltableironlarge tag, but that's only 6 less items on that list

#

Yeah that's right. 136 items on that list, only 6 are considered large amounts of iron

#

in vanilla at least

vast pier
#

I have two choices, change the display name of the tinfoil hat, or have a random person comment on my mod "why does the TIN foil hat smelt into aluminum?"

sonic flame
#

"America" is a perfectly acceptable response

vast pier
#

I might unironically make a mod that literally just changes the display name of the hat to aluminum foil hat

#

or just foil hat

#

probably foil hat

#

Hate to get side tracked, but I'm gonna do that right now.

sonic flame
#

that's the level of nitpicking that I respect

vast pier
#

that's the level of nitpicking that gets you put in those qol immersive mod collections with like 10k mods that conflict with each other

sonic flame
#

it's not a good collection unless I have to restart the server every 8.5 minutes for updates

vast pier
#

fuk u, this is kentucky

sonic flame
#

americans sometimes call it tin foil too

silent zealot
vast pier
#

yeah it's dumb, that's part of what inspired me to make this mod

vast pier
sonic flame
silent zealot
sonic flame
silent zealot
#

Or two mods makes conflicting changes... I've got two mods fighting over jackets right now, so they look completely different when you open/roll up sleaves and swap from the "better looking vanilla version" to "Pongies' version with options.

vast pier
#

Okay to make this not completely a meme mod, should I also make it so you can turn the foil hat back into aluminum foil?

#

cuz you can't in vanilla

teal nacelle
#

I'm thinking of making an edit of TOC just for me and a server I'm in (just so you can use rifles and shotguns slowly instead of dropping them, because irl you can operate most long guns with one hand)

Does anybody know about the code of TOC that can help?

vast pier
#

what is toc

teal nacelle
#

The Only Cure

vast pier
#

ah

teal nacelle
#

I've seen videos of people doing training drills to reload rifles one-handed, it's very possible

#

And you can definitely fire them one-handed

vast pier
#

I could've sworn I used a shotgun as an amputee last time I played with TOC

teal nacelle
#

I think there's a mod that allows you to use a vanilla sawn off double barrel

#

But that's it

vast pier
#

Maybe it was brutal handiwork or advanced trajectory that was indirectly making me able to operate it one handed

teal nacelle
#

I guess I could try it

vast pier
#

I know something was letting me use a shotgun one handed

teal nacelle
#

I think I found the block of code that makes you drop stuff when it's two-handed

#

I could just delete it but that'd also make you able to use two-handed melees

#

Which isn't what I want, just guns

vast pier
#

check brutal handiwork, it makes it so you can fight with your left arm if you lose your right arm

#

might be related

teal nacelle
#

Yeah, I know about that

#

Must have for TOC tbh

#

My character got a laceration on his left upper arm because my computer bugged out and there was nothing I could do by the time a zombie was on me

vast pier
#

If that doesn't let you, then check advanced trajectory. Which I don't know why you wouldn't be using that in b41

vast pier
#

tragic

teal nacelle
#

It went to like

0.0005 fps

#

For like 20 seconds

#

Zombie lacerated my arm and when last I saw it, it was like 40 feet away and barely visible

#

I can't make a prosthetic

silent zealot
vast pier
#

Just have to add the translate file for the recipe and then ship it out

silent zealot
teal nacelle
#

Multiplayer

silent zealot
#

ah, well if you can get the server admins to install a mod you make for single-handed gun use you can get an extra bit of code to regrow your arm. πŸ˜›

teal nacelle
#

Lmao

#

I'm just gonna roll with the punches and make it possible to use the gun one-handed

teal nacelle
vast pier
teal nacelle
#

The most complex mod I've made was a sensory overload trait that makes the character gain stress and panic from loud noises

vast pier
#

could you hear sounds

teal nacelle
#

Nope

vast pier
#

ah, idk then

#

just bad luck

teal nacelle
#

Just froze at the sound effects it was using before

#

Playing them on loop

teal nacelle
#

Yea, I'm just explaining why I asked for help

silent zealot
#

No probs, we can help - at least point you in teh right direction wehere possible.

teal nacelle
#

I deleted the block of code that takes 2 handed weapons into account, gonna see what happens

#

I cut it so I can paste it back if it causes a catastrophic error

silent zealot
#

What would need to be changed...

  • TOC not letting you hold two handed guns
  • reload speed (big penalty?)
  • aiming penalty
    is that all or am I missing some obvious things?
teal nacelle
#

Yeah

#

Reload speed would probably be half or 40%

#

Because the videos I've seen of people reloading rifles one handed isn't too slow

vast pier
#

I'm pretty sure TOC increases the time to complete any timed action anyway

#

so should still be covered

teal nacelle
#

I may try adding custom animations for stuff like racking a shotgun some day, but for now I'm just gonna let the character use the gun using normal animations

silent zealot
#

If not, check out ISReloadWeaponAction.setReloadSpeed()

vast pier
#

I still say you should see if advanced trajectory does what I was experiencing

#

It's a must have for 41 imo anyway

teal nacelle
#

I'm using the realistic overhaul, might be different

#

The server is too

vast pier
#

ah I think that's an entirely different mod, not entirely sure

#

Almost forgot to change the vanilla recipe name too

#

It's funny cuz this is actually an indirect buff to aerosol bombs

#

Since it adds another method of obtaining aluminum for the recipe

silent zealot
#

Hopefully it's a nice standalone-ish function and not embedded in the middle of something huge

teal nacelle
#

It's connected to the function that forces you to drop something in the amputated hand

#

It's called "take two handed weapons into account" or something akin to that

silent zealot
#

It might be as simple as a prefix that says "if weapon is two handed gun then return" that skips the rest of the function.

vast pier
teal nacelle
#

Can't get it to appear in my modlist

vast pier
teal nacelle
#

What, The Only Cure?

#

I'm talking about my edit-

vast pier
#

oh my bad

#

xd

teal nacelle
#

You're good lol

#

Forgot to change the mod id, I'll try it again

vast pier
#

For reference, aluminum not tin wouldn't show up for you either since you're playing build 41 so I thought it was about that

teal nacelle
#

Switching from workshop to mods fixed it

tacit pebble
#

I just realized we can't wrap foods with foil

#

πŸ€”

vast pier
#

who needs to when you can stuff everything into a freezer

tacit pebble
#

for my long trip with stale foods? idk how other country does but for me, I use foil for my lunch when it's summer. we eat rice, and rice will be easily stale when it's too hot.

left hedge
#

al you min yum

teal nacelle
#

The gun is upside down for some reason

silent zealot
teal nacelle
#

Yeah

silent zealot
#

Are you going to get the server and all players to install your custom version of The Only Cure, and keep it updated whenever TOC updates?

orchid quiver
#

Hi! I was wondering how could I make my mod generate a random number that is the same for all players in a server with this code:

        randomDailySprintTime = ZombRand(23);
        lastDay = day;
        soundPlayed = false;
    end```
maiden zinc
#

Well. this is certainly... a little bit overwhelming iara_think_thonk

teal nacelle
#

Probably, yeah

I could just send it to the server's discord or something

#

I don't know if the host is down to use it, if not it's still good for personal use

#

How exactly would I go about sending it to them to apply to the server?

silent zealot
#

That's why I suggest doing it as a prefix patch if you can - that way you make your own mod that adjusts the TOC code

teal nacelle
#

Just zip the folder?

#

Ah

silent zealot
#

I'm pretty sure mods on servers are tied to steam, but I don't do multiplayer

orchid quiver
teal nacelle
silent zealot
#

Two ways: you either generate a number in one place and push it to everyone OR you use a hash function on values that will be the same for everyone like servername..dayselapsed

#

(assuming there is a "servername" value somewhere)

#

A hash function will always generate the same value, and will look random... asusming you're not worried about players looking at the lua code and knowing the random numbers in advance.

bronze yoke
#

you can use seeded random to ensure the same value is calculated for everyone

vast pier
orchid quiver
#

Thank you for all the help. πŸ™‡

bronze yoke
#
local rand = newrandom()
rand:seed(theSeed)
randomDailySprintTime = rand:random(0, 22)
#

cache the rand object if you can, it's wasteful to create it each time you use it

maiden zinc
# vast pier I think something is wrong with your mod.info

Perhaps there's some characters I'm not allowed to use? This is what I got ```
name=Drink From Troughs
id=DrinkFromTroughs
modVersion=1.0.0
description=Troughs will now act as a water source refilled by rain and giving tons of water to use.
poster=poster.png
versionMin=42

not sure exactly what would be the problem with it tbh
orchid quiver
maiden zinc
#

I just realized I badly named it but that's not what's important right now kek

bronze yoke
#

yeah an invalid versionMin bricks the entire mod manager lol

maiden zinc
#

Huh, I guess I read the wiki a little to faste then I thought that was fine. Let's try!

vast pier
#

seems to be a common issue, no worries

bronze yoke
#

it doesn't seem like they have examples for it on there, and it's natural for 42 to work in other places that expect a version

tacit pebble
vast pier
#
author=VerySaltyOreos
id=AluminumNotTin
description=Renames the "Tin" Foil hat to Aluminum
version=1.0
poster=preview.png
icon=icon.png
versionMin=42.0.0```
This is what my most recent mod uses
bronze yoke
#

yeah a full x.x.x is needed

maiden zinc
#

Awesome, yeah I reloaded lua and now it's showing the mod. Progress!

vast pier
#

πŸ‘

#

the first of many hurdles

maiden zinc
#

oh yeah I'm anticipating some pain, but I'm a web dev, I know hurdles πŸ˜›

vast pier
vast pier
teal nacelle
#

(also the reload is the same speed, gonna have to fix that)

#

Also gonna add pain to the arm from holding up a heavy gun with one hand, idk how to do that though

maiden zinc
#

Once I've made changes to the mod files, if the game is running, can I reload the mod code from the running game or do I have to quit to main menu to reload?

tacit pebble
bronze yoke
#

bear in mind that this very often won't actually work how you want it to

#

for the most part it just runs the new version of the file, it doesn't undo anything that already happened and if you're relying on events for initialisation or something they won't refire

maiden zinc
#

yeah there's a new file too so I'll restart this time and see what happens

teal nacelle
#

Just realized the block of code I deleted might not have even done what I thought it did, this says TODO lmao

#

Gonna have to test

silent zealot
#

Keeping in mind B42 does a weird thing now where hitchance become something about modifiying damage unless you untick a sandbox option under character, the theory being the player is responsibel for aiming and the character stats determine the damage or something? I don't really get it. Also I hate it.

silent zealot
#

Oh then you're on the old system, so guns are technically melee. πŸ˜›

vast pier
#

Fantastic. Why on earth

teal nacelle
silent zealot
#

Why are guns melee? My guess: because that was how they got workig guns done for minimal effort and always planned to redo them later

teal nacelle
#

Also, with the advanced trajectory thing I don't even need that edit

#

Besides for balancing changes like reload speed

silent zealot
#

advanced trajectory will completely invalidate any advice I have on adjust gun starts - it does it's whole own thing.

teal nacelle
#

Ah

silent zealot
#

Just means you need to look at the advanced tragectory code and see how it deos stuff

plush wraith
#

Is there an event for the client that fires when you 'exit' the game, not seeing anything in the wiki

plush wraith
frank elbow
#
-- Any of these may be nil, so we can't take advantage of "..." syntax :-(

pain.
(from ISContextMenu, referring to the use of param1, param2, param3, param4, ... args)

#

I just wish I could travel to the past to inform whoever wrote this of unpack and save us all from this pervasive anti-pattern but this is the reality we live in now

queen oasis
frank elbow
queen oasis
#

yea, I see now. Brain is a little slow right now

frank elbow
#

This can be avoided by saving the result of select('#', ...) & later using it with unpack but that presumably was not known when that code was written

queen oasis
#

just passing it around, couldn't they just save it like args = {...} and then pass args

frank elbow
#

If they pass it as a table then whoever accesses it wouldn't know the original argument length (in the nil case, that is)

#

Because #args in that case would only count up to before the first nil

queen oasis
#

stupid question maybe but I don't know, what about using ipairs?

#

pairs

frank elbow
#

pairs would work for getting the values after the first nil, but typically these are used for passing arguments to a callback so that would be very cumbersome for the intended purpose & wouldn't have guaranteed ordering

#

No stupid questions around here

#

The onclick callback for a button, for example

queen oasis
#
function ISButton:setOnClick(func, arg1, arg2, arg3, arg4)
  self.onclick = func
  self.onClickArgs = { arg1, arg2, arg3, arg3 }
end

Hmm

#

arg4 feeling a little left out there

frank elbow
queen oasis
#

copy/paste ftw

silent zealot
#

runs away

frank elbow
brave bone
#

I would like to thank everyone who help us figure stuff up while making our simple mod πŸ™‚ you guys are awesome. ❀️

silent zealot
#

Helping out with zomboid questions is a lot more fun than atually doing the work I'm supposed to be doing.

brave bone
#

we are actually surprised it went well , not know anything to making a mod. lol. what a experience lol.

tacit pebble
# brave bone I would like to thank everyone who help us figure stuff up while making our simp...
Fast forwarding the game will make your wetness increase, while near the tent. so.. (we don't know how to fix it.. yet.... since we never modded before.)```
--> you can multiply

```lua
local gameSpeed = getGameSpeed() == 1 and 1 or getGameSpeed() == 2 and 5 or getGameSpeed() == 3 and 20 or getGameSpeed() == 4 and 40

bodyDamage:setFoodSicknessLevel(currentLevel - adjustedForce * gameSpeed)
#

the gameSpeed is fixed value so you can copy and paste mine

brave bone
tacit pebble
brave bone
#

we gonna try this, πŸ˜„

meager lion
brave bone
frank elbow
meager lion
#

Yikes, thats what i was afraid of

plush wraith
#

Im trying to add a custom progress bar to a tooltip, but running into the issue that the bar itself is empty, seems like others have ran into this but not finding a solution

urban timber
#

Hi guys, im only staring on making mods. Where can i get all tiles for 42 build?

silent zealot
#

Are you talking about for making map mods?

#

If so I think they are part of the Project Zomboid Modding Tools you can install through steam, but hopefully someone who has actually amde map mods can give a proper answer.

urban timber
#

I found here in project zomboid modding tools tiles. But i can't find new log door frame, new log fence

#

Maybe i need to update it to 42 build?

silent zealot
#

Not sure. This is teh brush manager from inside B42:

urban timber
#

I haven't really figured out how to use this program yet.πŸ˜…

#

That's i see in tiles but game using "walls log" file in scripts

#

But i can't find here walls_logs

gilded crescent
plush wraith
merry patio
#

Hi there? I new! I'm trying to finish a mod that I started a few days ago. The idea of the mod is to make the animation speed change when a certain temperature is reached. In the default case, it will be 0 Β°C. The truth is that I already have the animations modified and even the lunge changed by a script and converted into slow_walk, but the issue is when I want this to be activated by a specified temperature. Could you help me create a functional LUA script for what I'm doing?

tacit pebble
last siren
#

anybody can tell me how to make new tiles? like make a new floor or wall or furniture.ballpeenteeheehammer

merry patio
# tacit pebble What do you exactly want to know? - How to check temperature - How to run animat...

Hi! Thanks for getting back to me. I'm trying to create a mod for Build 42 that changes zombie walk animations based on temperature. I've already modified some animation XML files in 42.0/media/AnimSets/zombie/walktoward/ (specifically, I have zombieWalkSlow1.xml, zombieWalkSlow2.xml, and zombieWalkSlow3.xml which are slower versions of the default walk). These changes work, but they're always active. I want the slower animations to only activate when the zombie's temperature is 0Β°C or below

#
  1. Getting the individual zombie's temperature: I need a way to get the temperature of each specific zombie, taking into account whether it's inside or outside (and any other factors that affect a zombie's temperature). I'm not looking for just the ambient temperature. In Build 41, I believe the function was getClimateManager():getAirTemperatureForCharacter(zombie), but I'm not sure if this is still correct or if there's a better approach in Build 42.

  2. Switching animations based on temperature: Once I have the zombie's temperature, I need the Lua code to do the following:

    • If the temperature is <= 0Β°C: Randomly select one of my custom slow walk animations (zombieWalkSlow1, zombieWalkSlow2, or zombieWalkSlow3) and apply it to the zombie. I believe the function to apply an animation is zombie:getAnimationPlayer():setAnimSetName("animationName"), but I want to confirm this is still the correct function in Build 42.
    • If the temperature is > 0Β°C: Apply the default "zombieWalk" animation to the zombie.
  3. Continuous updates: I would like the code to do it constantly, or at least, very often, so the zombies react to the temperature changes.

I've tried using Events.OnGameTick.Add(), but I'm not getting the expected results. The temperature check doesn't seem to be working, and the zombies are always slow.

Could someone provide me with the correct Lua code snippets for Build 42 to achieve this? Specifically:

  • The exact function(s) to get the individual zombie's temperature.
  • The exact code to apply the animations (slow and normal) based on the temperature check.
  • Confirmation that Events.OnGameTick.Add() is the correct way to do this, or if there's a better event to use.

Thanks in advance for any help!

winter bolt
#

you could do it on the EveryHours event and then grab all the zombies from the current cell maybe

merry patio
winter bolt
#

i cant remember the command to get the zombies but ive seen another mod do it so i need to check

merry patio
#

I tried but they still appear slow, I don't know how to make it play one animation above 0Β°C and another below.

winter bolt
#

i have no idea if the animation thing will work or if its possible but this should get all the loaded zombies

merry patio
#

Thank you very much! I will try it and let you know how it went.

drifting ore
#

Is there a better way of making a food item have a certain number of uses like UseDelta than something like

`item food5
{
ReplaceOnUse = Base.food4
}

item food4
{
ReplaceOnUse = Base.food3
...` etc.

silent zealot
drifting ore
#

I want it to have 5 identical uses

silent zealot
#

ReplaceOnUse would work, if making lots of different items is OK. Any other method I can think of would need either be like a pack of cigaretes: pie -> remove piece of pie, eat piece of pie

#

Or require you to do custom lua