#mod_development
1 messages ยท Page 119 of 1
UI_EN goes inside a .txt of the same name... all translation files seem to work that way.
The translation file shares the name of the table inside of it
Just as a visual example:
Oh, yeah, Burryaga already basically said that... carry on lolz
I hope now that I'm finally past this I can get to work on constructing the UI for my Radio Survivors haha
behold the context menu works as expected uwu
Fwiw you are welcome to convert anything from Wookiee Gamepad Support if you wanna make sure your panels are gamepad interactable.
Ow hi @abstract raptor idk why the bottomless pit didnt show on my end. So i had just create own tile
Do you mind a quick DM?
check threads
Your best bet is finding a mod similar to what you are trying to do, and learning from it as an example.
yea that is really true
lmfao... welp, from one error to another one... I cannot win today
function: create -- file: ISIndesctructibleBuild.lua line # 17 | MOD: Mining Mod
function: checkForMines -- file: medievaloid_minespawner.lua line # 40 | MOD: Medievaloid
ERROR: General , 1676871804593> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.iso.IsoGridSquare.getCell()" because "this.square" is null at IsoThumpable.getInsideSquare line:2005.
ERROR: General , 1676871804593> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "zombie.iso.IsoGridSquare.getCell()" because "this.square" is null
I think it's time to step away for a moment
sure
your type
i literally have no idea but i'm guessing it's overriding it because of the type being food? try another type and see if it still does it
do i need to delete it or just change it to pills or something
no no
type is required for sure
it is how the item is treated. that may not be it tbh. i'm looking quick
i'm pretty sure food can still be first aid.
just never really thought about how it would be displayed as a perishable
i am getting it working with spiffo radial menu mod, i guess the type will affect whether it works or not
example of how immersive medical looks
so it doesn't seem off from yours
This mod has some things that don't seem to work
i dont think you need foodtype also if you arent delcaring it lol
well what im looking at works
i'm using a fully functioning version so not sure what one you are referencing
can i ask what weird copy paste is that spacing from?
always hard to tell when things dont look right when it's a mess like that. maybe someone else can more easily spot in it
Does the better sorting mod affect my sorting?
yes
it relabels display categories
i wouldn't assume that would have much to do with your issue atm though.
i could be wrong though. haha never say never when it comes to reasons why having issues LOL
are you owner of immersive medicine
no lol
zombie fix and lightswitch electrician. soon to be lightswitch overhaul! or something like that ahahah
sorry working on my mod atm.. your script didn't seem wrong.im just not sure how the display category works with perishable items and categories offf the top of my head
it's not very good at it
I know but it seems to be able to make basic stuff
it often relies on completely made up stuff and generally doesn't actually understand anything pz related, even if it does get it roughly right
like it'll call a bunch of functions that just don't exist
yea it's prolly fun to mess around with but literally everyone that first figures out ai chat bots potential, proclaims its greatness, just like it's the first time all over again ๐
if you are a good at using the language it will be very helpful but i can tell you that half the conversations it has are semi incoherent... while its possible it could make something that works on the first try, it will always be primitive and not truly functional and require knowledge beyond just knowing how to code
if you trained the model on the entire api of zomboid and all the quirks and it knew everything that was exposed. another convo
I asked it to improve my code a bit, original is this
local function maxSkills()
local player = getPlayer()
for i=0, PerkFactory.PerkList:size() -1 do
local perk = PerkFactory.PerkList:get(i)
player:level0(perk)
player:getXp():setXPToLevel(perk, 0)
for x = 1, 10 do
player:LevelPerk(perk)
end
end
end
Events.OnCreatePlayer.Add(maxSkills)```
ChatGPT changed it a bit to this
```lua
local function maxSkills()
local player = getPlayer()
for i = 0, PerkFactory.PerkList:size() - 1 do
local perk = PerkFactory.PerkList:get(i)
player:level0(perk)
player:getXp():setXPToLevel(perk, 0)
local desiredLevel = 10
for x = 1, desiredLevel do
local currentLevel = player:getPerkLevel(perk)
if currentLevel >= desiredLevel then
break
end
player:LevelPerk(perk)
end
end
end
Events.OnCreatePlayer.Add(maxSkills)
thats like asking it to do math though. kinda diff imo
i use it as a calculator for complex formulas all the time
it's insane
Yeah imagine if ChatGPT had access to latest news, internet
isn't this worse?
LOL
the stuff it added doesn't do anything, it's just slightly slower
verbose for sure
Well, you're right it's functionally pretty much the same but longer
albion you are a smarty pants. any chance you know the best event for updating recipe via scriptmanager?
i tried ongameboot and its too early i guess or something
using sandbox options?
OnInitGlobalModData
that will work still for recipe? lol dammit
for some reason i thought it wouldnt work or didnt
i'll try it. haha second time you've told me that maybe third ๐
dunno why i would think it would be diff tyty
you are looking for nyamops but his not active here tho
a cannibal trait im working on
thoughts about the icon?
its a hearty heart i drew
its going to give you 8 points (its actually a sort of negative trait)
you can only eat human meat, AKA corpses
yes
it would be interesting if you can only eat human players for it to be only viable in pvp or with npcs
definitely an interesting concept, perhaphs a server where cannibalism is the only method to get food
sounds cool tho! looking forward it
Looks good need to delete corpse Just after, and dont make the corpse give you more food than normal food items otherwise its to op.
all though if the trait cost more than others its okay if its op.
i wanna make a mod that lets you become admin without enabling god mode automatically. any ideas where to start?
also different traits affect illness chances, base chance is 40 if corpse was a zombie
actually this trait is also going to cause your character to be very very hungry
no unfortunately, sorry :c
basically by default, whenever you do /setaccesslevel [name] Admin, god mode is automatically checked, but i wanna make all those unchecked by default
why double iron gut
local originalMethod = Class.Method
local function patchedMethod()
{
-- prefix code ...
originalMethod()
-- postfix code ...
}
Class.Method = patchedMethod
oh little mistake, it is still experimental
oh! thanks! that is super helpful
np man

check the lua cheatsheet as well
very useful
thank thank
Are there any vars that could be useful in making a learn all ||(even these occupation exclusive ones)|| recipes mod? I tried to find some but I don't think there's any that'd easily allow to get all the recipes.
is there any way to add some clothing to the character creation menu? I know, there is a server option, that allow players to pick any clothing, but I don't want then to pick ANY, I want them to pick something from the list I gave
check out MainCreationMethods.lua in PZ/media/lua/shared/NPCs
it has all traits and free recipes included with those traits
for example this ones
yeah it p much has every recipe in there besides magazine exclusive ones
r u trying to make a trait or a magazine that teaches them all? or something?
Nah I'm trying to make a no grind mod which unlocks all the skills at the start of the game no matter the occupation and traits. I tried thet getFreeRecipes thing, sadly did not work for some reason.
I think I tried something like this, sadly didn't work but I may have messed something up, or it only works with professions.
u can just make it cost 1 and give everyone 1 free trait point
try looking at a mod that alters a player on spawn rather than trait mods
hmm thats interesting, perhaps you should check this out:
characterCreationMain.lua in PZ/media/lua/client/optionscreens
Yeah I looked at the Cheat Menu mod and noticed that it doesn't give the engineer recipes and also misses some other one.
it seems to have some useful clothing thingos
for example, this mod adds immunity when you enable the mod
https://steamcommunity.com/sharedfiles/filedetails/?id=2316796333
you can see how they made something work for all players when the mod is enabled
and then also use ur knowledge of how to give players recipes
giga chad taking speed demon instd
when i have 1 free trait point i'd rather not take a trait at all
speed demon W trait tho wym
i reverse too much
skill lack
lacking skill
Hey, just wondering. Is looking at other mods that can do a similar thing and then fixing your own by understanding on how the other one works (without fully copying and pasting the code) alright? I looked on how the Cheat Menu max skills feature works and I improved mine a bit without fully copying the code.
that's how i made the start of my immune trait before asking for feedback
i looked at several dif mods tho
So it'd be fine to post that mod on the workshop even if it includes one or two really similar lines of code?
you can copy off my homework but change it up a bit so the teacher doesnt suspect anything
i dont make the rules of coding etiquette, but it's like math. if you want to do a certain thing, there is a certain way to do it (most of the time). no way around it
I didn't really copy it off. There weren't any other ways to code these 2 lines anyway.
ik it was just a joke
but yeah it inspired me kinda
what is the code anyways?
local function maxSkills()
local player = getPlayer()
for i=0, PerkFactory.PerkList:size() -1 do
local perk = PerkFactory.PerkList:get(i)
player:level0(perk)
player:getXp():setXPToLevel(perk, 0)
for x = 1, 10 do
player:LevelPerk(perk)
end
end
end
Events.OnCreatePlayer.Add(maxSkills)```
the level0 and getXp():setXPToLevel() part, I added it just in case the levels would somehow go above 10 if that's even possible. Cheat Menu does a similar thing
ah. i think no more skillless survivors also has a check for that
since it literally can grant u too many levels
copying code from other mods
theoretically speaking
you both guys could do a same thing
you just decided to get some help
So is it bad?
no
that's the best way to learn imo
or at least understand how stuff works a little bit better
Hey, I need some help with an animation(set) not triggering in a specific scenario...
- from random location he will walk toward object face it and do the animations.
- but if i then cancel and re-activate the action (via context menu) it does not trigger the animation. (unless i move him 1 step from this location)
- but it does trigger the action (which is then buggy cause the animation sets dont provide/read the var updates)
If highly unlikely this scenario would ever happen but still ... would like to understand whats happening
lol dont worry its not 4am here so
If the modder doesn't explicitly ask you not to use their code, it's pretty much fair game as long as you don't pretend you are its original author and try to steal subs by cheaply reposting their code in a virtually unedited state. However, some mods will post an image that tells you not to use their code, e.g.:
Redistribution of this mod without explicit permission from the original creator is prohibited under any circumstances. This includes, but not limited to, uploading these mods to the Steam Workshop or any other site, distribution as part of another mod or modpack, and distribution of modified versions.
If I see something like that, I often don't even read their code, because I don't want to get a good programming idea from them that they can accuse me of stealing.
i had some issues with a few copy cats
dont mind ppl using my code and updating it for their own use
but a copy paste with a new name... that i cannot allow
so i dmced about 11 mods so far
btw, i found a pretty easy way to store your mods when you are not updating them so it wont have problems with being subscribed to it on workshop
i just added another folder within the workshop folder and just put my mods inside that so it doesnt read them
i have 2 dirs for pz... one for playing another for developing so i dont mix things up
and take them out every time i need to update it, since i need to be subscribed to my mods when hosting on mp
Unless you get a better answer i think theres dev made code for exercise in lua that may help
Cheat Menu doesn't have that in the description but Cheat Menu RB does
yea i have a backup one that i edit while the other stays the same, in case i mess something up
i usually contact the mod author if im interested in using something the coded, and ask if its ok to use it and credit them in the mod
Then as long as Cheat Menu is not in fact an unscrupulous derivative of Cheat Menu RB, I would use Cheat Menu for advice and ignore Cheat Menu RB entirely.
thats the best way to do things, ask for permission and credit the original author of the code
cheat menu is older than cheat menu rb
Thanks
its the "original" mod
yeah
Right on
i use it a lot for debuging
that lua window interpreter is very usefull
now im trying to make a whitelist for use with the integration, im a lazy coder so ill ignore the split screen mode of the game and use the steam id as a unique identifier for the players with access ๐
subscribe...
then look for the mod ID
Hey, I need some help with an animation(set) not triggering in a specific scenario...
- from random location he will walk toward object face it and do the animations.
- but if i then cancel and re-activate the action (via context menu) it does not trigger the animation. (unless i move him 1 step from this location)
- but it does trigger the action (which is then buggy cause the animation sets dont provide/read the var updates)
well thats horrifying
if you cant beat them join them
Omg legendary
Lol I want to eat zombies like this.
anyone know how to solve this ? (odd part is this goes away if an vanilla exercise has been done once.)
hey where can found functions for radio and channels?
If this is related to a mod you're creating, please provide more context. If it's related to a mod you're using, you're looking for #mod_support (and you should also provide more context there)
Its a mod im creating.
essentially creating a new exercise what i want to trigger via the context menu.
but its not being read 100% correct (if an exercise has not been triggered yet via the "exercise menu" )
it extends the isFitness Class but i thing the issue lies in not being able to pass the correct FitnessUI object which i think is used to calculate the exp/endurance etc
is it possible to teleport zeds"?
Unfortunately I can't take a closer look at the moment, but looking at your screenshot the "Caused by:" implies that there should be further error information that tells you where in the Lua is triggering it. Presumably, the vanilla exercises do some sort of initialization that populates this.currentExe, so if I were debugging this I would start there
๐
sadly there is not...
IsFitnessAction is calling self.fitness:exerciseRepeat();
which calls incRegulatity() which need this.currentExe (no clue where this would originate from or how to set)
there seems to be no trail to follow after fitness.incRegulatity() ...
Are there any .lua files that are related to recipes, and also the recipe magazines?
could this.currentExe be the data from FitnessExercises.lua?
Sadly no, I found an other clue though. just opening the fitnessUI menu fixes it. i guess it initializes some class...
has to be something in
function ISNewHealthPanel:onClick(button)
but i dont understand how opening a UI sets a backend var to calculate endurance/exp etc
I meant FitnessUI's new/create/init... If opening that ui makes your character exercise correctly again, something in it's creation functions may be responsible
Good morning.
If onClick creates a new FitnessUI or initialises one, I would check those functions
I plan to get weapons and weapon-parts fully parsed today.
well yeah. im looking but it doesnt make sense ..
Am very excited to see results of parsing ZedScript as JSON. :)
Wondering if I should wait to write a ZedScript writer until 42..
Could do both but not sure if it will be useful.
this.currentExe is a field in the java Fitness.class. Its reporting its not set likely because you failed to call fitness:setCurrentExercise(type) prior. this is called in IsFitnessAction:new() (the timed action initialization)
o.fitness:setCurrentExercise(exeData.type);
/**
* Sets the current exercise being performed.
* <p>
* Called from {@code lua/client/timedactions/ISFitnessAction.lua}
* @param type the string name of the exercise type as defined in {@code media/lua/shared/Definitions/FitnessExercises.lua}
*/
Hey Fenris, thanks for the reply. although I figured as much. however
I did not override the default fitnessAction:new() and did pass the correct exercise.type
even tried setting it manually with lua o.fitness:setCurrentExercise(exeData.type); to no success
ya that manual attempt is no good if your trying it like that (since o likely doesnt exist)
as well as exeData, both of those are variables from the timed action code
yes, got that. what i dont get is how why is FitnessUI passed though ?
getPlayer():getFitness():setCurrentExercise("squats")
if you want to test from the lua console
i did it this way before. while it sets the variable it doesnt work for reading our currentExe.type
Hi, i want to add new diseases to eating certain foods like vanilla mushroom and berry. How can i check what character eats? Or inorder to do that do I have to override all those foods? If so, could you show me how to do it? Also, if I override these items, will the recipes using these items be corrupted? thanks in advance 
That has an example of a safe decoration of the eat function
You could check what you're eating differently in that function and do something different than the mod does
The mod just talks when you eat as a simple example
exeData is set properly, Using the default ISFitnessAction:new() yet ...
is there a way to use the On.Create to set any amount of several items of the recipe in a lua function?
for example we have item1/item2/item3.../item10 and if 3 of the items are present, the recipe continues, as opposed to having 3 of the exact id like normal recipes work
Hahaha I just realized something.. I could add a ZedScript library to PipeWrench. People could generate items from their own Lua code.
That'd be hella crazy.
Like building RPG items.
I'm guessing that's already possible without it though.
DoParam() etc.
thank you so much
I F##ing knew it. ... i fixed it.๐ตโ๐ซ Send a new FitnessUI object with my fitnessAction. still doesnt make sense how that works but it does....
Thanks for the assistance @quasi geode appreciated.
Congrats, that looked like a headache, I took a few minutes glancing at it earlier. @cunning kestrel
Hehe thanks, Im a dev/tester by profession, but without the full code/debug, some of these things just dont make sense xD
question: what happens when 2 files require override/extend the same class.methode ?
If they both override the same class.method, the last definition loaded will persist.
If they both extend the same class.method via decoration, the decorations will play out in order.
hi guys, im new in modding pz, how can i debug items when i change a property in .txt whitout restart game ?
i know animSets have hotreload basicly. so if it doesnt, you might be out of luck (others may provide a better answer, havent played with items yet)
So I just tested this. and both seem to run Somehow ๐
require "TimedActions/ISFitnessAction"
function ISFitnessAction:stop()
print("stop")
FWOEndOfAction(self);
default_stop(self)
end
require "TimedActions/ISFitnessAction"
function ISFitnessAction:stop()
print("stop life")
currentExercise = nil
default_stop(self)
self.character:setVariable("ExerciseEnded", true);
end
explain this magic
howdy, i was curious if anyone knows how to add a starter inventory to a base game backround? im trying to implement something i made without having to use profession framework for the thing to be used. the wierd bit is it works with the framework, and thus could/should work with base game if converted, bit i have no clue how to convert it to not need the framework.
has anyone had any experience or info on such?
Maybe the object gets defined at different points in the game's execution @cunning kestrel
ok, thx
I suspect if you tried to create a new ISFitnessAction from the debug console and then stopped it, only 1 of those versions would be visible from debug console
AFAIK it's impossible for both to be accessed through the same function call; you would have to do something like add both versions to an event and trigger the event to trigger both versions in a single command.
If the tests are being called from 2 different files, that would explain things a bit. The first file is relying on a prior definition.
@cunning kestrel
those are my thoughts aswel but its a single action that started the call though ...
this is the current code i have, it uses the professions framework thing, but i have no clue how to get it to not need that dependency. aka, im trying to, in this case/example, convert the unemployed backround to start with the skills/gear as seen in this
you'd have to reverse engineer the framework im afraid ....
darn. even if i was going to convert/overwrite the base game proffession instead of putting a new one in?
i had thought that something like uihotbar or whatever would let me add a holster with a gun, like what some guy named ras did, but other than that, i had/have no clue what to do to get a filled medkit ect
and yes, i have been looking at other peoples code to learn from. it seems in theory doable, aka, changing base game starts, but the issue i have is inventory based, ect
the idea im having is to replace police start with a better inventory/skills for it
i assume if i added a new thing, the framework would need to be reverse engineered ect
overriding shouldn't be necessary that being said, havent dug into that aspect yet so...
so like a spawn kit linked to a trait ?
no, its supposed to be linked to the backround, such as, hypothtically, security officer starts with a gun, or police officer too, or doctor with a customized medical kit, ect
if trait would be needed to get it to do that, i might try that later on
oh yeah yeah i ment background profession. yes .
for the example from learning, here is what i found with a thing called raz's proffessions, aka, the hotbar concept. in this example, he took a base game thing, and added a holster thats got a gun, so i wasassuming its a viable idea.
so far im trying to figure out how to add to a current backround, not add a new one like before
since it seems in theory simpler
i mean a start kit exists so cant be that insane to link into that ...
i hope so
however, im curious, how would i do such a thing? does anyone have any idea on how to even code it? or such. i have no clue where to start
i know the base game starter kit is for all backrounds
im trying to make one thats for a single backround, and possibly change them all later
" Profession=" .. player:getDescriptor():getProfession()
i have toyed with that concept though pretty sure it would cause world dictionary problems if you had server side items
simply creating them on file execution might be fine but still not sure
Could mirror it via server commands.
what would that do?
issue with that is the item could only be created on the first tick since thats when commands are first usable
at that point youd already have mismatched world dictionaries
as for generating on execution iirc scripts are loaded first so it all depends when the dictionary check is performed
For anyone with sub-mods related to EHE the update is public now. I think this only applies to @pulsar heath and @fiery pecan.
Worth mentioning Twitch Integration works in MP now, and the instability and 'sounds getting stuck' in MP issue should be addressed.
ok, will update my mod if needed ๐ thx for the heads up @sour island
Ayy nice I have that mod.
EatType = ForbiddenFruit
I genuinely didn't know that this was categorized as food. Holy heck.
Hey guys, for some reason this code in my mod causes for the health panel to open, not sure why
local function maxSkills()
local player = getPlayer()
for i=0, PerkFactory.PerkList:size() -1 do
local perk = PerkFactory.PerkList:get(i)
player:level0(perk)
player:getXp():setXPToLevel(perk, 0)
for x = 1, 10 do
player:LevelPerk(perk)
end
end
end
Events.OnCreatePlayer.Add(maxSkills)```
How exactly do you know?
(The results of that exact function seem like they would be hard to determine)
(in game)
(since you can't call it directly and I believe it gets called before you press start)
Hmm concern. I think the field alcoholic is assigned by ComboItem's alcohol property and FoodItem's alcoholic property.
Going to split these definitions for their item category but can be a problem in PZ's script engine.
@gusty wharf You should post your whole file. I'm not sure that chunk explains it
That's the whole mod at the moment. I'm trying to code learn all recipes in a separate lua file and I deleted it to see if it caused it and it didn't
is it actually necessary to call both level0 and setXPToLevel?
Kinda. I tried without one of them and you could unlock the occupation skills by clicking on them.
by clicking on them?
that just sounds like the skills screen UI needs to refresh, not that clicking on it is actually doing anything
hm, or you discovered some dormant, unused functionality
in any case though, there is a debug screen for levelling up skills - I'd just do whatever that button does
I'm doing a sanity check on that code, I don't see any good reason it should do that at a glance. I'm about to run it.
@gusty wharf One note here setLevel doesnt provide "exp" any other system that looks at xp gain will not function of of it
You mean LevelPerk? I did not use setLevel
actually, there's setPerkLevelDebug - that will allow you to skip straight to whatever you want
I remember trying to use it, it only worked sometimes
im mainly refering to the debug screen. see de code behide that the level up button does not acctually provide EXP. compared to the add EXP option
only worked sometimes?
how to make checking simple script ?
like check if on vehicle is attached expl front bumper or hood etc
then allow to attach some different addon
by writing code
@gusty wharf Your code works and Idk what's opening health panel, but not that.
yeah but im not lua thing
I think it only worked on skills that already had at least one level unlocked
that sounds... odd
Well, then not sure. I'll try to solve it somehow
Clearly another mod you have running is triggering health panel to open
And it's not one of the 300+ I have running.
if you're writing any mod and you've turned on stuff that isn't going to be a dependency for what you're creating, you're making a horrible mistake.
I only have my other no points to spend limit mod (basically edited base game .lua file), that unfinished learn all recipes mod and mod manager. Maybe that learn all recipes thing didn't reload and still causes some errors not sure
I'll restart the game
wait, you've been changing the code and just reloading the file?
doesn't that work? It seemed to work every time I did it
it depends entirely on how your code is written
in your case, you should not do that
the reload feature is actually a "re-execute this file"
whatever happened to the lua state from the previous time it executed will remain
so, any events that are hooked up, for example, will still be running, too
Alright I'll remember this
quitting to the main menu is sufficient for ensuring a fresh load of all lua
the only time it makes semantic sense to use reload is if your code takes care of cleaning out any pre-existing hooks or if it simply redefines a function without storing the old version (or, again, you have code explicitly written to detect that you're re-executing)
@gusty wharf In your specific example, if you want to experiment with reloading your file live, you need to make your function global for testing purposes like so:
JxP = {}
function JxP.maxSkills()
local player = getPlayer()
for i=0, PerkFactory.PerkList:size() -1 do
local perk = PerkFactory.PerkList:get(i)
player:level0(perk)
player:getXp():setXPToLevel(perk, 0)
for x = 1, 10 do
player:LevelPerk(perk)
end
end
end
And then use the debug console to call JxP.maxSkills() after reloading to see what it does.
(JxP table not required but modules like that are good practice imo)
I usually separate it into a loader file and the main payload
then you don't need a global
(your payload file can return the function)
but for anything related to overriding game functions, which tends to be the bulk of what I do, I quit to menu, it avoids a whole class of bugs you can end up creating for yourself by trying to rely on reload
That works, but one advantage to using global modules for testing is that you can individually swap out virtually any function on the command line in a quick copy-paste. For me, it's a faster way to experiment.
Because ultimately when I write a new version of a function I am in VS Code, not in game.
I see. My EHE submods have been pretty dead for a while now though.....
So I enter the game with the function ready to go... if I can just copy it, and paste it in debug when I return to game, it's slightly faster than opening F11 to do it
(Unless it's added to an event and you're testing its behavior on the event, but even then reloading it is easier because you can just copy-paste the new event into your terminal like so:)
Events.OnStuff.Remove(oldGlobal)
oldGlobal = function()
-- Boom
end
Events.OnStuff.Add(oldGlobal)
You can drop this little snippet in debug console and try various functions on the event you're testing quickly.
shrug
to each their own of course
Hmm. Does the table do a thing? I'd only learned some Python before trying Lua in Zomboid so I don't really know much stuff about coding, especially mods .
(But the above trick won't work if oldGlobal is local because Remove won't remove the right function if the function isn't accessible from debug.)
Advantages to using a module (the table above) are that you can trivially make everything global for easy testing and then localize your module when your mod is ready to go, and furthermore you can return your module for everyone else to use in the future
the table is just a table that happens to be addressable from the global scope, the language doesn't care
It's much easier to make your module local or global at the top of your code if EVERYTHING is in your module than it is to manually go through your module making local things global for fast testing, so I just do it that way for my own sanity and speed of development
@gusty wharf
If I have 20 functions and they're all in my main module, I can instantly make them all global or all local by editing 1 line.
shrug
minimise what is global, if you can expose stuff through a return then you minimise the chance of any sort of pollution
...or people doing stupid things to your mod from their mod
Right, ultimately, turning your stuff into local at the end is recommended practice for anything that doesn't need to be global (such as overrides of vanilla things that are global already)
But a module will make that easy to do
Well then theres no other way . Olipro is right . Write the codes to do those checks
i am so proud
people actively encouraging and teaching modules
only took me a year to get the point across ๐ฅฒ
Teach me senpai browser
a true module would be across a setfenv boundary, it's just a global-scope table, don't get too ahead of yourself ๐
I'm more like "Do it.. or else.."
I'm almost done implementing item properties for ZedScript.
What is that exactly?
ZedScript is a placeholder name for the format of txt files in media/scripts/
I probably won't publish my parser on npmjs until an official name is announced for the format.
What is it that you are making exactly?
A parser and library for ZedScript.
My personal goal? Write software that uses UI to modify, create, and template definitions for ZedScript.
Hey isnโt that cool
So basically a UI to create recipes, items, etc
To facilitate the process instead of using raw JSON right?
Yes. The JSON is a medium.
It's there for anyone who wants to use it for their own purposes.
(Both the AST JSON and the simplified JSON)
I would personally use it, if it does not have any limitations or implications ofc
Sounds like a good tool to have!
Hey, I'm trying to do learn all recipes mod, wondering if I'm doing it correctly (it's kinda similar to the max skills thing)
function allRecipes()
local player = getPlayer()
for i=0, getAllRecipe():size() -1 do
local everyRecipe = getAllRecipe():get(i)
player:getKnownRecipes(everyRecipe)
Events.OnCreatePlayer.Add(allRecipes)```
Are there any things I did wrong and should add/change? It doesn't seem to work and I have no idea what to add
getKnownRecipes returns a list of recipes, it doesn't add the recipes you give it
You can use #getAllRecipe() instead of :size() I think
The โ#โ symbol returns a lists size
you're missing some ends, it would be better to pull the list into the local space instead of grabbing it from java every time, the function is getAllRecipes() not getAllRecipe(), and that returns recipe objects whereas the player's recipe list wants string names
Oh that is interesting
it's a java list, so we can't use # on it
Huh.. so UseWhileEquipped is a generic item property... however Drainable items has UseWhileUnequipped.
Only one Drainable uses this property.
i'm guessing something closer to this would work:
function allRecipes()
local player = getPlayer()
local knownRecipes = player:getKnownRecipes() -- see below
local recipes = getAllRecipes() -- saves the recipe list into a local variable, otherwise we have to access it every loop, and accessing java is very slow
for i=0, recipes:size()-1 do
local recipe = recipes:get(i)
knownRecipes.add(recipe:getOriginalname())
end
end
Events.OnCreatePlayer.Add(allRecipes)
Hey that sounds more like it
Oh so indexing through Java lists is zero indexed
I thought it would be 1 indexed too
something to note is that OnCreatePlayer passes the player object created; if you tweaked the function declaration to be like thislua function allRecipes(_index, player) and removed the local player = getPlayer() line, the code would look a bit nicer and it would work in splitscreen (which is not really a priority LOL but it's nice)
Since we are in lua
the api doesn't have anything nice like that really
Hey albion whatโs your experience background, you seem to know what you are doing
i've just been modding since the start of last year
Noice
i've seen other games lets you use 1 indexed for the main language in lua, as well as letting you loop through their structures using pairs and stuff, and generally just letting you use lua syntax for the game's core language objects when possible, but kahlua doesn't really have anything like that so we're stuck with calling java functions and playing by java rules
Yeah I noticed
We are basically getting Java objects with specific metatables right?
Iโve noticed that some methods return userdata and others do return Java objects
Doesn't work for some reason
do you get an error?
Yeah
What is it exactly
this opened up
Open the error console and show us the log pls, we might be able to get useful info
Do you know about konijimaโs environment creation method?
With it, you can check all of the gameโs source code in a single place
=(
knownRecipes.add(recipe:getOriginalname()) should probably be knownRecipes:add(recipe:getOriginalname())
use : not .
I told Konijima that I'd update one of his libraries.. I still haven't.
I'm a horrible friend.
Lol
Who is he exactly
He was a central figure here as a modder.
He initated the community api proj. Made guides for alot of stuff including how setup environment and how to decompile java.
He also made lots of templates for new modders to use
Mostly lua stuff
Scripts are txt
Now it works, thanks
Have you atleast read the vanilla? Thats all you need to get you started
Also check the guides on the thread
He doesnt have a weapon mod. Thats a diffrent line of modding . He works more of the backbone side
is there a way to convert local mouse coordinates to global ones?
got it, just use OnObjectLeftMouseButtonDown
@bronze yoke @fast galleon Hey, I finished making the mod and since you both helped me and gave me some code, could I post the mod on the workshop?
Just finished items parsing for ZedScript.
This is every item in PZ vanilla with all properties.
sure!
@tame mulch Here's my separation of properties for item types: https://github.com/asledgehammer/ZedScriptParser/tree/main/src/api/item
(Pre-documentation)
The largest hurdle of this parser project is items and now that's done besides improvements & fixes.
did u try go to the ProjectZomboid/media/scripts folder? might be helpful if you haven't
there is a weapons file in there
actually a whole folder iirc, with all the weapon scripts and sounds
I'll need someone or myself to comb through and double-check all item properties in the parser when time is had.
Once the parser is done I can move onto writing a exporter.
Then the GUI app.
=)
-- Food Diseases
MHD = {}
MHD.ISInventoryPaneContextMenu = {}
MHD.ISInventoryPaneContextMenu.onEatItems = ISInventoryPaneContextMenu.onEatItems
ISInventoryPaneContextMenu.onEatItems = function(items, percentage, playerIndex)
print("Starting to eat...")
----
local playerObj = getSpecificPlayer(playerIndex)
playerObj:Say("Itadakimasu!")
----
print("Items check...")
if items then
print("Done!")
else
print("Failed!")
end
print("Food check...")
if instanceof(items[1], "Food") then
print("Done!")
else
print("Failed!")
end
----
if items and instanceof(items[1], "Food") then
local player = getSpecificPlayer(playerIndex)
local currentUnhappiness = player:getBodyDamage():getUnhappynessLevel()
player:getBodyDamage():setUnhappynessLevel(math.max(currentUnhappiness - 3, 0))
player:Say("???")
end
-- default eat function
MHD.ISInventoryPaneContextMenu.onEatItems(items, percentage, playerIndex)
end
return MHD
What am I missing here?
Where is he now
check the original function and u will see what you missed
Busy IRL.
Ah sad
All modders eventually grow up :(
And modding is non profit
Usually, at least
I used to mod 24/7 when I was younger as well
Now I do it to practice certain languages to get a job
Thank you i got it ๐
I'm still a kid then.
I could finish my JSON parser today if I put more time into it.
That is odd
btw I wrote in wrong channel, this should be in #mod_support
Iโm thinking maybe integer overflow?
Investigate about it @small quail, you might be able to get some answers
Hey guys, sorry for dropping in the middle of your convo but, I've been checking a lot of different mods but I can't seem to find anything related to specific zombie amount and what type of zombie various small buildings/Area's should have/include with custom behavior such as sprinters defending gunstores or Louisville Prison and Police station, I had a question regarding this - is this thing even feasible modding wise to create? I have no prior Lua scripting experience but I'm considering to learn to make something I feel is missing in the modding community.
Hey that sounds like a good modding concept
Im not sure if zed spawn locations can be modified like that
But perhaps reverse engineering how the sandbox option โzombie populationโ works might give us some info
Zombie population has 2 options
Uniform or urban if Iโm not mistaken
Maybe Iโm getting the option name wrong, but it was something similar
The fact that this option exists means that the game has a way to control zed population
I think there's a mod that makes it so you can set the percent of a zombie variants spawn chances. I think it's called "Customizable Zombies" and you could take a look at its code because it kinda does a bit similar thing.
The only thing I did find was pretty much this for definitions to spaces; https://pzwiki.net/wiki/Room_definitions
Will check it out!
Yeah that mod definitely has some info
If making a mod like that from the ground up would be too hard for you, you can try modifying that mod, but if you want to upload/distribute it somewhere you need to ask the original creator for permission.
I see, thank you.
Does anyone know where the 2D images or icons of items in the inventory are located?
I think I do, have you checked the \steamapps\common\ProjectZomboid\media folder?
Lemme see if I can narrow it down and find it
They might be compiled into a .pack file
I'll get the ones I want from the wiki then, thanks though
i'm running into a really weird issue atm. for south and east facing world sprites when i and slightly off the sprite model. i still get the regular context menu options that i would get if if it were unmodded by lua.
example screenshot when i right click just to the left of the world sprite
it should look like this, and when i click on the sprite itself it works normally. not sure why it's giving me az context menu option from a range around the south and east facing sprites
same sprite same location same everything, the only difference is when i click just slightly off the sprite on only south and east facing sprites... i get what would be the non modded context menu
Use vanilla
Refer to vanilla
oh them haha ๐
im trying to make my clothing mod spongies open jackets compatable, can anyone help me?
His doing fiveM stuff now
You might want to try #modeling
Is that a project?
so trying to make a clothing mod compatable with spongies open jackets is now modeling?
im not modeling anything and i am bad at blender
Skill issue ๐คทโโ๏ธ
your statement does not help
Just try though, you can get better
Oh I was just giving you a hard time, sorry if it was mean
what you said was practically destructive critisism
Oh no donโt take it that way
What I mean is, we are all bad at everything at some point
If you have the time and will, practice some modeling!
i came here for information on how to make any generic clothing mod compatable with spongies clothing
this is not modeling ๐
Gta v modding
Oh wonderful
Looks like modeling to me
I mean, itโs just the xml configuration of your model
what do you know about modeling
Ye i agree.. we try to our best to improve our knowledge and skill
And seeking help from other is part it if we choose to grow along side other people.
And most challenges are always based on lack of knowledge and which is why we ask for help.
Anyways how did open jacket thing work exactly i havent seen the mod
I know it but havent checked the code
my point has been proven, now i need help with what i am trying to do, can anyone help?
Without looking at the code maybe its just 2 clothing type that uses oncreate recipe to swap the first one to the second mode
Just aslong as you send the condition and the holes and everything to the second clothing cuz basicallly hou delete the first oen and replace
Thats an idea but not saying thats what he did on his mod
But this is what i did for the bag hider mod
i took nightscales rick grimes sheriff outfit and recolored it the way i like it, but i need know or figure out how to make it compatable with spongies open jackets
Ehhhh ammm
Did you ask permission tho?
of course i asked
he said yeah because he doesnt have the time to edit the outfit and what not, so i took it in my own hands and did it for myself because if its one thing ive learned is that you have to do it yourself because nobody else will do it for you
I think the list of vanilla params are here
From the top again. U want that mod tl be compatible or similar to different mod right or is it the same mod?
In any case have you checked out how they did it?
rick grimes sheriff uniform (not the diahhreah green kind)
i want to be able to tuck in and tuck out the sheriff pants and open and close the jacket
Only the uniform?
yes
Alright so you could subscribe to the lua event OnFillInventoryContextMenu
It is an event that is called whenever you right click an item in your inventory
And if the item you clicked is the jacket, you can add an option to close it or open it
And ofc change the jacket model correspondingly
Nice
Oooh wonderful
Do an extra checks for the faces
Maybe its how you filtered the context menu
What exactly did you use to determine its a light switch,?
Do you know lua?
i dont know how to program lua
Oh okay
Hmm its an outer clothing piece and not tuck in i think
So just remove it?
i am good at gimp though, i can retexture stuff but thats about it
for _,v in ipairs(worldobjects) do
local square = v:getSquare()
if square and sq == nil then
sq = square
end
local sprLight = v:getSprite()
local sprSwitch = sprLight:getProperties():Val("CustomName") == "Switch"
if not sprSwitch then return end
how would i do this
Try to add the flags for the faces
Just unequip it
i have severe ocd when colors are supposed to match
the pants being darker than the hat under the light but it seems perfect under no light
Yeah it was obvious .. but no shame in that esp if it makes you do productive things
i guess so, what i am doing is productive
but the fact that i dont know where to start is the real problem
with at least trying to add the ability to open and close the jacket as well as tucking in and tucking out the trousers
Yeah if you enjoy it you might try and make an entire clothing mod from scratch
@drifting ore learning lua would be an excellent first step
i do enjoy it, but my problem is that i dont know where to begin
how 2 do this
Lua is a very very simple language
Well you got the internet, you can check out documentation
Search for YouTube tutorials
Read the official lua website
Check out a website called lua cheatsheet
Anyways you are giving almost no info for me to help out. Idk how to help. Try first to learn how the xml works . Tinkering it for starters to see what params are important
specifically for project zomboid? or will it be just a random game with totally different lua and me accidentally copying that into project zomboid thinking its going to work
nightscale said you have to have randomly generated GUID's
https://guidgenerator.com/
Heres the guid generator
Free Online GUID/UUID Generator
Just check the hypen
When mever you see a guid
Its suppose to be unoque
Ok then good
but i dont understand what a guid does
Mmmm
Think of it as a unique identifier
what is it supposed to do? what does it mean? these are the things i need to know to successfully create a mod
so i randomly generate a guid and then add it to
Reason for this is clothes are named mmmmm generic ish
but you are talking to a level 0 complete noob
So theres definitely lot of room for conflict
The guid prevents that
thank god i did roblox studio it let me start pz modding easily bc both use lua
Hi again fajdek how r u
@drifting ore send me a DM, Iโll show you where to get started
Oh nicer
i feel good bc those gym goer abusers from more traits r gonna get a nerf soon and i already feel the comments incoming ๐
Have you check to see what conflicts your mod from sapphs mod? The thing i asked you before.
Pls and thank you
ok
I forgot ...
Ill check the screenshot
My parsed uber JSON is now 80K lines lol
Oh heck. Recipe defs are wild.
I think that I'm going to skip those for now. xD
The syntax for recipes is very different from everything else in ZedScript.
wait til you get to vehicle scripts lol
If you've seen my commits.. You know I'm heading there haha
i havent. but i've done the whole script parser thing (in python though)
Going to modify my AST parser to have an expression to compile all destroys, etc. into one array.
My AST JSON is a way to remove all the crazy from the script so I can walk through the JSON instead of the raw text to fully parse.
Recipes broken but here's my current uber JSON:
Hey guys, is a mod that basically just modifies the base game files allowed? In this case it's a mod that disables the trait point limit.
Yes, there are quite a few mods that do that. If by modifies you mean overwrites a base game file (by including a file with the same path & name) with a copy of it with modifications, though, I urge you to think about whether there's a way to do it without doing so
Overriding only the functions you need > doing that. It's less prone to breaking between versions, and if it does break it should be simpler to fix
How would I only change a part of it?
I'm unfamiliar with the file you're referencing, but I'll provide a hypothetical example. Let's say there's an ISWhatever with behavior you want to modify. In particular, you want to change the ISWhatever.doThing function to do something slightly different. Instead of overwriting the entire file, you could do something like:
-- a reference to the existing doThing, if you need to call it in your override
local _doThing = ISWhatever.doThing
function ISWhatever.doThing()
-- overridden behavior here
end
I neglected to reply, @gusty wharf
Thanks
still happening.. i just dont get it
so weird man. driving me batty
can't release like this lol
hmmm might go back to the tiles themselves and look. i'm stumped though
actually there must be another condition i need to cover gonna look around vanilla. any suggestions are welcome, if you know the best way for me to detect the sprite on the wall. there is 8 diff sprites i'm doing by custom name, and direction offset atm.
local sq
for _, v in ipairs(worldobjects) do
local square = v:getSquare()
if square and sq == nil then
sq = square
end
local sprProp = v:getSprite():getProperties()
local sprDirs = {"Noffset", "Soffset", "Woffset", "Eoffset"}
for _, sprDir in ipairs(sprDirs) do
if sprProp:Is(sprDir) ~= nil then
local sprSwitch = sprProp:Val("CustomName") == "Switch"
if not sprSwitch then return end
it's detecting them. but only when the tiles are facing south or east it allows you just just click on the outside of the tile and obtain a completely different context menu but for the exact same tile. if i rclick directly on the tile object itself, it performs as expected
example screenshots. you can always tell my context menus because they have icons attached to them
#mod_development message
yea i can literally click anywhere on the entire square anyywhere. it must be another condition im missing
clicking by floor
Heh
It's literally an Uber compilation of all pz ZedScript
well all vanilla scripts are still 1.83mb
im having a bit of trouble with my mod can anyone help
I deconstruct to arrays and what
i guess some websites have larger payloads than that
Definitely not for the web lol
I wrote the parser so I can write a electron app for ZedScript
--higher level books worth more procedurally
elseif(thecat == "SkillBook") then
local bookPriceBase = 5.00;
-- struggling to grab the decimal from the name???
local bookLevel = string.match(itemName, "%d"); --little trickery to grab the number
if (bookLevel ~= null) then
print("bookName: " .. itemName ..", parsed #: " .. bookLevel );
bookLevel = tonumber(bookLevel);
newprice = bookPriceBase*bookLevel;
else newprice = bookPriceBase; end;
--]]
why is newprice always 0 ? my debug print shows i'm correctly parsing the booklevel from the string
disregard. got it figured out ๐
help plzif getActivatedMods():contains("ItemTweakerAPIExtraClothingAddon") then
require("ItemTweaker_ExtraClothingOptions");
else return end
local function ModifyParamsFromOriginalItem(originalItemName, newItemName, resistanceModifier)
local originalItem = ScriptManager.instance:getItem(originalItemName);
local newItem = ScriptManager.instance:getItem(newItemName);
if ((not originalItem) or (not newItem)) then return end;
if resistanceModifier then
-- modify resistance
TweakItem(newItemName, "Insulation", originalItem:getInsulation()*resistanceModifier);
TweakItem(newItemName, "WindResistance", originalItem:getWindresist()*resistanceModifier);
TweakItem(newItemName, "WaterResistance", originalItem:getWaterresist()*resistanceModifier);
end;
end
--Automates the adding of context menus
local function AddNewExtraItem(originalItem, newItem, originalContextMenu, newContextMenu, resistanceModifier)
ItemTweaker.AddOrReplaceClothingOption(originalItem, newItem, newContextMenu);
ItemTweaker.AddOrReplaceClothingOption(newItem, originalItem, originalContextMenu);
TweakItem(originalItem, "clothingExtraSubmenu", originalContextMenu);
TweakItem(newItem, "clothingExtraSubmenu", newContextMenu);
ModifyParamsFromOriginalItem(originalItem, newItem, resistanceModifier);
end
function Add4WayExtraItem(item1, item2, item3, item4, context1, context2, context3, context4, resistanceModifier)
AddNewExtraItem(item1, item2, context1, context2);
AddNewExtraItem(item2, item3, context2, context3, resistanceModifier);
AddNewExtraItem(item1, item4, context1, context4, resistanceModifier);
AddNewExtraItem(item2, item4, context2, context4);
AddNewExtraItem(item1, item3, context1, context3);
AddNewExtraItem(item4, item3, context4, context3);
end
-- trousers tucked
AddNewExtraItem("Trousers", "Trousers_Police_SheriffTUCK", "TuckOut", "TuckIn", 1);
^ surround your post with -triple ` to turn it into a codeblock
Does a trait still retain its features even if you change its name in MainCreationMethods.lua?
for example from
TraitFactory.addTrait("Cook2", getText("UI_trait_Cook"), 4, getText("UI_trait_Cook2Desc"), false);
to
TraitFactory.addTrait("Cook2", getText("UI_trait_Cook2"), 4, getText("UI_trait_Cook2Desc"), false);
I'm trying to experiment with the seemingly unused ones
and make them able to be chosen
even if it presumably does the same thing
Fuck me, I didn't camelCase newPrice and created a new variable
btw as I remember there's :getLevelSkillTrained() func for skill book item to get his level instead string.match(itemName, "%d")
I avoid using the built in functions because the documentation for them is bad -
I just spent an hour debugging inventoryItem:getHaveBeenRepaired() because I expected an unrepaired item to return 0, but it returns 1
you can't not use them lol 
Hey everyone. I'm a 3D artist and I want to do stuff. Anyone needs help? I can do 3D modeling and animation
Do you know any advanced bone rebinding trickery? In this game, when we animate, we need to manually move and rotate the things in our hands because the objects held by our hands are bound to our pelvis.
Hopefully you can imagine the consequences of that.
sometimes these hips do lie ๐
If we could rebind prop bones to our hands, create an animation, and then rebind the prop bones back to our pelvis, is there some fancy way to leave the movement data alone on that final step, such that the movement is based on the hand position but the bone remains technically attached to the pelvis on export for compatibility?
Actually I do have ideas to solve that, even without being able to reparent the bones
Really? @dark wedge and @ancient grail and I would love to know. We have been manually moving and rotating hand items and it is hell.
I have to work in a few minutes but if you don't mind DMing me I might try to get you in a group chat about this
Just, like, make a new object (like a Empty), add a constraint to follow the hand, and add a constraint on the weapon bone to follow the empty? Something like that should work shouldn't it?
I am not an animator. I have only recently learned to animate for this game. I am not an expert in playing with the settings of an animation and having things come out right. Also, the only software in which most of us know how to edit and export .X files is fragMOTION (and the game's vanilla animations are mostly .X files).
Which is not exactly the most brilliant software I've ever seen
Maybe it has that ability but I wouldn't be surprised if a lot of advanced tools are missing
Blender probably has some addons that make it possible to export the .X format
There's one that allows to import it
If you can link, please do. The tools I've seen did not appear up to date.
If I could properly import and export the .X files using Blender, finding tutorials to do other things would be infinitely easier
I found an exporter but it's for Blender 2.8
I'm under the impression you can actually not have to work with those curses .X files. A friend of mine is working with .fbx animations, said it works. Maybe .X is old code from before a rework?!
I have a somewhat different suggestion. Maybe try exporting in Blender to a format that both fragMOTION and Blender support, then import it to fragMOTION and export it to .X . I think I did some stuff like that a couple times and it worked. Not really sure if it'll work with this but there's a chance it will
Yeah I heard Zomboid's migrating to .fbx
people are also saying that it's better to use .fbx than .X
if making something
I mean .fbx animations DO work but the vanilla animations are all .X, so we need to import them at least... Or manually redesign poses, which generally doesn't lead to perfect matches for me.
If you do import the .X file, you will have to work with that skeleton, though. Which for me was a nightmare
I guess if there is another way to handle the props well in Blender maybe it would be worth it. Approximating an initial pose once would probably be easier than what I've been doing to move props around.
What software did the devs use for these animations?
By the way seems like the Blender addon can't import animation .X files .
fragMotion does not have support for this that I can find. Blender would be easy af with modifiers.
All the .x tools for Blender are either really old, or just don't handle .X animations correctly, unfortunately
What do you mean? You are animating on fragMotion?
Have to when your making a change to a vanilla animation. It's the only thing that can read/write .X animations properly
Making my own from scratch, then sure Blender and fbx is the way to go
I see
How about exporting it to something Blender can read? Doesn't it work?
I did have a lot of issues and didn't manage yet to export anything to the game. All those conversions and stuff, and also I'm not a coding guy so I don't even know how I would test if it works
There is a guide in the #modeling pins about importing the animation into blender by converting it into Half-Life source model data, but then the export from blender is always wrong for me among a bunch of other stuff with that method during the workflow. Maybe it's just me, but I couldn't get good results from that
from all of these formats supported by Blender only .bvh is in fragMOTION, and yet importing the running animation into Blender will give a 3200 frames long animation for some reason
so still broken
.smd works
but without animation at least for me
All of the animations are of that scale. The .X has them at 4800 FPS
Crazy. I hope they'll fully migrate to .fbx by the time b42 is released because the .X is some old dark magic
This is just in case you want to get the default vanilla animation as base for something new, right?
So, you don't need to convert it back to .X after your changes
I mean, that part of the process you guys must know much better than me
Possibly not, but I don't know anyone who has posted any reliable technique for converting .X to .fbx in Blender and then getting that fbx into the game
You can export as fbx if you're working in Blender.
No need to go back to .X I would think
Yeah, I can't say much
All I know is Blender stuff
I have both .fbx and .X characters here, but as I said, I didn't manage to make a mod that puts my stuff back in the game
That's why I'm here, I offer help in the animation process, you guys do the script ๐
OMFG I Did just read the thursdoid news and theywill be adding OnZombieCreate ๐ป
technically, its already done. but you cant play with it til 42 ๐
It's good enough knowing I will get it at some point. It's even better cause it mean I can do other stuff before b42 instead of making 10 mods per week lol.
And the onchunkloaded event will make it so easier for me to implement the airstrike mod. Good times
i really need to put some more work into that thing & get it up to date at least
Taking a look at the code moreso.
So each line is a source instance and should be handled separately.
But all sources are options.
one of each required to satisfy the requirements.
I think I have it now.
My job right now is modernizing an ASP website and documenting.
xD Same energy.
ah, point of note for your parser (something i remembered looking at my python version)
dealing with recipes # NOTE ALL THESE KEYS ARE ACTUALLY CASE_SENSITIVE
is there a way to fix this. I cant seem to figure it out. lol
I expected this.
There's very wild parse code.
Some code doesn't even trim-check for whitespace. =/
All my json tags use camelCase. They can be transformed back to whatever when exported back to the original txt format.
Will b42's take on ZedScript do non-case-sensitive checks on all tags?
it will if i remember to fix that lol (i'm going to have to make a note) its all very inconsistent.
I won't be that guy.. but
Yeah I really hope you do.
Rooting for ya on that task.
Life is easier when checking a lower-cased string
=)
Also don't worry, I already expect to do major refactoring when 42's code is live.
easy enough fix. and should be done since the inconsistency can lead to pointless and inaccurate bug reports. but i'm done for the day so it gets to go on the todo list XD
As long as it's on the radar.
its been on my radar for uh...3 years now at least ๐คฃ
I'll work with you if the need arises. Again the app I'm working toward will be to help people with working on ZedScripts without dealing without these silly technicalities.
It's been on my TODO list for 9 months now.
It's worth it.
lol ya.. the inconsistency is real. just relooked at the recipe parser. apparently the case-sensitive comment only applies to some of the properties. some of them are case insensitive ๐คจ
Yup.
This applies to general item properties too.
Some string values are trimmed while others aren't.
Leads to whitespace issues if not careful.
pretty sure Item.class converts it all to lower before checking but i'd have to relook
mmmmm Not in the load method.
var 3 and var 4 aren't checked the same throughout.
DoParam
@quasi geode Do y'all have an official policy about player playerIndex playerNum character playerObj usage out of curiosity? Is there a direction in which those practices are consciously moving? Just curious because if such a standard were being adopted I would want to start preparing my code appropriately...
ah nope it doesnt go lower case (looking at DoParam)
Yeah. I didn't use the code as a reference for basic params. I wrote a customProperty sub-object for each category and weeded out the options that way.
Used switch tables with shadowed super calls to basically the equivalent of a DoParam setup..
seems unlikely, given the lack of uniformity in that area atm, and no official direction (least that i've been informed of)
personally i'd clearly define a difference, but i dont think theres any plan to go through and fix the old var names
I'm all for the revoluti- I mean breaking compatability for mods by cleaning up the API.
After 10 years of buildup, it's time.
People'll be mad either way.
Understandable, I was only wondering. I suspect I am not alone in the occasional headache manually figuring out whether player is actually a player or just an index.
pretty sure we're going to break a pile of mods anyways (always seems to be the case), especially due to a number of the changes / new features
Well good luck to us all
export type RecipeAction = 'destroy' | 'keep';
export type RecipeConstructor = {
sources: RecipeSourceExpression[];
body: AssignmentStatement[];
};
export type RecipeSourceExpression = {
items: string[];
action: RecipeAction;
};
Im expecting my magnet fishing mod to break when B42 comes out but I'm not the slightest bit upset.
Just means I can have fun integrating it into an even more fleshed out fishing system.
yep i'm sure any fishing mod is going to break lol, its quite the change there. havent had time to play with the new system myself but looks neat
Haha I just hope that any UIs updated either add their own gamepad support or don't break mine but I know what my hope is worth historically
And it's not a lot lol (in life not @ Zomboid, I'm new here)
no idea on that one, UI = not my area
Fair enough
``
--code
``
Pls do this whenever u post codes
You can divide it into multiple post if ot doesnt fit.
I believe eszeikial told you this
We are not ChatGPT 
๐ฏ
Like a null object group?
Anyways to use autodesk maya?
I will get to this tomorrow
Is there a way to zoom in and out the keyframe timelines. I hate scrubbing that far. And is there an external way to make fragmotion darkmode?! 
Will the game allow zeds to keep moddata now? Or something that would make zed modding easier?
nothing new on that front i dont think, but not entirely sure
Ow ok thnx ..
Parsing recipes in AST now.
Not that I know of on both of those. fragMotion is just 
๐ฎโ๐จ
I wish there was an easier way to extract x file animations
Anyone knows how to check of a square is part of a safehouse
Anyone has a snippet or idea where rhis is written
does anyone know a way to keep the position between animations in sync?
it's an timed action disguising itself as an emote, with an initial starting anim + looping anim.
Is there a bone that is responsible for indicating actual player position or something
Recipes might have me rewrite my initial parser code.
The syntax is so wacky.
I split up = which messes up with recipe sources.
Really wanted to finish my parser today. =(
I'm having the darndest time trying to figure out how to create a container that only accepts certain items. I've tried to look up the code for the clothing rack in the vanilla game because I heard it only accepts clothing - but I am unable to find it. Any suggestions would be appreciated
OnChunkLoaded???
- drools -
So I won't have to run a function as frequently as GridLoaded...

Oh wow, and ZedCreated too..
I swear, all y'all devs are catering right to what I'm looking for >.>
Yes in Blender there is a translation bip, you need to clear all movement of that bip
Or you'll slide around
iirc, I think when I retargeted the animation I didn't retarget the translation bip
so it stays in place during anim
I believe the loop falling animation isn't also off-center if that is related
Afaik, if you created the loop animation using the end of the original animation, you would not move unless the translation bip is wrong.
When I made Meditation I had to make a transition and a loop just like yours
And my character would slide around until I zeroed that bip
I see, I'll take a look at your mod to see how it works.
Hi all.
GPU needed for dedicated server?
@rain iron I deleted all translation data on this and left it in its original state from the blender template:
That completely fixed any sliding of the form that was not visible in Blender.
I see I'll try that on my end.
I found it very easy to accidentally drag select and move that Translation Data object when I was editing. I would always manually unselect it after I realized the problem.
PSA for anyone adding gamepad support... if you decorate getBestAButtonAction, getBestBButtonAction, or any of the other getBest actions, do not forget if self.aPrompt then return end in the code below!
local Example = {}
Example.patchButtonPromptsForA = function()
Example.ISButtonPrompt = {
getBestAButtonAction = ISButtonPrompt.getBestAButtonAction
}
function ISButtonPrompt:getBestAButtonAction(direction)
local player = getSpecificPlayer(self.player)
if conditionsForHighPriorityPrompt() then
self:setAPrompt(getText("YOURTRANSLATION"), YOURFUNCTION, param1, param2, param3, param4)
return
end
Example.ISButtonPrompt.getBestAButtonAction(self, direction)
-- Do not change the prompt if you already found the one you want.
if self.aPrompt then return end
if conditionsForLowPriorityPrompt() then
self:setAPrompt(getText("YOURTRANSLATION"), YOURFUNCTION, param1, param2, param3, param4)
return
end
end
end
Events.OnGameStart.Add(Example.patchButtonPromptsForA)
return Example
This prevents you from overriding actions you did not intend to override, e.g., if the Open Door prompt is already set and your decoration may be relevant when we are near a door, you may not want to overwrite the bound self.aPrompt and corresponding function, because you'll stop us from opening doors whenever your condition is active. (Real-life example: Aquatsar overwrites our door-opening when we are running because it fails to check self.aPrompt before setting its own prompt.)
@tame mulch If I threw the above example on the Wiki, would it be appropriate for the Beginner section?
(Alternatively, feel free to stick it wherever it's appropriate.)
Hey, I can't understand how to properly make moveable furniture. I created tile properties file, .pack file and added a script. But for some reason I can't pick up my stuff, and script only shows icon, name and type. How can I fix it?
(@ anyone paying attention who may have grabbed code quickly, I fixed a forgotten class name and switched the whole module name to Example above shortly after posting it.)
@gilded hawk Ay I see you lurkin... How's that automatic workshop / mod.info editor comin along!?
I finished it like a month ago ๐
Actually I finished it in November
@thick karma
Oh cool! Does it also do the mod.info file somehow? Or was it always for the workshop.txt alone? I don't recall.
It's only for the workshop.txt. Which is the one who usually requires the most effort to write
The mod.info file does not really need an editor since it only takes plain text
Not true!
Behold:
-- mod.info
name=Meditation
poster=poster.png
id=Meditation
description= <RGB:0.7,0.7,0.7> This mod brings meditation to Project Zomboid! <LINE> <LINE> Use meditation to rest, relax, and recover, or become invisible to zombies by channeling your unity with everything around you! <LINE> <LINE> Meditation comes with a trait called "Yogi" that gives a +1 bonus to Lightfoot (making yogis move a bit quieter). All of the other effects of this mod are locked to players with this trait by default; however, in sandbox options, you may allow everyone to meditate exactly as yogis do! <LINE> <LINE> By default, the option to Meditate will appear as an extra choice in the world context menu (the right-click menu); again, this will only appear for yogis unless the aforementioned sandbox setting is selected. For those who would prefer to always sit this way, there is an option in <RGB:1.0,0.6,0.0> Mod Options <RGB:0.7,0.7,0.7> that allows players to override the behavior of the vanilla "Sit on ground" option. <LINE> <LINE> Meditation also includes a unique animation! This animation can be disabled using Mod Options after joining a server. This animation will override the vanilla sitting animation by default for anyone who can meditate; if you prefer requiring players to activate this animation via Mod Options, there is a sandbox option for turning the animation off by default. <LINE> <LINE> The act of meditating offers a range of possible benefits that can be toggled or adjusted in sandbox options: <LINE> <LINE> 1. Become invisible to zombies (SEE WARNINGS BELOW). <LINE> 2. Recover endurance as though you have activated the vanilla resting mechanic. <LINE> 3. Recover physical health (in terms of hunger, thirst, and fatigue) and ignore pain. <LINE> 4. Recover emotional health (in terms of fear, panic, stress, anger, boredom, and happiness). <LINE> 5. Enable dedication effects in sandbox options to base restoration rates on player habits! <LINE> <LINE> ... et cetera
require=modoptions
It is MORE of a cluster to make mod.info look nice, however, it CAN be done
Colors and line breaks.
Oh wow
Oh yes
Dayum man. well. I might consider adding support for it, but atm I'm busy with another project
โค๏ธ
No pressure
But you WOULD be a legend
Food for thought: you could let users set color variables and automatically convert [h] tags to RGB:R,G,B tags
I think that would be super user friendly and awesome personally.
Maybe, I will probably remake the app anyway to work with Lexical, but I dunno. We'll see
What's the difference between OnCreatePlayer() and OnCharacterCreate()?
Where are you reading OnCharacterCreate()?
They may be phasing that out, idk
I don't see it on the wiki's list of Events
Weird, I remember seeing some people talking about an event like that
Also, it's OnCreatePlayer
Additionally, there is OnCreateSurvivor. That may be something related to incoming NPC stuff. Idk.
Ah alright I forgot lol
Yeah but it's also triggered when you load in the game as far as I noticed
Hey guys is there anyone accepting commissions here?
Also, as a blind guess, how much a commission for a headgear would cost?
@ancient grail is basically always accepting commissions afaik; might be a thing he could do.
i believe its this one
He is one of the potential commissions, i commissioned him once for a weapon in fact, but i'm curious if others here are doing modeling too and if so, how many
You might have better luck in #modeling
Anyone know the code to create a UI tab (seen in the crafting and character info menu)? I've been scouring the native code and even some mods that feature it but I think I'm a bit dull in trying to isolate it
Good morning.
Anyone knows how to check if a floor has a valid floor tile ? I cant remember where i saw the syntax
local square = getSquare(x, y, z)
local floor = square:getFloor()
if not floor then return false end
You might be right, thank you.
Hello friends. Is there a way in one mod to disable the recipe of another mod?
I would assume I need to make an overriding script.. just not sure what I would put in there to out-right disable another mods recipe
Ahh getFloor i was lookin at isFloor
mb isfloor working same way, idk
You can use scriptmanager doparam
Then make that recipe require to be learned
And dont make anytthing to teach it
hello im back
anyone want hear my mod idea?
soo an mod idea that i got is an mod that after death you can create an new character or become an ghost and haunt your friends my idea is based on minecraft requiem mod
and you can take control of an zombie
Hi everyone! im trying to get some clothes I made into game I have it all working but for some reason when blood splatters on my character it just makes that part of the mesh invisible instead of applying the blood texture to it. I tried making my own masks based on the UVs I have setup and copying colours from another mask but it doesn't seem to work. How does the blood get applied to the character?
Either me or the game is drunk. Help why doesnt it find/read this table/var
self.exercises:getOptionData(1)
nvm got it was missing CanHaveHoles = false, in my clothingitems.txt
function MortarGetHighestZ(cx,cy)
local cz = 8
for i = 0, 8-1 do
cz=cz-1
local check = getCell():getGridSquare(cx, cy, cz )
if check then
print(cz); print(check)
return cz
end
end
end
i didnt need to check for floor after all
btw also found this
getSquare(x, y, z):isSolidFloor()
Or just a continue as your zombified self with limited interaction abilities (no driving, looting or opening doors) with a slightly increased health bar. Like a mini boss.
nice thnx
wait what if we made your zombified character an boss that you control it
btw this code is a pain
thats what I mean
u can just do for cz = 7, 0, -1 do
yeah but you can control him like the movements
and you have to infect your friends

yeah
but with the zombie virus eating you brains, you dont know how to drive and you dont know to loot stuff
I guess the setting do give Zs the ability to navigate doors and such, so that is reasonable to have that ability as a Z no matter the settings

Omg so my passion mod is similar to your idea that you have been pushing ?
All this time
?
Omg we should abort the mod
Cuz me and @zinc pilot are doing a mod on the side
Its called reanimation
It lets you control your zed counterpart and disable everything that normal players can do
Like access stash and your screen os blank you dont have access to ui
The animations are half way done
We still have a long way to go
With the dragdown and such
Currenly our biggest hurdle is how do make the zed not follow us while still remaining visible
Ghost and invisibility is tied together
Its already mp compat
@ancient grail Thats awesome. Are the Zs that follow trying to attack the player Z?
yh, I remember that
https://steamcommunity.com/sharedfiles/filedetails/?id=2936830870 Modified my original mod to put you on the rooftop now. Feedback would be great!
Yes they still do thats the problem
We already have the code that disables moodle
Sorta like godmod ish
And the insta spawn as zed code
Id say we are almost half way thru
Damn, I was going to say... Zed Army!!! lol
@ancient grail can you guys use a variation of the "Zombie Camouflage" mod. the sections for zombie detection, lowered to zero and the timer to infinite.
I know there is more to it than that, but just a thought.
using the crafting menu? not hard at all
function SPH_matrix:draw9x9(x, y, nw, n, ne, w, at, e, sw, s, se)
local side = 20
self:drawRect(x, y, side * 3, side * 3, 1.0, 0.5, 0.5, 0.5)
self:draw9x9aux(x, y, -1, -1, nw)
self:draw9x9aux(x, y, 0, -1, n)
self:draw9x9aux(x, y, 1, -1, ne)
self:draw9x9aux(x, y, -1, 0, w)
self:draw9x9aux(x, y, 0, 0, at)
self:draw9x9aux(x, y, 1, 0, e)
self:draw9x9aux(x, y, -1, 1, sw)
self:draw9x9aux(x, y, 0, 1, s)
self:draw9x9aux(x, y, 1, 1, se)
end
i wonder what this does?
thats for UI?
to draw a large shape * it seems
is this used somewhere? im bad at math but it doesn't add up lol
what in the fuck is that from
well if you don't mind, can you help?
I'd say it's going pretty well.
LOL
Wait until you find "Dead Rat Type Heavy-Duty"
Yes yes
indeed
Dead Rat (Wet)
I need to fix it not working on stuff like backpacks and stuff, but that's about it.
Namely the icons.
keep it up ๐
@sour island Hey, you've made a literature mod right? Could I get some assistance with changing up icons dynamically?
Actually wait I can just use your mod for ref
Apologies
exactly change? or just add some other images on actual item icon?
I need to prevent items with the multi-icons from doing the multi-icons
I wish to change their icons exclusively to the dead rat.
So stuff like chips, clothes, etc seem to be dodging the system.
I tried adding the spongies open jackets framework to my currently developing clothing mod, I have added the lua and other special thing needed for the mod to fully function with spongies open jackets (opening, closing, tucking in pants etc) but when I added this, upon launching project zomboid, the whole game freezes as it says โloading luaโ and then after a minute or two the game closes itself. What did I do wrong? Can anyone help me on this situation?
https://steamcommunity.com/sharedfiles/filedetails/?id=2936875513 I just spent a ton of time reworking all of the occupations into Rosewood so every profession has an accurate spawn location! (like hey a farmer spawns at a farm!)
where can i find a recipe script template mod?
vanilla
This looks interesting, might pick this up for my server 
wha?
Is there a way to get rid of an inventory item's tint?
I'm considering writing a lexer for ZedScript instead of my cheap regex / tokenizer tricks.
=/
Hit an annoying wall with how I parse ZedScript with recipes changing it up.
hard to tell, but no more weird tinting!
Did anyone make a mod that changed the pins on the map or it there a way to create something so based on what the building type is it give it an icon on the map. Think of a map like GTA V. Has icons for the building types
you can use mods that let you draw on map, but i dont think you can add anything to the hard map without some serious modding
do you sleep on a rat?
Depends, do you have a rat to sleep on?
change each game texture to rat 
make every item a dead rat not just food
It does just this.
already lul
heavy duty dead rat
oh I thought it only changed food my bad
what if you drop the items on the ground, can you see the actual item? I see you can "wear" rat?
local icons = item:getIconsForTexture()
if icons then
print(tostring(icons:size()))
for iconIndex = icons:size() - 1, -1, -1 do
icons:remove(iconIndex)
end
icons:add(tostring(MassRatConverter.ratRef:getIcon()))
end
--item:setIcon(ratRef:getIcon())
item:setSpriteName(MassRatConverter.ratRef:getSpriteName())
item:setDisplayName(MassRatConverter.ratRef:getDisplayName())
item:DoParam("Icon = "..tostring(MassRatConverter.ratRef:getIcon()))
--item:DoParam("DisplayName = "..tostring(ratRef:getDisplayName()))
item:DoParam("DisplayCategory = "..tostring(MassRatConverter.ratRef:getDisplayCategory()))
item:DoParam("CustomEatSound = "..tostring(MassRatConverter.ratRef:getCustomEatSound()))
item:DoParam("StaticModel = "..tostring(MassRatConverter.ratRef:getStaticModel()))
item:DoParam("WorldStaticModel = "..tostring(MassRatConverter.ratRef:getStaticModel()))
Ground items are indistinguishable since I set the models.
Stuff in your hands may appear normal, may not, really depends.
I'm sure I'm gonna see rats tonight when I sleep...
tbh no idea why the -1 end index works but I dont question it
not sure it does
no errors, just does nothing since you don't use get

my thought is that loop does nothing because it doesn't work with indexes, but maybe I'm wrong
Code seems redundant anyhow, too lazy to clean it up despite having just released the mod.
I assumed you tested it and needed it
Am thinking about a map & mod idea from a couple years ago that I had about combining nuclear fallout with PZ and making a map of Fukushima.
One day..
Have yet to try STALKER mods for PZ.
hey guys! does anyone know where can i find the file that describes the propane BBQ? i can't find the items.txt file that describes it, it only found the mov_redBBQ which it's the charcoal one, but i don't know how the game spawns them.
@red tiger you know how to determine if a square is safehouse or non pvp zone?
i you might know cuz of faction with friends
i'm honestly surprised that code i gave you doesn't do it
there is only two methods i see for getting it
one is based on the tiles themselves. i wonder if it requires a loop to check for other things also
getSafeHouse?
getNonPvpZone
checked source, it looks fine
what's the problem with that?
It's not item, it's moveable tile
ow i fogot i already fixed that sorry and thnx
local x,y,z = getPlayer():getX(), getPlayer():getY(), getPlayer():getZ()
local sqObj = getCell():getOrCreateGridSquare(x,y,z);
print(SafeHouse.getSafeHouse(sqObj))

