#mod_development

1 messages ยท Page 190 of 1

faint jewel
#

i am open for commissions.. wink wink.

#

you wanna hook the player onhit function.

tardy wren
keen silo
#

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.

coral sail
#

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?

ivory gyro
#

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

buoyant fjord
#

anybody know where the lua is for bombs?

true nova
#

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?

gilded hawk
#

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

true nova
tardy wren
true nova
# tardy wren 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

tardy wren
glacial viper
#

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
tardy wren
glacial viper
tardy wren
#

Yeah

glacial viper
#

use the file name right

tardy wren
#

Yes. Otherwise the game doesn't even load them

#

I'm not familiar with file overwrites so if anything, use more hammer

glacial viper
#

so i'm hiding the original recipe first

tardy wren
#

Right... Let me take a look at something

glacial viper
#

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

tardy wren
#

You can use the original names, actually

#

You do need to add Override:True to them, otherwise both recipes will exist(I know, stupid)

true nova
#

what exactly do you mean by consuming action. Do you mean OnEat?

tardy wren
#

I haven't made any consumables myself

glacial viper
true nova
#

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

tardy wren
true nova
#

except i just remembered they have tainted water. just need to figure out how that is applied

sour island
#

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

glacial viper
true nova
#

anyone know where the lua is for water bottles?

sour island
#

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.

true nova
#

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/

stiff fiber
#

Does anyone have a vehicle script template that I could use? The one in the Indistone.com's tutorial is outdated.

small topaz
#

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?

sour island
#

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?

bronze yoke
#
local writer = getFileWriter("myFile.txt", true, false)
writer:write(myString)
writer:close()
sour island
#

that is quick, thanks

#

SoonTM

#

Do I need to do something in order for myFile.txt to be created @bronze yoke ?

bronze yoke
#

as long as the first bool is true it'll create it

sour island
#

hmm

#

ah I see the issue

#

Forgot it get dumps into /lua

#

Sweet, it can open the text file too

#

using openUrl

reef sable
sour island
#

@bronze yoke I can just use fileReader:read() to get the text back right?

bronze yoke
#

you need to loop it, read() reads a single character

sour island
#

Ah yeah, it's returning an int

#

Looking over exposed methodcalls - what am I looping over?

#

Vanilla uses while true loops

bronze yoke
#

i usually do something like

local totalStr = ""
while reader:ready() do
    totalStr = totalStr .. reader:readLine()
end
sour island
#

When does it stop being ready ๐Ÿค”

bronze yoke
#

when there's nothing left to read

sour island
#

Thank you, that'd probably have taken me some time to sus out

sharp timber
#

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?

bronze yoke
#

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

sharp timber
#

what if the author declared that all his mods are open source and free for modification?

bronze yoke
#

then yeah, probably

sharp timber
#

hmm, ill just play it safe for a bit and hope he sees and responds to my comment for permission on his profile lol

keen silo
#

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.

wet mountain
#

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?

turbid pike
#

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.

wet osprey
#

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

keen silo
#

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?)

keen silo
# wet osprey hey is there any mod that allows you to create radio transmissions in game? just...

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)

steep vortex
#

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

sour island
#

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

fickle knot
#

And launch first doom somehow?)

wet osprey
covert carbon
#

If I want to override the properties of an item, do I just write the item with the same name in a new file?

buoyant fjord
#

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

covert carbon
#

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

buoyant fjord
#

damn

covert carbon
#

Does anybody know where to find the action that makes your character used bandages to heal themselves?

true nova
#

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

sour island
#

What is the error

true nova
#

[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..

keen silo
# wet osprey oh this is neat, tho it would still be considered adding radio transmissions out...

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)

buoyant fjord
#

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... ๐Ÿ˜ฆ

bronze yoke
#

try trap:getItem():getType()

buoyant fjord
#

will try again

covert carbon
#

YEEEEES

#

I finished a mod for the first time and didnt quit on it

#

what is the metalvalue of an object for?

chrome veldt
#

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

verbal yew
#

guys, how possible to add subcontext menu in existing context menu?

#

like for clean rag from water sources

neon bronze
#

look in the IsWorldContextMenu.lua they have examples for that there

#

i think its called addSubContextMenu or smth similar

cobalt fiber
# verbal yew guys, how possible to add subcontext menu in existing context menu?

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

coral sail
ancient grail
steep vortex
pine salmon
#

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.

sour island
sour island
pine salmon
#

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

steep vortex
#

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

covert carbon
#

Does anybody know how an item's metalvalue affects it?

#

oh its for the microwave

covert carbon
#

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

covert carbon
# true nova 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

true nova
#

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

true nova
# sour island Failed to call means you're trying to call something that doesn't exist - my gue...

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

sour island
#

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?

true nova
#

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

covert carbon
#

Does anybody know where the functions that allow the player to heal themselves is?

#

would that be timed actions?

true nova
#

you want the cheat commands or the natural healing over time?

covert carbon
#

like where is the stitch function found

true nova
#

lua\client\TimedActions\ISStitch.lua

vivid imp
#

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!

true nova
#

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

sour island
true nova
true nova
#

the default for that if thats what your asking the player character no variable

covert carbon
#

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?

true nova
#

lua\client\XpSystem\ISUI\ISHealthPanel.lua i think thats where it checks the inventory

quasi kernel
#

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

tawny sandal
#

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 ?

true nova
#

azas posters

#

aza made a tutorial on youtube

tawny sandal
#

Does it ?

true nova
#

change the names and replace the files

#

thats the one

tawny sandal
#

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

true nova
#

hardest part is all the time in photoshop good luck

tawny sandal
#

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

keen silo
#

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?

keen silo
#

does anybody know of a python library or something to easily work with Recorded Media translations files?

plush sky
#

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

keen silo
#

@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?

torn kayak
#

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

sonic needle
#

sounds like you got some betrayal right there

crystal terrace
#

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

crystal terrace
crystal terrace
#

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?

sour island
#

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?

mellow frigate
crystal terrace
mellow frigate
#

exactly

crystal terrace
#

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

mellow frigate
#

maybe about boost, 25% = default/1, 100% = 2, 125% = 3 ..

crystal terrace
#

ah oki thanks for the info, ill try and experiment a bit to see how the change reflects in-game.

mellow frigate
#

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

pine salmon
#

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 ๐Ÿ˜ฆ

mellow frigate
true nova
sour island
#

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

true nova
#
    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```
sour island
#

player in oncreate is actually the isoplayer, so that's good - difference of usage notwithstanding

true nova
#

and i use oncreate in the item script

sour island
#

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?

true nova
#

yes

sour island
#

what are the items? water?

true nova
#

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

sour island
#

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

true nova
#

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?

sour island
#

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?

true nova
#

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

sour island
#

Food can be tainted and isn't drainable

true nova
#

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?

sour island
#

You don't have to make it a water fillable object to have recipes work with it

true nova
#

yes i know but i wanted it to have an amount so many objects can be made from it

sour island
#

Well, stuff like sugar and salt do that and arent water

#

Could look there

true nova
#

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

crystal terrace
fickle knot
#

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

fast galleon
keen silo
#

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?

keen silo
#

do you know if the ${t:x.xx} behaviour is coded in LUA, and where it is?

keen silo
#

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)

)

keen silo
#

oh no

#

is there a way to set the duration of the lines?

weak sierra
#

i used to have a code snippet to really easily/quickly add a keybind

#

i have lost this snippet

#

anyone hook me up?

bronze yoke
keen silo
weak sierra
#

also hi i was gone for a few months

#

if anyone thot i died, nope

#

bad life times but im good

verbal yew
#

hi

weak sierra
#

hi

#

nobody has the keybind code? :p

keen silo
#

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

weak sierra
#

i am entirely unfamiliar with the media system

#

and busy

#

if i knew i'd help tho

rich void
#

Hey ya'll 1_spiffojump

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
weak sierra
#

always do a check on grid squares because if they are not loaded they will be nil

rich void
#

so just if GridSquare?

weak sierra
#

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

crystal terrace
#

ye roughly 90 tiles or so are loaded at any moment

weak sierra
#

it's a 150 diameter bubble iirc?

#

in square

rich void
#

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

weak sierra
#

around each player

weak sierra
#

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

crystal terrace
#

prolly, i just tested mostly in N-S and E-W directions

weak sierra
#

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

rich void
#

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 kekcry

weak sierra
#

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

rich void
#
---@type IsoSprite
    local isoSprite = getSprite(sprite)
    isoSprite:setName(sprite)

    ---@type IsoSpriteInstance
    local isoSpriteInstance = IsoSpriteInstance.get(isoSprite) 
rich void
weak sierra
#

mmmm

rich void
#

Okay I think I've realised a messup already

#

It requires 2 int's for the way I want to use it

weak sierra
#

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

rich void
#

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

weak sierra
#

yeah he dug deep in weird stuff u can do

ancient grail
ancient grail
#

Iwould help you but right now im stuck taking care of kid . My son is very sickly

rich void
ancient grail
#

all i did was just remove replace a sprite in a loop incrementing by 1 cuz of the tile sheet

weak sierra
#

i do have an old code snippet from u..

#

not sure if applicable or no

rich void
weak sierra
#

he has ascii art in there dw bout that

#

lol

#

this does at least some amount of dynamic creation of things with sprite assignment

ancient grail
#

I recall that when hou chabge the sprite you need to change both the name and the sprite itself

rich void
#

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 ๐Ÿ™

ancient grail
#

Also welcome back @weak sierra

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

crystal terrace
#

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

sour island
#

Who is ready to stab someone over some uno?

crystal terrace
steep vortex
#

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.

rich void
#

Absolute chad coding in notepad++ MuskBlaze

steep vortex
#

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

rich void
crystal terrace
rich void
#

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

bronze yoke
#

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

crystal terrace
#

i wanted to look cool as well, tried neovim for a couple of days. Unfortunately had to quit.

rich void
#

Tried to close neo vim and couldn't, pulled the powercord out the back of my pc and uninstall forever pepe_cry

sour island
#

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

rich void
#

Intellij is clean asf

sour island
#

I'm blanking on the new one's name now

bronze yoke
#

umbrella?

sour island
#

the old one is CAPSID (and is basically abandon-ware)

#

I think that's it

bronze yoke
#

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)

sour island
#

I'll not update intelliJ then lol

bronze yoke
#

yeah, intellij versions from 2023 rewrote a bunch of the intellisense and none of the lua plugins have caught up

rich void
bronze yoke
#

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

sour island
#

anyone know why the sprites are getting blurry?

#

I had this issue with other stuff - but it's kind of important for this lol

crystal terrace
#

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.

bronze yoke
#

never written any java but capsid sent me down the jetbrains pipeline

#

and now my start menu is all jetbrains

crystal terrace
#

jeebus

#

you got em all

rich void
#

I heard jetbrains are working on a new IDE atm

#

Think it's got a beta build

crystal terrace
#

i think only IDEA takes a while, its a bit heavy.

bronze yoke
#

idea's startup time used to annoy me but clion has it beat by far

crystal terrace
#

but certainly there's no better alternative for it when it comes to java from what ik

rich void
#

God bless

crystal terrace
#

it's like cutting your arm off to forget about the headache that's been bothering youdrunk

#

btw @bronze yoke your guide on sandbox options was really helpful and easy to understand.

bronze yoke
#

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

rich void
#

Thanks to @ancient grail and @weak sierra for the help before btw, now got my flags spawning on 4 corners after territory events ๐Ÿ‘Œ๐Ÿป

crystal terrace
#

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.

bronze yoke
#

it's one of the things that comes up here a lot

weak sierra
#

grats

steep vortex
#

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

sour island
#

try looking for "thump"

#

Zombies can only thump thumpables afaik (and cars)

steep vortex
#

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.

steep vortex
#

๐Ÿ˜† 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.

rich void
#

could be worse, could have anime ...

crystal terrace
#

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๐Ÿ‘€

rich void
#

#balanced

rich void
crystal terrace
#

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.

rich void
#

24 hours to smash the best house together I can ๐Ÿ‘€

crystal terrace
#

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.

true nova
tawny sandal
#

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

true nova
tawny sandal
chrome veldt
#

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.

โ–ถ Play video
crystal terrace
#

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?

steep vortex
# rich void https://zomboid-javadoc.com/41.78/

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?

crystal terrace
bronze yoke
#

just access them directly

#

Perks.Fitness, Perks.Strength, etc

crystal terrace
#

so i can just use em instead of creating perk objects

bronze yoke
#

they are the perk objects

crystal terrace
#

is my hardcoded table going to be a problem?

bronze yoke
#

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

crystal terrace
#

i remember you warned me earlier, but at that time i was overwhelemed with other problems in mod so left this one for later.

crystal terrace
bronze yoke
#

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

crystal terrace
#

oh ok oki i can look at docs i think it has complete list of names

bronze yoke
#

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

crystal terrace
bronze yoke
#

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

crystal terrace
#

interesting i suppose i will just stick to perks only then

bronze yoke
#

so maybe hardcoding it is easier

crystal terrace
#

ill try to make this perks.perk stuff work then maybe i could checkout the other way of without hardcoding it, small stepsfrog

#

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?

bronze yoke
#

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},
}

crystal terrace
#

oh this makes sense now, ill get started with this one. Thanks

sour island
#

You can also check if there is a parent

#

Parent perks don't have a parent or have the parent perk of none

crystal terrace
#

that's one good way to verify, ill test it out

keen silo
#

@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

bronze yoke
#

isn't that always the behaviour?

#

as in i think radio lines also do that

keen silo
#

kinda

tawny sandal
#

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,
}

{

}

keen silo
#

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

keen silo
crystal terrace
mellow frigate
#

is there something that prevents controller users to set their keybindings like keyboard users do ?

crystal terrace
#

not exaclty sure, i usually set the key bind via options and then simulate that keybind via steam input

crystal terrace
# tawny sandal Hey guys so I'm trying to make a mod to replace an existing poster in the game w...

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)

tawny sandal
#

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

crystal terrace
tawny sandal
#

Alrighty thank you

chrome veldt
#

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

crystal terrace
#

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

chrome veldt
crystal terrace
#

let me try, i believe it should be the left side values from the table in the middle.

chrome veldt
#

Also the "FromString" might be an issue, can you filter it out beforehand?

crystal terrace
#

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?

chrome veldt
#

I'm not sure what's wrong tbh, discovering lua and modding myself

tawny sandal
#

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

crystal terrace
#

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.

chrome veldt
#

good luck my friend

tawny sandal
#

Is there a way to make a mod to remove static objects from the game ?

#

The posters specifically, they are kind of objects

bronze yoke
#

i think you might need to do a numeric for loop anyway since Perks includes the enum functions too

rich void
#

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 dumb 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

fast galleon
# crystal terrace after a lot of retries, can't seem to figure out the issue here. I do get the ta...
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

#mod_development message

crystal terrace
crystal terrace
#

was able to generate a table of skills with the help of Poltergeist's suggestion

quartz holly
#

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

crystal terrace
rigid pecan
#

anyone knows how i can "create" more zombie speeds than available in vanilla? similar to the mod Personalized Zombies

quartz holly
#

I just want to change the image of when you place an explosive on the ground

fast galleon
#

have you made a model script for it?

quartz holly
#

yes

#

I have absolutely everything created, I only need that

crystal terrace
#

are you sure about prefix "Item_" in placed sprite? havent used so no clue

quartz holly
#

I want to see the 3D design or a 32x32 png

fast galleon
#

can you show the model script? you should also check logs for it.

quartz holly
#

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

fast galleon
#

ah, PlacedSprite works with traps. From what I understand, you haven't added a new tile for the PlacedSprite.

quartz holly
quartz holly
fast galleon
#

try removing it first

if you remove that line, it should use the picture you see in your inventory

quartz holly
#

ok

crystal terrace
# quartz holly ok

also can you show us how you named textures? in your texture directory

quartz holly
#

It could vary if I wanted to add the route weapon/1hand

crystal terrace
#

does it make a diifference if its Item vs item as prefix? i mostly used the latter

quartz holly
#

mmmmm

#

good point I'll try

crystal terrace
#

try what poltergeist suggested

quartz holly
#

that's what I'm doing, apparently I just have to put the texture in a PACK file

#

and create folder

#

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

crystal terrace
#

shouldn't it give me the name based on game's language?

fast galleon
crystal terrace
#

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.

fast galleon
quartz holly
#

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

sour island
#

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

thorn shuttle
#

For vehicle seat, i notice hasRoof. What it actually do ?

tardy wren
crystal terrace
gilded hawk
#

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
fast summit
#

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?

sour island
tardy wren
#

Sometimes it works, sometimes it doesn't

#

MY only idea is... Try doing it from the server's side of things?

crystal terrace
sour island
#

That's what I do for skill recovery journal's tooltips

wise ferry
#

man

crystal terrace
sour island
#

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:

crystal terrace
#

Oki interesting I thought it was just for the English language.

sour island
#

Nah, those are the IDs - you can also use getID on a perk object and you'd get these strings

crystal terrace
#

I might be able to work with this then, thanks.

gilded hawk
#

Is there a way to make it so that my mod is always the last to load using the event onGameBoot?

sour island
#

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

gilded hawk
#

Mh, these are good idea. I'll give it a shot

crystal terrace
#

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...

bronze yoke
#

Perks[id] returns the object

crystal terrace
#

wow that's even better

chrome veldt
#

Hey there, Is modData limited to a specific data size?

crystal terrace
#

i tried to use Perks[id] , perk seems to be nil.

fast galleon
#

is targetSkill instanceof Perk or is it a string?

crystal terrace
#

its a string val

fast galleon
#

if you print it, it shows the id of the perk. How sure are you?

crystal terrace
#

are you saying it does on your end? or are you asking if it's the correct id of skill

fast galleon
#

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.

crystal terrace
#

so like targetSkill is not just a name? but perk object?

fast galleon
#

that would explain why you didn't get translation names too

crystal terrace
#

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?

fast galleon
#

you can check target skill == "Nimble" or type(targetSkill) == "userdata" or instanceof(targetSkill,"Perk")

crystal terrace
#

no i meant like just getting the index from index,value pairs

fast galleon
#

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

crystal terrace
bronze yoke
#

you don't create a new one when you do that, you're just retrieving it again

wise ferry
#

does anyone have the name of a sound file of character being dragged down or eaten alive? essentially its name and location

crystal terrace
#

oh is it going to change the end results? my goal was to store the current xp and levels and store em

tawny sandal
#

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 ?

keen silo
#

@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)

crystal terrace
crystal terrace
keen silo
#

or perhaps OnTick, but I don't want to fill that up too much

bronze yoke
#

you can just hook whatever function the ui uses to set the fast forward

#

instead of checking constantly

mellow frigate
bronze yoke
#

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

crystal terrace
#

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

rocky berry
#

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

steep vortex
#

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

spark apex
#

Extra stats?

#

nah sounds bad

#

im not good at naming gl doe

#

Customizable building health?

steep vortex
#

That's rather good, thanks. Straight to the point and desribes what it does.

covert carbon
#

stupid question sorry. Not labelling a function as local will mean its accessible to all files right?

bronze yoke
#

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

keen silo
covert carbon
bronze yoke
#

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

covert carbon
#

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

crystal terrace
covert carbon
crystal terrace
#

should be doable

covert carbon
#

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

crystal terrace
#

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

covert carbon
#

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

crystal terrace
#

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.

covert carbon
#

ive found the code that makes it that way I think

covert carbon
#

what does "require" mean?

#

like when a file's code says
require "INSERTFILENAME"

azure shuttle
#

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

turbid pike
#

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?
half void
#

what is the best way to start learning modding in pz? ๐Ÿค” (I already have knowledge in LUA)

bronze yoke
#

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

turbid pike
#

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.

keen silo
#

you could try verifying the game files integrity

turbid pike
#

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.

keen silo
#

perhaps you modified something accidentaly in your game folder directly ๐Ÿคทโ€โ™‚๏ธ

bronze yoke
#

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

turbid pike
#

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.

true yoke
#

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

nocturne canyon
#

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

bronze yoke
#

i think it's based on the Medical=TRUE property and not the display category

#

@nocturne canyon

keen silo
#

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

thorn shuttle
#

so editing vehicle script especially engine specs only applies to to undiscovered vehicle ? PES_Think

wise ferry
crystal terrace
sour island
#
{["perkID"] = level} or {["perkID"] = {level=0, xp=0, extraInfo}}
#

There is virtually no reason to use the translated text internally

crystal terrace
#

I fixed it now, after your suggestion for the perk ID๐Ÿ˜„

sour island
#

Ah, was that old? Discord sometimes doesnt load

crystal terrace
#

Yep

sour island
#

My bad lol

#

I'm seeing how much chatter actually occurred now - idk why the web version does that

sour island
#

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

fast summit
#

Where can I find out about what getScriptItem() does?

#

NVM I used common sense and figured it out XD

fast summit
#

Would this be the correct way for lowering someone's body temp? character:setTempurature(stats:getTempurature() - 5);

#

stats is a variable thats already set

fast summit
#

Mispelled temperature but that's fixed now too

crystal terrace
keen silo
#

@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)?

bronze yoke
#

nope

keen silo
#

nope you don't know or there is no way?

bronze yoke
#

i don't know

fast summit
crystal terrace
fast summit
#

Not relying on it, more a fun little mechanic lol not really necessary. Thank you!

crystal terrace
#

ah alr

uncut meteor
#

Hello does the getModData() save the data even if i quit world /server?

bronze yoke
#

yes

cobalt fiber
sour island
sour island
heady crystal
#

Looks amazing!

#

I am HYPE

nocturne canyon
#

BetterSorting changed the displaycat's from "Medical" to "Med" >.>

sour island
#

Stuff like that should be handled with tags tbf

sour island
#

Still working out the kinks - it's having issues not grabbing the board sometimes

true nova
#

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?

fickle knot
#

Am i wrong, but translation files work without {} ???
Forgot to add closing brace bracket and it seems to work

prime sandal
#

new to modding, does anyone know where bodytemp is declared?

crystal terrace
short lotus
#

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.

prime sandal
prime sandal
#

would anyone be willing and available to have a look over some very novice code? trying to make my first scripting mod.

true nova
short lotus
tardy wren
#

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

short lotus
#

Maybe some of them got OnGiveXP code?

tardy wren
#

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,
    }
short lotus
#

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.

short lotus
fast galleon
tardy wren
fast galleon
#

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.

fast summit
fast summit
sour island
#

Had to redo the icons for the vanilla boards to match the new chessboard

fast summit
fast summit
#

Now I'm having issues with this line in my lua: bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 5);

crystal terrace
fast summit
fast summit
sour island
#

It would help if you caught 'nil of X'

#

or 'X of nil'

fast summit
#

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
fast galleon
fast summit
#

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

fast galleon
#

you need the object from a character, not the class.

fast summit
crystal terrace
fast summit
#

so getPlayer():getBodyDamage():getUnhappynessLevel()..........?

crystal terrace
true nova
#

is it possible to add sandbox settings that tell the game not to load recipes that are part of the mod?

wintry knoll
#

a quick question

#

do new tiles need code associated with them?

fast galleon
true nova
fast galleon
wintry knoll
#

ok, fantastic

#

i have a lot of new tiles to design then

fast galleon
true nova
fast galleon
#

adding items should be done only the regular way, in order not to ruin the saves.

quasi kernel
#

Chipping away at the old farming patch mod again, painful but more interesting this time.

quasi kernel
#

The agony of finding out that Mod Manager doesn't maintain the Mod Load Order on the reloading of lua

muted garnet
#

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

sour island
#

I don't supposed there's a way to determine model size in game is there?

sour island
#

Slowly coming together

true nova
# sour island

I get more hyped every time you update! So does this show any 3d object within the tile?

sour island
#

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

true nova
# sour island

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

dapper finch
#

hello is this where i ask for coding help?

sour island
dapper finch
#

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

sour island
#

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.

dapper finch
#

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

sour island
#

NPC as in something like superbsurvivors?

true nova
dapper finch
#

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

mellow frigate
#

The invasion of Roomba.. Terrifying

sour island
#

Are you using the mod CowsWithGuns is working on?

dapper finch
#

i'm not

sour island
dapper finch
#

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

sour island
#

Cows is very very active

#

Check out his posts on the community modding discord

crystal terrace
dapper finch
#

alright i'll give it a try

#

thanks everyone

#

@sour islandi can't reply in that channel

#

i'll take a look at it

sour island
#

You have to link your steam

crystal terrace
dapper finch
#

okidoki

#

this is a lot of information to take in so i'll absorb it and be back

true nova
crystal terrace
#

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.

tiny karma
muted garnet
#

Tell me please is there any way to turn off the sounds played earlier

keen silo
bronze yoke
#

if you do not own the copyright to materials in your mod, your mod could be taken down permanently

keen silo
#

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 ๐Ÿ˜”

bronze yoke
#

i will note, without offering legal advice, that copyright infringement is rampant on the workshop and action is extremely rare

keen silo
#

yes, but I do not want to risk it

#

perhaps I'll make it an addon if I feel like it

bronze yoke
#

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

drifting ore
#

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

muted garnet
#

thanks. I Founded

median field
#

Guys I think adding the 4 bore rifle would be awesome

remote sonnet
#

Nvmd.

sour island
#

I think short of the dice/poker chips - this covers all the vanilla game items

quasi kernel
#

That's so neat!

sour island
#

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 ๐Ÿ˜ˆ

dawn bane
#

Can't wait

quasi kernel
#

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.

sour island
#

Dynamic is good

quasi kernel
#

Wheat seeds from LGR and SF Farming TIme working together

sour island
#

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

quasi kernel
#

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

neon bronze
#

Put an exclamation mark in the beginning in the mod id

quasi kernel
#

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.

quasi kernel
#

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.

fast galleon
#

@quasi kernel
file: !_FarmingCompat.lua

require "A"
require "B"
require "C"
quasi kernel
#

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.

fast galleon
#

mod load order is irrelevant

quasi kernel
#

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

fast galleon
#

are all the files you need to require in same subdirectory, e.g. server?

quasi kernel
#

Yes.

#

File i'm attempting to load before

#

If I recall, numbers should load first, but I already tried it with A anyways.

fast galleon
#

server/!_FarmingCompat.lua would load before the other files and then you can require in whatever order you need

quasi kernel
#

Not sure how file safe it is, but I guess it's worth a shot.

fast galleon
#

except for vanilla, which would load earlier

quasi kernel
#

Which is expected

#

And we're right back to the error screen

#

Lovely.

fast galleon
#

what error?

quasi kernel
#

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.)

fast galleon
#

use require if LGR overwrites the file

quasi kernel
#

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.

fast galleon
#

if they have same name only one is loaded

quasi kernel
#

?

fast galleon
#

a number of mods copy vanilla files to make changes, only the modded file is loaded obviously

quasi kernel
#

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.

fast galleon
quasi kernel
#

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.

fast galleon
#

I mean he has 3 files there with vanilla names.

quasi kernel
#

I end up overwriting those with my own later down the line, those files should be irrelevant.

fast galleon
#

geez

quasi kernel
#

I genuinely have no idea why this is happening, it's driving me insane.

fast galleon
#

how do you use require?

quasi kernel
#

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.

fast galleon
#

Line 15 breaks because farmData.props["legourmetfarming.CafeSeed"] doesn't exist, even when it should.

fast galleon
#

use require to load the files in the order that you need, good luck

quasi kernel
#

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.

neon bronze
#

You could require the vanilla patcher in your modid to make sure it loads before your mod

quasi kernel
#

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..?

neon bronze
#

Sofar i know require doesnt overwrite anything it just makes sure the files are loaded before execution

quasi kernel
#

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)

neon bronze
#

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

quasi kernel
#

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.

neon bronze
#

So your load order would be vanilla patcher -> your mod -> lgr?

quasi kernel
#

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

neon bronze
#

Do you know the lgr mod id?

quasi kernel
#

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.

neon bronze
#

Oh god le gourmet

quasi kernel
#

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.

neon bronze
#

Does your mod change anything in lgr or its files?

quasi kernel
#

Only a few client-sided files.

#

Which is unrelated to what I'm trying to get to load.

neon bronze
#

Then lgr has to load first

quasi kernel
#

Im over on the server atm

neon bronze
#

If you dont load lgr first it wont be able to change them

quasi kernel
#

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.

sour island
#

You can use requires to ensure loading first afaik