#mod_development
1 messages · Page 340 of 1
the distance is modelled around the player's location, but spatialisation happens around the camera
Nothing I did worked. I can’t expect others to babysit me, but if anyone has run into this error specifically on Linux - feel free to share. Not really sure what I’m missing.
At least I fixed the file directory 👍.
I have the same issue
@gloomy hatch I think this commit https://github.com/timbaker/tiled/commit/8a036db78cd6c2283bc8da51d0dbe2e742b0a71b should fix it, and perhaps the solution is to build it from source, which I haven't tried yet, but fairly sure it should fix the problem
I've straced it to failing syscall
linkat(AT_FDCWD, "/proc/self/fd/42", AT_FDCWD, "/home/lexx/.TileZed/Tilesets.txt", AT_SYMLINK_FOLLOW) = -1 EXDEV (Invalid cross-device link)
and backtrace from debugger showed
Thread 1 "TileZed" hit Breakpoint 1, 0x00007ffff5bb2310 in linkat () from /usr/lib64/libc.so.6
(gdb) bt
#0 0x00007ffff5bb2310 in linkat () from /usr/lib64/libc.so.6
#1 0x00007ffff61dbf92 in QTemporaryFile::rename(QString const&) () from ./lib/libQt5Core.so.5
#2 0x0000555555772389 in SimpleFile::write(QString const&) ()
#3 0x0000555555712e78 in TilesetsTxtFile::write(QString const&, int, int, QList<TilesetsTxtFile::Tileset*> const&, QList<TilesetsTxtFile::MetaEnum> const&) ()
#4 0x0000555555831beb in Tiled::Internal::TileMetaInfoMgr::mergeTxt() ()
#5 0x00005555558324b5 in Tiled::Internal::TileMetaInfoMgr::readTxt() ()
#6 0x00005555556745d7 in Tiled::Internal::MainWindow::InitConfigFiles() ()
#7 0x00005555556216f0 in main ()
so clearly usage of QTemporaryFile::rename across filesystems is the issue, and it can be worked around like in mentioned commit
anyone know if global moddata is available during character creation / profession creation menus
figured it out
lmao, never knew that sprinting into a wall makes you fall down.
Guess I got no excuse now not to implement crashing into things and falling off the bicycle
how can i mod it so scythes can take down corn plants/stalks?
they dont need to return anything, just want to reclaim space
Check out the upcoming v1.1.2 update for Modix Game Panel! Project Zomboid is fully supported, and here’s a quick look at the web based panel running on my tablet. Modix will have full mobile and tablet support manage your zomboid servers anytime, anywhere! Tons of goodies for PZ Server Owners. v1.1.2 drops 31 July. https://steamcommunity.com/sharedfiles/filedetails/?id=3422448677 *Dev Build Preview
does remove grass (not using scythe) work for it ?
yes
Hello, I would like to know how to place objects with 100% probability in a specific container with a script and in which directory to place it for build41.
You probably want to go with an event to chose to add the item to a container
look for farming_vegetableconf.props.Corn i believe it just needs scytheHarvest = true, added to that table
ah i misunderstood. you just want it removed
you can modify ISRemoveGrass timed action and add the scythe to it and change whatever values for it
@bright fog but si 100% chance . I need crate a base for misión military
What ?
With this event, can I guarantee that the item is inside the container? Or is it with a roll?
I need to create a map and have specific containers with specific items inside it and they must appear in the quantities I want.
The event triggers when loot gets generated in the container
So all you have to do is verify that it is the right container
And then add the item
I have a mod that is conflicting with another mod and I'm curious if I'm mucking with this function in a bad way to cause the issue:
-- my code
local old_ISGrabItemAction_new = ISGrabItemAction.new
function ISGrabItemAction:new(character, item, time, dest)
local t = old_ISGrabItemAction_new(self, character, item, time)
if dest ~= nil then
t.destContainer = dest
end
return t
end
-- their code
local OriginalGrabItemAction = ISGrabItemAction.transferItem
function ISGrabItemAction:transferItem(obj)
local item = obj:getItem()
if something then doSomething end
OriginalGrabItemAction(self, item)
end```
Does the original transferItem function have a return value ?
If yes, make sure to return its result in your function
Else
it doesn't
Are you SURE you have a conflict ? Decorating a function means it'll appear in the stacktrace of an error in that function called from other mods
not passing in the dest argument can be problematic, but it looks like you're dropping it on purpose, is there a need for that?
Bcs it's a custom param
He added a custom one
dest is added, it's not in the original function
Does that other mod do that too ?
i'm gonna say don't do that, that is problematic 😅
Yea definitely won't make it as a compatible as expected
why do you need to override if all you're doing is adding an argument? can't you use an entirely separate function?
I figured I was safe as long as long as another mod wasn't trying to do what I did
That's true actually
local function createWithDest(character, item, time, dest)
local t = ISGrabItemAction:new(character, item, time)
if dest ~= nil then
t.destContainer = dest
end
return t
end
You don't modify the original calls of the functions in the vanilla code anyway, you're using a custom function at the end of the day
So there really is no need for that
you really want to avoid making api changes
Or that means you're modifying how the original function is called at some various places (which still probably should use a specific function for that)
tunnel vision is fun
Happens
I really hope the person making Inventory Tetris can make all of PZ mods compatible because it's so much fun.
Is it possible to disable / enable certain sounds from playing for specific players, like if they want to disable a notification sound or change it, in their personal mod options rather than sandbox
Just made the same mistake, tried so many different things in code for like 40 minutes
detect it then disable
theres no way to fetch the specific sound being played so you have to put those sounds inside a table and have a listener check that table
Hey guys i was wondering, is it possible to implement something for a pvp server such as, when a player enters a certain area "hot pvp spot area" , lets say WestPoint, his location becomes visible to everyone on map / all those in the same "hot spot".
Or maybe has someone tried something like this before?
Anyone got an EAS alert mod that plays in radio and TV? Like a real time updating one?
One that updates whwre quarantine areas and just general news about the knox virus?
@deep vale Sry for late response, been afk for a while. You can do this, all you need is to determine absolute x and y range of your hot spot area, check if player x and y in that range and show player on map (check out players on map mod)
Guys how do i make a texture mod for a car, if i dont want it replace existing but kind of add it to already existing textures so the car with the texture is gonna be spawned with some chance
possible
you can force it upon entering
but you sorta need to spam maybe
there might be other ways
guys what is the best way to learn how to create mods for project zomboid ?
Read guides and experiment with small mods.
yeah i need to try with small mods at first ofc
but idk what is the best guide to read
Idk, start reading. 👍
cuz i feel i am lost bcuz idk how i can make items, i am lost between 3d and 2d
okay then
I usually just reuse some vanilla item's 3d model, and then tweak the new modded item's value.
Only been modding for like a week so far.
Someone else might know more!
Is there a context menu tooltip max length
Hey so I have models made for scars and stuff but I have no idea how to code it can anyone help out?
Do you have a specific mod idea you'd like to make? As well as the modding wiki (which is an excellect resource) we can point you in the best direction to get started, or to break it down into smaller pieces to get started with.
(Or we can shatter your dreams by pointing out that what you need is handled in java and not accessible to mods, but that's just part of Zomboid modding.)
hey folks, is there a way to make a bag that only accepts items of a certain displaycategory?
Yes, there is the option to add a filter function to a conatiner.
Look at the vanilla items like ammo bandolier, wallet etc
i do know of OnlyAcceptCategory, but that seems to apply only to the item Category and not its display category
there will be a line in the item's script naming a lua function that decides what is/isn't allowed.
and i couldn't seem to find anything about filtering specifically for the display category
And since it's a lua function, it can use any logic you like to decide if an item is allowed.
oh i see what you mean now, ok i'll sniff around!
AcceptItemFunction
The vanilla ones are all in AccecptItemFunction.lua, but you don't need to use that namespace - just make a non-local function with (container, item) as the prarameters that returns true the item is allowed.
--***********************************************************
--** THE INDIE STONE **
--***********************************************************
AcceptItemFunction = {}
-- The item.AcceptItemFunction script property for item containers
-- specifies the name of a Lua function that will be called to test
-- whether an item is allowed inside a container. The function name
-- may contain "." characters. For example:
-- AcceptItemFunction = AcceptItemFunction.FirstAidKit,
-- Example: not used
function AcceptItemFunction.FirstAidKit(container, item)
return item:getStringItemType() == "Medical"
end
-- -- Example: not used
-- function AcceptItemFunction.KeyRing(container, item)
-- return item:getCategory() == "Key"
-- end
function AcceptItemFunction.AmmoStrap_Bullets(container, item)
return item:hasTag("Ammo") and not item:hasTag("ShotgunShell")
end
function AcceptItemFunction.AmmoStrap_Shells(container, item)
return item:hasTag("ShotgunShell")
end
function AcceptItemFunction.KeyRing(container, item)
return item:getCategory() == "Key" or item:hasTag("FitsKeyRing")
end
function AcceptItemFunction.HolsterShoulder(container, item)
return item:hasTag("PistolMagazine") and container:getItems():size() < 2
end
function AcceptItemFunction.Wallet(container, item)
return item:IsMap() or item:IsLiterature() or item:hasTag("FitsWallet");
end
oh this is perfect, should be super easy, thank you!!
yep, just use item:getDisplayCategory() (and hope the display category hasn't been changed by other mods)
My brain registers the ears as eyes, eyes as nostrils, and white part as a mouth, in your profile picture every single time I see you and I don't know why
The black part of the ears also registers as eyebrows
Took me a long time to see it the right way, now I do if I actually look at it, but I still see the face when I see it in the corner of my eye. Just thought this was important info i needed to share with you
so why is the model floating? it check the model in blender and the .txt files and they look fine
I've made a clothing mod, but whenever i put it on my character, he becomes invisible, how do i fix this?
nvm im so dumb the origin of the model wasnt centered
Dude I see the exact same thing lol, always thought it was some demonic face until I saw it bigger one time and noticed it's a fox
I don't see it haha
what does self:adjustMaxTime do in TimedActions?
it returns a duration adjusted by negative moodles
so things like unhappiness, drunkenness slow down timed actions
Got it, thank you!
Anyone know if the watch UI (the one showing in the top right corner when you equip a watch) is fully java side or if it can be manipulated with Lua? From my digging it seems to be java sided but thought I'd ask
Been so long since I raw-dogged html, forgot how much I dislike it 😩
This will reset the checked boxes every time you close and re-open though, gotta save to local storage
Yeah, i just need it while I play, but storing it does make sense
Just add this to your script tag:
document.querySelectorAll('input[type="checkbox"]').forEach(cb => {
cb.addEventListener('change', () => {
localStorage.setItem(cb.id, cb.checked);
});
});
window.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('input[type="checkbox"]').forEach(cb => {
const saved = localStorage.getItem(cb.id);
cb.checked = saved === 'true';
});
});
Thanks! beat me to it lol was working on it already
I was gonna do it like:
document.querySelectorAll('input[type="checkbox"]').forEach(cb => {
const key = cb.id;
cb.checked = localStorage.getItem(key) === 'true';
cb.addEventListener('change', () => {
localStorage.setItem(key, cb.checked);
});
});
Yeah that definitely works as well and is more compact
looks like it's locked up in java. you could maybe hide it and then roll your own
Yeah that's the conclusion I've come to as well :/ Was hoping for an easier solution but oh well, that's life when modding PZ lol
Lol I'm glad I'm not insane
It's times like these when everyone's listing problems in my mods that are based entirely on zomboid limitations that I realize how actually bad modding is 
Too many things locked behind java and too much jank. I know it's lower priority than working on the actual base game, but it's burning me out
Help. How can I make an item that can be translated into different languages? Try to follow what the page says.
ItemName_EN = {
Base.LoreNote001 = "Whispers in the Dark",
}
the display name you set does not matter, it's just the item's full type (but you have to set one for some reason, or translation will not work)
as prophesized a few days ago, i have learned the gun ammo count tooltip is hardcoded in java and my mod dreams have been crushed
every mod i've seen shows your ammo in MORE places, has anyone ever considered i don't want to see it at all
It worked perfectly! Thank you very much!
it is possible to remove elements from java-created tooltips, my library adds higher level API for it: https://demiurgequantified.github.io/StarlitLibrary/modules/InventoryUI.html
what you want would probably involve InventoryUI.getTooltipElementByLabel and InventoryUI.removeTooltipElement
I believe it’s fully Java if you were still waiting on an answer
a twinkle of hope from a starlit library.. i will look into this thanks
Yeah it unfortunately is :/ I looked through the decompiled Java and there's just no way to change it with Lua
But it's okay, it was just a minor part of a bigger mod, and the person requesting the mod says it's not an issue if the watch UI can't be changed, so it's all good! 😄
just released my mod, if you fancy you can check it https://steamcommunity.com/sharedfiles/filedetails/?id=3533237085
Oh sick, will definitely give it a try! Been using guns a lot more lately and getting aiming up is a goddamn chore the first couple of levels, this should help a lot
yes, it fixes that!
and works with the obsolete chance to aim mode
even if you dont hit the zombie, it do a simple "raycast" with checking zombies around cursor
well technically CanSee innate function in pz is raycast but its not costly
it should be less performance heavy than atro that does actual raycast/collision
i also have an old mod i was working on that attached guns to zombies on spawn, create holster if necessary and then spawn appropriate randomized ammo and mags upon death, but idk if i release it, i worked on containers spawns too, would have to prune code and do a simple branch with just zombies.
hello! i am new to the mod world and wanted to create my first mod where i chose pz as the game (b42). to learn modding the game, i wanted to make a very simple mod where it adds spoilage timers to dry breakfast foods like cereal, oats, tea, and coffee in the game (changing the food properties as a mod). i was about going to test it but i am not sure how my mod directory supposed to look like and where do i put it to the game folder for testing? i attempted to put it in "zomboid/mods" folder which the mod fail to appear. i watched some videos of making pz mod but i feel like i am missing steps. mind helping out?
also do i have to import my mod file here to diagnose the problem?
@floral tangle copy existing mod and then adapt it
tried it
lack of empty common folder is also a culprit
empty common filder hm?
like this right?
also you have very nice idea, yes
for those that long play could be interesting
instead of just hoarding
aw thanks! i came up with idea when i thought why dry foods last like eternity without any expiration
flour definitely spoils after some time, i had a pack of flour opened for six months and it got stale
true! thats why i am trying to make a mod that expires all dry food
but i am conducting on a small scale first
however the mod still not showing up
my mod ids are right
wheres b42 folder?
ah
its all coming together now
no wonder i saw several other mods with b42 folder
idk but my mod didnt list without it
game is janky so all kinds of stuff is expected but not immediately obvious
heh i am new the the modding world so this is a pretty steep dive
@vital sedge i shall paste my media folder into b42 folder right?
yes
got it!
the common folder holds files that are used by every version of the mod (usually assets), it's probably a bug that you have to have one though
that makes sense
anyway i am going to boot up zomboid and see if it loads up
seems like no
hmmm
really just copy other person mod, change name and id and it should work
lets see...
to make sure name your lua folder as the id, and your script too
oh and your mod folder too
i think i have to also put mod info in b42 folder
saw it on other peoples mod
its not rocket science, you will get it eventually
oh cmon it still doesnt appear
i think the game mod loader havent refresh the list yet
or do i have to create common file who knows
huh
all of my b42 mods i subscribed have common folder
i will give it a try now
doing that before i literally copy someones mod info
huh
i think thats my mod
FINALLY
copy other people shit, change names, change folder names, and it will work bro
nice
i think thats because
i uh
earlier i spaced the lines
or because of i do this in separate mod info in 42 folder
or both
i am going to try mess around
AHHH
yes the mod info file has to match
now i see
the mod doesnt appear purely because i added spaces like this
wait i meant
what spaces i dont see them
i meant this
ah you added empty white spaces after the lines?
yeah tabs
parser should solve this, must be some bug then
well since the mods loaded even though i removed specifed version
i am going to keep empty common files though...
nothing like forgetting to remove git folder before uploading your mod where your email is stored...
im that stupid
now i will get penis pump spam for sure lol
XDDDD
@vital sedgebut anyways i am going to say i am very grateful for your guide on making my first mod! its been a headache trying to solve it only to end up with the most simple fix
version control is a nice feature and i cant go back to coding in notepad but stuff like this can happen
@floral tangle no problem!
you cant code it in?
you can for sure, but vs code is just better
i used visual studio before for c# and web development was very sceptical of vs code, but in the end its great for small-medium size projects.
oh i tried to use visual studio for my coding platform
you can hook it to github and dont worry about losing code
but it fails to install when i run the installer for idk reason
visual studio is humungous stuff for this, its like trying to squash a a fly with sledgehammer
i am so interested in what visual studio could provide,it has soo much addon and library
vs code has too!
maybe i will find a way to fix the installer issue of mine
check the net framework
hm i will
have all the aio installed
after i done test this mod of mine which is going to take a short time
ahahaha! it does work!!!!
i am now in ultimate peace
oh wait i havent checked if it also expire if i pour it in a bowl
use the expiry bar mod to check the expiry date.
man i maybe should increase the amount of cooking items because i am trying to find bowls on 2 house and got none
oh right i forgot about that, because cereal (packaged) has longer expiration date than cereal(bowl)
but first i am going to find a bowl
huh 3 house and still no bowl,how annoying
oh comeon
oh wait i forgot to just use milk carton
wait a minute
why i am doing this
its already on default
i am sooo silly
i am actually plan to make this mod to make all dry foods perishable even though they last long
but it seems i should include other food items such as milk carton,juices and other drinks that also should expire
followed with settings such as when a can is opened the expiration date will be sooner similar to canned food mechanism
Are you not testing in debug mode? You can spawn items instead of having to go look for them
had to reminiscing back. its my dream to make a mod for porject zomboid since its being my most favourite game of all time. the dream was like 1-2 years ago. didnt think i managed to make one today
i am aware of debug mode existing but i forgot how to enable it :p
i will look it up
Right click the game in steam, choose properties and then just add -debug to the launch options
thanks, ah now i remembered it
i used to do this to run debug mode in b41
its been a while since i run debug...
afaik you can also create scenario or option and add necessary items so you have them each time you start game. Restarting is sometimes useful as the reload lua option/reload particular script not always work for all the code i think. @floral tangle
oh yeah similar to spawn with items command in multiplayer setting
depends on the lua youre trying to reload
@floral tangle i see you launched your mod, congrats.
wow that was fast
did it really become popular that quick?
oh sometimes i forgot most recent panel exist
i wish PZ had inheritance and dynamic editing of item properties because any mod that edit item will confict with any other mod that also edit some other properties of said items
well its up to modders to create the framework for it
nah, it's TIS job to replace the legacy code, the new additions like cars[not exactly new lol], crafting, they start to move into modern coding practices, PZ started as a small project so direct typed items were the easiest path
fair point
like i wanted to make a stone that can be heated in campfire, just extend the regular stone class and then it could be used in all the relevant recipes, but nope thats not possible. As for why i want to heat stones, it could be used to purify water in primitive survival using also a carved wooden log
right now i am working on the rest of dry foods subset and man i have been like working on this mod for 13 hours straight
my head hurts imo
leverage ai to do the bulk of mundane work like batch replace something
i did try to attempt that but then some ai could recognize and cant accept full code lines
so i take the old school route
if you cant paste whole file into ai. then ask for let say python script to read file and batch change something
maybe its possible but it will be assigned into cooking category as cooking item
you can add iscookable to stone, but that will replace base game files/definition and thats just bad for compatibility :/
but thats the PZ problem for all the mods that touch items unfortunately
unless you make new items then thats fine
sapph for example use some lua to intercept stuff too beside changing item def
but i stopped using that mod, too much bugs still
you need to declare new item that can still use the same world item model, but then you will have to modify the distribution table so that thing can spawn
yes
i think TIS is slowly reworking stuff, but they are very risk averse to overhauling what works, theres so much stuff that would be needed to change, refactoring all the code, big task. Maybe with next engine update in next few years.
well thats a good idea
i noticed that people get uppity when a mod has some ai images
i used ai to make my poster lol
i am fine with staying on their current engine for now, but one day they got to overhaul everything because basically the game is literally more cpu intensive than minecraft
i dont have graphic tablet and i dont know art so thats the only way
well thats a good thing i see it engage my 8 cores quite well
i remember when it wasnt the case
i just kind of using it if i dont have alternate images to find online
my 4 core cpu is screaming
given the amount of crap that is happening with higher zombie population, legacy code and java not being the premier choice for big games, it runs quite well
wow 4 cores in 2025 is pain
yeah its gen 7th
i replaced my ryzen 3600 for 7700 because i felt it hit the limit
if i wasnt poor i would get 9800x3d lol
i planned to earn money to get a am4 mobo and ryzen 5600x this upcoming sem holiday
funny
dd4 is cheap, am4 too and 5600x thats within reach i guess
yesterday i finished my math finals and straight to making this mod, and ended up to 4:21 am rn
well when you get your first job you will have the money heh
i bought 16x4 3600mhz ram just to realize the cpu and the mobo bottlenecking it
xDDD
ouch
PZ bottlenecking gpu is pretty impossible, it would have to be potato level like intel HD graphics
i feel like even old gtx 1660 is enough
i meant more like other games that demands quite huge of gpu power
you dont have to overwrite the item script
you use doparam instead
so i can edit some value of item without fucking other mods?
thats good to know, yes understandable
hmm but thats through lua i see, that will apply on runtime i guess?
it could work with predistribution merge?
during load but it does work even after
you should test
not really making item mod now :/
are there parameters to pass to lua function hooks? specifically i'm using OnWeaponSwing, seems like there's attacker and weapon but i can't figure out how to pass them
nevermind i got it
it just wasn't working because i put (attacker,weapon) in front of my function name in .Add
I have a silly mod idea, basically. If you have bunnies living within the vicinity of your base, after you sleep there is a chance a bunnies will be at the end of your bed and will leave a few carrots there for you. Depending on how many bunnies you have, the higher chance of them giving you carrots are.
You don't pass them, you receive them
NVM it was wrong mod order applied by default
anyone know how to not show worldcontextmenu when right click on some special object
Wdym ?
when u right click the world,it always open a world context menus,i want it not show up in some particular case
In what cases ?
And that's doable yes
im making the build menu mod,but when u set drag ,it can use right click to cancel building,but it would show the ground context menu
it is super annoying
hey i forget, is it possible to make a single tile that has multiple containers? i'm sure there's an obvious example of it somewhere in the game but i've forgotten
Fridge/freezer?
You can remove the context menu from the UI manager
Actually isn't it multiple containers ?
u can make multiple containers without sprite ontop of that single tile with its own container
sorta like a hacky way around
It'd be nice if future renditions of the modding API has something for transaction events ('E.G: Spawning an item as part of a mod), had a way to sign the transaction so that the anti-cheat (or third-party ones like mine) can see that and act on it with that signature.
With server-side inventories starting in build 42's future multiplayer, this would be the right time to formulate how mods would handle a server-sided simulation of item / inventory transactions with something like a signature.
It could be something as simple as the API passing a non-nullable ChooseGameInfo.Mod reference when executing some API call for the action.
Saying this out of frustration with how 41 has too much ambiguity with actions, causing a lot of conversations about how the anti-cheats I write are kicking players when it's their mods causing false-positives.
what cheating exactly are you intending to prevent when inventories will be server auth anyway?
Anything that performs abusive or exploitative operations.
Sledgehammer stuff, building, destroying, fixing, healing, etc.
Transformative actions, generically speaking.
That's great! I think it further supports the need for action-origin signatures.
how is the player going to cheat to spawn items when the server controls items? if a mod has some exploit that lets the client trigger e.g. item spawns when it shouldn't, that's on the mod and really difficult for you to deal with externally anyway
Yea
This is true, however if that action comes with a pointer to that mod, I can interpret it.
I had such an issue in my own mod with a duplication glitch
(Mod exception lists for anti-cheat checks is one example)
I can't make a check for all mods but server admins can place something that can match the signature of the authoring mod for an action.
So if this mod triggers a false-positive, it can be added to some list that then the anti-cheat in this case would say "Ok. Carry on. This is normal."
This would help the game's vanilla anti-cheat too.
I'm not mad, but frustrated. This is a great time in the development timeline for such a feature to be deployed.
Would save a lot of time / checks if in place. x)
Hey, is there a list somewhere of code changes for b42 to make updating mods easier? Like for several games I make mods for when the game updates and there are API or structure changes there's usually an accompanying list of those changes for modders somewhere. Just trying to save me having to go through dozens of files one by one checking what I need to change in my mods.
Nop
@bronze yoke has every java side changes in terms of functions parameters etc thx to Umbrella but it doesn't go in detail of the changes
As for Lua, no list either
You have the JavaDocs for both B41 and B42
And overall the changes aren't too drastic meaning a lot of stuff don't require much changes
the umbrella diff does cover lua as well
Main changes I can think about are TimedActions being in shared instead of client now (tho even defining them in client they should work)
And the recipe changes
Ah yea true
yeah, currently b41 timed actions work without modification
It'll be problematic when MP comes out, which you have some time before
there's code that implies they're even still supposed to work in multiplayer but that might just be a temporary measure
since not even all the vanilla timed actions have been converted
I forsee actions giving me a lot of headaches in 42 mp.
Ok thank you, when you say @bronze yoke has every java side change of functions etc where can I find that?
From the sounds of it I'll mostly just need to alter recipes and maybe pre-emptively move my timed actions to shared instead of client which shouldn't be too hard at least.
you can see the diff between different versions from the commit history here https://github.com/demiurgeQuantified/UmbrellaAddon-Unstable/commits/main/
only numbered commits are game updates, everything else is changes to our tools which can be ignored
Thank you, that's very helpful!!
There needs to be a psa announcement for modders to use proper casing in their mods. Just switched to linux again from windows and a lot of mods dont load/arent visible because Commnon =/= common
How do you attach a proper recipe name to a craftrecipe in b42?
I'd much rather it say, for example, "Make Regular Tire - Standard" or something similar.
Make a Recipes_EN.txt (or Recipes_RU.txt for russian translation for example) and put it in the media\lua\shared\Translate\EN\Recipes_EN.txt folder.
Then do something like this:
RecipesEN {
Recipe_MakeCarTireStandardPerformance = "Make Car Tire - Performance",
...
}
It should work after that
Thank you very much!
I do not want to say how long I've just spent scratching my head wondering why my lua function wasn't being called from a recipe properly before realising OnCreate:function had been changed to OnCreate = function....
It's in the languages EN file iirc.
Ah wait. Alex got it.
Is there a way to transfer a character from one map to another by copying the playerdb?
hey trying to update my map mod to b42, but having some troubles, now it is in a separate world from vanilla instead of merged into it, anyone knows why? thanks
yay my mod is somehow causing a memory leak because the game crashes before the main menu loads with an out of memory error !
okay apparently forgetting one } in your item script file will do that to you
Turned this into VCPC
Anyone ever make a b41 mod that shows me what my host games are initialising so Ik if the folder is borked without wasting 30 min of my life?
Yup ...
Tho tbh that's a game issue not properly handling casings imo
I just released my first mod. If you're interested, feel free to check it out – I'd really appreciate any feedback or suggestions: https://steamcommunity.com/sharedfiles/filedetails/?id=3534625115
do we have to declare new tags some where?
I am getting -> Tag has no items: ShredPaper
i think you need to modify the item script for the items you want to have that tag, for example
item SheetPaper2
{
DisplayName = Sheet of Paper,
DisplayCategory = Literature,
Type = Literature,
Weight = 0.1,
Icon = Paper,
CanBeWrite = true,
PageToWrite = 1,
StaticModel = SheetOfPaper,
WorldStaticModel = SheetOfPaper,
ReadType = newspaper,
Tags = ShredPaper,
}
I did (but the IndexCard, should be the same thing though)
mind if I take a look at your recipe and modified item script?
item IndexCard
{
DisplayCategory = Junk,
Weight = 0.1,
Type = Literature,
DisplayName = Index Card,
Icon = IndexCard,
CanBeWrite = true,
PageToWrite = 1,
WorldStaticModel = IndexCard,
Tags = ShredPaper
}
craftRecipe ShredPaper
{
timedAction = RipClothing,
Time = 25,
Tags = InHandCraft;CanBeDoneInDark;RemoveResultItems,
OnCreate = Recipe.OnCreate.RipClothing,
Tooltip = Tooltip_Recipe_ClothingNotWorn,
inputs
{
item 1 tags[ShredPaper],
}
outputs
{
item 1 Base.PaperShreds,
}
}```
you need a trailing comma anyway?
yep
weird.. ok, let me try that
Bcs windows IS NOT Linux
Windows doesn't give a shit about caps
Linux does
So it's not a "windows handles it well" it's just "caps matters on Linux"
That's it
I'm fairly certain there's methods to handle any cases
My guess would either be regex if it allows you to check for any case or handle everything low case in a way
I asked gpt to make a quick and dirty script to at least let me load my save and let me play lol
ok, that part is working.. it fails after performing the recipe, which I currently expect considering I haven't actually created the new result item yet..
Yea I had done that with a bash script
For mod.info
Thanks! just ran it lol
its there a way to randomize the amount of the result of a craftRecipe?
like I want to get between 5 - 8 of something..
Via Lua in an OnCreate function yes
B41 or B42 ?
42 only
B42 just saw your craft yea
So yea in the OnCreate function you can randomly add an amount of item
I should have been more specific.. I meant can you do it from the craftRecipe meaning without lua.. so, no I need the function.. I will add that later then.. thank you!
No
To my knowledge that's not a feature at least
thats fine.. I am just working through all the declarations first, then I will add the lua
Make sure to check the wiki page of craftRecipe if you haven't yet
So, item defs' Icon property will look in the "textures" folder for the name with a prefix of "item_". So Icon = charm will look for the file textures/item_charm.png. Now, I would love to have my icons in a different subfolder, textures/icons. How would I do this? Icon=icons/charm with the file textures/icons/item_charm.png?
Yes
As for the subfolders, there's a secret tech
Oooh, I love secret tech! Well, I love knowing it, not so much that it exists undocumented. But you know what I mean 🙂
It was @sour island that had shared it, but basically you can do
media/textures/item_icons/charm.png with your script entry for icon being Icon = icons/charm.png
If I'm not mistaken
I'll try that, it would save so much hassle if I don't have to have the item_ prefix on every one of them 🙂
Hmm... This didn't work. I'll try reverting the names, so it's icons/item_Charm.png and see if that works.
hmm
Takes a hot minute for my game to restart, just going back to menu and restarting didn't work, so testing if a full restart of the game works better. Give it a moment 🙂
Yeah, no, this didn't work either... Guess I'll have to put the icons in the root. The textures folder worked fine for the textures though, using the same method, but those don't have that prefix so I don't know. Just me trying to be organized and fancy and stuff.
I'm surprised this didn't work
Chuck might be able to give some insight into how he did it
I don't remember where he wrote that down
You know what did work though? media/textures/item_/icons/Charm.png with Icon = icons/charm. Though I think that icons/ would just be for my own organisation, because it will be the only subfolder of item_ in this particular one, considering I only got one type of item to put in there. I can see it being useful later, for things like item_/clothes or item_/bags.
waaaat
Ok I definitely don't remember it working like that, that's weird
B42 quirk? My crappy laptop quirk? I dunno, it worked, so I'm happy 🙂
I would assume B42 quirk
Until next time I restart the game fully, and it is broken again, I guess. But we'll see when that happens. I'm still just learning how to mod PZ, trying to wrap my head around the quirks before I go on to my first actual project.
Nah if something works once, it'll work again if there wasn't an update in-between
Reloading Lua from the main menu does the job in most cases and you rarely need a proper game restart
It worked with my soft-restart (quit to menu). Might not work with a hard restart (quit to desktop). And that's 100% my laptop not catching up, I know that from yesterday's model stuff when it didn't hot-load like it should do. Takes a lot longer with each change, but every time, I learn a bit more, and soon I won't need to have the game open for every change I make.
Yeah, ignore that, it didn't work after restarting the game, so the textures must have been cached. textures/item_Charm.png it is then. Not a biggie, can still sort everything else in folders.
Going to the main menu does nothing
You need to reload Lua when you do that to apply changes
This will reload most of the assets
most
Do they mean "reload assets" when they say "reload lua"? Because I haven't even touched lua yet, it's all models, textures and item definitions so far. So I just assumed "reloading lua" when hitting "continue" would do the same thing. This could save me so much time if it works!
When you load the game, there's different bits loading
And Lua is one of them and this usually tends to reload assets too, it notably is used to reload every scripts too
I think possibly icons won’t get loaded until you fully restart the game though, if I’m remembering right
To patch another mod, how can I make an overwriting change without actually just including her file?
Can I, e.g., make a new record of the same name in the same module in my file?
e.g they have in their .txt
module theirModule
{
item rock
{
weight = 1;
}
}````
can i then in my own .txt do
```lua
module theirModule
{
item rock
{
weight = 2;
}
}```
and have it be overwritten with 2 weight rather than this having defined a second rock item?
B41 for completeness
Yes but that's not how you should patch
Also no you can't do what you just wrote
How should I?
I would much rather not include as much of their files as possible
One method is that you can copy pasta the whole definition of their item in your own mod however this will be both incompatible with other mods patching AND any changes from the original mod in their own script won't transcribe to your own mod unless you copy pasta again their original changed script and do your own changes again
The real good method to do it, is to patch from the Lua
You can change item/recipe definitions from lua?
Yes
interdasting and much better
is there documentation on this anywhere so I don't need to pester you for sage wisdom?
The way you do it is by using a DoParam function on an Item class
For that you retrieve the Item definition with this function:
item = getItem(itemFullType)
And then
item:DoParam("weight = 2,")
declaration: package: zombie.scripting, class: ScriptManager
Note that I do not know the whole thing perfectly and thus I might have made a mistake
As for recipes it's a similar method but with recipe definitions
declaration: package: zombie.scripting, class: ScriptManager
If I want to add or remove fields of a class, can I do this also?
like adding an AttachmentType to something that didn't have one
I would guess that if you DoParam on an item that doesn't have a field, it will add the field to that item
But removing it I'm not sure
I'm not familiar enough with the process
Time to pore over the docs, i spose
declaration: package: zombie.scripting.objects, class: Item
For Item
I need to document the process on the wiki at some point
It's not immediately obvious that fields can be removed
That's alright, I didn't actually need to do that anyway
The other salient question about this is, when or how do I actually run lua scripts
is there boilerplate I need to run a script on load?
When the Lua file loads, it runs anything written in it, for things to run later, Lua events are usually used
You can learn more about it on the wiki page regarding Lua events
But in this case, you can run it directly without an event
I didn't realize Lua even supported events
Do you mean things like OnCreate that run functions from recipes?
Also, thanks
I'll have to read that a bit later today
OnCreate are a bit different tho similar in the concept
They aren't classified as Lua events
But you could say they act the same because they will trigger a function when a specific action happens
I guess it is technically an action callback, but from a coder's standpoint they are pretty much the same and used the same way.
These are callbacks
https://demiurgequantified.github.io/ProjectZomboidLuaDocs/md_Callbacks.html
Yea
Basically
Tho when we refer to one we don't refer to the other usually
Bcs they aren't used and defined the same way
Yeah this response sequence is basically my reasoning
With the new recipe system, can you now give multiple (different) items directly via the outputs? Or do you still have to use an OnCreate and AddItem that way?
Yes
do you guys think its possible to create a mod wherein i can stop the player character from taking off their masks whenever they have to eat? basically just revert it to how it was in b41. Thanks!
Yes, very easy.
There's a setting in masks that decides if a player can eat while wearing them or not.
where is this setting
You just use a bit of lua to loop through items and set it to the value that lets you eat
Nice, that's very handy.
I don't have my reference environment up to check quickly but look at vanilla masks
Ok please walk me through like, the basics, where can i get the lua script for the masks so i can edit it
Thanks for clarifying - yes, I mean each mask has a property in it's script.
Look at similar mods that adjust a specific property of existing items, like the one that makes jewelry weightless.
Items don't use Lua
YouTube videos might help people if that ever became a thing or someone did it. If I had the setup I might.
The high level logic is
##### NOT ACTUAL CODE #####
for each item in item database
{
if item matches conditions for me wanting to change it
{
item:DoParam(property=newvalue)
}
}
##### NOT ACTUAL CODE #####
Random thought in the dark.
Probably don't write it in the same format as scripts or that's going to confused the fuck out of people 😭
makes it easier to show how things are nested
There's some videos, but I did think about it already
just a sec...
That might something I will do in the future yes
there.
Fine 💀
returning to the main menu reloads lua
No that's only if your active mod list is different from the one in the same
loading a game only reloads lua if your mod list is different, leaving a game always reloads lua
It never takes ages to exist a game, not as long as it takes to load Lua when launching the game or reloading Lua via the menu button or mod list changes
So I'm having a hard time believing that
i literally just went in-game to verify i wasn't wrong
so idk about your weird loading stuff because it does reload lua lol
It doesn't reload lua for me, but I always make sure the modes selected in the game & the mods selected in the the save match so I don;t have to wait through reloading.
the implication here is that you can play on multiple different saves without reloading lua once
i'm not sure what to say because it does reload lua for me, and always has
Yes, you can, provided every save has the same modlist and the game's modlist also matches.
Well, I can.
laughs
I'm testing it out because from what it did when I played with lots of mod it never felt like a Lua reload due to the speed of existing a save never taking as long as took to load every mods
lua reload has never taken very long for me
No of course, not if you play with very few mods
But when you play with a fuck ton of mods, it does
And you do notice it
I use a mod managing mod so it's easy to get thing 100% matching (update modlist from save/update save from active list)
You mean like a low-mod run with only the 120 most essential mods?
😂
That's not a lot compared to the amount I'm talking about, dw 😅
most of the time i'm paying attention i probably have 1 or 2 enabled 😅
For testing someting I'm writing 1 or 2, for playing... a lot more
Ok so it does reload when existing
Does it reload everything like a classic Lua reload ?
i believe that'd make you the only person in this conversation who plays the game
Yea nowadays I no longer play the game so I never get these kind of insane mod lists
i'm still chewing through abiotic factor 1.0, no time for zomboid really
Only a few mods enabled for debugging and my own mod I'm working on
I just got back into Rimworld
Damn it's nice to have everything in XML and C#
Try fishing they said. Nice and relaxing.
Well this is what happened when I took my boat to the river!
lol that's cool
Odyssey expansion is really good. Being able to fly away from your troubles... provided you can keep your gravship operational.
I missed the 3 last DLC since I had last played the game so that's probably not going to be my first DLC to try as I'm not too interested in it
Biotech is very much worth picking up, both for what it gives directly and for the huge scope it opens up for mods
Yea that's the one I went with
Definitely feels like an extension of Ideology
With the huge customization it provides
Royalty is a bit meh, Ideology is nice but not essential, Biotech is the best by far, Anomly is really good if you want creepy horror stuff but otherwise ignorable, Odyysesy is great
Or to use the names they should have:
Rimworld
Ideology
Mechinators++
Weird Shit
Odyssey
The psycast from Royalty is the only interesting thing imo
Anomaly I'm interested in testing it yea
Love some creepy shit
Vanilla Faction Expanded: Empire and Vanilla Faction Expanded: Deserters adds a lot to the Royalty
It'll be my next one, I only miss it and Odyssey rn
VAnilal Psycasts Expanded adds a huge amount but gets very overpowered very quick.
Yea I'll add the VFE mods in once I've dug a bit in Biotech
(Says the person currently testing out a superhero gene mod)
I noticed that in some videos, tho there's also that sort of learning tree I believe ?
Yes, lots of different psycast trees and a lot of prerequisates to be able to start
Not all balanced againast each other, but all fun in some way
It looks more interesting than the way Psycasts work rn
Ironically you can do more with Zombies than you can in Zomboid 😂
Yea the necro shit from Anomaly looks cool !
Ghouls are really good defence becuase you can just stick them back together after they get "killed"
But... don't run out of raw meat.
Yea I was watching Hazzor's videos and saw his video on Ghouls
Any entry chamber full of corpses and a deadlife IED that ressurects everything around it when triggered will kill your FPS and any hostiles...
There's IEDs that resurect shit ? 😭
hell yeah.
That's cool
Collect the toughest corpses your can find
I need to fuck with the mechanoid shit from Biotech rn, I've yet to touch that
Junker pirates doen't look so tough when they are facing down a bunch of undread rhonos. bears and thrumbo
I've done full-mechinator playthroughs, what I do now is only use the simple small mechs (cleaner, hauler, crafter, paramedic)
Also I noticed there seems to be a lot of tribal factions now with Biotech and heard a ytber mention it in a video too. Is that a thing and if so how to modify it to not have that many tribal factions ? Tho I'll possibly try a medieval playthrough next save
It was fun having a mechanoid army though
I got slaves for that, that's why I haven't been interested in bots rn
When you start a new world you can choose which factions will be there.
Get rid of the boring ones. And hostile impid tribe can get @#$%@#%ed.
lol
I like variety. 🤣
No, Rimworld mods tend to play nicely with each other.
Also what's the best bionic mod rn in your opinion ? I remember Rah's Bionics from back then but is that still the goated bionic mod ?
And nearly all of those are from Vanilla Expaned or Big and Small, which adds a lot of fantasy stuff
EPOE, Expanded Prosthetics and Organ Engineering
Wasn't talking mod wise
Gives a nice progression for crafting bionics, adds more stuff that fits in with teh vanilla powerlevel.
But overall how relations with factions happen, since you get so many different factions, to have more interactions with the same factions
Aaaaah yea I remember that one now too
Well, as Supremacist Raiders people mostly hate me anyway
lol
but that just means more people to raid
Are manual mod order stuff still needed now ?
On my "what if instead of a nice Kansas family Superman was adopted by a bunch of meth-head pirates?" playthrough.
Sounds cool lol
Meth Superman

RimPy. It's a little python utility that will handle that. The in-game sort works too, since every mod will have requires/load before/load after rules.
👌
Yea I think I remember RimPy, it's an app with an interface right ?
There's a Rimpy mod, but that is just the way they keep the rimpy database updated .... it has extra sorting rules based on what peopel have determiend workes best
choose mods, sort, save, done.
Tho the in-game mod order works ?
Yes, I've not had issues with it. it's nice to be able to adjust mods without having to strat the game (loading all the mods) only to have to then restart after changing.
Yea true, that was the advantage of it
1.6 has some nice performance boosts, but the "cache processed xml database" thing is only a speedup if nothing has changed.
Also I love these new storage, comes and compliment Neat Storage very well
I'm happy to see all the stuff from back then in like 1.2 or so being in updated forms
Also there's that VFE mod that adds Oil refining but that was another mod right ?
I forgot its name, I loved that mod back then
Two main oil mods: Vanilla Chemfuel expanded and Rimfeller.
VE: Chemfuel is simple and vanilla like, rimfeller is good if you want to feel more industrial
And rimfeller mod author also made rimatomics, which is a very good nuclear reactor mod
Yea I remember that a bit but I didn't use it too much I believe
instead of just "build a nuclear reactor" you will have a reactor, cooling systems, mange loading in uranium rods, etc etc.
and it has a lot of crazy weapon turrets to use all teh power
Ok so I thought that that new VCE mod was basically Rimefeller but introduced as a VFE way
chemfuel expanded you get "deepchem" similar to deepdrilling, then refine that into chemfuel
works with their pipe networks.
Bcs VCE looked almost exactly like Rimefeller in how it works 😅
You missed 1.5 (Anomaly) being called the "Shelf Update" because of how good vanilla shelfs are now, and adaptive storage builds on that really well
Yea figured they basically changed their whole framework to use the vanilla method now instead of their own custom one
Tynon is insane for this
I heard he invented MULTITHREADING and SMART TICKING
That's crazy, how he came up to these technologies?
I'm not as glad as I would be tbh since this broke a lot of mods
Tynon never leaves modmakers without work 
Just as cough cough someone
He invented multi threading?
Wtf are you talking about
Yeah. You'd implement not invent
How do you go about having dependencies for a mod? Like I know my mod will require another mod but I'm not sure what that looks like
require=OtherModID in the mod.info
the dependency on the steam workshop is added separately through the mod's page after you upload it
If you are modifying another mod's lua, do you just name it the same in your mod then it overrides via loadorder?
(My brain might be inventing complications where there are none)
yes, although we usually discourage total file overrides if it can be avoided
I'm very new to the more code based lua/java mods, how would I go about modifying just part of an if statement to add an additional (not self.character:HasTrait("EasyGo"))
(I'm wanting to make a mod for mp for servers that use skill recovery journal for people who want vanilla stakes but don't want to shoot themselves in the foot)
from a different file, you can override one single function (assuming that function is accessible from the outside), which is much more future proof than overriding a full file
if the function is global, it's as easy as just defining your version of the function with the same name
Its local
then you might be unable to do this 😅
file overrides are regrettably necessary in some cases
Is it better to just edit mods directly in the workshop folder, or should I continue to do what I usually do where I copy paste the files from mods to the one in the workshop folder
Just dawned on me that there's probably no actual reason not to
Provided your mod loads after that mod it's no different than modifying vanilla lua.
Even if it's a local function?
Personal preference really - I like to start in the Mods folder, move them to Workshop when they are ready for upload (so workshop isn't full of dead mods) and keep them there. With the entire mod under git control so I can roll-back mistakes or return to a release I tagged if needed.
Same as vanilla... meaning you can't patch a local function. You might be able to patch the function that calls the local function. Or ask the mod author to make an adjustment so it's non-local and can be patched.
Sometimes the act of copying files and being paranoid about breaking the release version makes me delay updates by like a week, so its probably better for me lol. Glad there aren't any big disadvantages
I find git is a huge help - checkin when things are working and never have the frustration of HOW DID I BREAK THIS IT WAS WORKING 30 MINUTES AGO!
I also use git control on the mod version but not workshop. Having it for the entire thing would be nice
I use git at the mod level, not the workshop folder level, but that's just becaus eI start in /Mods instead of /Worskip/Cntent/mods.
Yeah lol, I can't believe there was a time in my life I didn't use it. I still don't use it for some things I should, but the games I've worked on would actually still be prototypes
Like giving a Neanderthal a pickaxe
Anyone know a good link for learning how to modify vanilla lua script, without just duplicating the base file?
All my mods so far have been txt scripts.
I think it might not actually be a local function?
So, a question that just popped into my head and I did zero research on as a brand new PZ modder... Does the game allow more than just texture maps for our models? Like, could we put in roughness or alpha maps too? I'm assuming it is just the texture map... Not important at all, models are way too tiny to see things like roughness on, and that can be painted onto the texture already, just interested to see how far I can take stuff 🙂
Sadly no
I do use substance painter and it allows me to draw heights, adjust roughness/metaic and such and i do all my textures like that, and at the end i simply export 2d view
Actually alpha works
But it is a bit buggy, other models tend to not render behind transparency, like beards behind a visor
Oh yeah, forgot about alpha
So yea alpha yes
But apart from Alpha, yeah... only texture
Vehicles have some kind of shaders, but my knowledge about it is limited
Yea
Yeah, but that's always been a thing with Alpha. Was the same back in Second Life, when people still used alpha maps there. The alpha is applied to the whole model, and when you attach several models together, they count as one, so you can still see the chair behind the character, but there would be a hole straight through if it was a bodypart. Or you'd see the character's chest if the jacket was done as a solid object with an alpha for the open zipper, even if you wore a shirt.
So don't use alpha to avoid having to do actual modelling 🙂
I'm not sure what I would've used it for yet, but I was thinking stuff like light maps for static objects. But that wouldn't matter, because I can just set up a light rig in Blender and bake the light data onto the actual texture, so not sure why my mind even went there.
you are limited to just one texture, you can use custom shaders for most things but it's fairly limited what you can actually do with them since you can't pass in extra textures
jab made some headway with passing in custom uniforms by abusing reflection but i don't think there's much you can do with them still, especially not in a practical manner
I would suppose it would involve recoding a whole ass rendering system Lua side ?
<@&671452400221159444>
is the "Free for all" post supposed to be inivisble?
https://theindiestone.com/forums/index.php?/topic/2530-mod-permissions/#entry36476
These are the different levels of permissions available to be applied to your mods, so that other modders know how they can be used. After selecting the appropriate mod permission for your project, just include the relevant image and link to the proper permission in the first post of your WIP/Com...
Wdym ?
there ssupposed to be text
explaining the "license"
and its just gray
it's a little weird there's no description, but, free for all literally means free for all
you reserve no rights and anyone can do anything whatsoever with your mod
Ah yea I see
That's not html
Ok
True
It is ironic, since tynon was consciously ignoring optimization issues for 6 or 7 years
Having game like this on one thread is absolutely terrible.
Your mod structure is wrong
Recheck your mod structure
You're missing a folder
Any code example for being able to "spawn a dead body" that can be picked up by a player (B41)? I currently have code that waits for a specific square to be loaded and then I've tried all assortments of AddZombieInOutfit()->kill()->IsoDeadBody.new() or createRandomDeadBody(), .. I get a dead body just the way I want, I can loot it, but I can never seem to get the new body to be able to be picked up (Grab Corpse), until i log out and back in (to the dedicated server).
I believe the way Braven did it was spawning a zombie and killing it, just like you did
In the spore zone mod
Copied code same issue. It looks like the same code in the "Trash and Corpses" mod which someone has commented doesn't work in MP. It's weird because the dead body sprite can sometimes be in front of the player.
(logging out and back it, and everything works correctly)
Zombies are not spawned the same way in MP if I remember right
Unless that wasn't what you meant ?
yes sir! Multiplayer weirdness
Hello survivors! I want to further customize a wilderness world, I havent made mods before but i have basic knowledge in coding, how doable is to make a mode (or use an existing mod?) to essentially randomly spawn various animals around the map?
hello
i got a question
why did you guys not make a mod that grabs the 2d mini map and makes it into a raycasting system
so you can see in first person
because it's not nearly that simple
yea but its still possible
i'll try to make it but idk how to script so i got learn
the hard way
prob i will give up
in a few days
is there a mod that already allows customizing the start fo the run? maybe it can allow me to spawn animals like that at the start of the run instead of having to debug mode it
Lmao wtf 😂
Nop
Not to my knowledge at least
its quite confusing to make a character from a video game model
can someone guide me?
i have little idea of what i am doing
texture work was never in my field of knowledge
i am trying to create a mod of replacing pz character with this
but i am not sure where to start, i looked up other mods from modders and i barely understand anything
You need to replace the skeleton with the PZ skeleton
-- create the IsoZombie instance
local isoZombie = IsoZombie.new(getCell())
-- square is an IsoGridSquare
square:addCorpse(IsoDeadBody.new(zombie), false) -- note the use of IsoDeadBody constructor here
Is that what you are using ?
I'm rewriting a wiki page a bit and realized I had given this as an example for constructors, which is exactly what you were looking for
That usually ends up with two corpses. This one of the "working" sets of code I have (in which it spawns, is visible, is lootable, but i can't pickup the corpse until I log out and back in). Probably a lot of overkill stuff, mostly trying to get it to sync the corpse.
--Create a new zombie
-- local zombies = addZombiesInOutfit(x, y, z, 1, "Default", 50, false, false, false, false, 50)
-- local zombie = zombies:get(0)
-- if not zombie then
-- print("Failed to spawn zombie.")
-- return false
-- end
-- zombie:setHealth(0.0) -- Kill the zombie immediately
-- zombie:Kill(nil)
-- print("[RFTCQ] Zombie killed at " .. x .. "," .. y .. "," .. z)
-- local body = IsoDeadBody.new(zombie, false)
-- body:setNoPicking(false)
-- body:getContainer():setExplored(true)
-- print("[RFTCQ] Body created at " .. x .. "," .. y .. "," .. z)
-- zombie:removeFromWorld()
-- zombie:removeFromSquare()
-- getCell():getZombieList():remove(zombie)
-- body:transmitModData()
-- body:transmitUpdatedSpriteToClients()
-- body:transmitCompleteItemToClients()
-- sq:RecalcAllWithNeighbours(true)
-- sq:DirtySlice()
-- sq:transmitModdata()
Hmm
It seems that IsoDeadBody.new(zombie, false) puts a dead body where the zombie location was. Thus I remove the zombie. (zombie:Kill(nil) simply shows splattered blood)
You shouldn't kill the zombie
The zombie doesn't spawn when you instanciate a zombie that way
That's what I explain in the wiki section where I found this code
Something very important to take note of is that this will not create an actual zombie, but simply an instance of IsoZombie which can be used for different operations which require an IsoZombie instance. This is the usual usage of the constructor, and creating entities is mostly done with different kinds of methods.
It shouldn't spawn a zombie
Maybe that's the secret sauce, ill try it now
The zombie became a corpse with the IsoDeadBody.new
So if you kill it, you end up with two corpses
And since the instance still technically exists (see IsoZombie wiki page and the recycling explanation) well you can technically still access a zombie there
local zombies = addZombiesInOutfit(x, y, z, 1, "Default", 50, false, false, false, false, 50)
local zombie = zombies:get(0)
if not zombie then
print("Failed to spawn zombie.")
return false
end
local body = IsoDeadBody.new(zombie, false) -- no dead body until logout and back in
sq:addCorpse(body, false) -- if this line is added, same issue as above.
local zombies = addZombiesInOutfit(x, y, z, 1, "Default", 50, false, false, false, false, 50)
local zombie = zombies:get(0)
if not zombie then
print("Failed to spawn zombie.")
return false
end
local body = IsoDeadBody.new(zombie, false)
body:transmitModData()
body:transmitUpdatedSpriteToClients()
body:transmitCompleteItemToClients() -- corpse is visible, loot-able, but cannot be picked up
That's literally not how you should do it
That's not the code I sent you
That's completely different
Here you spawn an instance of IsoZombie on the map
The method I send does not spawn the zombie
It only gives you an instance of IsoZombie to do anything you want with then
Oh.. so then i have to fill out the worn and inventory items
No you can dress the instance before adding it the corpse
And add any visuals you want to it like any other zombies
But the zombie does not exist on the map, that's the difference
Try exactly that
Don't change anything, don't do anything silly
Just those two lines for now
You're doing your tests in MP or solo rn ?
MP, I had to chnange the second line to isoZombie since the first line references the variable isoZombie not zombie only thing I changed...
Oh yea nice catch, that's a mistake on my end
no worries at all!! I'm just super happy to get some help man, thank you soo sooo much
Yea reason is because those were two separated snippets
Fixed it in the wiki anyway thx
No corpse appeared on the ground when the code ran, logged out and back in, no corpse as well.
local isoZombie = IsoZombie.new(getCell())
sq:addCorpse(IsoDeadBody.new(isoZombie), false)
Can you try in solo ?
Runs client side
Retrieves the player loaded area
oh this is code on the lua/server
@bronze yoke do you have some insight on this method to do it server side ?
Can an IsoCell be retrieved server side to run this for any squares ?
Actually maybe there's other methods to instantiate a zombie here without creating one on the map still
can do:
local isoZombie = IsoZombie.new(sq:getCell())
True
Didn't help, no corpse on join->tick, no corpse on logout/login
Hmm
weird, I have spawning items (at the right height), spawning containers (boxes) and adding items, spawning cars, with keys.. all working but a week working on trying to spawn a doctpr corpse with a journal on him hahah
Yea it's because corpses aren't really items and aren't exactly entities either
right.. it's just funny how easy the other stuff has been comparitively
You know I SWEAR I tried this and it didn't work...
local body = createRandomDeadBody(sq, 0)
Darn.. yeah I had to log out and back in to see it
dead bodies are jank
i was having these issues when trying to move them around for elevators
what i did before was sorta hacky
i transfered the corpse to the players inventory and the back on the ground
that refreshed the data for some reason
i did that in an instant and not by using timed action
interesting. maybe make a container on its square and take it in and out?
my mod is all ran in OnTick. I think that is possible, ill have to revisit
Shouldn't be hard to remove / readd the deadbody to the square.. I'll try real quick
How do you put an IsoDeadBody in a players inventory?
additem i guess
is it possible to create a ledge hang mod? a context option on open windows to hang using the Bob_ClimbWindowGrab with either infinite or finite grip (strength related) parametrized, option to let go or pull up Bob_ClimbWindowGrabIn. I tried with AI and got stuck xd
but IsoDeadBody isn't an InventoryItem ?
IsoDeadBody:getItem()
Try triggering the event to update the inventory actually
triggerEvent("OnContainerUpdate")
When the corpse appears
triggerEvent("OnContainerUpdate")
// or
triggerEvent("OnContainerUpdate", sq)
// or ?
That is already defined in the game code, you just have to call and use the event.
local function OnContainerUpdate(object)
-- your code here
end
Events.OnContainerUpdate.Add(OnContainerUpdate)
I'm extremely new to lua/zomboid (25 years programming). Are you referring to telling the client that it's inventory has been updated?
I don't know what you're really trying to achieve because I use a translator and can't follow the entire thread of the conversation, but that event is triggered every time a container is created or removed. So if you use it, you could perhaps notify them of what you mentioned, but I don't have the full context of the problem and what they want to solve or correct.
Fires when a container is added or removed from the world.
Zombie bodies, upon death, become item containers.
What you want to do with them, I have no idea. If you want to give me some context, you can write me privately.
TriggerEvents are basically like hooks in C++. If they're invoked, they fire; if not, the game continues running in vanilla mode.
They're used within mods to modify the game's basic behavior.
Oh yea you need to pass something sorry I forgot lol
Yea
Second one
I think ?
Tho can't be the square I think
Probably needs to pass the world inventory of the square
Depending on which area of the code is being referenced, it seems to check for a parameter, but not always. In most databases, it seems to run without parameters.
look like it does for IsoDeadBody?
Hmm
Actually it doesn't it seems
local body = createRandomDeadBody(sq, 0)
triggerEvent("OnContainerUpdate")
``` ?
I now understand what he wants to do, because he explained it to me privately. I told him, just in case, to exit the chunk and return to it again. From what he told me, it resolves itself when he closes the game/server. So, it's obviously a status issue when defining the container.
We need to search for what triggers the "grab zombie" context menu. By finding that, we'll be able to determine what state the body needs to be defined. When the corpse dies and spawns naturally, the game must be defining a boolean or something, which we don't, and therefore, we can't grab the body. When you exit the chunk or close the game, the map must detect the body and add that flag.
In single player, at least, when creating the body, you can grab it. Perhaps in multiplayer, it requires some extra changes.
can you assist me further with this?
i get that you meant to replace the character bones with default pz character rig
Nop I have no idea how to properly do that
I just know that you'll have to do that at some point
yalla i am cooked
i have been trying to finish this since yesterday
hmmm alright...
is there anything inherently bad about setting mod data on an item? like "Bag_ShotgunDblSawnoffBag"
I vaguely remember reading somewhere that you shouldn't do that, but I can't find that info
You read that here
https://pzwiki.net/wiki/Item_(scripts)#Other_parameters
Probably
But no it's not a bad thing
It's just a bad thing to have custom parameters that will add mod data to every single item instance
Even when not needed
cool. someone is trying to use my capacity mod for "upgraded" bags and of course setType doesn't stick between loads. I'm trying to help figure out a workaround for it
uh
that's what I said too
Tell them to come here and ask about it
that sounds like a threat 🙂 ha
lol no that's not what I meant 😂
basically, items can be given default mod data in their script, but it is wasteful to do that for values that don't change (because mod data is per item instance, it will bloat the save file with identical data)
so the only real use is a default value that is expected to change
it sounds like they wouldn't be using script mod data so it should be fine, mod data itself is fine
You can make it stick via setters if you're changing carry weight or reduction
my thought was to setType on the bag, like "Bag_ShotgunDblSawnoffBagUpgrade1", since my mod uses a lookup table for type. but I guess the type doesn't stick between loads. I'll ask them to hop in here
I've never gotten settype to persist
i would not mess with the type, that's a disaster waiting to happen
I don't think I did either. I remember messing with the player inventory type and I had to set it every load
it would be ideal if your mod supported overriding capacity per-instance in some way, possibly through mod data on the item
my ideas are usually disasters waiting to happen
that was my 2nd thought, mod data if it's upgraded, check on load and set capacity then
e.g.```lua
local capacity = item:getModData()["JB_CapacityOverride"]
if not capacity then
-- capacity = whatever you normally do
end
my problem is - my mod depends on checking types to set capacity
that's along the lines of what I was thinking as a workaround
if your backpack has context menu wear options, it will nuke all the mod data on switch
hmm, I didn't know that. does the nuke happen in lua or in java?
Lua because context menu wear options typically replace the item altogether
Trying to think of a mod that has it, I think kattaj military backpack?
I appreciate it. it looks like they disable the wear option if equipped. I might figure out how to worm my way in and copy the mod data to the "new" item.
maybe, but each mod has its own specific function so you'd have to make a compatibility for every one
and im not sure the result item gets passed down either
after I ate some lunch, I thought it might be more feasible to just change to a new item after an "upgrade"
I never modded before. I want to start. I want to ignore modeling, and focus on game mechanics for now. Is there a guide, step-by-step, or hands-on tutorial that will expose me to how experienced modders do the run-change-break-fix loop?
You won't have anything going into detail too much due to how coding is overall. You can do a lot of stuff but it's almost always a case per case situation for unique mods, unless you do basic Lua actions for crafts, items, tiles etc
I invite you to check the pinned messages
You will find a message from me which details a bunch of resources you can find in the wiki to get started
I can't reproduce this with "Wear" - the mod data is persistent even after a reload. I'll give it a try with the "equip" actions
Might be specific to a bag we use on SD, I allow players to upgrade their bags using tickets they loot off of zombies, and when they change using wear options it reverts the upgrades back to script value because it creates a brand new item
Like there are bags that are "lite" version
That has different slot options etc.?
I don't think they're looking at creating a new item. I guess it wouldn't be a big deal to copy the mod data over if they were. Sounds more reliable than changing type or overwriting the capacity for every bag of that type
Equip just calls ISWearClothing, which is where I tested for persistence. I'll just toss in some checks for mod data in my code and see what happens.
oof, and then I look at my code and that's easier said then done
that was easier than I thought it would be except for ItemContainer:getContainingItem() took me awhile to find
local modData = container:getModData()["JB_MaxCapacityOverride"]
local containerCapacity = (modData and modData.capacity) or overrideData.capacity
upload and steam immediately goes down
exactly on the hour is very unfortunate
so I guess fridges and counters can't have mod data. real fun finding that bug after uploading to the workshop. or more likely I'm just checking in my usual heavy handed way and breaking stuff
logic flaw
if youre initializing it and the obj doesnt have moddata yet
it will return nil so you wont be able to add or check yours
try something like
local data = obj:getModData()
data["stringKey"] = data["stringKey"] or {}
just replace the {} with the data you wanted to add
he does nil check it before trying to access it though
ah i see i read that wrong
So I didn't understand the reason behind the choice of doing that ?
Can someone help me? I'm going crazy. I have a finished addon, but the object distribution in the world isn't working. It's a hydration pack:
-- Police Lockers
table.insert(ProceduralDistributions.list["PoliceLockers"].items, "LB.Bag_new")
table.insert(ProceduralDistributions.list["PoliceLockers"].items, 500)
Even setting a value of 500 doesn't show up, so I'm guessing it's something new for hydration packs. Can someone enlighten me?
Use the debug LootZed to see if the item appears in the distribution
excuseme i don't see lootzed in debug menu where is it?
Sorry, I found it in the cheat menu.
Thank you, this tool is very useful for calculating weights correctly. Thank you very much.
That percentage is only an indicator, it's not a real percentage either
Bcs there's a lot more parameters
This is only an estimation I believe
Also worth noting: LootZed gives information based on the lua loot table, the actual loot generation is handled by a copy of the table in the Java. Normally they will be the same if you update the loot table when your lua file is loaded, but if you do this later for some reason you need to call ItemPickerJava:Parse() to update the java loot table.
Hi! In a clothing item's xml file, is the ordering of the entries relevant? For example, here is the xml
<clothingItem>
<m_MaleModel></m_MaleModel>
<m_FemaleModel></m_FemaleModel>
<m_GUID>86ffb73b-9b5b-4ffa-a46f-49846b1e9731</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<m_BaseTextures>clothes\boliersuit\longjohns</m_BaseTextures>
</clothingItem>```
Would it be save to exchange the position of the "m_GUID" and "m_FemaleModel" entries?
How do you know my nickname?
you can move positions i think but im not 100% sure
no, they don't matter at all
for array members the order will affect the order they are placed into the array, but that generally shouldn't matter
for all other members the position doesn't matter whatsoever
I can't find a good way to get the object from an ItemContainer
wdym ?
The item ?
like the "counter" is an ItemContainer and also an object. I can't seem to get the object.
no parent of course, and getContainingItem works perfect for like bags and equippable containers
that's what getParent() should return
Worst case scenario, check the square of ItemContainer for the object
declaration: package: zombie.inventory, class: ItemContainer
I'll give getParent a try again. it was late. I'm trying to avoid anything too heavy since these functions get called almost every tick when you're near any container
What are you doing exactly ?
adding a "per container" capacity override using mod data to the max capacity override. Say you want all Bag_BreakdownBag's to have a capacity of 75, but you can somehow upgrade that to 100. Just set the mod data on that container to 100, the other Bag_BreakdownBag's will still be 75.
instead of having to spawn a new container, or change the type, or change all the containers
Aaah yes I see, but why run it every tick ?
that's how often the game calls these functions
overwriting the java with some sweet lua
Which functions ?
That still doesn't explain why in your application here, you need to check every tick
You could simply update the container once and done ?
the container is updated only once but the game looks for capacity almost every tick so I need to give it the "modded" capacity
it's part of ItemContainer.getCapacity and ItemContainer.getEffectiveCapacity
and VehiclePart.getContainerCapacity
I got it working for ItemContainers that are also InventoryContainers, like duffel bags, etc. just having trouble with ItemContainers like counters and fridges, etc
so yea, getParent() works, it gave me the object and I can check for mod data on that object. thanks!
it works, nice