#mod_development

1 messages ยท Page 11 of 1

sour island
#

Doesn't remove it from existence safely though - which would be nice

violet shell
#

I find many of them when I play ๐Ÿ™‚

sour island
#

Different item

violet shell
#

oh ok, so this is an old item

#

and there are newer versions of it ?

eternal garnet
#

They replaced ""Base.DigitalWatch2" with

WristWatch_Right_DigitalBlack & WristWatch_Right_DigitalRed

#

Newer are these ones

violet shell
#

tyvm, this is very useful

sour island
#

Left/Right for each color and style

eternal garnet
#

It's in the clothing_jewellery.txt

#

As Chuck put it

sour island
#

there's military/classic too

radiant venture
#

@sour island ugh if you remember my mod, i'm still having issues getting the crafting recipe to work, and drinking the recipe result's item makes it not replace on use

eternal garnet
#

Why did they not just remove the old item unless it's being used as a Parent

sour island
#

Had a similar issue with EHE

eternal garnet
#

Makes sense

radiant venture
#

advanced recipes

#

fun

sour island
#

alot of the items/menus for clothing have IDs pointed to objects

radiant venture
sour island
#

The game does need a way to grab obsolete items that already exist though

#

afaik obsolete only applies on creation

#

It would be nice to do: force drop/unequipped from players /transfer out of containers -> delete

radiant venture
#

chuck do you know any reason this problem could even happen? maybe even a fix for it?

eternal garnet
radiant venture
eternal garnet
#

What do you think Egyptian hieroglyphs are?

Egyptians trying out coding in the real xD

radiant venture
#

hell yeah

sour island
#

Do you get errors?

#

bottom right red box?

radiant venture
sour island
#

you mean evolved recipes?

radiant venture
radiant venture
sour island
#

what does your recipe look like

radiant venture
#

in the folder they're called advanced

radiant venture
sour island
#

What folder?

radiant venture
sour island
#

evolvedrecipes.txt ?

radiant venture
#

oh yeah that

#

guess in my head i switched it up

sour island
#

ProjectZomboid\media\scripts\evolvedrecipes.txt

#

Is there a resulting item called hotdrink canteen?

radiant venture
#

yeah from there i took the code for HotDrink since this is suppost to be having a bigger version of hot drink that includes my modded item

sour island
#

show that too

eternal garnet
radiant venture
# sour island show that too

item HotDrinkCanteen
{
DisplayName = Hot Drink in Canteen,
DisplayCategory = Food,
Type = Food,
Weight = 1.7,
Icon = HotDrinkCanteen,
GoodHot = true,
IsCookable = true,
ReplaceOnUse = AluminumCanteenEmpty,
MinutesToCook = 20,
MinutesToBurn = 60,
ThirstChange = -20,
UnhappyChange = -10,
CustomContextMenu = Drink,
CustomEatSound = DrinkingFromMug,
StaticModel = AluminumCanteenEmpty,
WorldStaticModel = AluminumCanteenFull,
Tags = AlcoholicBeverage;LowAlcohol;HerbalTea;CoffeeMaker,
}

radiant venture
#

for some reason trying to cook it also emediatly burns it-

sour island
#

are canteens 100% custom items?

heavy iris
#

hey, what happens in singleplayer with Client and server ? its still the two of them, or all mod files are given to client, or what?

radiant venture
#

basically bigger water bottles

sour island
#

Is there a model for both empty and full?

#

cause I doubt it

#
    StaticModel         = AluminumCanteenEmpty,
    WorldStaticModel     = AluminumCanteenFull,
#
  • wouldnt make sense here
radiant venture
#

models not yet since i first wanted the code to even work but that hasn't caused any issues whatsoever for any of the other items

sour island
#

that'd be the only thing to occur to me

radiant venture
sour island
#

Why is one empty and one full?

#

Canteens can't even be seen through

radiant venture
#

just placeholder

sour island
#

have you tried removing those 2 lines then

#

static model is used for inhand animations btw

radiant venture
#

i wanted to make 3 models for each canteen

sour island
#

item HotDrinkCanteen = full though

radiant venture
#

true

sour island
#

also - the error

#

check console.txt and just copy that here

#

no need toguess

radiant venture
#

alright

sour island
#

ctrl+f 'stack trace'

#

copy the line or two above stack trace and to where the log goes back to normal

wooden talon
#

Hello there! i ve been experiencing crashes in my game, tried unsubbing a few unneccessary mods,but it still keeps happening, please help me save my playthrough :/
Not sure what infos you need about my mods and else,but im at your disposal
thanks in advance
or help me create a fully safe working modpack that i like,im okay with that too
and i will forget about that playthrough

forest salmon
#

hey everyone, is there a mod or a way of getting that chainlink fences become indestructible? like, the player built ones
want that for RP purposes

little condor
#

onWeaponHitCharacter that's server side event?

radiant venture
radiant venture
# radiant venture welp i thought so. but why it'd an item in my files

item AluminumCanteenEmpty
{
DisplayCategory = WaterContainer,
Weight = 0.1,
CanStoreWater = TRUE,
Type = Normal,
DisplayName = Empty Aluminum canteen,
ReplaceOnUseOn = WaterSource-AluminumCanteenFull,
Icon = AluminumCanteenEmpty,
StaticModel = AluminumCanteenEmpty,
WorldStaticModel = AluminumCanteenEmpty,
}

like it's literally in the same file

sour island
#

you have the module as Base or WTC

radiant venture
#

MTC

sour island
#

also why would it be looking for empty's minutes to cook?

radiant venture
# radiant venture MTC

before you ask why, i don't know all i did was copy the start of how items are listed in base files

eternal garnet
# wooden talon Hello there! i ve been experiencing crashes in my game, tried unsubbing a few un...

Best thing would be to back up the save and make a copy of it that you are using, and put it on your desktop.

Then load up the game and disable all of the mods and work your way through, enabling each mod at a time and until you find the culprit.

Then once you have found that, uninstall that one and put back your backup save into the folder, that way the save would have only had one mod removed from an existing save.

You should note though, you should not be installing mods mid way through your game to be safe, or unless the mod got updated, in which case, it wouldn't matter anyway.

Also make sure to look on the mod pages for anything being out of date.

radiant venture
wooden talon
eternal garnet
#

Np

radiant venture
eternal garnet
#

@wooden talon It is up to you, it is your save game

wooden talon
#

maybe its easier to build a new modpack

#

that works 100%

#

but i also need help with that

heavy iris
#

What happens in singleplayer with Client and server .lua files ?

vocal berry
#

singleplayer doesn't load server scoped lua

wooden talon
#

what is there to know about compatibility?

#

and stuff, not sure where i screwed up

heavy iris
#

@vocal berry but my lua files in server are loaded somewhere

#

what's "scoped" then?

forest salmon
jagged ingot
#

It does when you load your world.

vocal berry
#

๐Ÿค” I threw print statements in client/shared/server and never saw prints from the server side anywhere in my logs

drifting ore
#

for testing my mod.... am i safe to do it in the default game? or is there likea test environment i can download or anyithng?

tacit plover
#

you can test it in the default game, or using the debug mode by adding "-debug" to the launch settings on steam

#

the only bad thing that can happen are crashes or freezes

drifting ore
#

and another question; i guess how do i go about testing it? do i need to upload to workshop to be subscribed for it to register as a mod?

tacit plover
#

you can add your mod directly to your game, by putting it inside users/zomboid/mods

#

but if you want to test it with friends, you can upload it privately on the workshop

drifting ore
#

currently just need solo testing, but thank u <3

tranquil reef
#

I had a dream someone on this server said the name of the mod I'm making is dumb and doesn't make sense, then suggested other options, I just thought about it and looked it up on the server (didn't realize it was a dream yet), and then remembered I haven't really told anybody about the mod yet

#

Weirdly creepy experience lol

drifting ore
#

fear of failure appeared in your dreams

#

keep working at it, best of luck with the mod my guy

cosmic condor
radiant venture
#

HOLY FUCK PROGRESS

drifting ore
radiant venture
drifting ore
#

congrats

radiant venture
#

THE RECIPE ATLEAST HALF EXISTS NOW

drifting ore
#

also, you can use the windows snipping tool to take a picture

radiant venture
#

oh i'm aware+

#

my laptop just doesn't like it and throws a temper tantrum xd

#

aka freezes for a good minute or so

drifting ore
#

oh weird

radiant venture
#

eh this laptop is just not the best

radiant venture
tranquil reef
#

contextOption = context:addOption("Do This", worldObjects, ThisScript.DoThis(item), player)

#

For some reason, "(item)" after ThisScript.DoThis makes it so the method is immediately called once you right click, but it needs the item for the method to work

#

Having it just be ThisScript.DoThis works fine but obviously still with the problem of not sending the item variable to the method

#

Forget all that, had this problem for so long in many different situations and just realized it should be "ThisScript.DoThis, item, player" the second I asked lol

sour island
#

Yeah you can't store referential functions with arguments afaik

jagged ingot
#

It seems like a lot of modders don't know that server Lua is very limited.

jagged ingot
#
local x = function() end

?

sour island
#

contextOption = context:addOption("Do This", worldObjects, ThisScript.DoThis(item), player)

shadow geyser
#

what languages can you do that. In every one that I can think of, using the brackets calls the function as you are trying to provide the result of the function

#

I've never seen a way to pass a function, which partially filled arguments, although I don't exactly claim to be some sort of expert on the matter. Just curious if that is ever possible.

sour island
#

Likewise

#

also local x = function() end isn't storing the function but its result

shadow geyser
#

ah wait, in my mind, your message and delta mango's message got meshed together. Thought you were saying that Lua was limited in that it was a language that couldn't do that, implying that there are languages that don't have this limitation

drifting ore
#

hey whats the status of discord integration?

#

does it work? if so, that's really all i need

sour island
#

there's some mention of it in the java and settings

#

I know Dane has alot of outgoing data from his server

#

He may have discord integration

#

๐Ÿ˜

#

I thought he had randomized jobs, why is burger flipper still the most lol

drifting ore
#

hahahah

#

ill look int oit

#

my thought is creating an in game mod that announces in game when it's night time and when it's day
using PZ's Discord server integration, the message is sent to a private discord channel
a discord bot reads for the chat message. if it sees it, it changes the server icon

#

to a night/day version of the server art

tranquil reef
#

Can bots change server icons?

radiant venture
jagged ingot
#

Sorry. Not following.

drifting ore
jagged ingot
#

That's storing a LuaClosure in Kahlua which is the Java adapter type for Lua's functions.

#

Something like:

local x = (function() return 'foo' end)()

.. would store the result.

#

Maybe I'm not getting the context of what's being asked lol.

sour island
jagged ingot
#

Yeah. I thought you were saying that the function itself as the assignment is the result of invoking it.

sour island
#

He is adding a function reference inside of contentMenu add function - he included arguments

jagged ingot
#

Ok cool nvm.

sour island
#

I think we both misunderstood what the other was saying

jagged ingot
#

Had my fair share of boxing and invoking.

sour island
#

though you were using the word function as a placeholder name not as an actual function

#

so my bad

jagged ingot
#

Hell I've done things like this in Lua:

local bar = loadstring('return _G["foo"]')()
#

Surprisingly works when invoking some Java stuff.

#

Heheh.

sour island
#

My favorite is using not not

#

or ()()

sour island
#

I forget the context

jagged ingot
#

Typescript

#

Haha

#

The Lua lookup table for imports in PipeWrench has to do some whacky stuff to get imports working before Lua files are even loaded btw so that's more whacky.

sour island
#

Before the game loads them?

radiant venture
#

CHUCK

jagged ingot
#

It loads and rebuilds the lookup table prior yeah.

radiant venture
#

I FOUND MY MISTAKE

sour island
#

?

radiant venture
#

I FORGOT TO ADD THE MODS ID INFRONT OF THE ITEMS

#

XD

#

NOW IT HALF WORKS

jagged ingot
#

caps my dude

radiant venture
#

progress is being made xd

sour island
#

so you had "canteen" instead of "mtc.canteen"

radiant venture
#

i am too excited about these simple things

radiant venture
sour island
#

whats the current error?

radiant venture
#

well as you can see the recipe has no ingredients that can be added

#

eventhough the tags are attached to the result item like it should

jagged ingot
#

@sour island PipeWrench environments injects boilerplate to the end of the generated Lua. (Specifically this example)

-- PIPEWRENCH --
if _G.Events.OnPipeWrenchBoot == nil then
  _G.triggerEvent('OnPipeWrenchBoot', false)
end
_G.Events.OnPipeWrenchBoot.Add(function(____flag____)
  if ____flag____ ~= true then return end
  FMODSoundEmitter = ____PipeWrench.FMODSoundEmitter
  getSoundManager = ____PipeWrench.getSoundManager
  isGamePaused = ____PipeWrench.isGamePaused
end)
----------------
#

It then works with a rebuilt lookup table and executed event.

#

The chicken or egg issue doesn't matter thanks to this fix.

#

So yeah fun stuff. Obliterates loading-order limitations of the current Lua solution.

sour island
#

loading-order limitations?

shadow geyser
jagged ingot
#

Yes. It has to do with the TSTL compiler.

radiant venture
shadow geyser
#

recipe should be enough

radiant venture
#

module Base
{

/*************RECIPES*******************/

evolvedrecipe HotDrinkCanteen
{
    BaseItem:MTC.AluminumCanteenFull,
    MaxItems:3,
    ResultItem:MTC.HotDrinkCanteen,
    Cookable:true,
    AddIngredientIfCooked:true,
    AddIngredientSound:AddItemInBeverage,
    Name:Prepare Beverage in canteen,
    CanAddSpicesEmpty:true,
}

}

jagged ingot
#

Imports in Lua are references however TSTL stores imports from Typescript as final local variables on the top-level so if I update the library imported the values won't change.

#

So imports from PipeWrench are reimported following OnGameBoot.

radiant venture
radiant venture
radiant venture
jagged ingot
#

It has to do with resolving references of files that loads after yours does in a Typescript environment.

#

Lua uses require and Typescript import

#

Here. I'll give a file for an example.

radiant venture
#

so wait does that mean it makes it so you don't accidently make a file be exclusively run when trying to add an item?

frosty orchid
#

Im trying to write a simple mod to modify some trait costs. does anyone know where I can find the trait names I would need to use with TraitFactory?

jagged ingot
#

One moment

#

Borked file

radiant venture
#

we love borked files

shadow geyser
radiant venture
#

hwo do you mean that?

tranquil reef
#

Is it possible to get the square straight from a world item object?

radiant venture
#

i just added the standart tags to the result item just like every other evolved recipe

shadow geyser
#

one of the ingredients that are meant to be shown for that evolved recipe

radiant venture
#

i have a list, it should be everything that can be used for hotdrink

tranquil reef
shadow geyser
jagged ingot
radiant venture
# shadow geyser one of the ingredients that are meant to be shown for that evolved recipe
  • black sage
  • bouillon cube
  • bourbon
  • brown sugar
  • cocoa powder
  • coffee
  • common mallow
  • dandelions
  • ginger root
  • ginseng
  • honey
  • lemongrass
  • lime
  • milk
  • mushrooms x 7
  • nettles
  • opened canned condensed milk
  • red wine
  • rose hips
  • strawberries
  • sugar
  • sugar packet
  • tea bag
  • thistles
  • violets

i wrote them down, and the result item has the tags, AlcoholicBeverage;LowAlcohol;HerbalTea;CoffeeMaker,

radiant venture
shadow geyser
#

ok so for example, have you added the evolvedrecipe to be used for the honey Item

jagged ingot
#

@sour island You can see what's going on with that file.

radiant venture
jagged ingot
#

The only thing you don't see is the Lua lookup table being built.

shadow geyser
shadow geyser
# radiant venture uhhhhhh, deosn't the tag do that?

item Lettuce
{
DisplayName = Lettuce,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Lettuce,
EvolvedRecipe = Sandwich:3;Burger:3;Salad:5;Sandwich Baguette:3,
FoodType = Greens,
DaysFresh = 3,
DaysTotallyRotten = 5,
HungerChange = -15,
ThirstChange = -7,
Calories = 54,
Carbohydrates = 10.33,
Lipids = 0.54,
Proteins = 4.9,
StaticModel = RoundFood_Green,
WorldStaticModel = Lettuce_Ground,
}

radiant venture
#

so how would i add them?

#

ohhhh so i did guess correctly

shadow geyser
#

here is the vanilla lettuce item. you need to add in "HotDrinkCanteen":# for the item you want to be able to add to the evolved recipe

#

the tag is just a tag

radiant venture
#

so could i now just copy all the items into my script, add the evolved recipe, and it won't mess stuff up cause it's techincally double?

jagged ingot
#

Imports and global calls in Lua can get mighty fun.

frosty orchid
#

what would be the import equivalent of

require('NPCs/MainCreationMethods');

if im using pipewrench/ts?

shadow geyser
jagged ingot
drifting ore
#

can anyone help/suggest a fix for me? i enabled my mod in PZ, and then the game wouldnt reload lua and eventually crashed.

here is my source: https://github.com/AvocadoSteam/1-More-Backpacks

here was the error:
https://pastebin.com/4qxDRgFT

GitHub

Contribute to AvocadoSteam/1-More-Backpacks development by creating an account on GitHub.

radiant venture
frosty orchid
thin hornet
radiant venture
#

@thin hornet could you explain how doParam works?

sour island
thin hornet
radiant venture
sour island
#

Does the evolved recipe for HotDrink include all those herbs?

thin hornet
#

check how ItemTweaker works its the best example to use doParam

sour island
#

So why are you worried about params now?

radiant venture
#

i wrote them down for if i had to manually add them and well here we are

radiant venture
#

since the item itself needs a tag of like "used in:" if put into non code language

radiant venture
tranquil reef
#

I'm trying to print a square, and then print it again after sending it another function, but it's changing the item type in between somehow

#

I've been guess and checking for like an hour, this is the most painful experience of my life lol

tranquil reef
#

I can't tell if it's an abnormal occurrence or if I'm just dumb

#

Probably both

thin hornet
#

O.o

drifting ore
#
[11-08-22 10:02:23.062] LOG  : Mod         , 1660237343062> loading MoreBackpacksMod.
[11-08-22 10:02:23.065] LOG  : Mod         , 1660237343065> mod "MoreBackpacksMod" overrides media/fileguidtable.xml.
[11-08-22 10:02:23.075] LOG  : General     , 1660237343075> translator: language is EN.
[11-08-22 10:03:24.194] ERROR: General     , 1660237404194> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method)..
[11-08-22 10:03:24.195] ERROR: General     , 1660237404195> DebugLogStream.printException> Stack trace:.
[11-08-22 10:03:42.721] LOG  : General     , 1660237422721> EXITDEBUG: RenderThread.isCloseRequested 1.
[11-08-22 10:03:42.721] LOG  : General     , 1660237422721> EXITDEBUG: GameWindow.exit 1.
[11-08-22 10:03:42.721] LOG  : General     , 1660237422721> EXITDEBUG: GameWindow.exit 2.
[11-08-22 10:03:42.722] LOG  : General     , 1660237422722> EXITDEBUG: GameWindow.exit 3.
[11-08-22 10:03:42.739] LOG  : General     , 1660237422739> EXITDEBUG: GameWindow.exit 4.
[11-08-22 10:03:42.739] LOG  : General     , 1660237422739> 1660237422739 znet: Java_zombie_core_znet_SteamUtils_n_1Shutdown.
[11-08-22 10:03:42.791] LOG  : General     , 1660237422791> GameThread exited..
[11-08-22 10:03:42.791] LOG  : General     , 1660237422791> EXITDEBUG: GameWindow.exit 5.

can anyone tell me wtf this error means

shadow geyser
# radiant venture hmm i'm sure could explain how doParam works

here is what I have found in a mod I am working in

local scriptItem = ScriptManager.instance:getItem("Base.TreeBranch")
if scriptItem then
    scriptItem:DoParam("Tags = Box12")
end

but in your case you aren't trying to modify the tags, you want to instead use "evolvedrecipe = blahblah blah"

radiant venture
#

sooooo

shadow geyser
#

and from what I can tell, there isn't a way to append onto the end of the field, so you need to just write the whole thing. which isn't great because it would remove other evolved recipes added by other mods, but I can't really think of a way to do it other than doing to very annoying string parsing crap

radiant venture
shadow geyser
radiant venture
#

ah okay

shadow geyser
#

you need a colon between the recipe name and the number. the number decides the max hunger, you are transfering from the ingredient, into the evolved recipe. And you need to use a semi colon for all the other evolved recipes that originally belonged to that item

radiant venture
#

ah alright i think i understand

#

what about things that are counted as a spice? like ginseng?

shadow geyser
#

they are the same

radiant venture
#

what i mean is won't i have to add more numbers? since some items don't just chnage hunger

drifting ore
#
[11-08-22 10:03:24.194] ERROR: General     , 1660237404194> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method)..
[11-08-22 10:03:24.195] ERROR: General     , 1660237404195> DebugLogStream.printException> Stack trace:.

what could cause this error

radiant venture
shadow geyser
#

like look at the ginseng item

    item Ginseng
    {
        DisplayName = Ginseng,
        DisplayCategory = FirstAid,
        Type = Food,
        Weight = 0.1,
        Icon = Ginseng,
        EvolvedRecipe = Beverage:1;Beverage2;HotDrink:1;HotDrinkRed:1;HotDrinkWhite:1;HotDrinkSpiffo:1;HotDrinkTea:1,
        Spice = true,
        FoodType = NoExplicit,
        EnduranceChange = 2,
        Tooltip = Tooltip_Ginseng,
        HungerChange = -1,
        Calories = 0.1,
        Carbohydrates = 0,
        Lipids = 0,
        Proteins = 0,
        WorldStaticModel = Ginseng,
        Tags = HerbalTea,
    }
radiant venture
shadow geyser
#

it has a hungerchange = -1

radiant venture
#

ah i see it has spice = true

shadow geyser
#

I think the Spice = true is what gives it all the spice magic

frosty orchid
# thin hornet ```ts import { BaseGameCharacterDetails } from "PipeWrench" BaseGameCharacterDe...

I'm a little confused how DoTraits() works, wasnt able to find any online examples sadly. The lua seems pretty straight forward, something like this:

require('NPCs/MainCreationMethods');
local function initTrait()
    TraitFactory.addTrait("traitname", getText("sometext"), -1, getText("moretext"), false);
end
Events.OnGameBoot.Add(initTrait);

but idk how to do it in typescript. this is my first pz mod so forgive me for being a little lost here

thin hornet
#

ah you want to add traits okay

frosty orchid
#

I want to modify existing traits, but the mod Im following as an example also used TraitFactory.addTrait

tranquil reef
#

I said screw it and decided I wouldn't add this for now since it's not extremely necessary, and once I removed that code the code that worked fine before is now broken, my brain

#

Genuinely fried lol

frosty orchid
#

it looked something like this:

TraitsRebalance = {}
local TRAIT_COST = {
    Athletic = 12,
    ............................ traits here
    DummyBurglar2 = 5,
}
TraitsRebalance.TRAIT_COST = TRAIT_COST

local old_addTrait = TraitFactory.addTrait
TraitFactory.addTrait = function(name, trans, cost, ...)
    local new_cost = TRAIT_COST[name]
    if new_cost then
        cost = new_cost
    end
    return old_addTrait(name, trans, cost, ...)
end
#

its from an older mod so idk if this even still works lol

thin hornet
#

nah i dont think you can overwrite that function

#

its a java object

#

Example of adding new traits

import { BaseGameCharacterDetails, getText, TraitFactory } from "PipeWrench"
import { hookInto } from "PipeWrench-Utils"

hookInto("BaseGameCharacterDetails.DoTraits", (doTraits: Function) => {
    doTraits() // call original function first

    TraitFactory.addTrait("MyNewTrait", getText("UI_trait_axeman"), 0, getText("UI_trait_axemandesc"), true)

    TraitFactory.sortList();
    const traitList = TraitFactory.getTraits()
    for (let i = 0; traitList.size() - 1; i++) {
        BaseGameCharacterDetails.SetTraitDescription(traitList.get(i))
    }
})
frosty orchid
thin hornet
#

you could probably use TraitFactory.getTrait("trait")

#

but you can basically only do setDescription ``setFreeRecipesandsetRemoveInMP`

#

you could maybe remove the trait and add it again edited

frosty orchid
#

thanks for the example, ill try things out

thin hornet
#

nevermind you cannot remove it

#
public static ArrayList getTraits() {
   ArrayList var0 = new ArrayList();
   Iterator var1 = TraitMap.values().iterator();

   while(var1.hasNext()) {
      TraitFactory.Trait var2 = (TraitFactory.Trait)var1.next();
      var0.add(var2);
   }

   return var0;
}
#

it give a copy of the the added traits so removing it from this ArrayList would do nothing

stark coyote
#

Hello guys,
I have a strange bug ๐Ÿค”
I made an item, using a mesh from the game, and when the item is near a wall, I can see its "anti-shadow" outside. Any idea what could be causing it ?

#

I mean, it's kinda creepy, now I have a giant ghost pickle waiting for me outside ๐Ÿ˜†

frosty orchid
#

are you sure its a pickle? ๐Ÿ‘€

stark coyote
#

Yes ๐Ÿฅฒ

frosty orchid
#

I love your giant ghost pickle

#

should make it an official mod

clear geode
#

picklerick

stark coyote
#

Well, thanks ๐Ÿ˜† But I'd rather just have my regular Pickle Rick ๐Ÿ˜

tranquil reef
#

Anyone know why this might be considered a bugged action

#

The same foundation is used in another mod that isn't broken, and the two lined out things are apparently not the only reason it's broken

thin hornet
craggy furnace
#

btw i just stumbled on this again koni

#

this is insanely useful lol

frosty orchid
thin hornet
#

so im testing something

frosty orchid
#

Maybe that's how trait rebalancing mods work. Was wondering how they modified or replaced traits otherwise

thin hornet
#

didnt test yet

#

basically backing up traits then resetting and re-adding them all

frosty orchid
#

I'll give it a try

thin hornet
#

a bit hacky

#

only thing im not sure is the xpboost

#

since its a hashmap

shadow geyser
#

you don't need the "cont", i just put that in cuz i didn't want to write them all in the example

radiant venture
#

ah alright

shadow geyser
#

you don't need the comma at the end either I think

radiant venture
#

module MTC or Base or anything at the start?

forest salmon
#

anyone knows where is located the file responsible for player build structures?

shadow geyser
#

depends on how you are declaring your recipe

#

just try it

tranquil reef
#

I believe I've figured out my extremely annoying error, at least one of them, I'm trying to remove the item from it's container, but since it's container is the floor which I guess only exists when I'm near it, it's been giving me an error only when hovering over the floor menu doesn't show the object

#

I am happy that I've figured it out, but that, that is insanity lol

#

Probably nearing 3 hours of working on 2, count them, 2, lines of code

radiant venture
#

no errors tho so maybe it's just not recognizing it

shadow geyser
#

with and without?

radiant venture
#

haven't tested it with

#

let me try that

radiant venture
shadow geyser
#

do those can you check if that item still works in other evolved recipes?

#

hmm maybe try doing just the recipe you want to add, and not the others

radiant venture
#

hmm maybe

winged lotus
#

Good evening all! I am maintaining a mod that add new traits and I am encountering an issue with multiplayer.
I have my traits/profession code located in the lua/shared and it is called on OnCreateSurvivor

Events.OnCreateSurvivor.Add(initTraits);

With the initTraits function basically doing this kind of code TraitFactory.addTrait("customtraitname", "Custom Trait Name", 0, getText("Custom Trait Name Description."), true);

But this means the server never actualle get to run that code which makes it kind of freak out to see characters with traits it does not know (makes sense).
This leads to the console being spammed with this type of messages.
IsoGameCharacter$XP.load> unknown trait "customtraitname"
And also sometimes fully wipe the custom traits from the characters.

So I was wondering if anyone around has made this type of mod / experiences this type of issue. And if they would know how to make the server know about the new custom traits? Do I need to call the same code on the server, if so, using which event?

thin hornet
# winged lotus Good evening all! I am maintaining a mod that add new traits and I am encounteri...

You need to do this:

--- remove original 
Events.OnGameBoot.Remove(BaseGameCharacterDetails.DoTraits);

--- backup original
local original_DoTraits = BaseGameCharacterDetails.DoTraits;

--- overwrite original
BaseGameCharacterDetails.DoTraits = function()
  original_DoTraits(); --- call original

  --- add your traits here

  --- finish up
  TraitFactory.sortList();

  local traitList = TraitFactory.getTraits()
  for i=1,traitList:size() do
    local trait = traitList:get(i-1)
    BaseGameCharacterDetails.SetTraitDescription(trait)
  end
end

--- add again
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoTraits);
#

reason i remove before and add again after is cause the reference to the function change

unique trail
#

Is it possible to read/write to fields of different classes without using a predefined method? (or... when there is no predefined method ๐Ÿ˜… )

shadow geyser
unique trail
shadow geyser
unique trail
#

And then I would apply unique looting tables to the zone

#

Not changing the zone sorry

#

roomdef

#

i meant

shadow geyser
#

hmm, sounds tough, not sure if you would be able to do that before it gets populated though as it would be probably the sameish time that the room gets loaded, and the roomdef is available for you to be able to modify it before it gets populated. would have to check in the javascript

winter bolt
#

is there any way i can cast my InventoryItem variable to the subclass clothing?

#

i've tried a ton of methods but cant seem to find a way to get it to work

unique trail
shadow geyser
unique trail
#

oh yeah... ๐Ÿ˜‚

shadow geyser
#

hmm actually, this is for the secret military base right

unique trail
#

Yes

shadow geyser
#

you can just dynamically modify the distribution tables, when you come close to the secret base

#

the base is surrounded by tons of forest and you will be so far away from any other rooms which have the definition "medical"

unique trail
#

But wouldn't that mess up looting tables inside multiplayer?

#

As the loot tables are server based

shadow geyser
#

so you can try to modify the distribution tables as you approach the secret base, then change it back after you return.

winter bolt
shadow geyser
#

true, but it would only cause a problem if you just happen to have 2 players loading that time of cell at the same time

#

also depending on the item spawn chance, you could always just make it a guaranteed spawn with code. Like for example, hydrocraft guarantees a hazmat suit in the secret military base because its important to the tech tree, and the military base is a reasonable amount of difficulty and effort to get it. So there is just code that spawns it at specific coordinates in a locker in the military base

unique trail
#

Well that was my second thought

shadow geyser
unique trail
#

To manually spawn items inside containers when entering a room

unique trail
#

but in a vanilla friendly way

#

there are risks that go with it

#

its rare

#

and its never a guarantee

#

So that the danger of the disease is not completely removed and is still a huge risk

#

But there is hope ๐Ÿ˜‚

knotty saddle
#

I would like to implement the ability to add keybinds to the extra buttons on my mouse without needing to make custom macros. I read somewhere that this was originally a default feature of the game but it was removed, and some of the code for it still exists somewhere. Is this something that is still doable or would it cause issues? I have little experience when it comes to modding, but I have to imagine this is something other people would like as well.

queen leaf
#

Had a thought โ€” any chance someone can make a mod where you get welding goggles??
Itโ€™d be less protection than the welding helmet, of course, but itโ€™d be much lighter and easier to carry around from day to day
Iโ€™d love to have more options than just carrying around a welding helmet just in case

spark void
#

hey kinda new to this -- can you reload LUA while in-game in debug mode?

shadow geyser
#

yeah you just need to select the file from the file browser and click reload

spark void
#

Thanks. I'm doing some guesswork to try and fix the overlay bug in the 10 Years Later mod because folks on my server are complaining about it lol

desert dust
#

I'm having some trouble with getting a part of my mod to work, and I'm not sure what I've done wrong; it was working fine last night, but then I tweaked it and evidently broke something. I made a small mod which lets you recycle bags such as hiking bags and school bags. Now, a mod like that probably exists already, but I couldn't find it. Mind you, I have a habit of not looking properly.

Anyway, I'm trying to make it so that the player will get one thread at Tailoring level 3 and two thread at Tailoring level 7 and above. However, this is not happening on my debug mode character with maxed out everything. I get the leather strips, but no thread.

I created my own Recipe.OnCreate function, which is in the recipe code, but I must be overlooking something if the thread isn't actually being given to the player when they recycle a bag and have the appropriate skill level.

Lua Code: https://pastebin.com/dtvThrVi | Example Bag Recipe: https://pastebin.com/NfQnxM0b

I'm new to modding PZ, so forgive me if this is a stupid question or if I've made a screamingly obvious mistake somewhere.

winter thunder
desert dust
winter thunder
#

You could check how this mod implements it

#

Tried to find the simplest one, seems to only tweak underwear

desert dust
#

I changed the name of the folder my Lua was in from 'client' to 'server' and it is now working.

Thanks for the help, though! ๐Ÿ‘

spark void
#

I'm trying to figure out why the "Remove Vegetation" function in the 10 Years Later mod also removes any other overlays on the same tile

elfin stump
#

Hey all, I am trying to get into modding PZ. I have a lot of programming experience but I am new to LUA and to PZ modding. I found some useful resources to start but I cannot seem to find anything about how to affect player variables. For example, if I wanted to have an item that when used would make the character sick, or heal them, or zombify them or something like that. Can anyone point me in the direction of some resources? Anything about affecting the player with items or adding removing moodles etc is what I am looking for the most. Anything to get me started there would be much appreciated! Thanks in advance! ๐Ÿ™‚

forest salmon
#

i need to change the wires fence health, anyone know what is the file location of buildings?

cyan basalt
elfin stump
#

@cyan basalt awesome thank you! I will take a look.

cyan basalt
#

no problem! if i recall it's not super in depth but he shows debugging and the moods changing. im also a beginner tho so i am not super familiar either

elfin stump
#

No worries there is not a lot out there so anything helps ๐Ÿ™‚

winged lotus
unique trail
#

Can someone confirm that local function OnFillContainer(roomName, containerType, itemContainer) doesn't work on multiplayer?

#

It seems to work on single but no matter what I do it doesn't work on multi...

#

or am I just using it wrong?

thin hornet
#
public static void fillContainer(ItemContainer var0, IsoPlayer var1) {
   if (!GameClient.bClient && !"Tutorial".equals(Core.GameMode)) {
unique trail
#

On singleplayer

#

I can spawn items inside a container

#

but on multiplayer it doesnt work

#

how should I go about making it work?

thin hornet
#

on the server it triggers when the client request items for a container

#

so in other word, container content is generated by the server and transmitted to the clients

cyan basalt
#

so it would have to be in the server code instead?

unique trail
cyan basalt
#

and it doesn't get triggered at all when it's in the server folder?

unique trail
#

No

#

at least not anything that i saw

thin hornet
#

Well try to print some text and check the server console

unique trail
#

That is exactly what I did

thin hornet
#

mhm

unique trail
#

On single player this works

#

On multiplayer

#

it doesnt

#

no matter the folder

#

I mean dont mind the "addItem" method

#

that throws an error anyways ๐Ÿ˜‚

cyan basalt
#

idk how lua works lol does it error out b4 it reaches that part of the function then?

unique trail
#

I think I know why it errors on the addItem

#

its because its not spelled with capital A

#

but point is

#

even if I remove it

#

and leave just print methods

#

on singleplayer they get called

thin hornet
#

it should trigger when the container is activated (first showing in the inventory pane)

unique trail
#

on multiplayer nothing happens

thin hornet
#

like when a container is activated it send the request to the server

#
if isClient() then
    container:requestServerItemsForContainer()
else
    ItemPicker.fillContainer(container, playerObj)
end
unique trail
#

Okay Im trying it on the server once more

#

with the file being in the server folder

#

In single 100% works

#

I just spawned an Axe in every container

#

Starting a server now

#

Alright it was somehow fixed

cyan basalt
#

konijima is a wizard

unique trail
#

yes

#

But I still

#

dont receive print messages ?

#

do I have to do it different way?

#

By the way, Im pretty sure what konijima sent was some game Java code. May I know how to get such resource? Is it through reverse engineering app or something?

thin hornet
cyan basalt
#

^^ + 1 this guide worked really well and was clear to follow for me

#

super easy

unique trail
#

wow

#

I remember using some old tutorial

#

which I had to find my way round some stuff because it didnt work

#

Thank you for that i will definitely use it

sudden drum
#

Hi Guys! Does anyone one know how to implement place feature natively? So that when you have a table in inventory, for example, you can put it into place by pressing "Put". I want to implement putting of a kiln and other stuff "vanilla way" rather than having a separated ISUI. Or maybe you aware about mods that do it natively?

late hound
#

Question: How are people still playing on 41.71 when devs released 41.73 to the stable branch?

winter bolt
late hound
winter bolt
#

the new version respawned zombies in places that players had already cleared or something like that

late hound
#

think this is the main reason: Hey all, we're aware of a current issue with Linux servers crashing and are investigating. We'll be working on a fix ASAP. Thanks for your patience!

#

from their twitter

winter bolt
#

ohh

zenith bane
winter bolt
#

is that a phishing link lol

#

ahh i saw that it was discord.com instead of .gg since i thought all the discord links end with that

late hound
#

Wrong place for this, just use my stable build link I put in my changelog. I am out of ideas of what is causing this.

tranquil reef
#

After today I'm never playing this game again

late hound
#

I said that this is the wrong place for this, do you realize that I have been replying to you in the comment section of the mod? There is also the #mod_support channel which is the dedicated place to go for these issues. I also have my discord linked on the mod page itself. Finally I also have my DMs on Discord and Steam open.
Yes you can reupload it in your own modpack, I have been allowing people to do it that way. Just don't name your upload AuthenticZ or anything.

tranquil reef
#

It was fun while it lasted

charred hemlock
#

bit of an odd question, but do yall think a multitool (like a swiss army knife) is possible for modding? so it doesnt change much other then being a small blade (smaller then weapon possible), screwdriver, tweezer, plier, can opener, and a scissor

shadow geyser
rocky yarrow
#

Hey ! I'm having an issue with SurvivorFactory.CreateSurvivor to spawn a static NPC, it makes the NPC and I invisible ? (tried it out in a SP game)

gleaming pagoda
#

anyone having an issue with superb survivors mod where your survivors won't deal any damage to zombies at all and only be able to push them?

daring zinc
#

Hey, is there a way to make a fence not jumpable?

shadow geyser
#

I think that is a tag in the tilezed that makes some objects jumpable, so maybe by modifying the vanilla tiles you could do this

daring zinc
#

tysm

heavy iris
#

Hey there, I have a file in /shared that require a file Client in /client and file Server in /server (testing if client or server).
I get the following log error on loading PZ lua (when I set up the mod in the main menu). Do you now how I fix that?
LuaManager$GlobalObject.require> require("Client") failed. [12-08-22 12:42:52.977] WARN : Lua , 1660300972977> LuaManager$GlobalObject.require> require("Server") failed.

#
local Client, Server = {}, {}
if isClient() then
    Client = require "Client"
elseif isServer() then
    Server = require "Server"
else --- else we're in singleplayer, right?
    Client = require "Client"
    Server = require "Server"
end
rain frigate
#

Hey everyone!

Does anybody know how much things are we able to do with PZ GUI? Is it possible to do nice custom interface and/or popup windows without major headache??

shadow geyser
rocky yarrow
#

So nobody has any idea about IsoPlayer.new() making the player and the spawned NPC invisible in SP ?

shadow geyser
shadow geyser
rocky yarrow
#

yeah I had a work that made things corrupt

#

figured it out just now

cunning marten
#

Hello Hello ๐Ÿ˜„ Not a modder and more a an experienced 3D artist with a teensy tiny amount of programming knowledge and no experience working in the engine

Was really curious what the general approach would be to add texture driven facial expressions to zomboid would look like?
(if one would theoretically create a system that looks at the current active moodles and maybe picks one from a list of importance especially when they stack)

Would PZ be able to handle texture swaps/updates on the fly? Not sure if the engine precaches it or if it is possible to update on the fly

I have a theory that it might be possible (especially when looking at when the character is covered with blood/dirt the textures seem to update, so maybe possible but might be cheated by having an overlay texture that gets activated/deactivated based on the dirtyness values of the player

The only other option I'd then see is creating an actual facial rig and replacing the base models to support that
setup, but I think that would go against the aesthetic the devs had in mind (and also the fact that I'm pretty sure adding additional bones would break the player character and the zombie rigs)

Feel free to @ me - was mostly inspired by the post on the subreddit pointing out the lack of facial expressions ๐Ÿ˜ฌ

But once again, just a question in general

winter bolt
#

the code would probably be the difficult part though so i dont really know how you'd go about doing it

narrow urchin
#

Does anyone have code sample for adding items to foraging?

cunning marten
heavy iris
#

@cunning marten if you dont find any answer PM me I'll try to look for it (when I find time). I started to mod like 10 days ago, I'll do what I can. I think if it's not done at all, that might be hard, but I can start to check how bandages are placed on the character, how the location is coded, and see if we could set a face location. Also we could try to directly use the 3D model of the player and see if we can move it for a (weird? ^^) smile.

cunning marten
grim rose
#

hey hey

#

im looking for answer

#

you know, time in multipleyer passes so slowly when action slows down

#

is there any mod that allows time manipulation in multiplayer (like in split screen)

#

i know that this on big serwers would be useless but when playing with 1/2 friends it would be quite usefull

#

if you know any ping me, and dm me link to it

#

if there is none... anyone up to make it?

heavy iris
cunning marten
# heavy iris unfortunately I dont know a lot on 3D, but I think we can do custom animations (...

There definitely are custom animations- the true actions and dancing mods are living testaments to being able to add custom anims to characters, but adding custom joints and animations to those custom joints? not so sure ๐Ÿ˜…

Also The indie stone is still hiring around for an animations tech guy, so my assumption is that it's still pretty hard to add animations in general (or that a whole bunch of things still need to be standardised)

heavy iris
#

take \ProjectZomboid\media\anims_X\Bob\Bob_WalkTrees.X (you can open with notepad for instance), you can read that?

fleet hornet
#

hm

#

i made a silly little mod and whenever i load it it crasdhes to desktop

grim rose
#

wait

#

brainrot

#

i meant unless you make 3d faces

cunning marten
winter bolt
#

i think people use fragmotion to import .x but i've never used it so i'm not sure

cyan basalt
winter bolt
#

you can also convert to .dae using this site but it might not work for some models and definitely wont do animations:
https://3d-convert.com/en/

thorn cipher
cyan basalt
#

oooo i didn't know about that one

winter bolt
#

oh damn theres a new one?

cyan basalt
#

even easier

#

thanks for the link

thorn cipher
#

yeh its pretty good and simple

#

no prob!

kindred arch
#

Is it possible to take the map with marked locations and either edit it manually outside of the game or take it from single player into multiplayer?

weak sierra
thorn cipher
#

hmmm

#

I use blender 3.0

#

it works for me

#

I also installed the plugin earlier this week from that link

weak sierra
#

what OS are you on?

thorn cipher
#

windows

weak sierra
#

i can enable it fine

#

and it shows up fine in the options

#

but then i hit import and so far every time it just freezes

#

hm tried my own model instead of one by another person and it spat out errors instead of freezing

#

for my models that's fine, i can export to whatever format, but for opening someone else's X models the crashing ain't helpful lol

thorn cipher
#

so mine has the same warning but still works?

#

not sure

#

maybe tick the box?

weak sierra
#

that's a filter to just show enabled addons in the list only lol

#

don't think that'll help ;3

#

perhaps it's a windows vs linux thing

drifting ore
#

does anybody here know if there is a simple way to check if your item from a mod has spawned in the map? i have a distro setup, so the item should be, but id rather not have to go all around the map trying to find it.

i can spawn the item using debug, but wanted to know if i could check like global quantity or somethinhg maybe?

thin hornet
drifting ore
#

i guess i should just go around tp'ing myself? also.... i figured out the issue thanks to @winter bolt ..... my damn recipe script was breaking the game for some reason and was why it kept crashing

thin hornet
#

you can set the spawn rate of the item to 100 to test and see if it spawn

winter bolt
thin hornet
#

but it should spawn anyway if its in the dist

drifting ore
thin hornet
#

you may also want to test with different items spawnrate sandbox options (common, abundant etc)

drifting ore
thin hornet
#

yeah usually when i make item spawn i check vanilla items that i remember and use similar values

#

you want rare spawn, check the sledge haha

#

was rare asf last time i check

drifting ore
sour island
#

anyone know of an unique identifier for players that carries over between sessions?

weak sierra
#

steamid presuming u use steam

sour island
#

I meant to say player object - as per character

hearty plaza
#

Snake's Mod Pack 41.73 is compatible with Brita's Weapon Pack?

shadow geyser
steel locust
#

Does this function look right? Trying to run it in singleplayer, but whenever I do, it does nothing. No debug error either, it just straight up does nothing:

      if player:getKnownRecipes():contains("Make Fishing Rod") == true then
         player:Say(getText("Yes! I know this!"))
      else
         player:Say(getText("I don't know this!"))
      end
end```

I suspect something is wrong with my if statement, since I can get player:Say(getText()) to work outside of it.
weak sierra
#

getText is for getting translated strings iirc

#

if ur passing it direct strings

#

it prob isn't gonna work

#

just yeet the getText calls

#

or replace them with something like

#

MODNAME_IKnowThis

#

MODNAME_IDontKnowThis

#

and then put in a translation file

steel locust
#

I'll try that. Thank you Evelyn. ๐Ÿ™‚

weak sierra
#

mhm

#

the other possibility is that it's not running the method, of course

steel locust
#

Nah, it seems the method doesn't work at all. Strange. I thought for sure I was using it right.

Got it working. Time to continue experimenting. :^)

drowsy needle
#

How do I get an item to have the same recipes as scissors?

#

I'm trying to make an item that's a joke version of scissors that can do the same things, but idk how to make it do the scissors thing anymore. This update means my old Rip Clothing recipes don't work.

weak sierra
#

there has to be a category for scissors

#

and the recipes have to use the category

#

e.g., there is one for hammer, but sometimes ppl hardcode their mod to use "Hammer" and only clawhammers will work then..

#

there isn't one for scissors afaik so that's a hard sell - might have to autopatch recipes in code.

sudden drum
#

Is it possible to add a custom property to an item recipe? Someting like:
recipe NightItem { SomeItem, MyCondition:22-00 Result:NightItem, Time:15 }

glad pivot
#

Someone knows the camera angles?

#

Of Project Zomboid

thin hornet
#

most likely 30 degree\

#

or based on google Isometric drawings are built around 30-degree angles

glad pivot
thin hornet
#

you can probably get a tile in the game and check its angles

tranquil reef
#

tiles can have mod data, right?

cosmic condor
#

What do you mean?

mellow oyster
#

Is there anyway to display a png on interaction with an item, like on a map?

tranquil reef
#

I meant things like lamps, toilets, chairs, etc. can have getModData like items and players can, but apparently they can

#

Not sure why it isn't working for this specific thing though

#

This gives like 300 errors and I don't know why lol

cosmic condor
#

Tiles contain properties

#

Check out in TileZed

tranquil reef
#

Tile properties can't help with this lol

#

I'm giving toilets a custom context menu which calls this when clicked, and it's supposed to give it a new special boolean, but it just gives errors

green berry
#

Hello here ! I've sieved through all the code I could to find where the damage from car crashes were being processed by the game. Can someone tell me if this is something moddable or if this on the java side of the game ? The purpose is to add damage reduction on car crashes when the seatbelt is attached for this mod : https://steamcommunity.com/id/Fingbel/myworkshopfiles/?appid=108600
Love you all !

tranquil reef
#

It's like the object isn't actually even being passed, but I'm confused why it wouldn't be

rain iron
#

Hi, is there a function to make a specific zombie not able to infect you? I am making Senator Armstrong zombie and I dont want him to infect the player. The decompiled Java code has no mention about infection chance on zombie.

shadow geyser
mellow oyster
#

Is there any way to show a png on a context menu use of an item, like how you look at the map?

shadow geyser
# green berry Hello here ! I've sieved through all the code I could to find where the damage f...

there isn't a very direct way of modifying it. The crash damage is handled by the crash function at ~ line 3761 in Basevehicle.java.

   public void crash(float var1, boolean var2) {
      if (GameClient.bClient) {
         SoundManager.instance.PlayWorldSound(this.getCrashSound(var1), this.square, 1.0F, 20.0F, 1.0F, true);
         GameClient.instance.sendClientCommandV((IsoPlayer)null, "vehicle", "crash", "vehicle", this.getId(), "amount", var1, "front", var2);
      } else {
         float var3 = 1.3F;
         float var4 = var1;
         switch(SandboxOptions.instance.CarDamageOnImpact.getValue()) {
         case 1:
            var3 = 1.9F;
            break;
         case 2:
            var3 = 1.6F;
         case 3:
         default:
            break;
         case 4:
            var3 = 1.1F;
            break;
         case 5:
            var3 = 0.9F;
         }

         var1 = Math.abs(var1) / var3;
         if (var2) {
            this.addDamageFront((int)var1);
         } else {
            this.addDamageRear((int)Math.abs(var1 / var3));
         }

         this.damagePlayers(Math.abs(var4));
         SoundManager.instance.PlayWorldSound(this.getCrashSound(var4), this.square, 1.0F, 20.0F, 1.0F, true);
      }
   }
#

however maybe you could try, by modifying the sandboxoptions instance on the fly, to reduce the option to a lower one when you put on the seat belt, and revert that, when taking the seat belt off

#

ah wait never mind, the sandbox option only affects the vehivle damage, not the damage a player takes

subtle sapphire
#

Hello ๐Ÿ‘‹ Does anyone knows when the event OnPreDistributionMerge is called?

shadow geyser
#

you can see it being triggered in the IsoWorld.java. not much to say other than it is called just before the DistributionMerge, but I guess that is kind of obvious from the name. You can see what the DistributionMerge does as it is in SuburbsDistributions.lua

subtle sapphire
shadow geyser
#

only once from what I can tell

undone elbow
#

How to stop an action from the outside of :isValid?

#

This plays stop sound (related to the action) but doesn't actually stop it:

ISTimedActionQueue.getTimedActionQueue(getPlayer())[1]:stop()
knotty pecan
#

Can anyone help me with a few basic starter questions? I have been trying to make a custom poster by getting mods and changing the textures manually (I have like, zero experience modding this game, especially the correct way) but I can't seem to unpack the seemingly encrypted PACK files, not even the base game's textures. Not sure where to start with making said mod but if there's no way to unpack those files, I may have to. :c

I only play by myself so if I can get a way to access and change the ingame posters, that would be just as good. ๐Ÿฆ…

shadow geyser
knotty pecan
sour island
#

Not sure why you're getting errors - what does the error say?

gilded hawk
#

Do containers, items, and ISOObject have a GUID or HASH or something to recognize them?

#

I'm trying to differentiate two different crates on the ground but holy shit this is not working ๐Ÿ˜•

knotty pecan
#

if i figure this out, i could probably even upload it in the workshop too, along with my cobbled together plague doctor mask replacement i did a while back. i dont think my workaround of replacing the dust mask will be a good option to upload to the workshop..

sour island
#

Had to do this for IsoPlayers

#
IsoObject:getModData().uniqueID = IsoObject:getModData().uniqueID or getRandomUUID()
#
local objectModData = IsoObject:getModData()
objectModData.uniqueID = objectModData.uniqueID or IsoObject:getFullType()..getRandomUUID()

If you wanted it to still have some recognizable identifier

#

You may also have to name uniqueID something more unique as other modders may break your mod if you use generic variable names

gilded hawk
#

Mh, won't using moddata bloat the save file tho?

#

IsoSpriteInstance has a getID tho ๐Ÿ‘€

sour island
#
public int getID() {
        return this.parentSprite.ID;
    }
#

pretty sure that's to grab the sprite faster

#

and is not unique to each object

#

also you're just storing an additional value in a list

#

the list is saved empty afaik

#

so It's not adding all that much

gilded hawk
#

Alright, thank you

quiet nebula
#

Is it hard to make zombies 'say' something? Like show text above their head?

#

Because I've tried :say and either I'm doing something wrong or that's not the way to do it

sour island
gilded hawk
sour island
#

I was toying around with the idea

#

but I think i'd prefer doing a germs mod

gilded hawk
#

No lol, I'm trying to improve my Prox Inventory mod

sour island
#

where you have to wash your hands before eating, etc

#

ye

#

where even after washing your hands if you don't have a fork in your inventory when eating (which the game already checks for and uses afaik) you risk getting sick

#

going to try and keep it simple tho

#

nothing too crazy

#

The medicine overhaul mods seem to be done very well

sour island
gilded hawk
#

kek no problem dude

sour island
#

you made the merged inventory tabs mod?

gilded hawk
#

And I'm trying to find a clean way to highlight the containers I'm loading

#

Eh found it!

quiet nebula
#

What did you find?

#

Might be useful for someone else later ๐Ÿ™‚

gilded hawk
#

I found notthing usefull in the vanilla code, but I made my own solution, It sucks that I had to go through the OnTick even, but better than notthing

This sets the containers to highlighted using the user set hightlihgt color

local function OnTick()
    if not ProximityInventory.isToggled then
        return
    end

    for _, container in ipairs(ProximityInventory.containerCache) do
        local isoObject = container:getParent()
        if isoObject then
            isoObject:setHighlighted(true);
            isoObject:setHighlightColor(getCore():getObjectHighlitedColor());
        end
    end
end

Events.OnTick.Add(OnTick)
quiet nebula
#

Ahh, nice one

gilded hawk
# gilded hawk I found notthing usefull in the vanilla code, but I made my own solution, It suc...

To prevent containers to be "Accidentally" left highlighted, I do this before resetting the cache

ProximityInventory.containerCache = {}
ProximityInventory.resetContainerCache = function ()
    -- Removes the hightlight
    for _, container in ipairs(ProximityInventory.containerCache) do
        local isoObject = container:getParent()
        if isoObject then
            isoObject:setHighlighted(false);
        end
    end
    -- Reset cache
    ProximityInventory.containerCache = {}
end
#

The cache is reset when I re-render the prox inv button

quiet nebula
#

Nice

winged kindle
#

@gilded hawkhi i just installed ur proximity inv mod but i cant see any items in it

gilded hawk
#

Mod compatibility issues then

#

Stuff like alternate inventory rendering and similiar stuff is not supported

winged kindle
#

what's alternate inventory?

#

all my items on the world are from vanilla

#

we just used scripts mod and some ateliers vehicle modification

gilded hawk
#

Are you using the zombonly mode?

winged kindle
#

nope

gilded hawk
#

Is there any error in console?

#

If not, make a singeplayer mod with no mods except proximity inventory, if it works, then it's a mod compatibility issue and I can't help you

winged kindle
#

how can i check?

gilded hawk
winged kindle
#

ok ill ping u there

gilded hawk
# winged kindle ok ill ping u there

Anyway, the best way to check if a mod of mine does not work, is to test it by itself, if it work by itself then it's a mod compatibility issue and I can't help you

charred hemlock
#

a simple mod that i feel would be useful is allowing hotwiring cars to give you maybe 2-3 times the xp of dismantling an electronic wristwatch, and then maybe some mechanical xp

#

so it allows you to just hotwire every car you come across for some spent time, to at least provide you with more skill gain

drifting ore
#

i can't get custom sounds for my gun working at all, i've made sure it links to the right directory and that it's all case sensitive and there's no typos and so on but it still doesn't work

#

i've even tried doing the weird separate sounds file thing but no dice

#

i have discovered that the issue was because my character had the "Deaf" trait, help no longer needed thank you

radiant venture
unique trail
#

Question... If I have a variable in my mod... I set the variable to some value.. How do I make this variable stay this value when the player quits and enters the game again? Is there a way in the game for that or do I need to create my own files or something?

Edit: Is it ModData thing?

thin hornet
unique trail
thin hornet
#

like a unique id

unique trail
#

Well not id, it can change based on various factors in the game, more like a timer

thin hornet
#

ah then its not unique ok

unique trail
#

that goes down every 10 min or so

#

well unique I mean

#

every player

thin hornet
#

per player yeaah

unique trail
#

has its own value

#

Yes

thin hornet
#

who needs to fetch this value?

#

only the player fetch it?

unique trail
#

well I think so

#

it only applies

#

to the specific player

thin hornet
#

then player:getModData() is what youll need

unique trail
stark tusk
#

Is it possible to turn pz gun combat into foxhole-type weapon mechanics?

unreal garnet
#

So... I have some of Tsar's mods, tuning atelier and such, I'll later check what exactly and from what I understand, the tuning mod is only for his own mods?

winter thunder
sudden drum
#

Anyone knows which lua script is responsible for unlocking new recipes via book/magazines?

winter thunder
#

Do you know the name of the recipe? @sudden drum

sudden drum
winter thunder
#

here is the reference for the literature btw, seems the base is "TeachedRecipes", then you tack on the individual recipies

sudden drum
winter thunder
#

Is it a custom recipe that you are creating, or one already in game?

sudden drum
#

It could be a recipe for pipe bomb, which is in the game already. I want to fire an event after player read the magazine

winter thunder
#

This is my best guess, check after the character updates if they have learned the recipe, if yes, run whatever you wanted

sudden drum
unique trail
#

@sudden drum You can alter the Timed Action of book reading event and create a condition based on your needs to perform your code when finished with such book/magazine. Check: media\lua\client\TimedActions\ISReadABook.lua ๐Ÿ™‚

sudden drum
heady topaz
unique trail
heady topaz
eternal garnet
#

Mod ID and the Workshop ID

unique trail
#

Well I won't help you much with dedicated servers as I have never done them, but looking into the files of the mod you should add: 'firearmmod' and 'firearmssilencer'

eternal garnet
#

Also read the mod

heady topaz
#

aah okay so dbspatch means silencer patch thanks

eternal garnet
#

One is a patch

unique trail
#

@thin hornet I've done my code, I have also searched up how to use getModData and everything seems like it should work but it just doesn't want to read or save the values. There is no error but the values just basically stay "nil" after reading them.

#

Am I wrong somewhere?

thin hornet
#

you are not assigning it

#

you are assigning a global variable

unique trail
#

well yes

#

I think I want that

#

I think

thin hornet
#

hum

#

not sure why you would want that

unique trail
#

well I want to read that varaible

#

in every part of my code

#

as it's quite important

thin hornet
#

then just read it from the player object

#
player:getModData().myVar = player:getModData().myVar or { test = 1 }
player:getModData().myVar.test = player:getModData().myVar.test + 1
print(player:getModData().myVar.test)
unique trail
#

I am doing to here no?

thin hornet
#

i just dont understand what you are trying to do, give me a bit more info

unique trail
#

well like I said before

#

I want to assign a value to a variable and save it, so when the same player loads a save or joins a server again the game loads the values that were present before he/she left/quit.

#

this code is supposed to check if it is a new player or not

#

if it is it assigns default values

#

if not

#

it should read the values of modData

#

this code

#

is saving the values of a player whenever there is a save performed (and I am not sure if that works on a server yet but for now im trying to make the modData work at all)

thin hornet
#

Anything added to modData is instantly saved

#

global are not

#

With the two screenshot i see what you want to do.
What i dont see is where else do you want to use the values.

#

By using only modData you dont need that OnSave

unique trail
#

well there are few places where I use them

unique trail
#

but

thin hornet
#

the real question is how to access the player where it isnt passed by the function right

unique trail
#

well that is why I have a global player variable

#

I can access it anywhere and its client based

#

no?

thin hornet
#

it work sure, but not the best nor cleanest solution

#

what about splitscreen

#

second player will overwrite the first one

unique trail
#

there is splitscreen is in this game?

#

what

#

no xD

thin hornet
#

up to 4

#

show me somewhere you think you need that global player reference in code

#

ill try to figure how you would properly do it there

unique trail
thin hornet
#

oh yeah first of all you need to stop using globals like this ๐Ÿ™‚

#

lets start from zero

unique trail
#

Oh yes

#

no

#

I know

#

right now

#

I was just quickly writing this

#

to make sure it works

#

I wanted to change all the variables to locals

#

later

#

and another thing is I come from C# OOP language Lua is sometimes weird for me ๐Ÿ˜‚

thin hornet
#
local onEveryTenMinutes()
  for i = 0, 3 do
    local player = getSpecificPlayer(i)
    if player then
      local modData = player:getModData()
    end
  end
end
Events.EveryTenMinutes.Add(onEveryTenMinutes)
thin hornet
unique trail
#

and I would loop through each player

thin hornet
unique trail
#

Oh okay

#

emm

#

so, wait a minute

thin hornet
#

well the loop is only to make it compatible with the 4 local player

#

to support splitscreen

unique trail
#

doesn't getSpecificPlayer(i) return the object of a player on the server?

#

player1 player2 player3 etc

#

what if there are 5 players on the server

thin hornet
#

getSpecificPlayer is client only

unique trail
#

Oh

thin hornet
#

local player is on the client

unique trail
#

alright

thin hornet
#

when someone join a server in splitscreen it create a new player

unique trail
#

yeah see im jsut confused with the way the game is coded and Lua works sometimes Lua does magic and sometimes I feel like it's a pain

#

okay

#

let me try

#

when I do this ThereIsHope_player = player; doesn't that mean that ThereIsHope_player now refers to player

#

and whatever I change in ThereIsHope_player also changes in the player

#

in Lua it's not just a copy. It's a direct reference no? or pointer I should say

thin hornet
#

its not a copy it a reference

unique trail
#

so I still don't understand why my code doesn't work

thin hornet
#

but re-assigning ThereIsHope_player = 1234 changes its value only right

unique trail
#

I did as you said

#

I still find no luck

#

even after assigning this

#

it prints "nil"

#

wait

#

I realised my mistake

#

wait

#

nevermind

#

it works

#

Okay it worked for the print... when first assigning

#

but it still doesn't want to read the saved values after joining

#

again

#

๐Ÿ˜ญ

#

It just reassigns the default values over and over

thin hornet
#

dont worry there is hope

unique trail
#

Oh yes there is

#

I think I fixed it

#

sorry for bothering you so much

drifting stump
#

can grab on first tick and keep the reference from then on

thin hornet
#

depend if you die in mp and respawn without quitting, i mean, the first onTick wont run again

#

well what ever thats optimization for sure

#

there is many way of doing that i think the point of the example his to show him how to grab it without resorting to globals

full vine
#

After looking through decompiled code of 41.73 I stumbled upon this. In IsoPlayer:pressedAttack(...) there's crit calculation going on and at some point the code goes like this:

if (var11 instanceof IsoPlayer && var4.isRanged && !this.bDoShove) {
    var9 = (int)(this.attackVars.getWeapon(this).getStopPower() * (1.0F + (float)this.getPerkLevel(Perks.Aiming) / 15.0F));
}

which to me looks like, it checks for whether you're shooting a gun and the target is another player, and if yes, then it completely rewrites crit chance with this formula based on weapon's StopPower and without factoring distance to the target at all.

Was it always like that?

knotty pecan
#

quick question, trying to make a poster mod and im currently editing another poster mod to do so. i was able to export the posters and edit them individually, but i cant find the option in the zomboid tools to recompile them. anyone know where its located?

ancient grail
#

hi please help me with a script pls pls
its fairly simple
i just need to create a countdown timer

radiant venture
#

is there a reason this doesn't work?

ancient grail
thin hornet
#

Making a real world cancelable timer with callback and data
lua/shared/startTimer.lua

local gameTime = getGameTime()

local function startTimer(seconds, callback, ...)
  local startTime = 0
  local function onTimer()
    startTime = startTime + gameTime:getRealworldSecondsSinceLastUpdate()
    if startTime >= seconds then
      if type(callback) == "function" then callback(...) end
      Events.OnTick.Remove(onTimer)
    end
  end
  Events.OnTick.Add(onTimer)
  return function()
      Events.OnTick.Remove(onTimer)
  end
end

return startTimer

lua/client/myScript.lua

local startTimer = require('startTimer')

local player = getPlayer() --- example data

-- example usage
local cancelTimer = startTimer(10, function(player) --- access passed data in the function
  -- do something after 10 second(s)
end, player) --- pass data at the end

cancelTimer() --- canceled the timer
unique trail
#

this is probably a stupid question but how do I make an item smaller when dropped on the ground? xD

#

I know there is item:setWorldScale(float)

#

but how do I properly get to the item in the first place

#

onItemFall event doesn't seem to work as I thought it works

unique trail
ancient grail
#

which item do you want to modify

unique trail
#

my own

hazy jackal
#

Is there a mod that allows you to add a multiplier to one category? Like crafting? Instead of a blanket modifier

ancient grail
#

@unique trail
model mybox_ground
{
mesh = WorldItems/mybox,
texture = WorldItems/myboxtex,
scale = 5.6,
}

#

the mesh has to link to fbx
and texture to a png which is the UV

you can then play with the scale

warped sage
#

In what file do I go looking for if I want to find the sickness moodlet? (for the rotting corpse disease)

#

I would like to take a look at how the sickness is calculated over time. To see if I can make it deadlier and affect the player faster etc.

#

The related sandbox setting is: "Sandbox_DecayingCorpseHealthImpact".

unique trail
#

that complicates things

#

but thank you

#

that explains it

warped sage
#

Thank you for the fast answer. Appreciate it. I will look there ๐Ÿ™‚

hot patrol
#

someone is reporting a dictonary error when adding my mod to their MP server. are there kinds of errors actually a problem?

#
ERROR: General , 1660446082806> 0> zombie.world.WorldDictionaryException: Warning client has no script for item Base.DakiArmorBack30```
shadow geyser
#

hmm don't those errors usually kill that save? are they still able to play?

hot patrol
stiff brook
#

Hi, I'm trying to remove this section in function ISWorldObjectContextMenu.onSleepWalkToComplete(player, bed) to disable autotically awaking in Multiplayer and instead waking up with an action (Right click etc.). Can I check whether the game is currently in multiplayer and only remove that method call in that case?
is isServer() the right check?

weak sierra
#

how do i access this properly to add an item to this list on WeaponPart dynamically

#

i tried accessing it as a table, but it comes out nil somehow

#

the javadocs show getMountOn and setMountOn functions but they do not seem to exist

#

so how do i access this data to manipulate it

#

i wrote an entire autopatcher in lua

#

this one line of code is preventing me from moving forward :|

#

unless the game already combines rather than overrides it when u override a WeaponPart's MountOn

#

but due to the nature of things i imagine it does not

#

then this is a useful thing i could release as a framework

#

two gun mods add their guns to vanilla attachments -> conflict requiring a patch right now

#

with this both could do it collaboratively..

shadow geyser
#

ask if they deactivated your mod in that save, or maybe added one that overwrote some of your mod files. My understanding of the error is that there is an Item in the save i.e DakiArmorBack30 that exists in the save, but doesn't have a script for it, causing the crash. My guess is that they removed your mod, but they have the item in the save somewhere which is breaking the save on load.

hot patrol
#

I'll ask them. Thanks

weak sierra
#

ok so i learned that ScriptManager.instance:FindItem returns an item, rather than a WeaponPart, but since things aren't strongly typed in lua.. what does that mean for me

#

:/

#

in C# or whatever i'd do a cast

#

but here why does it matter?

#

and why can i still see the mountOn in debug

#

ok so the issue is that Item is not the base class of WeaponPart

#

it's a different type of item

#

one is a scripting object the other is java internal shit

#

i need to manipulate the java one

#

cannot find any way to get at that

#

i really wish there was even one hook to execute java, so frustrating

#

looks liek the only way to do this might be to do it to every instance of the item the player comes across which is an irritating amount of code to run just to make a line of code synchronized across all items when the data to manipulate is already present one layer up..

#

hopefully just something i'm missing that i can use..

undone crag
#

what u tryna do dawg?

weak sierra
#

i wrote an autopatcher to dynamically add all guns from a data structure to all attachments they are assigned to in that data structure

#

the idea being i can release a framework that lets people use attachments for more than one gun mod without needing a patch mod

#

but

#

ultimately the thing im tryna do is modify the MountOn list for a WeaponPart in code

#

and i can't find a way to get at it

#

not sure how to get the necessary object reference

#

looks through all lua for refs to getMountOn()

#

i guess i can take over the attachment system

#

looks like the best approach

undone crag
# weak sierra i wrote an autopatcher to dynamically add all guns from a data structure to all ...

I forgot I asked you something for about an hour.
An item instance has getMountOn, and a script item has DoParam. You can get an instance of an item with InventoryItemFactory.CreateItem, and the script item with ScriptManager.instance:getItem. In the text files, the list of weapons the weaponpart can attach to ends with a ,, but when you use doparam you should make it end with a ; otherwise it will miss the last one.
If you add a lot of attachments like that, the tooltip gets quite big, so you might want to not do this for the weaponpart, and instead add some code to Events.OnFillInventoryObjectContextMenu. You can use Lua to make the game attach weaponparts to weapons without the weaponpart listing the weapons. You could add a telescopic scope to the broom, without having to edit the scope's script item, and have it show the scope model if you edited the broom script item to show a model for the scope.

weak sierra
#

yeah i just found DoParam

#

luckily didnt waste too much work on anything that was specific to the other idea

#

thanks either way, and gave me some more to think about

gilded hawk
#

I got to vent, I'm so tired of making a mod and then having 50% of the comments be like "How do I turn the mod on", holy shit why people don't read the description

flat cipher
gilded hawk
#

As much as I'm happy that my mod is on the homepage, I had to turn off the comments cause this is ridiculous

weak sierra
#

maybe should make it on by default instead of off by default, might shut 'em up

#

heh

#

hi btw :)

#

i don't like to turn comments off myself but i can totally understand

cyan basalt
#

anyone familiar with the pipewrench typescript implementation here that knows how to add items to the distribution tables using it? I can definitely easily do it during lua im just curious lol

willow estuary
tranquil reef
tranquil reef
# sour island Are you making a hygiene mod?

Currently this mod is just a combination of the urination/defecation mods, but recoded and with some improved features, however I'm working on some other mods like dental hygiene which would make each tooth replaceable, able to be lost, brushable, etc.

#

A germ mod sounds pretty cool though lol

tranquil reef
#

that's the line that's broken, but it passes the toilet variable from the other function to this one, so I don't know why it only works when I do it from the other method

tranquil reef
#

Actually trying to exit the debug menu gives it another error

weak sierra
#

but it's in the log either way

#

or maybe re-open the debug window

tranquil reef
tranquil reef
cyan basalt
#

what's the correct way to get a player in a client script so it supports multiplayer? can we just do getPlayer() or would that not get the correct player

weak sierra
#

that works for the current player

#

when done on the client anyway

#

yeah

cyan basalt
#

gotcha cool beans thanks!

ancient grail
cyan basalt
shadow geyser
# gilded hawk I got to vent, I'm so tired of making a mod and then having 50% of the comments...

yeah I totally agree, about 50% of feedback/bugs are issues with not getting the mod to work on a server, and it almost always comes down to them not activating the mod in both the workshop section and the mods sections. I really wish IS would atleast have some text there to explain what it is, and how to do it. I think alot of people go from just activating it in the menu, and don't understand why there are the 2 sections in the server config. Even better would be if we could configure the mod so that if the workshop id is activated, you could set a default configuration for the mod ids that need to be activated. would just remove so many headaches to deal with.

winter bolt
#

someone commented asking if the mods required on the workshop page were actually required once

hot patrol
winter bolt
hot patrol
#

Couldn't say. They didn't give me a lot of info but it will be something I ask. I'm fairly sure the issue isn't on my end tho.

unreal garnet
#

so, hello, a question! If I added mods (that have options) to an existing save, I can't edit them right?
From what I see I cannot edit certain mods despite having the possibility in sp in world creation

shadow geyser
unreal garnet
#

huh, ok thanks

gilded hawk
cosmic condor
winter bolt
#

i can think of very few mods on the workshop in total where theyve required mods that werent actually required

shadow geyser
#

and in either case, that is the incorrect usage of that anyways

cosmic condor
#

I've seen some like translation mod, the mod author added all mods that his mod supports as required ๐Ÿ˜…

winter bolt
#

oh my god

#

somehow one of my mods has more subscribers than one of the mods that it literally doesnt function without lmao

willow estuary
#

Probably 90% of the mod support posts are from people who don't have the required mods set up properly for Britas or Autosaurs?

gilded hawk
#

omfg yeah, Modder: "Do you have arsenal 26 installed?" "no" ":-|"

willow estuary
#

I don't use required mods for my stuff for the most part anymore ๐Ÿ˜ฌ

#

Just not "easy" enough for the post b41 MP business IMO?