#mod_development

1 messages Β· Page 14 of 1

worldly olive
#

Thanks!

flat cipher
#

are you talking about searching arbitrary strings in the java source code? I think IntelliJ does not index .class files decompiled on the fly so they won't be searchable, hence why you have to do the manual step beforehand ><

#

for reference, here is the command I used on macOS

java -cp "/Applications/IntelliJ IDEA CE.app/Contents/plugins/java-decompiler/lib/java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler path/to/source path/to/dest
worldly olive
#

YEAH I mean that! haha

#

So it is the index... ok! thanks!

jagged ingot
#

Good afternoon.

cosmic condor
#

night night

jagged ingot
#

I use fernflower, which is the same core that's ran as a plugin for IDEA.

#

Since 2011-2012. πŸ™‚

#

Minecraft days.

flat cipher
#

oh nice, I'll look into it thx

jagged ingot
#

Jetbrains maintains it now.

#

Their repo will be the one to do normal Git work on.

flat cipher
#

oh looking at the contents of java-decompiler.jar, it looks like it's just fernflower so I think we're using the same thing ^^

deep kelp
#

Is there a Alexandria Community or any Community mod?

jagged ingot
#

IDEA took over the project a while back and packaged it as their decompiler tool.

flat cipher
#

haa gotcha

abstract pine
#

https://theindiestone.com/forums/index.php?/topic/24408-how-to-create-new-vehicle-mods/

       gearRatioR = 4.7,
       gearRatio1 = 3.6,
       gearRatio2 = 2.2,
       gearRatio3 = 1.3,
       gearRatio4 = 1.0,

Where are these vehicle values derived from? Are the values given in this guide the default? I notice only three vehicles (vehicle_car_sports, vehicle_car_sports_ez, vehicle_car_normal) even have them defined. So the other vehicles must be getting them from somewhere, but a Find in Files search doesn't return anything usefulβ€”other than that these are the same values found in vehicle_car_normal, is that file like a template for all vehicles?

lusty nebula
#

A bit of help needed...
If I set
pl:clearWornItems();
the character's starting clothes worn by the character are removed and moved to the main inventory ( In brief the character remains naked ).
What I have to use if instead I want the starting clothes completely removed/deleted so that they will not show up in the main inventory?

shadow geyser
random finch
#

What mods have vehicle definitions aside from fhq-Vehicle Spawn Zones Expanded, Skizots Vehicles Spawn Zones in the Riding Mower mod and Tread's Military Vehicle Zone Defs?

lusty nebula
drifting ore
cyan basalt
#

is there a better way to wait for a different mod's lua file to run than changing the filename to later in the alphabet?

vapid lotus
#

looking to see if anyone could make me a mod

eternal garnet
vapid lotus
#

okay thanks

cyan basalt
#

I also might be able to help!

umbral grove
#

enjoy

cosmic condor
umbral grove
#

Vanilla if you aren't

#

Guess i missed that both are toggled on at the moment, but it doesn't seem to be causing any problems

#

or wait no sorry

#

I use dynamic, and dynamic means that traits come and go depending on health conditions.

#

Was thinking of a different mod

umbral grove
#

hope that helps

cosmic condor
#

People usually enable all the mods available when the workshop comes with multiple optional mods. πŸ˜…

umbral grove
#

yeah, used to do that

#

500 hours later, generally not

sly obsidian
#

Anyone have experience adding modded maps to PZ server on Apex Hosting can help me?

shadow geyser
shadow geyser
# cyan basalt is there a better way to wait for a different mod's lua file to run than changin...

if you want a file to run later, use the require statement to state which file you want to run before it. If it really is a situation where you need it to run after all other files, then renaming it is probably the easiest way to get it to run after all other files from the same mod. If you Need to run it after literally all mod files, including other mods, then I would put it all in a function, then add that function into OnGameBoot

cyan basalt
#

awesome that makes sense, thank you!

cosmic condor
#

How to set the cooldown for an item? Allow the player to use an item once every 5 minutes.

glad ridge
cosmic condor
glad ridge
#

it be something like this

#

10000 is the default value for a wet towel so i just upped it to 30000 but i think that's around 10 min real time, so you have to play around with it.

cosmic condor
#
    {
        DisplayCategory = Household,
        Type                =            Normal,
        DisplayName            =            Wet Bath Towel,
        Icon                =            Bathtowel,
        Weight                =            0.5,
        Wet                 =           TRUE,
        WetCooldown         =           10000,
        ItemWhenDry         =           Base.BathTowel,
        WorldStaticModel = BathTowel,
    }```
#

so these are different items

glad ridge
#
    {
    Type = Normal,
    Count = 1,
    Weight    = 0.25,
    DisplayName = Soap2,
    CantBeFrozen = TRUE,
    Icon =    Soap2,
    ReplaceOnUse = dirtysoap,
    StaticModel = Soap2,
    UseWhileEquipped = FALSE,
    WorldStaticModel = Soap2,
    }```
#

this would be the first item which gets replaced on use with the dirtysoap item just as an ex

cosmic condor
#

okay, I get the idea now, but not sure if WetCooldown can be used for any items

glad ridge
#

yeah that's why i wasn't sure if it be applicable or "realistic" enough for what you are doing, i think as long as it is a normal item it should be okay though

#

what are you trying to make?

cosmic condor
#

just asking for a friend πŸ˜…

#

Thanks for the work around solution ❀️

glad ridge
#

np

shadow geyser
#

you could always just use something in the mod data, then use canperform to check the moddata to see if that item is valid to be used

#

then just need some extra stuff to modify the display name to show it can't be used

lusty nebula
rugged cosmos
#

Hi guys,
I don't know if this is the chat, but here I go.

How do you see the idea of two scripts with the following functions?

  1. Script that spawns vehicles in different zones randomly so that the map does not run out of vehicles.
  2. Script that checks if there is an updated MOD and restarts the server with warnings and a countdown.

I have developed them for my server with PowerShell for Windows.

cosmic condor
rugged cosmos
cosmic condor
#

they won't lol

rugged cosmos
cosmic condor
#

it happened

#

and that causes data loss

#

so it's your problem too

umbral grove
#

riko make me a mod

rugged cosmos
#

Im doing a /quit command with the save option, that cause data loss too?

umbral grove
#

"Zombies use firearms"

#

i want zombies that shoot back

cosmic condor
cosmic condor
rugged cosmos
umbral grove
cosmic condor
umbral grove
#

but funny

rugged cosmos
#

@cosmic condor

rugged cosmos
#

@cosmic condor tested and it works

#

Warning message with a countdown

#

then kick players

#

and finally restart the server

#

its basic but it works

cosmic condor
#

that's cool. congrats! πŸ˜€

rugged cosmos
eternal garnet
#

Good system

languid thicket
#

Isn't there a mod for ai? And can't there be friendly and enemy?

shadow geyser
languid thicket
#

Oh cool thanks!

weak sierra
#

if i make a recipe with the same name as vanilla will it override like for items?

worldly abyss
#

Hi, I have a problem with a Tile I have created. I've been trying for 6 days to get it to work in game, but I can't get it to work. Can someone who speaks Spanish help me? My English language is bad but I can try!

viral notch
#

there is way for steam workshop request modA or modB ?

#

not modA and modB

weak sierra
#

nope, either mark them both and then explain in the description, or mark neither and explain in the description lol

#

wouldn't that be nice lmao

#

can i conditionally include a recipe depending on if another mod is present in a script?

#

they're just LUA but not marked as LUA right?

#

so

#

theoretically i could just do one that has a require() statement?

#

or i guess a if not X then return

sly obsidian
#

I added some maps to my modded server and a lot more zombies are spawning naked more than normal anyone know why is that happening?

umbral grove
#

anyone down to make a simple mod for me

cosmic condor
#

if it really simple you can just ask how to create one here πŸ˜†

#

I can assist

#

but if not really simple then I can't help

umbral grove
#

yeah i just want zombies that fire rockets out of their toes

#

and have swords for teeth

#

lmao

cosmic condor
#

okay end of the talk

umbral grove
#

sup riko

cosmic condor
#

🀣

umbral grove
#

i was thinking i just want it to play an audio file when using beta blockers

cosmic condor
#

that's super easy

umbral grove
#

idk anything about mods

#

other than how to juggle them

#

if its not hard then ill dm you when i wake up and you can assist?

#

or whenever we are both on and free

#

im passin out

cosmic condor
umbral grove
#

ya, hit you up on the flip?

#

then we can make the "zombies use firearms" mod as planned

#

nie nie

weak sierra
#

i just made a fork of a recipe mod (with permission) and added a few things, nothing that should break anything as long as i followed syntax (and i checked it..) and yet i'm getting wonk errors when u load up a game and failures when i try to open the crafting window

#
attempted index: getFullType of non-table: null

LOG  : General     , 1661105117135> -----------------------------------------
STACK TRACE
-----------------------------------------
function: populateRecipesList -- file: ISCraftingUI.lua line # 1093 | Vanilla
function: createChildren -- file: ISCraftingUI.lua line # 969 | Vanilla
function: instantiate -- file: ISUIElement.lua line # 653 | Vanilla
function: addToUIManager -- file: ISUIElement.lua line # 1009 | Vanilla
function: createInventoryInterface -- file: ISPlayerDataObject.lua line # 157 | Vanilla
function: createPlayerData -- file: ISPlayerData.lua line # 187 | Vanilla

ERROR: General     , 1661105117135> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getFullType of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1661105117135> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getFullType of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:134)
    at zombie.gameStates.GameLoadingState.exit(GameLoadingState.java:398)
    at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:105)
    at zombie.GameWindow.logic(GameWindow.java:297)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:764)
    at zombie.GameWindow.run_ez(GameWindow.java:680)
    at zombie.GameWindow.mainThread(GameWindow.java:494)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1661105117135> -----------------------------------------
STACK TRACE
-----------------------------------------
function: populateRecipesList -- file: ISCraftingUI.lua line # 1093 | Vanilla
function: createChildren -- file: ISCraftingUI.lua line # 969 | Vanilla
function: instantiate -- file: ISUIElement.lua line # 653 | Vanilla
function: addToUIManager -- file: ISUIElement.lua line # 1009 | Vanilla
function: createInventoryInterface -- file: ISPlayerDataObject.lua line # 157 | Vanilla
function: createPlayerData -- file: ISPlayerData.lua line # 187 | Vanilla```
#

LOG  : General     , 1661105138274> -----------------------------------------
STACK TRACE
-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: setVisible -- file: ISCraftingUI.lua line # 30 | Vanilla
function: toggleCraftingUI -- file: ISCraftingUI.lua line # 1368 | Vanilla
function: onOptionMouseDown -- file: ISEquippedItem.lua line # 390 | Vanilla
function: onMouseUp -- file: ISButton.lua line # 56 | Vanilla

ERROR: General     , 1661105138274> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: 1.0 of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1661105138274> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: 1.0 of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1243)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
    at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
    at zombie.ui.UIElement.onMouseUp(UIElement.java:1228)
    at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
    at zombie.ui.UIManager.update(UIManager.java:809)
    at zombie.GameWindow.logic(GameWindow.java:261)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:764)
    at zombie.GameWindow.run_ez(GameWindow.java:680)
    at zombie.GameWindow.mainThread(GameWindow.java:494)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1661105138274> -----------------------------------------```
#

my assumption is that the latter errors are due to the former since the first is probably choking on a recipe

#

and not loading everything up

#

gonna go poke around in the vanilla code and see if i can narrow down what might be broken but if anyone has run into this lmk

#

so a result item isn't workin' out

#

do i need to preface a reference to something in Base

#

even if i import Base?

#

cuz that'd do it if i do

#

gonna guess that's it.

#

mm the originals don't do it tho

cosmic condor
#

where's your script?

weak sierra
#

there's four of them

#

ill uh

#

post them as files ig

#

got permission a while back to make a VFE version of Kitsune ammo craftin mod

#

so im doing that, plus an addon for my PPSh mod

#

most of the content is the same as the vanilla version of Kitsune ammo crafting

#

just added ammo and mag crafting recipes, and new calibers added to the gunpowder gathering recipe

#

i did rename the gunpowder gathering one to match the original recipe since i want to override it

#

is that.. a problem to try to do?

#

that one is in misc

cosmic condor
#

why do you have many modules?

weak sierra
#

based on the original modder's structure

#

they have three separate submods to let the users pick whether they want ability to craft ammo, mags, and/or the misc

#

and then the final one is included in a separate mod for my PPSh gun

#

as a submod

white latch
#

Is it possible to modify the capacity of vanilla objects such as crates or lockers?

smoky meadow
#

i have a question, is there a way to spawn a car without it's parts.(without tires, car door, etc) only it's body remain?

cosmic condor
weak sierra
#

magical isn't it?

#

i wish the script parser didn't have shit for output when it fails lol

cosmic condor
#

debug logs run like crazy

weak sierra
#

yeah but it's all just pointing at vanilla code that parses it

#

no line references in the scripts

#

looked at the vanilla code

#

seemed to fail because it couldnt find the full type for some result of a recipe

#

but i can't find a mistake

cosmic condor
#

I wonder if loading order can cause the problem

#

a modified mod based on two other mods, this is hard πŸ˜…

weak sierra
#

some of that isn't even in these scripts

#

nothing about a vz58 for instance

#

that looks like brita's shit

#

the scripts i sent depends on Vanilla Firearms Expansion

#

and UdderlyAttachments->UdderlyGuns: PPSh-41 SMG for the last one

shadow geyser
shadow geyser
white latch
shadow geyser
opal pier
#

Guys, is there a tutorial that explains how to add containers to cars? I want to add an extra container inside the ambulance but I think I'm skipping some step

weak sierra
#

but that's a little janky

white latch
weak sierra
#

so it happens with just the ammo recipes installed

#

and i only added two things to that

#
    {
    GunPowder=6,
    keep [Recipe.GetItemTypes.Hammer],
    keep Wrench,
    
    Result=22Bullets,
    Sound:Hammering,
    Time:5.0,
    Category:Firearm,
    SkillRequired:MetalWelding=1;Reloading=1,
    }```
#

and

#
    {
    GunPowder=25,
    keep [Recipe.GetItemTypes.Hammer],
    keep Wrench,
    
    Result:762Bullets,
    Sound:Hammering,
    Time:5.0,
    Category:Firearm,
    SkillRequired:MetalWelding=4;Reloading=4,
    }```
#

i.. do not see anything that would make it choke

shadow geyser
weak sierra
#

the calibers here are from VFE but it puts all its shit in module Base{}

#

in the script?

#

so u can execute random lua in there?

shadow geyser
#

no I mean where it is causing the lua error

weak sierra
#

i mean that's in vanilla, but ur right there's no reason i can't do that

#

that's a good idea

#

lol

white latch
#

strategic print statements are the OG debugger

shadow geyser
#

is your mod adding any new items? or just recipes using existing items btw

weak sierra
#

just recipes using existing items

#

but the existing items are from VFE and vanilla

shadow geyser
#

because the message was that it couldn't call getfulltype on some item, so it seemed like some item is missing from your game, which is in one of your recipes

weak sierra
#

so there is a mod involved there

#

i made sure that the names were correct

#

and that VFE is loading first

shadow geyser
#

maybe double check all the correct VFE mods were activated

weak sierra
#

maybe i accidentally edited a VFE script while i was poking through it..?

shadow geyser
#

might be worth checking

#

easiest way to fix is probably to unsubscribe, check its gone, then resubscribe

weak sierra
#

ok so i fixed VFE and that let an actual error come through

#
ERROR: General     , 1661111618140> DebugLogStream.printException> Stack trace:
java.lang.NumberFormatException: For input string: "22Bullets"```
#

it tried to parse it as a goddamn number

#

not sure why, since the original mod had 556Bullets and did not have this problem ._.

#

slaps "Base." on the new additions to see if that helps

#

actually i wonder if my log line is somehow causing that

#

yeets that

#

i figured it out

#

i wrote Result=22Bullets instead of Result:22Bullets

#

:)

#

seriously TIS please, please add syntax checking for the scripts

#

:|

#

a single = sign should not stop the entire crafting menu from appearing

#

and a line number in what file would be fantastic

alpine scroll
#

Quick stupid question

#

When you do a mod that requres a file from another mod

#

And this other file also requires a mod

#

Do I need to require the requirements too or not?

#

Lets say, file A requires file B. file A has a function I wanna use, so, on my file C, do I need to only require file A or do I also need file B?

shadow geyser
# alpine scroll Lets say, file A requires file B. file A has a function I wanna use, so, on my f...

yes and no.

yes in that, if your mod A is dependent on mod B and mod B is dependent on mod C, You need to have both mod B and mod C for your file to work.

no in that, if you are simply talking about the require statement in lua, if file B already has the require(fileC), you only need to do require(fileB) in file A. when your file A runs the statement require(fileB), it will run/retrieve the cache of the result of file B. And when executing file B, it will reach the require(fileC) in file B, which will then run/retrieve the cache of the result of file C.

alpine scroll
#

Got it

#

Just for context, I am trying to make something to trigger the Expanded Helicopter Events. And EHE has like a TON of files haha

#

But I think I am doing it right as it is right now

thin hornet
#

Prevent your script to run if the required mod is not activated.
then require the other mod file you want to load FIRST (before your script).
add require=TheRequiredModID to your mod.info

if not getActivatedMods():contains("TheRequiredModID") then return; end

require("TheRequiredModFilePath")

serene zenith
#

What's the first thing to do, in order to start creating mods?

shadow geyser
serene zenith
#

Can not find a Changed/Puro mod.. so. That's a start. But I don't know if there's much of special infected or changing the look of the zombies in general.
But I haven't really looked that much into it.

thin hornet
cyan basalt
#

oooo very helpful!

quasi kernel
#

I wont get beat to a pulp for trying to ask newbie questions here right-

#

I've been wanting to get into modding, I've read a few tutorials, but I'm still a bit lost.

#

I'm hoping to develop a mod that introduces a "Battery Charger" for the normal batteries so they can be used with mods like Better Flashlights and Radios can continue to be useful with Save our Station n stuff. Is this too much for someone just starting?

#

I'm more interested in the Lua side of modding rather than the Java side if that means anything, though I can technically do both since I have experience with both languages.

#

(yes I just read the link posted it helped a little)

cyan basalt
#

from my experience people have been super kind in here so don't worry about asking questions!

quasi kernel
#

Oh thank god.

#

I've been torn to shreds in other communities just for trying to learn.

#

I really want to contribute to the modding scene here because I love the game so much.

cyan basalt
#

and from my limited experience I'd say the best thing to learn is to download mods and open them in vscode/your ide and just study them at first

quasi kernel
#

Oh? Hm.

cyan basalt
#

everyone has been super kind dw!

quasi kernel
#

Where would I go to start tampering with my mods?

#

It doesn't seem like the Users/.../Zomboid directory has much in regards to that.

#

Would local steam files be more effective?

#

Oop, think I found it.

gilded hawk
quasi kernel
#

Is there any particular vscode extensions I should use for modding in the lua side of things?

gilded hawk
#

But I forgot to write any documentation for it πŸ˜…

quasi kernel
#

oop hehe

#

Seems that first extension was the most popular available, so that's a good sign. Thank you!

#

I take it that there will be some wonk with the interpreter because of the nature of Zomboid's "forked" lua, right?

#

I know Zomboid runs off of a Java-compat version of Lua, forgot what the exact name of it was.

#

Forked may not be the right term but whatevs, am not a professional

thin hornet
#

i will cover lua but also ts modding

gilded hawk
thin hornet
#

yeah typescript modding is pipewrench

#

My framework pzpw v2.0 is in alpha i have lot to do still

#

But its so much more structured than my v1

gilded hawk
#

pzpw? πŸ€”

thin hornet
#

yeah its commandline tool to create mods

#

with its own template/config json and now a new command line compiler

quasi kernel
#

Now that I look at the lua, how possible is it to make a "Better Batteries" mod without outright breaking / being incompatible with most mods..?

gilded hawk
quasi kernel
#

Because from what it looks like, at least for SoulFilcher's Explorer mod in AwesomeTime, it uses something similar to a durability check and just lets you insert a new battery.

#

So if the battery is 0, instead of making a new item, it's just.. replaced entirely.

#

Agh I worded that weird

#

From what it looks like, would it be smarter to seperate it into two mods?

#

"Better Batteries" and "Battery Chargers"?

#

Maybe that won't be necessary actually, I sound insane.

thin hornet
#
#

will simplify alot with time

quasi kernel
#

Is it normal to feel like a complete moron when first entering the modding scene-

shrewd briar
#

For any modding scene then yes

quasi kernel
#

Okay good to know I am experiencing normal human emotion yesyes

shrewd briar
#

Yeah

thin hornet
#

haha yeah

quasi kernel
#

I really wanna learn all this stuff but it's hard to tell where to start.

#

Looking at the lua files of some mods helps, but it also makes me more confused in some aspects.

thin hornet
#

Not easy at first, there is alot of different things in pz modding.

#

But really think about what you want to acheive, make it simple at least at first

quasi kernel
#

Wouldn't batteries be simple enough? I'd hope so anyways-

thin hornet
#

then ask here we can probably send you in a direction toward your goal

quasi kernel
#

Oh, ok!

#

I just don't wanna use y'all as a crutch if that makes sense

#

Like, I don't wanna have to rely on y'all 24/7 for my mods to work, I wanna learn to be independent too

thin hornet
#

People who can will answer

#

Or at least send you into the right direction

quasi kernel
#

Fair enough

#

I suppose I should ask some questions then.

thin hornet
#

Thats what this channel is for

quasi kernel
#

How would I start with setting up a mod that can be enabled to begin with?

gilded hawk
quasi kernel
#

I know there's an "example mod", but it doesn't have any lua files for me to tamper with.

gilded hawk
gilded hawk
quasi kernel
#

So just yoink one and tamper?

#

Obv don't release it to the public if it's hardly edited but

#

Y'know

gilded hawk
#

Exactly

#

Apply common sense and some creativity, and you will have your first mod

cyan basalt
quasi kernel
#

Ooo thank!

#

I have an idea of how to do some things, though I imagine I'd have to modify some behaviours on the Java end of things for this to work the way I want.

cyan basalt
#

if you modify the java it won't work on the workshop just an fyi

#

and to modify the java you have to decompile it

quasi kernel
#

Ohh

#

Okay perhaps not lol

cyan basalt
#

there's a lot more that you can do with the lua than you think tbh

quasi kernel
#

Oh wait, I forgot you can override stuff via lua

cyan basalt
#

yes in Konijima's guide he shows you how to hook into a function and override it

quasi kernel
#

will keep that very open

cyan basalt
quasi kernel
#

-debug can be put in the Steam boot options too right?

gilded hawk
quasi kernel
#

excitement

#

I think I did something wrong- it does not appear to want to boot.

#

uhhh

#

Oh, it seems to be trying to boot via regular means.

#

I need to get it to use safe mode somehow.

rugged cosmos
#

im trying to translate a bit

gilded hawk
eternal garnet
rugged cosmos
#

@gilded hawk @eternal garnet
There are 4 files .ps1
I can upload a .rar or I use any web like pastebin?

cyan basalt
#

how do the texturepacks work in this game? what file format is .pack and how does one edit that?

quasi kernel
#

Well I just wiped all of my mods in an attempt to fix regular booting for 0 reason

rugged cosmos
rugged cosmos
#

I hope you cand understand it

eternal garnet
rugged cosmos
rugged cosmos
eternal garnet
#

:0

#

Awesome stuff

rugged cosmos
quasi kernel
thin hornet
#

something like add custom game

quasi kernel
#

Nono I know that

#

I just can't get that to boot through alt launch

#

My default launch doesn't work for some dumb reason

thin hornet
#

what does it do?

quasi kernel
#

It closes automatically the second I try to use the "Dev" version of the game.

#

No prompt to use alternate launch or anything since it's not the main game.

#

I don't have problems using alternate launch normally, but here it's particularly a problem because I can't use the method everyone else is using to have a designated "mod friendly" version.

#

Should I open a ticket?

cedar anvil
#

I really want to study UI things like this one. But I have no idea where I should begin.. Could anyone give me a tip?

thin hornet
cedar anvil
#

oh yeah, the context menu

#

I tried to figure it out myself by searching Lua files. but couldn't understand a single one..

cyan basalt
quasi kernel
#

I already wiped it completely and reinstalled twice, no good.

#

Not sure what's up with it.

alpine scroll
#

Anyone knows where the "Destroy tile" code from the new update is? Like in which file

shadow geyser
#

I had compiled a more simple example to show how they are done

cyan basalt
#

any chance anyone in here knows how to use the addImpulse method for vehicles? I'm just messing around and trying to move around vehicles with physics on events, but I am so bad at visualizing vectors

#

params are vehicle:addImpulse(Vector3f impulse, Vector3f rel_pos), can anyone in here who is smarter than me tell me what these vectors might represent? i thought it would be the first one is the direction/magnitude on the vehicle and the second was the relative position that the vehicle is at but I can't figure it out 😒

shadow geyser
#

I haven't dabbled with these, but so like, you modify the first vector, if you want to change the impact to hit to the right or to the left. Then you modify the second vector if you want it to be applied to the front of the car vs the back of the car.

cyan basalt
#

For the first vector if I just did a (0,0,5) and set the second one to the middle of the car would the car most likely go straight up?

#

And I wonder if they need to be based off the world position at all or if they are just relative to the car itself idk man

cedar anvil
shadow geyser
gilded hawk
sage bluff
#

hi, i would like to make a mod that adds a sword to the game, but i have no idea how to make the model, i already know how to use blender but dont understand how i put it in the mod

white latch
#

where the heck is carry weight or capacity for containers stored? I can't find it anywhere

#

specifically the metal crate right now but any of them really

shadow geyser
undone elbow
#

Is it possible to remove "Full to Bursting" moodle using Lua?

gilded hawk
undone elbow
#

Yes

sage bluff
#

Can someone help me fix this problem im having with the model of my sword?

#

This is it in blender

rugged cosmos
#

Do you know the syntaxis for servermsg with powershell?

For example with a .bat this works:

rcon.exe -c rcon.yaml "servermsg \"Test message.\""

I get this:

#

With .ps1:

cd C:\Users\Administrador\Desktop\RCON
rcon.exe -c rcon.yaml "servermsg \"Test message\""

I get this:

#

I tried with and without the characters " \ ' and it didnt work

sage bluff
#

sorry, i have no idea, im new to modding

rugged cosmos
#

This option only send the first word:

cd C:\Users\Administrador\Desktop\RCON
.\rcon.exe -c rcon.yaml 'servermsg "Test message"'
flat cipher
#

in powershell, you have to double β€œ to escape it. So you can try β€œβ€ instead of \” in your first example

rugged cosmos
flat cipher
#

In theory, like this

rcon.exe -c rcon.yaml "servermsg "”Test message”""
#

ignore the weird quotes from my phone, these are all double quotes (β€œ)

rugged cosmos
#
.\rcon.exe -c rcon.yaml "servermsg ""Test message"""
#

I get this:

flat cipher
#

yes

rugged cosmos
#

only get the first word

#

the second word is ignored

flat cipher
#

hmm that must happen at the rcon.exe level then, the powershell should be fine, I’m not familiar with rcon.exe

shadow geyser
#

can't you just use single quotes on the outside

#

.\rcon.exe -c rcon.yaml 'servermsg "Test message"'

flat cipher
#

yes you can, he tried that but same result as the last attempt

shadow geyser
#

ah sry i missed that

rugged cosmos
#

np xD

flat cipher
#

that works: .\rcon.exe -c rcon.yaml 'servermsg \"FOO BAR\"', but there are many layers to this ^^

rugged cosmos
flat cipher
#

yw ^^

gilded hawk
quasi kernel
#

Does this look like a decent battery charger? I'm still new to spriting so

#

(Search alkaline battery charger, not just battery charger for ref)

idle ember
#

hi all 1 just have a question can i use this model in pz

#

want to start with it instead of male or female

cosmic condor
quasi kernel
#

I can edit the sprite to make it a 4-pack

sage bluff
#

hi, i have been having this problem with my sword model, it is fine when i use place item, but looks like this when i use it as a weapon, Anyone know how to fix this?

cosmic condor
sage bluff
#

ok thanks

flat cipher
rugged cosmos
idle ember
#

can someone help ? i want to use my 3d nft fbx file in zomboid as charactor to play is that posible ?

cosmic condor
idle ember
cosmic condor
#

if your fbx file can be opened in blender then it could be possible

idle ember
#

its made in blender

cosmic condor
#

can you open the file with 3D Viewer?

idle ember
#

didnt try that but can you tell i witch folder i have to drop the fbx file to try or do i have to do more to make it work

cosmic condor
#

and do you really have a permission to use that fbx file?

idle ember
#

i know they allready used it in gta 5

cosmic condor
#

what?

idle ember
#

that nft

cosmic condor
#

do you mean FiveM?

idle ember
#

saw them playing gta 5 so

cosmic condor
#

many of NFTs are stolen contents

#

you have to make sure that the sellers give you the permission to use that fbx file

idle ember
#

and yes i can se my nft in the 3d viewer

cosmic condor
#

to set it straight, nft is just a queue in the blockchain, it doesn't store anything, your fbx file is hosted somewhere else

cosmic condor
#

so you can drop the NFT part so people can understand what you really mean

#

"I have the 3d fbx file that I bought" is enough

#

now, back to the main story

#

what does your fbx look like?

idle ember
#

i just want to use my void in pz

cosmic condor
#

pic?

idle ember
#

thats the 1 i want to use as character

#

i just want to now how i can fit i in to the game

#

so not as a male or female but as a void

bronze mulch
#

nft

cosmic condor
#

oh no the guide on how to create clothing mod is removed

bronze mulch
#

screenshotted

cosmic condor
#

you may use the same method

idle ember
cosmic condor
#

make the whole 3d model as a clothing

idle ember
idle ember
#

and if thats done i can make it work

idle ember
cosmic condor
# idle ember if i check the file thats allready done
cerulean lintel
#

IS there a version of Hydrocraft you can currently run on a multiplayer server or are they all nuked?

dim hill
#

Would the grass and foliage added by the 10 Years Later mod be "Map Data" or "Chunk Data"? I'm trying to use a mod to clean it out of my server

quasi kernel
#

(Please try to answer the other questions before mine please, it's not urgent!) Do y'all know if radios and regular batteries spawning in the world start with randomized charges?

#

From experience, I don't think I've EVER seen a radio without a full battery in it unless it's been left on.

#

Same goes for walkie talkies on zombies.

dim hill
quasi kernel
#

I'm aware of them starting on, I just wanna know their setup so I can make adjustments in a mod I'm making.

#

I'm wanting to make a "Better Batteries" mod that introduces rechargable batteries, a battery charger, and fixes to a bunch of objects (supposedly) starting with 100% battery.

#

Plus possibly adding a Watch battery that can be replaced, so you have to maintain your watch a bit.

#

I do need feedback on whether or not watch batteries would be a good addition or not though

ancient grail
#

how do i trigger a function when i come close to a certain item or step on a specific tile

#

a simple function for quest purposes such as saying "what is this place?"

#

or a sound

drifting ore
#

watch batts would be sweet @quasi kernel , just thought about the fact that they never need batts a few hours ago while playing

quasi kernel
#

Fr

#

Would be nice to have to keep them maintained

drifting ore
#

also you loot one digital watch in the first 10-30 minutes and then never interact with it ever again

quasi kernel
#

Yeeup

cyan basalt
#

yeah I think you can just overwrite the item definitions to make them require batteries

sly orchid
cyan basalt
#

and look for how batteries are defined as well

#

true

#

maybe they are all apple watches from the 90s

sly orchid
#

Like literally you dont need to change them just like in a calculator

#

But better batteries would be cool

quasi kernel
#

hm you have a fair point

quasi kernel
#

Because it'd be nice ot have two seperate types each with their own benefits.

#

Non-rechargable which has a longer lifespan, but can't be recharged. And rechargable with a shorter lifespan, but can be recharged.

#

I'd have to introduce "Charge" and "MaxCharge" variables somehow

cyan basalt
#

like just keep the module as base

quasi kernel
#

I see

sly orchid
#

Were rechargeable batteries common in the 90’s?

quasi kernel
#

No, and that's why they're interesting in a Better Batteries mod.

#

You'd have to go hunting for them and they'd come in a pinch.

#

(ntm you'd have to get an alkaline battery recharger, yes those existed in 1993)

sly orchid
#

Cool

summer stump
#

Hey, does anyone know what happened to the fractioned moodles mod? It got renamed for "nothing" and it seems like its not working anymore

unborn radish
#

Both a modding and end-user question at the same time
I made a sub-mod for a vehicle mod that renames all cars to be lore-friendly (changing ford for franklin and all that stuff)
My mod works flawlessly in single player, but in multiplayer the original names still show. I've checked, double-checked and triple-checked the server's load order yet i still get my immersion broken by a "pontiac" or a "chevrolet" all the time
Here's my mod, any help would be much, much appreciated https://steamcommunity.com/sharedfiles/filedetails/?id=2811283502

heady crystal
#

Anybody know how do I listen to client commands?

#

I made a LUA file in media/lua/server and wrote this, but it never gets triggered even though it should be subscribed to client commands.

cyan basalt
#

oh yeah I think that's the event you're supposed to use

heady crystal
#

I considered that it simply doesn't print because it's the server or some random reason but I'm not sure

cyan basalt
#

just to be sure, but you're not testing this in SP are u?

heady crystal
#

Ofc not

gilded hawk
#

I'll probably remove this once we have a way to lock mods versions in the servers

cyan basalt
heady crystal
#

The function is right

tranquil reef
#

It's possible to open windows, doors, break windows, etc with code right?

cyan basalt
#

is this the code that ended up working for you?

cyan basalt
tranquil reef
#

Now I just need to figure out if I can spawn and despawn zombies on command, that'd make this 100 times better

halcyon dagger
#

Hey everyone! qq would there be a way to catch a rcon comand on a server script? I'm thinking about a mod that would allow to trigger game events / read game stats from another backend application like a website API. any idea?

cyan basalt
#

how does modData work? do you guys know of any resources where that's explained?

quasi kernel
#

Do y'all know of any way to get debug to run in alternate

tame linden
#

Im trying to host a server for my friends and I but the server says terminated before it finishes initalizing, how do I tell what is causing the problem, do i just search for errors in the console.txt and figure out what mod the error is a part of??

fiery pecan
cyan basalt
#

so you just changed the skin instead of the scriptname?

#

that makes sense I suppose

fiery pecan
#

yeah

tranquil reef
#

I know how to make a zombie spawn only in houses, but is there a way to make it always stick around the house? Like if it's chasing a player it only goes like 5 feet away from the house before going back lol?

#

Pretty specific, but I'm trying to make a ghost mod

#

Random ghosts everywhere on the streets would be kind of weird

cosmic condor
shadow geyser
gilded hawk
cerulean lintel
#

it kept saying different "animals.txt"

summer stump
#

Hey, does anyone know what happened to the fractioned moodles mod? It got renamed for "nothing" and its not working anymore

gilded hawk
#

Maybe the modder got pissed and wanted to remove it without breaking servers?

shadow geyser
# cerulean lintel it kept saying different "animals.txt"

yeah that is related to if you have multiple hydrocraft mods present. You need to make sure only one is present. The issue might be because the server has an old version cached in the mods folder. PZ is kind of weird like that. We intentionally kept the same mod id, so people could easily upgrade from the old abandoned mod to the new one, but it causes some confusion unless you know alot about how the PZ handles mod files

gilded hawk
#

Is it me or TCCacheMP can't be added to collections anymore? πŸ€”

cerulean lintel
#

even with only one mod that happened to a fresh server

shadow geyser
#

its would also be good to manually check that the previous mod is properly gone, cuz some times steam can be funky and doesn't properly delete a mod, when you unsubscribe

#

we've also had people not remembering that they had manually installed HC from years ago before they took a break from PZ, so it would be good to double check all locations, that there isn't another hydrocraft mod in any of the manually installed locations

cosmic condor
gilded hawk
#

πŸ€” Odd

quasi kernel
#

I DONE FIXED MY ZOMBOID

#

HAHAHA

#

I CAN FINALLY RUN DEBUG!

gilded hawk
#

EEEEEEH!

#

Good job!

quasi kernel
#

Alright, now for the fun stuff.

#

How would I start with my battery mod? Any particular place I should start?

#

Creating/modifying existing/new items seems like the easiest first step, though I might still need to be walked through that a bit.

gilded hawk
summer stump
#

Does anyone know a mod that I can use to create a key for an specific door? I know that Necroforge has that function, but I'd like something that's a little more immersive, if possible. Otherwise, I'll just go through the coding/admin powers way

gilded hawk
#

I would say admin power way is easier no other mod comes to mind

quasi kernel
#

is this a decent edit for the rechargable battery?

#

It took a little more effort than just flipping it around but I think it turned out okay

#

Hey @gilded hawk, would it be smarter to leave Base.Battery alone and just implement a new item for the recharge?

#

The only edit I can see myself making is just adding an "Empty Battery" for when it's destroyed

gilded hawk
quasi kernel
#

Alright

#

So leave Base.Battery alone except for adding one of those "ItemDestroyed" things

#

Then just make that into an Empty Battery

#

Actually, maybe not.. Base.Battery in itself is just a regular Alkaline, so there's no real point to making an empty version since it can't be recharged.

#

At least not safely.

#

That does call into question whether or not the Battery Charger should work on classic batteries or not

gilded hawk
#

πŸ€”

#

Honestly, if you want easy life, make a recipe that converts normal batteries into rechargeable.
And apply the recharger only to the new battery

quasi kernel
#

Oo perhap

#

Could give a reason to level up electrical

gilded hawk
#

Also

glad ridge
#

Battery's deplete so maybe you could make use of the replaceondeplete or replaceonuse

quasi kernel
#

I'd likely have to do something to vanilla items to add a "Type" of battery variable which is a little annoying

#

Because players can take batteries out and one has to take the correct battery type out

#

You don't wanna put a rechargable in and have it magically turn into a regular one

#

Because from what I'm assuming happens, Batteries are "Destroyed" when they're inserted into an item, where the item simply increases it's charge to correspond with the battery's.

#

Then when the item is removed, it just creates a new battery with the current charge of the item.

#

That's just my theory as to how it works, though I feel as if it's a sound theory seeing as SoulFilcher's lantern just lets you put a new battery in if the charge is 0

halcyon dagger
cyan basalt
halcyon dagger
#

thx! did you see any other mean of basically invoking a lua script from outside the application by any chance? πŸ™‚

gilded hawk
#

Is there a command or something to make the map fully known? πŸ€”

shadow geyser
#

I don't think there is a command. Although if you are in debug mode, you can just toggle to unhide unvisited areas

gilded hawk
#

πŸ€” I'm making a mod that makes the map fully known if you start with a specific trait

quasi kernel
#

I imagine it's gotta be possible, seeing as someone made an Explorer trait mod that extends the range of how far you mark the map.

shadow geyser
gilded hawk
#

Oh thank you!

shadow geyser
#

I don't see any examples of it being used,but you can probably figure it out with some trial and error

gilded hawk
#

Oh nice! I'll give it a look, maybe I can make it work πŸ€”

shadow geyser
#

if I would have to guess, the first 2 ints are the x and y for some cell, and the second pair of ints, would define another rectangle of squares. so using the 2 pairs of vectors, it would set thoughs cells to be visited

#

ofc if you have decompiled, you could just directly check what it does

tranquil reef
#

Is it possible to add a column to this menu

gilded hawk
celest creek
shadow geyser
tranquil reef
#

Is it possible to add new injuries to the health menu?

#

This one seems less likely but if so that'd be great

gilded hawk
#

I don't see why it should not be possible πŸ€”

shadow geyser
#

not easily. the injury system I think is in the java, but you could manually implement whatever you want, then just manipulate the UI so it is visible

quasi kernel
#

How would I go about adding a new item well?

#

and also adding it's icon somehow-

#

I have this much

#
module BetterBatteries {
    imports {
        Base
    }

    item RechargeBattery
    {
        Type         = Normal,
        DisplayName  = Rechargeable Battery,
        Icon         = Base.Battery,
        Weight       = 0.1,
    }
}
#

Used part of an unfinished tutorial to get this far

restive python
#

Anybody can help me out on how to add custom world models to a new cloth item? I can only replace the existing models by replicating a Vanilla model's name and folder path, but I cant ever add new stuff, no matter what name or path I add, when I drop it on the floor, it just shows in the game as a sprite.

shadow geyser
quasi kernel
#

Under textures?

shadow geyser
#

so for example, if your icon is called betterbattery, you will have a file called item_betterbattery.png, and then in your item script, you have the line Icon = betterbattery

shadow geyser
quasi kernel
#
module BetterBatteries {
    imports {
        Base
    }

    item RechargeBattery
    {
        Type         = Normal,
        DisplayName  = Rechargeable Battery,
        Icon         = item_RechargeBattery,
        Weight       = 0.1,
    }
}
#

So it'll be like this?

shadow geyser
#

no, only the png file has the item_ prefix

quasi kernel
#

Ohh so it's just RechargeBattery?

shadow geyser
#

yep\

quasi kernel
#

Ok perfect

#

I have this, but it's not quite showing up in the item explorer in debug mode.

module BetterBatteries {
    imports {
        Base
    }

    item RechargeBattery
    {
        Type = Normal,
      DisplayCategory = Electronics,
      Type = Drainable,
        DisplayName  = Rechargeable Battery,
        Icon         = RechargeBattery,
        Weight       = 0.1,
    }
}
shadow geyser
#

can you show your file structure for the png

quasi kernel
shadow geyser
#

and the png file if you could as well

quasi kernel
#

sorry about that

shadow geyser
#

its a png right?

quasi kernel
#

correct

#

32x32

shadow geyser
#

when you load in, does that file get loaded?

#

actually nevermind, im not sure if it outputs the png files

quasi kernel
#

Hold on, I may be stupid

worldly hatch
#

hey if i were to have a modded world and then disable the mods then reenable them would all my modded stuff still be there?

quasi kernel
#

yeah im just dumb lol

shadow geyser
#

they will, if you haven't loaded into that save in the meantime

quasi kernel
#

i forgor to actually enable the heccin mod

worldly hatch
shadow geyser
#

yep

worldly hatch
#

what happens if i load in before i enable them again

shadow geyser
#

you can have multiple saves with different mods for example

#

and you can just load into them back and forth, without needing to modify anything

worldly hatch
#

can i have one unmodded world and one modded without having to disable and enable them all the time?

shadow geyser
#

you have to manually remove them from the save, if you want to actually remove a mod

worldly hatch
#

im not talking about removing mods im just wondering if i can have one of each without having to disable them to play on my unmodded world

shadow geyser
#

so the mods you have selected in the main menu do not affect what mods are activated in existing saves.

#

when you load a save, PZ reloads all of it's lua stuff, and will check what mods were activated in that save, and then activate and load those files when you load a existing save

#

things only break if you unsubscribe

#

or if the mod author breaks their mod and uploads it to steam workshop

worldly hatch
#

so what you're saying is i can have my unmodded world that has never had mods activated on it and also have my modded world which will be started with mods and wont have to disable them to switch between the worlds

#

also im wanting to mod from the workshop

shadow geyser
shadow geyser
#

loading into that save will take care of it for you

quasi kernel
#

Alright, now for the fun stuff. I got the item in but it doesn't do anything. Is there a way to use it as an alterative battery?

#

I imagine I'll have to apply edits to individual vanilla items with lua

worldly hatch
quasi kernel
#

The items off the top of my head that require edits are Flashlights, Radios, and Walkies

#

And possibly lamps since im p sure you can use high electrical skill to modify them to use batteries (?)

normal rover
#

hey heres a dumb question when my friend and i try to load map mods they dont work. whats the deal im sure you hear this alot but i cant find anything online

#

like the map extensions

shadow geyser
#

youll have better luck in the mod_support channel

normal rover
#

bet thanks

quasi kernel
#

Alright, so how do I start modifying stuff like radios?

#

Radios would be a good place to start for now.

cyan basalt
#

@shadow geyser I was looking at how the tsar boat mod implemented their physics and here's how they rotate the boat:

        if isKeyDown(getCore():getKey("Right")) and 
                not isKeyDown(getCore():getKey("Forward")) and 
                not isKeyDown(getCore():getKey("Backward")) then
            -- boat:setPhysicsActive(true)
            -- AquaPhysics.addImpulseGetWorldPos(boat, force)
            boat:setPhysicsActive(true)
            
            local forceVector = boat:getWorldPos(-1, 0, 0, tempVec1):add(-boat:getX(), -boat:getY(), -boat:getZ())
            local pushPoint = boat:getWorldPos(0, 0, lenHalf, tempVec2):add(-boat:getX(), -boat:getY(), -boat:getZ())
            pushPoint:set(pushPoint:x(), 0, pushPoint:y())
            
            forceVector:mul(force)
            forceVector:set(forceVector:x(), 0, forceVector:y())
            boat:addImpulse(forceVector, pushPoint)
            boat:update()

            local forceVector = boat:getWorldPos(1, 0, 0, tempVec1):add(-boat:getX(), -boat:getY(), -boat:getZ())
            local pushPoint = boat:getWorldPos(0, 0, -lenHalf, tempVec2):add(-boat:getX(), -boat:getY(), -boat:getZ())
            pushPoint:set(pushPoint:x(), 0, pushPoint:y())
            
            forceVector:mul(force)
            forceVector:set(forceVector:x(), 0, forceVector:y())
            boat:addImpulse(forceVector, pushPoint)
            boat:update()```
#

so it looks like it is based off of world position?

quasi kernel
#

And would something like modifying objects go in client, server, or shared-

cyan basalt
#

the line I'm curious about is pushPoint:set(pushPoint:x(), 0, pushPoint:y()) I wonder why they are putting the Y as the Z πŸ€”

#

and also why the heck does getWorldPos take two vectors I would think it should take nothing and return a vector3 😒

shadow geyser
#

yeah looks kinda wack. seems like you would need to look through the decompiled java to understand what's going on

shadow geyser
cyan basalt
#

Yeah I looked through that a bit too but it's so confusing since none of the vars are named

#

like var1-var9 lol

#

ohhhh yeah that could be

quasi kernel
#

Am gon continue lator, must continue zomboid binge

cyan basalt
#

best of luck

#

and enjoy zomboid 😁

#
public Vector3f getWorldPos(Vector3f var1, Vector3f var2, VehicleScript var3) {
      return this.getWorldPos(var1.x, var1.y, var1.z, var2, var3);
   }

   public Vector3f getWorldPos(float var1, float var2, float var3, Vector3f var4, VehicleScript var5) {
      Transform var6 = this.getWorldTransform(this.tempTransform);
      var6.origin.set(0.0F, 0.0F, 0.0F);
      var4.set(var1, var2, var3);
      var6.transform(var4);
      float var7 = this.jniTransform.origin.x + WorldSimulation.instance.offsetX;
      float var8 = this.jniTransform.origin.z + WorldSimulation.instance.offsetY;
      float var9 = this.jniTransform.origin.y / 2.46F;
      var4.set(var7 + var4.x, var8 + var4.z, var9 + var4.y);
      return var4;
   }

   public Vector3f getWorldPos(Vector3f var1, Vector3f var2) {
      return this.getWorldPos(var1.x, var1.y, var1.z, var2, this.getScript());
   }

   public Vector3f getWorldPos(float var1, float var2, float var3, Vector3f var4) {
      return this.getWorldPos(var1, var2, var3, var4, this.getScript());
   }```
#

πŸ˜΅β€πŸ’«

worldly hatch
#

do modded cars have random spawns around the map or do you have to spawn them in to use them

#

cuz alot of these mods dont say

cyan basalt
#

i think most of them have random spawns

worldly hatch
#

cool

cyan basalt
#

can always change values and look for yourself too

#

cuz it might not be what you want

shadow geyser
#

modded vehicles need to be added into VehicleZoneDistribution to use the vanilla vehicle spawning system

worldly hatch
#

wait im new to modding in this game

#

do i have to manually do all this

#

or can i just get the mod from the workshop and apply it to my new world

shadow geyser
#

if you are making a new mod, yes. if you are just taking a mod from workshop, the mod author will have done it for you

worldly hatch
#

oh ok yeah im only getting other peoples mods

shadow geyser
#

just btw this modding channel is more for people creating mods. mod_support is more for user questions and help

worldly hatch
#

oh my bad

#

thanks

quasi kernel
#

Alright, I'm back from the binge.

#

What would be the best way to add extra functionality to radios, and where would I put the lua file?

#

Would I put it in server? Client?

#

Because I'd like to add the option to stick the rechargable batteries in radios and the like.

#

Okay I found some of the code for the battery

#
-- AddBattery
function ISRadioAction:isValidAddBattery()
    return self.deviceData:getIsBatteryPowered() and self.deviceData:getHasBattery() == false;
end

function ISRadioAction:performAddBattery()
    if self:isValidAddBattery() and self.secondaryItem then
        self.deviceData:addBattery(self.secondaryItem);
    end
end
#

I'm a bit stumped at to where to go from here.

#

I dont know what provides this data either than the constructor, so I don't know what to do now.

small topaz
#

Hi! Is it possible to delete vanilla recipes from game or to overwrite them? I am trying to make a new recipe for "jar of broccoli". I gave it the same name name as in the vanilla recipes.txt but what happens is that in-game interface now displays two "Make jar of broccoli" options, one according to the vanilla recipe and another one according to my own recipe.

SOLVED: by searching the web via, I found this: https://theindiestone.com/forums/index.php?/topic/22762-how-to-change-tweak-existing-recipes/ stating that adding Override:true to the recipe should do the trick

white latch
quasi kernel
#

Is modifying the radio to accept an alterative battery even possible..?

glad ridge
#

hey in a recipe how do you say (or) is this the way? ex: Soap2/LiquidSoap

white latch
shadow geyser
quasi kernel
cerulean lintel
#

Anyone know how to edit the zombie settings of Horde Night? Firearms B41 is showing up after adding the mod, HN doesn't.

#

not showing up ingame either and not showing up in AZO

#

wait. is horde night broken in 73?

shadow geyser
# quasi kernel May I call upon your knowledge

well, I havn't meddled with the radios so you will have to discover this stuff mostly on your own. I would try taking a look at ISRadioWindow.lua. It is the file with the UI. From what I can tell, the interactive elements are all RWMxxx.lua. so for example, I think the RWMPower.lua is the battery. Atleast I think it is as that class has a addBattery method

quasi kernel
#

Well that's def a lead, thank you so much.

#

Ive just been looking at ISRadioAction.lua for ages now

shadow geyser
#

You would at the very least have to modify RWMPower:verifyItem, as that is the function that decides what items work I think.

function RWMPower:verifyItem( _item )
    if _item:getFullType() == "Base.Battery" then
        return true;
    end
end

although i doubt just adding a if so it returns true for you item is enough. there are probably other checks as well that you would need to fix. Although you can always just try it out

quasi kernel
#

How would I safely modify it?

#

Yes I'm still a newbie, I'm figuring things out as I go.

#

I doubt just changing the file there will do what I want, I imagine I have to do something with a new file.

#

Redefine the function at least, yea?

#

Would I just do like..

#
function RWMPower:verifyItem(_item)
    local itemType = _item:GetFullType()
    return itemType == "Base.Battery" or itemType == "Base.RechargeBattery"
end
#

If I understand correctly, RWMPower is global, so I can just modify it from my lua script via redefining the function to my new code.

#

(That's assuming my understanding is indeed correct, I'm taking shots in the dark)

shadow geyser
#

so in your new lua file, you should have the following

require "RadioCom/RadioWindowModules/RWMPower" <-- this ensures that this file is loaded before your file. its technically not needed because all vanilla files are loaded before modded files, but I personally think its still good to do. Just to explicitly show what files you are modifying for future people(yourself or others) looking at the code

--the easy dirty way. this replaces the function entirely and may break if other people are also modifying this function

function RWMPower:verifyItem( _item )
    --your changes here
end

--the smarter way. not guaranteed compatibility, but its better in general. you are replacing the verifyItem function, but still using its logic. so if another mod made their changes, you would still be using them
local old_verifyItem = RWMPower:verifyItem;

function RWMPower:verifyItem( _item )
    if _item:getFullType() == "Base.RechargeBattery" or old_verifyItem(_item) then
        return true;
    end
end
quasi kernel
#

oo

#

Could I still simplify it to a single return line or is that not as efficient?

shadow geyser
#

if you want. whats important is that it is still logically consistant, and you are monkey patching the old function so it is still working

quasi kernel
#
require "RadioCom/RadioWindowModules/RWMPower"

local old_verifyItem = RWMPower:verifyItem;
function RWMPower:verifyItem( _item )
    return _item:getFullType() == "Base.RechargeBattery" or old_verifyItem(_item)
end
#

I see

#

Alright, thank you so much! This is one step closer to my goals.

cyan basalt
#

wait how do you post code blocks with color

quasi kernel
#

triple ` with lua after it

cyan basalt
#

O shoot

#

whoops

#

cool 😁

rocky sluice
#

what happened to this mod?

#

it was a moodle status thing

#

now it is renamed to nothing

dry stag
#

how can i use mod manager when hosting a server IT works when I make a solo world but when I'm hosting the default thing appears

viral spire
#

Has anyone attempted or is currently working on/playing with the concept of a radiation mod?

shadow geyser
shadow geyser
rocky sluice
#

and there are no comments

gilded hawk
#

Did anyone ever made a "brita" light version of the mod? πŸ€”
90% of the weapons not not spawn by default, so I'm wondering if I should switch to a lighter mod

gilded hawk
#

Why not

drifting ore
thin hornet
#

Good luck making a light version brita code is almost a new encryption algorythm xD

weak sierra
#

can you lock a repair type behind a recipe requirement?

weak sierra
#

i have similar opinions about brita being pretty heavy/bloaty, nice as it is in many ways

#

working on a gun repair rebalance rn

gilded hawk
#

Yeah, the mod is great but it has 200+ weapons, but only a bunch of them are appropriate for `90 Kentucky

weak sierra
#

and many are almost identical to one another

gilded hawk
#

yeah

weak sierra
#

pistols with so little difference in stats it's irrelevant, etc

shadow geyser
#

well it is about the aesthetics mostly

steady herald
#

how can i open pack files?

cyan basalt
#

i have the same question ^

quasi kernel
#

I imagine that for putting the battery into the radio, that's gonna be server managed for replication purposes.

#

So I gotta figure dat out

steady herald
#

how?

cyan basalt
#

@steady herald You can download the modding tools in your steam library

steady herald
#

i cant see where to open the .pack files

cyan basalt
#

ah gotcha, yeah idk either

solid carbon
#

Any chance someone has the files from "Moodle Fractions"? Seems that yesterday the author might have gotten hacked and the files are gone.

stable linden
# steady herald how?

I don’t remember exactly. I believe there is a TileZed.exe wherever the tools downloaded

stable linden
steady herald
#

but it doesnt let you open pack files

stable linden
#

There is a pack file extractor on the wiki

stable linden
#

Sorry, I’m about to take off and the message was from so long ago. Otherwise I’d be more helpful D:

steady herald
#

oh never mind

#

the folders empty

solid carbon
solid carbon
# steady herald

Aww, yeah same. Well I'll see if I can figure something out or I'll switch to another mod and hope the author got hacked and gets their account back rather than having raged over something and deleted it themselves. Thanks for trying though!

steady herald
solid carbon
steady herald
#

how long should it take to unpack a pack file lmao

steady herald
#

ok i got a feeling both unpackers dont work

#

ive been upacking a small pack file for half an hour

gilded hawk
#

@sour island Can I make a modified version of your "Skill Recovery Journal" mod? πŸ€”

halcyon dagger
#

qq how can call e.g. IsoPlayer method when returned from java array? I get the player objects in the list (calling getOnlinePlayers) but can't access any class members of it πŸ€”

sour island
#

If the change is worthwhile, you can make a pull request on github

gilded hawk
# sour island To what end?

For my private server I'm looking to add a negative trait that disables the usage of the skill book skill recovery journal.
Since some of my friends need to use it, but me and another guy don't want to use it, but we still want some benefits out of it, so the idea of a negative trait seems good to keep it somewhat balanced

sour island
#

Illiterate?

gilded hawk
#

Illterate but just for the skill recovery journal

sour island
#

You could make a secondary mod for something like this probably - but sure I don't have any isuses

gilded hawk
#

Okay thank you.

somber heath
#

what do I need to make an item have 3D model I can place ingame (be a Movable)
is it just a sprite from the sprite pack or do I also need an .x 3D model?

shadow geyser
#

the sprite pack, if you mean like for the .pack files is just for the tiles. you need a .x 3D model if you want to place it into the world like when you place bottle onto a table

quasi kernel
#

Hey robot, any idea why the rechargable battery icon isn't appearing properly in the item list?

#

It's not an urgent fix or anything, just a nitpick.

#

It appears properly in the inventory and everything which is strange.

#

Perhaps it's because the file for the texture doesn't fall under Base..

shadow geyser
#

what item list?

cyan basalt
#

do you guys happen to know what method project zomboid uses to check recipes? I need to change any recipes that are keep WeldingMask to keep [Recipe.GetItemTypes.WeldingMask],, but I don't want to go through and change all of the recipe definitions manually

shadow geyser
#

if you mean the one to spawn items in when in debug. im not sure. you can probably figure it out from the lua for it. ISItemsListViewer.lua can probably help

shadow geyser
cyan basalt
#

awesomeeee thank you!

#

I figured I could do it with scripts I was just searching the codebase aimlessly haha

quasi kernel
shadow geyser
quasi kernel
#

Hm, perhaps it's just a limitation on Zomboid's part. Soulfilcher's Awesome Time has the same problem.

shadow geyser
#

maybe try investigating that

quasi kernel
#

cuz it renders like this

#

it's a minor nitpick so im not too worried about it, was more worried if it would affect gameplay any

shadow geyser
cyan basalt
#

i've had the same issue with my mod

#

i just didn't care to fix it lol

quasi kernel
#

all of SF's stuff has the same problem

shadow geyser
#

thats the code it uses to render the icon. maybe it is the drawTextureScaedAspect2 function failing

#

might need like a specific png ratio for it to work or something

quasi kernel
#

it looks fine ingame so i guess its a non-issue lol

#

Also, robot, do you figure that the actual battery insertion is on the server side?

#

I'd reckon such seeing as it's likely it fires an event somewhere to make it replicate over when inserting a battery.

#

I have it so it detects the rechargable as a valid item to insert, it just doesn't insert quite yet.

shadow geyser
#

so looking at the code, the verify item is just a filter for the addbattery function, which then queues up a ISRadioAction "AddBattery" action

quasi kernel
#

Yeye

#

then we have all of this logic

#

which seems relatively irrelevant(?)

#

Okay so it creates a new "instance" of the ISRadioAction then adds it to the ISTimedActionQueue

shadow geyser
#

ah big of

#

looks like its not possible

#

the adding of the battery is done by javaside

quasi kernel
#

It start dipping into the java side?

#

ah.

#

crap.

shadow geyser
#

you will probably just change your mod so that your recharge recipe returns the dead batteries into a fresh one

quasi kernel
#

Prob

shadow geyser
#

yeah, honestly idk why you didn't do that in the first place

quasi kernel
#

I was thinking of having a proper appliance that did that, is that possible?

shadow geyser
#

unless you just wanted to make your own special ones to do it

quasi kernel
#

I wanted to have it so regular batteries and rechargables each had their own benefit

#

Rechargables would hold less charge but were rechargable.

shadow geyser
#

so not all batteries could be charged

quasi kernel
#

Ye

shadow geyser
#

well it might still be possible

quasi kernel
#

Looks like if I wanna implement that I gotta wait for more to be exposed

shadow geyser
#

basically you would just manipulate all the logic in the mod data of the item

#

and just have a flag in a battery that it is a rechargable one

quasi kernel
#

Like a boolean?

#

"IsRechargable" or somethin?

shadow geyser
#

although it would be quite alot of logic to manipulate all the UI to make it seem like a seperate item

quasi kernel
#

Perhaps too much for a first mod-

shadow geyser
#

probably

quasi kernel
#

Hm..

shadow geyser
#

even just saying it, I was dreading the amount of stuff you would have to do to get it to work

quasi kernel
#

Man, oh well.

#

Might be better to wait until I have more experience so you wouldnt have to practically make the mod for me hehe

#

I dont wanna put you through that

#

Wonder what would be a good alternative mod..

#

Eh, perhaps I could still just make a "temporary" version that makes all batteries rechargable.

#

Though, I'm unsure how possible that is.

#

Seeing as the way I want to do it is a little strange.

#

I was wanting to have a specialized Battery Charger object that could be placed on tiles that have electricity to slowly charge batteries within their slots.

#

Thing is, I'd have to fight to make a functional UI whilst somehow making it all on the lua end.

#

The lazy way is to just add a recipe, but that feels cheap.

#

Actually, I just had an idea.

#

@shadow geyser I hope I'm not being a bother, but how much more possible would it be to simply create a "hand crank" battery charger?

#

That way you can just charge a battery at a time and use a bit of fitness.

shadow geyser
#

depends on how much quality you want it to be

#

without an animation, pretty ez

#

or I guess if you can find an animation that looks like you are cranking you could just use it

quasi kernel
#

Yeye

shadow geyser
#

all you need to do is make another item for the hand crank

#

then make a recipe with keep handcrank, which basically means, the recipe needs that item, but it wont consume it

#

then have a Oncreate function which gives the player exp

quasi kernel
#

I'm unsure how realistic hand crank battery chargers are, so perhaps it'd be smart to make it like an electrical thing..?

#

So you could craft a hand crank out of a bit of electrical scrap, maybe a bit of metal scrap, and some wire.

#

Would there be a way to make it so it progressively charges as it's done or is that gonna require a different approach?

#

And what I mean by that, I mean it actually charges the battery as you do it, and it doesn't just wait until you're done to apply it all.

#

Cuz stuff like liquid transfer is able to do that in real-time and I'd like to know if similar is possible here.

#

Sorry if I'm asking too many questions

shadow geyser
#

you can. you would just need to then use an Ontest to filter batteries, to only allow batteries with less that 100% uses left, and then your recipe only adds a certain amount of uses back to the battery.

#

you would then have the battery use the keep keyword as well

zenith agate
#

Why in the heck would you not just make a simple LUA timer that adds a charge every X minute?
Find the script for a fridge, or similar; Rip it apart, make it charge up batteries.

Remove original batteries from distribution list, add your custom ones; Done.

quasi kernel
#

Original batteries are required due to java limitations.

#

I can't just make a new battery instance without having to do all sorts of wonk that could break crap

zenith agate
#

Just what.

quasi kernel
#

(Specifically for radios)

#

Radios are hardcoded on the java end to only accept Base.Battery

shadow geyser
#

or atleast implementing it in a way that wouldn't lag the shit out of PZ

dim hill
#

Anyone knows if it's @sour island's extended helicopter events that has a siren that starts playing sometimes? For a really long time? πŸ€”

shadow geyser
#

actually nevermind, if its only every minute, it wouldn't be that bad depending on how you handle it

#

but either way, alot more complicated than just adding a recipe

quasi kernel
#

So having it charge realtime is more complex?

shadow geyser
#

yes

#

its less about it being complex, and more about using recipes being incredibly simple

#

so relative to just using recipes, doing other methods are very complex

quasi kernel
#

I mean, I guess. Though I'd like the opportunity to learn more on the lua end of things.

steady herald
#

anyone have an idea why i cant unpack any .pack files? i let it ran for 2 hours on a 1000 kb file and nothing

#

like i literally just wanna get the tv tiles so i can make an animated tv

quasi kernel
shadow geyser
#

really depends on how much you are willing to just teach yourself to do

quasi kernel
#

I'm def willing to learn so long as I know the end result is possible.

#

So to my understanding, I gotta figure out how to add onto the context menu, get actions working, somehow find a way to get a loop going when an action is initiated, adjust charge of a battery, yadda yadda yadda.

shadow geyser
#

yeah there is stuff you would need to learn. obviously there are many ways to implement whatever you want, but imo you would need to learn about how to make a new tile. You would want it to be a container. Then the globalobject system would be a good thing to scour through and learn how you use the global obejct system to track these tiles. That gives you a good performant method to finding the batteries to have the charge

quasi kernel
#

Oh, I'm thinking of going with the hand crank for now.

shadow geyser
#

oh I see

quasi kernel
#

Seems simpler and more convenient.

#

Plus it makes it so Electrical is more valuable since those with high levels can recharge batteries.

#

Thus making batteries themselves more valuable.

shadow geyser
#

oh if you are going to do the hand crank, then just use the recipes

quasi kernel
#

I just need a way to adding a context menu to batteries with less than 100% charge / are dead to "Charge with Hand Crank" if a crank is available.

shadow geyser
#

just seems simpler

quasi kernel
#

Yeah but recipes wouldnt constantly update the charge would it?

#

Unless that's an option-

#

Sure recipes work but it's just bleh

#

I wanna go for something with at least a tad bit of difficulty so I can learn

#

I'd need to

steady herald
#

i found the tileset png

#

just gotta hope it works

quasi kernel
#
  • Add item "HandCrank.DeadBattery", which Base.Battery turns into at 0% charge.
  • Add Context action to "HandCrank.DeadBattery" item or "Base.Battery" with less than 100% charge
  • Initiate an action that begins "charging" the battery a bit every minute or so, with the amount charged varying with Fitness and possibly Depression.
  • Stop action when the selected battery has reached 100% charge or the player sprints.
#

iirc there's a value for items to turn into another upon draining / destroying so

shadow geyser
#

well, just to give a head start on having the actions repeat themselves. here is on I made for something else


function ISAddPollenAction:perform()

    local inv = self.character:getInventory()
    local count = inv:getItemCount("Hydrocraft.HCPollen")

    local args = { x = self.beehive.x, y = self.beehive.y, z = self.beehive.z}
    inv:Remove("HCPollen");
    sendClientCommand(self.character, 'Beehive', 'addPollen', args)
    -- needed to remove from queue / start next.
    ISBaseTimedAction.perform(self);
    count = count - 1

    -- add 2 week_unit to check if new action is needed because beehive.pollenAmount wont update immediately
    if ((self.beehive.pollenAmount + 2*Beehive.week_unit) <= self.beehive.honeyMax and count > 0) then
        -- queue up another pollen action if the beehive has the space for it.
        ISTimedActionQueue.add(ISAddPollenAction:new(self.character, self.beehive, 100))
    end

end
quasi kernel
#

oo

shadow geyser
quasi kernel
#

Alright, so lemme try and translate this to try and make sure I'm understanding this correctly..

shadow geyser
#

there is also a replaceondeplete

quasi kernel
#

ReplaceOnDeplete is prob the one I need

#

Only thing is idk if it'll trigger properly with some vanilla items like walkie talkies / flashlights

#

Since I'm p sure they just eat the battery when it's lost charge

shadow geyser
#

im not sure exactly which one the vanilla batteries trigger when they run out of charge, so you might have to figure that out by yourself

shadow geyser
quasi kernel
#

Lemme guess, vanilla actions like that are also java-side-

cyan basalt
#

figured out how to add a new sourceitem to a recipe from code. thanks for the advice @shadow geyser

function editRecipes(){
    let allrecipes = getScriptManager().getAllRecipes();
    for (let i = 0; i < allrecipes.size(); i++) {
        let recipe = allrecipes.get(i) as Recipe;
        let recipe_sources = recipe.getSource() as ArrayList;
        // For each source -- check if there's a WeldingMask and no WeldingGoggles.WeldingGoggles
        for (let x = 0; x < recipe_sources.size(); x++) {
            let source = recipe_sources.get(x);
            let sourceItems = source.getItems();
            if (sourceItems.contains("Base.WeldingMask") && !(sourceItems.contains("WeldingGoggles.WeldingGoggles"))){
                sourceItems.add("WeldingGoggles.WeldingGoggles");
            }
        }
    }
}
onGameStart.addListener(editRecipes)```
#

typescript too

#

nested for loops yay

#

vanilla recipes all are correct, but I needed to add this for mod compatibility since they just hardcoded the weldingmask item instead of the tag

steady herald
#

i feel like this shouldnt happen

#

but it does it with the og tileset too...

shadow geyser
#

yeah all the items that aren't confined to 1 tile are butchered like that, because the 2 tiles are technically different tiles

steady herald
#

welp

#

only 1 way to test it

shadow geyser
#

hmm, aren't the wide screens atleast 2 two tiles? maybe im just imagining things

steady herald
#

nah theyre all 1 tile

jagged ingot
#

Good old Isometry.

steady herald
#

preeeeety sure ovens are too

#

friiiiick

#

the wav file is gonna be 36.4 mb 😒

shadow geyser
#

hmm, then maybe its a performance thing? cuz I think atleast the verticle cuts, are where a wall would cover them partially

#

so that way only half the furniture needs to be rendered when there is a wall partially infront

quasi kernel
#

Hey, robot, I found something!

shadow geyser
#

although I can't explain the horizontal cuts