#mod_development

1 messages · Page 306 of 1

small topaz
#

Yes. I put my script.txt folder in the common folder. Then, it doesn't work for my B41 version of the mod but it does work for the B42 version. (Both version don't contain the script.txt in there media folder ofc.)

bronze yoke
#

it's not supposed to

#

build 41 does not load files from build 42

#

the common folder is a new feature so older versions don't support it

small topaz
#

Ok. Many thanks for the info.

But what exactly are then the supposed files which may go into the common folder if it only works for one version? Is this just a tool for future versions (or maybe even different patched version of B42)?

umbral raptor
#

is there a tag or flag for recipes that allows crafting while an item of a recipe is on the ground?

bronze yoke
#

it'll make more sense when multiplayer comes out and people will actually stay on older versions, and when b43 comes out

bronze yoke
#

for now i recommend putting all assets into common, and all code into 42

#

translations can also be in common

umbral raptor
#

or you can do the big brain thing and place all your files in both

#

works for me

#

takes up more space but wont matter for tiny mods, only matters for large ones

#

i just copy and paste my media files in both 42 and common

bronze yoke
#

why would you do that ???

#

you can just leave one empty if you really don't want to engage with it 😭

small topaz
#

I still don't understand: which parts of the mod can access the files from common? If it is only B42, then I still do not get how you can save space by putting data to the common folder because having the data in common or in B42 doesn't matter then (takes up the same amount of space).

bronze yoke
#

right now it doesn't really matter

#

it will matter more in the future, when b43 is out, or when there are multiple patches people are playing, and your mod may need a different version for each (this will definitely start happening when multiplayer is out and servers don't want to break their saves)

small topaz
#

ok! then I understand! thanks for explaining!

torn igloo
#

ELI5: What does setAnchorLeft / setAnchorRight / setAnchorTop / setAnchorBottom do?

bronze yoke
#

when the parent panel is resized, it will follow the edges it's anchored to

#

if it's anchored to two edges on the same axis, it will resize itself so that the distance between the edges stays the same as it was before

abstract iron
#

So i was thinking about something, what do you guys think that is the most fundamental coding/scripting consepts are in the creation of mods for pz, for instance I suspect that object oriented coding/scripting is a huge part of pzs system.

#

What are your guyses thoughts on this

bright fog
#

It's used for timed actions, context menu, UI related elements

#

But I didn't need to touch any of it for a while tbf

#

And it's fairly easy to play with

abstract iron
#

I see,

#

So potentially arays or data structure?

bright fog
#

It depends what type of mods you do

#

There's no specific requirements

abstract iron
#

That makes sense, I think in order to pin point it one has to understand what they are doing before they understand what fundamental is required

#

I'm writing a paper and so these are just some questions I intend to answer in a digestible way

umbral raptor
#

is the the recipe tag InHandCraft neccessary for the recipe to work?

#

i see it in pretty much all recipes

#

and i wanna make one where the items are on the ground

bronze yoke
#

the more experienced modders, especially with previous experience in computer science, do tend to use OOP, but i'd say the average mod doesn't use it at all

bright fog
bright fog
mortal escarp
#

How should I handle a wrongful DMCA complaint against my mod?

#

If anyone's ever dealt with this as a modder, please reach out.

bright fog
#

We've done that before Chuck can possibly help a bit with that

#

Not saying it'll fix the problem tho but that could help

mortal escarp
#

Was just about to ask for link, you are awesome bro, thanks @bright fog

small topaz
#

As a general question: do you think it is a good idea to add your code to a lua event and also to manually trigger lua events? Or has this a significant likelihood to cause stability issues?

bright fog
#

As long as you don't trigger the event during the event

#

Or that's called a while loop lol

silent zealot
#

Which lua event(s) are you think of triggering manually?

#

You may also want a safeguard of some sort to stop recursive/unwanted event triggering.

bright fog
#

Like I said, don't trigger the function which triggers the event

small topaz
small topaz
slim swan
#

Is there any way to teleport the vehicle?

#

Only find teleport vehicle in bullet,not sure if it would work

round kiln
#

so with item tweaker mod no longer going to work on b42, what is the way to modify the values of existing items
like do i modify the item tweaker code or?

#

want to make something related to changes of certain values/output something different after using items

bronze yoke
#
local item = ScriptManager.instance:getItem("Base.Apple")
if item then
    item:DoParam("Parameter = Value")
end
#

this is all item tweaker ever did

round kiln
#

ah i see

#

its really just that

round kiln
#

i find it interesting how this mod that has existed for 10 years now really is just that lol

abstract iron
round kiln
bronze yoke
#

yep

bronze yoke
small topaz
#

Is it possible to change a specific parameter of a specific clothing item's xml file while the game is running via lua coding? Specifically, I want to temporarily delete the xml paramter
<m_UnderlayMasksFolder>media/textures/Clothes/BulletVest/Masks_BulletVest</m_UnderlayMasksFolder>
which can be found for several vanilla clothing items (in my case mainly bullet proof vests).

umbral raptor
#

het i have a very simple lua request from anyone that can help

#

i want to make an item that can be written on like a notebook but doesnt require a pen or pencil to write on

#

thats its.

#

so pretty much skipping the requirement for pen/pencil for a single item

#

i have no idea how to do it, so if anyone can, let me know

#

u can help by also telling me where to find the LUA files related to the writing on notebooks system.

round kiln
#

theres a mod that i know that hasnt been updated for almost 3 years now with no updates or interest from the original mod creator and want to port it/expand upon (which uses itemtweaker)

ancient grail
# round kiln its really just that

yep that mods goal was to make it simple for other modders to change values of items without having to learn lua

tho most of the ones that did use it added shit ton of prints lagging the shit out of servers

bronze yoke
#

it also doesn't even fully work in multiplayer lol

#

it only changes the items on the client side, which sometimes doesn't matter but sometimes does

#

also, the prints aren't the fault of the mods using it, item tweaker is the one that does that

small topaz
# umbral raptor u can help by also telling me where to find the LUA files related to the writing...

I'd start and check the vanilla code in media/lua/client/ISUI/ISInventoryPaneContextMenu.lua. This generates the right-click options for the items in your inventory. There is also an option for writing in journals, notebooks etc. The option for writing is only present when players have pens in their inventory. So you could pbbly make a writable item and simply don't use any condition stating that there must be a pen available. (Could be difficult coding though...)

After players click the option to write, there is a specific timed action which is triggered (should be ISWriteSomething:new()).

Also possible that there are simpler solutions. It is just my first idea.

umbral raptor
small topaz
# umbral raptor thanks alot, will check it out ❤️

Not 100% sure but aren't there even easy methods to add a right click option to a modded item (using some kind of lua event or smth)? In this case, you could simply try to add a "write" option to your item and then trigger an appropriate TimedAction, similar as the vanilla code does.

abstract iron
#

Or just a notebook without the required pen/pencil used in the game?

umbral raptor
#

i want to make one that doesnt require a pen or pencil to write in

abstract iron
#

Hmm

eternal tiger
#

Okay so I am just trying to get a custom Map Symbol, but I keep getting stack trace errors on Build 42.

I have a 64x64 PNG stored in common/media/ui/Lootablemaps and my MapSymbolDefinitionsTF.lua is simply MapSymbolDefinitions.getInstance():addTexture("TFSkullBones", "common/media/ui/LootableMaps/map_TFskullbones.png", "Test")

Everytime I open my map with my mod loaded, I get errors and the map refuses to open. am I doing something wrong here?

eternal tiger
#

Hmm. I'm thinking it might be the .png itself causing the problems

eternal tiger
#

Actually it seems you need at least 9 different Map Symbols otherwise it breaks the map 🤔

eternal tiger
#

Hm yeah that seemed to fix my issue.

#

Just needed to make 8 more symbols

round kiln
bronze yoke
#

shared

round kiln
vast pier
#

will
collider:HasCurtains():IsOpen()
check the curtains for IsOpen or the original collider?
trying to get curtain detection when a zombie touches a closed window, but unsure how to go about it

#

Answer: checks the curtains

round kiln
#

trying to figure out why pz crashes from the existence of my mod being turned on

#

theres also only very few files in it

drifting ore
#

Did you check console.txt in your user zomboid folder?

round kiln
#

i did but not sure what to look for

drifting ore
#

Usually at the bottom of the console log after a crash, it will show which file was being loaded before everything stopped

round kiln
drifting ore
#

If you send the console.txt file I can help you take a look

round kiln
#

i should also mention the few files that i have, referencing the file format of how other mods do it

drifting ore
#

It looks like in items_dairy.txt you are referencing "Weight" as an item parameter

#

Which is not valid for some reason... mind sharing items_dairy.txt?

round kiln
#

ah, i see now

#

forgot a comma

#

the classic

#

thanks for checkin

drifting ore
#

No problem

round kiln
#

but now i gotta try to see if theres any more problems before the repeat the process

silent zealot
round kiln
#

finally fixed the problem that i was dealing with

#

time to repeat the process

#

i had coded before, but never done lua or pz modding before

#

like sometimes

brave bone
#

question: why do some items have "attachment world" in the model scripts, but i don't see world in the attachment block parameters, does this mean that it can be placed like the workshop mod's workbench? thats the only thing that makes sense that i can think of.

indigo copper
#

Is there a way to know if a zombie is alive when a player attacks it?
I tried using the OnHitZombie event, but the IsoZombie parameter in this event gets the state before being attacked.

sand saddle
#

i have a strange bug in my modlist and for the god of code i cant figure out which mod causes it. so i pondered to go with a Filesearch to figure out wich mods are most likely the culprit. the issue is : if i dismantle a metal floor or metal wall i crafted i get blowtorches back..... so to narrow down what mod/s might be the culprit/s i was pondering to do a "search in files" with notepad++. what functions mess with the return of dismantling?

#

to note : there is no error associated with it. and the return is "full" blowtorches.

vague marsh
winter bolt
#

that event fires after allll the damage stuff is done

sand saddle
vague marsh
sand saddle
#

nope not subvscribed to a mod like that. i only noticed this (i think cross mod bug) in my actual playtrough. once i had learned the recepies and tried to build a base.

vague marsh
knotty stone
#

anyone know where the function is to destroy plants when you drive over it with a vehicle?

knotty stone
#

hm ok, thx

sand saddle
silent zealot
#

Unless you have some super weird mod reverse engineering deconstruction by looking at the inputs to make something, twhatever mod is creating blowtorches needs the text "blowtorch" somewhere in it.

sand saddle
silent zealot
#

If it happens with no mods, report it on the bug report forums

vast pier
sand saddle
#

training up welding and finding the neccersary magazines is a hassle.

vast pier
#

I don’t think debug mode would be causing recipes to bug out like that

sand saddle
#

my guess is that dissasembling stuff takes the crafting material. does some arbitary math and chances to return items on skill. and maxing out your skills makes it wonky and returns useables in full condition. but yeah currently testing that.

knotty stone
#

how do i disable/kill a vanilla function?

sand saddle
sand saddle
# knotty stone how do i disable/kill a vanilla function?

As a example (fantasy function)

`local old_FunctionForStuff = CategoryForStuff.Functionforstuff
function CategoryForStuff:FunctionForStuff(input A, InputB)

end`

if it has a return value add a "return Thingtoreturn" into that function.

#

this would disable the function entirely. keep in mind this might have bad consequences if not tought about. any mod that uses that function would be Broken.

sharp plinth
#

Mod Manager v1.0.8 Update: I've nearly completed the next update and just wanted to showcase the mod detection system.

  • What does it do?

🔎 Auto-Scanning & Fix Suggestions
✅ Detects missing/corrupt files (mod.info, modinfo.json).
❌ Flags error logs & missing files.
🔧 Provides fix suggestions automatically.
🏷 Tag Management & Custom Error Notes
🛠 Tag mods as In Progress, Bugged, Broken, or Fixed.
📌 Add custom error notes inside mods for easier troubleshooting.
🔔 Discord Webhook Integration:

  • Auto-notifies Discord when mod status changes!

Built for Project Zomboid. 🙂

https://www.youtube.com/watch?v=FinReuk1j0A

Official Download: github.com/OV3RLORDS-MODS/Modix-Mod-Manager
Discord: discord.gg/EwWZUSR9tM

Workshop: steamcommunity.com/sharedfiles/filedetails/?id=3422448677

Key Features:

🔍 Auto-Scan

Automatically scans your workshop folder for missing files (mod.info, modinfo.json) and error logs.

⚠️ Conflict Detection

Identifies file conflicts betwe...

▶ Play video
umbral raptor
#

can someone tell me how i can know which mask number is what in clothingitem?

umbral raptor
#

Thanks alot both of you ❤️

#

Helped alot

small topaz
#

that is for B41 though. not sure if the changed anything for B42...

umbral raptor
#

nope still the same

#

i have the clothingitem already filled, i just didnt know which ones to remove to get an effect i wanted

knotty stone
# sand saddle As a example (fantasy function) `local old_FunctionForStuff = CategoryForSt...

ok iam to stupid to get it^^ I need to get rid of the self:destroyOnWalk(luaObject,square) or the if square:isVehicleIntersectingCrops() then luaObject:destroyThis() return end in the second function ```function SFarmingSystem:checkPlantSquare(luaObject)
local square = luaObject:getSquare()
if not square then return end
luaObject.exterior = square:isOutside()
luaObject.hasWeeds = SFarmingSystem:hasWeeds(square)
-- if the plant has enough of a pest flies infestation we apply flies to the square
if luaObject:hasVisibleFlies() then square:setHasFlies(true) end
-- we may destroy our plant if someone walk onto it, or if it's already dead
self:destroyOnWalk(luaObject, square)
end

function SFarmingSystem:destroyOnWalk(luaObject, square)
if square:isVehicleIntersectingCrops() then
luaObject:destroyThis()
return
end
end

crystal oar
#

is it going to be a problem if i use the 41 client to update my mods? i can't get experimental to load at all

bright fog
#

B41 can't read B42 mods

slim swan
#

is there any way to teleport the vehicle?

crystal oar
bright fog
crystal oar
#

my mods are mostly single recipes, like turning seeds into oil or something, i'm sure if someone tries it on 42 and it doesn't work they will let me know. right now they just don't work in 42 at all without the update.

drifting ore
sour island
#

Whatever I used for error mag is the list of errors

#

Some errors are not added though - due to how the exceptions are sent

steep glade
#

I'm new to PZ modding, does anyone knows why I get 30k+ undefined global warnings lol
on my workspace theres only the mod folder and the b42 lua folder

drifting ore
sour island
#

It's the same method the F11 screen uses

#

getLuaDebuggerErrors()

sand saddle
# knotty stone ok iam to stupid to get it^^ I need to get rid of the ```self:destroyOnWalk(luaO...

i would propably overwrite this small function :
function SFarmingSystem:destroyOnWalk(luaObject, square) if square:isVehicleIntersectingCrops() then luaObject:destroyThis() return end end
to replace it you basically overwrite it. place it appropiately into either client/shared or server subfolder.
function SFarmingSystem:destroyOnWalk(luaObject, square) if square:isVehicleIntersectingCrops() then --luaObject:destroyThis() return end return end

knotty stone
sand saddle
#

eeks. dont copy paste what i wrote i placed a "end" and a return to many into my example.

#

just copy the orginal function over and comment the destroy line out (--))

sand saddle
knotty stone
#

i tried someting similar but its just not working, maybe iam somehow at the wrong place there is also this in this function -- the other stuff is handled java-side now, maybe iam just stuck with it, so no Agrotsar welp 😄

sand saddle
#

sorry cant help with java modding. that stuff is a blackbox for me -.-

drifting ore
sour island
storm trench
#

I'm trying to port the ZuperCarts mod to B42 for myself and I have it working without errors, but the animations don't work. Anybody got some idea of what I need to change? It's painful to play this game without the mod and iBrRus doesn't seem to be coming back.

karmic wedge
#

Does the common folder work in B41 or do I need to do this for my mod to still work in 41?

merry patio
karmic wedge
#

So like above image.

#

unfortunate, doubles file size

prime viper
#

tried making a main menu background mod, but all I get is a black background and 4 errors, any reason as to why this is?

sand saddle
karmic wedge
#

yeahg, womp

#

is there a list somewhere that has all the distribution changes?

bronze yoke
#

some will remain because the vanilla lua just does things that would be considered bad 😅

karmic wedge
#
ERROR: General      f:0, t:1740337489247> ExceptionLogger.logException> Exception thrown
    java.lang.Exception: Item not found: TNG_VHS.TNG_VHS_Collection_S5. line: item 1 [TNG_VHS.TNG_VHS_Collection_S5] mode:destroy at InputScript.OnPostWorldDictionaryInit(InputScript.java:688).

Pain. What am I doing wrong here?

umbral raptor
#

in the inputs

#

and also the outputs dont use a [] betweent he name

#

heres a recipe as an example

#

craftRecipe ConvertToFuel
{
Time = 30,
timedAction = Making,
AllowBatchCraft = False,
Tags = InHandCraft;CanBeDoneInDark,
Category = Survivalist,
inputs
{
item 1 [SupportCorps.LanternElectricEmpty;] mode:destroy,
}
outputs
{
item 1 SupportCorps.LanternFuelEmpty,
item 1 Base.LightBulb,
}
}

#

see how i did it?

karmic wedge
#

Weird, I don't see that in any of the base game files but I'll try it

drifting ore
#

Should just be the output, it works without the ; if you only have one

umbral raptor
#

but if it doesnt work, try adding it.

umbral raptor
karmic wedge
#

lol, never got around to it

umbral raptor
#

fuck, just checked, its too early.

karmic wedge
#

just tng season 1-7

umbral raptor
#

voyager was relesed in 1995.

#

as a trekkie sir, thank you so much ❤️

karmic wedge
#

o7

umbral raptor
karmic wedge
#

Hrmm. Still getting TNG_VHS.TNG_VHS_Collection_S5. line: item 1 [TNG_VHS.TNG_VHS_Collection_S5;] spit out at me.

this is what it looks like now

    item TNG_VHS_Collection_S5
    {
        DisplayCategory = Entertainment,
        Weight = 0.1,
        Type = Normal,
        DisplayName = Star Trek: The Next Generation Collection 5,
        Icon = TNG_VHS_Case,
        WorldStaticModel = TNG_VHS_CollectionBox,
        Tags = IsMemento,
    }
    craftRecipe Open Star Trek: The Next Generation VHS Collection 5,
    {
        timedAction = PackingBox_Small,
        Time = 80,
        OnCreate = Recipe.OnCreate.TNGVHSCollectionS5,
        Tags = InHandCraft;Packing;CanBeDoneInDark,
        category = Miscellaneous,
        inputs
        {
            item 1 [TNG_VHS.TNG_VHS_Collection_S5;] mode:destroy,
        }
        outputs
        {
            item 1 TNG_VHS.TNG_VHS_EmptyCollectionBox,
        }
    }
#

It just really hates season 5 I guess lol

bronze yoke
#

there shouldn't be a semicolon after the item name

#

the semicolon is supposed to separate multiple item names

karmic wedge
#

Was just told me to add that a few messages up somuchcringe
Regardless, same error with or without.

bronze yoke
#

is your module definitely named TNG_VHS?

karmic wedge
#

Yep yep
module TNG_VHS;

bronze yoke
#

there shouldn't be a semicolon

#

your module is called TNG_VHS;

karmic wedge
#

Lua changed in B42? This mod has been working on b41 with that semicolon for nearly a year Zeniiiiii

bronze yoke
#

this isn't lua, but there may be slight differences in script parsing now

karmic wedge
#

I see, funky

bronze yoke
#

also if your b41 recipes referred to the item by their short types, module name wouldn't matter

karmic wedge
#

Distribution referred to them with the module

#

it just works ™️
trying without now

bronze yoke
#

huh, maybe it's a parsing difference in b42 or i'm wrong - but in my experience the parser doesn't drop special characters from module names

storm trench
bronze yoke
#

you need animsets in the b41 location as well as the b42 location or they won't be loaded

#

so media/animsets *and* 42/media/animsets or common/media/animsets

storm trench
#

Yep, problem solved. 💚

south bear
#

What function sends a client send a message in /all to a MP server?

karmic wedge
#

Yep lol. ; in the module name definitely wasn't helping anything. New useful errors to work with now. Thank you.
Made the naming scheme sane, no more TNG_VHS.TNG_VHS_Collection_S1 FennecScreamR Not sure what my thought process was when first making this. Few more things to solve and it's b42 working again yippie

slim swan
#

Anyone know how to get the item’s position

#

I tried using WorldItem, but if the item is not on the ground, its position cannot be detected.

#

When the item is in a cabinet or something similar, it can still be recognized as a WorldItem, but when it’s in a car trunk, it’s no longer a WorldItem.

bright fog
#

And from the container you can find where it is

eternal tiger
#

It has begun.

bright fog
#

Custom icons, nice

eternal tiger
#

I wish I could make these with custom colors instead of just the pens. Not sure how one would do that.

#

Cause right now I use 3 different stamps. The Background, the Hexagon, and finally the Icon

bright fog
eternal tiger
#

but I guess that also means you can use any other Icon pack you want and make a little border for it.

storm trench
#

Changing the capacity for the mod doesn't change how much the container holds. Anybody have an idea why? It was 49 by default, but that equaled out to only 37 in game. So I changed it to 75, which adjusted it to 48 in game... until it just... stopped doing so. Now it's back to 37 no matter what I start a new game with the container value set at.

bronze yoke
#

container capacity cannot be higher than 50

storm trench
#

I'll give that a go, but the weight of 37 in-game still had that issue set at the default 49.

storm trench
#

Yeah, don't change anything unfortunately.

vast pier
silent zealot
#

There are seperate limits in Itemcontainer:

bronze yoke
#

why aren't these static anyway?

#

if you can convince people to stay in debug mode you can get around it i suppose

#

i'm pretty sure they're enforced by lua anyway though

#

there's rarely any reason to but you can set instance field values in debug mode

silent zealot
silent zealot
#

Just need to fix a problem where moving a worn container over 50 weight to a different body location will drop it onto the floor AND put it in your inventory.

#

(which also gave me the idea for an Ender chest mod, where you make a container that access the same inventory from everywhere)

bronze yoke
#

that could be brutal to implement

#

i suppose you could put an invisible + weightless container in the player's inventory as long as you don't care about other players being able to access it too

silent zealot
#

I thought it wouldn't be too bad, it's not 850 lines of lua patching because weight limites show up in all worts of stupid places

silent zealot
storm trench
silent zealot
#

Assuming there is some sort of unique id per player, which I assume there is.

bronze yoke
#

the issue is if it's not in a regular container somewhere it won't save

#

so it has to be in someone's inventory for safety

silent zealot
#

More likely it would need some sort of action to attach the inventory attaching to since accessinga container is a direct java call, so might end up being a "place chest in world to access" type of deal.

silent zealot
bronze yoke
#

the squares would have to be loaded for their containers to be accessible

silent zealot
#

hmmm

bronze yoke
#

you could do it if you could serialise inventory items and load them on demand, starlit had a module for that in b41 but i don't really want to update it

silent zealot
#

well, all that is aproblem for a mod I'm not even going to consider starting until I finish up three half-done mods

bronze yoke
#

every time they add some new thing that either needs to be saved or changes how items are saved i'm probably deleting people's items so i'll probably just leave it in b41 which will never change anyway

silent zealot
silent zealot
#

...and then to further make sure I don't get all my half-done mods finished I installed Avowed and it's such a weird game; like Skyrim except it all just works without horrible jank and 50 QoL mods to have a usable inventory interface. And it's Unreal 5, but runs so smooth out of the box without changing any settings on my 4 year old video card.

#

And it's a AAA RPG, but doesn't feel like it was built by a committee of executives that don't actually play games.

#

It's just.. fun to play, and I didn;t realize how much I mesed that with new games. Even if it's going to be a one-playthrough game for me, unlike Zomboid and it's thousands of hours.

plush wraith
#

Trying to find a way to detect this event <eventOccurred>collideWithWall</eventOccurred> but not seeing anything I can call. Anyone tinkered with this before?

bronze yoke
#

i think you can only catch these in timed actions

silent zealot
#

Sometimes it's odd what events are missing - like I was just looking for a vehicle damaged event, and the only one is "vehicle damaged enough to need a new texture"

#

The car dashboard has it's own routine that saves the car state and rechecks it every 10 ticks to see if it got worse.

plush wraith
#

Ya, Im trying to detect different falling/tripping events, falling over a fence sets a flag you can detect from the playerObj, but falling from running into a wall doesn't follow the same logic

#

PZ devs keeping us on our toes

bronze yoke
#

you might be able to detect the player entering the collidewithwall state?

plush wraith
#

Ya I was looking for something to check collide/collidetype but still looking around

#

Was also looking at the different bumptype variables that get set at times

#

Seems like 3 different systems from over the years

bronze yoke
#

in an OnAIStateChange callback you can check if the new state is the collidewithwall state

eternal tiger
#

I have to say, when renaming bulk images windows powershell is a godsent.

#

This would take hours if this didn't exist. LOL

drifting ore
#

There is a tool I use… bulk renamer or some shit like that

plush wraith
eternal tiger
#

I use $counter = 1 Get-ChildItem *.png | ForEach-Object { $newName = "$counter-REPLACEWITHNAME" + $_.Extension Rename-Item $_.FullName -NewName $newName $counter++ }

That way it doesn't have the annoying trailing (#) at the end.

#

My IT courses finally coming in handy. And its for modding a game. lol

drifting ore
#

Bulk Rename Utility if you wanna check it out… Ive never had that issue with the # trailing but I primarily use it to rename media files

eternal tiger
#

I'll just stick to powershell. It serves its purpose really well.

silent zealot
eternal tiger
#

It really is. I have a Raspberry Pi I use to mess with linux or a virtual machine depending on the day. I'm really debating about switching to a Linux OS for gaming, but a few of the games I play rather often aren't supported.

#

I have well over 200 files I need to rename in various locations, so this little script is saving me so much time.

silent zealot
#

I will also qualify that with in the last twenty years I've done huge amounts with linux but only ~2 hours of that was using a GUI when a developer needed one for something... everything else has been commandline

vast pier
silent zealot
#

hahahaha

#

Nice icon style

#

...at least you have preview images done

vast pier
vast pier
# vast pier

the only one out of these 5 mod images that I've been actively working on is the molotov icon

#

cuz that's the bomb rework mod

eternal tiger
#

I got my icon done. Just gotta do the preview images.

vast pier
#

nice

silent zealot
vast pier
#

I encourage people to use game-icons.net but I'm worried at some point someone is gonna just fully copy the design style I do (the color choices with the background and border)

#

It won't be a big deal just kinda bleh

#

The main reason you can look at a mod and tell it's one I made is because of the background color

eternal tiger
vast pier
#

for consistency sake

bright fog
silent zealot
#

For me the font/outline/color is enough to tie things together.

eternal tiger
silent zealot
#

And the same vignetting overlay, but at different levels based on the background.

eternal tiger
#

I don't know if I'll post more than just the one mod, but having a unique title would help distinguish them.

vast pier
#

I mean game-icons.net is Creative Commons license, and everything is made by them.
It's not "free" like google images, it's free like public domain stories

eternal tiger
#

Good to know. I'll have to give them a look.

vast pier
#

I always say this when it's brought up, but you will genuinely recognize a lot of their icons

silent zealot
#

That's the common analogy I've seen for open source software.

eternal tiger
#

Wow actually I do recognize a lot of these.

#

The DND Program I use must use this as a library for icons.

vast pier
#

Here's the icon sheet, containing every single icon.
Despite how I never see anyone talk about it, this resource is used more frequently than people realize.

#

I try to show it off whenever possible cuz I think it's neat

eternal tiger
#

I just double checked. Dicecloud does for sure use these

#

good to know!

vast pier
#

Yeah it's a great resource!

eternal tiger
#

Wow I might need to use some of these for the Symbols.

eternal tiger
#

Just found these beauties'

#

Now to figure out how to setup an Options screen so you can enable and disable these because

#

there is alot

vast pier
#

what're they from?

plush wraith
bronze yoke
#

states are singletons, so you can compare them to the instance

plush wraith
#

Ya but only some of the states are exported it seems

bronze yoke
#

oh i see, some aren't exposed

#

that's a pain and likely unintentional

plush wraith
#

Go figure its one of the ones I needed 😂

#

But now you can run face first into a wall and drop your smoke pepo_happy

eternal tiger
#

I found a code that can help me write my code LOL

#

or rather a Script to help me write my code.

#

Adding numbers to all these would be horrific to do by hand. Especially since there is a lot more for every other category.

#

wait

#

WAIT i messed it up

#

Got it working

#

lol

grizzled fulcrum
#

what in the fuck are you doing

vast pier
#

Can't be produced by a recipe, but I have the recipe open and visible?

grizzled fulcrum
#

is that you writing them?

grizzled fulcrum
#

also you have 2 of the same Vehicles folder, why?

vast pier
eternal tiger
#

Thats a thing you can do?!

#

Lets see how this works.

eternal tiger
#

Actually now that I'm looking at this I feel like an idiot LOL

grizzled fulcrum
eternal tiger
#

Yeah that's what I'm working on. I know basic C++ and Java, but its been about 6 years since I've last modded. I should go take a refresher course.

#

Also that code won't work as is. The second instance of name in

instance:addTexture(name, path, name)

is referring to the Category name, which would just create 41 categories.

Thank you for jogging my memory. lol

ancient grail
#

not sure if you need it tho

eternal tiger
#

I'm just making Map Icons

ancient grail
#

ayt yeah do what aoqia mentioned and just run everything on a table

#

your 1k lines of code becomes 6

grizzled fulcrum
vague marsh
eternal tiger
#

xD Got married. Coding had to go on the back burner! lol

tacit pebble
eternal tiger
#

I took like a 3 month course on Java at one point, but I really never got into modding Minecraft. lol

sand saddle
#

question about modinfo. i know there is a "LoadModBefore=" option. is it valid to add a "LoadModAfter=" ?

sand saddle
#

thanks

small topaz
#

Hi! What is difference between those two conditions:
if not isServer() then
if is client() then
???

flat cipher
#

not isServer() will be true in solo and multiplayer (client only)
isClient() will be true only in multiplayer (client only) @small topaz

native swift
#

does anyone know how the "chance" works in distribution Lua? for example in the Authenticz mod, The Clown says "chance=0.04". how does this translate to percentage? im having trouble understanding what the numbers translate to as far as rarity goes

vague marsh
native swift
#

tht makes sense cuz the percentages are actually impossible. i saw a freddy and a jason next to eachother which would be 1 in 10 BILLION if it were direct percentages

vague marsh
#

don't take my word for it tho, im also not sure about pz

small topaz
#

I am modding some ui elements and the vanilla code contains several commands of the form
self:drawText(someText,...)
Is it possible to access the text after the text has be drawn? Maybe deleting it or changing its position? Btw, those commands are executed in the respective ui's render() function.

umbral raptor
#

Does anyone know where the vanilla .oncreate for recipes are in the LUA files?

small topaz
umbral raptor
#

need some help

#

in the wiki it says the item's ID should be
farming.Strewberrie

#

do I have to put it as so in recipes?

bronze yoke
#

the chance of other items spawning doesn't affect another item's at all, except in the very rare case where so many items have already spawned that the container is full

winter star
#

howdy, im new to modding and decided to make a texture mod that that puts soyjak faces on zombies and players, as well as changing the overall "skin" tone to be white like how soyjak drawings typically are, because it's funny. so far i've made textures for the male player body, i made the base character texture grayscale and pasted the face i wanted over the texture, made sure the names of the images and folders were all correct like three times, but the texture still wont load. it just makes the player invisible. any insights as to why it won't work?

bronze yoke
blissful meteor
#

Has anyone done any work relating to keys doors? I'm wanting to improve fort redstone next update to have some endgame content in the underground area.

I want to make keycards that will open doors in the underground area. If there is a mod that already does something similar could someone point me to it so I can look through the code

true nova
#
key:setKeyId("any int you want to be id")```
vague marsh
storm trench
#

Does the game spawn anything in (not in containers) in LUA? And if so, where??? Thanks.

true nova
eternal tiger
#

Not sure what I did but now my game won't read ANY mod files pertaining to MapSymbolDefinitions. Time to verify game files. LOL

blissful meteor
#

I'm hoping since we have the basement walls they have made it so some tiles can't be destroyed

true nova
#

and with removing sledge destroy option on things i dont see that as an option but the context option can be removed if it is opened on the doors

sturdy salmon
#

Hello, good afternoon. I was working on identifying the vehicles, since perhaps at some point, I have to track some of them. I saw that there is a database of them, and that it has an id. However, from lua, I try to access that value, and it seems to not always be the same. Am I making some mistake?

local vehicle = character:getVehicle() -- BaseVehicle
local vehicleGetID = vehicle:getSqlId()

From now on, any help is welcome. There is another method, but it didn't work for me either. I'm on build 41. Thanks.

storm trench
storm trench
true nova
#

but how ive seen others spawn what they want is using loadgridsquare event checking for a buildingid so not to repeat spawns, and getting the roomname to see if you want to spawn there and then getting objects in the room to place on

storm trench
lapis wigeon
#

I'm trying to make a simple mod for myself that is just one crafting recipe. I can get the mod loaded in but the recipe doesn't show in the crafting menu. Is the wiki still correct for B42 or do I need something more than just configure a recipe.txt file?
https://pzwiki.net/wiki/Recipe_scripts

bronze yoke
#

no, this for b41, b42 has a completely new recipe system

#

there isn't really any documentation on it, look at the vanilla ones and other mods

random finch
#

(B41) So, I am working on a mod that handles InventoryPane. I thought items double-clicked within the players inventory transferred to a loot container or floor, but they only equip those items - Is that correct vanilla behavior? Seems to be, but I swear the items transferred on double-click.

lapis wigeon
random finch
blissful meteor
storm trench
#

Hate to be a bug again, but are the building names shown upon right-click in -debug mode applicable names for me to use in a function targeting specific buildings?

#

I tried the PZ wiki for POI names but... yeah not there lolll.

brave bone
#

can someone help me understand to turn this image into that, im sooo confuse what is happening on the left image

bright fog
bright fog
storm trench
bronze yoke
#

those are the room names, yeah you can use them in mods

bright fog
#

So you can easily find how the game accesses these by checking the code which makes this context menu option

bronze yoke
#

not all ui is lua but most

bright fog
#

Yea you're right

storm trench
#

Yea, so I was hoping there was a list somewhere of these and I don't have to check each place I want physically in game.

bright fog
#

Context menu options are Lua at least

bright fog
bronze yoke
#

there will probably be an entry for every room in the distributions

#

an actual comprehensive list is kind of pointless since the mapper can put literally anything in there

storm trench
#

Only 25,000+ line to peruse hahaa.

bright fog
#

fetch.clickedSquare:getRoom():getRoomDef():getName()

#

That's how the game gets the room name

bronze yoke
#

not sure if the b42 map has it but the b41 map site had a room names overlay which may be faster than in-game

bright fog
#

Not much in the java at least

#
public boolean isShop() {
      String var1 = this.getName();
      if (var1 == null) {
         return false;
      } else {
         if (ItemPickerJava.rooms.containsKey(var1)) {
            ItemPickerJava.ItemPickerRoom var2 = ItemPickerJava.rooms.get(var1);
            if (var2 != null && var2.isShop) {
               return true;
            }
         }

         return false;
      }
   }
#

ItemPickerJava.rooms

#

Perhaps

bronze yoke
#

there isn't a fixed list of rooms

#

the mapper can put whatever string they want in there

#

ItemPickerJava.rooms is just how the game stores the distribution tables

bright fog
#

Tbf you could easily make a code which picks up every loaded room and get their name, and add them in a key table

#

And just TP around the map

#

Mapping every possible rooms

bronze yoke
#

you'd have to load every single square on the map though

bright fog
#

No

#

I mean

#

No definitely not

#

You can just go around every cities

#

I don't think there's that many room options, most are shared anyway ?

bronze yoke
#

yeah

#

seems really high effort for something you can just look on the map site for

bright fog
#

Yeah but the map you need to take note of every unique rooms ...

#

While this list, we could actually write down somewhere in the wiki

bronze yoke
#

if you want to update it every map update 🤷‍♀️

#

it sounded like they were trying to target specific rooms so just checking those out on the map would be way faster

bright fog
#

I mean that's a problem sure

#

But if the majority of the rooms are listed, and proper version is noted for the list

bright fog
#

Actually how about asking the mapping Discord

storm trench
bronze yoke
bright fog
bronze yoke
#

i said i wasn't sure, i checked now

bright fog
#

ah nvm

#

Seems to be in the B41 version tho, at least it's not in the B42 version ?

sturdy salmon
#

Hello, good afternoon. I was working on identifying the vehicles, since perhaps at some point, I have to track some of them. I saw that there is a database of them, and that it has an id. However, from lua, I try to access that value, and it seems to not always be the same. Am I making some mistake?

local vehicle = character:getVehicle() -- BaseVehicle
local vehicleGetID = vehicle:getSqlId()

From now on, any help is welcome. There is another method, but it didn't work for me either. I'm on build 41. Thanks.

storm trench
bright fog
storm trench
#

Actually nevermind, it appears correct. Thanks all!

sturdy salmon
# bright fog You need a persistent identifier ?

Yeah. I need to identify the vehicle, in case someone takes it, to have a record and be able to search for it on the map. I would need the ID to be unique, however, I get different results within the same game.

#

I'm making a log, to know, if someone takes a car, to keep a record, and to be able to know where they leave it.

bronze yoke
#

the sqlid is the one i would expected to be persistent

#

that's its id in the vehicle database so it'd be strange if it changed

#

if it really isn't for some reason you can just attach a randomly generated id to the vehicle's mod data

sturdy salmon
#

I need unique information that identifies the vehicle. I have already identified the player. Then, I would need to see where the tow cars action is called, so I can maybe add a triggerEvent or something custom.

#

Although I don't know if triggerEvent can be created or just invoked.

bronze yoke
#

you can register events with LuaEventManager.AddEvent("myEventName")

silent zealot
silent zealot
#

I wonder if SqlId is like the place I worked at where they insisted there was no need for an ID field on the excel sheet of tasks because they could just reference the row number and then got really confused when references to "item 67" stopped making sense because rows had been added/removed.

sturdy salmon
silent zealot
#

Log towing info too or people will steal cars via towing,

jaunty marten
# bronze yoke the sqlid is the one i would expected to be persistent

yea, sqlid is a perfect name btw xD

int allocateID() {
    synchronized(this.m_usedIDs) {
    for(int var2 = 1; var2 < Integer.MAX_VALUE; ++var2) {
        if (!this.m_usedIDs.contains(var2)) {
            this.m_usedIDs.add(var2);
            return var2;
        }
    }

    throw new RuntimeException("ran out of unused vehicle ids");
    }
}

void setVehicleLoaded(BaseVehicle var1) {
    if (var1.sqlID == -1) {
    var1.sqlID = this.allocateID();
    }

    assert !this.m_loadedIDs.contains(var1.sqlID);

    this.m_loadedIDs.add(var1.sqlID);
}
silent zealot
#

No wonder things broke when I spawned the 2147483648th car

storm trench
# bright fog

Holyyy crapoli, where'd you get this? This is wonderful.

bright fog
storm trench
eternal tiger
#

I have 0 clue why, but my Lua file just stopped being detected by the game. I had to delete the entire file and copy and paste the contents back into the mod files to get the mod working again. I've changed nothing LOL

#

Also does anyone know if the MapSymbolDefinitions file can actually be used apart from the standard array? I keep trying to put my own code in to condense this massive file down, but the game refuses to read it properly and I can't figure out if its because of my inexperience with Lua or if I have the files in the wrong location cause I'm new to modding Project Zomboid or if its another thing entirely.

simple helm
#

can anyone do a custom vehicle mod for me ?

drifting ore
#

Can't get my seeds icon to appear in the sow menu... not sure how exactly to reference the icon

#

farming_vegetableconf.props["Marijuana"] = { icon = "common/media/textures/Item_weedSeeds.png",

#

What I have it on right now, I've tried without common, I've tried just "weedSeeds" and "Item_weedSeeds" but can't get it

silent zealot
#

Apparently the code tracks a variable to that determines how well Zombies can keep their spending within their budget goals. 😂

#

Or maybe it's late and I just stared at that for too long because CamelCase woudl have been far more obvious.

vast pier
#

🤨

silent zealot
#

No, It's ZombiesCanBudget.

vast pier
#

why tho 😭

silent zealot
#

Because I'm in a stupid mood after fiighting with $@#^@#^ ossec all day trying to write on tiny little simple #$%!@%rule

vast pier
#

In other news, I think my munitions mod is just about ready to release

#

Fun fact, molotovs, and fire crackers are the only bombs that need a lighter in your off hand. Not just any sort of firestarter, only items with the "Lighter" tag

#

One of the things I'm changing ofc. Cuz why couldn't you use a match in this situation?

#

or a lit candle?

#

I'm also making it so the normal pipe bomb requires something to light it, and adding in a separate version that has an electric igniter.
The electric version is required for crafting the timer/remote versions.
There's a recipe to craft the electric version directly, and one to just add an electric igniter onto an existing pipe bomb

#

Aerosol bomb is gonna basically be a weaker pipe bomb that causes small fires.
Not really sure what if anything should be changed about the firebomb/molotov/smokebomb so they're relatively unchanged

#

Main difference is they are actually in loot tables now

silent zealot
#

Are the recipes to make them more available? I think right now one of those is strictly behind a profession choice

vast pier
silent zealot
#

Add The Anarchists Cookbook to loot tables with all the explosive recipes

vast pier
#

There's also a military improvised munitions handbook which includes recipes for all of them 👍

vast pier
#

It's more of an edgy book than anything

#

the handbook I've been researching has proper recipes, measurements, and procedures for making propellents and primers

vast pier
# vast pier

Also adding in a can bomb, which you can craft from tin cans/water ration cans, propellent, and scrap/nails

#
    craftRecipe MakeCanBombNails
    {
        timedAction = MakingElectrical,
        Time = 100,
        NeedToBeLearn = True,
        Tags = AnySurfaceCraft,
        category = Electrical,
        inputs
        {
            item 1 tags[Primer],
            item 1 [Base.TinCanEmpty;Base.WaterRationCanEmpty],
            item 3 [Base.Nails],
            item 10 tags[Propellent],
            item 1 tags[Binding],
        }
        outputs
        {
            item 1 MunitionMag.Canade,
        }
    }

    craftRecipe MakeCanBombScrap
    {
        timedAction = MakingElectrical,
        Time = 100,
        NeedToBeLearn = True,
        Tags = AnySurfaceCraft,
        category = Electrical,
        inputs
        {
            item 1 tags[Primer],
            item 1 [Base.TinCanEmpty;Base.WaterRationCanEmpty],
            item 1 [Base.IronScrap;Base.BrassScrap;Base.AluminumFragments;Base.GoldScrap;Base.SilverScrap;Base.SteelFragments;Base.Aluminum],
            item 10 tags[Propellent],
            item 1 tags[Binding],
        }
        outputs
        {
            item 1 MunitionMag.Canade,
        }
    }```
#

It's basically the same as an aerosol bomb, but requires something to ignite it and has a smaller explosion radius

#

recipe will probably change a little bit before I release it

vast pier
vast pier
#

Electrician will inherently know how to add an electric igniter to a pipe bomb, and will also be unlocked automatically by electric level.
Engineer will know all of them inherently

#

All of this together means you could start as any profession, find a pipe bomb in the world, reverse engineer it, hit level 4 electric, turn a pipe bomb into an electrically ignited one, and then reverse engineer that to unlock the recipe to directly craft them instead of just adding it on afterward

#

Or start as a veteran and get level 4 electric, craft a pipe bomb, add an electric igniter, and then reverse engineer it

#

Oh yeah I also made it so bombs can be put on your belt, and added in "triggerExplosionTimer" to pipe bombs to make them explode faster.
I found it very awkward to throw a pipe bomb and have it sit in the air for a long period of time, so I took "triggerExplosionTimer" from the aerosol bomb and added it to the pipe bomb and can bomb

#

Oh and uh, noise makers are buffed too. forgot to mention those

silent zealot
vast pier
#

default duration is half an hour in game, increased to an hour and a half
default range is 17 tiles (an alarm clock is 15), increased to 120 tiles

vast pier
silent zealot
#

Noisemakers defiitely needed a buff, in vanilla thy were terrible.

vast pier
#

Yeah 120 tiles seems dramatic, but why would you use the resources to make a noise generator when you could fire a single pistol bullet and have a much further draw radius

silent zealot
vast pier
#

I don't think you can activate the bombs without placing down or throwing them

silent zealot
#

And rewards people for preparing & using tactics.

vast pier
#

draws attention for an hour and a half before needing to be picked up and reset

#

I think they're infinitely reusable, don't know if I can change that in some way

#

I think it's fine given the commitment required to get to that point in the first place

#

Hey now that I'm thinking about it

silent zealot
#

CanBeReused = TRUE,

#

change that to FALSE and it should be single use.

vast pier
#

isn't it just alcohol vs gasoline? I don't think gas explodes on impact in a plastic bottle?

#

also I hate that the flame bomb is in a plastic bottle... gasoline melts most plastics

#

It's not safe to put gasoline in a water bottle

silent zealot
#

If you're really keen you can make a device you throw, and on impact a glass bit breaks a and a chemical reaction ignites it.

vast pier
silent zealot
#

This woudl be suicidal the way we run/climb/fall/bet in melee in zomboid.

#

But you coudl do it.

vast pier
#

I mean the aerosol bomb recipe kinda implies we already do that

silent zealot
vast pier
#

I think it would still work, cuz the smoke bomb makes 10 in game minutes of noise while not being reusable

silent zealot
#

Maybe firebomb is meant to be a fuel-air explosive?

vast pier
#

the recipe is a bottle, a rag, and gasoline

#

It just magically ignites itself

bronze yoke
#

i wouldn't take the recipe too literally, that recipe hasn't been changed since the game had about 5 items in it

silent zealot
#

so it has a small amount of explosives and an electical trigger to spread the fuel and then create a big airburst with resulting pressure-wave

silent zealot
#

hahah

vast pier
#

I will take every recipe literally and you can't stop me

silent zealot
#

So they wrote the recipe 20 years ago and never looked at it agian because explosives are horrible and no-one uses them. That seems likely.

vast pier
#

I'll just do what I did to the pipe bomb, vanilla version needs igniter, and then a new version that doesn't need one cuz electric ignition

#

Also how does the smoke bomb work? does it burn the rag, and react to the cold pack to create smoke?

#

is it technically steam?

bronze yoke
#

steam from the steamed clams we're having

vast pier
#

Ah no I think it actually reacts to the paper burning?

silent zealot
vast pier
#

idk either way, needs an igniter, vanilla doesn't have one

tacit pebble
#

I'm also curious so I asked to GPT and

If the game assumes that the cold pack contains ammonium nitrate, and you combine it with rags/newspapers, the idea might be that the pack is broken open and the reaction starts to heat up the rags, causing them to smolder and produce smoke.

idk anything about chemistry so idk

vast pier
#

As the smoke bomb has an explosion duration of 10, which is how long the sound lasts

vast pier
# tacit pebble I'm also curious so I asked to GPT and ``` If the game assumes that the cold pac...

in this video we make pull pin smoke grenades without using potassium nitrate their is no cooking involved they work very well and are easy to make. This smoke grenade does not include KNO3+Sugar
Instead of the KNO3+Sugar this smoke grenade use an instant cold pack that and paper.

WARNING: DO NOT ATTEMPT WITHOUT WEARING GLOVES - AMMONIUM NIT...

▶ Play video
#

It's not as strong as what we see in game obviously, but it's functional in the same way

tacit pebble
#

oh interesting vid

vast pier
#

Still, would need an igniter, which in vanilla it does not use one

#

It's weird how molotovs are the only bombs that seem to have gotten any attention, probably since they aren't profession locked

#

"oh nobody uses the other ones, let's just work on the one people use"
Nobody uses them because they don't get worked on

tacit pebble
#

it's funny that we need at least 5 pipe bombs to kill a single zombie

bronze yoke
#

i think they know there's nothing short of a complete overhaul that would get people to use them

tacit pebble
vast pier
#

I feel that's not entirely true, they could easily increase the damage of the aerosol/pipe bombs and they would immediately become more viable

#

Would give an alternative to horde clearing that doesn't involve a campfire

#

It is nice though that they are no longer profession locked in B42

#

but relying solely on some random schematic RNG doesn't sound great

bronze yoke
#

did they change the skill requirements at all

#

it's one hell of a combo of profession lock + needing high levels in a useless skill + they feel terrible to use + they're shit

vast pier
bronze yoke
#

any of the engineer bombs

vast pier
#

The recipes don't have level requirements, at least not the basic ones

#

noise maker requires level 3 electrician, and auto learns at level 7

bronze yoke
#

did they have skill requirements in b41 or did i misremember that?

vast pier
#

If you mean the ability to add the triggers n' stuff, yeah those are still pretty high

#

Adding a tier 3 sensor to a bomb requires....

#

electrical 6

#

same with a tier 3 remote controller

#

The bombs themselves just need the recipe tho

#

Not really sure why putting the sensor/remote trigger on the bombs requires the same electrical knowledge needed to actually craft them though

#

you'd think it would be a lot easier to know how to attach it rather than how to create it

thin walrus
#

Hello everyone! I have a question: I know how to translate one mod, but how do I create a collection of translations in one of my mods for several different other people's mods?

silent zealot
#

You should be able to combine multiple translations files together.

#

For example if mod1 has ItemName_XX

    ItemName_Base.Foo = "Fooin",
    ItemName_Base.Bar = "Barin",
}```

and mod 2 has ItemName_XX
```ItemName_XX = {
    ItemName_Base.Wiz = "Wizin",
    ItemName_Base.Zoom = "Zoomin",
}```

you can combine those to one file, 

```ItemName_XX = {
    ItemName_Base.Foo = "Fooin",
    ItemName_Base.Bar = "Barin",
    ItemName_Base.Wiz = "Wizin",
    ItemName_Base.Zoom = "Zoomin",
}```
slim swan
#

Is there an event that can be triggered before the game saves or closes?

fallen merlin
#

Helloo, I am new to modding the game and need some help with it. I have created a mod with the right structure, as following:

MyMod/
│── media/
│   ├── lua/
│   │   ├── client/
│   │   │   ├── MyModFile.lua   
│── mod.info
│── poster.png```

My mod info File looks like this:

name=My Mod
id=MyMod
poster=poster.png
description=XXX
version=1.0```

And the folder for the mod is located under users/myUser/Zomboid/mods/

Unfortunately the mod doesnt show up in the game. I am using the latest unstable build. Does anyone know what exactly I am missing out? Thank you for your help in advance

fallen merlin
bright fog
fallen merlin
fallen merlin
thin walrus
silent zealot
#

😊

fallen merlin
#

I have another question. So my mod is almost done, it's about healing zombification and wounds. It seems to work almost completly, it just can't heal lacerations and I don't know exactly where to find the method to remove it. This is what I have:

        -- Heals all wounds
        for i=0, BodyPartType.ToIndex(BodyPartType.MAX) - 1 do
            local bodyPart = bodyDamage:getBodyPart(BodyPartType.FromIndex(i))
            bodyPart:SetBleeding(false)
            bodyPart:SetDeepWounded(false)
            bodyPart:SetBurnTime(0)
            bodyPart:SetScratched(false, false)
            bodyPart:SetBitten(false)
            bodyPart:SetFractureTime(0)
            bodyPart:SetCut(false, false)
        end```
I thought "deep wounds" would be lacerations, but unfortunately it's not. Does anyone know how to set lacerations to false?
fleet bridge
fallen merlin
#

The last issue seems to be this:

#
        local bodyDamage = player:getBodyDamage()
        bodyDamage:setMoodleLevel(MoodleType.Queasy, 0)
#

I am confused with that tbh. The method setMoodleLevel doesnt exist in BodyDamage according to the docs. But somehow, it works and throws an error that tells me following:

function: CurePlayer -- file: CureZombification.lua line # 12 | MOD: Cure Zombification
function: onMouseUp -- file: ISButton.lua line # 56 | Vanilla

ERROR: General      f:116, t:1740490781807> ExceptionLogger.logException> Exception thrown
    java.lang.RuntimeException: Object tried to call nil in CurePlayer at KahluaUtil.fail(KahluaUtil.java:82).
    Stack trace:
#

Sorry for all the questions, it's my first time modding a game

vast pier
fleet bridge
#

i've never seen MoodleType being used before. are you sure that's a thing and not something that was imagined by Copilot or something?

vast pier
#

Porting a mod from B41 to B42 and it seems the guns are flipped? Any idea why?

fallen merlin
#

How would you remove a Moodle from a player object then?

frank tide
#

Somebody please make a tile pack /mod to add more garage items to the game for b42 engine stands/displays,tire balancers ect.

small topaz
#

Hello everyone! Is it possible to change a specific parameter of a specific clothing item's xml file while the game is running via lua coding? Specifically, I want to temporarily delete the xml paramter
<m_UnderlayMasksFolder>media/textures/Clothes/BulletVest/Masks_BulletVest</m_UnderlayMasksFolder>
which can be found for several vanilla clothing items (in my case, it is mainly relevant for bullet proof vests). Thanks for any ideas!

knotty stone
#

I will leave this here if anyone wants to finish this, i give up with my limited lua and api knowledge at this point. I disabled that crops are killed when you drive over them. The last thing to finish this is in AgroMain.lua line 176 filling the "seeItems" variable, there is something wrong there and AgroUtils.removeContainerItems(seedItems) fails to read it. Good luck spiffo

fleet bridge
ember leaf
#

Hey folks is it possible to add a sickness modifier to a tablet/pill? I.E you take Painkillers but overuse causes sickness?

ember leaf
#

Think I have a hang of the creation of new items using text, it's just causing increases in sickness/fatigue while still keeping it as a drainable item, just I notice when I fatigue is added to painkillers for example and it's drainable it doesn't apply, but if I apply it to antibiotics which has the food class it works

#

Don't know if its dependent on that?

vast pier
#

Don't know what bip is used for attachments tho, I already tried seeing if it was effected by bip01_prop1

vague marsh
ember leaf
#

Thanks 🙂

vast pier
#

?

vague marsh
#

bruh its gone

vague marsh
vague marsh
vague marsh
ember leaf
vast pier
vague marsh
lapis wigeon
#

What the fastest way to load your mod changes in debug mode?

storm trench
#

Is there something different with the way semicolons work in B42 lua's?

bronze yoke
#

probably not

bright fog
#

Remove them

grand cloak
#

do you guys know what this means

bright fog
#

uh

storm trench
bronze yoke
#

it shouldn't be

#

in lua semicolons are just treated as whitespace

#

the only exception is they can take the place of commas in table initialisers

#

neither of these uses are common or recommended though

storm trench
#

Yeah, it's really weird. Errors galore without, none with. I am half tempted to go back to Build 41 and see if the code works fine in 41.

trim quartz
#

Hey all, how do I find the correct X and Y to open a window center screen please?

queen oasis
trim quartz
#

fantastic, appreciate it

silent zealot
#

I'm guessing something in mod.info is specifying what version of the game the mod is for.

silent zealot
storm trench
silent zealot
#

Different process, but Excalibar adds a number of fixed spawn via lua.

It does some stuff to build a table of things to add, then calls this via EventsEveryTenMinutes:

P4Excalibar.CheckSpawn = function()
    local spawnReserves = P4Excalibar.getSpawnReserves()
    for k,v in pairs(spawnReserves) do
        local square = getSquare(v.locx, v.locy, v.locz)
        if square then
            if v.item == "Zombie" then
                local crawler = true
                local isFallOnFront = (ZombRand(2) == 0)
                local isFakeDead = (ZombRand(2) == 0)
                local knockedDown = true
                spawnZombie = addZombiesInOutfit(v.locx, v.locy, v.locz, 1, v.outfit, v.femaleChance, crawler, isFallOnFront, isFakeDead, knockedDown, false, false, 2):get(0)
                if not isFakeDead then
                    spawnZombie:setHealth(0)
                    spawnZombie:DoZombieStats()
                end
            else
                local spawnItem = square:AddWorldInventoryItem(v.item, v.x, v.y, v.z)
                spawnItem:setWorldZRotation(v.r)
                spawnItem:getWorldItem():setIgnoreRemoveSandbox(true)
                spawnItem:getWorldItem():transmitCompleteItemToServer()
            end
            spawnReserves[k] = nil
        end
    end
end
#

So it's just checking if each square is valid (presumably they will only be valid if close enough to be loaded) and if so, spawn something (item or zombie) and remove the entry from the list of things to spawn.

storm trench
silent zealot
#

It's a great mod too, if you want a bit of fantasy "assemble the artifact from multiple pieces" questing.

#

If a vanilla file declares a local variable like this, is there any elegant way to change it? Or do I have to patch every function that uses it?

bronze yoke
#

there is no way to change it

silent zealot
#

Oh well. Patching functions it is.

#

...or I just edit my local copy of the file and don't make it a proper mod.

bright fog
#

This should help people who requested a proper guide on craft recipes

#

I'll try to finish it tomorrow :)

faint ingot
#

We (I) need a tiny mod that locks the inventory windows in place. But I lack the skills required to make it.

faint ingot
#

The inventory windows. I keep dragging them by accident while dragging items around quickly.

bright fog
#

I'm gonna be honest, no one will make your idea unless you do it yourself

#

Most mod ideas get lost

faint ingot
#

The miniature health bars mod has a locking button so you can't do that. It would be super nice if it was there for inventory windows

bright fog
#

That are thrown here at least

faint ingot
#

I'm just throwing it out there.
I lack time to learn. Hopefully someone sees it and agrees.

silent zealot
#

Every modder has a huge pile of high-level ideas, then gets distracted and does something else instead.

storm trench
silent zealot
#

I guess there might be an issue if EveryTenMinutes isn't often enough and the player can load the area and reach it before items spawn, but for Excalibar that's plenty of time... the spawn locations are things like "inside Rosewood prison" or "lowest level of the secret military base" and you're not getting to those places quickly.

bronze yoke
#

in build 42 you can check to spawn things during loadchunk

#

if done properly it's exactly as effective as loadgridsquare but literally hundreds of times more efficient

simple helm
#

anyone kknow where I can learn how to add new base models from CGtrader

silent zealot
#

Do you mean spawn a vehicle, or add a new type of vehicle to the game?

simple helm
silent zealot
#

no probs, I do that constantly.

simple helm
#

is it hard to do ? can i just get a model from cgtrader and script it in game or do i need to poly crunch

silent zealot
#

What is the model for? item, clothing, vehicle, other?

storm trench
silent zealot
#

You'll need to make a new vehicle, not just load in the model

#

and if you want to actually put cars on it... good luck.

simple helm
#

i mean there already a mod to put a car on a trailer, cant you piggy back off of that mod.

also why make a new vehicle from scratch if you can buy the base model work off of that

silent zealot
#

A vehicle is more than a model

#

it's a bunch of data on parts, mechanics interface, stats etc.

#

Not hard to do, at least if you can use an existing mechanic template instead of building a custom one because that looks super fiddly.

simple helm
#

yea similar to gtav adding modded vehicles

silent zealot
#

I suggest getting the model (or a free placeholder) and giving it a go.

simple helm
#

ik this dev he a really good dev everything is broken down etc

tacit pebble
silent zealot
#

I wonder if they just put the car on top of the trailer and hope it stays there 🤔

simple helm
#

yea

#

it goes on the trailer and gets covered

#

wait wrong one sorry

silent zealot
simple helm
#

there a vid of him doing it also

tacit pebble
#

yeah

simple helm
#

everything doesnt have to be like u lower the rams and drive it on just a hauler to haul more cars

silent zealot
#

then change the trailer model to add the cover, add weight, done.

#

You could almost certainly scale that up to a bigger trailer with multiple vehicles.

simple helm
#

i dont care about adding the cover just want someone to mod the car carrier in game

simple helm
#

i thought it not hard to add ?

storm trench
silent zealot
storm trench
# simple helm end of the day its worth

I've been forking a B41 mod for the last 2 days and it's been hell. All I'm doing is expanding upon existing framework, too. So it's gonna be a lot of days to end before it's worth it lolll.

silent zealot
#

Honestly, it's a good idea but don't start with a focus on the model - just use a minimal model and build a proof-of-concept mod

simple helm
#

okay but forget about adding a new script rn just want to get the trailer in game first, if there are 18 wheelers with living quarters i think this is not far off

silent zealot
#

Even if that means a big flat rectangle that gets other rentangles added on top as cars are added.

#

That much will work easily - you can look at the existing big trailers.

#

AFAIK any living quarters type stuff is from RV Interiors, which is B41 only... I don't think anyone has been crazy enough to reproduce that when they could just make use of RV Interiors for more vehicles.

whole parcel
#

Hi all! How's going on?
I've a question regarding pz modding. I'm trying to achieve server-side mods. Is is currently possible in the dedicated server to specify server-only mods in any way? I didn't find anything tbh.
I was thinking in patching the NetChecksum class to skip files in media/lua/server, so I can ship the mod without the server files, but dunno if the game needs the server files for anything at all.

Thanks!

silent zealot
#

What do you mean by "server side mods"?

#

Mods that are on the server but NOT installed by the client?

whole parcel
#

Yeah

simple helm
simple helm
#

i dont know how to mod pz

#

let alone add modded vehicles dont i need to poly crunch it and add the paint etc

silent zealot
#

You don't know how to mod pz yet

#

the modelling/texture side I can't help with, but if you look at existing vehicle mods you'll see it's justa bunch of text files to define things.

simple helm
silent zealot
simple helm
#

it not getting stuck i just need the PZ basics for adding NEW modded vehicles, do they have to be broken down in categories. what the poly count they need to be etc that i have not done in a minute bc pz is a bit different then gtav

small topaz
silent zealot
whole parcel
simple helm
#

i can use cgtraders tho correct ?

bronze yoke
#

you can just have a lua mod that pulls and loads lua files from the sandbox folder

silent zealot
# simple helm i can use cgtraders tho correct ?

If you can load it into blender and export as a .fbx you can use it, but that doesn't means it's a good starting point - if that image you posted is of the model it's massively more detailed than what you want for zomboid.

bronze yoke
#

there's already a couple executions of this concept floating around

whole parcel
#

Oh, so is it possible to require() outside the mod folder? Interesting

bronze yoke
#

i'm not really sure what they're called though

bronze yoke
whole parcel
#

That's a great hacky workaround

simple helm
small topaz
silent zealot
#

Through java modding anything is possible... at least in theory. A lot of stuff is impractical.

whole parcel
#

Yeah, I was thinking on patch the NetChecksum class to skip server files tho

silent zealot
simple helm
#

okay can i message you on the side or someone else that knows about importing a new vehicle like this ? trust i want to learn but i rather not asking alot if im not talking to the right person ?

silent zealot
#

Check the #modeling channel, or ask again here in a while and see if other people are around who do vehicle modding.

bronze yoke
#

otherwise, java mods can run serverside regardless because there is no java checksum, and pretty much anything else wouldn't work without a client mod anyway

simple helm
#

alright btw i did manage to find a download for a vehicle looking at the script now doesnt look like alot of lines just want to do it right. thank you tho

#

also asked in tsar discord and k15 hopefully i can get one of them

silent zealot
#

FYI: you can see the code for any mod, get the mod id from steam workshop:

#

downloaded content is under your steam installation, game id 108600

small topaz
silent zealot
#

Sorry, my fault - I got the conversations crossed

sinful ether
#

Hey people, i just made a Lifestyle addon of 20 tracks for the Keytar. Anyone interested, i can stream some of the tracks before you try too.

lucid oyster
#

i asking a little technical question for anyone out there, is actually any way to give the player more hp? (not imortality just more health, so can bleed or get hurt more before death) i was triying to make gunfights a common thing but its hard to enjoy them cus how easily it is to die of a shot (i know its unrealistic) im just asking if is there a way trough lua scripts to do such a thing, so that players may survive and heal back up after a fight

#

i looked up mods and conversations on this chanel and i didt find anything

umbral raptor
#

the best feeling in existence when you are modding recipes

copper abyss
formal sky
#

Hello, I've been looking to commission a mod on reddit. I've been contacted by a guy that was very enthusiastic, but the more we talk themore he sounds like a LLM, so before the discussion blows and they start harassing me for money, I thought I'd ask here:

#

I want a mod that records the amount of zombies in a chunk when the player enters it (or spawns when the game starts), and when he leaves that chunk, the mod compares the stored amount to the current count to see how many the player has killed, and deduces a small (custom) proportion of the killed amount from the chunk's maximum population (and records the amount of the newly entered chunk to do the same there). Is that possible at all?

#

Alternatively, when the player kills a zombie, that zombie's starting chunk has a small chance to get its max population lowered by 1. Same result, different way to do it. No clue of the inner workings of the game so I can't judge on the relative difficulty of either implementations.

#

before the discussion blows and they start harassing me for money
boy that didn't take long

bronze yoke
#

that's an absurd amount of money 😭

tacit pebble
formal sky
formal sky
formal sky
tacit pebble
formal sky
tacit pebble
#

sry i mean, Albion's

formal sky
#

I can click it, it says I don't have access.

#

What's the channel name, not as a link ?

bronze yoke
tacit pebble
#

there's community_recruitment ( #1019743790178762812 ) channel and you can search for "modding community" then you will be able to find this post.

In the modding community discord, there is a request channel so you can ask for a paid commision.

umbral raptor
#

i wish the console would tell u everything wrong with the code at once instead of giving it to u piece by piece as u crack down errors

drifting ore
#

Wtf is that

#

Is someone holding you at gunpoint

tacit pebble
silent zealot
#

Probably works a job where they still have apps that only work with IE6.

bronze yoke
#

it's not really possible for it to give accurate errors for future code, since everything's already messed up from the first error

silent zealot
#

can lua do try/catch blocks?

bronze yoke
#

they have pcall to call functions in protected mode but it doesn't really work

#

in zomboid anyway

silent zealot
#

googles "For many applications, you do not need to do any error handling in Lua." HAHAHHAHAAHAHA

#

They wrote that before seeing my code.

bronze yoke
#

the error handler literally doesn't care if you pcall and shows a red error to the user anyway, and for some reason they made all function calls protected so all pcall does is double the overhead

#

you'll notice errors don't propagate upwards in pz

silent zealot
#

I guess that means the lua calls made from java are already pcalls (or equivalent)

bronze yoke
#

pcall is useful in the very niche case where you specifically want to get the error since that part still works

#

i hate exceptions anyway so it's not a big deal to me

silent zealot
#

Just have to add "if foo~= nil" checks everywhere.

bronze yoke
#

and errors not propagating upwards by default is pretty merciful since otherwise mod errors would be way more brutal

silent zealot
#

since something being nil instead of what I want it to be is probably 98% of the lua errors I generate at runtime.

bronze yoke
#

i'd say nil checking is a better solution than try/catch blocks

#

but you can technically do this with pcall if you're crazy

drifting ore
#

does zomboid make other player data inaccessible beyond a certain distance (or does the client unload the player)? I'm trying to make a player compass mod for something like manhunts, but beyond 100 tiles from another player, their position stops updating and stays fixed at their last "close enough" position.

silent zealot
#

Good question - how is your code getting triggered, and how are you checking the player location?

#

Since the server has to know all the players I'd expect attaching to an event like EveryTenMinutes and recording player location should work, though I'm not sure how to share that with clients.

drifting ore
# silent zealot Good question - how is your code getting triggered, and how are you checking the...

It's through the context menu on a specific item, which then populates with submenus for each player:

-- all hooked to OnPreFillInventoryObjectContextMenu
local onlinePlayers = getOnlinePlayers()

for j = 0, onlinePlayers:size() - 1 do
    local p = onlinePlayers:get(j)
    subMenu:addOption(p:getForname(), p, findPlayer, p)
end

findPlayer then gets their position like so:

target = player:getForname()
targetPosX = player:getX()
targetPosY = player:getY()
ourPosX = getPlayer():getX()
ourPosY = getPlayer():getY()

distance = math.abs(math.sqrt(math.pow(ourPosX - targetPosX,2) + math.pow(ourPosY - targetPosY,2)))
angle = math.atan2(ourPosY - targetPosY, ourPosX - targetPosX)
silent zealot
#

I'll defer to anyone with more mulitplayer modding experience.

copper abyss
#

can anybody help me out real quick?

#

I added a ammo type to my game, but I want two bullets to give my modded gun 20 shots, anybody know how this can be done simply?

silent zealot
#

You will need to do some lua scripting

#

The default is every bullet item becomes one bullet in the gun

hexed timber
#

Hey guys, im having issues with lua, specifically with the context:addOption

this is my code

context:addOption("Spawn a BoZo", nil, spawnBossZombie)

but i get the error on the screenshot, ive been going thru this for hours and cant seem to find the solution

silent zealot
blissful meteor
#

Would it be possible to remove a context option when in an area? I want to remove the sledgehammer destroy option while in the redstone bunker

silent zealot
#

@Kraz yes. Add your own function to the populatecontext menu, check if "Destroy" is a existing context menu entry, do you check and choose to remove Destroy if appropriate.

hexed timber
silent zealot
hexed timber
#

Ok ill be going through it, thanks

silent zealot
#

@Kraz see Removing options on the same wiki page

random finch
#

Given an ItemContainer as parameter, I want to find the outer most container it is contained within so I can get its location aka square.

ItemContainer:getParent() always return nil with backpacks. This works with moveable and player inventories, but not for item inventories such as backpacks.

Any ideas on how to get the location of a backpack?

silent zealot
#

Add a prefix patch to the function that adds an extra 9 bullets if the weapon type is your gun.

#

(with safety checks to not overfill)

blissful meteor
#

Thanks I had a look, is there a similar page that details how to get the players location

copper abyss
#

ty so much

#

I know its a strange request

blissful meteor
#

Sorry I'm barebones in lua

copper abyss
#

but my modded gun is also- very strange

silent zealot
#

What sort of gun is it? We've had discussions of very weird gun ideas here before.

silent zealot
#

Nice.

copper abyss
#

welll its a fictional firearm that I'm suprised hasn't been made yet for this zombie game lol

vague marsh
# copper abyss

theres a gun like that on a b41 map mod, i forgot what it is

silent zealot
#

back/fannypackfront/primaryhand/etc?

vague marsh
random finch
silent zealot
#

Only thing I'm sure of is you first check if it is equipped and if so use player location, if not equipped... not sure. Likely something to do with the square it is on.

#

what does getSquare() give you?

random finch
#

Backpack within another backpack or within a moveable container. Backpack on a floor is still within a container.

I thought Id be able to get its square location by using ItemContainer:getParent():getSquare() like you can everything else.

silent zealot
#

That would be too easy.

random finch
#

it doesnt inherit that method

silent zealot
tacit pebble
silent zealot
#

But that's B42, because I forget there is still B41

random finch
#

Damn, you get access to that in B42 at least.

tacit pebble
#

yeah then there's no getSquare I believe

   public IsoGridSquare getSquare() {
      IsoGridSquare var1 = null;
      ItemContainer var2 = this.getOutermostContainer();
      if (var2.getVehiclePart() != null && var2.getVehiclePart().getVehicle() != null) {
         var1 = var2.getVehiclePart().getVehicle().getSquare();
      }

      if (var1 == null && var2.getSourceGrid() != null) {
         var1 = var2.getSourceGrid();
      } else if (var1 == null && var2.getParent() != null && var2.getParent().getSquare() != null) {
         var1 = var2.getParent().getSquare();
      } else if (var1 == null
         && var2.getContainingItem() != null
         && var2.getContainingItem().getWorldItem() != null
         && var2.getContainingItem().getWorldItem().getSquare() != null) {
         var1 = var2.getContainingItem().getWorldItem().getSquare();
      }

      return var1;
   }

this is getSquare() for inventoryContainer since B42

silent zealot
#

A horribel idea: what if in B41 the square stores containers, but those containers have no link to the square?

tacit pebble
#

maybe you can tweak that for B41?

random finch
#

Ill have to itterate through each square to find the container lol

silent zealot
#

So all you can do is test every square in existence?

#

which is... not a good idea.

random finch
#

hrmmm

hexed timber
#

ok made it work, now im having issues with local zombies = getWorld():addZombiesInOutfit(1, x, y, z, nil, false, nil)

#

I basically need to spawn a zombie, to later alter its attributes, thats the spawn line, it just jumps an error with no stacktrace

tacit pebble
#

I don't think you need getWorld() for addZombiesInOutfit

hexed timber
#

Ok it does spawn it, but how do i access it after it?

tacit pebble
hexed timber
#

yes, im trying to alter its HP and other values

random finch
tacit pebble
#

addZombiesInOutfit will spawn zombies but also return zombie list which you spawned.

tacit pebble
hexed timber
#

let me get the exact error

tacit pebble
hexed timber
#

oh wait the error is in the if

ancient grail
sturdy salmon
#

Hello, good evening, I was trying to keep a record of the vehicles, but I noticed that the methods I am using, in both cases, change the value when the chunk is reloaded. The getID is supposed to change, but the strange thing is that the getSqlID also changes (when it is supposed to refer to the database ID). I don't know how to identify them, in case I lose any. Any suggestions? Thanks in advance for reading.

#

The strange thing is that it seems to add 10. Because it is clear how it says 11, and then 21. How it says 13 and then 23. I had not noticed that. But well, maybe those are not the methods I have to use, and on the contrary, there is another way to identify them.

elfin cobalt
#

Dude imagine if there was a mod where you couldn't see the percentage of batteries and you need a battery checker to check the percent 🤔 (this is a mod suggestion :3)

#

And make batteries spawn in with random charge levels

sturdy salmon
#

There is a sqlite3 database for vehicles. Finally, vehicles, in that DB at least, have an ID.
The strange thing is that the method called getSqlId() returns different results.

sturdy salmon
#

If I remember correctly, the VehiclePart can be accessed by index, but I don't know exactly which battery it is.

elfin cobalt
#

Not the vehicle batteries, the small ones.

#

Double A

sturdy salmon
#

We differentiate them, but I see that they have the same name.

sturdy salmon
#

The getKeyId() method seems to always return a unique value.

#

I will have to use the method to identify the vehicles for now.

bright fog
copper abyss
#

alittle confused here

#

I cant get it to work

bright fog
#

Also

#

Are vehicles object pooled ? If not then the vehicle keeps the same class on reload

#

If so you can just do tostring(vehicle) and you will have an ID

#

Tho I doubt it tbf but who knows

sturdy salmon
#

I'll try it. But at the moment, the only value that seems to persist is the key value. But I'll see what you tell me. Thanks.

bright fog
sturdy salmon
#
[2025-02-26 08:12:55] player: Pango. TP: /teleportto 12063,6874,0. vehicleGetFullName: Base.SmallCar. getKeyId: 97884626. vehicleGetEngineQuality: 34.
silent zealot
#

Using modData to make your own unique identifier should also work.

sturdy salmon
#

Apparently. At least it is more accurate than the other 2 methods so far. I will have to test it.

sturdy salmon
silent zealot
# copper abyss heyyy.

Have yo done lua scripting before? What you want will need some lua code, since it's not possibel through just item configuration.

copper abyss
#

it focuses LESS on the TYPE of ammo, and more on the actual gun

#

problem is, if I do it this way- it will only add +18 once the MaxAmmo is reached

silent zealot
#

Also, you're replacing vanilla functions so you're going to break other guns.

random finch
silent zealot
# copper abyss 😭

It's OK, writing code that doesn't work is how you start writing code that mostly works.

sturdy salmon
#

Would it be possible to turn this channel into a forum? So that each topic is a thread. That way the conversations are kept separate. I think that would be a good idea, so that we can collaborate better.

tacit pebble
#

idk how can i say this in english :/

silent zealot
#

First of all - does your gun have an item defined as bullet, and without any extra lua code does that thing get loaded in one-by-one when you press reload?

copper abyss
tacit pebble
#

The gun says it has 2 bullets, but

Does this mean you can actually shoot 20 times?

copper abyss
silent zealot
#

no, we're not there yet - rember in vanilla one bullet = one shot

#

I thought you wanted one bullet to restore 10 shots when loaded in?

copper abyss
#

2 x 10

#

2 cells consumed

#

problem is, whenever I try to code it so that it focuses on the ammotype, instead of the max capacity, the gun doesn't consume 2 cells, and instead just adds the amount of ammo I want if I have atleast 1 cell in my inventory

#

and irregardless of the way I go about it, whenever the gun is unloaded you end up extracting the current ammo amount that is in the gun..

#

so if you insert 2, you get 20 in the gun, unload the gun, and now you have 20 in your inventory lol