#mod_development
1 messages · Page 109 of 1
Sublime gang
there is an easy way to replace text input ISTextBox entry
to combo input?
Hey, you can try : https://steamcommunity.com/workshop/filedetails/?id=2760035814
thanks :))
@wheat kraken Just FYI, the only mod I know that uses Simple UI Library has a bugged UI. When you hide your UI, its child panels will not display correctly.
I am not sure if it's because the author implemented Simple UI in a problematic way or if Simple UI has a problematic implementation.
It may be worth the extra hour to simply learn to use ISPanels or ISPanelJoypads correctly for whatever you want to do... but it depends what you want to do.
My friend just posted a simple example recently of how to use the ISPanels to display text on a background centered in your screen. Not sure about your long-term goals, but it can get you started if you look at the code to see how it works. https://steamcommunity.com/sharedfiles/filedetails/?id=2925734630
I try the simple ui, got some result
but try again using vanilla ISTextBox (from Rename Bag) i got it
i create
local options = {"1","2","3"}
local modal = ISTextBox:new(0, 0, 280, 180, "NAME", bag:getName(), nil, MyClass.onEditBagClick, player, getSpecificPlayer(player), bag);
comboentry = ISComboBox:new(150, 0, 100, 18, target, MyClass.onChange, comboentry);
comboentry:initialise()
for i,v in pairs(options) do
comboentry:addOption(options[i])
end
--get current pos of text input
comboentry:setX(modal.entry:getX())
comboentry:setY(modal.entry:getY())
--insert my combo
modal:addChild(comboentry)
--remove the old one
modal:removeChild(modal.entry)
and works
it creates a window near from clicked item, with ok and cancel button, but replace text input to combo with predefined options input
and take action when change value onChange (not usage ok button)
ok can trigger onEditBagClick
if want to
Burryaga for open or close the UI with simple UI just need to do : NameUI:Open() or NameUI:Close()
But MrBounty are not longer in pz modding sadly 😦
That's standard in vanilla, except you would use camel case for functions.
ISPanel:open() and ISPanel:close() are often used in vanilla ISPanels
Anyone familiar with the "More Maps" mod? I've made something but I don't actually know how to contribute to a github page
My problem with Simple UI has nothing to do with whether it has nice function names, however... I am only concerned it may have implementation issues, so I figured I'd warn Reifel
Yes but i think the goal of MrBounty its to show a easy way to make panel because when he made the mod , the panel system was very mysterious for a lot a people
I will take a loot to the example of your friend ! Thanks for sharing ❤️
For sure, 100%. The panel system is not trivially easy to learn. Granted.
Maybe One (dream) day we will get a HTML / Javascript UI system
Yeah, I would just test your Simple UI mod along the way with the vanilla UI-hiding function @wheat kraken
Just periodically try using it while the player is in no-UI mode.
A proper UI will be able to show up while everything is hidden, but the child panels of "The Only Cure but better" do not show up correctly this way.
I am suspicious that the use of Simple UI could be related.
I think "V" is the default shortcut for this.
(Does not work if you're in a car.)
Cut hand or drive... you need to choose 🤣
i was trying to reuse Rename window, keep window near item clicked
instead create my own ui or panel
this was my solution, for replace existing elements on any existing window
(copy positions, remove child, create your own using old pos, add my child at same pos of old one)
solved for me
if I were making a map of the entire game that can be used to navigate but doesn't reveal anything to the UI map... should I include all the random dirt roads, or just the main paved roads?
Optional
thanks for the infos Dane and Burryaga
If the way is just for replace a existing panel with buttons, the best solution it's Burryaga solution ^^
My solution is good if you want make a new panel without be crazy or lose hair at the end 🤣
Again, I don't even know for sure that Simple UI is the issue. Just warning R to test an edge case I've seen go wrong in association with that dependency.
Is it better to base your UI of Simple UI API to later expand it internally to do some more complex things later? Or it will be dragging me down?
all i want for a mod is a mod that adds a doom disc capable to be inserted in a computer and that we can play it INSIDE project zomboid
How to override only one hand model, e.g. for left hand?
This doesn't work and disables the model for the right hand:
self:setOverrideHandModels(nil, self.item);
equip the item to secondary?
or
declaration: package: zombie.characters, class: IsoGameCharacter
overrideSecondaryHandModel
This is a field. Is it possible to change it from Lua?
I found a workaround.
oh?
How hard is it to make a mod that adds recolors along with existing ones?
difficulty is subjective
What do you want to recolor? If it's just a retexture, then it's quite easy
Well lets just say for example, a pair of overalls, which are blue. Would it be difficult to add a black variant that can spawn along side the blue one without creating issues?
Hi guys 🙂 sup
good morning
Gmorning to you too 🙂
for me, the easiest way is to make a completely new item
so that you won't mess up the vanilla one
@tame mulch hello sir .. will it ever be possible to have an rcon command that restarts server? They say it has to be done externally but idk might be possible ? ? ?
Yes, just copy the vanilla code and change its name, recolor the texture, and you've got a new item
Simple enough
Good morning! In game not possible start restart the server. Only by external programm
Was just curious because I saw that mass varsity jacket recolor mod and wanted to add more variety in colors.
Right.. thnx for the lightning fast response . Looks like you havent slept yet
Since like, there's like only 4 colors for like the lumberjack shirt.
Try tint
You can even create a TINT item to let the player choose their own color
You will just need 1 item which is white color
I havent tried it tho... I only messed with hair dye
But would that make it so it would spawn in the map/on zombies as a random color?
I don't like TINT item though since some color look bad lol
I would prefer Red Shoes, Black Shoes rather than Shoes
Eh, I'm not that experienced with Lua but thanks for the info. Probably eventually will try and mod for PZ again.
Yep) 7 hours in row working on guide 
Id be happy to teach you the basics sometime.
Kahlua, which Zomboid uses, is a bit different - but for the most part it's still Lua.
Only thing you gotta worry about is the funny Java instances.
I've made a mod before. More Colored Screwdrivers specifically but doesn't have mod support for a lot of mods for other screwdrivers. So that kinda flopped.
I can't even tell what is Kahlua or Java. 😹
Other mods use other screwdrivers?
Or are you saying mods that use screwdrivers didn't account for your custom ones?
Ah.. yeah I think those mods might be using the hard coded vanilla screwdriver.
Which is kinda pleh, someone oughta patch it to use the tag.
Really I'd make a whole mechanics API for this type of stuff to fix a bunch of discrepancies in Mechanics for hard-coded items but I'm lazy and I have my doubts people would use it
just take a peek, you created completely new items, which is my preferred method
but may not good for tools lol
Unfortunately.
That's why I haven't touched the mod I made after getting it uploaded. If I knew lua better and having a better understand on how to make mods compaitable I'd be all over PZ modding lol.
That's the thing - mod compatibility is really.. dependant on what you're trying to do.
If it's a small mod, sometimes you can get away with just changing a single function a bit.
Other times, more in-depth things require manual patches.
if it's recipes then you can swap to using the recipe functions
then all modded screwdrivers that are tagged properly will be picked up
Farming is one thing that struggles a lot in the compatibility department because if even one mod overrides the same thing as another, you can break everything very easily.
u cud use them from lua too
And that's because a lot of the farming code wasn't really made with scalability in mind from what I've seen.
I know my main thing that I see being a minor pet peeve is lack of variety in items. Color wise mainly. Maybe some quality of life changes to. I know easy packing was like a top one for me to use but it's heavily outdated and or not being worked on.
Just kinda depends on what I want to try and dip in more.
u can do [Recipe.GetItemTypes.Screwdriver]
or in lua you can reference that directly
Udderly they're talking about stuff like mechanics I think.
when it specifically comes to items in known categories like this
Screwdriver gets screwy there since it's not using tags to my knowledge.
At least not yet
iirc, Vehicle Mechanics would need a Java-side update to support tags.
So vehicle repair is stuck with hardcoded tools and tool mods are left out in the cold.
You also gotta consider that patching vehicle repair would likely cause it's own incompats unless people adopted the patch
Which is a headache
But I'll have to get the files for the mod to jog my memory back on it. Since it was like, really simple stuff besides the dis stuff.
I hated the dis
might just be able to do a wrapper but yeah it might be incompat with other mods that fuck with vehicle repair like VRO
idk
depends on how they work
Depends on how deep in the code the screwdriver change is tbh
If it's surface level then yeah a patch should be a piece of cake
If it's deeper than that, it becomes problematic.
I love watching tiny things be nested in massive functions!!
Yeah. I'd hate having to overwrite a 50+ line of code function just to change one line. Cause then you take ownership of all that code, making sure it is up to date and working.
that's why wrappers are preferable
Yeeeup
local original = Whatever.Something
Sometimes a wrapper just doesn't work for some of these things though, not without some really weird crap going on.
Usually
These are to many things my brain does not understand. Yet I understand source coding.
ive programmed for nearly 20 years dont beat urself up :P
I was very happy when Fishing turned out to be really simple to edit and permit magnet fishing for
I've programmed for 7 almost all exclusively in Lua, it happens.
Fair enough.
got more lua experience than i lol
Lua is weird but it's my home language, so even if people call it garbage I will die on this hill.
Source is garbage imo
I haven't touched source but I've heard horror stories from Valve developers themselves.
Funny vidya go brr
TF2, and Gmod mostly
It's confusing at first but it's not all that bad when you really get into it.
Well hey, if you can conquer that, Zomboid isn't too too bad either. It definitely has it's.. moments.. but it's workable.
We'll see. Wonder if I could get my mod compatible with others but I'll look into later.
Yeye! Just keep your spirits up. All else fails, I'm sure you can get away with other tools being modified.
Stuff like scissors I don't think are really used outside crafting, so you could likely get some benefit there.
It really only should be recolors really. So copy pasting but with different names.
For the most part I think
Is there a mod that shows the holes or inspect stats of clothes in the tooltip? Could have sworn I saw it - but I might make it
Only one I can guess is maybe ExtraSauce QoL
Doesnt seem to be it
hello
Howdy!
can i ask something for not about mod?
I mean, if it's moreso a vanilla thing then I'm sure people in #pz_b42_chat would be happy to help.
I can't say I understand entirely, apologies.
Perhaps someone else here will understand better than I-
thank you
nah, I faintly recall seeing someone on astream hover over a clothing item and see the holes
or maybe it was a thought that occurred to me
Perhaps something that came up in a dream! Destiny perhaps?
maybe
I never seen or heard of it
i find reference of connect to zomboid server db with node.js
for example, i want make a web page about my zomboid dedicated server, then i want get data from zomboid server
plz, who know about this process, tell to me....
sorry, my English is very slow and clumsy.
have a good day everyone
maybe like this? https://www.battlemetrics.com/servers/zomboid
It's similar, but is there any way to access in-game information?
that's very advanced, out of my scope
sorry, and thanks you
might have been that one mod that lets you auto-patch clothign
Current draft
Going to have to see about deriving garment window to make a ispanel version
really dont want to copy and paste it all
thats pretty sick
has anyone modded this out? or optional? im the host, its just me and my friends.
its a dedicated server tho if that matters at all
I was able to derive then replace the functions calling collapsableWindow
Kind of hate how off the right side goes
also is the texture not showing holes anymore?
going off to the right allows you to read the items themselves when you are moving around the inv though. unless you had another idea on how to still provide readability while moving around the inventory. unless you increased the delay for the window to appear or something, then i guess it would matter less
hahaha
Old old post revival, can anyone tell if it's ok to remove vehicle recycler and swap it out for repair overhaul midgame?
this one is feasible
should be vanilla
like when you pick up the clothes, you should know whether it has any holes
Another morning, another day for the mods.
I have a crazy idea. Is it possible to combine the radio & TV item interfaces into one? I want to add pocket TVs to the game.
not sure what you mean. do you have a visual presentation?
function undeadRecovery(pl)
if pl and (pl:isAccessLevel('admin') or pl:getUsername() == "Glytch3r" ) and pl:getModData()['undeadheal'] then
pl:getStats():setHunger(0)
pl:getStats():setFatigue(0)
pl:getStats():setBoredom(0)
pl:getStats():setEndurance(100)
pl:getStats():setSickness(0)
pl:getStats():setThirst(0)
pl:getStats():setFear(0)
pl:getStats():setStress(0)
pl:getStats():setDrunkenness(0)
pl:getStats():setPanic(0)
pl:getStats():setAnger(0)
pl:getStats():setStressFromCigarettes(0)
pl:getNutrition():setCalories(700)
pl:getBodyDamage():setBoredomLevel(0)
pl:getBodyDamage():setUnhappynessLevel(0)
pl:getBodyDamage():decreaseBodyWetness(pl:getBodyDamage():getWetness())
pl:getBodyDamage():setHasACold(false);
pl:getBodyDamage():setInfected(false);
pl:getBodyDamage():setFakeInfectionLevel(0);
pl:getBodyDamage():setInfectionLevel(0);
pl:getBodyDamage():setFoodSicknessLevel(0);
--pl:getBodyDamage():getHealth()
end
end
Events.OnPlayerUpdate.Add(undeadRecovery)
so i made this thing for my zombie admin mod
i wanted to replace the godmode
making players able to target me
but i want to also die
cuz i added
function glytch3rRIP(chr)
if chr:getUsername() == "Glytch3r" or chr:isAccessLevel("Admin") then
chr:getSquare():AddWorldInventoryItem("EyeSOS.pvpRewardStub", 0.5, 0.5, 0)
ISInventoryPage.dirtyUI()
if chr then
getPlayerInventory(chr:getPlayerNum()):refreshBackpacks()
getPlayerLoot(chr:getPlayerNum()):refreshBackpacks()
SendCommandToServer(string.format("/thunder"))
getSoundManager():PlayWorldSound('ZombieSurprisedPlayer', chr:getSquare(), 0, 5, 5, false);
getSoundManager():PlayWorldSound('SOSs2', chr:getSquare(), 0, 20, 5, false);
addSound(chr, chr:getX(), chr:getY(), chr:getZ(),120, 1)
SendCommandToServer("/servermsg \"" .. chr:getUsername() .. ' has been slain' .. "\"");
end
end
end
Events.OnPlayerDeath.Add(glytch3rRIP)
so anythin gim missing from the bodydamage and stats
?
seams correct right
problem is i dont heal my wound or stuff like that
any suggestions
Not quite. I essentially want to combine the "connect headphones" and "put in battery" UI elements onto a TV you have equipped in your hand, like a radio
Your best chance for that is to look for native UI in PZ root code.
@ancient grail do you want to heal bodyparts to full hp or just remove scratches, cuts, bleeding, etc?
im actually done with the code
sorry
these are 3 diffrent types of heal for diffrent purposes
any tutorials on how to get started with zomboids version of lua
assuming they use a modified one
I think you can remove most of the stuff at the bottom and keep only setHaveBullet(false, 0). you already change them at the top
anyone want a free volvo 740 Project to finish? i have model and some textures done but i give up with blood and damage and stuff, and its just sitting there not used at all and im sure people could like it
deleting xml files isnt like deleting lua files right
like it would cause error if the file is missing since the mod deleted the file
anyone ?
I guess it is only a Lua checksum.
To avoid errors I think you would need at least 3 lines of code in the XML file @ancient grail
Iirc less than 3 lines causes an XML parsing error to be mentioned by the compiler while you boot up
You may want to update that file with blank data before deleting it
im sure it doesnt help, but i have the same issue. the only thing i can come upo with, is i went into the INI file and made the safe house,the spawn point. my guess, is there is spawn protection tied into buildings. you cant claim a spawn point as a safehouse, as that would prevent anyone not in your safehouse group from spawning. i would suggest opening up a map, finding new X,Y cordinates, and change the spawn location. this might fix your issue
okie
Hello, I hate Discord but I'm here because I was told this is where to go to discuss modding etc, I am working on a rather large map mod & was looking for info on the default mini-map integration or eris mini-map etc, I have been struggling to find any detailed info or instructions on how to do this. Thank you.
Try ask in #mapping chat
Cheers ❤️
i have become inspired once again. may be brainstorming my next mod idea in the future
Offer that up in #modeling if you haven't.
They know more about what to do with it over there.
Thanks didn't knew where to put it
im posting this to on the mod resources if you guiys think my idea is correct
LOAD ORDER:
shared files runs 1st
client files runs 2nd
server files runs 3rd
lua files are run alphabetically
``` ```
Adviceable Order:
Maps / Tiles
Library / API / Framework / Utils / Database
Vehicles / Clothing / QoL
Weapons / Items / Food
Admin Tools / Server Tools
Mods with Overwrites```
The order should match that of SP, no?
At least from my own experience my mods are tested within the game either SP or in host menu - both which you can't alter the load order of
The point being, less bugs are bound to occur the closer each setup is
Anyone recall there being holes in the graphic? Even in the vanilla window there doesn't seem to be.
Why is this one feature giving me multiple instances of deja vu
Good morning.
Any suggestion
Lmao I think you misunderstood my post. I am highlighting the gamepad shortcut to Reset Lua. In vanilla, there IS no gamepad shortcut to Reset Lua. I added it. I do not think any KBM modders are jealous of gamepad modders... That was sarcasm. I am joking about how I now have access to this one minor ability that you all probably take for granted.
I wasn't being critical. I find it funny.
I no longer need to use my Steam button bindings to go into mouse mode just to reset Lua. Minor success lol
Word lol this sounded like you took me seriously
Make a guide for that.
There is definitely no advantage
Do I come off this way often?
I always wonder. Text = no emotions.
No just that one comment
Maybe it's because I type with capital letters and periods.
But I gotcha
Yeah all good.
It was just because your response was the kind of response someone WOULD give if they thought that I thought gamepad modding was actually better, that's all
Not the capitalization or anything
Anyone know if there is way to create a mod to modify the .class "RandomizedZoneStoryBase" the chance part: "public static final int baseChance = 15;" Dont know if im asking a stupid thing, if it is the case, im sorry 😉
I try to be friendly here.
I'd argue that this corridor is the most important for modders.
Moreso than the forums ever has been.
I have no particular exp modding that yet .goodluck tho
There is, but not in Lua modding and not in a mod that people could automatically download via the workshop without first downloading a third party app for installing Java mods.
I thought it was possible to alter the chance via lua
And set it
Gonna make me dig… lol I’ll try to find it today and ping when if I do
Any tip for where i should look into it?
@drifting ore If they are correct that it is declared in a decompiled .class file, it'll be a dead end.
If there is ultimately a Lua variable that actually controls what they want to control, then there may be another way.
I want to say their is. I am certain I use a mod that lets you set. I’m just hoping it’s not a bikini mod since even if it is possible they probably used magic lol
You need this for Java modding IF that turns out to be the only way to do what you want: https://github.com/Olipro/PZHook
But there may be another way, I haven't looked into that
ok, gonna look through it, thanks for the info 😉
@tame mulch I am pinging you because I have come to recognize you as "the friendly one" 🤣 . . .
I can't speak for EVERYONE, but I bet you if you polled us, well over 3/4 of gamepad players would agree that this should be the default behavior for bumpers in your inventory and loot panels... I was almost about to make a mod that did this because I didn't know it was an accessibility option until I read the vanilla code:
just throwing that out there
I've done what I can . . . 😉
You can set any field in debug mode
Not an ideal solution for changing exposed stuff without getters/setters
give us a java hook in vanillaaaaa
?
what is the solution to this problem
ERROR: General , 1675869359770> 0> zombie.world.WorldDictionaryException: Warning client has no script for item SurCraftPack.HamKenevir
ERROR: General , 1675869359770> 0> at zombie.world.DictionaryDataClient.parseCurrentItemSet(DictionaryDataClient.java:42)
ERROR: General , 1675869359771> 0> at zombie.world.WorldDictionary.init(WorldDictionary.java:213)
ERROR: General , 1675869359771> 0> at zombie.iso.IsoWorld.init(IsoWorld.java:2450)
ERROR: General , 1675869359771> 0> at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268)
ERROR: General , 1675869359771> 0> at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225)
ERROR: General , 1675869359772> 0> at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1675869359772> 0> WorldDictionary: Warning: error occurred loading dictionary!
ERROR: General , 1675869359772> 0> ExceptionLogger.logException> Exception thrown zombie.world.WorldDictionaryException: WorldDictionary: Cannot load world due to WorldDictionary error. at WorldDictionary.init line:255.
ERROR: General , 1675869359773> 0> DebugLogStream.printException> Stack trace:
zombie.world.WorldDictionaryException: WorldDictionary: Cannot load world due to WorldDictionary error.
at zombie.world.WorldDictionary.init(WorldDictionary.java:255)
at zombie.iso.IsoWorld.init(IsoWorld.java:2450)
at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268)
at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225)
at java.base/java.lang.Thread.run(Unknown Source)
reverse any changes you made recently to server config that caused it
It's in the first sentence
e.g., rearranging tile maps
yeah in this case it's an item
so
verify files on said client i guess in this case
for starters..
might also try removing any cached map files on the client
forcing a new copy to download
im assuming this is MP i probably shouldnt
if this is SP disregard that
yeah MP
mk
It's a world dictionary error - which means he removed a mod
I've only ever seen it happen for items that got removed - it locks up map loading for some reason
i've never seen removing a mod be a problem tbh
It's specific to 3D models on the ground
Found a way to trigger a world dictionary error, this should be the reproduction steps: - Install a mod that adds an item. - Override that item in another mod that changes a few stats on it. - Copy that mod to a new mod ID, and try to load the world with the new mod ID instead of the old one (or ...
here's a variation i discovered that may or may not apply
mm
text is different
cannot override mod id
probably not this then
This problem only happens to 1 person.
ah
yeah
delete the cached map files
on the client
it is probably doggedly trying to reuse them
and it will get a new one from the server if u do that
can delete the whole client-side save to be sure with simpler instructions
mentioned item is available in mod content I don't know if this information will be useful but
There's an item mentioned?
IMO only the server side of PZ should have java hooks. The client side either needs to be third-party Java modded or not at all.
The responsibility of the API is on TIS.
ERROR: General , 1675869359770> 0> zombie.world.WorldDictionaryException: Warning client has no script for item SurCraftPack.HamKenevir
When running servers, the security and responsibility transfers over to the community running it.
''SurCraftPack.HamKenevir''
Ah, was the mod removed at one point? Or updated?
For the client, TIS is responsible for the client's security.
updated
Were models changed?
I'd give what Udderly said a shot
of course
World dictionary errors have been a bane for a while
That and the fact that if you change item types the game tosses out those items
@tame mulch Is there an alternative place to give that proposal for revisiing openUrl() API command mentioned a day ago?
I will add to my tasks task - discuss about this with team
Doesn't seem like my help-ticket is going anywhere so looking for options. Sounds great. Thanks!
@red tiger when did you last play pz?
January of last year.
When did we all last plaay lol
Before that? 2017.
I think my last run was with @thick karma
5 days ago
The game is more fun to mod than play IMO.
ironic, i hate modding it, it's a chore to me
the API and oddities are such a headache
the limitations
etc
You have server so you always active plus its rp @weak sierra
i do it because i want to play with the features that aren't already there, and to fix bugs that TIS doesn't wanna fix yet
I enjoy breaking those limits.
i mean if ur not running a server and having people wait for things ur doing maybe it's more fun
we also want way to GET just by lua 
Idk about that.. sound like what your doing is exactly how it should be done
the fact that im trying to write a sandbox sync mod just to fix a base game feature of sandbox option synchronization shouldnt have to be eating up my time though
that's just tedious
and then the wiki offers up methods that are nil at runtime
headaches
Force results as JSON with a check and then that's safe.
That and Lua tables.
HTTP GET
that'd be interesting
I'm happy I haven't played so much so I can mod and play 
HTTP get
If all you get back are text then it won't execute anything malicious.
could execute lua from a remote source to avoid needing to update a mod 🤔
huh?
That will be awsome
The problem is that even as innocent as GET looks on receiving information, simply connecting to an endpoint can be dangerous for some individuals with identity and what can be obtained from that connection.
Isn't as serious but can be depending on very specific situations.
is it not unsafe to connect to a server in the first place in that situation?
Could be overdoing that scenario but it can be a thing.
Also make it so that when a sandbox is changed an event should happen so we can retrigger our functions or stuff like that
yh, sadly u right
Apart from the fact that you can REDACTED using Lua, yeah..
(That redacted is actually a real issue I haven't disclosed as a zero-day exploit)
everyone should read this
if you use sandbox options and MP
and in particular if you store security settings in ur sandbox options
Security is a priority for me so the things I know I keep locked up and patch when needed.
=/
(Wrote the anti-cheat patch last year)
Seems like nasko didnt reply or read
12+ hours spent. 266 from 333 item script params done 
Nice
anyone wanna collab on the sandbox options fix? i wrote the framework for it but the API for accessing/changing sandbox options i tried to use doesn't actually exist at runtime
i have limited free time and the next step is to study the vanilla UI code for the sandbox options and try to figure out how it does it
YEAH
Rainy morning. Sad music playlist time.
Wait, what are you doing?
Oh wow
I'm about to go ham on this.
For real.
A simple bootstrap app allowing GUI for building script items...
I already modified a shell template repository for the app.
(Using this one: https://github.com/codesbiome/electron-react-webpack-typescript-2022)
I could make this process.. so.. beautiful..
xD
Am i crazy or is it all in russian?
I'm down to help out with investigating the code, but won't have too much free time either other than weekends due to the day job
Omg this would be amazing. I had no idea I could change that setting. Switching it to what you are suggesting is definitely the most intuitive and consistent with other games. With the default as it is now, I keep pressing the wrong buttons all the time 😅 I'm at least glad to know I can change it!
maybe... its in english for me
I think someones translating it right now some text is still russian for me but he titles are in english
oh yeah there are some bits in russian
not a good day to code... i keep hiting walls today...
Rest.
still have a few more days of freedom... big meeting friday with the big boss... so i want to get as much done as possible since time will be limited starting next week 😐
hello, i would like to do a modpack that i would upload to the workshop for my server for custom settings and such, how would that be possible ? please i need help there ! ^^ if you have any piece of info ill take it !
hmm noob question... brain is frozen... is there a way to make a panel "click through"?
not quite the right place to ask, but you will have to add the mods manually to your server config or create the configs localy by creating a host the way you want the server to be and import those settings to the server
oh sorry i dont know where to ask either, but like i know how to do that, its just about uploading a custom mod on the workshop i dont know
ah you made a mod and want to upload it?
no i took couple mods customized those and want to upload to workshop as a modpack for my server so they sub only to one mod
Dont think so honestly cause clicking anywhere in the panel would instantly focus on it + just moving it and resizing it is possible if needed
hmm so i guess ill have to use the 1px height panel trick again
was hoping there was a better way to do it
you should ask the creators before you upload any changed mods since its at least polite to ask if they allow it...
but this should help you out: https://pzwiki.net/wiki/Mod_structure
it's his native lang, all will be translated later
Thought so
dont worry i was about to ask them but i actually want to see if it works first ^^
thanks !
Thanks a lot
anyone with a hurry google translate is your friend 😄
it's official wiki so need native speaker instead using online translator he-he
ok fuck this this is hard ill pay someone to do it later lmao
well the animation mod is done... now to make it a framework
and that was the easy part
just read all that. i started translating the scripts guide to english but holy moly that shit takes a long time. never translated much before lol
i only got like 5-10% done and was spent
can confirm that google translate does a horrid job in this case haha
i had to rewrite like 80% of the entire thing anyways because it didn't make any sense lol
it does but better a bad translation than none in some cases 🙂
haha
My transpiler progress:
@red tiger any news about the http client you wanted to do for pz?
i found something i wanna try out... i doubt that it works but apparently a pure lua HTTP client...
Working on this transpiler to make it easier for me to dev the HTTP engine.
Doing it the right way. =)
well a http engine would be awesome... no more writing files
to bad it will not work on pz's lua
😐
@pulsar heath Server-side?
File IO check -> OnTickEvenPaused with timer -> Check contents length or starting char or checksum -> parse & handle.
2 processes
- PZ server
- Separate process listening for requests.
You could do a database version.
IMHO, it'd be easier to java-mod API calls for GET and POST.
well ill keep using my dirty solution of using my app as a middleman to receive the data and write it into a file in the lua folder or mod folder
Going through the game's lua, I see some mentions of a sledgeDestroy function. But I can't find its definition. Does anyone know where I could find that?
This is function from java class (LuaManager.java)
/**
* @noSelf
*
* Method Parameters:
* - (IsoObject arg0): void
*/
static sledgeDestroy(arg0: zombie.iso.IsoObject): void;
Ahh, I couldn't find it because my generated folder is excluded from my project ~_~
Thank you ❤️
Where did this come from? I could find the Java part in LuaManager, but I can't find this one.
This is from PipeWrench.
A modding environment, designed to code mods for PZ using TypeScript, alongside Lua.
I decompiled zomboid about 6 months ago, but after a while I couldn't continue, recently ran into a lot of free time, so I thought I may as well give it another bash, hopefully finish the mod I had been working on 😛
Awesome, thank you very much!
No problem.
PipeWrench typings has auto-generated documentation for method signatures.
/**
* @noSelf
*
* Method Parameters:
* - (String arg0): void
* - (String arg0, Object arg1): void
* - (String arg0, Object arg1, Object arg2): void
* - (String arg0, Object arg1, Object arg2, Object arg3): void
* - (String arg0, Object arg1, Object arg2, Object arg3, Object arg4): void
*/
static triggerEvent(arg0: string, arg1?: any, arg2?: any, arg3?: any, arg4?: any): void;
Ahh, okay, nice!
My progress with the transpiler I'm writing from Lua code to TypeScript code.
(Writing type-discovery & type-mapping code)
Tuples are done though which makes me happy. Lua loves tuples, especially when looping through tables.
Thanks goodness TypeScript has array deconstruction syntax. Made it a lot easier to handle.
I've been having trouble with IsoWorldInventoryObject, for some reason the .dropTime value always returns nil and I can't figure out why!?
any help would be, well very helpful!
local checksize = 4
local playerssquare = player:getSquare()
local cell = player:getCell()
for dy = -checksize,checksize do
for dx = -checksize,checksize do
local dsquare = cell:getGridSquare( playerssquare:getX() + dx, playerssquare:getY() + dy, playerssquare:getZ())
if dsquare ~= nil then
local objectList = dsquare:getWorldObjects()
if objectList ~= nil then
for i=0, objectList:size()-1 do
local gitem = objectList:get(i)
if gitem ~= nil then
print("item: " .. tostring( gitem:getItem():getName()))
print("dropped at: " .. tostring( gitem.dropTime))
end
end
end
end
end
end
Java variables are not directly exposed for most objects, so you cannot access dropTime on an IsoWorldInventoryObject directly and would need to use a get method on the object. Unfortunately, there doesn't seem to get one for that variable.
I take it pwm-cli is a linux application?
I'm going through the readme on the github, but I got stuck on the npm run extract step ^^;
Ah uhhhhhhhhhhhhhhhhhhhhhhhhhhhh
I can run it on my Windows laptop.
Use npm i
then uhhhh
Thanks @dark wedge, I was hoping it wouldn't be like that but I'll have to figure out another solution. Thanks again!
npm run clean
npm run compile
npm run watch
Are the three I use.
Ah, run extract worked this time. I'll try those next 🙂 Thanks a lot
Clean removes generated code, I take it?
np! Checking the ISDropWorldItemAction.lua file, it looks like the the time it takes to drop an item is determined by the object's weight and a few traits:
o.maxTime = 50
...
local w = item:getActualWeight();
if w > 3 then w = 3; end;
o.maxTime = o.maxTime * (w)
o.maxTime = o.maxTime * 0.1;
if character:HasTrait("Dextrous") then
o.maxTime = o.maxTime * 0.5
end
if character:HasTrait("AllThumbs") then
o.maxTime = o.maxTime * 4.0
end```
My goal is to find out when something was dropped actually, like how long any given item has been on the ground.
Yeah.
Ahh
Or at least my basic one to have for people to use. There was another one although its author is inactive.
PipeWrench is the actual typings.
I'm not that knowledgeable about typescript, it's been a few years since I last used it a lot... ^^;
I'll have to read up on it
Thank you very much
There's two layers of transpilation:
[Java -> TSD] --> # <-- [TSD <- Lua]
|
V
[PipeWrench]
|
V
[YOUR CODE]
|
V
[TSTL]
|
V
[Compiled Lua Code]
@quiet nebula
Ahh. Cool. Yeah, they're put through PipeWrench and then compiled into Lua. Cool
TSTL is another transpiler that a group of people wrote.
What's the main tag for screwdrivers that mods use?
Man.. I want to make a Discord bot on my server that performs lookups for API & items.
What an insanely useful tool that'd be.
tag tag? i swear i remember seeing that they dont use tags. someone may have to correct me there
Wrote that on my growing list of things to tinker.
not sure if you actually mean tag or if you mean item name itself
I looked and it has like just "Screwdriver" as its tag
its name
not tag
2 diff things
tags are used to group similar item types
just want to be clear on that
What's up ya'll - I was trying to use Tiled to extract images from a pack file but nothing happens, I'm sure I'm overlooking something - any suggestions?
if you do sheet you need to use correct prefix. if you do individual uncheck 2x
Rather new to Lua and PZ modding so didn't know.
Oh gotcha! Thank you very much
oh you are good! just wanted to make sure
if you aren't using base module then you need to write item as Base.item
if it's vanilla
are you using it in lua or script
I've made a mod before. Only issues is that dismantling is an issue. But since I think I forgot the recipes that might have been the issues.
ahhh check that recipes doc. translate whatever you need from it https://pzwiki.net/wiki/Scripts_guide
it should give most info on parameters
i translated some but you can use translator for anything that's not in english
i mean you can say that about a lot of stuff really
how to use getFileReader?
getFileReader("file.txt",true)
need to have a "file.txt" in same folder from script? or where?
better to focus on the help instead of the what ifs
OR.. or.. you could do it.
:P
if i had time i would do a lot. D:
(I plan to when I get to writing a web-app for script management)
my workday alone keeps me busy for many hours. dont get me wrong all the stuff on the backend is soo dope, but most asking havent even gotten 5% that far
unless they are familiar with some languages at least 😄
This also exists: https://json-schema-editor.tangramjs.com/ <3
JSON Schema Editor is an intuitive editor for JSON schema.
It provides a tree view to present the structure of schema, and a property inspector to edit the properties of schema element.
i'm struggling completing what felt like a simple update to my lightswitch electrician lol
adding sandboxvars to change items required in recipes has me just stumped
i tried like 3 diff ways
last try is going to be most simple just using OnCanPerform and adding in each item via itemscript and setting manual craft number using sandboxvar
my brain is broke on it though
bleeechhhhh. after 3 days of trying to write my own functions for everything did I find: SwipeStatePlayer
Apparently, THIS is the class that actually processes the attacks, even though the IsoPlayer has a DoAttack and all sorts of other damage functions. So, ~400 loc has been replaced with: SwipeStatePlayer.instance():ConnectSwing(self.character, self.weapon)
On the plus side, this has fixed ALL of my damage/range/optimization issues, and has also made this hit everything in a much better way. So, i'm happy, just annoyed. 
wow
{
destroy Torch/HandTorch,
keep [Recipe.GetItemTypes.Screwdriver],
Result:ElectronicsScrap,
Time:30.0,
OnTest:Recipe.OnTest.DismantleElectronics,
OnGiveXP:Recipe.OnGiveXP.DismantleElectronics,
OnCreate:Recipe.OnCreate.DismantleFlashlight,
Category:Electrical,
AnimNode:Disassemble,
Prop1:Screwdriver,
Prop2:Source=1,
}``` So if I was making a mod for a screwdriver would I change anything saying screwdriver in the recipe?
what is prop2?
Prop2 is secondary hand model
prop2 is the item that goes in your left hand during the animation
i know that i meant what is that
source=1 😄
is that just how it works with nothing?
Source 1 is the first item in the recipe's items list
ah
It's so dynamic recipes that use tags can still look correct
Would I need to change anything in the recipe like the item name?
This recipe uses find items by Tag "Screwdriver", so just need set to your screwdrivers this tag.
function Recipe.GetItemTypes.Screwdriver(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("Screwdriver"))
end
Tags system is GOAT
Some folks were saying there was issues with other mods like lockpicking, how would I go along and fix that?
I think only by lua patch this mod
So looking into those mods and adding those functions?
I think in lockpicking mod you need replace function that used check item type by itemID to getItemsByTag
Alrighty
Swipe state is your function or vanilla?
Mod for a screwdriver but the recipe is for flashlight?
It's a mod that adds more screwdrivers.
Javadoc Project Zomboid Modding API declaration: package: zombie.ai.states, class: SwipeStatePlayer
But some functions seem to not work like dismantling.
So the tags don't seem to work via mods.
At least for screwdrivers.
Good eye man
This changes things
what is your work flow for quickly testing mods dudes
You mean mods we develop right?
yes
We just normally run it isolated test it on local hosted and SP
some of these are unusable directly, just fyi. some functions require and/or return data that we are not exposed to in Lua.
Well i dont test in SP not unless the mod is exclusively made for SP
i do the majority of my testing in sp, but i write everything for mp

Ow hi albion
it's just a lot faster, as long as you know how to write for mp already (and test it in multiplayer before release)
Soundslike advice for veteran modders dont you think
I do the same, almost all my development is done in SP and just write it with MP in mind. They should work identically in that way. You can "hot reload" some lua files via the Debug menu, and if you just need a single value or something, the Lua console is your friend
depends what you call 'veteran' - i was doing this ever since after my first mod that needed intentional networking
I see
didn't think about using lua console all that much saves time i'll look into thanks
thanks guys
i'm guessing everybody uses a debug map of some sort to save time
i gotta find one of those after work
Btw theres a search bar on the lua list of you havent noticed it yet
When you need to reload the lua files
shit nice
a debug map? i just use the vanilla map, i hadn't even really thought about it
i've never screwed around that much with debug but i got the urge to try modding on break
You can use the iforgot ehat its called the survival mode thing where you are in a cabin its a small map if you intend to test SP
Last stand!
That loads fast
alright tysm saves me time looking for maps
i wonder if there'd be a significant loading time improvement with a single cell map or something
Ye on the chuck loading thing its reduced
I just start a SP map anywhere. Have a good pc, so reloading that save takes less than 30 sec the first time, and like 10 any time after. Using the debug Item Picker can just grab everything i need to test.
yeah that's how i test
(For PZ 41.77 doc version with arg names & some documentation): https://projectzomboid.com/modding/zombie/ai/states/SwipeStatePlayer.html
declaration: package: zombie.ai.states, class: SwipeStatePlayer
Having trouble with a basic Lua issue, trying to figure out how to call this reload texture function when I click on a car...
vehicleMenu:addOption("Reload Vehicle Textures", vehicle:getScript():getName(), reloadVehicleTextures)
that's from the debuger, but i'd like an easier way to do it
Add option to worldContextMenu, find car near clicked square and then try reload texture
gotttt it, thank you!
I am going to do that, yep
What is this witchcraft? Is this instead of :Hit()?
UPDATE: I solved this problem by overwriting the vanilla UI with its vanilla name. Still no clue where the hell the old function was being called from, but now we're good. Leaving this post up for anyone who was curious about it.
Okay, y'all, losing it again... Whoever helps me sort this is my hero...
When I use my new faction UI to enter a name (4x font in screenshot below for testing), and press Triangle to submit:
Everything is beautiful and glorious:
All it does when I press Triangle is call the onClick function on the Ok button in the Create Faction window.
HOWEVER . . .
If I do the same thing in KBM mode:
It opens in vanilla width (which is cut off at x4 font, working on fixing this exact problem):
Which is EXTRA weird because if I hit Ok and reopen the menu in KBM mode, life is happy again:
So . . . like . . . wtf?
My correction relies on calling this:
function WookieeCreateFactionUI:onClick(button)
if button.internal == "CANCEL" then
self:close()
elseif button.internal == "OK" then
local playerIndex = self.player:getPlayerNum()
local player = self.player
local faction = Faction.createFaction(self.entry:getInternalText(), player:getUsername());
self:setVisible(false);
self:removeFromUIManager();
local width = 700
local height = 500
local x = (getCore():getScreenWidth() / 2) - (width / 2)
local y = (getCore():getScreenHeight() / 2) - (height / 2)
local modal = ISFactionUI:new(x, y, width, height, Faction.getPlayerFaction(player), player);
modal:initialise();
modal:addToUIManager();
if WGS.getJoypadData(playerIndex) then
WGS.modal.onJoypadDown = modal.onJoypadDown
modal.onJoypadDown = function(self, button, joypadData)
if button == Joypad.BButton then
self:close()
elseif WGS.modal.onJoypadDown then
WGS.modal.onJoypadDown(self, button, joypadData)
end
end
setJoypadFocus(playerIndex, modal)
end
end
end
maybe in your keybindings it is tied to opening the old menu, which doesn't interfere with controller because there are none
As you can see, the width and height setting are not intended to depend on joypad connectivity
I overwrote ISFactionUI, there's only one.
Not only that but I can literally go back and forth and make the error go away in gamepad and then come back in KBM...
Also, I know I'm opening my version of Create Faction because the vanilla version's text input doesn't fill the panel. 🤪
This is instead of everything.
-- apparently this handles weapon collisions with EVERYTHING, damage calcs, the whole works.
---- Would have saved me like a week to use this from the start. lol
SwipeStatePlayer.instance():ConnectSwing(self.character, self.weapon)```
Whoa, lit.
I can't seem to find the sprites for vanilla items (specifically the walkie talkies)
They are not in media/textures. Where are they?
darn
You can access them.
what are they encoded with? would 7zip work or do I need another program
There's a tool somewhere for extracting and repackaging these archives. Someone in here might know where it is.
I found an online tool that reads them, going to check if it truly works
https://filext.com/file-extension/PACK
All about PACK packed jar files. Details for the PACK file extension and how to open a PACK file. Filext.com
Hmm, it only reads the text and bytes, and not the images
I just remembered that I can get the icons off of the wiki 🤦♂️
Use tilzed to extract…
<clothingItem>
<m_MaleModel>skinned\clothes\bob_jacketvarsity</m_MaleModel>
<m_FemaleModel>skinned\clothes\kate_jacketvarsity</m_FemaleModel>
<m_GUID>f756aca5-7504-4ee5-bc34-d0327347a2d0</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<m_Masks>12</m_Masks>
<m_Masks>13</m_Masks>
<m_Masks>14</m_Masks>
<m_Masks>3</m_Masks>
<m_Masks>5</m_Masks>
<m_UnderlayMasksFolder>media/textures/Clothes/Jacket/Masks</m_UnderlayMasksFolder>
<textureChoices>clothes\jacketvarsity\jacket_varsityky</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityalpha</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityblue</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityblueb</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityyellow</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityyellowb</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsitybrown</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsitybrownb</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityorange</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsityorangeb</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsitygreen</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsitygreenb</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsitypurple</textureChoices>
<textureChoices>clothes\jacketvarsity\jacket_varsitypurpleb</textureChoices>
</clothingItem>``` Can someone explain what this is?
Please do elaborate?
well first, you exported it x y right?
<m_Masks>12</m_Masks>
<m_Masks>13</m_Masks>
<m_Masks>14</m_Masks>
<m_Masks>3</m_Masks>
<m_Masks>5</m_Masks>
<m_MasksFolder>media/textures/Clothes/Jacket/Masks</m_MasksFolder>
Let me check
lemme see
my vest worked fine so I imagined the process would be the same
flip em?
yup
testing
That fixed it
😄
Should I use X-Y for everything or just clothes?
i use it for everything.
Alright, got it. thank you
de nada
Is it possible to add multiple ClothingItemExtra options to a clothing item (i.e. give the option to wear it in three different ways rather than just 2) or would that have to be done with a dedicated script?
@faint jewel Could we chat in dms rq?
sure!
hello guys
how would i go about adding something like this into the game without overwriting the main files
if weapon and weapon:getType() ~= "BareHands" then
owner:getXp():AddXP(Perks.Strength, 1000);
end
end```
i know there's some sort of render thing but i don't understand how to implement it. the code above is taken from XpUpdate.lua in base zomboid, just changed a value to 1000 for testing purposes
Hello, I want to make a local configuration so that the backpacks make them invisible, do you know any information?
you would rename the function to something else, and call it using whatever function handles XP updates (check XpUpdate.lua for declarations)
tysm
Found out something weird. You CAN make a TV item that runs on batteries, works while equipped without placement, etc. but it doesn't actually connect to TV stations. There's probably some sort of function that TVs use, but I'm not sure where I could find it.
it's tied to the tile properties
there is probably some way to do it. not 100% but i know in the properties you can assign the type
OnWeaponHitTree actually might be a reserved keyword for a method within xpUpdate, so you want to keep the name the same, but essentially replace it with your new values
that sounds like a terrible headache to juryrig
alright i'll keep that in mind thanks
i'm sure it's not the worst. i'm just not sure how i'd do it outside of tile properties
there doesn't happen to be a library that detaches tile properties, is there?
or have a "floating" tile
tilezed
ahhhhh gotcha, i should check out the threads tbh
that is commanders guide to tile properties
pins for now
threads are newer
check out tilezed and then look for those declarations in the lua docs
like isotype
wish i knew more about it to help you beyond that 😄
I will also look at if I can make a duplicate function (that handles the TVs) out of the IsoObject type and put it in a custom script
you can place any sprite anywhere with code
w/o any particular properties
I mean, I'd like to detach the properties of IsoTelevision (from IsoObject) onto an item that is never placed, only equipped in-hand
hm
I don't see how the game handles IsoObjects besides on creation. I think I would need to replicate that when the player equips the item
essentially duplicating everything

i got this snippet from glytch3r
local square = getPlayer():getSquare():getAdjacentSquare(getPlayer():getDir())
local obj = IsoObject.new(square, "crafted_01_18", "", false)
square:AddTileObject(obj)
if isClient() then obj:transmitCompleteItemToServer(); end```
specifically the IsoObject line might still be usable
i'd look at how radios work in the code
cuz they work in hand or on tile
and try to duplicate that
I looked at radios. Their methods are separate from TVs entirely but I can take another look as to how it differentiates items and tiles, if at all
i've seen TVs turn on not-on-battery while itemized
in vanilla
if you get one onto the ground as an item instead of placed somehow
at least i think it's doable in vanilla
i would imagine that it should be doable to get one working handheld anyway
oh... 🤔 interesting
they require a nearby gen or power
im not sure if they tune properly
cuz it was very late game
anyway if they can work in item form then i would expect them to work in inventory if u just enable the ability to access the ui
it's likely that when they are placed onto a tile, itemized or not, it can fulfill the methods of IsoTelevision like whether the TV is viewable by the player or what cell it is in
and I would then need to reroute the object to set that boolean always true when equipped and give the player's cell instead
ill test out the itemized TVs rn
this is actually super amusing
eyy there u go
lol
told ya
yeah idk how the television code is written
but i'd assume personally that it shares code with radio
u can hope anyway
as I suspected, when you equip the vanilla TVs in hand, they work exactly the same, but never tune properly into a station
the exact same issue my items are having
If you don't like seeing your player's backpack you could just play with ExtraSauce Sac.
it might be simpler if I instead override the vanilla IsoTelevision to give it new code on onEquip (apparently this isn't a thing) so that normal TVs would work while equipped
Thanks, but it's not what I'm looking for.
@azure rivet what u wanna do is point to an invalid model on the backpack(s) in question
either override via script or use DoParam
blank out the model line
they'll be invisible
...is there a function to call when an item is equipped as a primary or secondary? I'm lost 😅
or an item attribute. I could've swore I saw something similar to "onEquip"
aha i think i found it
hey is it possible to give shamblers, fast shamblers and sprinters different models
Regex Regex Regex..
they use the same zombie object, you'd have to make new zombies
Would be cool if Global API included Regex calls.
What exactly is your goal?
Using a script to make backpacks visible and invisible.
Hmmm. Not familiar with removing or changing the drawn models for existing items but someone here might be.
With ExtraSauce Sac I just take them off... since their shortcuts are active, unequipping or equipping the backpack effectively makes my backpack invisible.
Ok, I understand the mod, but the problem is that it doesn't apply the weight reduction.
☕
Perhaps you could make a mod to allow one weight-reduced backpack to be selected when none is equipped.
That might be easier than hiding the models. @azure rivet
Check out how holsters are invisible
Can you hide holsters via options?
Its not a bag but its a clothin item
Its never shown
They probably dont have sprite at all
Excpt maybe when placed on the ground
Exactly it's probably an invisible model or something
That doesn't really help
Darlak needs something that can be toggled in game
An invisible backpack model would require him to transfer all of the items from visible back to fake invisible alt bag
Ugly solution
But it will work
Can you hide a model on an existent item?
I have no idea.
@azure rivet I would just add an inventory context menu that says "Reduce Weight", and then if you activate it on a different item, automatically stop reducing the weight of the item you first activated.
Create two bags and onceeate coppy all datas of all items inside
Replace bag (deletes everything)
Respawn the stored data
And just apply whatever standard backpack weight reduction is for that item
If that is possible
Idk if you can even adjust an item's weight tbh
is there anyway to run a lau function upon the game world itself loading?
like right when the world first loads log some info?
These are ideas that I have to consider.
Check out postdistributionmerge
Or predistrib
@drifting ore
would this work?
Yeh that too 😅
pog, ill give it a shot.
also do you know if it possible to call on other mods lua functions?
Nm im being overly complicaylted.
My first mod will be incredibly simple. It just enables god mod upon world load
Most Lua code/functions are "universal" once they're loaded, so likely yes, as long as the mod in question is loaded already.
Easy way to ensure that is require the other mod, and the game will try to make sure it's loaded before yours, which will make that function available.
For example, Lua doesn't have an indexOf function like most other languages. I made a utility mod that has that function available. If you require my framework for your mod, that function will be available, and in your own scripts, you can simply call indexOf(array, "search term") without anything extra you have to do besides the require.
(when I say require the other mod, I mean in the mod info text file, just to clarify...)
So like:
require=ModWorkshopID (not the number ID but the name ID)
At the end of your file.
okay thanks for the info, i was going to call a godmode funciton from another mod, but then i remeberd that the efault game has a god mode, so there no reason to do that.
Making more progress tonight on my Lua to TypeScript transpiler. :D
local tupleFunc = function(var)
function saySomething(text)
print(text);
end
return 'A string', null;
end
let tupleFunc = function(_var_: any): [string, null] {
function saySomething(text: any) {
console.log(text);
};
return [ 'A string', null ];
};
is there like documentation somewhere? cause theres not muchi n the pinned comment
like how could i toggle god mode on for a player?
how do i guarentee the code is run? is there like a file thats run on the mod loading? like a OnLoad.lua file or soemthing?
or are all lua files in the mod loaded and run?
I'm trying to import the Moodle Framework but I'm getting an error on loading of my mod:
if getActivatedMods():contains("MoodleFramework") == true then
require("MF_ISMoodle");
MF.createMoodle("vaccine_moodle");
end
Here's the traceback
function: FAVACCINEUtils.lua -- file: FAVACCINEUtils.lua line # 9 | MOD: Simple Vaccines
ERROR: General , 1675914680240> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: createMoodle of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1675914680240> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: createMoodle of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:564)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:510)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:342)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:264)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:391)
at zombie.GameWindow.init(GameWindow.java:1206)
at zombie.GameWindow.mainThreadInit(GameWindow.java:576)
at zombie.GameWindow.mainThread(GameWindow.java:489)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1675914680242> -----------------------------------------
STACK TRACE
-----------------------------------------
function: FAVACCINEUtils.lua -- file: FAVACCINEUtils.lua line # 9 | MOD: Simple Vaccines
I'm curious what's going on here since I'm following the instructions laid out in the mod
MF is a global? That's a really dicey choice of name if so
I believe so, I agree, it's a very small name, let me check though
This is the MF code, I'm pretty new to lua so is this global?
--UI for Moodle Framework
--
--add (un-)commented line below in your mod to use this
--MF.createMoodle("Proteins");
MF = MF or {}
MF.Moodles = {}--moodles map (for getPlayer only, for now)
MF.verbose = false
MF.TooLargeValue = 100000
MF.ModDataClean = false
and MF_ISMoodle is the file containing MF I presume?
yes
Is your code also in client?
ooh, it's not, so it needs to be huh? I have it in the shared folder
the way the folders work is a bit confusing starting out - but basically anything in shared runs two versions
1 client 1 server
The error is most likely the server version failing to find MF
ah, that makes total sense then
I'll move my code to client and give that a shot then
welp it worked, i did not just have to ewnable godmode, i also had to heal the chracter
I guess there is no proper way to restart the server gracefully from scripts?
Udderly has a mod for that, + Nurver has some stuff
Someone also wrote some Linux stuff
I mean detecting a workshop item changes and restart from lua
Yes
Not from Lua, but easy enough to set up
Udderly's stuff is on the workshop
yeah its in #1070858800501891172
I was about to write one for my purposes thanks I don't have to
when a new character is started in a world that had the last one die, is the last characters data overwritten?
or is it just a new entry added to the palyers.db file?
@sour island you got a global_mod_data.bin file from a save with lots of custom GlobalModData stuff in it you can send me?
need it for testing something
this is my largest I think - no clue what's on it
thanks
Noticing some odd stuff using commands and inventoryItems - seems as though items sent over commands don't have a location to reference
is it possible to change the main menu screen with mods?
now you can refresh your memory XD
thanks lol
i dont mean just like change the back ground iamge, i mean like add a new button to the main menu
What's the file path to test a mod again?
without steam on windows is user/zomboid/mods
Ty
media\lua\client\OptionScreens\MainScreen.lua is the main menu i think
@dark wedge your strike thing
Would it be possible to detect before the attack is thrown if the aimed target is a door
And do a diffrent action ?
To be specific the zed mod im doing
I want it to slam the door instead of the bite animation if its a door
Thanx in advance for the reply
You would need to check this manually before initiating the SwipeStatePlayer action, but it is possible, yes.
Also, I was wrong about this being a super magical fix for all of my problems. Unfortunately, it still only takes into account your primary hand item when dealing damage.
Thnx for the idea
And yes, there is the isDoorTo functions you can use on squares to determine that
Cant you make a property bind
Like assign a moddata to the primary hand whenever you equip stuff on your left
when its calculating damage in the java code, it just gets the primary hand item from the character sometimes, instead of passing around the weapon. so no
Only limitation isnif you only have your left hand equip with somethign and your right is nil
Ahh damn
Ow you can probably still do something like setmindmg
setMaxDmg
While you swing
If it knows you are swinging even if it is secondary hand
But if it only listens to the right hand thio technically theres no such thing as left swing so i think you wont encounter this problem as long as you are swinging a weapon
I have a suggestion
You have to make your left hand turn your right hands default dmg always and if its nil you should still make it say that its not
The only way to do that would be to force equip the item in the primary hand for the attack action. Which is possible, but that's definitely a hack and not a good solution. Also, simply always relying on the primary's item could cause a mismatch in skill types when you're holding a knife in one hand and a hammer in the other. I have a few ideas, but that is for tomorrow me.
hello late night modders
a question for everyone, itemname is the item name itself, but is objname the reference to a tile or something else altogether?
is it hard to make a reskin mod?
holy shit you're amazing
Aww lol you're very generous
But thank you, I've been putting in some hours getting stuff to look clean and work cleanly
What exactly is the context of the objname variable you were talking about?
So, we have some fast travel code given by the previous modder, but they are very busy IRL and thus I've been trying to understand a bit of it.
For instance, there is a context menu for teleport that utilizes itemname = via:
...
if itemtype == "Animals.HorseAppaloosaSaddled"
local teleMenu = self.invMenu.context:addOption( "Fast Travel", nil);
local telesubmenu = ISContextMenu:getNew(self.invMenu.context);
self.invMenu.context:addSubMenu(teleMenu, telesubmenu);
local LandmarkMenuOption = telesubmenu:addOption("Landmarks", nil, nil);
local LandmarkMenuSubMenu = ISContextMenu:getNew(telesubmenu)
... ```
Now they have another which isn't in the context menu, how it worked previously was that you right clicked on the world itself, presumably a tile, and were given the list of options.
```for _,obj in ipairs(worldobjects) do --filter for what we find when we right click
...
elseif objname == "Fast Travel Point" then
...
else
local LandmarkMenuOption = telesubmenu:addOption("Landmarks", nil, nil);
local LandmarkMenuSubMenu = ISContextMenu:getNew(telesubmenu)
telesubmenu:addSubMenu(LandmarkMenuOption, LandmarkMenuSubMenu)```
But I was told by a friend doing tiles that not all tiles have names so I'm trying to narrow down exactly what objname would be referencing.
So this is for lua development, the Java part of that diagram is to show that it translated java into typescript? Or does it allow for Java mods as well, somehow? Just to confirm.
Can you upload that file?
PS what exactly is your goal r.n. with this teleport code?
Do you mind if I DM you for that?
Nope
is it possible to change a Mods gun sound without altering the sound files? I was looking into using a doParam, to replace the Gunrunners weapon packl sound back to the vanilla sounds, but so far no luck
I was testing with just one gun, this is the code I was using
Typescript typings*
So, if my Recipe needs a Drainable, can I figure out how many of the actual item will be used?
@pliant epoch http://www.fragmosoft.com/fragMOTION/
finally fixed the integration! thnx alot sir Chuck GPT
https://steamcommunity.com/sharedfiles/filedetails/?id=2919435743
https://steamcommunity.com/sharedfiles/filedetails/?id=2853615523
@ancient grail typo on "Conversion"
conVEsion
why do you create it as a new mod?
confused players incoming
ah, I get it lol
different customer
Hi everyone I have no idea of moding but I would like to create a mod where the distorted trumpets from half life start playing randomly can someone please explain to me how?
You want the sound to come out of nowhere or just normal background music?
You need to use onplayerupdate event
ZombRand()
And the produce the audio
Thats it
Good eye
Good morning.
not really, took a while to notice
Hello Git diff.
Yes just input the number you consume on the recipe
Morning sir jab
Okay, I phrased this wrong. I meant, how many items. A drainable has a set amount of uses, and it may not always be full of uses
👋
A recipe can pull trom several drainables to fulfill the uses requirements
I'm working to fix an edge case where that matters
Still thats some impressive detective skills .
Hmmm the no sledge function. Can be used as an util actually
For modders
Or for server owners i guess
Found out a streamer I watch and have subbed to plays PZ. He said it so subtly and casually.. Cheered 500 @ em heh.
He gets around 3K viewers peak on his daily streams. Pretty neato.
I love seeing all the documentation efforts going on in here for modding. It's so refreshing.
Less people getting stuck in silly unknown pitfalls = win.
Yep massive effort from sir aiteron
I'll give him support wherever it's needed. =)
I plan to document going forward using my documentation tool so I can compile it with PipeWrench.

is it possible to convert string back into isoobject id
Also am considering taking my first look at why the .X importer in Blender fails to import animations today.
<3
pls enable a way to use autodesk maya eheh
Unless you can identify the original instance and grab it, no. You'd need to make a new instance.
darn
Out of nowhere
you can use this one https://steamcommunity.com/sharedfiles/filedetails/?id=2834231099
and create your own sound pack
Thanks man thats really helpful
Could someone explain to me how I could change the texture of the item in the StaticModel part?
I believe it is in the files "models_.X"
I tried to change the PopBottle image, but the image doesn't appear in Blender to create the model...
Another thing, recently I was trying to change some sounds, for example the alert event when we come across a zombie, but instead of the sound playing, it is muted.
no, i will try now
the code seems fine
make sure you really got jumpscared
better convert to sound to .ogg files for smaller size
the volume part may not be needed if you adjusted the sound volume properly
no louder than 85 dB
which mod?
Any .
all of them lol https://steamcommunity.com/id/safc/myworkshopfiles/
Wow can you hide the instance of progress bar by choice like for some stuff not all
I don't know how to code if there are no example from vanilla lol
number doesn't matter lol
Solid in this case is an adjective for "good"
I see i havent messed with the progress bar. But there was onentime i wanted to remove it on a time action. Whats 4d pocket
your mod quality are way more better
meanwhile me coding the same mod for about 2 years now
Must be some big mod
Actions have variables for progress shown in their new()
must be hard when the patches come out and break things with a mod in progress that long
I see
you can try hiding it with code if you can
Is Dynamic Traits 😂 new ideas appears, new knowledge appears so a lot of things are reworked to have better code, etc
And I don't have too much time to code many different mods 😦
Dynamic traits nice .same as what music man did
