#mod_development
1 messages ยท Page 310 of 1
that's weird then, this is correct
body locations are equipment slots so the only thing i could blame here is either wrong body location (it isn't) or you somehow accidentally made them exclusive (you didn't)
I have a question for anyone who wishes to give input.
For the ZuperCarts - Carts & Trolleys B42 port, when I fix the container issue where it's stuck at 37 capacity, should I start working on a reason to use one over the other and vice versa?
What I am thinking is a trolley will hold less capacity (example: 35) but have 100% encumbrance reduction.
While a Shopping Cart will have the full "50" capacity but only an 85% encumbrance reduction?
Plus maybe more functionality later, like maybe the trolley allows you to move at full speed with a full container, while the Shopping Cart makes you slightly slower as the encumbrance approaches max capacity?
I mean maybe I can try changing the CanBeEquipped part to be QuiverLK instead?
oh, yes, do that!!
i forgot
container clothing work slightly differently from normal clothing
i'm not sure if the bodylocation field even gets read, they use canbeequipped
vanilla examples have both and they always match
i tried it, and i can no longer equip it anymore. It just appears with equipping in primary or secondary.. nothing of equipping it however
Im gonna research into it
Maybe take a look into the fanny pack script
absolutely do that
Also, this "weight" function... is that the correct function to use here?
Because when the capacity is at or above max value (50), then the container capacity is 37 (50-13=37).
Is this adding light & heat when a "radio" is turned on?
56 total now.
2x2x2x7
yep
exactly what its meant to do
I thought I took those out. I was trying to avoid the nil issue and obviously that doesn't do it
Add a print statement to AddHeatSource to confirm 1) it's being called and 2) the parameters being passed are correct
Also, confirm you're adding the heat source correctly my manually making a heat source using the lua console... they might behave the same way as light sources.
Not helped by none of the vanilla lua using IsoHeatSource, because vanilla objects that generate heat do that in the java code.
So I found code in another mod for an item like a trolley/cart, and it's in B42. Why does this work and mine doesn't?
{
WeightReduction = 100,
Weight = 20,
Type = Container,
/* Capacity = 180, */
Capacity = 50, /* hard coded b42 50 bags, 1000 vehicle */
DisplayName = Wooden Wheelbarrow,
Icon = HCWoodenwheelbarrow,
DisplayCategory = Container,
RequiresEquippedBothHands = true,
StaticModel = carretilla_model,
WorldStaticModel = carretilla_world,
ReplaceInPrimaryHand = models_x_wheelbarrow holdingbagboth_cart,
}```
For some reason I can't get 3d models to appear in game. I have them in a models_x folder within the media folder. The StaticModel and WoldStaticModels match the filenames exactly, and they are fbx files. is there anything else I could be missing?
Looks like there's some f-ery going on in the WheelBarrowB42Limit.lua
Yeaaa just looked in the comments. Makes sense now.
they're overwrting ISInventoryPane.canPutIn
Ahhh, so just straight up ignoring the pushback. Yeahhh... that's dangerous to mess with lol.
Maybe I can try forcing it via lua... ehhh...
Can the change be done as a prefix/postfix instead?
it's not as simple as just overriding the capacity or something, you are hard blocked off from doing that
mods that get around it have to patch every function that checks the capacity
as a brute, I would hook into transfer, save the item weight, set the weight to .1 or something and set it back to the original weight when moving it out. nothing is optimal though
or hook whatever happens before it checks if there's room in the container
For reference, here is my unreleased "bypass all capacity limits" mod and you can see how much stuff is replaced because a few lines in the middle need to be redone and there is no practical way to do it with pre/post patching.
580 lines left...
Java sets hard limits for capacity, but it's up to LUA to enforce them.
discord doesn't like tab characters ๐
this mod is just overwriting capacity in ISInventoryTransferAction:isValid() and ISInventoryPane:canPutIn()
Download & open if you really want to see it all.
already did
there are limited ways to inject code into the middle of a function that you may not have tried
tell me more...
I managed to learn c# harmony transpiling, if lua has anythig similar I would love to know
for example, you can use literally any function call they make to trigger your own code
you can also trigger code off of the original code indexing a table
if you need locals from inside the function i added some utilities to starlit's reflection module that can get them - they're read only but most of the time you'd want to do that they're objects/tables anyway
So patch a function called near what you want changed in a wayy that does the needful?
yeah, basically
it's never 100% but there are a lot more tricks than just prefix/postfix the original function
I'm sure there's a way. Maybe I need to get back into the Java game. I really don't want to... but...
What is the immediate goal? getting more than 50 capacity in the cart?
if you're open to java edits then it's pretty trivial
Instead of replacing a compiled java file, can you add an extra one that modifies the code in existing classes?
there's a framework for that kind of thing in development but for now not easily
Yes, but... Java 
i feel you... java ๐คข ๐คข
you could easily patch it just with java's reflection stuff but i don't know how you'd get the game to actually run any code in a new file
Java is just C++ in a funny hat with OCD about filenames and directory structures.
well i much prefer it without the funny hat ๐
So in theory: if you patched one existing class in a way that would trigger your code, you could use that code to patch another class. And if you did that right you could glue your patcher to something that isn't a core fundemental game class that gets changes every patch like "item"
In practice: this does not sound easy.
yeah, basically
that can be plan B, and plan A is "heck no I ain't doing that!" ๐
I have to agree, java has some annoying quirks that start when you just want to know which version to download.
i'd definitely wait for that framework to be released before doing anything like that, i hear it's coming along and it'd allow for a lot more interesting stuff than just reflection
What is the framework called?
Bumped to a wall with a lua code, trying to make it so if your skill is at a certain level the recipe will give you different outcomes, but it keeps saying something is wrong with the 2nd "AddItem" line.. What am I doing wrong?
Here's the code
require "recipecode"
function Recipe.OnCreate.FNCC_Dissasemble_Woodenhandle(items, result, player, skill)
if player:getPerkLevel(Perks.Woodwork) > 4 then
player:getinventory():AddItem("Base.UnusableWood")
elseif
player:getPerkLevel(Perks.Woodwork) <= 4 then
player:getinventory():AddItem("Base.Plank")
end
end
๐คฆโโ๏ธ I wrote getinventory instead of getInventory
That is an awful lot of variety xD Gotta love that
It's exponential, I have more planned
honestly the hardest part is setting up the display
I had to repeat this process 56 times in total
- equip item
- put code in console
getPlayer():getPrimaryHandItem():setModelIndex() - place item down
- adjust item placement using extended item placement
alternatively I can spawn in an absurd amount of them and just sift through for one of each
This is technically only two guns
8 models, 7 textures
the way I'm designing it, these models will be reusable since I designed the textures to work as atlas'
one atlas supports 3 different stock variants, 4 barrel variants, 4 grip variants, and two receiver variants
technically each one also supports two wrap variants as well, idk if I'll add more colors or textures to that though
and then the pink is free space that can be used for extra bits
Wait, so the atlas is kinda like a mask?
How did you manage to get that done? That sounds awesome for variety
which part
Well, making use of the pink for extra bits, is that because of the atlas?
Sorry, I am a near complete newbie at this xD
It's because if I add new parts to a gun, I can try to fit in texturing there since that space isn't used by the models
If the variations expand beyond the constraints of this, I can simply increase the texture size
it's currently 256x256 pixels
aah, I still love seeing things like this, customization, variety and potential of that is amazing
Yeah it's cuz build42 supports having multiple models for weapons that it picks at random
Oh, I still haven't converted to 42, the unstable makes me hesitate a bit since I'm still not even sure how to do 41 yet
the hardest part I've had to deal with so far was getting it so when you crafting the stock version of the gun, it keeps the same variants
otherwise it would just spit out a random choice
Also I mainly do modding for me and my friends to enjoy, and since 42 don't support multiplayer yet... Well, there's the main reason I stay 41 for now
This is mainly important for a future idea I have involving the sprites
having them be consistent is important for me
Hmm.. Yeah, consistency and reliability goes hand in hand after all
also as a little tidbit, I'm gonna be making it so the player blacksmithed pieces will never roll the rusty variants
cuz that just wouldn't make sense
Heh, yeah making rusty stuff seems a bit odd if it's literally comming from the furnace
and to ease my workload a bit, I wrote out this lua code that adds the models to the guns
otherwise it would look like this in the weapon script
WeaponSpritesByIndex = ImprovisedMagRifleNoStock;ImprovisedMagRifleNoStockGreen;ImprovisedMagRifleNoStockBlack;ImprovisedMagRifleNoStockPurple;ImprovisedMagRifleNoStockRed;ImprovisedMagRifleNoStockOrange;ImprovisedMagRifleNoStockPink,
which is unreadable and hard to make changes to
Yeah.. I try to keep order in my codes as well, otherwise it's near impossible to change anything
well if you end up deciding to jump the shark, build 42 has significantly more you can do with crafting
So in lua I do a lot of -- to categorize, scripts it's /**/ and xml <!-- --> all over but because of that now I can finaly go back and find everything within 10 seconds
do you use visual studio code?
Aye
how can i replace a specific texture in a texturepack?
You mean specifically sprite textures or item textures?
check this out then
ui textures stored in the .pack files
Sorry, I'm still learning about that.. I don't know how to unpack .pack files yet, however I'm fairly sure you can write a luacode to overwrite, but you'd most likely need a .pack file either way ๐ค
No I meant the mark function
Oh, the ctrl+F?
--MARK: Text
it does this to your little code window on the right
Goodness gracious ๐คฏ
I love you Oreos
I've wished for something like that for ages
That little trick is gonna be abused in my scripts and codes from now on ๐
oh yeah for item scripts, get the extension "ZedScript"
makes item files look like this
An upgrade: ```
-- #region MyRegion
..
-- #endregion
I need to complete that extension.
I got an autist diagnose, so this is candy for my soul
oh also in item files you need to do
*/```
instead of the ```--```
Bro.. I spent my whole day writing a normal-form 4 database on the abstracts of Java documentation. I'm also one. :D
I didn't understand a word of what you said other than from the 2nd last punctuation xD
I'm so lost in my world right now lol
Does manually spawning and placing 56 variations of the same two guns for a single photo count?
Keep at it, that's when we get the most done xD
I have to be careful. I can easily lose a month of my life.
That's how TypeScript mods support for PZ happened.
A lot of gin and redbulls.
Hmm, can't seem to make it work
show
You need to set the file language to zedscript or lua for it to show up
How do I do that?
if you don't wanna install zedscript, then just press
ctrl + k, and then m.
then you type lua in the bar that shows up
note I said and then m
you press ctrl k and then let go before hitting m
zedscript is better for item scripts tho since Jab is setting up descriptions for functions n' stuff
There's an unfilled section of that extension that allows for more descriptions to be implemented.
But with build 42 there's changes I'll need to make when I get to it.
batman's one works with build 42 scripts i think
There's another?
i don't spend much time in scripts so i don't really use either one
Also a cat just jumped on my head
ah i was thinking of a different community, not batman LOL
or wait no maybe that is this one
either way it's this extension https://marketplace.visualstudio.com/items?itemName=cyberbobjr.pz-syntax-extension
Won't that invalidate the script if it's in luacode?
i believe so, discord doesn't really have good ways to search for users though and i only sort of remember their name ๐
the file language is just what visual studio code treats the file as. You don't change it to .lua
it's @ batman-fr
it stays .txt
Alright, thanks a lot
He's French.
Any way I can get a link to Zedscripts?
@true plinth Hello. You there? I wrote the other vscode extension for ZedScript.
there's a mini app store built into visual studio code that lets you search and install extensions
Thanks a lot ๐
Didn't see time, already 03:33 here, better get to bed now
Nice meeting you both @red tiger @vast pier And thanks for the help!
Hmm.. one last thing, is there a way to keep tab being the 4x spacebar as it was before on Zedscript?
hmm, that shouldn'tbe up to the extension
you can change it in the bottom right (or left? parts of my ui are backwards for personal preference)
this should open a menu that changes the indentation
Thanks @bronze yoke ๐
New variant being added, front angled mag variant.
dear god help me, that means there will be 112 variants
cuz 2x2x2x2x7
2 guns
2 barrel textures
2 ejection port placements
2 reciever variants
7 color variants
2x2x2x2x7 = 112
You're crazy.
Does that mean 112 items have to be defined, or is this done with various attachments?
2 items
112 model definitions
๐
lmao
not 112 fbx files, 112 entries in a txt file
You can't abuse the attachment system used for scopes/mags/silenceers/etc?
make a stock attachment, a mag port attachment, a tape attachment...
I could maybe but then I would need to write my own randomizer code to choose random attachments, no?
Easier than writing code to auto-generate 112 model definitions
I mean the heavy hitter for the definitions is actually just the colors
but, since you've got that working, not worth redoing now
everything else is copy paste
I have the variants in separate files so I can mass edit them
not 112 files
the way I said that made it sound like 112 txt files
It's 8 txt files right now, with 7 model definitions each
56 model definitions
I haven't done the other 56 yet since I just made the angled mag variant and still need to make all the model variants associate with it
Is there a way to fire off some lua when the player starts a reload?
And when finishing said reload?
ISInsertMagazine.lua
ISEjectMagazine.lua
If you want earlier or later than the actual timedAction,
ISReloadWeaponAction.lua (Or something similar. I can't remember)
i have a question. so my old structure involved having all the files in both common and 42. i didn't know much back then
can i throw everything in 42?
my mod is only for B42
also i wanted to know if that file structure change might affect the saves of people using the mod in any way
everything can be in 42, but the common folder must at least exist
it shouldn't affect the mod in any way to move them to just that folder
thank you so much โค๏ธ
is there an easy way to add a vanilla trait for a certain profession as a profession trait that can't be removed, and for other professions make it a trait that can be added/removed?
the only way is to make a new profession trait with the same display name and description, make it mutually exclusive with the 'real' one, and swap it with the real one when the player spawns
this is also how the vanilla ones work
no, i want to add the NightVision trait to the profession, but so that this profession can't remove it. is there such a possibility, except for adding a duplicate trait ongameboot and adding the original trait ongamestart?
that's just how profession traits are done
thanks
Is there a guide for making weapon attachments?
Can you please tell me how to add a trait to a character after the game starts?
player:getTraits():add("InternalNameOfTrait")
thanks
Hello, what ? ๐
Yo. I wrote the same sort of vscode extension in 2023
This
nice ๐ do you think you'll evolve it ?
I plan to.
I'm bogged down with other work atm
ok if you want some help, i can contribute ๐
is it possible to make this script cool instead of heat?
local function AddHeatSource(x,y,z,heatData)
local heatSource = IsoHeatSource.new(x, y, z, heatData.range, heatData.temp)
getCell():addHeatSource(heatSource)
return heatSource
end
Helloo, I am having the following problem and hope someone can help me. I have this quiet simple script:
function CurePlayer()
local player = getPlayer()
if player then
player:getBodyDamage():setInfected(false)
player:getBodyDamage():setInfectionMortalityDuration(-1)
player:getBodyDamage():setInfectionTime(-1)
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
end
end
local function AddCureButton()
local cureButton = ISButton:new(100, 100, 150, 30, "Heal", nil, CurePlayer)
cureButton:initialise()
cureButton:addToUIManager()
end
Events.OnGameStart.Add(AddCureButton)
And it seems to work. So it creates a little "Heal" button and the wounds I had were cured as well as the queasy moodle. But after some time, the queasy moodle reappears. Also I noticed my Stress value going slightly up even when just sitting in a base without bad moodles or traits that could cause Stress to increase. This lets me believe that I didnt cure the zombification infection and so I thought maybe someone of the more experienced modders here knows, if I did miss a method, which actually cures the knox infection.
Thank you in advance ๐
Are you setting infection level to zero as well?
I thought setInfected(false) would eliminate the infection and the level would therefore be irrelevant.
I added the like so it looks like this now:
player:getBodyDamage():setInfected(false)
player:getBodyDamage():setInfectionMortalityDuration(-1)
player:getBodyDamage():setInfectionTime(-1)
player:getBodyDamage():setInfectionLevel(0)
Will try it out quickly
didnt work. i think isoheatsource is hardcoded to heat only.
hi anyone here can tell if it would be possible by modding to get data of closest tiles. or at least all visible tiles or all currently loaded tiles to memory or something like this?
what are you trying to do anyways? you might achieve the same result without using that kind of aproach, check out how campfire adds heat or maybe how player heat stats changes or something indirectly related to what you want to use this function for
one sec
or at least show me where i can find this kind of info
I am getting an Exception (java.lang.RuntimeException: attempted index: getBodyPart of non-table: null) at this line:
local bodyPart = bodyDamage:getBodyPart(BodyPartType.FromIndex(i))
I think I maybe use the BodyDamage wrong. I am new to Lua, but I saw that BodyDamage has a List BodyParts and I thought this would be the way to reference it in my script
you want to add heat to radio? interesting. i think i need the code for adding heat too... maybe
another idea is to spawn an object that produces heat and just modify the sprite maybe
What event immediately comes after OnInitGlobalModData?
get the object then check for getSprite()
It's not by body parts
It's body damage
I feel like it would be better to have everything in the same extension and not 2 different extensions that will clash between each others
your index might start from 0 and not 1
Tbh it frustrates me a bit that there is not a lot documentation haha
No I know that haha
I just answered to ping you haha. I can actually program in Java, Python (have a cs degree), but yes the modding stuff is new for me
The wiki has been getting a lot of updates (big shout-out to @bright fog for getting the ball rolling on that front)
There's also #1125248330595848192
Yeah it is just pretty big and some things have to be found out by yourself (our I just missed some smt). For example:
local bodyParts = player:getBodyDamage():getBodyParts()
for i = 0, bodyParts:size() - 1 do
local part = bodyParts:get(i)
part:setBleeding(false)
part:setDeepWounded(false)
part:setBurnTime(0)
part:setScratched(false, false)
part:SetBitten(false)
part:setFractureTime(0)
part:setCut(false, false)
end
This makes total sense to me, but I didnt expect the BodyParts to be in BodyDamage. And what's was rly frustrating was the SetBitten method. For some reason all methods seem to be set..., only SetBitten starts with an capitalized S. Maybe this is part of Lua's language, but yes took me a while
Btw I dont rly know if this loop now works
It doesnt throw an error at least, but the Stress level is still rising
Some of the codebase is 10+ years old, I imagine a lot of it is in systems related to player health and stats. Some of the naming conventions are not easy to follow.
If you use an IDE I suggest looking into the Umbrella tool which auto-generates functions as you type. Also, having a copy of the decompiled code so you can jump around and look at inner workings. Sometimes you'll figure out the best route to take by reading through java.
You should be fine to learn modding then
I suggest checking this out
Umbrella & a vscode
Instance pointed to media (for searching lua/scripts) and a vscode instance pointed to decompiled java has been a massive help with my modding.
You just need to accept that the codebase is full of jank and post the best jank here so we can all laugh/cry with you.
if item:hasID("SupportCorps.X) then
How do i correctly ask for an item ID?
idk if this is correct
i wrote my first script for mod and i want to see if it works
how do imake something appear in ingame console
like you know print( or something)
You can use print(variable)
Any errors? You can share the script here if you'd like
well this is my code
local player = getPlayer()
if not player then return end
local px, py, pz = player:getX(), player:getY(), player:getZ()
local range = 3
print("tilez mod")
for x = px - range, px + range do
for y = py - range, py + range do
local square = getCell():getGridSquare(x, y, pz)
if square then
print(string.format("Tile (%d, %d, %d):", x, y, pz))
print(" - Is solid:", square:isSolid())
end
end
end
end
Events.OnPlayerUpdate.Add(logNearbyTiles)
i did activated the mod in menu
i look for anything in this console
but cant even see "tilez mod"
technically it should spam whole console with "tilez mod" and bunch of other stuf each tick
a lol i think its because this uncommented text i pasted with local player xd
I think lua requires more than just print("string")
Unless it was
print(stringVariable)
aa its actually the code xd sceond line
seems like my mod isnt even running
local function logNearbyTiles()
local player = getPlayer()
local xdd = 0;
print("tilez mod")
print(player)
print(xdd)
if not player then return end
local px, py, pz = player:getX(), player:getY(), player:getZ()
local range = 3
for x = px - range, px + range do
for y = py - range, py + range do
local square = getCell():getGridSquare(x, y, pz)
if square then
print(string.format("Tile (%d, %d, %d):", x, y, pz))
print(" - Is solid:", square:isSolid())
end
end
end
end
Events.OnPlayerUpdate.Add(logNearbyTiles)
i did this and cant see any of these even if the prints are on top
First, try to test the simplest mod if it works in general:
print("i'm alive")
If it works, there is a syntax error in the previous code.
If it doesn't work, well, enable the mod somehow.
do i have to restart zomboid anything i change code?
so i made an file with print("i'm alive") only
and still cant see anything
Lua code will definitely be updated if you exit to the main menu.
See console.txt, not console in game
nothing
i.e. 1) edit 2) exit to main menu 3) see console.txt
i searched by alive word and in whole file no such word
althrough i see
LOG : Mod , 1741273894184> loading scan_tiles_mod
So your lua file is not loading. What is your file structure? Where is the file?
is heatsource hard coded to never go below room tempreture?
and is it possible to override this?
is this for B42 or B41?
must be tengo/Zomboid/mods/ScanTilesMod/media/lua/client/scan.lua
for B41
so media/lua?
ok imma give it a try
Guys, I'm stepping into PZ modding, but one thing that isn't clear to me.
What's the best way to debug code and test it in game? It sucks to have to restart the game to test code
Going to main menu resets lua. Also press F11 in debug mode and see what you have there. ||You can reload a lua file in active game||
aint no way around it, lua and models can be changed ig tho
not model scripts tho
I'll mostly be doing lua scripts, which I'll have to reload pretty often to test things out.
Can I reliably do that with the F11 screen?
Yes
Thank you~ lastly, what's the best way to catch and identify errors?
Does F11 show them?
You can track it while in game
Awesome. Thank you. You've been great help (:
Double click the filename (I guess, not sure)
It should be there if your mod is enabled
@umbral raptor btw how do you get the builder tag here? Your questions sound like you just started creating your first mod.
i dont mod lua haha. i mostly do items, clothes, simple lua like loot distribution, etc.
idk how i got the builder tag
@undone elbow do u know LUA? could i ask u some things?
I know LUA. It's the simplest programming language and it takes 15 minutes to learn it completely. But most of the questions are not about lua, but about the game API.
Learn it ๐
Google "lua in 15 minutes". Let's say it will take 1-2 hours max.
ight man
sure, i'm agree, that's why i offer my help if needed.
What does negative value in distribution does? Doesn't spawn or still spawn?
can someone help me fix this?
im trying to override zomboid's base-game heat source capping
Does anyone know where the vanilla Nailgun files are located?
no: to calculate the heat the game just calculates the hottest thing in range, so making it cold will just result in air temperature instead
yeah i think i found a way to override it
but for some reason it sets the entire world to being cold lmao
i suck at programming
any suggestions on how to start learning how to create mods?
Guys, how do you access fields that don't have built in getters?
https://projectzomboid.com/modding/zombie/iso/areas/IsoBuilding.html
like if I wanted to access the Windows vector here
declaration: package: zombie.iso.areas, class: IsoBuilding
uh, sorry but anyone know how to fix this?
That's the first time I've ever seen any bug like that lol
What did you do ?
That's your model which is broken I bet ?
We can't help you if you literally give ZERO detail
Explain your situation or we literally can't do shit for you
thats not entirely true,
i was asking if anyone has any ideas on how to fix that,
not if people know the exact fix,
or what the cause may be
It is, you're getting a bug which I've never seen in my entire life
- are you developping a mod ? Updating one ?
- what's the mod
You can literally give so much detail
That's not a common problem what you just shared
I asked two questions, clearly pointing to you needing to give more detail. When you share a problem you have, giving as much detail as you can on the situation is necessary if you expect anyone to be able to help you
Sometimes, an image doesn't give enough informations, like in your case
I can only guess your problem involves an item in hands, and that's it 
you asked "what did you do" and said "bet your model is broken"
before saying
"i cant help you if you dont tell me shit",
- how did you get in this situation
- what mod are you developping
- is the item a weapon ?
???
and tbh dude you kinda put me off asking for help from you
that, my friend, is called attempting to be funny
That's the second time I asked you these kind of questions to possibly help you more. You didn't put a single effort in giving more informations. You don't want my help ? Fine then
Has anyone worked with the getWindows() function in IsoRoom?
It's supposed to be a vector of windows in a given room. I'm trying to do something with it, but it's always empty
is size supposed to just be a run command?
getPlayer():getCurrentSquare():getRoom()
It's an array thing that returns the size of the array. Vector is a sort of array in this case
let me dig in my code, I know I ran in to some issues with it, especially E and S windows
ahhh, and, thanks for teaching me something new, hope it goes well
Be wary that sometimes, some arrays that you can access are actually not even used by the game
That's notably the case for methods that involve retrieving the list of buildings in the player cell 
I don't know if that's the case here however
That's kind of what I'm suspecting here. It seems like IsoBuilding and IsoRoom stuff are mostly used during initial generation only
there's also something really weird with vectors
Also you said it gives out a vector ?
Bcs I checked getWindows and it gives an ArrayList
public ArrayList<IsoWindow> getWindows() {
return this.Windows;
}
Doesn't look like that's mentioned a lot
Ahh, yeah. You're right. I confused it with "Windows" field in IsoBuilding
but anyhow, IsoRoom:getWindows() still says it's 0 when I enter a room
Jesus
You sure ?
yea I was trying to figure out why I had this code for windows if it was easy
Ah yeah you need to get the vector from the building I feel like
I tried, but it's a field without a getter. I checked out the link you sent and gave it a try but couldn't figure out how to get the field
if you don't mind adding a dependency starlit library makes it pretty straightforward
Yeah
You basically just use the function in the page
I'll give that a go. Is it possible to check if the Windows vector is actually used in IsoBuilding?
could someone decompile a java file for me?
I ended up grabbing the room squares, looping through and checking the square for an IsoWindow. You have to check south and east also because those windows are technically outside. Don't know if that's the right way to do it though
Can you not ? ๐
I think it is
there are code usages
why? haha
can't promise that means it actually runs but it's not a 'definitely not' situation
I mean idk, why do you not decompile the java ?
Alright, thanks guys. I'll give your suggestions a go.
how can i do it then?
Worst case scenario that works yeah
There's a single click decompiler made by Albion in there
awesome
You just click it and boom files are decompiled
that reminds me, I need to decompile 42.4...
if you ain't modding, you ain't living right
Nah mate, when I mod I mod a fuck ton don't worry lol
But I'm busy these days, I focused making documentation for the wiki
its so weird that the game uses so many different codes and languages lmao
and they all work together somehow
the wiki is looking phenomenal
like it uses lua, it uses whatever the fuck scripting is, it uses java.
I already have a mod which is pratically finished, just not getting motived by continuying work on it because I need tiles and I'm absolutely not an artist 
Scripting is something custom made by the devs
For some reasons lol
and also does not qualify for the definition of the term 'scripting' ๐ญ
Yeaaah, you're basically defining tables of objects in a way
yeah it allowed modding. if i had to mod items in lua or smthin i wouldnt have touched modding haha.
The same could have literally been done in Lua I feel like, by literally just having tables that are your objects ?
It would have made it easier for people to learn Lua a tiny bit to get used to some basic formatting for it
Would also allow soooo much to be done on script entries
not sure how it'd be done, i dont know much about lua, but everytime i touch the lua file while modding i always end up producing garbage code lol
zedscript predates the game having lua scripting
Yeah
it also was actually a scripting language originally
That was my guess
If all was made in Lua you could directly modify any existing scripts, expand them and shit
Without the need for the shitty methods to modify existing scripts that we currently have and that do the bare minimum
Would allow for easier compatibility basically
i don't really like things like that being defined in code but i wish they had gone with a different name than 'scripts' and ideally a more standard format like json or something
Yeah
but u could do both scripting and lua lol
What do you mean ?
i mean that you can set up your item fully in scripts and add the additional functions in lua
like the oncreate, oneat, etc etc
thats the simple stuff
Or just directly have everything in Lua so you can literally do anything on items
I see how defining things in the script files in Lua files could cause some issues, but it would bring actually soooooo much to the game
Would make everyone's lifer easier in so many ways
And tbf that's basically what distribution is rn, it's purely Lua based
what could it allow u to make if that were to happen?
that isn't possible right now
Tell me, how do you modify any scripts right now ?
Overwriting will cause incompatibilities
change a value, add an item script/command?
Yea
maybe having the ability to add in our own commands would be cool
if it isn't already there
You need to go through a few Java objects which involve getting the script object, and you are limited by the methods defined for that object
If you define custom entries in the scripts of your items, you are fucked because the game by default adds custom entries to the mod data of every single items
So you end up having to use lookup tables for your items, instead of directly accessing the item script data which could hold your custom entries directly
You could automate the creation of items based on conditions because it would use tables that you could repeat
You could create items based on sandbox options directly
Dynamically create items
There's a looooooooot of shit you can do with defining items in the Lua
You want to change values based on if another mod is activated ? You need to go through the script java object while you could directly set values based on conditions from the Lua
And let's not mention any new scripting added by the devs, like the craftRecipe which sometimes lack java methods to modify those
You're basically entirely depend on the devs actually adding the methods
While if scripts were just tables in the lua, you could directly access anything and modify anything
(and hoping the methods actually do what they're supposed to)
there'd be performance implications if they were kept in lua
Yeah that's why I see why there could be problems
in b41 they had to rewrite the loot system in java since accessing the loot tables just had so much overhead
I agree at the minimum using json could improve things a bit
if scripts were lua that exact problem would come back but worse (they have to check like a hundred script properties to instance an item)
Yeah
They would still need to bring the things java side
But at this point isn't the problem just Kahlua ? 
the decompiler wont work ๐ฆ
cant run it neither by clicking or by command line
You're not in the folder with the jar file
Wait
Yeah I think that's the reason ?
apparently that's what unable to access jarfile means
i am
Welp, Albion should be able to help you better than me here
i have it open
wdym open ?
not really, i don't use java ๐ญ
if anyone can help i just need the decompiled isoheatsource
the path after should be your path to the ProjectZomboid folder?
Nah you'll decompile the files
That will make your life way easier
I just did this and I can't remember for sure but I think so
Where is your ZomboidDecompiler.jar file ?
documents
Then you're in the wrong folder
this project was only written in java since it needed to interface with stuff that was already in java, i don't have much experience with actually using java
You need to do
cd "folder/with/the/jar/file"
whereever the ZomboidDecompiler.jar is, you need to nav to that folder with cmd, and then run that command with your zomboid folder
you can also just open the folder in file explorer, put cmd into the address bar and press enter
that'll open cmd to that folder
What ?
try it ๐คทโโ๏ธ
what os are you on?
Windows
works for me
which version
10
cdm?
i was a little afraid for a second that one of the many weird things i installed to edit file explorer added it ๐
it can only guess your game directory if it's in very specific places (i can probably ask the registry for steam's location but i haven't looked into that yet), you'll have to pass the path to the ProjectZomboid folder
e.g. for me java -jar ZomboidDecompiler.jar "D:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid"
You're still not in the folder with your jar file ๐ญ
got it to work
i moved it to the zomboid files dw haha
while trying to get it to work
๐
does it say when its done?
wt opens the newer terminal but idt the explorer trick works without modification (some setting had to be changed somewhere iirc, but I don't remember where)
Which sucks
newer terminal ?
Newer only in the comparative sense (which is the only sense but you know what I mean); this has been around for a few years now
i had no idea it was open source
Some of those issues are a fun read
There was drama a whiiiiile back when someone called out inefficient code, it led to some unnecessarily heated exchange & ultimately they demonstrated a better way to do it by rolling a basic terminal
Deciphered what I had from before and rolled it in to one function to find all windows in a room. Returns window objects in a table.
function JB_ASSUtils.GetWindowsInRoom(playerObj)
local windows = {}
local roomSquares = playerObj:getSquare():getRoom():getSquares()
for i = 1, roomSquares:size() -1 do
local square = roomSquares:get(i)
local south = square:getS()
local east = square:getE()
if square:getWindow() then
table.insert(windows, square:getWindow())
elseif square:isWindowTo(south) then
table.insert(windows, south:getWindow())
elseif square:isWindowTo(east) then
table.insert(windows, east:getWindow())
end
end
-- print("I found " .. tostring(#windows) .. " windows in this room.")
return windows
end
Nice. Open to feedback?
absolutely, but I know it's a mess
One way to improve it would be to reduce repetition; you're calling roomSquares:get(i) quite a lot, which means unnecessarily repeating the process of getting that element. You could assign the result to a variable and then operate on that instead (local square = roomSquares:get(i), then use square in its place after that point)
Java decompilers online: *JAD, *JDCore, *Procyon, *Fernflower, *CFR. โ A user interface to extract source code from .class and .jar โbinaryโ files.
found this
works far better than any of those decompilers
lol
What works better?
Pretty sure albion's is built on a fork of fernflower & certainly improves some of its output, as someone who has used both
and I'm out
You seem to be confused about the point of the decompilers in the wiki page
yeah probably lol
Oh damn! I'm gonna give this a go
They make the decompiled code better to read
What problem do you have with the decompiling rn ?
Didn't you say it worked ?
Simply open the output folder as a VSCode workspace
If what I'm trying turns into a mod, I'm gonna name is Microsoft, on account of all the windows chasing I've been doing
there is no output folder
it gives u the code as text in the website
Jesus don't use that
Please just don't do it from within the game files ....
He's talking about ZomboidDecompiler
Ik
Oh sorry lol
@umbral raptor
Put the jar file in an empty folder.
If you have PZ installed on a different drive, use the instructions for "other" and feed it the directory of your PZ installation.
It's seriously just a singular double click
But you need java installed, it should be explained in the wiki page
Nope, double click hadn't worked for me either. If the game is not on your C drive, it doesn't find it
mines on E: and it works fine my reading skills need work
np lol
I think the directions for ZomboidDecompiler are pretty straight forward though
D: drive works fine too, as long as it's a default steam install location
i think i can probably ask the registry or something where the steam library is but i haven't looked into that, not much of a priority
currently investigating analysing the output to fix up some common decompiler annoyances in post
I mean, I got it to work long ago. I just had to do it through the console rather than double clicking (which didnt work)
Has anyone tried running both B42 and B41 by making copies of the game instalation? Any gotchas with them both sharing the same c:\users\me\Zomboid profile directory?
it will absolutely destroy everything if you let them share a cache directory
launch one of them with -cachedir="C:/SomewhereElse/
otherwise there's no issues with having multiple installations
ive tried to be able to launch both versions too. and failed.
i did change install dir and cache for both, run 42 with steam and 41 with nosteam
still failed
Thanks, doesn't sound worth it just to backport a mod to B41.
Also, 42.4 broke one of my mods... somehow my simple recipe breaks the code for using a game controller on the crafting interface.
Probably the updates they did to make using game controllers in B42 viable lolll.
Definitely that, but I'm struggling to work out why.
just make a copy of the entire build 41 folder and put it somewhere on your desktop
that's what I did
since b41 isn't getting any updates, you should be safe to just leave it there
I've searched every file of reference mods and searched up every term I could think of and I still can't figure out how to set the coverage of my bracers so that the armor value applies to the character's forearms
I think that's handled by bloodlocation on the clothing
unsure tho
why not just try to figure out what the vanilla vambraces do?
{
DisplayName = Forearm Leather Armor - Right,
DisplayCategory = ProtectiveGear,
Type = Clothing,
Icon = Arm_Armor_Leather,
BloodLocation = ForeArm_R,
BodyLocation = ForeArm_Right,
ClothingItem = Vambrace_Leather_Right,
BiteDefense = 100,
ScratchDefense = 100,
CanHaveHoles = TRUE,
ClothingExtraSubmenu = RightForearm,
ClothingItem = Vambrace_Leather_Right,
ClothingItemExtra = Vambrace_Leather_Left,
ClothingItemExtraOption = LeftForearm,
WorldStaticModel = Vambrace_Leather_Right,
Insulation = 0.35,
WindResistance = 0.3,
CombatSpeedModifier = 0.98,
DamagedSound = ArmourBreakLeather,
Weight = 0.5,
DiscomfortModifier = 0.05,
Tags = IgnoreZombieDensity,
}```
It's probably bloodlocation
cuz that's also the value that handles clothing holes
My worry is when I run it it will fight with B42 over the stuff in c:\user\me\Zomboid\
It definitely is.
The most I've seen it had problems with, is it resets your game settings
Important: if you list an invalid bloodlocation you can cause the game to load and delete lots of items from yoru savegame.
Why is this happening
{
model ImprovisedWoodStockTest
{
mesh = weapons/firearm/parts/attachments/WoodStockTest,
texture = WorldItems/HandleWooden_Small,
}
}```
ModelWeaponPart = DefaultwWoodenStock ImprovisedWoodStockTest saltystock saltystock,```
@silent zealot You ๐ซต
Help me figure this out, you're the reason I'm setting up gun attachments
hahahaha
I just spent two hours working out why my recipe broke game controller code.
Answer: because 42.4 parses the recipe input list differently; in 42.3 you didn't need a comma at the end of every line, now you do.
yeah and I'm gonna be spending hours figuring out how I can get the tape to still have color variants despite the fact that the attachments aren't capable of having randomized sprites
is there any possibility of syntax error? because
MeshAssetManager.loadCallback> Failed to load asset: AssetPath{ "media/models/Vehicles_WheelFRTrans.txt" }
this is what i've usually seen (the path is inside of {})
(Or something has been changed in B42...)
Otherwise the @$#%@#^%@#ing game controller code thows a fit
Becuase __len is not defined for something.
Capital W for Weapons?
vanilla is all:```
model x4Scope
{
mesh = Weapons/parts/Rifle_4XScope,
texture = Weapons/parts/Rifle_12XScope,
}
The guide I'm following does this tho
You shouldn't need to, but I have trust issues with the Zomboid parser/loader
From memory: you need the attachment item to list the guns it can mount on AND the weapon item to list the attachments it can take
I'll look at a mod that adds attachments first
it wouldn't be throwing the mesh error if I hadn't already gotten it to attach to the gun itself -3-
in the weapon:
ModelWeaponPart = x4Scope x4Scope scope scope,
yeah I know
ModelWeaponPart = ItemName ModelName location location,
Where you write the attachment name twice then the attachmnet point in the weapon item twice, for some reason
hmmm
correct file extension on weapons/firearm/parts/attachments/WoodStockTest ?
not WoodStockTest.fbx.bx or something silly?
model file not being held open by blender?
Did you burn sage and anoint your CPU with the correct sacred oils?
Huh that's weird, I was gonna ping rainmaker_13 but they aren't in the server? or any mutual servers?
strange
their last message was 2/12/25 at 12:47pm
was gonna ask them if they knew what's wrong since they've modded in attachments for b42
Not sure I'd classify a four-color bic as a "memento"
Why does no1 develop a mod that removes any basically nude female characters whether from sex events or strip club I can't look at them in islam
I think that category is novelty items in general tbh
Is this a genuine request? your profile makes me feel otherwise
oh my fucking god
Read my mesh script, I have it as firearm/parts/attachments when it's just firearm/attachments

i've updated ZomboidDecompiler with a more robust system for detecting game installations since that's come up more often than i thought it would: if anyone has a steam library in a weird place, i'd appreciate it if you gave it a try and let me know if it works
as before, the detection only works for steam copies of the game on windows
https://github.com/demiurgeQuantified/ZomboidDecompiler/releases/tag/v0.1.5
At least it's working now.
trying now (c:\games\steam... is my installation path)
I can't recall if I had to set that explicitly when I used the previous version of ZomboidDecompiler
the older version could literally only find the default steam location on either the c or d drive
but it turns out way more people than expected don't have their steam library in the default location ๐
This new one found the game, no issues.
thank you for testing!
Thank you for the tool and motivation to update my decompiled game to the latest version!
stuck it on the E drive, zomboid is around there too and it worked flawless. you're the best thanks!
thank you!
Don't worry about the profile but the request is genuine
I am not kidding 1 bit
when you think things might be simple...
public Square[][] getSquaresForLevel(int _int) {
ChunkLevel chunkLevel = this.getLevelData(_int);
return chunkLevel == null ? null : chunkLevel.squares;
}
okay this is driving me insane now, none of them are working again
That is why I use git and checkin every time a bit of progress is made
So I can see what I did to break everything
{
mesh = weapons/firearm/attachments/imp_mag_angled,
texture = weapons/firearm/GunAtlas1white,
}``````
model WoodStock
{
mesh = weapons/firearm/attachments/imp_wood_stock,
texture = weapons/firearm/GunAtlas1white,
}``````
model WoodGrip
{
mesh = weapons/firearm/attachments/imp_wood_grip,
texture = weapons/firearm/GunAtlas1white,
}```
ModelWeaponPart = ImprovisedStock WoodStock stock stock,
ModelWeaponPart = ImprovisedMagFeed MagFeed magfeed magfeed,
ModelWeaponPart = ImprovisedGrip WoodGrip grip grip,```
I feel like making you explain each of those words now. ๐
this is driving me insane
It doesn't make sense to me, because the game is properly registering the models
yes I know they're both fine for certain
I know for certain because they show up in the attachment editor properly modeled and textured
the models are parsed correctly, or they wouldn't show up in the attachment editor
hmmm.
And no other errors exceptions in console.log?
Exception: too many variations I can't handle this much choice
Nope, just the asset path
which makes zero sense considering the game literally loads it perfectly fine in the attachment editor
Hello-I've never made a mod before but im trying to just make a variation for the Varsity jacket, Nothing fancy just a texture swap ontop of the alreayd existing bob and kate Jackett_Varsity models. I followed a tutorial but every time i try to load the mod it crashes so I honestly have no idea what is even wrong
could someone perhaps look at my files or maybe knows a more in depth tutorial/troubleshooting page i could look at to figure out how to do this? I am a complete newb at modding
will it matter
models_x
and models_X?
no
hmm
the game converts all filepaths to full lower case before doing anything with them
I'm still wondering why there's a model name instead of actual path between { and }
pure curiosity
What is the crash error? Post your console.txt (from c:\users\yourusername\Zomboid\ ) and there is a good chance we can offer suggestions.
And are you making a new item, adding a texture to the existingjacket, or repalcing a texture of teh existing jacket?
here is the console. I am just adding a texture to an existing Jacket. Ideally I'd like it to be a variation instead of a replacement of the already existing Varsity Jacket. The actual models are Bob_VarsityJacket and Kate_VarsityJacket I followed the tutorial that was pinned to this page about how to make new clothes by Tchernobill
just trying to give it a new png. It times out anytime i try to load the game back up with it in the mod folder.
Interesting - Java is running out of memory. It only does this when you mod is activated?
yep if i delete it from the folder it opens back up just fine. no idea how i messed it up so bad
How much RAM do you have?
Memory total available to JVM: 252.0 MB
16 gb there is plenty of space too
actually that's just from the java settings resricting memory
not actual system ram free
Which reminds me, I need to adjust my memory settings as they got reverted when I refreshed files
How big is your texure file?
i remember JVM was always around 256mb for me when I didn't set memory
its 256x256 17.8 kb
how would i find my free ram? Im not sure i understand how that is different apologies I am trying to learn
Right click tash bar -> windows task manager -> performance for system ram
BUT it's important to know Java has it's own memory system
Assuming you are on a 64bit Windows, backup ProjectZomboid64.json in the games directory and then open it in a text editor.
you should see something like this:
"-Djava.awt.headless=true",
"-Xmx3072m",
"-Dzomboid.steam=1",
"-Dzomboid.znetlog=1",
that Xmx means "java can only use 3 GB of ram"
And I think the default on B41 is even lower.
I set mine to:
"vmArgs": [
"-Djava.awt.headless=true",
"-Xmx4096m",
"-Xms1024m",
"-Dzomboid.steam=1",
"-Dzomboid.znetlog=1",
"-Djava.library.path=win64/;.",
"-XX:-CreateCoredumpOnCrash",
"-XX:-OmitStackTraceInFastThrow"
],
That means it has a max of 4GB, and XmS means start with 1GB instead of starting with 200 MB and grabbing more because we both know that isn't enough"
This is on the assumption you've just hit the point where your mod collection is using to much ram for everything.
interesting i do have a lot of mods. I'll give this a shot and report back
Could be something else happeing, but this is an easy first step.
It's also worth trying with only your mod enabled, and no other mods.
delete or edit C:\Users\milk\Zomboid\mods\default.txt to disable mods if you can't get the game to start.
do you have any lua in your mod?
You're thining a loop/recursion eating all teh memory?
I don't believe so it wasnt a part of the tutorial
yeah what I was thinking. something looping / spamming unnecessarily
it's also crashing very early, I think before it actually get to running lua.
A 200 line console.txt is so tiny!
yeah and I just realized it was happening when loading script (I guess)
same, comparing to my console,txt it shoudl be loading scripts right after the texture packs
Recursive item script? No idea how that would be possible. Script that breaks the parser? I know dozens of ways, even if they usually break in a different way to this.
:3
Ok I updated the json as you suggested. It seems to still crash out while loading scripts
looking at the console it looks like it ran out of memory again
you dont need to edit this anymore, if you're in the modding discord see https://discord.com/channels/908422782554107904/1299269595697385524
Both ways work, but I can edit one file instead of two shortcuts. Not that it would be a lot of effort to edit two shortcuts lol
true, i just use the batch files when modding, but most peopel dont so that launch arg is useful
I don't think the devs have any idea what a cow is.
and remember steam can delete your edited json when it validates checksums unless you tell the bootstrapper otherwise so keep that in mind
- when they get upset they don't run away, they systematically destroy your stuff. Even if that means running back home after running away just to break some more fence.
- I killed three tonnes of cow because I was sick of this and got less than 2 kg of meat from them
- brown cows produce normal milk instead of chocloate milk.
...ok so manybe not that one.
btw there's a possibility of this
since console says arrayList is the reason, some missing comma or syntax could cause that? Something.... when something wasn't closed, then everything will try to be read as previous parameter's value.
like an arrayList which contains 9999 things
idk if this will help but here is a recording that shows basically the whole file structure and code
need one more }
/*codes*/
... Jacket_Ground,
}
}
and... you need to define your script is for which item like this
module Jacket_VarsityKoK
{
item myNewItem /* This tell to Java that this script for myNewItem */
{ /* This "{" tell to Java that script for myNewItem starts from here (opening) */
DisplayCategory = Clothing
...
} /* to here (closing) */
}
oooh ok great catch! this fixed the crashing immediately thankyou so much!!
โ๏ธ
Guessing work is always fun to me btw
https://pzwiki.net/wiki/Scripts
This will help you to understand how script files work
I very much appreciate it like i said i am a complete noob to coding. if you have a kofi or anything ill gladly tip you for the help.
this part where it needs to be defined. is this right?
I don't earn any money from modding. (at least for now). pure enjoyment is the only fuel for making me keep modding. so you're welcome 
does anyone know a script or how to write an LUA for loading cars on a trailer ?
Have you checked the existing car trailer mod?
it goes farther then looking at that, also that script it written wonkie
wherever the code written it in the tsar common
module Jacket_VarsityKoK {
imports { Base }
item Jacket_VarsityKok
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = KoK Jacket,
ClothingItem = Jacket_VarsityKoK,
BodyLocation = Jacket,
Icon =Item_JacketVarsityKoK,
BloodLocation = Jacket,
RunSpeedModifier = 0.92,
CombatSpeedModifier = 0.95,
BiteDefense = 50,
ScratchDefense = 60,
NeckProtectionModifier = 0.5,
Insulation = 0.70,
WindResistance = 0.50,
WaterResistance = 0.60,
Weight = 3,
WorldStaticModel = Jacket_Ground,
}
}
You will be able to understand which is the difference when you check the wiki I sent.
{ means opening // while } means closing (opening for which you just wrote)
So logically, it should be like this
item Jacket_VarsityKok
{
parameters (Icon, BiteDefence, Weight, etc..)
}
this means parameters is for item Jacket_VarsityKok
=====================
imports {
item Jacket_VarsityKok
}
what you wrote means
item Jacket_VarsityKok is for imports and doesn't much make sense
I hope I explained well.. I'm not really good at explaining :/
no no you are very helpful im just reading through the wiki. so because the item im adding uses a model in the game does that mean i don't need the import section?
"Most vanilla items use the module Base. If you utilize the Base item block, you do not need to import it. Be careful with the naming when utilizing Base module, so it does not match name of a vanilla game item (as it will overwrite the vanilla item)."
it now shows up in game text as an item i can wear but does not actually load the model so i consider this great progress
to be honest, I don't know what imports does since I don't make any item mods (script-related mod).
as far as i know, you will need model script too for your new item if your item uses own model? hmm (nvm this line. this is weird one)
also Icon should be Icon = JacketVarsityKoK unless your .png name is Item_Item_JacketVarsityKoK.png
The whole game is wonkie, dealing with that is part of the fun of modding. And I use "fun" in the Dwarf Fortress sense of !FUN!.
all imports do is add that module to the list of modules that will be checked when you reference another object without specifying the module
But a script to put a vehicle on a trailer isn't the sort of thing people are likely to have laying around, it's going to be a finnicky process.
but you shouldn't really do that anyway and most scripts don't even do that (people just add imports because other mods do)
If you want to write one from scratch, The two tricky parts are 1) make the trailer look different when it is carrying a vehicle and 2) make a vehicle vanish from the game and then restore it reliably.
1 probably isn't hard, 2 is... I can't think of a great way to do it, just some crazy ideas that probably won't work.
I can't tell you what it actually does at a technical level, but if you want to make items in your own namespace to avoid conflicts with other mods you need to use import base.
Then you could make an item called Nep.SniperRifle, because if you make Base.SniperRifle there is a high chance of a conflict with some other mod using the same name.
But it's easier to just make Base.NepSniperFile
I used ChatGPT and not even sure that helped. I need to try and find where to get the code. Or learn LUA and try to write a script myself but would like to try and find the one already made and go off It
ChatGPT is a trap when it comes to code.
isn't that module thing? not imports one
I really have no idea why mod uses module {Base}
It might help, but it will also give you made up code and you need to understand it well enough to fix it.
really this
Anywhere you know where to begin ? I have the vehicle in game just need a script
Like a random person on the internet that learned to code by reading code forums but has never done it themselves, and also they can't admit they are wrong or don't know something.
Have you done much scripting and/or programming before?
I use GPT as calculator only. like "does this code make sense logically?" after done my work and it helps me enough
Chat GPT is great if you want "give me 300 silly business names for my silly business cards mod"
Scripting not really. I could learn Lua might start tomorrow. Also I learn best off of visual
Any other programming?
I have no idea where is a good place to start learning, except to say don't do what I did which is "learn BASIC because that's how everyone gets started in the 1980s"
That's good - if you know the basics of flow control (if/then/else, loops. functions, passing variables around) and understand a bit about how objects work that will help a lot.
@simple helm
btw this is the file for loading animals into animal trailer.
lua\shared\TimedActions\Animals\ISAddAnimalInTrailer.lua
For sure will look at everything that can load stuff
making the car vanish and then recreating it is not straightforward... probably needs some clever hack like hiding the vehicle in a distant part of the map, or some trickery with the vehicle DB.
Ima try to do something like autosar trailer as clearly deleting the entity and recreating seems the best route
btw is baseVehicle also IsoMovingObject?
otherwise... seems you really have to do kind of heck
unfortunatley that relies on BaseVehicle haveing a place to store animals, which is public ArrayList<IsoAnimal> animals; in the java.
Anything possible
logic is there and I thought keypoint is public void addAnimalInTrailer(IsoAnimal var1)
When you say "delete" do you mean delete the vehicle object? If so, how are you going to get it back?
Tbh not sure yet I am tired and going to sleep. Tomorrow a new day. Gn
first line of the function puts the animal object in the animal storing array, but we don;t have an equivilent vehicle storing array.
Would be easy if we could mod java...
I'm going to have a shower and do some shopping, I'll have a look at teh Autostar hauler later because I'm curious how they approached this.
removeFromWorld will not delete some kind of data however I don't remember exactly but i just felt like that before
permanentlyRemove will delete everything for sure
oh did autostar already do this? :0 I'm gonna sub autostar
Autostars solution: 1) on the tailer create a whole bunch of VehcleParts that match the normal part names, but prefixed with "wrecker_"
- one by one take every
VehiclePartoff the car and place it on the trailer (so the car's DoorFrontLeft gets attached to the trailer's wrecker_DoorFrontLeft
- record some values to modData somewhere on the trailer like the vehicle type, the vehicle skin, is hotwored, etc.
- if key is in ignition put the carkey in the player's pocket
- destroy the vehicle permanately.
Then to launch you replay that in reverse: read the trailer's modData, create a new vehicle of the same type, setthe skin, set if it's hotwired, etc etc. Then one by one remove each VehiclePart on the new car, and move the stored part from the trailer to the vehicle.
Looks like there's a whitelist of vehicles it can load, presumably to avoid problems loading modded vehicles with extraparts that don't have a corresponding wrecker_partname on the trailer.
Also that would let them use this for things like the boat trailers than can only hold boats.
So if you want a vehicle than can transport one vehicle you could make use of Tsarlibs to do it... looks fiddly to set up the vehicle file but not too nasty.
So RV with motorbike on the back, easy(ish)
But a car carrier that holds multiple vehicles - you'd need to rewrite a lot of code because it's all built on the assumption that only one vehicle will be transported.
...also I was supposed to shower THEN look at the code. Oops.
@simple helm have a read through that in the morning, see if that helps you understand the tsarlib code.
I actually do this in my carwanna extended mod but it is also done in the original carwanna if you need POC or something
a little bit longer ๐
Does Carwanna just record details of the vehicle in modData and then recreate it? From screenshots looks like you need parts repaired/no items inside/etc
hmmm so I got it to the point that it shows in the game list and you can wear it, tear it up and what not but the actual model is not showing up. I looked at the wiki and compared my files side by side with another mod that reskins the varsity jacket and im just kind of stumped as to why its not working.
Hey this can be many reasons
Some folks in #modeling might know more about typical issues with clothings
Hm ok I'll ask them. This is my first mod. I thought a simple texture swap would be easy but I'm just completely lost
you may want to check that errors.
Tooltip is broken too and error popped up
this mean something is already broken and it could be that modeling is just a follow-up issue.
What are the LUA errors telling you? I can see the red thingy in the lower right. Check console.txt and teh errors may give a useful hint
no model specified by item i think.....I also realized i messed up the clothingitem.xml but adding the extension in the name so it was reading it as clothingitem.xml.xml i can get something to show up after fixing that
i consider this progress
Sometime progress is weird. Like the time I celebrated because after hours of work I was able to make the game crash if the character put on underpants.
haha i am doing my best im sure these are really dumb mistakes but its literally my first time. I'm determined now 100% sunk cost fallacy.
People who have been doing this for years make dumb mistakes.
Nothing to be ashamed of.
could someone tell me how i can override isoheatsource's hardcoded cap of never going below room tempreture. this mod did it.
it uses isoheatsource, but my attempts ended up making the entire world cold instead haha
im trying to add it onto this code
local function AddHeatSource(x,y,z,heatData)
local heatSource = IsoHeatSource.new(x, y, z, heatData.range, heatData.temp)
getCell():addHeatSource(heatSource)
return heatSource
end
How does that mod do it?
Is that file you posted the only lua for the mod?
im not sure, i dont fully understand it.
no there are other, but its related to timed actions and such
from what i understand its pretty much messing with the world's climate and overriding some things
this is for B41 tho
i can send u all the lua files if u want
other things have to do with server commands, definitions of ACs and etc
timed actions seems to be about the player's actions and movements and such for turning on/off the AC
the file i sent seems to be the only one actually working with the temp
I can just subscribe on steam to get the files
if you could do that and help me that'd be great. you'd understand it better than i can haha
if not isMultiplayer then
if player:isInARoom() then
local gt = cm:getTemperature()
-- print ("---gt---")
-- print (gt)
local ht = cell:getHeatSourceHighestTemperature(0, player:getX(), player:getY(), player:getZ())
-- print ("---ht---")
-- print (ht)
if ht > 1 then
local playerTemp = cm:getAirTemperatureForCharacter(player)
-- print (string.format("PLAYER TEMP: %f, TARGET TEMP: %f", playerTemp, targetTemp))
local newOverride = cf:getOverride()
if playerTemp > targetTemp then
newOverride = newOverride - 0.5
else
newOverride = newOverride + 0.5
end
cf:setEnableOverride(true)
cf:setOverride(newOverride, 1)
it emsses up with the air temp or the player temp not sure
it also uses isoheatsource which is weird
wow.. the climate stuff is pure confusion
WTF is class called "ClimateFloat" for?
It's not a float, it's an entire class.
not sure, didnt seem to cause errors
it seems that it pretty much modifies the entire climate
or smthin haha
yeah was confused about that too
but problem in base zomboid is that isoheatsource never goes below the current temp so it can never cool
so i think that def needs to be overriden
the isoheatsource isn't the thing cooling the player
oh, then what is?
the air temp/climate change?
or maybe its changing the player temp?
it includes all of these so im not sure lmao
so ht is the temp of teh best heater affecting a square
if it is >1 (whcih probably means "it exists" ) it gets the air temp for character, getOverrise
then make the overide warmer or cooler to match the target
So an IsoHEatSource set to 18 won't so anything wthen it's a 30 degree day
but this override will
provided you're in a room and affected by an isoheatsource
so i need to add this override?
this?
Hey sorry to interrupt but what is the mesh in a model script for weapons?
the 3d model itself
u direct the script to where it is
thank you, been struggling with that
It's a huge mess of badly names classes with no clear purpose, BUT we know know that getting enabling override and setting overide probably forces teh character temp
so open up the lua console,
cf=getWorld()getClimateManager():getClimateFloat(4)
is the "sprite" the same?
then cf:setEnableOverride(true) and cf:setOverride(someNewNumber, 1)
just shove different numbers into setOverride adn see what happens
Traditionally it would be done by having a completely seperate item for each gun
You can probably hack it with lua and setName()
Is this for B41 or B42?
yep.
but
u have to put ur module name before it
for some reason
whats the module?
sorry
so if my module name is supportcorps and my model name is bigaxe then
WorldObjectSprite = SupportCorps.BigAxe
the thing at the top
module SupportCorps
{
imports
{
Base,
}
oh i have that setup
just a final thing
think this'd work?
module Base {
model Yuka {
mesh =YukaMesh,
texture =Yuka,
}
}
I'm talking items, not models here... but for example Brita would have an item for KrissVector9mm, then one for KrissVectorStockExtended. Then KrissVector22lr and KrissVector22lrstockextended
and the extend/collapse stock action replaces the gun and copies over attachments/condition/etc
no
Not calibres, but that's a simple recipe. AK74+short barrel = AK74u+long barrel
model Cast
{
mesh = WorldItems/Cast,
texture = WorldItems/Cast,
scale = 0.065,
}
AK74+hacksaw = AK74u
my scale is too small haha
cheers ngl i stole the base code from a random weapon mod i found XD
yeah sometimes code will be changed from base game haha when modding
u gotta look at other mods
thats better for u
thanks again, i appreciate the help dude, hope you have a nice day!
"Should we have a setFog(int) method?"
"heck no! Fog shall be ClimateFloat(5)!"
"Could we... use a normal float instea... OK I can see I am making you angry I shall leave now"
In short I need that mod I am not trolling
I'm skeptical that "skibiddi toilet" means "my request is a sincere one" ๐
As for removing specific zombies - shouldn't be hard to do, AFAIK the zombie outfits are just huge lua tables so you just need a mod to remove the outfits you don't want.
If you want that, then congrats - you're a modder now.
I drove to the big Garage near the drag racing track south of Lousiville because I really needed car parts and tools. Which is how I discovered "Pole Position" is actually a strip club.
Complete with big fake garage doors so it loosk like a mechanic's shop
Does ISModalDialog support new line \n?
Is there a quicker debug way to bloody/dirty a clothing item than killing zombies and letting them maul me?
I can get items on the right side bloody no problem but the left I have been trying for 20 minutes
Except for one of them for some reason
in debug mode theres a blood menu
You can probably change the item name
its that
I need something that can change bloodLevel of a clothing item
Think I'll just try to write a script unless something exists I am not seeing
does someone know a B42 mod that has recipes with randomized outputs? I saw a mod here that had briefcases that u could unlock
It's simply an oncreate function
You can probably use item visuals
pressing random adds it to clothing
If i want to start making for example food items, is there a tutorial i should read on?
...

