#mod_development
1 messages ยท Page 190 of 1
My wallet is empty... Sob sob
Hello Everyone, We need help with a mod we are developing, Voiced Radios and TVs (https://steamcommunity.com/sharedfiles/filedetails/?id=2950750587). Programming knowledge is NOT required. We need Voice actors, specially female VAs to voice the lines for the mod, to have real human emotions (also, people willing to direct and edit the programs are apreciated). The discord link is in the description of the workshop. Once the channels are released, I'll also include the cast of the different actors and directors in the description.
I'm new to modding in PZ, and I'm curious to know if it's possible to add custom enemies. Not reskins/different outfits of zombies, I mean entirely new creatures in general, with different mechanics.
For example, say I wanted to add a creature inspired by the Lickers from Resident Evil. They would have no vision at all, so could only detect players if the player is running, shooting, or gets too close to them. They would also be able to scale walls and sides of buildings.
Is this possible in the game's engine, or would I be trying to do something that won't work at all?
Hi, have an way to set options to user ? I want to automaticaly set options
----- AIM OUTLINE -----
local aimOutline = self:addCombo(splitpoint, y, comboWidth, 20, getText("UI_optionscreen_aim_outline"),
{ getText("UI_optionscreen_aim_outline1"), getText("UI_optionscreen_aim_outline2")})
local map = {}
map["defaultTooltip"] = getText("UI_optionscreen_aim_outline_tt")
aimOutline:setToolTipMap(map)
gameOption = GameOption:new('aimOutline', aimOutline)
function gameOption.toUI(self)
local box = self.control
box.selected = getCore():getOptionAimOutline()
end
function gameOption.apply(self)
local box = self.control
if box.options[box.selected] then
getCore():setOptionAimOutline(1)
end
end
self.gameOptions:add(gameOption)
And i want to force player to set it to 1, so "none"
So in getCore():setOptionAimOutline(1), i set it to 1 = none, but its only when player apply any settings
anybody know where the lua is for bombs?
I'm trying to make an Occult mod and i'm making the player able to get a bottle of blood from corpses. I have the models all working and it works as a consumable but i cannot get the recipe to make it work. can someone help me see what i'm doing wrong?
Is there a way to add ellipsis to a text in a button if it's too long?
Coming from JS and HTML/CSS it seems like there is no easy way of doing this in PZ
Sure, send the text
Thanks man, i actually figured it out finally
Glad I could help
actually i was wondering if you know can i make it a drainable item that will poison you if consumed? i was testing it and i'm not sure if waterbottles can have the Poison or the calories modifiers on them
Well, if you write the consuming action, which drainables don't have by default, then you can give the character some poison... I don't know the exact names of stats you must use, poke around in either IsoPlayer, IsoGameCharacter or BodyDamage
Hey there, I was wondering if its possible to override TeachedRecipes for items added by mod like this, I'm able to add new entry like Tags previously, not sure if the entry is already there it would work, my testing seems like nothing changes ```lua
local item = ScriptManager.instance:getItem("KCMweapons.DoomsdayPreppers1")
if item then
item:DoParam(
"TeachedRecipes = Create Bolt Fletching (x3); Create Short Shafts (x3); Create Long Shafts (x3); Create Bolt Head (x3); Create Short Crossbow Bolt (x3); Create Long Crossbow Bolt (x3)")
end
The original `TeachedRecipes` is using `Craft` instead of `Create`, this is just for a patch mod i'm making to hide the original recipe and display new ones
If you're only changing the name, then providing a translation file will be easier
so if the mod already has a translation file previously, i'd just override mine on top?
Yeah
use the file name right
Yes. Otherwise the game doesn't even load them
I'm not familiar with file overwrites so if anything, use more hammer
ah, im not just changing the name, i'm changing the recipe ingredients as well
so i'm hiding the original recipe first
Right... Let me take a look at something
then load my own recipe, that's why i need to use new recipe names
at least from my limited mod reverse engineering exp, that's how i saw people do it
You can use the original names, actually
You do need to add Override:True to them, otherwise both recipes will exist(I know, stupid)
what exactly do you mean by consuming action. Do you mean OnEat?
I'm not sure if Drainables can be eaten...
I haven't made any consumables myself
meaning, i don't have to hide original recipes?
yeah the script page for it doesn't appear to have anything that would let me apply any stats to the player. ill just stick to making it a food
By doing Override:True you are essentially hiding the old recipe with whatever your definition is
except i just remembered they have tainted water. just need to figure out how that is applied
You can use text manager to measure the text
If it's over the button's width + the width of a ellipsis + your preferred padding cut it off there
Actually, you'd need to measure each letter in order for this to work - so maybe this isn't the best idea -- what you could do is try messing with the stencil functions to cut off the rendering
I do that in errorMagnifier
Thanks, managed to use Override:True instead of hiding original recipes via lua
anyone know where the lua is for water bottles?
The issue with Override:true is that it only applies to the first recipe named that - so it's not reliable in some cases. Just something to keep in mind.
im having an issue getting a worldmodel mesh to show up. it worked fine when i used WaterBottle but when i changed it to Bottle it just shows the 2d icon when on the floor. I see the waterbottle one is in models x folder but the bottle one is in the worlditems files also the first is .x while bottle is an fbx. do i need to change my import to more than just base?
nvm i figured it out just had to add worlditems/
Does anyone have a vehicle script template that I could use? The one in the Indistone.com's tutorial is outdated.
https://pzwiki.net/wiki/Scripts_guide/Vehicle_Script_Guide
explains all possible values
Excellent! Thank you!
Whenever the player uses the washing option from the "Take a bath" mod, you must ensure that the clothing item worn on the body location "RasSkin" (coming from ra's mod) is also cleaned (i.e. blood and dirt removed). This new clothing item is in fact the new texture introduced by ra's mod.
That is essentially what happens in your code example ISWashYourself for the vanilla washing option: When player uses the vanilla washing option on a certain body part, ra's code makes it so that the new texture is also cleaned on this body part. In the the code example, the texture is contained in the variable "skin". Then the command "skin:setBlood(part, 0)" removes all the blood from the body part "part" of the texture "skin".
In the "Take A Bath" mod's code, couldn't you simply try to add similar code to the washing routine? Another question: are you the creator of the "Take A Bath" mod and want to change the code of the mod? Or are you more trying to implement something like a compatibility add-on for the mods?
Ran into an issue with using clipboard - if the text is too long it simply runs out of memory lol
ERROR: General , 1692466688982> 19,936,080> java.lang.OutOfMemoryError: Out of stack space.
ERROR: General , 1692466688982> 19,936,080> at org.lwjgl.system.MemoryStack.nmalloc(MemoryStack.java:314)
ERROR: General , 1692466688982> 19,936,080> at org.lwjgl.system.MemoryStack.nUTF8(MemoryStack.java:713)
ERROR: General , 1692466688983> 19,936,081> at org.lwjgl.glfw.GLFW.glfwSetClipboardString(GLFW.java:4378)
ERROR: General , 1692466688983> 19,936,081> at zombie.core.Clipboard.setClipboard(Clipboard.java:80)
ERROR: General , 1692466688983> 19,936,081> at zombie.core.Clipboard.updateMainThread(Clipboard.java:92)
ERROR: General , 1692466688983> 19,936,081> at zombie.core.opengl.RenderThread.renderLoop(RenderThread.java:187)
ERROR: General , 1692466688983> 19,936,081> at zombie.gameStates.MainScreenState.main(MainScreenState.java:226)```
Is there a quick and dirty way to just dump this into a text file?
local writer = getFileWriter("myFile.txt", true, false)
writer:write(myString)
writer:close()
that is quick, thanks
Also, unrelated to this question: https://imgur.com/ykcfjJk
SoonTM
Do I need to do something in order for myFile.txt to be created @bronze yoke ?
as long as the first bool is true it'll create it
hmm
ah I see the issue
Forgot it get dumps into /lua
Sweet, it can open the text file too
using openUrl
Iam not creator of the mod i just want to fix it for myself and learn thing or two on the way, and i did. I already send method to creater of bath mod so he maybe fix it for others too, thats on him.
I did it like this:
@bronze yoke I can just use fileReader:read() to get the text back right?
you need to loop it, read() reads a single character
Ah yeah, it's returning an int
Looking over exposed methodcalls - what am I looping over?
Vanilla uses while true loops
i usually do something like
local totalStr = ""
while reader:ready() do
totalStr = totalStr .. reader:readLine()
end
When does it stop being ready ๐ค
when there's nothing left to read
Thank you, that'd probably have taken me some time to sus out
I just want to clear something up, I'm free to upload a modified version of a mod as long as I credit the author since it's open source right?
unless they left a license or permission in the files or description, no
having access to the source isn't the same as it being open source
what if the author declared that all his mods are open source and free for modification?
then yeah, probably
hmm, ill just play it safe for a bit and hope he sees and responds to my comment for permission on his profile lol
Hello Everyone, We just released the entire voiceover of Triple-N for the mod we are developing, Voiced Radios and TVs (https://steamcommunity.com/sharedfiles/filedetails/?id=2950750587).
We require your help, programming knowledge is NOT required. We need Voice actors, specially female VAs to voice the lines for the mod, to have real human emotions (also, people willing to direct and edit the programs are appreciated). The discord link is in the description of the workshop. Once the channels are released, I'll also include the cast of the different actors and directors in the description.
I am trying to modify a vehicle mod, in which part of the script can you choose what items the trunk of the vehicle has?
I've been posting this every few days or so, I suppose maybe this is the channel I should have posted it in to begin with, posted it in the main chat channel last week, and in mod_support a few days ago...
The reason I ask is for whatever reason in my sandbox world, nearly half of all the clothing items are purple, pink, or magenta. It feels like I'm plaything saints row or something. Meanwhile a lot of other colors like Red, Yellow, and plain white are almost non existent.
Maybe there is a mod that already fixes this on the workshop that I haven't run across?```
Does anyone what might be causing the purple and pink clothing? is there a lua file or xml I could tweak some values in to tone down the amount of pink and purple clothes, and maybe boost the amount of white, red and green?
It's very strange, pretty much every zombie has at least 1 purple or pink article of clothing. It's very rare for one to not, and I never see white clothing, red, yellow, green are incredibly rare.
itemType is for installable items
hey is there any mod that allows you to create radio transmissions in game?
just learned how to create radio mods with WordZed, but was wondering if it would be possible to do it in game
what you mean In game?
like, radio transimissions for a MP server?
(a player connects to the server, to some Item, makes a transmission in an available channel and it's send to everyone else on the server as a radio transmission, which can be set to repeat, something like that you want?)
I did make a framework mod to Voice radio transmissions, It links audio files to the first line of text, and plays them when the first line shows up: https://steamcommunity.com/sharedfiles/filedetails/?id=2973493897
It is part of my other mod, Voiced Radios and TVs, whose objective is to voice the entire vanilla Broadcasts.
(Im currently looking for more voice actors for that mod, If you are interested check it out)
What's the simplest method for getting a table of all the items in the player's inventory?
Trying to access this from a function called by a function added to OnFillInventoryObjectContextMenu
Right now I've got this. The first part seems to work fine as it adds the context option without a problem and calls the function (which I confirmed by errors appearing in the earlier version).
I think I found the approach used in the second image in this channel's message history but it doesn't work here. I was able to change the moddata before and it appears properly in the tooltip, but this doesn't change the tooltip so presumably I'm messing something up.
I assume I'm not actually using the inventory as a table, hence why nothing happens, but I've not been able to find an example that I've managed to get working
Familiarity with lua still pretty basic so possible I'm just screwing up something pretty basic too but I'd hope not
getInventory returns an arrayList (effectively)
ipairs() and other stuff appropriate for lua tables won't work - try finding getInventory uses in vanilla files to compare
local playerInventory = playerObj:getInventory():getItems()
for i = 0, playerInventory:size()-1 do
local item = playerInventory:get(i)
--do stuff
end
defining variables like in you are may be creating global variables (?)
I've never actually tried that - but IntelliJ marks it as a global reference
Going to add Catan
Let someone else add pokemon and yugioh lmao
And launch first doom somehow?)
oh this is neat, tho it would still be considered adding radio transmissions outside the game, I meant in game as, character types something/define broadcast time, and that broadcast loops at that time
If I want to override the properties of an item, do I just write the item with the same name in a new file?
alright, first mod and i'm being dumb. How do I check the name and/or type of an explosive trap
print(trap:getName()) returns NIL
print(trap:getType()) returns MAX
I want to do a check on explosions to see what kind of bomb it is to destroy different types of player structures
there arent different types of explosives. Every explosive just has the category "explosive"
however to find the name of the explosive lemme check rq
I dont think I know how to return the name of the explosive, sorry
damn
Does anybody know where to find the action that makes your character used bandages to heal themselves?
i know you can find the animations in ProjectZomboid\media\anims_X\bob
function Make_BloodBottle_Tainted(items, result, player)
for i=0,items:size() - 1 do
local item = items:get(i)
if item:getType() == "BloodBottle" then
result:setTaintedWater(true)
end
end
end
can someone tell me what im doing wrong. i took most of this from items lua and it just gives an error
What is the error
[19-08-23 20:57:06.753] ERROR: General , 1692496626753> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in Make_BloodBottle_Tainted at KahluaUtil.fail line:82..
I do not know if this is possible. I'm not an expert on how it works exactly, but I gather that you cannot make radio transmissions at runtime, since the game needs to load them before.
If I where you, I would start like so:
Make a test.xml file with some defined radio which plays everyday.
During runtime, modify the test.xml, so every broadcast says something different.
Check if it updates.
I would also recommend contacting the developer of this mod (https://steamcommunity.com/sharedfiles/filedetails/?id=2398274461) to ask him questions, since I gather enabling and disabling the AEBS might give you an insight into how to make your mod work.
If you can't contact him, suscribe anyway and check how the code works (particularly lua), It might give you some Ideas about how to make it work.
I'll also take the chance to request Voice actors for my mod, Voiced Radios and TVs (https://steamcommunity.com/sharedfiles/filedetails/?id=2950750587). Programming knowledge is NOT required. We need your help, to have real human emotions (also, people willing to direct and edit the programs are appreciated). The discord link is in the description of the workshop. Once the channels are released, I'll also include the cast of the different actors and directors in the description.
(I'm sorry if I'm a little annoying, but this message gets drowned under hundreds pretty quickly ๐ and I want people to know we are looking for them)
does anybody know where the lua for sledgehammer stuff is?
or know how to get the type of trap in Events.OnThrowableExplode.Add(function(trap, square)
or where the lua for bombs are... ๐ฆ
try trap:getItem():getType()
YEEEEES
I finished a mod for the first time and didnt quit on it
what is the metalvalue of an object for?
Hey guys, I'm not sure how I can get every cell / zone (not really sure of the difference) a player has visited, does anyone knows?
The getZonesAt(x, y, z) in IsoMetaGrid does not seems to return anything in my case
guys, how possible to add subcontext menu in existing context menu?
like for clean rag from water sources
look in the IsWorldContextMenu.lua they have examples for that there
i think its called addSubContextMenu or smth similar
You need to store the option in a variable using the context:getOptionFromName(name) and put the getText("OptionString") in the name, with the OptionString being the translation string of the option you want to add.
For example, a local equipOption = context:getOptionFromName(getText("ContextMenu_Equip_Primary")) would return me the option of Equip primary, then I can make a submenu using local newMenu = ISContextMenu:getNew(context) to create a new menu, then use context:addSubMenu(equipOption, newMenu) to add that menu to the equip option
(variable context is probably passed by an event)
In your case, clear rag is a recipe option, I'm not sure you can modify it the way I said earlier, but it's worth a try ๐
Remember to set the onSelect field of your option to nil! Or else the user can click on the submenu and it will call the old function.
eg.
local equipOption = context:getOptionFromName(getText("ContextMenu_Equip_Primary"))
equipOption.onSelect = nil
That will make so the option don't do anything when clicked on
Cool mod, Glytch3r!
Would you be willing to share a template so other mod devs could more easily make custom zombos? I haven't seen any guides or such to make a custom Zombie anywhere, let alone completely new and awesome variants such as your Leaper!
Will be willing to do colabs
Up till that extent
I do mod commissions so i would benefit from the exposure
Thank you very much, that's done it. Apologies for the slow reply; had gone to sleep shortly after sending that).
Hello ๐
Is it possible to create custom functions for the GameServer class for handling networking tasks? I might be looking in the wrong direction im not sure.
Failed to call means you're trying to call something that doesn't exist - my guess would be result is not what you think it is.
If it is exposed, yes. What kind of network-task were thinking of doing?
well essentially a custom zone state that I would like to sync kind of like the nonpvpzone ๐ค
but as far as I saw only the GameClient is exposed. so i am not sure where to handle such things
Are there any mods that add new stuff you can use as fuel for a fire? Trying to find an example to work off to make an added item burnable.
ETA: Found a mod for burning money; will check that out
Okay so im trying to create a second type of suture needles but whenever I make the item, it is incapable of stitching deep wounds
whats the script your using?
{
DisplayCategory = FirstAid,
Weight = 0.1,
Type = Normal,
DisplayName = Suture Needle,
Icon = SutureNeedle,
MetalValue = 5,
Tooltip = Tooltip_SutureNeedle,
Medical = TRUE,
WorldStaticModel = SutureNeedle,
}```
its literally just a copy and paste of suture needle item but I added a 1 to the end
and yes I am using a Base module
i believe because the lua code checks for "SutureNeedle" specifically you need to change the item name to that and change the display name instead. I would try that first . i haven't been doing this long so i'm not entirely sure
i'm pretty sure it has to do with setTaintedWater because i changed it to player:getInventory():getItems():get(i):setTaintedWater(true). same error. which i can't get down to why the only checks for tainted water i see in the lua are for filling from water sources and not directly attached to the water bottle item which might have something to do with it idk probably gonna scrap making it drinkable until i can figure something out
If you're not using a decompiled source or referencing the guide on methods you're kind of shooting in the dark.
What class uses setTaintedWater?
I actually set up a decompiler just to try to figure this out. I might just be dumb but i also don't know lua too well and i learned java over a decade ago so i'm probably just missing something. these are all the classes i found in the lua that use it
ISConsolidateDrainable, ISAddWaterFromItemAction, ISConsolidateDrainableAll, ISBaseTimedAction,ISTakeWaterAction, ISTransferWaterAction, SMetalDrumGlobalObject, SRainBarrelGlobalObject, SRainBarrelSystem, Recipe, IsoObject, IsoWorldInventoryObject.
what i saw looking through it is it checks if the water source is tainted then applies that to the container that it's transferred to, but theres no instances of just setting it as tainted
well i guess it does when transferring self.item:setTaintedWater(true); only thing is i tried doing self. and i don't think it worked. i don't even know exactly what self. does lol
Does anybody know where the functions that allow the player to heal themselves is?
would that be timed actions?
you want the cheat commands or the natural healing over time?
like where is the stitch function found
lua\client\TimedActions\ISStitch.lua
Hello, how do you prevent the character from moving when the player is pressing ctrl + a with the cursor inside a window? I would like to implement a "select all" feature but when I press ctrl inside a window the player starts strafing and if I press a the player it will move on the left.
I tried to look in IsInventoryPage but I didn't find any clue...
Thank!
lua\client\OptionScreens\MainOptions.lua key bindings are in here one for aiming is line 3117. id imagine youd have to set a condition if inventory is open then change control key binding
Some of these look like Lua file names - what is the root class the method belongs to?
yeah i was searching lua it's InventoryItem i believe
What is player here?
the default for that if thats what your asking the player character no variable
So im looking at the ISStitch.lua timed action file. I realised that it doesnt check if the player has the right items in their inventory. Where in the game files would the code check the player's inventory in order to do a timed action?
lua\client\XpSystem\ISUI\ISHealthPanel.lua i think thats where it checks the inventory
I think I'm going slowly insane
A local table value that isn't empty merely moments before the line executes becomes empty.
Same goes for the dictionary near it.
Wait..
sobs in mod load
Is there any way to edit the in game posters to display something else ?
Such as this one, they are static, non random "paintings"
I'd like to change them without any mapping if its possible
They are all over the in game map though, so I'd need to download and go through the whole world ?
Could I even add modded maps over that ?
Alright, tilemaking it is then
Any idea where I can get started on that ?
Or if there is a similar mod that I can check out the structure of ?
As far as I know that doesnt replace the existing ones
Does it ?
I think I get it
Thank you both for the help, I'll dive into it
I hope it works on linux though lol
Its funny how in my previous mod I had to check out one of Aza's mods to do a part of it
And now I'm doing it again
hardest part is all the time in photoshop good luck
Oh if I can manage to figure out the how of it, photoshop or whatever shouldnt be a problem honestly
Thanks for all the help
Question, for those who work with sounds.
Is there a way to play a sound in the middle, or something like that?
like, I have an audio file that is 54 seconds long, but I want it to start playing in second 32, Is there a way to do that, or do I have to split the Audio into 2 files?
does anybody know of a python library or something to easily work with Recorded Media translations files?
Anyone have anywhere I can go to get mod commissions done? I have a point I need to prove and I'm willing to pay to show this guy his idea's dumb
@bronze yoke I want to ask something. I need to control the duration of VHS Lines. I Know that for TV, if you add ${t:x.xx} it makes the line show for that amount of time. However, I tried doing this in media/lua/shared/Translate/EN/Recorded_Media_EN.txt and it didn't work. It just showed the times instead of making it last that amount
do you know how can I make it work?
is there a way to find out who DMCA'd an unlisted modpack a friend of mine made?
so he can talk to the person, settle it nicely between them both
sounds like you got some betrayal right there
sandbox options from mods are supposed to show up here right? im trying to work with albions one of the guides on sandbox options and having trouble to display em options
seems like it's because of having the mod uploaded to workshop as well, tried on a test mod and it's working
anyone familiar with these int params in there? assuming float one is for multiplier
actually i think i got it wrong, float is for amount of xp but i dont understand what integers are there for
Also is xpMultiplier and PerkBoost different things?
I'm asking how you're defining it - cause you don't show it in any of your screen shots from what I can see.
And if you're getting the same error parsing the array and directly calling setTaintedWater then chances are the error about "you're trying to call something that doesn't exist" is from the player not being correctly defined perhaps.
I can try it out once I'm back home - been out for like 2 days
Is the snippet from above still the one you're working with?
character:getXp():addXpMultiplier(perk, multiplier, levelMin, levelMax);``` You can look at CharacterSave mod for an exemple of use.
is it like we do with books so only a certain range has a particular mulitplier?
exactly
alr got it, by any chance you familiar with boost?
for fitness/strength im getting a value of 3 for that one
and it does reflect 125% in-game when i hover over the skill
I do not remember the details on xp because it was too long ago.
maybe about boost, 25% = default/1, 100% = 2, 125% = 3 ..
ah oki thanks for the info, ill try and experiment a bit to see how the change reflects in-game.
I'm not sure it will be of any help in your context, the only thing I got left about boost is that code comment: ```lua
character:getDescriptor():setProfession(job);
character:getDescriptor():setProfessionSkills(ProfessionFactory.getProfession(job));--clears all xp boost map and add profession xp boost but not traits boosts so profession must be set before traits
are there any tutorials that add logic, not items or maps?
I was looking at some repos for some mods but I cant figure them out ๐ฆ
most mods (except true musci plugins) add logic. You can look into the workshop for a mod that does something similar to your current idea. If you want general guidlines on modding, use the wiki. here, other modders can answer very specific questions, not conceptual meta-questions ๐ .
yes it's the same. as far as i know i just defined it in the function which is called when the item is made with Oncreate. thanks for any help i appreciate it i'm gonna try working it out more myself but i'm pretty much lost at this point
Have you posted the entire oncreate function?
The player is the third argument?
In most cases in the vanilla Lua player is a id number - playerObj is the isoplayer
Using getspecificplayer(n) may help - but I'll confirm in a bit
for i=0,items:size() - 1 do
local item = items:get(i)
if item:getType() == "BloodBottle" then
player:getInventory():getItems():get(i):setTaintedWater(true)
end
end
end```
player in oncreate is actually the isoplayer, so that's good - difference of usage notwithstanding
and i use oncreate in the item script
Your previous snippet had the result being tainted didn't it?
Also I see the issue
items in the function is not items on the player
you can't use i when it's indexed off recipe items for use in the player's inventory
Are you trying to make the bloodbottle tainted?
yes
what are the items? water?
yes. well i want to make it add poison to make the character sick but tainted seemed like the only way to add it to a drainable
tainted = foodPoisoning
you can write your own function for damage over time - but that's somewhat advanced - just mentioning the food poisoning cause it's very potent and will likely kill the person
this is for blood transfusions? might be better to apply an infection on use if tainted
But you can check out making soups in recipecode to see how tainting the result is handled
```lua --You can add 'lua' after the ``` to color it
function Make_BloodBottle_Tainted(items, result, player)
for i=0,items:size()-1 do
local item = items:get(i)
if item:getType() == "BloodBottle" then
result:setTaintedWater(true)
end
end
end
```\```
Using what your current snippet has implies you are using a blood bottle in your recipe btw
And makes the result tainted, your recipe would need to use up the items and produce a result accordingly
PZ recipes can also do removeresult:true so the resulting object is only used for the tooltip
and you can use oncreate to manipulate the items in items
PZ recipe require a result item to function though - the tooltips and ui break otherwise
and now that I think about it removeresult:true sometimes breaks tooltips too
dude thanks for the help. I didn't realize result just applied it to the item like that. i can't believe it was that simple. does making it tainted also apply the tooltip or will i have to apply that in the item?
its applied automatically- I'm just not sure how the poison is processed after the fact
that's probably done in java side
If this is tainted blood why would people be drinking it though?
Or is this tainting water with blood?
thats fine. its not for blood transfusion which is a cool idea actually, but i'm using it for decorative purposes atm for an occult tileset i'm making, also want to make a vampire trait that allows you to drink blood. the fact that it can kill you is a plus cause its crafted from corpses. i need to work out how to make it not drainable into other water filled containers but this is a big hurdle and you've helped me learn some stuff which is cool
Food can be tainted and isn't drainable
also i want to make it reduce hunger but i'm not sure how to do that in a drainable. is that something i can apply with a lua script through oncreate?
You don't have to make it a water fillable object to have recipes work with it
yes i know but i wanted it to have an amount so many objects can be made from it
you know didnt think about that
would be easier to apply a specific poison amount
and hunger
now i'm feeling like i wasted 3 days trying to figure this out lol
didnt seem to work although theres no error it functions as a normal untainted bottle of water
i may just look into making it a food item
Thanks for sharing, I'll look into it
Good day, what is the max amount of lines i can add in sanbox tab, so that they are fully displayed. Cause i', getting some lines overlapping each other
depends on resolution and text scale
I think star fixed it for his sandbox mod based on this
I want to ask something. I need to control the duration of VHS Lines. I Know that for TV, if you add ${t:x.xx} it makes the line show for that amount of time. However, I tried doing this in media/lua/shared/Translate/EN/Recorded_Media_EN.txt and it didn't work. It just showed the times instead of making it last that amount
do you know how can I make it work?
@fast galleon @bronze yoke do you know something about this?
do you know if the ${t:x.xx} behaviour is coded in LUA, and where it is?
ok, after researching a little I found something that might save me, But I need help.
https://zomboid-javadoc.com/41.65/zombie/radio/scripting/RadioLine.html
in the package zombie.radio.scripting, public final class RadioLine, there is a method called setAirTime(float float1) and setText(java.lang.String string).
It seems that this is not being done for Recorded media I gather. However, could I use this methods with LUA to do it myself?
(I would be doing it on the OnDeviceText event:
local function OnDeviceText(interactCodes, x, y, z, line, device)
-- Your code here
end
Events.OnDeviceText.Add(OnDeviceText)
)
Javadoc Project Zomboid Modding API declaration: package: zombie.radio.scripting, class: RadioLine
recorded media doesn't use RadioLines, it uses MediaLineData https://projectzomboid.com/modding/zombie/radio/media/MediaData.MediaLineData.html
i used to have a code snippet to really easily/quickly add a keybind
i have lost this snippet
anyone hook me up?
not that i know of

also hi i was gone for a few months
if anyone thot i died, nope

bad life times but im good
hi
Ok, I figured that there is a special character "[cdt=1.00]" wich tells how much a line should be shown.
HOWEVER
When the line stops showing it does not invoke the next line. Does anybody know if there is a way to invoke that? @fast galleon @bronze yoke @weak sierra
Hey ya'll 
Trying to figure out how I can add a sprite to the game world, I've been thumbling around and think I've correctly managed to get the sprite iso object, however I'm calling nil somehow on gridSquare:setSprite(sprite), does anyone know where I may have gone wrong here?
-- Replace flags on four corners of the control point
local flagSprite = factionFlagSprites[winnerFaction]
if flagSprite then
-- Get the sprite from the sprite manager using the sprite name
local sprite = getSprite(flagSprite)
local controlPoint = controlPoints[controlPointID]
if controlPoint then
-- Replace the tiles at the corners of the specific control point with faction flags
for _, corner in ipairs(controlPoint.corners) do
local gridSquare = getCell():getGridSquare(corner.x, corner.y, corner.z)
gridSquare:setSprite(sprite)
end
end
end
always do a check on grid squares because if they are not loaded they will be nil
so just if GridSquare?
gridSquare
yeah
doing things like this dynamically requires having a user having it loaded in, which can require running code on clients periodically to trigger the change from a backlog when the square is loaded and using onloadgridsquare or whatever it's called indexing into a table for max speed
but i have no idea of your context
if it's always something that should be loaded then im not sure why it'd be nil but that's a check worth having
ye roughly 90 tiles or so are loaded at any moment
Aye well this is only triggered for a control point that is being captured when the winner is declared, so for my testing I should in theory have those squares loaded as the 4 corners re in viewing distance at least
around each player
yeah that would make sense
if it's only happening when someone's there
still tho add the check for sanity and print a message if nil
then u can work from there
u can also check for function presence that way
if gridSquare.setSprite then
etc
prolly, i just tested mostly in N-S and E-W directions
i wrote the vehicle respawn mod that relies entirely on player loaded squares :p
so i had to do a lot of stuff w/ this
I saw an example of chuckleberry setting a sprite name after getting the sprite object, but he was getting the object directly from a square I believe, I was a bit confused by this, is it possible I may need to set a name for a sprite I've retreived through.. it's name 
u may well need to create an object
to set the sprite of
im pretty sure u cant set a sprite of a square itself
---@type IsoSprite
local isoSprite = getSprite(sprite)
isoSprite:setName(sprite)
---@type IsoSpriteInstance
local isoSpriteInstance = IsoSpriteInstance.get(isoSprite)
there is a setsprite that is a part of the isospritegrid class and also the isoobject class
mmmm
Okay I think I've realised a messup already
It requires 2 int's for the way I want to use it
afaik u need to make an isoobject
and then set the sprite of that
but im not an expert on this
@ancient grail cud help u mb
Ye I was considering reaching out to glytch3r I've seen he did something pretty wild with particle effects coming from the player
mad skills
yeah he dug deep in weird stuff u can do

Hello sir 
Iwould help you but right now im stuck taking care of kid . My son is very sickly
No problem bro, I'll keep on cracking and send you a dm at some point if I get really stuck, if you're cool with that, no obligations ๐ค
oof sorry to pull u in then
all i did was just remove replace a sprite in a loop incrementing by 1 cuz of the tile sheet
Every little helps I'd love to see it ๐
he has ascii art in there dw bout that
lol
this does at least some amount of dynamic creation of things with sprite assignment
I recall that when hou chabge the sprite you need to change both the name and the sprite itself
Okay I see, thanks a lot, if I can't get this shortcut way to work now I'll just create a new object as you say, looks easy enough, really appreciate the help both of ya ๐
Also welcome back @weak sierra
tyu
anyone know if it's possible to block a keypress from bubbling up? i want to block alt+f4 from working
i tried catching and swallowing the f4 with a return
no dice
something that's been bothering me for a while, this seems to happen when the mechanic is triggered for the first time only.
i think i might be adding xp on top of current one
was able to fix it, needed to set xp to 0 as well before adding previous values.
That looks awesome.
What tends to be the best approach/tool for finding specific functions? I've been using notepad++ as it highlights appropriately (can't remember if I had to install a plugin) but you can't look through luas by just searching in windows.
Javadoc Project Zomboid Modding API package index
Use VS code and install the lua extension
Absolute chad coding in notepad++ 
It's a rather self-defeating form of laziness as I will often not bother installing something which would save a lot of bother later. Thank you for that link though
It'll save your eyes, and you a lot of bother in like 5 mins flat, don't gotta take my advice tho

if you're looking at files on your editor(like vscode) ctrl+shift+f for searching fro particular keywords in all files (present directory), if you just wanna search in your single file then its just ctrl+f
I use NP++ as my default text editor but it's far from a modern IDE, I know some giga chads use stuff like neo vim but vs is just the bomb and super intuitive
the attitude that using the proper tools would be too hard to learn or too complicated or whatever seems pretty common, but the fact is that we use the tools we do because they make things the easiest
i wanted to look cool as well, tried neovim for a couple of days. Unfortunately had to quit.
soooo relatable hahaha
Tried to close neo vim and couldn't, pulled the powercord out the back of my pc and uninstall forever 
People made decompiler / library tools for use in intelliJ
I used a slightly dated one - been meaning to give the new one a shot
Once you get used to a set of tools it's hard to change
I didn't know there was a new one, I struggled getting the old version to work
Intellij is clean asf
I'm blanking on the new one's name now
umbrella?
capsid is becoming more and more of a nightmare now that the latest intellij versions don't even work with it (although, neither does umbrella, but that's emmylua's fault not ours, and it doesn't stop you from using it with other ides)
I'll not update intelliJ then lol
yeah, intellij versions from 2023 rewrote a bunch of the intellisense and none of the lua plugins have caught up
sounds like that's why I couldn't get umbrella working
was that you? i remembered when we finally figured out the cause there was someone else likely having the same issue but couldn't remember who
anyone know why the sprites are getting blurry?
I had this issue with other stuff - but it's kind of important for this lol
mostly used intellij for java stuff, only thing i don't like about it is takes a while to load up which is justified but if i don't need to open a full blown IDE for something then i usually go that route.
never written any java but capsid sent me down the jetbrains pipeline
and now my start menu is all jetbrains
i think only IDEA takes a while, its a bit heavy.
idea's startup time used to annoy me but clion has it beat by far
but certainly there's no better alternative for it when it comes to java from what ik
The saviour of the java devs
God bless
it's like cutting your arm off to forget about the headache that's been bothering you
btw @bronze yoke your guide on sandbox options was really helpful and easy to understand.
oh thank you! i'm glad it helped
i thought it was weird there were literally no resources about them so i wrote that one up
Thanks to @ancient grail and @weak sierra for the help before btw, now got my flags spawning on 4 corners after territory events ๐๐ป
ye it's just small stuff once you understand but if you have no idea it can be daunting honestly, luckily i was searching through discord texts and was able to find it.
it's one of the things that comes up here a lot
grats
So, currently trying to understand what's going on in the construction code. The first two photos are the wooden double door and metal double door. The second is called by a function when it's created and the last is called by that.
It looks to me like both the metal and wooden doors use carpentry to determine health and there doesn't seem to be a difference between the two (aside from the destruction sound in lines 48-51 in the third picture). Am I missing something here where the material matters? Does the code that causes damage to the construction modify the zombie's damage based on material?
Also, I've been trying to find it but failing (did actually catch up and install VSCode rather than using notepad++); does anyone know where the code to manage zombies attacking objects is? I'm not sure what names might be used to find that when searching
Thump is one of the ones I've looked at although there's about a thousand results so possible I've missed it. Only using thump as a whole word is also a bit tricky with two hundred. Unfortunately stuff being eligible for thumping is used by a lot of other code too.
๐ My discord is dark mode at least.
But, yeah, started with python back in KS3 so I pretty much always use light mode for IDEs.
Aye I'm poking fun light theme can be a vibe
could be worse, could have anime ...
lf suggestions, i pretty much have some skill specific pills and one for death, now i was thinking might sound too op but since i already have one for death, it might make sense to have one for cure as well๐
Cure with RNG for overdose 
#balanced
Temporary level 10 skills sounds awesome, really cool idea
overdose? i mean some folks wont use it but i bet some do prefer to remove infection using sandbox or something else anyway. It's just an option out there, not like you'd have to use it tbh.
someone suggested to add a mod option to limit the increase in levels, honestly i just wanted someone new to get a feel of skills they will be grinding for the next couple of days.
Well you're gonna kick the bucket otherwise, could be cool to see a "cure" mod that doesn't just make you grind forever to unlock or remove the threat of infection all together, temporary skills buffs sound dope, I'd totally use that in a playthrough, would be awesome finding one of those pills and looking for a good opportunity to use it if they're rare ish
24 hours to smash the best house together I can ๐
thank you, lets see if it gains some traction maybe ill work on this one. I have tried to keep the spawn rates pretty low coz then it's just not fun if you can find it in every drawer you open. But would need some feedback from users to get a decent rate and maybe will add new spawns later on.
this actually throws the same error as before i just didnt notice it it seems my item just refuses to be tainted. I will probably just work around it and make it a food item
Alright disregard the old messages, it was unrelated but the mod doesnt seem the be replacing the posters, any ideas @true nova
I have done the photoshop thing but I think my problem is with naming convention or mod structure
I'd really appreciate it if you could help me with that
whats your script.txt look like?
I'm gonna dm you
Hey guys, here is an update on the progress of my mod, currently named PZ-Tracker, any feedback is appreciated ๐
(Sry this is a Youtube link, I tried compressing it but it's still too heavy for discord)
https://youtu.be/XsqyIZwZqLU
PZ-Tracker is a mod and website I'm developping for the game Project Zomboid. It allows to synchronize and the website to follow your progress on the game. It also provides some leaderboard so we can brag about our kill number.
i feel like this is gonna bite me later, might as well fix this now. I wanted to work with skill levels in my mod so basically i made table for each category of skills. Hardcoded with skills from that category, than rolling a number upto that index and basically doing stuff related to that skill. While levelling up or resetting the level back to previous level, i require Perk object, atm im using achieving that by using getPerkFromName method of PerkFactory which works smoothly with english version as expected. But i'd like it to be compatible with Non-english versions as well, any suggestions how should i clean up this mess?
Is there a simple way to check the file that something you find here is from?
There's a function called DamageBarricade but it's not appearing when I look for it in VSC (currently opened folder is Project Zomboid). It's from IsoBarricade; is that not normally accessible?
hardcoded table with skills, the ideas here was to use the length as upper limit in ZombRand and then again fetch the name based on that roll.
so i can just use em instead of creating perk objects
they are the perk objects
is my hardcoded table going to be a problem?
getPerkFromName is just a weird way of getting them
i don't think there's an issue with doing this
not all perks will have their english localised name internally though
i remember you warned me earlier, but at that time i was overwhelemed with other problems in mod so left this one for later.
is there something i can do about it? im not sure i understand which part it affects
if you're accessing them with the Perks enum you have to use the internal names
e.g. Perks.Metalworking doesn't exist, it's Perks.MetalWelding
foraging is PlantScavenging, and i think there's more weird ones like that
oh ok oki i can look at docs i think it has complete list of names
if it's meant to be the in-game categories i would save the effort of hard-coding the categories and stuff by just looping through Perks and checking their category, it'd be compatible with mods too
but that might complicate things since the way categories work is really weird
https://zomboid-javadoc.com/41.78/zombie/characters/skills/PerkFactory.Perks.html i think this might be it
Javadoc Project Zomboid Modding API declaration: package: zombie.characters.skills, class: PerkFactory, class: Perks
yeah tht's them
the weird thing to notice about this is the categories themselves are also perks
i have no clue why it's done that way
so if you wanted to do it programatically like i suggested you'd have to work out how to check that the perk you're looking at is... actually a perk
interesting i suppose i will just stick to perks only then
so maybe hardcoding it is easier
ill try to make this perks.perk stuff work then maybe i could checkout the other way of without hardcoding it, small steps
so if i understand this correctly, the idea would be once i have a skill name. I would iterate over my table and try to match it, for each entry i should it return an object of that perk right?
the idea would basically be to generate your table from the perks table so nothing needs to be hardcoded (pseudo, doesn't work)lua local skills = {} for _,perk in Perks do local cat = perk.category if not skills[cat] then skills[cat] = {} end table.insert(skills[cat], perk) end which would result in a table like```lua
local skills = {
passive = {Perks.Strength, Perks.Fitness},
combat = {Perks.Axe, Perks.Spear, etc},
}
oh this makes sense now, ill get started with this one. Thanks
You can also check if there is a parent
Parent perks don't have a parent or have the parent perk of none
that's one good way to verify, ill test it out
@bronze yoke Im curious about the OnInitRecordedMedia, OnLoadSoundBanks and OnLoadRadioScripts lua. Do you know where this events are used in the Project zomboid LUA? I'm trying to check if there is a way to set the duration of a Recorded Media Line
with [cdt=1.00] (on the file with the text) I can make the line be shown for 1 second. However, once it is gone it takes the default time to show the next one
kinda
Hey guys so I'm trying to make a mod to replace an existing poster in the game with my own tiles, but I think my script file is wrong, can you guys take a look ?
module Base
{
imports
{
Base
}
module Changedposters
{
item Base.Mov_PaintingBetty
{
Weight = 0.2,
Type = Movable,
WorldObjectSprite = yourname_posters_01_0,
DisplayName = Changed poster,
Icon = Poster,
}
{
}
if you write ${t:x.xx}, once the line is finished it immediately starts the next
(However, if you check the text of the lines, it says [cdt=x.xx], not ${t:x.xx})
I Gather PZ is doing something on the OnLoadRadioScripts Event, and I want to know what.
it seems every line lasts 5 seconds by default
I'll anwser my own question:
- OnInitRecordedMedia is in lua/shared/RecordedMedia/ISRecordeMedia.lua line 40
- OnLoadSoundBanks is in lua/shared/SoundBanks/SoundBanks.lua line 398
- OnLoadRadioScripts is in lua/server/radio/*
name your module something else apart from Base, wait why do you have module inside module like that. You only need YourModule to wrap around everything, then you import base like you did and then your item script.
is there something that prevents controller users to set their keybindings like keyboard users do ?
not exaclty sure, i usually set the key bind via options and then simulate that keybind via steam input
for reference https://steamcommunity.com/sharedfiles/filedetails/?id=3006109377 , checkout the texture section script only is pretty much same except the model you have your item script in there. Also do verify that you have right variables inside your item script(i.e. weight, type etc not sure if that affects any of it but you can refer to vanilla files or i can link you a github resource for variables)
module Movables
{
imports
{
Base
}
{
item Base.Mov_PaintingBetty
{
Weight = 0.2,
Type = Movable,
WorldObjectSprite = yourname_posters_01_0,
DisplayName = Changed poster,
Icon = Poster,
}
{
}
Is this good ?
If not, is there a way to unpack and then repack the .pack files ?
I found a really old program for it but it doesnt work i think
remove the Base. from your item name, rest seems fine to me. And can't help you with regards to .pack files, no idea how that works.
Alrighty thank you
Is there a way to define a global custom setting's value through the user interface? Like one string that you set once and that'll be used on every world the player creates / joins
after a lot of retries, can't seem to figure out the issue here. I do get the table, can't fetch the parent or even just individual perk for that matter. Says Tried calling non-function
Can you print _? Is it the 2nd screenshot ?
let me try, i believe it should be the left side values from the table in the middle.
Also the "FromString" might be an issue, can you filter it out beforehand?
i could if it's possible to grab individual entries i think
i dont think its possible to print em, i tried using print(tostring(_)) doesnt seem to work, actually do i have to use toString from java here?
I'm not sure what's wrong tbh, discovering lua and modding myself
The previous stuff didnt work, does anyone know a program to unpack and pack .pack files on linux ? I couldnt get any existing programs to work
i think imma look at this one later, sometimes it's just pz being pz i think earlier even just accessing skills was giving me names of these perks but now even that doesnt seem to be working.
good luck my friend
Is there a way to make a mod to remove static objects from the game ?
The posters specifically, they are kind of objects
in Perks in expects an iterator, not just the table
i think you might need to do a numeric for loop anyway since Perks includes the enum functions too
Not all of them are directly accessible if you want to look at every class you'll want a decomp of the game
That will give you insight into the Java, tbh though I will use basically every resource I have at my disposal before looking at Java because it makes my brain hurt
you also can't make overrides directly to the Java source code in the same way you can to the exposed lua files that you have been looking at in the main PZ directory @steep vortex
ISCharacterInfo.loadPerk = function(self)
local perks = {};
-- we start to fetch all our perks
for i = 0, PerkFactory.PerkList:size() - 1 do
local perk = PerkFactory.PerkList:get(i);
-- we only add in our list the child perk
-- here we just display the active skill, not the passive ones (they are in another tab)
if perk:getParent() ~= Perks.None then
--...
end
end
return perks
end
thank you, ill try this out
was able to generate a table of skills with the help of Poltergeist's suggestion
How do I configure an image in this section? when placing my bomb the sprite of the pipeBomb appears and not mine
look for references but some modders use PACK files and I don't understand
could be because game is unable to find your file, maybe a problem with name or file type etc etc. Reference vanilla files for this stuff.
anyone knows how i can "create" more zombie speeds than available in vanilla? similar to the mod Personalized Zombies
I never found the original folder of this section, in the reference mods that I saw they only placed the name of the file and the sprite appeared
I just want to change the image of when you place an explosive on the ground
have you made a model script for it?
are you sure about prefix "Item_" in placed sprite? havent used so no clue
I want to see the 3D design or a 32x32 png
can you show the model script? you should also check logs for it.
I already tried it in several ways but it still doesn't work, only this works
thats the picture of the placed bomb by pipebomb
ah, PlacedSprite works with traps. From what I understand, you haven't added a new tile for the PlacedSprite.
and how I do it? I looked for many folders and I did not find the path
try removing it first
if you remove that line, it should use the picture you see in your inventory
if you want to add tiles, check this guide https://pzwiki.net/wiki/New_Tiles
ok
also can you show us how you named textures? in your texture directory
does it make a diifference if its Item vs item as prefix? i mostly used the latter
try what poltergeist suggested
that's what I'm doing, apparently I just have to put the texture in a PACK file
and create folder
this?
item Claymore
{
DisplayCategory = Explosives,
MaxRange = 9,
KnockdownMod = 0,
Type = Weapon,
MinimumSwingTime = 1.5,
SwingAnim = Throw,
WeaponSprite = Claymore,
UseSelf = TRUE,
DisplayName = Claymore xixitumare,
SwingTime = 1.5,
SwingAmountBeforeImpact = 0.1,
PhysicsObject = Football,
MinDamage = 0,
Weight = 1.5,
MaxDamage = 0,
MaxHitCount = 0,
Icon = Claymore,
KnockBackOnNoDeath = TRUE,
ExplosionPower = 0,
ExtraDamage = 60,
SmokeRange = 1,
SmokeAlpha = 1,
SplatBloodOnNoDeath = TRUE,
ExplosionRange = 4,
ExplosionTimer = 5,
SensorRange = 1,
CanBePlaced = TRUE,
ExplosionSound = PipeBombExplode,
SwingSound = AerosolBombThrow,
PlacedSprite = constructedobjects_01_32,
WorldStaticModel = Claymore,
}
or in the model line
shouldn't it give me the name based on game's language?
It does?
IGUI_perks_Combat = "Combat EN translation test",
Oh I switched to a different language and I was still getting Nimble as a target skill instead of what it's called in respective language. I'll double check my code, maybe I'm missing something.
I'm not sure what the problem is. Try removing the PlacedSprite line and check the model X file for issues. Often people copy X files and have internally old names.
directly delete placedSprite prevents the display of an object and the object remains but as invisible
my idea is to show the design of the claymore and mine
it's too complicated to create a .pack file
I don't want to download weird programs from the internet to create the file, this will put a virus on my PC, I have photochop 2020 and blender but they are useless to create the .pack file
I think I'll have to settle for that and I've been trying for 2 days xd
Perks pulled from perks. use the internal name afaik, if you want the translated name you have to use something like :getName()
Notice you have MetalWelding and PlantScav
I can double check my journal mod if you still have issues
It is better that you're storing the internal IDs rather than translated names
For vehicle seat, i notice hasRoof. What it actually do ?
Otherwise you get issues like shoving a door leveling your maintenance if you set your language to Russian
thanks i was being stupid that's all, somehow i have been working on file from downloaded mods folder, instead of the one i should have. So it's working and im able to create tables based on local perk names.
Does anyone know how to set the player's kill count and hours survived in MP?
These two don't seem to work
player:setHoursSurvived
player:setZombieKills
possibly stupid question: For the item scripts, can you use parameters from other item types? Like can I use the weightreduction parameter for a clothing item?
But do you want it to be using local names? That would mean changing languages would break your table no?
Oh yeah, I've seen this issue before
Sometimes it works, sometimes it doesn't
MY only idea is... Try doing it from the server's side of things?
I'm creating table once the game is started so whatever language you have at that time it would create table wrt that. If you change language mid game then yes it won't work.
But you can make it work using the internal IDs - and whenever you need the local names it can be retrieved using those IDs
That's what I do for skill recovery journal's tooltips
man
You mean like each perk had a unique I'd that's same irrespective of language you have?
It does have one ๐
The names you got in this image are not translated to any language
Those are the IDs
'PlantScavenging' 'MetalWelding'
and if you checked the parent for the passive skills you'd see 'Passiv'
Oh wait it is there:
Oki interesting I thought it was just for the English language.
Nah, those are the IDs - you can also use getID on a perk object and you'd get these strings
I might be able to work with this then, thanks.
Is there a way to make it so that my mod is always the last to load using the event onGameBoot?
You can include buffer directory folders, name the modID all lowercase or a later unicode character
If you have something you want done later you could also include some sort of ontick countdown - as for loading, something like loadstring() could load lua on the fly
Depends on what you're trying to do
Mh, these are good idea. I'll give it a shot
a bit confused with the skills situation, say i have a table populated with all the skills ID's. Now in order to reset these perks, i need to create a perk object. My mod data contains only the names of these perks(ID's), is there a way to create perk objects from these ID's? Earlier i was just using local names for perks and was working for me.
maybe i can iterate over the perk list and match i suppose...
Perks[id] returns the object
wow that's even better
Hey there, Is modData limited to a specific data size?
i tried to use Perks[id] , perk seems to be nil.
is targetSkill instanceof Perk or is it a string?
its a string val
if you print it, it shows the id of the perk. How sure are you?
are you saying it does on your end? or are you asking if it's the correct id of skill
I suspect that you save the actual perks instead of their id or name so it would make sense that it would return nil if that's the case.
so like targetSkill is not just a name? but perk object?
that would explain why you didn't get translation names too
this is where its initialized, random is a int val and skill table is basically a table of particular category
i can try and see if the targetSkill is just a string or not
hmm i think its a table
i assume there's no better way apart from for loop to just get the id?
you can check target skill == "Nimble" or type(targetSkill) == "userdata" or instanceof(targetSkill,"Perk")
no i meant like just getting the index from index,value pairs
since you already populated the table with perk objects there is no need to get the object again
but for persistence save them by id in the modData
perk:getId() gives you the id
ah sweet, btw since im already getting the obj might as well use that instead of creating a new one like i was trying to on line 158
you don't create a new one when you do that, you're just retrieving it again
does anyone have the name of a sound file of character being dragged down or eaten alive? essentially its name and location
oh is it going to change the end results? my goal was to store the current xp and levels and store em
Asking here because I didnt get an answer. Is there a way to reset a world for only the loot without affecting builldings ? Similarly, would copying map saves to a new save keep the buildings built while generating new loot ?
@bronze yoke @fast galleon Do you know if there is an LUA event for when the player changes the speed of the game? (And how to know whether the time is being fast forwarded or not)
seems to be working, need to fix some stuff on the reset function.
think i realise the problem with an older instance, the levels and xp would be pushed through modData and then ill be restoring to those levels...unless these scripts are rerun each time the game runs.
Fe/Male + BeingEatenDeath?
i'll use EveryOneMinute event and float GameTime:MULTIPLIER to check if the time is being fastforwarded or not
or perhaps OnTick, but I don't want to fill that up too much
you can just hook whatever function the ui uses to set the fast forward
instead of checking constantly
Speed change after action does not go through the UI
does it go through lua?
if yes you can hook the function that actually changes the speed, not the ui itself
if no, just check at the end of every action
hi, could anyone do me a favour๐ ? i have tested the mod and it's functionality but if someone else could test on their end if possible then i can be sure. I have published the changes to workshop. I can link it here, if there's any volunteer
Hey, I wanted to make a mod as a test on how hard or easy it is, so I tried making a hat. Seems to me like the information is partly outdated and very scattered and incomplete so maybe someone here can help. I thought looking at existing mods may help but I only found retexture mods on the workshop
Importing the male or female model into Blender let them be way too big and I found a holey guide which mentioned F and M model redos where the links are dead
https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
I found some reddit post where those were linked again via Discord, the male model downloaded but the female model was unavailable again
so I made a world model (which works 100% and shows up in the world, the icon works as well, it's already weird enough that it has to start with "Item_") but following the guide linked above to parent them to bones, assigning vertex groups etc. and using an edited XML of an already existing hat, they don't show up at all. They flatten the hair when put on but are invisible
here'd be the 3 files that aren't pics or models. I have since found 2 mods that each added working masks. One of them used the .X file format, the other one used .X for static meshes and .FBX for skinned ones, where I don't know why. I have looked at one of the X files' headers which mentioned a specific Blender 2.8+ plugin that can export .X files. I tried that out as well but it doesn't make any difference. When I specify a female model as a nonexistent file, it gives me an error in the debug output, that the file couldn't be loaded, which makes sense, but loading the male, which has a model, works and the only thing that doesn't is that it's invisible
Hey, never said but thank you for all the help with my questions on this channel, I was able to release the mod I was working on on Sunday.
Now I'm trying to figure out a good name for a mod I'd made today. It adds sandbox variables that increase the health of stuff the player can build.
Working title was bonus building health. Also considering Construction Health Sandbox, Construction Health Sandbox Variables, Building Health Variables, Building Variables, Building Sandbox...
None of them roll off the tongue very well
Extra stats?
nah sounds bad
im not good at naming gl doe
Customizable building health?
That's rather good, thanks. Straight to the point and desribes what it does.
stupid question sorry. Not labelling a function as local will mean its accessible to all files right?
yeah
there are better ways of accessing functions from other files, so unless you need to use it in a script (script functions have to be global) it's not recommended to do that
I managed to make it work, now when someone fast forwards the mod, it plays a FF clip, and when they stop, it plays the rest normally
im trying to expand on a function thats already made by the game. Would my method work?
yeah, if you're patching a vanilla function then you want to replace the original's place in the global namespace
so keep it global
okay thank you ๐
I thought my new mod idea would be easy and I would actually finish it but then the game decided to use slightly different code for this specific type of item
would suggest something more on the feasible side, since it's a lot more demotivating if you can't finish the mod.
I wanted to make staples capable of stitching wounds. I figured out how to do it I think
should be doable
yeah the issue was that items that can stitch must have a specific name
but if I give the stapler that name, it replaces suture needles
why does it need to have specific name?
ah i see, you're using teh mechanic provided by needle
does it have to replace the needle tho? not that i have worked with it
so basically what I have found
I gave a new item the exact same item line as a suture needle, except I named it differently
It wouldnt work
however I renamed the item to the name of the suture needle item name (I forgot it rn)
and it worked
So basically
if I name the item the name of the suture needle, the new item will work but the old suture needle will be gone
that's unfortunate, But ye for stitching you'd need that mechanic. Maybe try and find out how it works under the hood like the needle itself and if it's possible to access that somehow.
ive found the code that makes it that way I think
In blender, what's the correct way to unwrap your model for it's texture? I selected all outside faces and did smart unwrap, but it doesn't seem to match the texture within the game
I've been posting this every few days or so, I suppose maybe this is the channel I should have posted it in to begin with, posted it in the main chat channel last week, and in mod_support a few days ago...
The reason I ask is for whatever reason in my sandbox world, nearly half of all the clothing items are purple, pink, or magenta. It feels like I'm plaything saints row or something. Meanwhile a lot of other colors like Red, Yellow, and plain white are almost non existent.
Maybe there is a mod that already fixes this on the workshop that I haven't run across?```
Does anyone what might be causing the purple and pink clothing? is there a lua file or xml I could tweak some values in to tone down the amount of pink and purple clothes, and maybe boost the amount of white, red and green?
what is the best way to start learning modding in pz? ๐ค (I already have knowledge in LUA)
i've heard of this issue before, have you tried disabling all mods? i don't think we ever actually diagnosed which one but it was being caused by a mod
pink is probably a bit more common in pz than it would be in real life but nowhere near as common as what you're experiencing
I tried disabling all mods and testing for a while and there was still a lot of purple and pink. however... with the mods it is even more pronounced. My theory is it might be related to spongies clothing mod.
I've tried looking through the files in it to see if I recognized anything that effects loot tables or zombie spawns to see if maybe I could tweak values, but I didn't find anything. That doesn't mean there isn't something in it that can be edited to influence it, it just means I don't know what I'm looking for.
you could try verifying the game files integrity
My second suspect would maybe be Small Town First Responders, but once again, I'm not sure where in it it would influence zombie spawns clothing colors or loot clothing colors.
perhaps you modified something accidentaly in your game folder directly ๐คทโโ๏ธ
hmm, i actually work on stfr and i've never heard of that issue being caused by us
though it seems like an issue that could go under the radar since it's not obviously an error, i haven't experienced it myself
The only thing I've modified myself was the BDU jackets and chemical warfare suits in Sharks Military Upgrade mod. I just altered the weight of the chemical warfare suits (there were 0 weight by default) and I turned down the insulation on the BDU jackets.
I just feel there must be a lua file or xml that controls the hue and saturation of clothing randomly spawned on zombies and loot, but so far I haven't been able to find anything.
i dont think this is the right place for this but
can someone please make a mod where i can change the rate at which hair grows ๐ โค๏ธ
i would eternally love you
Trying to figure out why some items with DisplayCategory firstaid/medical go into bags that have accept item functions and yet some other items with the appropriate firstaid/medical display categories do not work. Very lost atm
i think it's based on the Medical=TRUE property and not the display category
@nocturne canyon
I just figured out something pretty cool
If you didn't know, you can control how long each line is in Radios and TV broadcasts by adding ${t:x.xx}
however, you can increase the time a line is shown by adding [cdt:y.yy] after that
with this, you can control how long a line lasts and it may stack them with future lines
I discovered this while fixing a bug for our mod Voiced Radios and TVs (https://steamcommunity.com/sharedfiles/filedetails/?id=2950750587&tscn=1692215256), making the text sync when fast forwarding (and adding a fast forwarding sound). We are currently looking for Voice Actors (People experienced with audio editing are appreciated), to voice the lines. NO PROGRAMMING KNOWLEDGE REQUIRED.
If you are interested, join the discord in the workshop description.
so editing vehicle script especially engine specs only applies to to undiscovered vehicle ? 
yeah, it is, tysm.
Wizardry
it's like saying you need this file for whatever youre doing
Use a keyed table with the ID - drop the perk name all together outside of UI display
{["perkID"] = level} or {["perkID"] = {level=0, xp=0, extraInfo}}
There is virtually no reason to use the translated text internally
I fixed it now, after your suggestion for the perk ID๐
Ah, was that old? Discord sometimes doesnt load
Yep
My bad lol
I'm seeing how much chatter actually occurred now - idk why the web version does that
Is there a usual way to update player's lootWindows from the container?
I know you can call on getPlayerLoot to do this
But I need it to update any possible player nearby as well
Where can I find out about what getScriptItem() does?
NVM I used common sense and figured it out XD
Would this be the correct way for lowering someone's body temp? character:setTempurature(stats:getTempurature() - 5);
stats is a variable thats already set
Mispelled temperature but that's fixed now too
is it working for you? i don't think you can change temp like that i mean even if you temporarily do it's gonna go back to it's earlier state based on other factors i think
@bronze yoke @fast galleon Do you know if there is a way to know wether a radio line/Recorded Media line is being heard completely (full, collored text) or faintly (gray, cut text)?
nope
nope you don't know or there is no way?
i don't know
I've not tried it just yet. I'm working on models and textures right this second. Essentially I was trying to make it so eating something cold temporarily makes you kind of cold.
if you are relying on that mechanic then i would suggest getting this one sorted out, i briefly looked into temperature and there's a lot of fators that dictate body temps.
Not relying on it, more a fun little mechanic lol not really necessary. Thank you!
ah alr
Hello does the getModData() save the data even if i quit world /server?
yes
I know it's a bit late, but I use ISInventoryPage.dirtyUI() to refresh everything.
If you need to do this for all players, maybe a sendServerCommand will do the trick
making the container dirty worked
i actually figured it out lol
BetterSorting changed the displaycat's from "Medical" to "Med" >.>
Stuff like that should be handled with tags tbf
Ty, idk if it's obvious here but the UI elements are generated from the pieces on the square
Still working out the kinks - it's having issues not grabbing the board sometimes
i made a mod that works fine when starting a new game in single player and hosted but when i add it to a current hosted game it gets stuck at initializing and the log stops updating. anyone know How i can troubleshoot this?
Am i wrong, but translation files work without {} ???
Forgot to add closing brace bracket and it seems to work
new to modding, does anyone know where bodytemp is declared?
declared? think bodyDamage class has access to it
Javadoc Project Zomboid Modding API declaration: package: zombie.characters.BodyDamage, class: BodyDamage
Does anybody knows how to access to the item icons in the texturepacks file?
I managed to unpacked the UI.pack file but can't unpack the UI2.pack file.
sweet thanks, probably butchering the code but wanted to give it a shot
would anyone be willing and available to have a look over some very novice code? trying to make my first scripting mod.
you'll need tilezed which you can get in tools if youre using steam its just listed as project zomboid modding tools. theres a pack viewer and it allows you to view them and extract them into sheets or individual images
I think I just made it, thanks dude! ๐
Are all recipes in the "Cooking" category supposed to give you XP in cooking? I have made a few recipes and they give no XP, and yet I noticed my testing character still leveled up their cooking skill
Maybe some of them got OnGiveXP code?
No, none of them have any
recipe PreparePotMash
{
Pot,
RawMash=30,
Water=20,
Sheet,
[Recipe.GetItemTypes.CraftLogStack],
noBrokenItems:true,
Result:FreshMashPot,
SkillRequired:Cooking = 2,
Time:400.0,
Category:Cooking,
CanBeDoneFromFloor:true,
NeedToBeLearn: False,
}
recipe RawMashFromPotato
{
keep MortarPestle,
Potato=1,
noBrokenItems:true,
Result:RawMash,
SkillRequired:Cooking = 1,
Time:40.0,
Category:Cooking,
CanBeDoneFromFloor:true,
NeedToBeLearn: False,
}
recipe RawMashFromCarrot
{
keep MortarPestle,
Carrots=2,
noBrokenItems:true,
Result:RawMash,
SkillRequired:Cooking = 1,
Time:40.0,
Category:Cooking,
CanBeDoneFromFloor:true,
NeedToBeLearn: False,
}
recipe RawMashFromCorn
{
keep MortarPestle,
Corn=1,
noBrokenItems:true,
Result:RawMash,
SkillRequired:Cooking = 1,
Time:40.0,
Category:Cooking,
CanBeDoneFromFloor:true,
NeedToBeLearn: False,
}
recipe RawMashFromEggplant
{
keep MortarPestle,
Eggplant=1,
noBrokenItems:true,
Result:RawMash,
SkillRequired:Cooking = 1,
Time:40.0,
Category:Cooking,
CanBeDoneFromFloor:true,
NeedToBeLearn: False,
}
I thought players would get XP because of codes in recipecode.
This... seems to be weird.
Yep. Just tried my own recipe. It does work like that.
It seems the recipes in any category would all give certain XP.
If you don't have set an OnGiveXp then the game uses the Recipe.OnGiveXp.Default, which adds cooking xp when the result is instance of food.
That explains it! So I suppose I need to set Recipe.OnGiveXP.None?
a simple OnGiveXp:none, should work ...
or any string, so it's not nil.
nevermind, if the function isn't found you will get error warnings. Best way is to make the none function.
If you figure it out lemme know. I'm also trying to work with bodytemp. I haven't gotten to test mine out yet though because I can't figure out why my damn items arent being put in the game ๐ญ
If you haven't already, W. Patrick has a pretty good youtube video that's got some decent information for item scripts. Theres another guy, Ogreleg (spelling?), that has a good youtube vid on lua scripting.
https://cdn.discordapp.com/attachments/852632065022099591/1144277498604028055/image.png
adding more pieces + cannibalizing some vanilla items
Had to redo the icons for the vanilla boards to match the new chessboard
I had Module instead of module at the top of my items script...
Now I'm having issues with this line in my lua: bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 5);
in debugger? always check whatever you're chaining onto is not nil
Look, I'm real stupid XD I don't know how to check for that XD
Also yes, in debugger. It popped an error and said I was calling a nil table or something of the likes
attempted index: setUnhappynessLevel of non-table: null
[24-08-23 10:47:23.108] LOG : General , 1692888443108> -----------------------------------------
STACK TRACE
-----------------------------------------
function: FBGCigarettes100s -- file: FrysSmokesFunctions.lua line # 8 | MOD: Fry's Smokes
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@eb6b5341
function: perform -- file: ISEatFoodAction.lua line # 120 | Vanilla.
[24-08-23 10:47:23.114] ERROR: General , 1692888443114> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: setUnhappynessLevel of non-table: null at KahluaThread.tableget line:1689..
[24-08-23 10:47:23.115] ERROR: General , 1692888443115> DebugLogStream.printException> Stack trace:.
[24-08-23 10:47:23.118] LOG : General , 1692888443118> -----------------------------------------```
Theres the full stack trace lmao
bodydamage is nil
Do I even need that or can I just do setUnhappynessLevel(getUnhappynessLevel() - 5);
Looking online it looks like its actually "BodyDamage" and not "bodyDamage" so I can try that too
you need the object from a character, not the class.
Where would I find that at? I'm currently looking at this site https://projectzomboid.com/modding/zombie/characters
getPlayer():getBodyDamage()
so getPlayer():getBodyDamage():getUnhappynessLevel()..........?
this is going to give you bodyDamage obj yes, you can call methods available for body damage class on that
is it possible to add sandbox settings that tell the game not to load recipes that are part of the mod?
no, scripts are loaded before sandbox.
However you can probably load recipes safely after the sandbox options.
In my case I make them hidden and canCraft returns false.
would you mind telling me the basics on doing that?
mapping and tiles prefer minimalism, probably no
here is one example, though some people seem to have issues.
this explains tile properties
thank you i'm sure i can figure it out i was having a hard time finding examples as the mods i use don't add or remove items in sandbox just change settings
adding items should be done only the regular way, in order not to ruin the saves.
appreciate it!
Chipping away at the old farming patch mod again, painful but more interesting this time.
The agony of finding out that Mod Manager doesn't maintain the Mod Load Order on the reloading of lua

Hey guys. Please tell me how to turn off the sounds when the action is canceled and completed, which are played at the beginning of the action
I don't supposed there's a way to determine model size in game is there?
I get more hyped every time you update! So does this show any 3d object within the tile?
Only ones that are tagged for games
The only issue is the relative position of some items due to models not being centered over their x/y it seems
or I made so much spaghetti code the math is jumbled up
boards are super off center, the pieces are kind of ignorable
But I'm writing the system to allow for easy expandability
So another mod+api
One thing that makes me not so happy is the compression textures are getting
Might have to restrict the colors even more
i can't image the amount of code that went into this. If i'm lucky when you finish it i can do an addon to put some magic the gathering or something in the game. I think it looks great and i cant wait till you finish it, no rush though
hello is this where i ask for coding help?
Surprisingly it's not been much work getting the skeleton down, just a lot of tweaking - but going forward adding on more stuff will be more artwork/pixelart than anything
can anyone point me in the right direction on a function that checks whether or not something is in a dense forested area?
maybe something simple that doesn't require a lot of load on the game
i was thinking maybe something that ran a check every 4 or 5 ingame hours
i'll be right back
You can use the zones from the map to check that - but it depends on what you're trying to achieve. Generally you shouldn't need to fire off an event indefinitely.
i'm mostly checking if an NPC is lost in a forested area
and if so would delete them
after a set time has passed of them being in the forest
NPC as in something like superbsurvivors?
well i'm not a great coder atm but if you need help making pixel art let me know
yes
i'm trying to make an auto cleanup mod for it
i've usually run into the problem of them wandering off into the woods or away from a town and becoming irrelevant
and the more there are the laggier the game becomes
so i wanted to make something that checks for conditions and auto deletes them from the game
The invasion of Roomba.. Terrifying
If they're far enough away they should despawn and pose no issues
Are you using the mod CowsWithGuns is working on?
i'm not
I would not be opposed to help, but I'm a bit particular so I wouldn't want anyone to put in effort and me not end up using it
i don't know coding well
so it feels like a huge undertaking to learn a new framework
but i can try if anyone is willing to help me understand it
start small, don't worry about everything right away. Pick something particular, ask questions in here.
alright i'll give it a try
thanks everyone
@sour islandi can't reply in that channel
i'll take a look at it
You have to link your steam
https://steamcommunity.com/sharedfiles/filedetails/?id=3006109377 check this out, was pretty new back then when i created this one.
thanks for pointing me in the right direction. your code is very clean and easy to read. i was able to apply this to 100 items within different categories and add it to sandbox options which i have never done before so i learned something new
ye don't need to go through everything right away, altho instead of just reading try to follow along that would help a lot. Otherwise you'd be overwhelmed.

Tell me please is there any way to turn off the sounds played earlier
@bronze yoke I want to ask a question about moding and steam policies. For my mod Voiced Radios and TVs I wanted to add some 90s hit songs to the Knox Talk Radio. https://steamcommunity.com/sharedfiles/filedetails/?id=2950750587&tscn=1692806463
However, I have recently seen a video where they mentioned in passing that some addons for true music mod might be banned.Could this happen to my mod? do you know how this works?
if you do not own the copyright to materials in your mod, your mod could be taken down permanently
dam
well, there goes that idea
guess I'll have to find some non copyrighted hits, something more clasical
like Bethoven's ninth symphony apparently ๐
i will note, without offering legal advice, that copyright infringement is rampant on the workshop and action is extremely rare
and i believe you do have the choice to remove copyrighted materials to have your mod relisted, but i'm not sure since i haven't made any mods like that
Does setting the run speed modifier higher make you faster?
and lower slower?
or is it like from 1 to 0 and 1 is the max char speed
thanks. I Founded
Guys I think adding the 4 bore rifle would be awesome
Nvmd.
I'm happy with how it's turning out
Going to include Uno and hopefully Catan as two sub-mods to show how to implement the API
Soon the workshop will be overfilling with board games ๐
Can't wait
This is a good future
Meantime, I've finally picked up my old farming patch mod. Old one was a mess of manual data entry which I never wish to do again. 4K+ lines of all typing when I could've done it dynamically.
So I'm doing it dynamically now!1
I'm able to choose between different "variants" of crops if their end results are slightly different. (I.E, Base.Wheat vs filcher.SFWheat) but they can still use the opposing seeds.
Dynamic is good
Wheat seeds from LGR and SF Farming TIme working together
Most of the board game stuff is done that way cause I cba script a bunch of stuff
Did it for chess for now, but I'm looking for ways to avoid it
There is some points where I have to overwrite things, but the system I've made makes it a lot of easier to do that for the individual bits I actually need to overwrite.
This is the size of the average patcher now.
--local data = UltimateFarmingPatch.RipFromFarmingData() -- This may be redundant. Unsure.
local farmData = UltimateFarmingPatch.DoPatcherSetup()
-- Make individual adjustments.
-- Add blacklists to seed packets if this mod happens to introduce any.
UltimateFarmingPatch.KnownBlacklistedPackets["filcher.SFWheat"] = true
UltimateFarmingPatch.KnownBlacklistedPackets["Base.Corn"] = true
farmData.props["filcher.SFWheat"].cropCode = "Wheat"
UltimateFarmingPatch.GetSeedPackets()
UltimateFarmingPatch.UpdateFarmingData()
Most are even shorter than this. This required an overwrite to get SFWheat to be treated under the overall "Wheat" type, and some overwrites to make sure you can't read the wheat or corn you thresh for LGR "Learn to Sow" compatibility.
(The system can't tell the difference between threshing an item for seeds or a seed packet, and you can only read seed packets to learn, so!1)
This is quite possibly the most over-the-top system I've made so far but I'm really proud of it.
It makes patchers easy enough to make that community members can likely contribute without much issue.
Ugh, hit another wall with mod load order.
LGR loads before Mo Crops because of alphabetical difference despite being further down in the mod load order

Put an exclamation mark in the beginning in the mod id
I'm unsure of if that would work or not, the patcher mods need to load in between each farming mod.
It goes like
Vanilla - UFP Core - Filcher - Filcher Patch - Mo Crops - Mo Crops Patch, etc
problem is that the order doesn't want to go like that and LGR has decided it wants to load before Mo Crops and it's own designated patch
So like..
Wait but.. that'd mean Mo Crops Patch would be the one erroring, not the LGR one..

I think it just hates me, it's loading in the correct order from the looks of it.
Perhaps the mod load order is working as intended, it just doesn't want to load .props from farming_vegetableconf for some reason
I think I found it.
Annoying, but at least I found it.
Maybe.
I did not find it.
From what I can gather, LGR is somehow being loaded with the Vanilla patcher, so none of its data exists when its own patcher comes along.
How in the world does LGR load before my mod? The only thing that could maybe hold it back is the ModId, but even then it didn't have issues with Soul Filcher's or Mo Crops.
The directories are the same, mine comes first alphabetically-
I don't.. understand.
@quasi kernel
file: !_FarmingCompat.lua
require "A"
require "B"
require "C"
Are you telling me to require it..? That would just force it to load after.
I already tried setting it up to where my farming file name started with an A instead of LGR's, well, L.
When I tried it myself, nothing changed.

LGR is somehow, beyond all of my understanding, loading first. Enen a visible mod load order like this shows it's at the bottom.
mod load order is irrelevant
But my file name should've still come first, and it doesn't.
The issue is that LGR manages to load it's crop data before the first vanilla patch which is included with Core
are all the files you need to require in same subdirectory, e.g. server?
Yes.
File i'm attempting to load before
If I recall, numbers should load first, but I already tried it with A anyways.
server/!_FarmingCompat.lua would load before the other files and then you can require in whatever order you need
Not sure how file safe it is, but I guess it's worth a shot.
except for vanilla, which would load earlier
what error?
It's effectively an empty dictionary error due to the data not having loaded in the correct order.
Line 15 breaks because farmData.props["legourmetfarming.CafeSeed"] doesn't exist, even when it should.
It doesn't exist because it somehow gets lumped in, converted, and cleared with vanilla crops.
I can already confirm this is happening because of console prints.
(The system works by having an individual patcher after every mod, where it effectively takes from farming_vegetableconf and copies all of the data over before clearing the original data.)
use require if LGR overwrites the file
The issue is I don't want LGR to overwrite the file before I can get to it.
I need vanilla as it is so I can take it's original data, then LGR can do whatever it wants.
Because then I can just run the LGR patcher, get LGR's data, clear it, and move on.
if they have same name only one is loaded
?
a number of mods copy vanilla files to make changes, only the modded file is loaded obviously
None of these mods do that, thankfully at least.
Vanilla's file is farming_vegetableconf.lua
LGR's is LGfarming_vegetableconf.lua
Mine is a_farming_vegetableconf_patch.lua
Mine would reasonably load first, would it not?
wait
wait
wait
No that wouldn't do anything, otherwise Soul Filcher's mod would've had the same issue.
this mod does it
wym, the file names are different!1
Shouldn't Vanilla's load first then get overwritten by LGR? And even then, I should still be able to get in the way for a moment to get the data before LGR can do so.
I mean he has 3 files there with vanilla names.
I end up overwriting those with my own later down the line, those files should be irrelevant.
geez
I genuinely have no idea why this is happening, it's driving me insane.
how do you use require?
I don't use require.
There's hardly anything for me to require except for base game vegetableconf, which loads before the mod is even loaded anyways.
Line 15 breaks because farmData.props["legourmetfarming.CafeSeed"] doesn't exist, even when it should.
Wizardry
this is clearly not vanilla line
use require to load the files in the order that you need, good luck
This loads after LGR correctly, the problem is the LGR loads after vanilla but before the vanilla patcher.
It's somehow going Vanilla - LGR - Vanilla Patcher - LGR Patcher instead of Vanilla - Vanilla Patch - LGR - LGR Patch
Taking a short break anyhow to try and collect thoughts

This all gives me a headache either way, according to a load order thing I found it should be alphabetical but it just isn't???
Unless I'm just insane, but I swear I'm not.
You could require the vanilla patcher in your modid to make sure it loads before your mod
That would require overwriting entire files of the LGR mod which isn't mine.
Vanilla Patcher is included in the base mod. Perhaps I'm just screwing something up..?
Sofar i know require doesnt overwrite anything it just makes sure the files are loaded before execution
I understand that, I'm saying that the issue is that LGR is loading sooner than it should be, I don't own LGR, and I'd have to overwrite the file to add the require.
The issue is that the VanillaPatcher is somehow coming after LGR despite file names supposedly dictating otherwise.
This is all I have to work off of, assuming it's correct (which to my knowledge it is)
But i mean in your mod.info you can put the modids for those two mods so that your mod will load last after all those mods in their entirety are loaded
I don't want it to load last though.
I need Vanilla Patcher to load first
It needs to come straight after Vanilla, but for some absurd reason LGR is beating me to it.
So your load order would be vanilla patcher -> your mod -> lgr?
The vanilla patcher is my mod.
At least, part of it.
So yes.
Just My Mod -> LGR
But it's reverse despite literally everything designating otherwise
Do you know the lgr mod id?
I believe it's just LeGourmetRevolution
My mod is UltimateFarmingPatch, but what tips me off is that Soul Filcher's mod and Mo Crops don't have this issue.
Oh god le gourmet
Mo Crops I believe is MCM.
LeGourmet has consistently been a thorn in my side when it comes to modding this stuff, but I cant say I'm the ultimate patcher without it.
Does your mod change anything in lgr or its files?
Only a few client-sided files.
Which is unrelated to what I'm trying to get to load.
Then lgr has to load first
Im over on the server atm
If you dont load lgr first it wont be able to change them
It should be able to change them fine, game loads in the order of shared, client, server.
I need it to load after on the client (which is working fine), and before on the server (which isn't working.)
I'll probably reach my 700 hour mark just trying to solve this
LGR has been the only mod with this issue so far.
You can use requires to ensure loading first afaik
