#mod_development

1 messages · Page 197 of 1

storm hound
#

Adding vehicles, gear, weapons, etc without needing to do anything advanced, you can just use Notepad++

#

And work with the lua

indigo hearth
#

But if you are working with functions that use Java and Lua it’s nice to have access to the library

storm hound
#

If you want to do something more advanced like change how something in the game already works.. If it's changing an existing item ingame I think you can use overrides in Lua, but if you wanna for example, make the vehicle physics better, that's a Java thing

#

Yeah, that's true. But IntelliJ has Bytecode decompile, so if you only need to view the decompiled source without changing it, you just need to load the .class in IntelliJ and it'll break it down to bytecode and format it to be readible

zealous pebble
#

i mean i kinda wanna add a repeating crossbow if thats possible. if no one will do it i will. dont care if it has a dedicated model yet i just want it to work

#

ill just make it a grey box for now lol

storm hound
#

I definitely think you can do that in Lua

zealous pebble
#

what software do i need to do it in lua? notepad ++

#

where do i get that

storm hound
#

It's a free download online

#

It's the defacto software for any language that doesn't need to compile

#

html, css, js, lua, etc

#

I can't link you to any sort of modding tutorial in lua off the top of my head, but you shouldn't have too much trouble finding one if you search google

zealous pebble
#

i feel like all i need to do is make a custom shotgun thats pump action but it shoots custom arrows instead

indigo hearth
#

You could remodel the vanilla shotgun

storm hound
#

My advice then is to find a mod that does something close to what you want to do, and look at how it does it. Since then you've got a reference in lua

zealous pebble
indigo hearth
#

There is a crossbow mod you can reference

#

Although don’t just use the code straight up and call it yours. I’ve made that mistake before 😰

storm hound
#

Yeah

#

Just look at how it adds the bolts and weapon and do your own thing with that in mind

zealous pebble
#

ok

storm hound
#

If you're modifying a mod for personal use, iirc, the TOS for Project Zomboid mods covers that and iirc you're completely fine to do so

#

But if you put it on the workshop then you're covered by those tos too

#

I remember some kinda caveat in there that mods that don't explicitely have a license are share-alike

zealous pebble
#

would it be against TOS to take a look at the shogun code in the base game and model it after that

indigo hearth
#

Nah I don’t think so considering all mods are using vanilla code for the most part

storm hound
#

I'm pretty sure that's allowed

zealous pebble
#

idk even know how to look at the cross bow mod code. i wouldnt copy i would write it myself but i would need to see how they do it

storm hound
#

Let me find the tos again

zealous pebble
#

or just take a look at the shotgun code in the base game

storm hound
zealous pebble
#

where is the code for a shotgun

indigo hearth
#

Lua code is usually in media

#

But one file could reference files from all over

storm hound
#

"4.1. Modification of other users’ workshop submissions is allowed under personal use, but you are NOT allowed to submit work that is not your own, without permission of the mod owner."

#

And modificaiton of PZ's code is A-okay long as you're not subverting copy protection or breaking people's PCs

zealous pebble
#

it wouldnt be modifcation it would be a coder seeing how they do it and writing it themselves based off of someones code, which people do all the time.

storm hound
#

Yeah, just saying for reference

indigo hearth
#

Speaking of, if I modify my dedicated servers VehicleDistribution, do I need to create a mod? Or can I just manually edit them in the server files

storm hound
#

As far as my understanding is, you can modify a base game item to add your own thing and distribute that

zealous pebble
#

where is guns under in client

indigo hearth
#

I figure it’s server side so it shouldn’t matter right?

indigo hearth
zealous pebble
#

ok sorry

storm hound
#

It's definitely worth checking if the setting already exists, I think it probably does

indigo hearth
#

Looking will help you learn

#

I don’t mean to be rude but it’s very helpful to look through the game files

storm hound
#

I do think the game modding experience is 95% staring at someone's else's code and trying to figure out wth is going on

#

And judging them for their rushed game controller support

indigo hearth
#

Using a controller on PZ got me like

storm hound
#

I've been working on a mod just to add throttle and brake axis support and automatic switching between keyboard and controller, and I've got the Lua side of it all done and working

#

Can't stand wasd vehicle control. All or nothing throttle and brake is a horrible experience

#

I've got the Java side of it all written, I just need the f***ing thing to compile

#

I'm building it on top of the Better Vehicle Physics mod, so I've also added individual gear selection

indigo hearth
storm hound
#

I didn't used to mind it as a kid, but these days I've got the luxuries of borrowing my cousin's steering wheel, pedal, and shifter. I'm used to better vehicle control xD

indigo hearth
#

TIME TO BREAKOUT THE G29

zealous pebble
#

im sorry i cant find where the guns are in the files

storm hound
#

Funny you say that, lmfaoo

#

It's a G29 I've got sitting here

indigo hearth
#

I like it, I added my own steering wheel. Ended up getting thrust Master pedals

zealous pebble
#

wait

indigo hearth
#

And a sweet, sweet shifter

storm hound
#

The annoying thing is that if I just had my coding environment set up correctly it'd have been a quick, 6 hour edit to an existing file to do what I wanted to do albeit badly. But I wanted to add a controller binding system, which I've actually written out

#

I've got the G29 set. WIth the original wheel, optional shifter and original pedals

#

It's not mine but I'm borrowing it

indigo hearth
storm hound
#

But I've spent almost a week every day from 8-10am to 3-7pm trying to get this fricken thing working

zealous pebble
#

ok i see isshotgun weapon but that might not help me, how do i find where the modded files are i tried looking but it just gave example stuff

indigo hearth
#

I’m at work so I don’t have my files info front of me

#

Oh you need to go to the steam workshop for PZ

#

So click on PZ from the steam library and there should be a tab that will display the workshop

storm hound
#

Like, when I modded Minecraft, it took me 3 days without any modding information to break down the item registration, and set up a system to dynamically register items to the client and server on item creation. Because I followed a tutorial that sorted the gradle stuff out so all I had to do was code

zealous pebble
#

yeah and then how do i look in that files

storm hound
#

To add axis bindings as an option in Zomboid is genuinely a lot simpler, but because I'm an idiot that doesn't know how to set up a bloody IDE, it's just.. God dammit

indigo hearth
#

Then once you’ve subscribed to a mod, you’ll need to go to steamapps/workshop/10800/MODID#

storm hound
#

I might just switch to eclipse and try to set up my environment in there. For what I want to do I shouldn't need to use storm, since I've already got a decompiled source

indigo hearth
#

I spent hours trying to figure out how to do something simple like add rendered text on top of a player’s model while they’re typing

storm hound
#

So you can see what people are saying above their head?

#

That's pretty sick

indigo hearth
#

Yeah but without modifying ISChat.lua

#

Lol your project sounds fucking sick

#

Mine is peanuts 😅

storm hound
#

My project was way beyond me and has taken me over 30 hours xD

#

Was tempted to try and contact the peep that made the better vehicle physics mod and to see if they'd take a comm to make the changes I want to make

#

It'd take someone that's already got it set up like, 20 minutes

indigo hearth
#

Aside from vehicle physics what are some instances of mods that would require Java?

#

Something like improved projectiles?

storm hound
#

Anything that changes the way something fundamentally works. If you wanted to improve projectile physics, that's definitely a Java thing

#

Though, only to a certain extent

#

Eventually you'll run into the point where the devs have used a library to handle the base physics system

#

And that's written in C and something you can't touch

indigo hearth
#

Makes sense

#

Do you think it would be possible to assign specific areas of maps that would effectively change the result of when a player dies?

storm hound
#

I honestly wouldn't know. You'd have to look through the source and make sense of how it works

indigo hearth
#

Fair enough. I wonder if server options are configurable by areas versus the entire server

storm hound
#

My experience with PZ's code is a week of trying to do one very specific thing, and I know a little about that one thing and absolutely nothing else

indigo hearth
#

Coding in a nutshell

storm hound
#

Eeeeyup

cedar anvil
#

Hey guys I just made a button, but it keep fails finding an image. local function ZamazonButton() local myX, myY = getPlayerScreenWidth(0), getPlayerScreenHeight(0) local button = ISButton:new(myX - 140 , myY - 140, 32, 32, "", nil, onCreateUI) button:setImage("media/ui/3star.png") button:setVisible(true) button:setEnable(true) button:addToUIManager() end Am I missing something here? I've tested without image and worked fine.

storm hound
#

Well, I did it. I set up my eclipse environment correctly and built a modified version of the CarController class

#

Turns out you don't specify zombie as the source for PZ files, you specify the base directory. And for your project, you don't specify src as the base directory but one up from that

#

Probably the same issue I had in IntelliJ

#

Now I'm going to work through the modified file I had earlier with my changes and gradually implement and fix any issues with em

#

..After I take a break and head down to get energy drink

#

@indigo hearth Here's what I did in Eclipse, using the default builder instead of maven or gradle:

  1. Make a folder for your project, inside that folder make a folder called src, and inside that make folders coinciding with the location of the file you want to edit in the game files. IE, ProjectName/src/zombie/core/physics/CarController

  2. Add the base game directory, Project Zomboid as library (steamapps/common/Project Zomboid or something like that). Type, class folder/external class folder

  3. This might be optional, but add all of the .jar files in PZ as libraries

  4. Change your source folder from ProjectName to ProjectName/src, and remove ProjectName as a source

  5. Order them so that your java jdk is first in the build path, library jars are second, PZ is afterwards, and your project is last

#

You'll need to decompile the game to get the file you want to edit in .java format, to do so, make two .cmd scripts (Don't have them in your project folder. Put them where you want your output to be):

  1. contains:
    decompile.cmd C:\SteamLibrary\steamapps\common\ProjectZomboid\zombie\ .\decomp
  2. contains:
    jdk-19.0.2\bin\java -cp "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 %*
    Change anything such as your jdk location, your game location, and your IDE location according

Then make the folder "decomp" in the same folder you made those scripts in, and run them

#

I don't know if eclipse has a java-decompiler included, so use IntelliJ to decompile it

#

Then run file 2. After that, copy whichever file you want to edit from whereever it is in the PZ decompile, IE, zombie/ui or zombie/core/physics to the same location in your src folder. UI folder under Zombie, etc

#

If anything there doesn't work, I can't help because I just messed with shit for almost 6 hours until it worked

sharp timber
#

Can someone tell me what the difference is between a door and a door wall?

indigo hearth
storm hound
#

No worries, hope it works for you 👍

#

I missed a few details since I'm recalling from memory, so I added a few things

#

Since you're working from an obfuscated decompilation a lot of the variable names will just be generic "var1" "var2" etc, so you'll have to look at where they're getting their values, and make a note of it or refactor them (Rename all instances and correct the file around the new name)

indigo hearth
storm hound
#

Sweet. All good 👌

robust briar
#

Is there an event to detect when your access level changes? There has to be right? It's not just polled everywhere IG is it?? pleease tell me there is an event haha

fast galleon
hasty vector
#

Is there a way to catch users who exploit a bug to duplicate items?

glass tartan
#

What are the base game skill categories called internally?

#

Like the "crafting" or "comnat" skill (or is it perk?) categories

#

From what i've seen when mods add new skills they add them under a new new category, such as "Misc". however, is there a way to insert a custom skill into the base categories?

hollow current
#

Does anyone have an idea of how I can access certain vanilla animations and apply them on the player, for example, the death animation?

nova socket
#

Anyone worked with the global map? Any idea how to add text notation to it with code?

#

function ISWorldMapSymbolTool_AddSymbol:addSymbol(x, y) looks legit but not sure if that saves it to player map data

rare scaffold
#

Does anyone know how to make my own type of grenade / throwable

indigo hearth
elfin olive
#

Would it be possible to make a portable shelter, like the tent, inhabitable and useful for storage with just lua? It's the main reason I want to learn lua but, if I need to decompile the java then I don't want to go that far probably. I know they are looking at doing this in future updates but, who knows when that will happen.

mellow frigate
#

That said, it is likely to be a vanilla feature of B42

elfin olive
indigo hearth
#

Given that loot and vehicle distribution is specified by furniture and room type; Is it possible to specify loot and vehicle distribution even further by grid coordinates?

indigo hearth
elfin olive
#

@indigo hearth Yes that's where I wanted to start, I want to look at that code. The only script I've looked at so far was the monkeys biker start. Ill go see if I can find the RV interior one.

drifting ore
#

Hey guys can i get yalls opinion on somethin

#

Im thinkin of making a mod to add a bunch of classic books a novels that were written pre 1993 to spice up the world; reading them reduces depression and boredom a lot more than usual books

Maybe the following titles

Catcher in the Rye
Lord of the Flies
Art of War
Nineteen Eighty-Four
Frankenstein
Lord of the rings
Moby Dick
Huckleberry Finn
The Great Gatsby
Charlottes Web
To Kill A mockingbird
Charlie and Chocolate Factory
The BFG

#

Thoughts?

bronze yoke
#

you should check out Named Literature

tardy wren
#

What's the difference between an IsoObject's properties and IsoSprite's properties?

#

Both have a getProperties method

#

I have found that I can use the properties to somehow identify an object, but... I'm yet to figure out how I can make my custom tile object and give it properties

#

I've noticed a lot of mods do this to read properties:

    for _,object in ipairs(worldobjects) do
        local square = object:getSquare()
        if square then
            for i=1,square:getObjects():size() do
                local thisObject = square:getObjects():get(i-1)

                local thisSprite = thisObject:getSprite()
                
                if thisSprite ~= nil then
                
                    local properties = thisObject:getSprite():getProperties()```
#

doesn't that work though? Besides the nullchecks

    for k,v in pairs(worldObjects) do
        ---@type IsoObject
        local object = v
        local properties = object:getProperties()
fast galleon
tardy wren
#

I see...

#

I think... I'll want to make my own buildable barrel

#

Probably a metal one

#

I have no idea how I could add it to the build menu though

#

It's all uncharted territory to me

atomic crow
#

There’s quite a few buildable barrel mods already, but it would be a good exercise if you’re trying to learn how to add something to the build menu.

tardy wren
#

Yeah... and I don't want to accidentally let people pour multiple stuff into the barrel.

sage eagle
#

@heady crystal when telecorn mod

mellow frigate
sage eagle
#

really?

mellow frigate
#

search the workshop with keyword telecorn

indigo hearth
#

Anyone know how to resolve this error? I'm not sure how to change the Java compiler in IntelliJ

tardy wren
muted garnet
#

I have a line in the update function that adds sickness, but if the player speeds up time, then the final value becomes less than it should have been initially. How can I fix this and what is the refresh rate in the update function?

nova socket
#

Anyone knows how to add symbol on the map with code?

#

It doesn't seem like there is a proper way without assembling the whole charade with tools that comes with ISWorldMapSymbols

sand harbor
#

I've published a mod to the workshop, and subscribed to it, but I don't see it in my mod list - only the local workshop version I made. Is this normal?

nova socket
#

Another question. How exactly server knows what cell is returned by getWorld():getCell() if there is no player context or XYZ context on server?

fading horizon
#

I may be finally releasing something today drunk

nova socket
#

pz mods thumbnails is sometimes a different state of art

fading horizon
#

i always add "DEV" to the end of the modID for my local mods

#

if theyre the same, the game wont recognize them as two separate mods

plain crane
#

Hey all, I'm having the weirdest issue. I have been creating custom weapons, and did so a few times successfully. Yet the last two items I made cannot use custom SFX, they just use basic rifle sound. They are both based on the vanilla template though, just like my other guns, and I'm pretty sure I did everything exactly the same. How would I investigate this? Any ideas?

muted garnet
#

I have a line in the update function that adds sickness, but if the player speeds up time, then the final value becomes less than it should have been initially. How can I fix this and what is the refresh rate in the update function?

fading horizon
round depot
#

Can someone make a crafting recipe that lets you tear the pages out of empty notebooks

plain crane
round depot
#

10 since an empty notebook has 10 pages

#

Even though every notebook I've ever owned had 70 pages minimum

plain crane
#

recipe Tear pages from Empty Notebook {
Base.Notebook,
Result:Base.SheetPaper2=10,
Time:30.0,
NeedToBeLearn:false,
Category:Literature,
}

random finch
#

Anyone else have an issue with recipes that require a lot of resources not consuming resources periodically? For example, 100 planks, 200 nails, etc,.

boreal rose
#

Planning on using ItemTweakerAPI.
Is there a neat database somewhere with the name of every item in the game?

#

found it nvm

nova socket
boreal rose
#

aight one last question here, let's say I wanted to change a weapon's damage stat
So to halve the damage a weapon does, I would halve the MinDamage and MaxDamage stat?

tardy wren
#

Roughly yes

gilded hawk
#

Does anyone how how to make a dummy new IsoThumpable? I need it fo make so that my ItemContainer can be marked as locked

ItemContainer.new(ProxInv.containerType, nil, nil, 10, 10)

balmy swan
#

Having an issue I haven't had before and I'm not sure why this could be happening.
I've made a custom item, attached a model to it. Everything looks as it should when it's on the ground, but it's missing when equipped.
What could even be causing this?

Woops, figured it out. Forgot to add the weaponsprite.

muted garnet
#

I have a line in the update function that adds sickness, but if the player speeds up time, then the final value becomes less than it should have been initially. Please tell how can I fix this and what is the refresh rate in the update function?

bronze yoke
#

the update function is called as frequently as possible, up to the fps cap if there is one

#

GameTime provides frame deltas in various formats or you can use an event that gets called at consistent timings to avoid it

sour island
balmy swan
#

Ugh. What is causing these attachments to rotate like this when equipped, vs when it's placed on the ground?
The actual mesh positions are good, and in the script files all the rotations are set to 0. If I try to adjust any rotation rotation values it just does the opposite.

Found the answer in case anyone else finds this. You need to have 'Use Space Transform' unticked in blender when exporting the parts

tulip cipher
#

anyone know that one thing that allows you to restart PZ without closing it over and over?

mellow frigate
#

If anyone wanna help a lazzy dev, I do not remember how to get (in lua from the IsoObject instance) the right parameters matching the chunck debuggers sprite.name (red in attached picture) and properties CustomName (green). I'm also wondering what is the best way to identify a tile from lua (to dynamically apply effect). Do you have any advice ?

sour island
#

You can also make a kind of submodel for world-attachnents

#

Which would let you use the hand model for ground

tulip cipher
#

anyone know what this is doing?
WARN : Recipe , 1695062241005> RecipeManager.resolveItemModuleDotType> ERROR: can't find recipe source "Ammo_Shotgun_Slugs" in recipe "Place Shotgun Slugs Into Box"

granite ginkgo
#

Guyss,why won't my modded car move,the engine is on and it's revving but it wont move at all

tulip cipher
#

have you given it a weight and horsepower rating?

granite ginkgo
#

it shall have,i reused a script of a previos car mode I made

#

it got mass of 950,rpm type generic

#

anyone lese had this problem?

#

basically wheels spin but car won't move

sour island
granite ginkgo
tulip cipher
#
        
        DisplayName = 12 Gauge Shotgun Slug,
        Weight = 0.05,
        Type = Normal,
        DisplayCategory = Ammo,
        CustomContextMenu = Re-box Ammo,
        Icon = MyIcon, }```

```recipe Place Shotgun Slugs Into Box {
        Ammo_Shotgun_Slugs=20,

        Result:Ammo_Shotgun_Slugs_Box,
        Sound:PutItemInBag,
        Time:3.0, }```
tulip cipher
#

am i identifying the item incorrectly?

sour island
#

Looks alright, is there a comparable vanilla recipe?

#

The =20 looks off

boreal rose
#

if I use itemtweaker API to edit an item that doesn't exist, say, an item that is from a mod I don't have installed, will my mod still function properly?

#

just ignores the itemtweak for a nonexistant item?

#

gonna answer this myself if I ever finish the mod itself for vanilla items

sour island
#

I will most likely be fine

#

that being said - you can also just not use item tweaker and instead employ the API it is using directly

#

Nothing against it - but some other mod used it's ID before and it's caused headaches and I've ran into a few mods with a copy of it sitting in their mod (???)

storm hound
#

You ever just implement a try catch block, and then think.. Nah, it's not that much more work to code something properly

#

My code may blind any competent programmer, but I'd rather it not kill them

weak sierra
#

heya, where are the global xp multiplier settings accessible via lua

boreal rose
indigo hearth
weak sierra
#

i just need to retrieve them

sour island
#

it's just a friendlier wrapper for it

#

I think Dark actually returned recently to update it, unclear if he moved the contents to shared or server from client (as it being in client means only client's scripts change -- very minor issue) - or if the other mod is still causing problems.

indigo hearth
#

Oh like the code. I think most of the multipliers are in media\NPCs. But I could be wrong.

boreal rose
#

I mean I just saw how I could do simple changes with simple mods that utilized ItemTweaker API and I figured it was simple enough for me to take a crack at it

#

instead of just doing the txt file replacement/override/whateveryoucallit mod like I did with my first mod lol

sour island
#

It is simple and easy to use - I'm probably using old information / being overly cautious

boreal rose
#

and thus having it be compatible with other mods that modify item stats

sour island
#

Also any issues you find with IT is because of the other mods - not itself

boreal rose
#

other mods that use IT?

#

or not necessarily ig

#

but yea hopefully my mod concept works well

#

wait a second I'm stupid

sour island
#

This is the entirety of IT:

if not ItemTweaker then  ItemTweaker = {} end
if not TweakItem then  TweakItem = {} end
if not TweakItemData then  TweakItemData = {} end

--Prep code to make the changes to all item in the TweakItemData table.
function ItemTweaker.tweakItems()
    local item;
    for k,v in pairs(TweakItemData) do 
        for t,y in pairs(v) do 
            item = ScriptManager.instance:getItem(k);        
            if item ~= nil then
                item:DoParam(t.." = "..y);
                print(k..": "..t..", "..y);
            end
        end
    end
end

function TweakItem(itemName, itemProperty, propertyValue)
    if not TweakItemData[itemName] then
        TweakItemData[itemName] = {};
    end
    TweakItemData[itemName][itemProperty] = propertyValue;
end

Events.OnGameBoot.Add(ItemTweaker.tweakItems)
#

My earlier point is that you can just use scriptmanager yourself

#

Also the code is still in the client folder

boreal rose
#

it might've just been easier to create a mod that created a Trait that reduced player damage rather than using IT to change the damage of every single vanilla weapon 🤦‍♂️

#

and it would be future proof

#

how have I not thought of this

sour island
#

You can also use scriptmanager to parse all weapons - but yeah using a trait I guess would make more sense there

#

except for the fact I don't think there's an event to change damage output

boreal rose
#

oh

#

mmm

sour island
#

so you'd need to heal zombies onhit

boreal rose
#

I guess that's why something like Anti-Gun Activist from More Traits never actually impacts gun damage directly

#

it just reduces a ton of other stats

#

also this wouldn't work for changing other stats like weapon range

#

welp that's how it goes

#

gonna continue on

sour island
#

why wouldnt this work for range?

boreal rose
#

uh

#

at this point I don't know how to do it

sour island
#

just use doparam

#

or use item tweaker if you're not sure

boreal rose
#

yeah

sour island
#

eventually you can come back to it to improve your mod

boreal rose
#

I'm doing item tweaker

sour island
#

And for anyone reading and is curious what issues can stem from having script changes in /client/ - server distros account for weight in their loot placement -- having the scripts changed in client code means the changes don't occur on server and the item will be using the vanilla weight.

#

On top of trying to compare script values between clients/server -- I also ran into an issue with shops not being able to match categories with BetterSorting

#

I had to write a silly workaround for that where the client sends their script values over

boreal rose
#

I suppose I just gotta get this mod done first
Optimizations in code can happen later, but get the base concept done first

#

now that I think about it I'm making this purely for my own playthrough lmao

nova socket
#

That some weirdfuckness over here, just listen.

sendClientCommand(player, "IShops", "locateShops", {}); -- First call
sendClientCommand(player, "IShops", "requestShopTable", {}); -- Second call

Server has one function attached to event for both cases. Both client commands are called from addOption of context and literally is a copypaste of each other in context of code. First one trigger event, second one doesn't (not even print in first line shows up). But when I run this manually it works.

I'm an idiot, rubber duck thank you.

boreal rose
#

What I wish I could see is all mods that have a certain dependency
Like if I could see all dependents of ItemTweakerAPI, then I could learn how they use it

atomic crow
boreal rose
#

hm

#

what's the ID of modded items? Uh, for example...

#

Vanilla game items are like Base.Katana
The heck do I put for "Base." in a mod like Four Color Bic Pen's Bic Pen?
(The ID name for that item is "BicPen" but idk what to put as the "Base.")
What determines that/where to find that?

storm hound
#

Does anyone know where the controller tester UI is in the game classes?

#

I need an example I can look at for using the general input wrapper rather than the xinput one, since I need LT and RT treated as axis

random finch
#

Anyone else have an issue with recipes that require a lot of resources not consuming resources periodically? For example, 100 planks, 200 nails, etc,.

storm hound
#

Ah, nevermind. JoypadManager creates the UI elements

#

I think (Even if it doesn't it has the information I need)

indigo hearth
storm hound
#

I think I've got it working, but cheers for the suggestion 👍

sour island
#

Looking for testers for gamenight 😄

sour island
plain crane
#

Hey all, I'm having the weirdest issue. I have been creating custom weapons, and did so a few times successfully. Yet the last two items I made cannot use custom SFX, they just use basic rifle sound. They are both based on the vanilla template though, just like my other guns, and I'm pretty sure I did everything exactly the same. How would I investigate this? Any ideas?

granite ginkgo
faint jewel
#

is there a mod that disables skill books all together?

sour island
faint jewel
#

i know right!

boreal rose
#

too bad we can't "hide" any mods from our view on the steam workshop

atomic crow
#

Too many server config ‘mods’

granite ginkgo
vague bay
plain sundial
#

Hi, is there a list of all the Events that I can register callbacks to?

atomic crow
# vague bay for example ?

Just mods intended for private use on servers, mostly tweaks and repacks of other mods all compiled into a single file. The kind of stuff that should be unlisted and only serves to clutter the workshop page.

boreal rose
#

Think it might be possible to modify the number of zombies that spawn in a building?
I would prefer it to be modifiable by the zombie population multiplier but I feel that isn’t gonna be possible…

sour island
#

And I believe mod options had issues integrating their settings into MP

#

I also keep seeing general server settings too - but idk what that's about

atomic crow
granite ginkgo
#

Can ssomeone explain why,after chganging the offset of the car ig and spawning it again it resets???

rustic glade
#

I wanted to create my own mod for Zomboid. I just want to add a peace of food. What should i know about modding in generel and what do i need to do for my own mod. I already have the code for the food done and i have a picture of it ready to. Do i only need to just add it to the code or what do i need to do taht it works fine?

#

And sry for my bad english

vague bay
# rustic glade I wanted to create my own mod for Zomboid. I just want to add a peace of food. W...

1:11 Step 1 - Know your file locations
4:06 Step 2 - Storyboard your ideas out
9:03 Step 3 - Get your files from the game or other mods
11:47 Step 4 - Build your mod files
1:01:54 Step 5 - Create the textures (mislabeled in the video, oops)
1:19:45 Step 6 - Put your mod files in the right structure
1:30:37 Step 7 - Test your mod (please back up ...

▶ Play video
#

Just follow this tutorial and you good to go. He explain how to add items , recipes and their images and coding part.

rustic glade
#

thx

crystal terrace
rustic glade
#

alright thx guys

random finch
crystal terrace
#

Try to be more specific around it, someone might be able to help outspiffo

random finch
#

Specific? I thought that was pretty clear.

crystal terrace
#

Idk could add more details what's the issue, wym by periodically? As much as details you can add are usually better otherwise others may or may not be able to recognize the exact issue. Sometimes it's just people who are not around who faced a similar issue.

random finch
#

Anyone else have an issue with recipes that require a lot of resources not consuming resources periodically? For example, 100 planks, 200 nails, etc,.
Periodically as in unpredictably. I wouldn't say randomly because there has to be be an underlying issue. I say ANY recipe because it doesnt matter what the end product is or what the ingredients are as long as there are a lot.

crystal terrace
#

I'm assuming you already tried other in-game items, different recipes?

random finch
#

yup, I suppose one thing I did not mention is that I am testing on a dedicated server. A beastlty one at that.

plain sundial
#

Where in the decompiled Java code would I find a piece of code that gets executed when player loads into a game from the main menu?

sour island
tardy wren
#

Can I add custom data to traits?

bronze yoke
#

not really

#

traits have essentially no functionality of their own

#

they're simply something for the rest of the game to check for

tardy wren
#

I see...

#

I guess to have my traits do a similar thing with a different system, I want to hard-code a table then

#

Also... A wild guess, but comparing two strings is faster than checking if a character has a trait, right?

nova socket
#

how do I access all worn containers on a player? (such as a backpacks etc)

vague raven
#

anyone know how to make this display the correct name rather then the itemID?

nova socket
vague raven
#

would you possibly have a repo with something like that being done because that's a little too vague for me to follow

#

imma see how VFE did it and hopefully that sheds some light

#

Set item module to Base and then created a ItemName_EN file and put in ItemName_Base.RareRepairKit1 = "Katana Cleaning Kit", and that worked.

storm hound
#

Hi, does anyone know if there's a way to run Lua clientside only? I've been working on a mod that isn't server reliant, it's mostly java but I'm using ModOptions for the settings, but if I connect to a server it seems the server requires the lua for the menu to show

neon bronze
#

All lua is run client sided

#

You have 3 folders for lua

#

Client, server and shared are run by client. Server and shared are run by server

storm hound
#

Ahhhh, I must've just screwed up my code then

#

Thank you 👍

#

Actually, I wonder if it could be something in ModOptions itself telling it to shut itself off for a mod if the server doesn't have it installed, I haven't actually looked

#

The issue I'm having is that the ModOptions menu works great in a single player world, it shows all of my options and they work. The controller switching mod also works, double taping w swaps to keyboard and double clicking A swaps to controller. But then when I join a server, my ModOptions menu for my mod disappears, and the controller switching mod also breaks. When they work fine if I'm not on a server

bronze yoke
#

no, you can't, the server and client are forced to use the same mod list

#

with how pz has client authority on nearly everything there would never be a safe way of allowing the client to use different mods

sour island
#

Actually, there's a setup to do just that

#

the mods are whitelisted

#

I'm fairly certain the server needs to use a modified java tho

bronze yoke
#

is there a checksum involved?

sour island
#

Yes

bronze yoke
#

that's good

sour island
#

It's kind of ingenious - there's a whitelist for mods - so as long as you have the required set and some of the whitelisted ones you're good

bronze yoke
#

sounds like a security nightmare but the idea had crossed my mind

#

i can't imagine how you'd do it cleanly without a java mod though yeah

storm hound
#

But if I was to use Java to load Lua, it'd get around that, right?

#

I should prefix this by saying I have explicit permission from the server owner of the server I'm playing on. They just don't want to force everyone to do any sort of manual mod installation, which would be required since I had to write the mod in java. (My mod just allows more precise throttle and brake control by allowing them to be bound to controller axis. As well as manual gear shifts to specific gears depending on button. Something that simply isn't useful to the other people on the server)

#

So I suppose I'm wondering if the Java and Lua interaction can work in reverse, running lua from java. My other option is to implement the settings I need in my own ui but I'm just not keen to put that extra work in

#

I don't know if this is allowed under the tos though, as it could be said it's deliberately subverting a protection mechanic for online play 😅

storm hound
#

Today in "Throwing everything at the wall in the hopes at least one of em will stick"

#

Finally understood how to use the Xinput system through experimenting, just to find it doesn't treat LT and RT as axis, and I'm struggling to figure out how to get those values

storm hound
#

I've been at this mod a week and a half because I've got one brain cel andcan't figure out how to print to the console from java, so I can't test anything without loading into the game and just hoping it works

cobalt fiber
#

How are you modding the java? are you compiling it everytime? I always wanted to know 😆

fathom goblet
#

Modding for Java is not something really useful unless you are going to make something really new, because the most of a game logic as i understood is writen in Lua

#

Thats why releasing modding toolkit supporting fabric without a lua mixins would be a bit dumb :p

storm hound
#

The bytecode decompile works really well almost entirely as is, just the variable names are still obfuscated

#

I'm modding java because what I need to do involves overwriting parts of the car controller and base vehicle classes, which is something that can't be done in lua (As far as I'm aware)

storm hound
#

I'm calling it. I give up. This is beyond me. If I can't manage it in 50 hours, I just can't manage it. I'm gonna head on to other things

azure edge
#

i am not any familiar to programming but is there any video to watch if i want to create a safezone custom building in map?

#

so player can start there i can also want to add a admin player shop

plain sundial
# sour island There's Lua triggers for OnLoad

Yes, I found that. What I need is a mod that will connect to an API through websocket. I was not sure how to include all the packages supporting websockets in Lua, so I thought it might be easier to decompile the Java and compile the dependencies together with the game code.

restive tendon
#

So i made a remodel for all moodles in project zomboid but I kinda dont know how to mod them into the game. PZ modding tools is kinda hard so if someone knows how to do this, maybe we could work on this mod together?

raw tulip
#

I'm having a hard time finding a car battery charger, I have actually searched every vehicle and vehicle maintenance areas
so if I made a mod that allows you to craft a car battery charger, is this fair?
please @ me if I should increase, decrease, remove or add something to the crafting recipe requirements

bronze yoke
#

it seems very expensive, battery chargers really aren't that helpful

raw tulip
#

you only need one once you have obtained one

bronze yoke
#

you rarely even need one

raw tulip
#

well... I need one, thus why I made this mod, and perhaps other people out there may need one too

bronze yoke
#

it's a while since i've interacted with metalworking/electronics so maybe that's not as harsh as it looks to me

raw tulip
#

if you're taking mechanics seriously at that time in your gameplay (like 2 months) you would have likely had an abundance of these materials laying around

#

thus why its expensive since its not too hard to find... but its not easy to come across either

#

I havent found one yet, and I CANT SEEM TO FIND ONE

#

debug/cheat one in KEKLaugh

bronze yoke
#

i'm a little dutiful with turning off car lights/engine so i guess it might be more common of an issue for other people than it is for me

raw tulip
#

im gonna release "Craft Car Battery Charger" onto the workshop, but I am unsure if its too expensive/electrical 4 is too high

#

so wanted to get some feedback before I do

atomic crow
#

Honestly I’d say that’s reasonable, though maybe remove the propane torch and have screws instead, or alternatively make it 3 electrical and 1-2 metalworking to justify the propane torch.

paper lynx
#

Can sommeone tell me where i need to check in the pz files the xp reward when
cooking something on a campfire?

humble elm
#

Hey y'all. I would like to commission a mod. Let me know if you're a dev and would like to discuss, happy to talk budget, timeline etc

unique roost
#

I made a small mod, How do I upload it to the workshop for my friends?

#

I checked pins, couldn't figure it out myseld

#

found a guide on the workshop

nova socket
#

Does anyone know how to fight with z indexes of UI's?

brazen bay
#

Hey hope everyone is doing well, I’m looking to commission a mod for some armor and possibly weapons

median prairie
#

Modelling question that extends to scripting:
I have custom zombies wearing "full body costume". I set their hair to "none" yet occasionally I'm getting this piece that looks like it's a hair base.
Am I missing something?

nova socket
quartz portal
#

Where can I find out what arguments are being passed onto the function OnCreate?

#

Something like Recipe.OnCreate.TorchBatteryRemoval uses items,result, and player, but nothing in recipes.txt mentions anything about a player variable getting passed.

humble elm
humble elm
#

LOL no

atomic crow
#

I love this mod for a variety of reasons, mainly that it makes any weapon viable if you focus on it enough, but it always annoys me that it doesn't work with modded weapons, I'd love to try my hand at reworking this to do such a thing without the manual process of making patches for every melee weapon mod I can find, or at least to float the idea for anyone else who might be interested in giving it a swing.

median prairie
#

Nice sounds like a big undertaking, and I wish you luck

atomic crow
#

That's what I was worried about, like I said I was hoping to try and make it dynamic, so that anything that can be used as a melee weapon is subject to it. There's another mod that does something similar but for backpack upgrades, not quite the same process but it works for basically all modded backpacks/containers without needing to be patched for every single one individually.

#

This one

bronze yoke
#

i think it can be done

#

didn't look too closely at the specifics of this mod but as long as it can be implemented by editing the stats of an inventory item instance it should be doable

atomic crow
#

Might give it a shot then, see what I can accomplish on my own...

true vault
#

🧐 is it possible to make an item "cookable" but not able to be eaten/consumed?

atomic crow
#

Presumably since it's possible to make ones that can be frozen but not eaten.

true vault
#

Hmm... fair point.

cobalt fiber
#

Again, thanks for the explanation!

cobalt fiber
median prairie
manic relic
#

how does PZ like distribute different items? Like how does it make items spawn in police lockers for example?

#

and how could I do that so it does the same to clothes of my mod?

atomic crow
# manic relic and how could I do that so it does the same to clothes of my mod?
The Indie Stone Forums

This is a visual guide for mappers and modders who need to add or modify PZ's loot entries using the new ProceduralDistributions.lua approach. Whilst the ProceduralDistributions.lua file has been in the game for quite a while (i.e. the Gigamart shelves having distinct loot types), TIS will be eve...

hollow current
#

function ISInventoryPage:onSearchButtonPress()
    -- create a modal dialog box with a text input field
    local modal = ISTextBox:new(0, 0, 280, 180, getText("ContextMenu_searchTip"), "", self, ISInventoryPage.onSearchSuccessful)
    modal:initialise()
    modal:addToUIManager()

    -- set the focus to the text input field so the player can start typing right away
    modal.entry:focus()
end

function ISInventoryPage:onSearchSuccessful(button)
    -- Check if the OK button was clicked
    if button.internal == "OK" then
        -- Check if the textbox input is not empty
        if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
            searchString = button.parent.entry:getText()
            self:onSearchContainer(searchString)
        end
    end
end```

This is part of my code for a mod I've created a while back. Was wondering if its possible to have the "enter" key pressable to do the same result of ``if button.internal == "OK" then``
chilly flint
#

hey, I want to make a mod that makes a animal.
But I have a problem when I try to make a butcher recipe.
Basicly the animal has a age value of 12 (when rotten) but the meat one of 4 (bacon).

if I do :

local porkChop1 = InventoryItemFactory.CreateItem("Base.PorkChop")
local rotten = animal:isRotten()
porkChop1:setRotten(rotten)
inv:AddItem(porkChop1)

this will not give me a rotten meat but instead a fresh one since the newly spawned meat has a age value of 0.
If I do setAge instead, the problem is that the meat can be bad before the animal is.
I can lower the rotten value, but I would like to not do it. Any suggestions?

granite ginkgo
#

Does the size look wrong??

restive tendon
granite ginkgo
#

hmm,so gotta go smaller I guess

nova socket
#

Any UI enthusiasts?
Why in the world ISUIElement scroll might not be rendered right? It doesn't visually scroll. The actual list is scrollable, you can even scroll the scroll manually with cursor to get the results but once is scroll it with mouse scroll its just static.

Is there something besides setYScroll(number) to make it move in onMouseWheel event?

buoyant sky
#

can someone tell me where lua local AuthenticPrisonerClassic2 = { name="AuthenticPrisonerClassic", gender="male", chance=0.5, }; ZombiesZoneDefinition.Prison[AuthenticPrisonerClassic2] = AuthenticPrisonerClassic2; The outfits to these special zombies are saved? I don't need the one from authentic just overall where such outfits are saved

neon bronze
nova socket
#

hm, deriving from ISScrollingListBox didn't change much.

neon bronze
#

Why not just put in an instance of it?

nova socket
#

UI is a bit more complex

#

but I found out

#

in case setScrollWidth(number) is mandatory to make scroll to work visually.
It does seem ISUIElement doesn't have this setup proceduraly when its object is created.

tropic hedge
#

Hi

I wanted to retrieve the Steam ID,

    local getSteamID = IsoPlayer:getInstance():getSteamID()
    print(getSteamID)

but the result is this 7.5561195083547136E16, not that 75561195083547135 ( correct )

7.5xxxx7136E16 ( not correct ) < 75xxxx7135 ( correct )

Bye

idle knoll
#

I'm starting my fun with Tails. In the foreground, I decided to prepare a package containing road signs. Here are some examples of speed limits. What do you think?

eternal stirrup
#

very nice

tardy wren
#

Does anyone know if it's possible to add entries into the translator from Lua?

#

I'd like to rename a bunch of recipes without writing a Translate.txt file manually

hasty vector
#

Is there anyone who knows what value among a weapon's parameters is related to stamina consumption

tardy wren
#

it's encumbrance

manic relic
#

So if I get this right...

#

This is the ProceduralDistributions.lua, if I now take my mod and slap it in there with a number (which is the chance of the item spawning) it should show up, right?

#

just as an example

neon bronze
#

You can BUT i advise you to do table.insert for mod compatibility

manic relic
#

whats that

neon bronze
#

Table.insert inserts value into a lua table

#

So you dont need to write out the whole list or the whole file

manic relic
#

okay thanks,

#

how I do that

neon bronze
#

But just require the distro file and then table.insert(your list, your value)

manic relic
#

are they in the game root?

neon bronze
#

Game root?

manic relic
#

like in the vanilla game folder

#

in the folder created by steam

neon bronze
#

Oh i think they are in shared

manic relic
#

shared?

tropic hedge
#

Hi

If I write a mod data, turn off and on the game, the mod data is retrieved correctly.
However, if I write mod data, but for some reason the client crashes before the client is closed properly,
the mod data is lost. What can I do?

bye

plain sundial
#

Is it possible to add Lua packages via Luarocks to a mod?

sour island
tardy wren
#

I think not

sour island
#

You could use Google sheets to automate much of it

#

Also Poltergeist has something of an automated translation thing

#

I assume by the way you typed it you're looking to avoid having to enter multiple repeated lines?

tardy wren
#

We have a whole system to delete recipes, by making them uncraftable

#

Issue is, they show up in craft helper even if hiden

mellow frigate
#

Hello there, do you know an exemple of modded sandboxoption string variable

tardy wren
mellow frigate
tardy wren
#

One sec

mellow frigate
#

I am not looking for integer, double, enum, boolean, only string

tardy wren
#
option DaikonMorePerishables.OverrideList
{
    type = string, default = ,
    page = DaikonMorePerishables, translation = DPF_OverrideList,
}
tardy wren
#

the space in the default is the most important part

sour island
tardy wren
#

I think shared

#

Yeah, shared

#

it's done like this

        recipe:setIsHidden(true)
        recipe:setCanPerform("nope")
#

the "nope" function just returns false

#

Sadly Craft Helper shows hidden recipes regardless

sour island
#

Obsolete?

#

Are hidden recipes meant to not ever be used?

mellow frigate
fast galleon
tardy wren
#

Weird...

fast galleon
#

if you find something please post update 🙂

tardy wren
#

Our sandbox settings don't change unexpectedly anymore because of my mod to sync them over Lua

#

Eve wanted to patch Craft Helper Continued a while ago...

#

But our list of to-do stuff is bigger than B42 patch notes

cedar anvil
#

I'm trying to import another Lua file into here, but this isn't working. Could anyone tell me what should I fix here? ```---MainTest.lua
require "ZamazonWeapon"

local foodprice = foodpricezand---ZamazonWeapon.lua

local foodpricez = {
4,
9,
8,
1,
2
}

return foodpricez```

fast galleon
#

I assumed they changed the sandbox option because it is checked OnPerform but this issue is reported too often.

Just checked and the recipe is hidden with these two conditions. Although I do the reverse, it's hidden by default and I unhide it.

tardy wren
#

Don't remember when the deleter code runs exactly

bronze yoke
cedar anvil
hollow current
sour island
#

Excited about the cache'd textures - will this come with different coloring methods? The current one is multiplicative I believe - I wanted to make outlines using 4 drawn images and I wasn't able to get a solid white using the current methods.

#

Would also be neat to merge a shading overlay onto a solid base for color variants rather than the usual recolor

frank stone
#

how to make a crafting recipe?

mellow frigate
hollow current
#

hmm it doesn't seem to have any effect

#
if button.internal == "OK" or isKeyPressed(getCore():getKey(Keyboard.KEY_RETURN))```
~~I assume that's the correct way to implement it~~ actually nvm this function is called when player clicks a button with mouse so obv pressing enter won't have an effect
covert carbon
#

how do you clear the error logs

#

it gets messy when I make 100 errors

atomic crow
#

That’s the only way

#

Or go back to the menu and reblog

covert carbon
#

it keeps saying I am returning nil, I do not know why if getPlayer():getPrimaryHandItem():getAmmoType().isInPlayerInventory() == true then

bronze yoke
#

getAmmoType returns a string, getAmmoType().isInPlayerInventory() isn't valid

covert carbon
#

What does it need to be valid?

verbal yew
#

what do SendClientCommand?

#

share info on the server for other players?

#

it's same if i just throw func in server folder? without SendClientCommand on client side func?

fathom goblet
#

Gotta love it to read PZ source code and just blobfoxfloofcofe
From what i understood is that first method does... some kind of preparations ig? Creates item objects and puts... scripts in map i guess??
Im not sure, it is a bit hard to read decompiled code of pz blobfoxfloofcofe

raw tulip
#

are these fair? should I increase, decrease add or remove some items/skills?

tardy wren
#

I'd maybe increase the car battery charger a bit

#

Both in skill and cost

raw tulip
#

how so? why do you think that?

tardy wren
#

The cost may be fine... Maybe not enough wire

#

But skill seems too low

#

Also remember to mark the tools as "keep"

raw tulip
#

how much wire should be required? yeah I checked to make sure to keep the aforementioned items in the recipe hahahaha after wondering why it consumed the tools

tardy wren
#

Maybe 4?

#

Also, I think the generator should take Engine parts

raw tulip
#

interesting.... engine parts makes sense

tardy wren
#

It does consume petrol and spit out electricity

#

It's a gas engine connected to an electric turbine after all

raw tulip
#

oh.. apparently theres "wire" and "electric wire"...
wire is used for something else Blinking
perhaps I should remove "wire"

tardy wren
#

Also don't forget to lock them behind magazines

#

Normal wire is for fencing

#

I suppose, electric wire is next to useless

raw tulip
grand bough
#

Where would I find the ripped clothes overlay?

raw tulip
tardy wren
#

Make your own

vagrant valley
#

Electrical magazine

raw tulip
vagrant valley
#

If you're lazy

grand bough
#

I found 'em, but... I got nothing to compare them to.

#

If I'm right, it should be here...? E:\SteamLibrary\steamapps\common\ProjectZomboid\media\textures\HoleTextures

raw tulip
tardy wren
#

Uh

#

I'd look for a mod that adds a recipe book.

#

One second

raw tulip
tardy wren
#

Look at Udderly Ammo Crafting

raw tulip
tardy wren
#

alternaticely, ZAP Glass Molding

muted garnet
#

how can I save progress or reduce time of timed action? For example, if I have a very long timed action, and the player has already waited half the time and canceled the action, then if he starts the action again, he will either have saved progress, or the required time will decrease to what he did not have the last time end of action?

nova socket
#

Anyone knows if there is a way to make Result in recipes to be empty?

#

P.S I only need resulting items related to what I do in a function

vagrant valley
#

RemoveResultItem:true,

tired wave
#

Is there a red rain mod?

hasty vector
#

is there anyone knows zpop_x_y.bin, x and y meaning?

dull moss
#

is getPlayer() a valid IsoGameCharacter ? trying to force player to sit and prevent movement

    player.setSitOnGround(true);```
#

it is, right? HUH
am I missing something?

neon bronze
#

Yea it is

#

GetPlayer gets you the current player you play as

dull moss
#

Yea, I know that one

#

I'm more interested why can't block movement PepeThink

#

Oh, something else was interfering

#

I did dot

#

instead of :

#
player:setBlockMovement(true);```
this works
#

I constantly mess those 2 up

#

too used to working with moddata tables and you use . there

#

now it works, however still can't force player to sit, any ideas

#

hah

#

thanks god for decompiled pz code

#

yoinked this by looking up sit in libs
player:reportEvent("EventSitOnGround");

#

another question though, block movement prevents moving altogether, including rotating character to look around. any way to be able to rotate while preventing movement?

balmy swan
#

Would anyone happen to know in what part the UI tooltips for weapon attachments are displayed? I may have done a ctrl+f on all the LUA files, but I couldn't find it- figured if it was hardcoded.

Trying to see if I can change the name of the weapon attachment type when looking at specific weapon, to go around the whole 'can't make new weapon part types' problem

atomic crow
dull moss
atomic crow
#

Odd, because you should still be able to turn in place if that’s the case

wet sundial
#

I need help with getting a custom recipe skillbook to spawn in game. I've made a custom item in this same mod that spawns just fine, but for the recipe book (which I just copied from the game's code and renamed it as a test) it doesn't show up in crates.
I'm using (in the lua/distributions folder)```require 'Items/ProceduralDistributions'

table.insert(ProceduralDistributions["list"]["BookstoreMisc"].items, "EnginePartsMag");
table.insert(ProceduralDistributions["list"]["BookstoreMisc"].items, 2);```

I've noticed that it does show up in LootZed but the actual item looks blank

idle dawn
#

Reposting this for the funny, definitely relevant though.

wet sundial
fringe heart
#

Does anyone know what is the problem?

#

local function firstaidboredomheal()
local player = getPlayer()
local stats = player:getStats()
local boredom = stats:getBoredom()
local bodyDamage = player:getBodyDamage();
if boredom >= 99 then
bodyDamage:AddGeneralHealth(100)
stats:setBoredom(0)
end
end

Events.EveryOneMinute.Add(firstaidboredomheal);

wet dune
#

Hey guys,
Is it possible to auto equip the players a outfit?

#

Based on faction

wet dune
rigid mauve
#

Ah, probably something to do with this. I'll keep combing the channel

chilly flint
#

Hey hey, I have a question.
I'm currently doing a addon for Hydrocraft in wich you can craft Mags for Arsenal gunfighter.
My problem is that somehow the 9mm and the 5.56 mags do not work.
Other Vanililla mags work and the VSS recipe dose.

Did I do anything wrong ?

recipe Make VSS Magazine
    {
        HCSmallMagazineCase=1,
        HCSteelspring=1,
                keep HCSmithyhammersteel/HCSmithyhammertitanium,
        keep HCAnvil2/HCAnvillead2,
                 CanBeDoneFromFloor:true,
        Result:VSSClip,
        Time:150.0,
                Category:Smithing,
                OnGiveXP:HCWelding_OnGiveXP,
    }

recipe Make 5.56x45mm STANAG Magazin
    {
        HCMediumMagazineCase=1,
        HCSteelspring=1,
                keep HCSmithyhammersteel/HCSmithyhammertitanium,
        keep HCAnvil2/HCAnvillead2,
                CanBeDoneFromFloor:true,
        Result:556Clip,
        Time:150.0,
                Category:Smithing,
                OnGiveXP:HCWelding_OnGiveXP,
    }    

fringe heart
#

And how will the event be after eating a certain food? Event.eating(smth food).add?

verbal yew
#

i think it problem in "." in recipe id

#

Make 556x45mm STANAG Magazine

chilly flint
#

okey I will try

verbal yew
#

just do "." in localisation file

chilly flint
#

Sure, thanks for the tip. I will try it out once I got the time for it

mellow frigate
#

Hello there, fellow modders. I am looking for the frames of the Fire01 animation (this is the default/small size fire tile animation pictures used by IsoFire in its small state). Do you have any idea where I can find those frames ?

chilly flint
#

I also double checked the mediumcase Item. This also works with other recipes

bronze yoke
#

is this exactly how the script is written or are there more recipes between them?

#

a syntax error in one recipe will cause it to refuse to load the remainder of the file

#

so if there's other recipes between them i would look at the one before the one that isn't appearing

muted lynx
#

Alright, quick question, I am fairly new/Basic to modding in project zomboid and I got below basic experience in lua, but how would one add a cooldown between doing recipes? So one you've done it, you gotta wait until you can do it again?

chilly flint
drifting ore
#

Hey, i have a model for a weapon. how would i go to adding it ingame with the item i created?

#

looking at the vanilla files, the models seem to be in an x file format? what is that?

atomic crow
drifting ore
#

would fbx work fine?

#

since i use blender

atomic crow
#

shrug Models and file formatting isn’t really my area, I’m not really the person to ask. You might have more luck in #modeling tbh.

drifting ore
#

Alright i will go there

hidden compass
#

Does anyone know when IsoObject#update is called in Java?
Is it called every tick?

wet sundial
hasty vector
#

Do you know the formula for calculating weapon damage in Project Zomboid? Also, does anyone know if the critical hit chance is the chance for the zombie to be instantly killed?

idle knoll
karmic sonnet
#

how does one upload a mod to workshop

atomic crow
karmic sonnet
#

thankyou, i figured it out believe it or not 😂

verbal yew
#

how to override already existing recipes?

#

Override:true?

#

with same recipe id?

fast galleon
#

recipes have names and they can be same names for multiple recipes.

#

I don't use the override but I have the impression it doesn't work well when multiple recipes use the same name?

verbal yew
#

i want do step by step thing for this.
like:
Rip clothes => Ripped Sheets + Thread
Ripped Sheets + Thread + k: Needle => Sheet
Sheet => Sheet Rope
Sheet Rope => Sheet
Rip Sheet => Ripped Sheets + Thread (but low then before)

sonic needle
#

M1 FREEBRUMS

hollow current
#

@mellow frigate got a quick question about your mod Moodle Framework. I faced an issue where the moodle is being shown for all players online on a server. I am using it for one of my mods in a function as follows:


--The following function is called for the event onPlayerTakeDamage
function Knockout.onPlayerTakeDamage(character, damageType, damage)
    if isServer() then return end --If the code is running on serverside, don't execute the code (tried with and without this line, still same result)
    if character:getModData().Knockout_isKnockedout then return end --Ensure that the player can only get knocked out if he's not already knocked out

    if instanceof(character, "IsoPlayer") then  --Check if the damaged character is a player and not a zombie

       --More code that executes the function *Knockout.setUnconscious(character)* based on certain requirements
    end
end

--Knockout.setUnconscious(character)
function Knockout.setUnconscious(character)

    local playerIndex = character:getPlayerNum() --Get player num

    ISTimedActionQueue.clear(character)
    ISTimedActionQueue.add(Knockout_TimedAction:new(character, playerIndex))
end

--Timed Action
function Knockout_TimedAction:start() -- Trigger when the action starts
    self.action:setBlockMovementEtc(true)
    Knockout.disabler(self.character, true) --Disable player controls

    self.character:getModData().Knockout_isKnockedout = true

    UIManager.setFadeBeforeUI(self.playerIndex, true)
    UIManager.FadeOut(self.playerIndex, 1) --Show black screen

    local moodle = MF.getMoodle("Knockedout");

    if moodle then
        moodle:setValue(0)
    end
end```

if you (or anyone else) got a solution about this, would be lovely
mellow frigate
mellow frigate
hollow current
# mellow frigate unless you changed from default thresholds, moodle:setValue(0) is activating the...

its deactivated at:

function Knockout_TimedAction:perform() -- Trigger when the action is complete
    self.character:setBlockMovement(false)
    Knockout.disabler(self.character, false) --Enable player controls

    UIManager.FadeIn(self.playerIndex, 1)
    self.character:getModData().Knockout_isKnockedout = false

    local moodle = MF.getMoodle("Knockedout");

    if moodle then
        moodle:setValue(0.5)
    end
    
    if self.sound then
        self.character:stopOrTriggerSound(self.sound);
    end
end```

but I am not sure how is that relevant to making the moodle show for all players instead of only the target player
mellow frigate
#

maybe ensure the stop action deactivates the moodle too

#

you'll still have the "bugged action, clear queue" inconsistency but considering you also block movements, the moodle would be the last of your problems

#

you could remove all moodle interaction from the timed action and do OnPlayerUpdate: ```lua
function knockedout.OnPlayerUpdate(isoPlayer)
local moodle = MF.getMoodle("Knockedout");
if not moodle then return end
if isoPlayer:isBlockMovement() then
moodle:setValue(0)
else
moodle:setValue(0.5)
end
end

hollow current
#

I will try that, will also try different stuff with the onPlayerTakeDamage to see if the issue roots from there. Thanks!

mellow frigate
hollow current
#

oh. Any way around it?

mellow frigate
#

not really: 1/ not using Moodle Framework 2/ not using splitscreen 3/ giving me the evolution

hollow current
#

Will see if I can figure something out

weary charm
#

Here’s an idea

Diabetes trait (Hardcore Mod)
A trait that forces u to actually look out for what u eat.
No more chugging ice cream tubs, maybe now the nutrition trait will be useful so u can see what has what.
Insulin could be added in the game as to something to worry about, so look for it in stores or clinics/hospitals.
Thats my idea hopefully someone tries it out

verbal yew
weary charm
#

Lmao yeah

verbal yew
#

It’s not that I’m a fan of negative traits and that I’m so immersed in RP...
The idea itself is interesting, make a list of foods based on carbohydrates and assign them “bread units” (I don’t know how it is in English) in order to suppress the new scale of “sugar in blood” needs.

#

From all my experience communicating with people with diabetes, I remember that insulin should be kept refrigerated.
It's basically just another story about how you die.

atomic crow
#

Depending on how complex the build 42 crafting system is it might be viable to implement some sort of insulin synthesis as well, it would take a very high medical level though.

verbal yew
#

build New world with blackjack, Guns and Insuline

#

with fitozombies (10 years edition) and zombodrugs...

sour island
#

I have the black jack covered

verbal yew
#

Nice, take brita guns with improved projectile

#

need slu....ops! insulin i wanna say

#

New world done on 66,6%

weary charm
verbal yew
#

mmm, yumme drunk

verbal yew
#

start with one long insulin and one normal (~15 days)

#

shuga-meter with tests or just pee and try lick it if not have tests

weary charm
#

Oh shit this all coming together now ain’t it

sour island
atomic crow
#

I wouldn’t say it’s too far, it’s an interesting way to spice up long term survival and give it a unique challenge that would be pretty tough to overcome IRL

chilly flint
#

hey quick question.
When I use special characters in for translation it gets bugged ingame.
The Translation file dose not have those errors.

It looks like this:

verbal yew
#

or... check original pz de localisation with notepad++

chilly flint
verbal yew
#

use same

#

or just copy original file and rename it and change content in them

fast galleon
drifting ore
#

Is there any way (Server setting etc.) to set-up sleep recovery modifactor? Like when I lay down, that I recover more. Actually I would really need to lay for 10 hours to recover, which is not my intention. Is there a sleep-length modifier or something I can work on?

manic relic
#

okay so quick question

#

this is my (test) version of the distribution system

#

to make my item spawn I need to replace the "TUT.Someitem" with the name of my item

#

for example "Hat_monky_black"

#

is that correct?

neon bronze
#

Youd need the full type

#

Along with the module name

bronze yoke
#

the space after ArmyHangarOutfit will cause issues

manic relic
#

what do you mean with module name?

neon bronze
#

Like Base

#

Everytime you declare a new item in the script file you write what module its in

#

Like
Module Base{

}

manic relic
#

?

#

I still dont get it?

neon bronze
#

You need smtj like Base.BaseballBat

#

If you put just BaseballBat it will not spawn it probs

bronze yoke
#

it will assume base when the module isn't specified

#

but mods should avoid using base

neon bronze
#

Is there a load issue associated with putting stuff into base or is it purely to categorise modded and unmodded stuff?

fast galleon
#

it should make it faster to find stuff and improve compatibility

neon bronze
#

So the latter

chilly flint
fast galleon
#

it's a text editor thing, search based on the program of your preference and when you are editing the file use the appropriate encoding.

bronze yoke
fast galleon
bronze yoke
#

there can only be one Base.Apple, there can be a hundred MyMod.Apples so long as each mod has a different module

chilly flint
fast galleon
chilly flint
#

ah I see! Thanks very much I will try this then now

fast galleon
sour island
#

Updating conditional speech a bit
DrunkSlurring: {"o:uh","s:ch","s:sh","a:ah","u:oo","c:sch","tion:shun","i:ii"}
Results: (1-4 = moodle intensity)

1    yesh, siir.
2    yes, sir.
3    yesh, sir.
4    yesh, shiir.
1    must be nice having a vacation
2    musht be nice having a vacation
3    musht be nice hahving ah vaschahtion
4    moosht be niice hahviing a vahschatiiuhn
1    suh mahny dead
2    shuh many dead
3    so many deahd
4    shuh mahny deahd
1    i'm nuht drunk you're drunk!
2    ii'm not drunk you're drunk!
3    i'm nuht droonk yuhu're droonk!
4    ii'm nuht droonk yuhu're droonk!
1    Thish is an example of the drunk filter in action.
2    This iis ahn example uhf the drunk filter in action.
3    Thish iish ahn exahmple of the droonk filter in action.
4    Thiish iish ahn example uhf the droonk fiilter in aschtiion.
#

seems to not be scaling too well though lol

brave ruin
#

Yo, I have a question but not regarding mods. Is it easy to make a town / add stuff to the map. If someone got spare time to help me start it up? Like do I need to download any programs and such?
Would like to try and maybe stream while doing it

brave ruin
kind veldt
balmy terrace
#

is there any known solution the fact that sandboxvars load after the distribution event for items fires?

bronze yoke
#

yeah, you can just get the itempicker to reparse the distributions

balmy terrace
#

ItemPickerJava.Parse()?

#

i don't know if that helps with the use case of trying to make a mod's item distribution configurable with sandboxvars

bronze yoke
#

it does

#

just wait for sandbox options to become available, edit the distributions accordingly, and then parse them again

balmy terrace
#

that feels, not very peformant

bronze yoke
#

it feels mandatory 🤷

#

it's all going to happen at load time anyway

#

it's a bit of a shame that every mod has to do this individually but it's not really a big deal

balmy terrace
#

well, in that case, would I just be avoiding changing the distribution tables until the sandbox vars are available? wouldn't i have to wipe any changes i made on previous boot or does the game only build item distribution tables on startup?

bronze yoke
#

it's lua, it resets when lua does

#

OnInitGlobalModData is the event for this

#

it's the first event to fire after sandbox options load

balmy terrace
#

hmmm, wouldn't it be easier to hook into OnFillContainer and modify the outputs based on your sandbox vars, like the vanilla game supposedly does?

bronze yoke
#

would that be easier? 😅

balmy terrace
#

hmmm probably not

bronze yoke
#

i've done something similar for some non-vanilla spawning logic and it's definitely the more complicated way of doing it

#

and less performant

fallow osprey
#

for some reason, all my lua callbacks stopped working suddenly without changing anything

#
function OnPlayerAttackFinished (playerObj, currentGun)
    print ("fired!")
end
Events.OnPlayerAttackFinished.Add(OnPlayerAttackFinished)

does not print anything when attacking, even though it worked fine just a couple days ago

nova socket
bronze yoke
#

the game is attempting to sync the generator but the generator isn't actually added to the square

nova socket
#

I found out why its happening

#

Its happening because I issue generator from server.

#
-- Create gen
local item = InventoryItemFactory.CreateItem("Base.Generator");
local object = IsoGenerator.new(item, cell, square);
object:getModData().isProp = true;
object:transmitModData();
object:transmitCompleteItemToClients();
object:transmitCompleteItemToServer();

However it has nothing to do with specified square location.

#

Found sympthoms: if square is unloaded (player leave elsewhere) it also starts spamming this on server-side

#

How creating a new IsoGenerator object causing such a meltdown is not something I'm able to grasp.

#

Nevermind, update: if you do any of

gen:setFuel(100);
gen:setActivated(true);
gen:setCondition(100);

Without transmitting it on server side it starts to do something weird and lookup some unknown gens in uncertain squares.

#

Might be some networking bug with updating IsoObjects since I don't either create or lookup gen at that square and basically coordinates are different everytime as player moves around the map, looks like just any random existing generator found in currently loaded cell.

heady crystal
#

Is there an event or anything similar for when a player reads a book, magazine, etc?

heady crystal
#

I saw that but can you hook a timed action without overriding it?

bronze yoke
#

they're just a bunch of functions, you can hook them like anything else

heady crystal
#

Oh neato

#

Thanks!

remote sonnet
#

How do you get rid of the fake infection?

This right here dosen't seem to work.
playerObj:getBodyDamage():setIsFakeInfected(false);

mellow frigate
remote sonnet
#

Any references? I'm trying to set the fake infection to false not the infection.

bronze yoke
#

i think you need to set their fake infection level to 0 in addition to disabling their fake infection

remote sonnet
#

Well I fixed one issue but somehow managed to create an infinite loop -_-

mellow frigate
remote sonnet
#

Hah! 😂

#

So this is creating the infinite loop.
As long as the ReduceFakeInfection is TRUE the section get's skipped, as soon as the timer runs out it starts increasing the timer again and so on...

raven zinc
#

Anyone got any tutorials for adding custom hats? I'm loosing my mind 😭

nova socket
#
-- Server
local object = IsoGenerator.new(item, cell, square);
object:transmitCompleteItemToClients();

Creates two IsoGenerator objects on client side,
1: Object not being networked (cannot update without exceptions thrown on both sides)
2: Object that is networked

How to deal with that madness, I can't not instantiate and instantiate object of IsoGenerator to transmit it...

bronze yoke
#

do you have a client check in your code? i would immediately suspect that the code is running on the client as well as the server

nova socket
#

i commented the check out (hosted game)

#

3 hours of my life gone due to one missing return

bronze yoke
#

😔

nova socket
heady crystal
#

Happens to the best of us. Poor albion saved me days of banging my head against a wall at the cost of her sanity 😦

remote sonnet
#

So I figured out the issue, but I can't think of a way to fix it...

Once yellow is TRUE it ends on red. Once yellow is FALSE it continues on green. Even though fake Infection should be set to FALSE, one line above yellow.

What the hell am I missing here?

remote sonnet
#

Nvmd. Figured it out... Has to do with the bite itself -_- Urgh.

verbal yew
#

Guys, who can help me write injection?

median prairie
verbal yew
median prairie
#

I was adding a new GUID. I'll try keeping it the same.

#
        <m_Name>GruntTesting</m_Name>
        <m_Guid>f75f1a6a-3d09-45d1-aeac-4d55524cb2a2</m_Guid>
        <m_items>
            <itemGUID>8973893f-f324-4cdb-a32b-43cd0378174f</itemGUID>
            <subItems>
                <itemGUID>229b23f6-8e8f-4f16-837b-4fe950c48bfc</itemGUID>
            </subItems>
            <subItems>
                <itemGUID>06b8adc1-ef58-4545-a30a-6ca9920c1b82</itemGUID>
            </subItems>
        </m_items>
        <m_items>
            <probability>0.3</probability>
            <itemGUID>8fc17470-453b-4ed0-945d-c20ba6f5af59</itemGUID>
        </m_items>
        <m_items>
            <itemGUID>903c06ea-78e7-4f42-a3da-768be61f216f</itemGUID>
        </m_items>
        <m_items>
            <probability>0.3</probability>
            <itemGUID>4b278ded-d489-4b64-b457-e059a9963beb</itemGUID>
        </m_items>
        <m_items>
            <probability>0.2</probability>
            <itemGUID>7b339ad5-da2e-42a5-8a51-ee87239a943c</itemGUID>
            <subItems>
                <itemGUID>d90d4976-d993-4fae-ad78-f5a4fcf05366</itemGUID>
            </subItems>
        </m_items>
        <m_items>
            <probability>0.1</probability>
            <itemGUID>825f5380-d6ef-4cf8-8d77-d3a115724f4a</itemGUID>
        </m_items>
        <m_items>
            <probability>0.2</probability>
            <itemGUID>cba6763a-6897-4631-8748-0c15f5450c93</itemGUID>
        </m_items>
        <m_items>
            <itemGUID>6fed6e2b-3a72-4bac-aac5-09585984493d</itemGUID>
        </m_items>
        <m_items>
            <itemGUID>ebea15c8-99b3-4e20-905b-d22cf82b8217</itemGUID>
        </m_items>
    </m_FemaleOutfits>```
#

same as the young outfit type

#

I'll give it a shot

fast galleon
# balmy terrace that feels, not very peformant
    if ItemPickerJava.doParse then
        ItemPickerJava.doParse = nil
        ItemPickerJava.Parse()
    end

this is added to the lua table, have that in mind if you do java mod. You should add this to an event after OnInitGlobalModData and before the cell is loaded.

verbal yew
#

OU!

#

I know its problem

#

all clothes items u use in mod for zombie preset should be duplicated in this file

#

like this

#

for example

#

our new preset has only vanilla clothes, but fileGuidTable not contain this info

median prairie
#

oh

#

yea I've been trying to make them wear vanilla clothes, that makes a lot of sense

#

thank you

verbal yew
verbal yew
#

Guuuys, how to write injection?

fast galleon
#

?

verbal yew
#

or why global func not overwrite another global func with same name?

verbal yew
#

never mind, i'm complete another way

prisma gale
#

anyone have any tutorials on custom ISTTakePillAction code

raven zinc
#

Anyone know where I can find the jumpscare sounds in the game files?

sage eagle
#

someone help my savior

#

their poor head

hollow current
#

@bronze yoke hello, you suggested to me before the usage of online id instead of player name for sending server/client commands. apparently it returns player as nil when I tried it the way you suggested, however, when I used names, it works fine (which isn't optimal considering the problems you mentioned)

--Function gets called from onWeaponHitCharacter event. I am trying to add a timed action to the target player, but a bug happens where the timed action is applied for both attacked player and target player (possibly all other players online too), and the only way I found that fixes it, is sending the target player's username to to a client command, then sending it to a server command to apply the timed action.

function Knockout.onWeaponHitCharacter(attacker, target, weapon, damage)
    if target:getModData().Knockout_isKnockedout then return end --Ensure that the player can only get knocked out if he's not already knocked out

    if instanceof(target, "IsoPlayer") then
        --lots of irrelevant stuff here
      local onlineID = target:getOnlineID()
      print("ONLINE ID FROM _DAMAGES IS: " .. onlineID)
      sendClientCommand('RealKnockouts', 'knockPlayerOutByID', {onlineID})
    end
end```

Client Command:
```lua
function Commands.knockPlayerOutByID(onlineID)
    local player = getPlayerByOnlineID(onlineID)
    sendServerCommand(player, 'RealKnockouts', 'knockPlayerOutByObject', {player})
end```

Server Command:
```lua
--This is where the error happens, player being detected as nil
function Commands.knockPlayerOutByObject(player)
    local playerIndex = player:getPlayerNum()

    ISTimedActionQueue.clear(player)
    ISTimedActionQueue.add(Knockout_TimedAction:new(player, playerIndex))
end```
#

I noticed that player object is fetched from the client command and sent to the server command according to the code snippet you sent as well. Wouldn't they be different clientside/serverside?

#

.

mellow frigate
# hollow current <@119473430289448961> hello, you suggested to me before the usage of online id i...

If OnWeaponHitCharacter is called on the target Client side, you do not need all that network stuff: just apply the stun locally. If it is called on server side, you only need one message from server to client. ```lua
--also this is invalid because you cannot serialise the player into the args for network transmition:
function Commands.knockPlayerOutByID(onlineID)
local player = getPlayerByOnlineID(onlineID)
sendServerCommand(player, 'RealKnockouts', 'knockPlayerOutByObject', {player})
end
--replace by:
function Commands.knockPlayerOutByID(onlineID)
local player = getPlayerByOnlineID(onlineID)
sendServerCommand(player, 'RealKnockouts', 'knockPlayerOutByObject', {onlineID})--you also can just remove any args, because the client called already can find getPlayer()
end

#

you may wanna use isoPlayer:isLocalPlayer()

hollow current
#

I will try sending the server command directly, or doing an if condition for isLocalPlayer()

mellow frigate
# hollow current That's what I tried initially, doing the stun directly without usage of client/s...

if doing it locally does too much, using network cannot be the solution, filtering locally can. ```lua
--client side
function Knockout.onWeaponHitCharacter(attacker, target, weapon, damage)
if not instanceof(target, "IsoPlayer") or not target:isLocalPlayer() then return end
if target:getModData().Knockout_isKnockedout then return end --Ensure that the player can only get knocked out if he's not already knocked out
Commands.knockPlayerOutByObject(target)
end

tardy wren
#

It works... I don't anymore

mellow frigate
tardy wren
#

This is to patch packing recipes

#

For the mod that makes non-perishables perish

hollow current
tardy wren
#

I have to find what item to patch by crawling recipes... Have to go two levels to make a loop

mellow frigate
tardy wren
#

Didn't profile it for basegame

hollow current
tardy wren
#

It's in a file because of Discord message length limit

#

Remember

hollow current
#

haha yea

tardy wren
#

GetAllRecipesFor doesn't like items with modules

#

Recipe result is an item without the module

#

At least in my testing it was

#

if it turns out it can be both I will run into Louisville naked

mellow frigate
tardy wren
#

There are a few spots I can apply those, yes...

#

I have switched from writing good code to writing working code

mellow frigate
#

the lua cost of java loop array management can be mitigated. but that's only if you need it. you'll see

tardy wren
tardy wren
#

Then I will check... might improve the code a bit

#

Gotta ask

#

Caching class functions only works if I work on the same item, right?

#

Or rather instance

mellow frigate
tardy wren
#

Really?

mellow frigate
tardy wren
#

I thought it would save a reference to the object's function, not the class'

mellow frigate
#

the method definition is not duplicated with each instance or it would take so much more space.

tardy wren
#

So it's kind of like... The reference is static?

#

Or rather... To lua, all methods are static?

mellow frigate
#

I do not know for lua, but for c++ (and I guess for java it is approx the same) methods are defined once per type, with a virtual table for indirection in case of inheritance & override.

tardy wren
#

Uh huh...

#

If I cache my method... how do I use it then? Let's say, I cache item:getFullName() into scriptItem_fullName

mellow frigate
#

you do not cache instance stuff in file scope, you cache only type stuff at this level. instance stuff remains cached inside your lua functions ```lua
local item_base = __classmetatables[InventoryItem.class].__index
local item_getFullName = item_base.getFullname
function myluadFunction(params)
--..
local instancefullname = item_getFullName(item)
--..
end

#

I see some Poltergeist around there. that's good. he knows better than I do and I got to go.

tardy wren
#

Okay

mellow frigate
#

do not forget your minecraft session 😄

tardy wren
#

I have to go make dinner

#

So I cannot play regrettably

#

Maybe in the evening

vernal island
#

there is a mod that changes ISReloadWeaponAction.attackHook on onGameBoot, how can I override that with my mod's custom attackHook? I am kinda confused how game manages onGameBoot's load order. maybe I should change my modID/filename to make it last?

tardy wren
#

FileName

#

As in the file you do the overwrite with

#

You can also do a Require on the file you're patching

weary charm
#

I got a good idea, a negative trait where you start off extremely fatigued on day 1 because your character did an all nighter the night before the apocalypse began, ig like 4 points would be good

#

Very realistic to literally every person ever 💀

tardy wren
#

So you just... lose a few hours of the first day?

pulsar rock
#

Hey hi, is there a way to show things depending on a condition, for only a single player?

#

For example, a floating piece of text, an area marking, etc...?

pulsar rock
#

Also, what the relevant method to check a player's current tile?

rotund dock
#

where (if anywhere visible) can I find the item definitions for refrigerators? Or even any furniture object that is also a container?

tardy wren
rotund dock
#

I found a few (such as the ovens) in the newMoveables file but the capacity is not defined there

#

Is it in the tiles?

bronze yoke
#

the process is: 1) the first client selects the player and sends the online id 2) the server uses the online id to get the player object, sends the online id to the client with that player 3) the second client uses the online id to identify that player and run whatever code

#

you need the player object on the server side so you can send the server command to that specific client but you can't actually send it along

pulsar rock
#

Hey hi, where can I find the documentation related to the addOption method for right click context menus?

#

I can't seem to find it anywhere online in the javadocs, nor in the LUA docs.

bronze yoke
#

it's not in the javadocs, it's pure lua

pulsar rock
#

Can't seem to pinpoint where in the luadocs it is

#

I'm hooking into OnFillWorldObjectContextMenu, and would like to use its context to add some options. However, I'm not sure what the 4 fields mean. The first one is the text, I'm assuming. The other 3 seem unclear, however.

#
_context:addOption("text goes here", nil, nil, nil)
#

The nills over there ^

bronze yoke
#

iirc it's text, first argument, function, second argument, third argument, etc

raven zinc
#

Question, is there a way to replace music files using scripts rather than just replacing the .bank file?

pulsar rock
#

First argument for what?

bronze yoke
#

the function

pulsar rock
#

So

bronze yoke
#

when you click the option it'll call that function with those arguments

pulsar rock
#

First, second, etc... arguments are passed onto the function?

#

That's an odd order hmm

#

Why not have method go first, and then all arguments

bronze yoke
#

yeah i imagine they only needed one at first and didn't plan ahead

pulsar rock
#

Still, if that's it, that's good to know

#

Thanks a lot!

#

Another question, while I have you in here 😅

  • How do I store & load mod data for a save
  • How do I store & load mod data for a square/tile
bronze yoke
#

for a save, ModData.getOrCreate("unique string key") returns a table that saves with the save

#

for a square/tile, most objects have a :getModData() table which saves when the object does

pulsar rock
#

Gotcha, thanks a ton!

finite kettle
#

Hey hi, is there a way to delete a weapon once it breaks? I mean, immediately

drifting ore
#

By chance, is anyone aware of the event OnObjectAdded Event and it's exact usage? does it trigger when a user places the IsoObject at the world level? like placing any of the known IsoObjects?

#

it says added to map, but wasn't sure if that meant just placement in general

bronze yoke
#

iirc it was whenever a object was added by any method other than just loading in

drifting ore
#

perfect tytyty

bronze yoke
#

my documentation on it is a bit lacklustre but the last part might be relevant to you

#

Fires when an object is added to the world. Note: usually not called on the client, but is in some cases.

raven zinc
#

The Sims : Zomboid

frank elbow
#

Oh hell yeah

verbal yew
#

give me two!

#
  • live styles + mods from Birget = rly The Sims
elfin olive
#

Is there a tutorial on how to make a specific amount of objects spawn in a container? Like if I wanted 4 forks to spawn would I have to copy paste the whole fork with a weigh of 100 four times?

atomic crow
elfin olive
#

@atomic crow Thank you.

#

Problem solved I assume lol.

pastel raptor
#

Hi guys I'm a mapper and I'm currently creating 2 maps (Irvington and Shepherdsville) for my RP server. We are desperately looking for a modder. Is anybody available here? We could even pay the work. Please🥵🫡

pulsar rock
#

Hey hi, what would be the most performant way of checking what tile the player is on? Is there an event for entering a new tile?

#

onPlayerMove it is

sour island
#

Still messing with game night - and getting desync. Do floor tiles not actualy count as containers? I'm wondering if the issue is due to that.

heady crystal
#

Does anyone know how to check if there's anything solid in a tile? As in something you could collide with like a crate or something

maiden stump
#

any tips for making a weapon mod?

#

i know lua modelling and animation

lean reef
#

Hey @sour island, sorry to bother but I'm just curious why you used ISPanelJoypad instead of just ISPanel for Game Night, specifically for the window code

#

Game Night has been a massive source of inspiration for me, so I've been poking around at it trying to figure out your secrets lol

sour island
#

I don't think there's an impact to use joypad - but I know there's people who prefer to use controllers - hoping this allows for a patch/update later

lean reef
#

Okay, thanks!

sour island
#

Are you working on an add-on?

lean reef
#

No, I've been trying to make Nonograms!

#

But it was Game Night that sorta gave me the idea for it and let me know it was (hopefully) possible

#

I don't wanna get too into it to not spam the chat about my weird stuff, but I wanted to make a stupid research minigame to gatekeep progression in my mod and I settled on nonograms

mellow frigate
pulsar rock
#

Does transmitModData not work on squares?

#
Exception thrown java.lang.RuntimeException: Object tried to call nil in saveTileData at KahluaUtil.fail line:82..
heady crystal
pulsar rock
#
WarpTiles.saveTileData = function(_tile, _thisLink, _otherLink)
    local tileData = _tile:getModData().WarpTiles

    if not tileData then
        tileData = {}
    end

    if _thisLink.tileType == WarpTiles.tileType.source then
        tileData = {
            destination = _otherLink[1]
        }
    end

    _tile:transmitModData()
end
heady crystal
#

I assume it doesn't work while on a vehicle

pulsar rock
#

_tile being an IsoObject

heady crystal
#

I don't wanna be checking against a list. Would kill performance in my case

pulsar rock
#

Unless tiles/squares aren't IsoObjects, and I've taken a wrong turn somewhere hmm

bronze yoke
pulsar rock
#

🙃

#

Wait

#

But the decompiled luadocs show this

bronze yoke
#

it is capitalised on isoobject unhappy

pulsar rock
#

It is capitalised in my code

bronze yoke
#

but tile is presumably an isogridsquare?

#

which have it non-capitalised

pulsar rock
#

Huh, okay, that's inconveniently random

#

Thanks though! That helps

raven zinc
#

does anyone know what prefix is in tiled?

#

Nvm

hollow current
#

@mellow frigate just wanted to let you know that your solution of IsLocalPlayer() did solve me the issue which I spent days trying to fix, hats off, thanks so much 🤝

pulsar rock
#

Anyone got a clue as to why this would error out?

#
local function foo(_player)
  -- ...
end

Events.OnPlayerMove.Add(foo)
#

Specifically, the adding of the foo method hook on the OnPlayerMove event.

#

Did that event change? Is it not subscribeable?

bronze yoke
#

what error are you getting?

pulsar rock
#

My other event hooks work fine

#

So I'm kind of puzzled

bronze yoke
#

that would imply the event doesn't exist (usually as result of a typo) but that's accurate to my documentation

pulsar rock
frank elbow
#

Any chance you're redefining Events somewhere?

pulsar rock
#

Not as far as I'm aware

#

I have other event hooks in the mod as well

#
local function init()
    Events.OnTick.Remove(init)

    Events.OnFillWorldObjectContextMenu.Add(contextMenuHook)
    Events.OnPlayerMove.Add(checkForWarp)

    WarpTiles.getModData()

    print(WarpTiles.modName .. " " .. WarpTiles.modVersion .. " initialized.")
end

-- Event hooks

Events.OnTick.Add(init)
#

This is all relevant code regarding Events

#

I've tried commenting out the body of the checkForWarp method, in case it's somehow causing problems with the Add, to no avail.

#

Seems like it resolved itself. Not entirely sure what I did there. Might have just been something that didn't overwrite properly when I updated things.

#

Sorry y'all!

frank elbow
#

Glad it worked itself out

hollow current
#

is there some sort of a guide that explains setting up mods in a github repo and getting them to update automatically on the workshop when a change is done to the main branch? (if at all possible)

bronze yoke
#

if you want automatic updates you'll need a second steam account with a copy of the game

#

and i think you need to emulate the authenticator too...? not sure about that, just remember the authenticator being a hinderance when chuck was trying to do the same thing

hollow current
#

Sounds like a hassle. Any idea if he was able achieve the desired result?

bronze yoke
#

i think so

hollow current
#

I see. Will try to do more research into it, ty

nova socket
heady shoal
#

What do you think about my map? I'm still working on it but I want some feedback of what i've already done

drifting ore
#

give the rich people a dock

#

so that they can dunk on the poor people better from across the water

#

where do you define new values for WeaponSprite=? in items
it seems this one is the reason my model isn't showing-up in-game

raven zinc
#

Does anyone know what the name of this icon is in the game files?

drifting ore
#

is that helpful?

hollow current
#

there a function to disallow player's interaction with inventory/containers?
Solved

#

or if whole UI can be hidden, it'd be better since I also want to disallow interaction with health panel/crafting menu/etc (maybe selective if possible since I wanna keep chat panel?)
Solved

hollow current
#

actually i just realised those are timed actions, which shouldn't execute until an active timed action is over.. yet they do?
Solved

tardy wren
#

Players can queue timed actions, and some take so little time they finish instantly too

drifting ore
#

is it possible to change whats on the screen? i would like to play around with implementing night vision goggles, or infared