#mod_development
1 messages · Page 223 of 1
I have no clue why or how this is happening - but I love the music when you drink the beer xD
id love it if it worked as it should
like how does the animation model get flipped compared to the world model?
its using the same model
Is there any ways i can debug this somehow?
so the AnimNode for each hand, is where the item attaches to. If that anim is Messed up in any way. the item can do all kinds of magical stuff.
EG, throw a beer of the screen as if playing baseball, with an anim.
right so i got the size correct. But the animation is still backwards
Where and how do I set the animation to use?
cuz the module declares that:
EatType = Bottle,
CustomContextMenu = Drink,
So id assume that it uses the DrinkBottle xml for animations?
But i have no idea
if that is even the file, perhaps it uses the Bob_DrinkFromBottle.X file
<m_Conditions>
<m_Name>PerformingAction</m_Name>
<m_Type>STRING</m_Type>
<m_StringValue>drink</m_StringValue>
</m_Conditions>
This is the most important part of AnimSets
THIS is what defines what animations are playing
Whenever a player fills up those conditions (which can be set in many places of PZ code), it will trigger this animation
yea, i get that. But the model is being held in reverse position in the animation.
So what interest you to look for is: where and how PerformingAction is set to drink
That's ever because of the axis of export or the axis you put your model on
(I'm not sure for that)
same model as vanilla game beer bottle, just renamed
sprite works
works fine when placed in the world
correct way and everything
animation just holds it backwards
makes no sense to me
ground placed and in hands is not the same model I believe
in the items_food.txt for the beer bottle it is
the thing is it worked fine once, then it broke when i wasnt looking
anomolous activity
Yeah just realized you're the guy that got an issue with the mod getting uploaded and breaking
You said you have footage of it working before uploading ?
my dude
if you use the normal beer bottle anyway
then why on earth would you replace the X model with an fbx model
😄
Gave me lua errors when i told it to get the base game BeerBottle model
said it couldnt find it
dude, rename the basegame beer file to CervezaMesh, put it in your folder, and it works 🙂 get rid of the fbx
in my defense the .x files are not clearly explained
nah, everything is fine man, no need for defense 🙂
you mostly confused yourself 😄 It should work with the file I sent
just remember to scale up to 1.0 again
if you have meddled around in your files and dont have the "old" files anymore, I can send them as well
Great 🙂
alright yea, now it works. Thanks
you are most welcome!
I'm so confused, I'm trying to add an simple mod to zomboid for my first attempt at modding. but i cannot get it to show up in-game.
I've got it saved to %UserProfile%\zomboid\mods
My mod folder contains
-media
--lua
--scripts
--textures
mod.txt
poster.png
Hopefully that's clear
you have to put it at zomboid/workshop
omg really? EVERYTHING i have read, including the game itself was saying otherwise, but i will go try that now.
there is a "ModTemplate" folder, build a folderstructure like this. You need also need a preview png and a workshop info file
Uploading is ingame, via the workshop button 🙂
Even tho i only want to test in singleplayer, do i still need all of it?
So preview.png not poster.png
and the workshop info file is different from the mod.txt?
you can active mods you have there ingame without actually having to download them from the workshop
it just doesn't show up in-game at all for me when i save it there.
no no, we are talking two different things, as I misunderstood you. You need the preview and the workshopinfo for when you want to upload the mod.
what is your folderstructure?
If the save system was added as additional settings in the game, at least all my efforts while training the character would not be wasted. Can you recommend a save Back-Up style mod?
At least I can save my 78th character
C:\Users\Kylee\Zomboid\mods\Whetstone
Skill Recovery Journal by @sour island . I consider it mandatory 😄
inside media i have folders;
lua
scripts
textures
mod.info, not mod.txt
best it to copy it from the examplemod and change it to your likings, so you know it has the right format
I tried it 78 times, the game is very good, but after a while dying becomes meaningless. 😅
you mean due to the journal? 😄 Well, that is the best mod to fit your request I could think of
Thanks for spotting that, it still doesn't show up tho so i will do as you said and copy the examplemod.
have you renamed to lines in the example mod mod.info file?
cause otherwise your mod pops up as example mod ingame
I created the structure from scratch so no
but i will use the example mod to recreate it and see if it fixes my problem
alrighty! If it still does not work then, you could zip up the whole mod and send it to me
@austere sequoia I got it 😄
copying the example structure and replacing it with my files etc worked.
thank you
You are most welcome 😄 have fun modding!
@sour island I am here 🙋 I am glad you welcomed my feature requests for the mod "shops and trades", I will start working tomorrow and if I need help or I have questions about your code I will ask here. Thanks again 💯
Needs mod.info not mod.txt
no he doesn't wtf are you talking about
Where he's put it is fine
That's good, just got to change into mod.info
I was under the impression that he wanted to upload it to the workshop, but failed at that. We fixed the miscommunication and after it the mod 🙂
Welcome to the server!
Question, Is there any way, to have Two different textures for male and female clothing meshes? I have two meshes Different baked Textures, and I don't see a way to specify which texture is for the male mesh, and which is for the female mesh. Any ideas?
Can i put a Distributions file in this directory? media\lua\server\items
yeah
table.insert(ProceduralDistributions["list"]["ArmyHangarTools"].items, 1);
The number at the end, is that a chance of it spawning or how many will spawn?
the chance
Sorry last question! 😛
what's the range? does it accept decimal?
technically 0-100 but it's scaled by loot rarity (* 0.4 on default settings) and there's a bit of wonkiness nobody really seems to understand, better to just base it on other items than to try and work it out mathematically
0.4 is default? Wow ok
what should i put in the script for a ham leg? i want it to be able to be sliced
youd need a recipe (slicing the ham) and a result item (slices of ham)
thanks
hello! just wonderin if anyone knew where I could go to commission for a mod? Modeling + the mod itself. (its a clothing/armor mod)
Check out #1125248330595848192
Thank you!
Edit: @sour island this is EXACTLY what I was looking for. seriously! Thank you so much!
local trait = TraitFactory.getTrait("Hoarder");
if trait ~= nil then
if player:HasTrait("Hoarder") then
maxWeightBase = maxWeightBase + strength * SBvars.HoarderWeight;
end
end
this is right construction?
Hello, everyone. I am very interested in the "Standing Item" mod that has been talked about recently.
https://steamcommunity.com/sharedfiles/filedetails/?id=3175484316
I subscribed the mod and it uses a simple recipe (no Lua hooks) to reproduce the switching between standing and lying items. I was wondering if the parameters unique to the item object, such as durability, would not be copied in this case, but when I actually tried it, the values were copied. Does anyone know how this works? (I used to hook in Lua and copy each value for this kind of converting recipe.)
vanilla stuff line 104-109
check ISCraftAction.lua
transfer some param on craft
Thanks, I didn't know there was such a specification.
And I see that the specification is only for HandWeapon.
I guess I was unaware of this spec because when I implemented it, it was for clothing.
Anyway, thank you so much!
This only happened I after tried to "import" a png file to TileZed as explained in various tutorials. The error occurred after I closed TileZed and then re-open it.
But maybe I start asking those questions on the mapping channel or in the modding discord
If you have more questions about this specific mod, feel free to ask 🙂
Seems like it as long as you get the other variables from somewhere, also ; is optional
can you put a space or titles between options in the sandbox menu for better organization?
like divide it into sections
most modmakers uses workaround like
option zReAAS.zReAAS_InfoChecker2
{
type = boolean, default = true,
page = zReAAS_ArmorAbsorbSystem_general, translation = zReAAS_InfoChecker,
}
option zReAAS.YOUR_DIVIDE_INTO_SECTIONS -- <--- HERE BE line like "----------------------------------" between options
{
type = boolean, default = false,
page = zReAAS_ArmorAbsorbSystem_general, translation = zReAAS_YOUR_DIVIDE_DIVEDER,
}
option zReAAS.zReAAS_InfoChecker2
{
type = boolean, default = true,
page = zReAAS_ArmorAbsorbSystem_general, translation = zReAAS_InfoChecker2,
}
in translate file for sandbox options zReAAS_YOUR_DIVIDE_DIVEDER = "-------------------",
Can smb help me with this? Idk why but wings are invisible from one side.
am no expert on 3d render but usually it's due to it being too thin or its texture is not set right
Does anyone know if it's possible to play an animate image in pj?
considering how rain or water is animated I suspect it would b possible
but not sure whether it will be possible to make it using Lua
Is your model only one face of vertices ?
Also too many options will break the page and the last will overlap
he probably didn't mean for both to be the same
More Half-Life 2 in PZ that myself and another dev have been working on: https://youtu.be/P7O_PmMQPhY
If you would like to find out more, you may visit our website: https://www.pixelport.community
And yeah don't do dividers like that please, it looks terribly bad
No, I made two
Amazing, tho I wouldn't call your thing "project framework" ? Sounds confusing bcs a framework can be any other mods that adds a framework for modders
Normals are inverted ?
That's exactly what it'll do though. It provides a code base to make a similar project such as mine with a multitude of functions that can be used for easier development.
(Not to be confused with Project HL2RP)
You got any examples of the possibilities it adds ?
I didn t said they were the same
Definetely it looks ugly, but it s the only way
"last will overlap", they are not entirely the same but he probably just wrote an example and meant to change the name
yeah but it looks terrible, just do multiple workshop pages
Especially on big mods I definitely think it's fine
THYSM. Now it works as it should be
Haha np happens
project zomboid
What does it look like when facing the other direction ?
Check out how Braven did it with his overlay maybe ?
He sort of has an animated overlay
Not sure if it's actually an animated image or just playing around the contrast of it
It's still pretty early in development, but currently it has ways of adding/managing a sort of "overlay" to characters, inventories, items, and entities along with hooks on the objects related to those that can be extended/modified. I want to add other ways to easily extend functionality like admin/user commands, maybe a crafting system (even though PZ already has one), skills/traits (but simplified), housing, jobs, quests, etc.
For example, when someone joins the server it'll load their character into memory like so (there's a global table containing the instanced information):
local character = ProjectFramework.Characters:New(player:getUsername())
character.playerObj = player
return character:Initialize()
This is going to be changed up a bit later on to separate between player and character (player being the connected user, and character being the specific character that they've created/loaded on a single user). The character object contains data such as their name, description, age, etc. even their inventory as another object using the Inventories module I created.
i was thinking more of animated objects like.. for example bouncing circle
around the screen
There's a mod that makes video games ?
there is ?
Yes
give me a sec
Playing asteroids inside project zomboid !
Make the apocalypse yourself!
You could check how they do it I guess
oh dnag yes! that's exactly what i wanted
ty, ill take a look!
👌
So I have a question about making my mod compatible with another.
The way I fumbled my way through the .txt files ends up with my mod creating a duplicate of another mod's item instead of just overriding it
How can I do this better?
FYI I am not a java dev or anything. Complete amateur here who only understands some of PZs code that I can access via notepad 😄
If you actually want to work in code, dont use notepad 😄 I did the same mistake. Use "Visual Studio Code". Try it, it is a huge upgrade.
Unfortunately I have no clue though about mod compatibility
No atm I don't want to work as a dev at all, I just want to make a pretty simple mod. I got the idea of it working but I just don't know how I would make it so that I could simply add in item compatibility for other mods. Basically I want to wear machetes in belt slots instead of on the back slot, and I got the basegame machete doing that, but when I try to make other mods' machetes do it, my mod just creates duplicates for them.
Maybe something in the "module { imports" stuff idk
Is there a command I can use so that a specific IsoGridSquare shows a specific sprite I made? What I was able to do is taking a worldobject from the square and then assigning my sprite to that object via
object:setSprite("mytile_1")
However, I would like to do this without overwriting the sprites of the square's objects.
One strategy I thought about was creating a new object, equipping it with my new sprite and then adding the object to the square. The problem is that I don't have any idea of how to make such an object.
even if you only want to read code, use Visual Studio Code. You can open the whole lua folder at once and search through it for the terms you need. That alone is worth the (free) download 😄
cool, thanks!
thanks! i wanna make sure the page looks both intuitive AND attractive so i will see if i even need sections
was just wondering if there was a way at all
currently the settings r fine but i eventually wanna make it even more customizable
Reason: Bad word usage
Does anyone know of lua type definitions? I hate when there are undefined globals everywhere and being able to see function arguments is nice. I considered using PipeWrench but it seems possibly outdated as the last commit was 2 years ago.
nvm ctrl+f saved me, Umbrella on github by asledgehammer 😄
Yup Umbrella
It's also in the form of an addon on VS code
So you don't even have to download from github
In VS code:
- ctrl shift P
- Open Addon Manager
- Search for Umbrella
Im trying to make water a requirement to fix an item (along side my moded item)
I've got the water as "GlobalItem : Water=3" so it's a secondary item.
but things like a bottle filled with water, or a kettle/pot with water are not working, what would those be under if not "Water"?
I did it using this method like the readme suggests and it works like a charm!
No idea, did you check some vanilla recipes that use it ?
It does yes but if you do it with the addon manager you don't need to update it
It'll update itself
Would a recipe use the same thing? I didn't think to look in recipes.
No idea, I'm not familiar enough with item scripts
I think "Fixer : Water = 3" should work
Hello @sour island , I was able to arrange a PR for your mod "Shops and Trades" you can find it here https://github.com/Chuckleberry-Finn/pz-shops/pull/48 🤞 🎉
Very nice! Thank you so much.
any mod expert here????
want to make a knife at a mod i use for cutting zeds to be drainable each time it cuts a zed
nah they all left.
😦
recipe Get Zombie Eye
{
CorpseMale/CorpseFemale,
keep LCKnife,
Result:ZombieEye,
CanBeDoneFromFloor:true,
Time:100,
Category:Health,
}
you want to take condition from the knife, right?
yea
item LCKnife
{
DisplayCategory = Material,
Weight = 0.4,
Type = Normal,
CanBeEquipped = TRUE,
DisplayName = LCKnife,
Icon = LCKnife,
WorldStaticModel = LCKnife,
}
i must change item and recipe right?
i want it to be near 100 times lets 110 to be safe
its for questing
so i need it to brake so they cant repeat quest unlimited time
any idea is welcome
TicksPerEquipUse
The parameter sets the value of how many ticks must pass for the item to spend one use.
maybe its this?
Hello guys, I need help. Im working on translating The Workshop/Scrap Armor/Scrap Weapons mods in French but for some reasons the recipes are still in english when i look in Crafting menu. Also some items from The Workshop are still in english. All the tooltips/weapons etc are correctly in french. I have no idea why some things are working and others not. Anyone has any idea?
i translated many other mods before and they always worked
i saw this i hope it works
item LCKnife
{
DisplayCategory = Material,
Weight = 0.4,
Type = Drainable,
UseDelta = 0.01, /100 uses/
CanBeEquipped = TRUE,
DisplayName = LCKnife,
Icon = LCKnife,
WorldStaticModel = LCKnife,
}
usedelta
uhhh you need to make your item drainable
lol
yeah
what I was thinking
it might make it look weird in the ui
LCKnife = 1 in recipe, i think
ty
ty
i believe so
thanks i'll have a look at all that 🙂
Does anyone here have a step-by-step link or where can I find it? I wanted to make an animation for my Zomboid mod, where do I start?
@wicked crane ty it worksssssss
is there somewhere i can see all skill names for mod making?
SkillRequired : MetalWelding= this is metalworking for example is there anywhere on internet all these skill together?
IGUI_perks_Combat = "Combat",
IGUI_perks_Blunt = "Long Blunt",
IGUI_perks_SmallBlunt = "Short Blunt",
IGUI_perks_LongBlade = "Long Blade",
IGUI_perks_SmallBlade = "Short Blade",
IGUI_perks_Axe = "Axe",
IGUI_perks_Spear = "Spear",
IGUI_perks_Aiming = "Aiming",
IGUI_perks_Reloading = "Reloading",
IGUI_perks_Crafting = "Crafting",
IGUI_perks_Carpentry = "Carpentry",
IGUI_perks_Woodwork = "Carpentry",
IGUI_perks_Cooking = "Cooking",
IGUI_perks_Farming = "Farming",
IGUI_perks_Agility = "Agility",
IGUI_perks_Sprinting = "Sprinting",
IGUI_perks_Lightfooted = "Lightfooted",
IGUI_perks_Nimble = "Nimble",
IGUI_perks_Sneaking = "Sneaking",
IGUI_perks_Fishing = "Fishing",
IGUI_perks_Survivalist = "Survivalist",
IGUI_perks_Trapping = "Trapping",
IGUI_perks_Foraging = "Foraging",
IGUI_perks_Doctor = "First Aid",
IGUI_perks_Accuracy = "Accuracy",
IGUI_perks_Guard = "Guard",
IGUI_perks_Maintenance = "Maintenance",
IGUI_perks_Firearm = "Firearm",
IGUI_perks_Passive = "Passive",
IGUI_perks_Strength = "Strength",
IGUI_perks_Fitness = "Fitness",
IGUI_perks_Electricity = "Electrical",
IGUI_perks_Mechanics = "Mechanics",
IGUI_perks_Tailoring = "Tailoring",
IGUI_perks_Metalworking = "Metalworking",
That should be it. You can find a lot of lists of actual names for stuff in the english translation files
Is there any guide or tutorial on how to create items? for example I want to create a card, just a card that says "CARD" and an image that I choose.
sorry, I forgot to copy it. There seems to be two perks with metal stuff:
IGUI_perks_MetalWelding = "Metalworking",
ty
thx
that is all scripttypes - scroll down a bit and you will find "Item block structure". You will eventually need some of the other scripttypes too though. You can of course simply copy what already exists in vanilla and alter it to your likings 🙂
I have never programmed, I want to learn how to make some mods in project zomboid and I want to start with this, copy and paste wouldn't teach me anything, I hope it won't be too complicated to start with simple things.
Items are actually very, very easy to make, so they are the perfect point to start from
Perfect, if it is well explained, it will be easier for me, thank you very much.
WeaponSprite any1 know what this is at weapons?
it is their model
as in model scripts
no, the link to the model script. Model script sets mesh ("fbx") and texture ("png")
ok really ty for your time
no problem mate!
i am trying to make 6 unique super rare items
1 for each trader
was having in mind a superkatana that can be repaired many times
will check probably how the scrap weapons mod repairs weapon and use katana vanilia stats
I think there already even is a katana repair mod
no, I mean, you could look at how they did it. Would save you a lot of time
tyyy
fixing Fix Katana
{
Require : Katana,
Fixer : SheetMetal=1,MetalWelding=4,
Fixer : ScrapMetal=2,MetalWelding=4,
Fixer : Katana=1,
}
lol not even tools?
You could of course add tools 😛
could someone point me to the best place to start learning pz modding as big man bonepart once said if you want something done do it yourself
what you tryna make? Models, Mapping, code
im trying to remake someones car mod so it can work with rv interiors
Modeling you can just watch any blender tutorials that suit you, i wouldnt reccomend doing any YT tutorials that seem boring to you find someone that you can easily learn off of and actually enjoy learning it.
Hello here! I'm creating a mod with custom crates. Everything works, except when I want to place a crate from my inventory, I get the error "cannot create recipe for this movable item". If I restart the game with the item still in the bag, no more errors. We only see this error in debug mode. Otherwise everything is going well. An idea ? 😅
Hi! iirc, there is a random house story sometimes appearing in game where the owner seems to be some type of survivalist or prepper. You can find various trapping/hunting related items lying on their tables as well as crafted jars of vegetables. Does anyone happen to know how I can spawn this story in debug mode? I tried the options of the "Randomized Buildings" but wasn't able to find this particular thing.
a related question: where are the data for randomized building and zone stories stored in the game files?
I think it's only for vehicles and survivor events?
is there any way I can see the games current "callstack"? as in what exactly is going on when I make an action
🤔 I'm on a quest to link Raven Creek's river to Slocan lake, currently following the holy Dirkie tutorial, but when exporting from BMP to TMX, I end up with that error text.... It's been like that for a few months now, everytime I tried fixing it by installing back the map editor from the forums, from Steam, verifying the files... I always end up with that. I'm quite confused
attempted index: getBodyDamage of non-table: null function: zReMonitor -- file: zReVAC2_TestCode.lua line # 3 | MOD: zRe Vaccine 2.0 ReMod by kERHUS java.lang.RuntimeException: attempted index: getBodyDamage of non-table: null at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492) at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980) at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812) at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66) at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139) at zombie.Lua.Event.trigger(Event.java:64) at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:65) at zombie.GameTime.update(GameTime.java:671) at zombie.gameStates.IngameState.UpdateStuff(IngameState.java:566) at zombie.gameStates.IngameState.updateInternal(IngameState.java:1623) at zombie.gameStates.IngameState.update(IngameState.java:1333) at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101) at zombie.GameWindow.logic(GameWindow.java:298) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71) at zombie.GameWindow.frameStep(GameWindow.java:765) at zombie.GameWindow.run_ez(GameWindow.java:681) at zombie.GameWindow.mainThread(GameWindow.java:495) at java.base/java.lang.Thread.run(Unknown Source)
what's wrong?
local function zReMonitor(player)
local infectionStatus = player:getBodyDamage():IsInfected();
local infectionLevel = player:getBodyDamage():getInfectionLevel();
if infectionStatus then
player:Say(tostring(zReInfectionLevel));
end
end
Events.EveryTenMinutes.Add(zReMonitor); ```

Your player is probably smth different than an IsoPlayer
Do getPlayer() for the time being instead of player
ah shieet... yep. thats work
There is one thing that is not clear to me in the PZWiki to create my own item, the icon image, where should it go? and what dimensions should it have? I don't see anything on the wiki.
And can all items and other configurations be in the same file or must they be individual?
icons simpy go in the textures folder (32 x 32 png)
You mean if you can put weapon, books and potatos in the same item script txt file? Yes
pefect, thx mate
no problem
Does the object have to have some special weight option or something to be shown? because I get the "?" icon in the game, both names are fine, they are 32x32 and that's it.
my bad, forgot the naming: Add "item_" as prefix to your png
so when your item wants the icon "testtest", you need a 32 x 32 png called "item_testtest" in your textures folder
Ok, thanks, but it's weird because the guide doesn't say anything.
not everything in there is nescessarily complete. The best you can do is look at how other mods did it
The thing is that since I was doing it inside the soulficher quest mod (so I didn't have to do all the folder creation etc) I had a custom object image right next to it and I didn't even notice it, hahaha. Thank you very much for the help.
you are most welcome!
The event for every ten minutes doesn't pass an isoPlayer I think.
If you have the java decompiled you can see what's getting sent into the method.
i have a braincrack after war with formulas

found most of them, like infection rate
but how knox infection fill stress and sick
like stress and sick from infection source
i want reduce/absorb/downgrade how much stress and sick gain from infection
but idk how
just i know i should divide sources, because for stress and sick exist another sources
looks like it progressive with mortality duration
like, u should die after 3 days from knox infection
your stress level be full after ~40% of this time
hmm....

Reason: Bad word usage
Hey guys!
I've recently released a mod called "To-Do List". Its main purpose is, at the title goes, to give you a UI in which you can keep list of stuff to do or scavenge. I of course use it myself, and find it quite helpful for those like me who are having a hard time keeping track of all the various stuff that Zomboid requires of you to survive and prosper.
Gaben did not yet bless the mod with being promoted on "Popular this week" block, so I would appreciate your likes, subscribes and comments 🙂
Cheers!
https://steamcommunity.com/sharedfiles/filedetails/?id=3175536048
Sorry for that, my fault. But was not on purpose, lol. Great mod, I will give it a shot 😄
Reason: Bad word usage
Quick question, could it be possible to make a common safe house to do list for all players that are part of the same group? And then make your own personal one? Just a thought
Yeah I saw your "erect" series taking up all space 😂 People seems to love it though, so, well deserved!
I am so sorry for that though 😭 🤣 I did not anticipate the rush
I actually have it in my "To-do list" to-do list ™️! You can vote for that feature 🙂
The ™️ killed me 😂😂 (I checked the mod page before asking just to not seem like an idiot but seems I missed it anyway)
It's here, check it out
https://tally.so/r/mYW855
Now I just need a mod to ping a place I can see kinda like how battle royales do nowadays
Nothing to be sorry about mate! Your mods are doing numbers, that's awesome!
...
Well, maybe it would be optimal to use just one slot instead of 4🤣 But again, no hard feelings dude, I know it wasn't on purpose
It was 6 for some time 😬 xD I only ever wanted the extinguisher to stand, then everyone and his mother asked me for the other stuff. Took me three more mods to realize they wont stop until everything is standing xD
That they do 😅
Well, at least I hope you use the word "erect" in the mod ID, that would make it all worth it 😂
I do 😛 Everytime you want to make an item stand up xD
It basically is the recipe name for all "stand up" recipes
Hi all, I am attempting to transition my Script to LUA base to be more streamlined and hopefully be a bit more compatible with other mods, though I've ran into an issue where I just cant seem to incorporate the users Sandbox Settings into my scripts equation, it just seems to completely refuse to run the Events.OnLoad Function, the rest of my mod works fine, except that the Users Sandbox Settings will not come into effect and the value will always remain the default
This is the part of the script that just does not seem to initialize (nor does it trigger any Print outs):
Events.OnLoad.Add(function()
weightMultiplier = GetWeightMultiplier()
print("DGConfigurableGunWeights: Returned a Weight Multiplier of: "..weightMultiplier.." with a Settings Multiplier Listed as:"..SandboxVars.DGConfigurableGunWeights_weightMultiplier)
end)
function GetWeightMultiplier()
print("DGConfigurableGunWeights: Now Requesting Users Sandbox Multiplier Settings")
return SandboxVars.DGConfigurableGunWeights_weightMultiplier
end
I have set my Sandbox setting for the mod to a value of 2 which should Double the weight of all weapons rather than halving it, but unfortunately it just doesnt seem to trigger either event
But these are the only Log print outs that I get in relation to my Mod:
LOG : Mod , 1710362810989> loading DGConfigurableGunWeights
LOG : Mod , 1710362810994> mod "DGConfigurableGunWeights" overrides media/lua/shared/translate/en/sandbox_en.txt
LOG : Mod , 1710362810997> mod "DGConfigurableGunWeights" overrides preview.png
LOG : General , 1710362821584> DGConfigurableGunWeights: Successfully Set Adjusted Weight of: Base.Pistol to: 0.75
LOG : General , 1710362821584> DGConfigurableGunWeights: Successfully Set Adjusted Weight of: Base.Pistol2 to: 0.75
LOG : General , 1710362821584> DGConfigurableGunWeights: Successfully Set Adjusted Weight of: Base.Pistol3 to: 0.75
etc
etc
etc
Question, how would one go about editing container sizes for inventory tetris, I currently have a patch of my own I made that changes gun sizes to things as big as 3x6, 2x7, etc, but I need to resize the gun/pawn store display cases for them to fit. What's the proper way to get the container name and how should I be formatting it the .lua files for it?
i don't really know why it isn't firing, but try OnInitGlobalModData instead - this is an event i've reliably used for using sandbox options to mess with scripts
what exactly is the problem with your mod?
Thank you for that 🙂 I may give that a try if i run into this issue again, for some reason magically, it has finally decided to trigger the event 😛 I have no clue what was stopping it initially, though I've found out that the 'SandboxVars.DGConfigurableGunWeights_weightMultiplier' value is apparently returning as null, rather than the users sandbox setting, which could be why it keeps reverting back to the default value of 0.5 - Atleast it seems I am finally making progress again now 😅
any good car mod tutorials?
tfw fuel pumps still work (under certain circumstances) when my mod restores the power
now i have to figure out why it does that and how to make it not do that
it seems to be consistent amongst cars and happen only to the fuel pumps that specifically were under the condition i discovered
anyone got links to the up to date mod tutorials?
apparently my blackouts mod does not disable fuel pumps that you have interacted with before (when it catalogs the fuel count)
any way to look at further details of tiles?
i used F2 to read the details but the only thing that looks off is the fuel count is catalogued
the tile even says haveElectricity = false
but i think that might be for the floor tile
is it possible to take a model of a car in game and put it into blender to use as a base to make my own?
my b i thought i was in that channell ahah
Would anyone know why my Mod attempts to run desired code during game start ONLY when there is an error there, but if their is no error, the Initialization side of my script is completely ignored until the shutdown process begins..... I'm terrible at explaining and often creating walls of text trying to explain my terrible grammar and Coding Lingo, so I've added a video to hopefully explain my issue.
In short... my Code execudes during startup like it should, but only if there is an Error there.... if there is no error within the parts of the code that I would like to happen when the game starts... it wont do ANYTHING untill the user decides to shut down/exit the game.... then and ONLY then will my script then decide it wants to implement it's modded data....
your video is private
yeah
Oh my bad, I forgot to save the videos settings, should be good now
it's not actually running your function, the error is during compilation
when you do function GetWeightMultiplier() it creates a new function with that code - and since there's an error in that code's syntax it fails to compile it, hence the error
your function isn't actually being called in either situation
Its a weird error, because before when I wasnt able to return a valid Sandbox value, all guns weight would be modified based on the default value given by the script which was 0.5 successfully the moment the player loaded into their save... the moment I fixed the Sandbox Variable issue, it now refuses to execute the code until the the clicks exit/ ALT+F4s (which seems to be why I only get 1 lot of logs stating that the weights were changed when the game exits, rather than 2 sets that use to happen during startup and exit when it was working with a broken Sandbox value)
try a different event, i don't see OnLoad used very much so that one might be weird
is there some official documentation or atleast well explained documentation in regards to events? What they do? when they execute? firing order etc?
the most detailed documentation i know of is my own https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md but i don't have very much on OnLoad
at least so I can look into and try understand the events more, initially I was told to use OnGameBoot, but in my head that seems like it only happens once when the player starts up the game.. and doesnt fire again when the player loads into their save. so hence I went to OnLoad as that is suppose to only fire once when the player either begins a new game or Continues a save
yeah, ongameboot is way too early for sandbox options
i use OnInitGlobalModData for anything sandbox related, since it's the earliest event after sandbox options actually load - least likely for something to already be set in stone
in some cases you might need to use something later because something you need hasn't loaded yet but i haven't come across anything like that yet
Awesome thank you so much for that, that will certainly help me gain a better understanding, I could certainly use the OnInitGlobalModData one for at least initializing my mods Sandbox Settings. The one I'm a little confused on is how to have an event that Only triggers once when the player loads into their save, ideally the last ever operation before the player clicks the 'Click to Play' so all Gun weights can be adjusted the moment the players fully loads into their game, as i feel changing these Gun Weight values on the main menu wont have a result when the player eventually loads into the game? or am I wrong with that?
OnInitGlobalModData is suitable for that
when i mean it's the first one after they load, i mean during loading into an actual game
the sandbox options aren't actually loaded during the first few stages of loading and they just return the default values
OnGameStart is usually good for this kind of thing but that fires after the chunks around the player have been loaded in, which sometimes means items in that area are still using the old values
Ohh okay, I think thats where I am getting confused Im pretty sure the OnLoad event actually triggers every time something Loads, IE from going to Desktop to mainMenu is considered a load event, going from main menu to saved game is considered a Load event and returning from a saved game to the main menu is also considered a load event
Good evening guys, I'm trying to make a mod to open a resource box for my server. Well, I made two mods, one works perfectly, the other one gives an error both when trying to open the box and when putting the items in the player's inventory. Can someone help me? I'll attach the console.txt. Thank you
not sure what that extension is, our umbrella is part of the lua addon manager (ctrl-shift-p -> addon manager)
the addon manager is part of the lua extension
man you're getting this too? i'm gonna have to look into that, you're not the first
is there any way to change/edit already existing context menus?
For example, I want to make it so the context menu for trading uses the characters name rather then the accounts username.
Would I have to make a context menu that mimics it (and calls the function that the already existing trade menu runs)?
I reset my comp so i got vscode again like 2 hours ago
anyone know why my cars invisible 😭
Any LUA gurus out there that may have an idea what is going wrong with my script? I have been going around in circles all day and am dang near just about over it, just to get one simple thing working is being such a pain 😅
I seem to be stuck in some crazy loop where if the Sandbox settings are successfully pulled from file then my use of the TweakItemAPI Mod to Tweak Item Weights based on those gathered settings refuses to work, at worst my entire For Loop will refuse to run (or at least all logs within the loop wont be produced), where as if I get the For Loop/TweakItem working then regardless of what my sandbox settings are set to the script will only ever use the default value of 0.5 which is the value the Logs claim to be retrieving from the Sandbox settings, despite that number potentially being 7.5, where that 7.5 Value would be displayed as retrieved in the logs only if the TweakItem/For Loop had some sort of failure or mishap due to Initiating too early/Late when attempting to use Events.
Any help would be greatly appreciated 🥰 After launching PZ for well over the 100th time today just to find that either the Weapon Weights weren't changed at all and were left at default PZ Weights (due to the For Loop or TweakItem Failing), or the Sandbox settings weren't taken into account and it defaulted to my scripts 0.5 (half weight), and its only ever been those two outcomes, never anything else is a bit demotivating
All just to have a Single dang Sandbox setting
😅
Has the TweakItem API a specialized function for using sandbox values? And where in the mod do you put your commands coming from the API?
Now you are on the frontpage 😛
The ItemTweaker mod is quite basic, this is the core of ItemTweaker which I am now attempting to hook it directly into my mod, rather than relying on it as a dependency so i can adjust it according to my needs, as I just don't think the event is firing at the right time so am currently going through a handful of different events trying to find one that may work
--Initializes the tables needed for the code to run
if not ItemTweaker then ItemTweaker = {} end
if not TweakItem then TweakItem = {} end
if not TweakItemData then TweakItemData = {} end
--Prep code to make the changes to all item in the TweakItemData table.
function ItemTweaker.tweakItems()
local item;
for k,v in pairs(TweakItemData) do
for t,y in pairs(v) do
item = ScriptManager.instance:getItem(k);
if item ~= nil then
item:DoParam(t.." = "..y);
print(k..": "..t..", "..y);
end
end
end
end
function TweakItem(itemName, itemProperty, propertyValue)
if not TweakItemData[itemName] then
TweakItemData[itemName] = {};
end
TweakItemData[itemName][itemProperty] = propertyValue;
end
Events.OnInitGlobalModData.Add(ItemTweaker.tweakItems)
I can DM my script if that would help, I just dont want to keep posting big text walls 😛
Maybe im dumb, but is there any way to make one item change into another after some time? 💀
You could potentially create a new local int in lua, and also create an event that cycles every game minute, you could increase that int you created with the event firing every minute, once the int reaches your desired time passed you can then trigger a function that would handle changeing the items, I'm a little unsure of how to actually change items, i am still learning LUA at the moment 😛 But hopfully this can help get you started 🙂
local timeLimit = 35
local currentTimePassed = 0
function incrementTimePassed()
if currentTimePassed < timeLimit then
currentTimePassed += 1
else
print(currentTimePassed.." Game Minutes have passed and achieved/surpassed the timeLimit of: "timeLimit" Game Minutes - Now Changing Items")
currentTimePassed = 0 --Reset back to 0 to loop the process if required
--Change Items Here
end
end
Events.EveryOneMinute.Add(incrementTimePassed)
Maybe something like this (this is untested and knowing my limited LUA knowledge likely isn't the greatest way about achieving this, but hopefully helps get you started :))
any1 know a mod or an idea how to create a mod that make all recipe from all mods to disapear recipe after u read???
basically i want it to remove ReplaceOnUse = from all mods i will be using
local bloodLife = {
MatInfectedBlood = { Target = "MatTaintedBlood", Time = 24 },
}
function LabRecipes_UpdateBloodAge(item, container, square)
obj = bloodLife[item:getType()];
if obj then
if item:getModData().Condition == nil then
item:getModData().Condition = obj.Time;
else
item:getModData().Condition = item:getModData().Condition-1;
if item:getModData().Condition <= 0 then
if container == "floor" then
local temp = item:getWorldItem();
square:transmitRemoveItemFromSquare(temp);
temp:removeFromSquare();
square:AddWorldInventoryItem(InventoryItemFactory.CreateItem("LabItems."..obj.Target), 0.5, 0.5, 0);
else
container:DoRemoveItem(item);
container:removeItemOnServer(item);
local temp = container:AddItem("LabItems."..obj.Target);
container:addItemOnServer(temp);
end
end
end
end
end
Events.EveryTenMinutes.Add(LabRecipes_AdjustBloodCondition);
after 240 min (ingame) MatInfectedBlood change on MatTainedBlood
Sending me huge chunks of code is not a good idea. 😉
First of all, if you would like to avoid the ItemTweaker API, you can can easily manipulate the script parameters of your items with a few lines of code by yourself. For example:
local name = "Base.BoxOfJars"
local item = ScriptManager.instance:getItem(name)
if item then
item:DoParam("Icon = MyCustomIcon")
item:DoParam("Weight = 3")
end
end
Events.OnGameBoot.Add(modifyJarBox)```
Probably clear what this does. 😉
In this example, the modification of the JarBox is done on "GameBoot" which is the event where your mod is first loaded after enabling it in the game menu (or when a safe game has been loaded where your mod is active - but let's assume for the moment that you start a new game). Problem is that at this point time, the user cannot have set the sandbox values because the ordering works like this: enable (and load) the mods -> then go to the sandbox menu and change something. So the "OnGameBoot" event is not the right thing for you.
The ItemTweaker uses the event "OnInitGlobalModData" instead. I don't know when this event is triggered (never used it) but your problems might come from a situation similar to the stuff I explained above: the "OnInitGlobalModData" is triggered before you can change any sandbox option and therefore your changes don't have any effects. But just a speculation since I don't know enough about InitGlobalModData...
local function zReAdjustItem(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
zReAdjustItem("Base.K1_Hood", "CanHaveHoles", "false");
without events, easy for adding another items
Here is also something you might try with your current Mod setup (in case you haven't already): start a new game and enable the mod before it. Then change one of your sandbox option and start the actual game (as you would do without any mods). Then quit your game, reload and check after reloading whether your changes apply.
what i asked cant be done probably right???
It is possible to hide a list of recipes from the craftmenu no problem, the other stuff (automatically searching the recipes) I have no clue though
i dont want to hide i just want all recipes to disapear when some1 read them
it will be cool cause when ya die u must gather recipe again + every1 must find a recipe to learn and not all reading same recipes
Thank you for that, honestly even my script isn't even big as it's only 80 lines (about 50% of them being Debugging Logs :P), its quite compact and I've tried to limit repeating lines by utilizing a table for the Items I wish to modify.
However the ItemTweaker API Started with an Events.OnGameBoot which I had changed that to OnLoad and OnInitGlobalModData all 3 without success at the moment, as just from guessing it seemed like OnGameBoot was happening far to early, before the Sandbox settings had even been initialized (which I would like to incorperate to allow the User to tweak my mods aggressiveness towards its weight reduction/addition), and both the OnLoad and OnInitGlobalModData seemed like they happened way too late
@austere sequoia but ty for trying to help
Ok. Then you already thought in the same direction as I did, namely that the event is not appropriate for your work 🙂 (still no guarantee that this is really the source of your problems). You could simply try some other events like "OnGameStart" or "OnCreatePlayer", "OnNewGame". See here for more events: https://pzwiki.net/wiki/Category:Current_Lua_Events
Problem is that I don't know how the DoParam() command which my example and the TweakerAPI uses behaves on those events. (Not sure whether you can just use it any time and it still works).
You might also try those things with your own code and not just changing single commands in the TweakerAPI's code unless you know the API's code very well and you know exactly what you are doing (possible that the API's code has some strange side effects you are not aware of and your testing is therefore not so diagnostically conclusive...)
Yep! The community did the real magic there 😌
you edited your comment? maybe you mean "way too early" in your last line?
Thank you for that 🙂
Believe me, I spent 13+ hrs today, going backwards and forward, doing everything I could humanly think of with my own script, with countless stops and starts of PZ testing every minuscule change to see if it would finally work, before only just about an hour ago decided to resort to modifying the API rather than thinking the issue was my script 😛
As even the almighty ChatGPT and another Discord user yesterday said my code looks fine and that it was very strange that things weren't firing correctly, So if the issue isn't in my code (granted I spent 13+hrs today tweaking, adding debugging, changing, removing etc) the last thing I thought I could try is modify the resources that my mod relies on to operate 🤔 but honestly still kind of leaning toward one simple little thing wrong with my script somewhere, it generally is 😅
I am terrible at explaining myself at the best of times 😛 thats why I thought It may be better to just send my code/mod to someone that knows more and test it them selves if they have the time to see the issues first hand.
I am now kind of thinking the issue lies in that my script relies on the timing of the ItemTweakers event for things to happen just perfectly, I am wondering is there a way that I can directly trigger ItemTweaker's 'ItemTweaker.tweakItems()' function through my own script, rather than hoping the Event happens at the right time? 🤔
what you trying to do?
But unfortunately now that I've messed with ItemTweaker and removed it from my Workshop folder and directly added the Core Script along side my Mods Script, ItemTweaker is no longer even being detected it seems
you could simply avoid the ItemTweaker altogether and write your own version of the "tweakItems()" functon, changing the item properties as you want. use commands like
item:DoParam("Weight = 3")```
the value "3" can be replaced with a value coming from sandbox (presupposed you find the right moment in time where your code should be executed)
still the same issue as yesterday essentially 😛 if you saw that
nope
ItemTweaker - it's very old mod with huge massive - avoid this shit
like razab says, do it like this with do param.
Normal code for easy integration:
local function zReAdjustItem(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
zReAdjustItem("Base.TheItemIWantToChange", "Weight", "3");
Creating a Configurable Gun Weights Mod that the User can set the Multiplier in the Sandbox Settings to either Reduce or Increase the weight of all vanilla guns, the Main issue just seems to be timings, and things just dont happen as expected, the issues have varied wildy since yesterday, from either ItemTweaker not firing or firing before the Sandbox settings have loaded, sandbox settings not being detected and reverting to the default value of 0.5, and after reloading the LUA in-game my script will reload everything, but then ItemTweaker will never re-fire its code to actually update the weights, and everything inbetween while triny to learn LUA to so very hard for me to understand and follow what is actually going wrong, and half the time Debug Logs that are within my script just don't seem to appear on the In-Game console nor in the console.txt file (some times) I managed to get it working again now, but the issue I am facing now that the sandbox settings are just not referencing properly... so probably all very confusing... it certainly is for me XD
you want apply Multiplier for all weapons?
not change one by one?
like reduce 50%?
yep?
My script already seems to do that, or atleast it uses that way to gather the original weight to be used in calculating for the modded weight, which I Have listed all Vanilla Gun ID's (Base.Pistol) etc in a table at the top of the script, and the for loop iterates each found ID to apply a weight to each in theory
for _, itemID in ipairs(baseItemIDs) do
if getActivatedMods():contains("ItemTweakerAPI") then
local originalWeight = 0
local itemDef = ScriptManager.instance:getItem(itemID)
if itemDef then
originalWeight = itemDef:getActualWeight()
local adjustedWeight = CalculateAdjustedWeight(originalWeight)
TweakItem(itemID, "Weight", adjustedWeight)
print("DGCGW: Successfully Adjusted Weight of: "..itemID.." from: "..originalWeight.." to: "..adjustedWeight.." Based of a weightMultiplier of: "..weightMultiplier.." and a given Sandbox Value of: "..SandboxVars.DGConfigurableGunWeights.weightMultiplier)
else
error("DGCGW: Item not found with ID: " .. itemID .. " - Now reverting to 0")
originalWeight = 0
end
else
print("DGCGW: ERROR - ItemTweakerAPI was not Activated!")
end
end
@keRHUS, I think the main problem is to execute the "zReAdjustItem" function AFTER the player has accessed the sandbox menu so that OP can change Weight with a value coming from the sandbox options (and not with a hardcoded value like "3"). Question is then simply which event to use for triggering the ReAdjust function. Do you happen to know a suitable event for this?
I would still remove all references to and functions from the ItemTweaker alltogether and make your code fully independent of it. Will not directly solve your problem but give you much cleaner and more stable code. Also much better and easier for testing purposes
local function zReAdjuster(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
local function zReWeightChecker(item)
local items = getAllItems();
for i = 0, items:size() - 1, 1 do
local item = items:get(i);
if item:getTypeString() == "Weapon" and item:IsAimedFirearm() then
local MultiWeight = SandboxVars.zReAAS.zReAAS_WeightMulti;
local StandartWeight = item:getWeight();
zReAdjuster(item:getFullName(),"Weight",StandartWeight*MultiWeight);
end
end
end
Events.OnInitGlobalModData.Add(zReWeightChecker)
We thought the OnGameBoot event is not suitable here since this event is triggered before the player could acutally set some sandbox values - or isn't it?
otherwise, the code looks like something OP could almost copy-paste. just the event is still in question...
OnGameStart (Triggered after the start of a new game, and after a saved game has been loaded.)
that was smth I suggested too! at least for trying and see whether it works
Event.OnInitGlobalModData, is the most suitable because it s called right after the Sandbox options are initialized.
thanks
strange... OP said they tried this without success... maybe there is another issue with the code then
but maybe they should simply try kERHUS' updated code from above without any ItemTweaker API and it will work then
I may be getting confused with them I had tried so many when testing why my sandbox settings weren't being detected (I am also using the mod that allows you to change sandbox settings mid-game, which should take effect after reloading), is there something that I would require to do in my script to allow that mod's change of settings to take effect?
first thing I would do now is taking kERHUS' code from above and use this as a base for your work. this will make you get rid of the ItemTweaker API
local MultiWeight = SandboxVars.zReAAS.zReAAS_WeightMulti;
local StandartWeight = item:getWeight();
local ModifiedWeight = StandartWeight*MultiWeight
local MModifiedWeight = tonumber(string.format("%.2f", ModifiedWeight))
if MModifiedWeight >= 0.01 then
zReAdjuster(item:getFullName(),"Weight",MModifiedWeight);
else
zReAdjuster(item:getFullName(),"Weight",0.01);
end
I did just implent a revised version of it, unfortunately ran into an error and forgot to uncheckthe Break on error 😛 But oviously I think that was just user error 😛
LOG : General , 1710415407217> DGCGW: Found Weight Multiplier - Now Returning Value: 0.5
LOG : General , 1710415407217> DGCGW: Retrieved a Weight Multiplier of: 0.5
LOG : General , 1710415407219> -----------------------------------------
STACK TRACE
-----------------------------------------
function: AdjustGunWeights -- file: DGWeightsScript.lua line # 58 | MOD: DefectGamingsConfigurableGunWeights
function: DGWeightsScript.lua -- file: DGWeightsScript.lua line # 85 | MOD: DefectGamingsConfigurableGunWeights
LOG : General , 1710415407220> Object tried to call nil in AdjustGunWeights
LOG : General , 1710415407287> creating new sourcewindow: C:/Users/Fury-PC/Zomboid/Workshop/DefectGamingsConfigurableGunWeights/Contents/mods/DefectGamingsConfigurableGunWeights/media/lua/client/DGWeightsScript.lua
More weirdness happening :L somehow the returned Sandbox value is 0.5 despite my setting being set to 2 and apparently some nil value slipped through after the sandbox settings were gathered
nothing can say, should look into code
as kERHUS said, impossible to say what is wrong without seeing the code
but "Object tried to call nil in AdjustGunWeights" means that you tried to apply a command to an object which has no value ("nil") or that you tried to apply a command of function which doesn't exist
Or object doesnt exist
:D
function zReAdjuster(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
this is stuff if item then for avoid nil. It's terrible situation when working code drop fatal error because something NIL, stupod lua!
just avoid it, huh?!
😅 😅 Seem to be making progress now, better not speak too soon though all progress will be stripped soon I can feel it 😛
I was able to get it back to the 'working' state that I had it with ItemTweaker at its best stage, which was that all weights are successfully changed.. though the Multiplier is just some random number that my mod decides to make up.. I changed the Script default to 1.5, the Games original sandbox multiplier was Set to 2 when first starting this save, and the current Sandbox settings according to the mod that allows me to change the settings says that its on 7.5
So I am absolutely baffled as to where its pulling this 0.5 digit from now once again 😅
This is the Logs:
LOG : General , 1710416791356> DGCGW: Now Requesting Users Sandbox Multiplier Settings
LOG : General , 1710416791356> DGCGW: Found Weight Multiplier - Now Returning Value: 0.5
LOG : General , 1710416791357> DGCGW: Retrieved a Weight Multiplier of: 0.5
LOG : General , 1710416791357> DGCGW: Successfully Adjusted Weight of: Base.Pistol from: 1.5 to: 0.75 Based of a weightMultiplier of: 0.5 and a given Sandbox Value of: 0.5
LOG : General , 1710416791357> DGCGW: Successfully Adjusted Weight of: Base.Pistol2 from: 1.5 to: 0.75 Based of a weightMultiplier of: 0.5 and a given Sandbox Value of: 0.5
LOG : General , 1710416791357> DGCGW: Successfully Adjusted Weight of: Base.Pistol3 from: 1.5 to: 0.75 Based of a weightMultiplier of: 0.5 and a given Sandbox Value of: 0.5
LOG : General , 1710416791358> DGCGW: Successfully Adjusted Weight of: Base.Revolver from: 1.75 to: 0.875 Based of a weightMultiplier of: 0.5 and a given Sandbox Value of: 0.5
ETC (Shortened due to exseive length)
I put my Script into paste bin if that would help at all, am I even initializing the Sandbox settings correctly? as it just doesn't even seem to represent a logical accurate number
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
line 26 looks like something wrong...
if SandboxVars, but what it'is, where this is predetermine... should it be here?!
getActualWeight()
try getWeight()
From my very limited knowledge, I had assumed, and ChatGPT led me to believe that was the way to access the Sandbox Settings, but that specific line on 26 was added at later stage to help debug to figure if it even existed, which apparently it does somewhere, but from the sounds of your reply this is something entirely unrelated to what i actually want?
I ahd seen servers use the SandboxVars.lua file in order to hold their settings so thought that it was the way about it, who knows 😛 it could well be for multiplayer, but single player could be an entirely different way to access sandbox settings 🤔
same
VERSION = 1,
option DGConfigurableGunWeights.weightMultiplier
{
type = double,
min = 0.01,
default = 0.50,
max = 10.00,
page = DGConfigurableGunWeights,
}
I do have the option added for the Settings which they appear and let me input a value, though it doesnt seem my script is taking it into affect
Which does seem to link up to the requested value in my script:
SandboxVars.DGConfigurableGunWeights.weightMultiplier
DGConfigurableGunWeights.weightMultiplier
In this do you have to initialize or declare SandboxVars anywhere? or is it a global variable that can be accessed by any mod at any time?
SandboxVars.DGConfigurableGunWeights.weightMultiplier - anywhere anymod
function changeGunWeight(Item, Weight)
if Item then
Item:DoParam("Weight = "..Weight)
end
end
this is scary me
if SandboxVars then is useless, it will always exist
same for if SandboxVars.DGConfigurableGunWeights then
Your function is within your mod, if your mod isn't installed, that function will never run anyway
Hmmmmmm... its definitely some form of timing issue, while I was in-game after everything have already finished initializing, I press the F11 menu and reloaded my script and turns out it then decided it wanted to now use the 7.5 multiplier, however exiting and returning on first startup still results in a 0.5 multiplication, so somewhere the SandboxVars are being requested by my script before they've fully initialized or something?
and if it runs, your mod is installed and thus your sandboxoptions too
Ahh I see, I only added individual debugging lines when things werent working or when it started going downhill at least 😛 so I could check that every single aspect of the script was launching as expected
Yeah but definitely no need for this function at all ;)
instead of using your function, just retrieve the sandbox option directly
it will cost less resources for the game overall
No idea if your code is ran all the time but if it is, definitely watch out for these kind of stuff, also the prints should be removed or it'll just clog up the console logs, if there's no point to logging stuff
Would this solve that timing issue I seem to be facing mentioned above?
Also one thing you could do with this function if you really want to log that your sandbox options are retrieved is to store the value in a table
where on the first startup the script fails to read (or atleast it pulls 0.5 randomly from nowhere) but when reloading the script mid-game, it then recognises that the Sandbox value is not actually 0.5 but instead 7.5
Ideally full release I wouldnt really want many, if any logs, all logs at the moment are purely for testing and making sure everything is tip top
So for example:
local mysandboxvalue = {}
myfunction = function()
mysandboxvalue["weightMultiplier"] = SandboxVars.DGConfigurableGunWeights.weightMultiplier
end
Events.OnGameStart.Add(myfunction)
-- in a random function, access that value
local multiplier = mysandboxvalue["weightMultiplier"]
local weight = weight * multiplier (depending on how you use it exactly)
In fact, I suggest doing that
And you should do that
When would the OnGameStart event fire in compareson to my Script that is all just hanging out there executing when ever?
Bcs from what I understand it stops you from getting access to this sandbox option the hard way (access sandboxvars then dgconfigurable etc etc) but directly access it in a single operation
OnGameStart is on a save start
So, if someone changes the sandbox settings in-game, they need to restart their saves anyway
And if you restart your save, you run through this code again and update the value with the new one
Okay cool, I will give that a try 🙂
no idea haven't looked at that
what's that timing issue you got ?
So it retrieves your sandbox values before they are set manually by the player ?
Yeah I see your issue
line 43 you define your function AdjustGunWeights() but you made the mistake of running it directly inside your code
NEVER RUN A FUNCTION DIRECTLY INSIDE
Always add it to an event to run or another function to run it
Never run your functions from the code unless it has some use for it and specific conditions
Say I start an entirely new game.. within that new game I setup the Sandbox Settings to make all guns 2x Weight.. when loading in initially i will see that the Guns have all been reduced with a multiplyer of 0.5 instead of 2 this will happen indefinitly if leaving/rejoining... however if i relaunch my script while the player is still idle inside their game save, i can re-load my code which will forcefully recheck the Sandbox settings, find that it made a mistake by making all weapons 0.5 weight instead of 2.0 and then will re-weigh them all to have 2x weight
So in your case you'll have:
local mysandboxvalue = {}
myfunction = function()
mysandboxvalue["weightMultiplier"] = SandboxVars.DGConfigurableGunWeights.weightMultiplier
-- run your gun weight updater
AdjustGunWeights()
end
Events.OnGameStart.Add(myfunction)
-- in a random function, access that value
local multiplier = mysandboxvalue["weightMultiplier"]
local weight = weight * multiplier (depending on how you use it exactly)
the reason is what I described, when you reload a lua file, it runs everything written in it, so it runs through functions to define them localy or globaly, define variables like I did with local mysandboxvalue = {} or run functions such as Events.OnGameStart.Add(myfunction) which will add myfunction to functions to run when this Event triggers
And in your case it will run your function AdjustGunWeights()
Because it's in the core of the file
So when you launch game and it loads the lua, it runs your function even through you are not in a save with custom sandbox options, and when you get in a save with sandbox options, it won't run your function bcs it's in the core
However if you reload lua, in-game or in the menu, it will run through the script file again
Thus run through your function and get new sandbox options since now there are different ones
That's why whenever you need a function to be ran for a save, you do OnGameStart or OnLoad (which triggers after game start)
So are you saying that my script have been launching on the main menu this whole time, and all sandbox values etc were all being janked because tehnically no sandbox settings can exist on the main menu? so then by the time i click Continue.. load the game.. my script has already gathered all it's information and has no use for the newly found information upon starting the save?
exactly
it has already ran through your script in main menu
Okay that's starting to make a bit of sense now 😛
Would you think first steps first is to put the AdjustGunWeights() into an Event trigger preferably OnGameStart or something to make it only fire once when the player loads into the saved file?
Definitely
Just take my example above
this
You Sir are a true legend, works flawlessly after doing that 😄
Now I can finally start tidying up my mess of Debug Logs 😛
Hi All,
Get Scrapping Simulator Today!
Steam Store Page:
https://store.steampowered.com/app/14...
Humble Store Page:
https://www.humblebundle.com/store/scrapping-simulator
Join our Discord:
https://discord.gg/Rw5qxNqfBT
Visit our Website:
https://defectgaming.com/
Run it OnGameStart and it should work
np ;)
Nice, you even took the time to make a video lol
I'm curious actually, what did you use to edit your video ? That looks like a quick edit you just made
Thank you so much for all the help! Including @verbal yew & @small topaz Also, couldn't have done it without you's 🙂 ❤️ 👍
Also it's technically possible to update the weight in real time, but I definitely think it's not needed
Just Camtasia Studio, its really good at just doing some quick clips like that 🙂
thx the zooming effect looks clean so I was curious
Both for recording and editing 🙂
I'll probably stick to OBS for recording but I learned a bit of video editing a month ago to make a presentation video that runs on my workshop page
You could do that in fact
Not enough people use it and it makes it so good to show off features of mods in an instant
Even better than putting images
Heheh I'm certainly no wizard when it comes to editing, Camtasia hoeslt ydoes all the work 😛
Me neither but I was able to do something fairly clean
😮 nice that looks awesome is that a HQ gif or is it an actual video?
it's an actual video
ohh thats awesome, I thought you could only do gifs for moving pictures 😛 I'd certainly have to look into that if I get more into modding and creating for the community 🙂
[video mp4=https://i.imgur.com/dAvvzEL.mp4][/video]
This feature is so unknown to the modders of PZ it's actually impressive
But it's used a lot in other game's workshops
you just link a video like you would with an image
I mean you're the guy who made all those weight reduction mods are you ?
And i've been active working on and updating an indie game for over 4 years on steam now Posting news events and all and never even knew this existed, good find 👍
nice what's your game
Yeah I was a little ashamed of them honestly as they were just the simple txt way of doing it which I found tends to overrite other mods, so I am hoping this new LUA system will take those old ones over and be the new and improved 🙂
Once the Gun Weights is sorted I aim to Update both the Bag Weights mod and Item Weights mod to work on a similar framework 🙂
Scrapping Simulator, Just a little passion project, but i'ts definitly getting there 🙂 but don't want to shameless plug to much ahahah 😛 I couldnt be more grateful for the support with my Mods/Issues 🙂
very true, i thought it couldn't hurt to add one more right? 😅
Would definitely be the kind of game Let's Game It Out would fucking destroy lol
I bet! hahah
what are the engine limits for character animations?
I'm a sucker for good animations and I've been working with blender animations for FPS reloads, I was wondering if i could create detailed third person animations for actions and reloads
Can someone tell me how i can add items for a custom occupation?
did you check how the base game does it ?
first time coding anything, so i have no idea what im doing
there is some basic info on the wiki. But best is to look at how other mods or the basegame are written
if you run into more specific problems, feel free to ask of course
alr, thanks.
Can someone explain what ZedScript's purpose is for? I saw other mods using it to (presumably) register items, but I have no idea what role it represents.
@austere sequoia hey mate, just noticed you're about to do the translations of your "erect 'em all" mod
make sure you use this tool https://github.com/Poltergeist-PZ-Modding/pz-translator
I can't stress enough how much time it saves
like, you run one command, kick back and watch it working
creates all 20+ translations automatically, even minding the different encoding requirements
Awesome dude, thank you! 😄 I was already stocking up on candies for a full day of copy/pasting 😄
save 'em candies for a rainy day!
Also, do I have to use scripts or can I alternatively use Lua only? I'd much prefer using Lua over these txt scripts. Custom recipes is my main goal so if I can do that purely in Lua, that would be very nice.
you could theoretically do it through Lua
but i wouldnt recommend
the recipe constructor is public
but you'd need to hook into an event in the beginning of the game to create the recipe and add it to the list of recipes
whereas a simple txt file would do all that hassle for you
I see, thank you
When defining a lot of new items in the script.txt file, is it in general a good idea to define a new module or is it better to assign them all to the vanilla module "Base"?
its for compatibility like uniq full name
another module avoid problem with override side mod by mod
like Base.Bleach and MyModBase.Bleach - not same and not overrides
i prefer use personal tag/suffix in my mods
like
Base.zRe_Bleach
uniq enough, imho
is there any way to change/edit already existing context menus?
For example, I want to make it so the context menu for trading uses the characters name rather then the accounts username.
Would I have to make a context menu that mimics it (and calls the function that the already existing trade menu runs)?
Overriding shouldn't be an issue due my naming conventions (for example "Base.MyModName_MyItem")
I am just wondering whether new modules have any impact on performance...
Probably not, it's like a namespace. Having 10 items added in one module vs defining 10 modules with each having one item should not make difference.
Hey guys! Is there a way to switch a specific light switch of a house on or off in a certain radius? is there a way to open a specific gate or door or lock it in a certain radius? Is there a way to turn a specific generator on or off in the same manner?
anyone know how to make a poster mod?
a poster mod ?
You mean for the main menu ?
if you mean like "poster on the wall as decoration", look at how azas posters does it
yep thats the type im going for and ty
if you dont have it already, also get project zomboid modding tools on steam
ok so ive bumped into a weird problem
one of my true music mods started spawning a ton of cassettes in vehicles
ive reduced the rates in the lua files but its now spawning more?
lol
makes 0 sense
this is the rates im at rn
lemme see if they stop spawning if i make the rates a ludicrously low number
honestly just gonna reupload the mod, something must of broken when i updated it 2 weeks ago
gonna be overheating my cpu converting mp3 files again 🙃
I really like medical simulation mods for games (e.g. Ace Advanced Medical in Arma 3).
I've heard that some things in the game are 'impossible to mod' is the current hp/medical system along those lines?
I currently have https://pzwiki.net/wiki/Modding open to try and suss that out.
either true music is broken or lua files aren't being read properly, spawn rates aren't being set properly
worked fine last month
if they spawn with these rates then the mod is utterly broken
lol
numbers this low aren't interpreted correctly
inherent flaw behind the 'millions of nearly identical items' strategy
again
these numbers arent what i used to use
i think i used to use like 0.0001 at the most
since theres like 1000 tracks
so need the spawns to be lower
but im making it like 0.00000000000000000000000000000000000001 to see if it outright just doesnt spawn lol
and if they still spawn a bajillion then the mod is borked
we use custom spawning logic to handle this better
imo true music just should not have been designed this way in the first place
never blame a 'recent game update'
ah fair
i just assumed since why would it work 1 month
but not the next
well worked fine since about a year and a half ago
flawlessly
we use 'dummy' items, we actually spawn one single item and use lua to swap it with a random cassette when it spawns
so we can actually control the spawn rate in a meaningful way + so more items doesn't mean more items spawning
i just don't know how to fix this spawning issue
it spawns like 30 cassettes in almost every car lol
thats with nothing but my mod enabled
is there any way around this or is this just a true music problem?
it's a true music problem
oof
imo it never should have had separate items for each song
but also i have no idea if they could have predicted the scale on which people would use it
i always almost convince myself to write my own but i just don't see it being a large benefit to users
yea i think the developer of the core mod is going to have to modify it
unless they aren't active anymore then rip
realistically it would be ignored, at 'best' it would create a nightmare situation of two incompatible systems
anyone know how to make their own rv interior cell?
Hello Hello! I'm trying to create a mod that simulates a woman's menstrual cycle (it's an inside joke), in which basically, as many know, every x week, during one week a woman has her period. As she bleeds, she has to use menstrual pads as a bandage so her clothes stay clean, don't get infected or attract zombies. And also add variation in moods.
Currently I've already added the menstrual pads as bandages and added a menstruation trait if the character is a woman and made her bleed from the groin, but I don't know how I'm going to simulate or do the part of just bleeding x times a day, during a week, after x weeks, how the menstrual cycle works. Any idea? (My first time modding)
@bronze yoke the other issue is if it was all 1 item, wouldn't you not be able to spawn the items using a cheat spawn tool since you can't exactly search for the song you want?
or would it be coded in a way that would show every song?
add bleeding to groin area every few hours lmao
i'd probably do something similar to the way vhses work and have some admin tool to switch spawned 'blank' cassettes to a specific one
ah
the way we did it within the bounds of how true music currently works though is to just replace the blank with the individual items when it spawns
so those individual items still exist and can be spawned, they just don't technically have spawn chances of their own
that is the solution during 1 week, but it needs to stop after one week and start again like 4 weeks after
if game time passed = 1 week then stop mod
if above true start counter
if above counter = 4 weeks activate mod
not that code exactly
that shit wont work but thats the baseline for you idk what the code would say specifically but those 3 points would make it work for you when coded properly
okok I will try to make it work thx
local function MenstrualCiclesLol()
local player = getPlayer();
if not player:isFemale() then return end
local cicles = player:getModData().MyModCicles
if (cicles == 0) or (cicles == nil) then
cicles = 720 -- 1 day = 24 h, 30 days = 720 168 = 7 days
end
cicles = cicles - 1;
if cicles <= 168 then
--DOIT HERE MENSTRUAL SH1T!!!
player:getBodyDamage():setAnger() = ZombRand(0, 0.8)
player:getBodyDamage():setSick() = ZombRand(0, 0.8)
end
if cicles > 168 then
--REMOVE MENSTRUAL SH1T!!!
end
end
Events.EveryHours.Add(MenstrualCiclesLol);
Would anyone know if the function:
ScriptManager.instance:getItem(itemID)
Would be able to pickup Items that have been added to the game by a separate mod?
yeah
Awesome thank you 🙂
anyone know how to make their own rv interior cell?
hi, do u know how to work with overvrite stuff by events and another way (without events)
for example:
Im trying remove item tweaker from better sorting, by have a problem with override categories, like:
first and main core get all items and change categories for them by condition:
and second step should be predetermine specific items by mods, like:
this is step without events and it's okay when you first launch game - all categoryes ok, but after rejoin to server - all categories changes back like in first step
it's possible to launch first step without OnGameBoot event?
it doesn't look like anything you're doing relies on that event
so it should be fine to just call it when the file executes yeah
how?
just write zReBetterSorting(); instead of Events.OnGameBoot.Add(zReBetterSorting)
or both of this not req here?
thanks :з
do u know how work stress and sick when you knox infected?
how are they accumulated, where i can get these values?
like, yep, i can do it with event everyTenMinute for example, get first value, after ten minute get second value, subtract the difference between this. But... knox infection not alone way to generate sick or stress... And idk how to get this values... How to separate this...
does anyone know how possible it is to change a hat/head accessory model based on the hair equipped? for example--having a ribbon/bow model look one way on tied hairs and another on loose hairs, or even different per-hairstyle..?
Reason: Bad word usage
OnZombieUpdate - high weight for performance?
probably the most expensive event in the game
OnTick too?
difference is ontick is once a tick, onzombieupdate is once a tick per zombie
so often hundreds of times heavier
hmm... but how work OnTick? What thats mean? One frame per second or?
as fast as possible, usually whatever the fps limit is set to
rendering happens on the same thread so frame == tick in this context
hmm...
but if i want doing some code every 7 sec, what i should do with events?
for example
anyone got a good guide onto making a poster mod 
at what point exactly are you stuck?
Can I make it that my mod overwrites its own data in case another certain mod is installed alongside it? And if so, how exactly?
idk how to make the tile
Quick video on getting custom tiles in the project zomboid editors (buildinged, tiled and worlded)
If you like what im doing please consider donating to my Patreon.
https://www.patreon.com/DaddyDirkieDirk
I found Daddy Dirkie Dirks tutorial series very helpful
@bronze yoke someone posted a fix for my problem in my mods comments :)
this basically solves the issues
i think this works best for massive music collection mods rather than smaller ones
which is perfect for me
Hello! I was thinking is it possible to make 1 makeup item for example lipstick to be capable to apply all kinds of make up?
{
DisplayCategory = Appearance,
Weight = 0.2,
Type = Normal,
DisplayName = Lipstick,
Icon = Lipstick,
MetalValue = 1,
MakeUpType = Lips,
WorldStaticModel = Lipstick,
}```
I tried editing item in MakeUpType = Lips; Eyes, but got no luck
i think it's problem with UI
something here:
Is there any way to set the key for certain door?
I'm making a mod for my server and i created a keycard item which is basically a key.
I need to set my security doors to be opened with that created key card that i pretend to spawn as admin in the proper place.
How would i set door and key IDs ? Or a workaround to make them be opened with that keys. I'm a bit lost.
I can get building and/or door key as admin. But i want that key to be my keycard.
For setting keys I'm not too sure but checking if a player has the right item to open a door ? Yeah definitely doable
declaration: package: zombie.iso.areas, class: IsoBuilding
Oh! You're right, i can make the trick xD Thank you
You can access the key of a building this way
I believe you can change it
give me a sec I'll look at it
I'm so noob with lua, but i will try. Thankfully i understand most scripts due to my C# background
-- access an IsoDoor object anyway you want, I'll name it door
local keyID = door:getKeyId()
myCardKey = --number integer
if keyID ~= myCardKey then
door:setKeyId(myCardKey)
end
If i'm not wrong this sets the key to be the keycard, right?
-- you access an item and check if it's a key, it outputs a Key object
-- I'll name it key here, let's say you already checked it's a keycard then:
myCardKey = --number integer you set for the door
local keyID = key:getKeyID()
if keyID ~= myCardKey then
key:setKeyId(myCardKey)
end
exactly
This is only showing how to access and change the ID of a key
This would probably allow you to make sure your keyCard has the keyID of the door it should open
And will also allow you to make those IDs unique
So you don't end up with random keys being able to open those doors
wow that's exactly what i need. Thank you very much. The last thing i don't understand very well is...
I would place those lines in a lua file but the folder structure gets me, where should they be placed?
Then you'd have to use these to check if the door the player is trying to open has the corresponding keyID to the item key in the inventory
Most likely media/lua/client
i will just place 4-5 doors with 4-5 keycards levels that all, all spawn as admin in my server. If keycard are not in loot tables they won't appear, so np
then create a file myKeyCardChecker.lua
yes but you need to make the keyIDs unique so the doors don't have their keyID set naturally and thus allowing natural keys spawning to open those
i can set a word, right?
Unless you completely remove keys from spawning in the natural loot which involves removing the key from spawning in container, zombies etc
so regular system won't get them duplicated ever
no you can't
It's need to be an integer
declaration: package: zombie.inventory.types, class: Key
declaration: package: zombie.iso.objects, class: IsoDoor
These are the pages that interest you and you need to look for getKeyID() and setKeyID()
would be easy to set them as Nexus1, 2, 3...
if only lol
ok, thank you very much
You can technically do something through with that
i would change half my knowledge of Unity and C# for this
Would anyone have an idea on how to modify Bag Capacity in LUA?
I was able to to retrieve the Original Capacities using this:
local instanceItem = itemDef:InstanceItem(itemDef:getFullName())
originalCapacity = instanceItem:getCapacity()
Which I was hoping just changing the Params, Similar tot Change the Items Weight would work, but it is producing an error for each Bag it attempts to change the Capacity of
This is the function that handles attempting to change the Capacity:
function changeBagCapacity(Item, Capacity)
if Item then
Item:DoParam("Capacity = "..Capacity)
end
end
Is there some other way I should be using to handle changing Bag Capacities?
myKeyNames = {
1267925 = ["Nexus1"],
1267926 = ["Nexus2"],
-- etc
}
--outputs the string in the dictionary above corresponding to the keyID so if the keyID of door == an ID in the list it will output the corresponding string, else it outputs None
local myDoorKeyID = myKeyNames[door:getKeyID()]
local myKeyKeyID = myKeyNames[key:getKeyID()]
if myDoorKeyID == myKeyKeyID then
door:open()
end
like this
or
but there's no point to it I will be honest with you
Bcs here it's useless code
yeah it's not necessary
But you can do this:
myKeyNames = {
1267925 = ["Nexus1"],
1267926 = ["Nexus2"],
-- etc
}
--outputs the string in the dictionary above corresponding to the keyID so if the keyID of door == an ID in the list it will output the corresponding string, else it outputs None
local myDoorKeyID = myKeyNames[door:getKeyID()]
local myKeyKeyID = myKeyNames[key:getKeyID()]
if myDoorKeyID == "Nexus1" then
-- do code
end
if you REALLY don't want to use numbers for clarity
I mean if you have some base in other languages you should be good
The main challenge will be accessing whenever the player is trying to open a door
I'm not sure if there's a method for that
I will try that, you have marked a path to follow and i've learnt by trial error, so it's just a matter of time xD
👌
Reason: Bad word usage
I would either check if the player is in front of a door perhaps and access the tiles on the square the player is on or in front
Won't it be helpful for others to have as a modding tool? Problem it's just a small part of my mod, but maybe i can extract that part to share
Also player could thump the door which can be detected and I've used it in recent code
If other players want something similar they can just go and take it I guess lol
You can do a tool for it if you want
my mod is not going to be shared, at least for now, sadly
👌
You can do a framework for key cards yeah
it will interest a lot of people I'm sure
also gave me an idea of a troll mod
To make the player have to search for the right key for the door he's trying to unlock lol
Like it would be a roll dice that takes a random key in your inventory and checks if it's the right key to open the door, if not then don't unlock the door
so the more key you have the less change you have to roll the right key lmao
if this could have been done with C# i would force the key to be in hand and many other little details, but i will be ok just to allow only open with that key xD More than enough
PZ doesn't support C#
i don't understand lua 2% of how i can handle C#
Nothing stopping you there
You'll learn
It's not that hard
Since you have good bases in other coding language, just have to share with you how the game handles stuff and you'd be set
problem is that we don't have some kind of mod editor or some tool to make things a bit easier, maybe i'm notdoing the proper workaround for things xD
there's many tools to make PZ modding easier
One which allows easy reload of lua within the game too
I've made 2 scripts by now:
-
In a recipe, you have files, you can read them, and by script i give a chance to receive valuable data. Files are converted into Read files by recipe.
-
When dragging an item to a container it will allow only certain type, in my case Ammo, but made another container for literature.
with C# at this point i would have done the mod already xD
I'm fairly certain your 2nd script is a vanilla feature
There's many containers that only allow some type of items
And there's many mods that already have something like that
i tried to set Ammo in the vanila set, and it would accept guns too
now it only accepts ammunition, ammo
hmm
I see
Like I said, once you understood how the game handles stuff it will go fast too
it's not a language issue, it's just that you have to learn lua
i've been learning C# since 2016 i still consider myself a noob, even having made many projects already. I started as modeller and it's the least thing i do now.
I do everything in Unity, model, texture, programming, the whole pack xD
The struggle with Unity is Unity itself
My issue was that After calculating the Original Capacity * Multiplier It would often convert the value to a float, however the Capacity Value is required to be an INT, so using math.ceil I was able to round up to the nearest round number
https://projectzomboid.com/modding/zombie/scripting/objects/Item.html#Capacity
The more you know 🤦♂️ 😅
declaration: package: zombie.scripting.objects, class: Item
Can I assume that if I update getModData result and call transmitModData it will sync that data between server and clients or I should not rely on it at all?
Or it only works if I call transmitModData only on server?
classic issue
Anyone know when OnWeaponSwing and OnPlayerAttackFinished are supposed to go off? Or where they should be?
I'm trying to test when they fire and it seems like the answer is never
neither of these do anything when the admin character swings
thx a lot

Reason: Bad word usage
Sorry once more, but I dont understand this "local cicles = player:getModData().MyModCicles ". Is something I shoud be doing?
I am new to modding
its your personal condition for easy using, not need write all time player:getModData().MyModCicles
now its just cicles
or u about moddata?
yeah about the modData().MyModCicles
its a way to get like global state that I should declare somewhere
u can rename MyModCicles on another
what u want, its should be uniq
its just something like flag or info contain in character
you put it new condition
is it possible to swap out item model using lua at runtime?
like yep, its should, but it start declare in code, where I set value 720
first state for this is nil
Ah I see it now thx thx
Reason: Bad word usage
https://steamcommunity.com/sharedfiles/filedetails/?id=3184827912
Any feedback appreciated 🙂
Have you tried MakeUpType = All, ?
didnt try this. Thanks
Hello here! I'm creating a mod with custom crates. Everything works, except when I want to place a crate from my inventory, I get the error "cannot create recipe for this movable item". If I restart the game with the item still in the bag, no more errors. We only see this error in debug mode. Otherwise everything is going well. An idea ?
If I remember correctly, items created from debug itemlist miss some initialization. I have not more precise info and your problem could be unrelated.
Thanks for your answer ! For testing, I create the object in craft menu and "Give ingredients". So maybe there's no problem ? 😅
that's the way to go 🙂
Reason: Bad word usage
Reason: Bad word usage
My boy has been getting warned over and over lmao
They've no other messages on the server I'm so curious what was said lmao
Could be a bot trying to link dumb stuff.
M O D S | I N | B I O
Hey I have a question, how do these different modes work in those code?
More specifically, is there a way I can put the player into one of these modes?
Maybe some way I can access the UI and simulate a click? I know you can do something like that with inventorypanes and their fuctions like lootall
Loot all probably doesn't simulate a click at all
And what do you plan on doing with this exactly ?
There's most likely an easier way
Well I'm trying to make a hotkey that puts me into that mode specifically
Just a quality of life thing I'd like to have
Isn't that already a thing ?
Is it?
Did you check your hotkeys ?
I know there's a button for destroying furnitures
And I think one for rotating
So there probably is one for all of these ?
Once you are in the mode you can press tab to go inbetween them, but I don't think its a hotkey no
it'd be easier to figure out if we knew what exactly the like 'build mode' is called in code
searching 'mode' or similar in the javadoc gives you all the results for model too
and i haven't the patience to check
Eggon already did it https://steamcommunity.com/sharedfiles/filedetails/?id=2289454303
bumping/nudging my previous question!
looking to see how possible it would be to have accessories as a collectible seperate from my hairs without the possibility of like...making a hat that wouldn't be compatible with any other hairs
You could create a new bodypart perhaps ?
tho I'm not familiar with it but I know it's possible
That could be possible, but then in the case of like, a "ribbon" item, for example--it would just have floating bits instead of actually changing to match the hairstyle, right?
is there a way to pull what hairstyle someone is wearing maybe..?
and have the "ribbon" item use a specific model IFF a specific hairstyle is being used?
Possibly yeah
Is there any modders here that do mod work for compensation based on user request?
plenty! you could also go to the modding discord and ask someone for a commission https://discord.com/channels/136501320340209664/1125248330595848192
yes
but you'll need to be more specific about what you want/need ofc
That is # unknown for me rn
oh, weird...it may have to do with your roles.
click on it
It will still lead you to the channel
Ahh i see, sweet
i'm thinking what i want to do (and ik this is a dumb idea but hear me out) is make a "scrunchie" mod that lets you wear the scrunchie on your wrist in that classic 90s fashion AND lets you tie your hair with it--i don't mind going thru the base models for example and making it so the scrunchie shows up in some capacity on tied hairs, but i'd need ot know how to do that
it would also be cool to be able to change the way tied hairs work so you "need" a hairtie to tie your hair
hmm
I got an idea
Why not using the haircut menu ?
So like when you have scisors you can change your haircut, why not do that here too but instead you need to have a hair tie
no idea if that can be modded in tho
yesss i love that, and i think that would be a good way to do it...my one concern is like, say i have a "red" scrunchie. how do i make it so that it knows red scrunchie = red tie for the hair without having to make like. a new model for every color.
make it a different item
basically you make versions of your hair with the hair tie
tho you'll have to make multiple hair styles with the hair ties
but if you can mod custom haircut tools, then it's definitely doable that way
wym by different item? sorry idk if i understand. cause i would want the color of the item in the inventory and on the actual hair model to match up, idk how to get those to sync.
if you can make a custom haircut tool with a red hair tie for example, then it means you can do it for N colors by creating new items that are just different colors of hairties
then reference those various hair tie as tools that allows access to your custom models with the corresponding model and texture of hair tie
so it wouldn't be possible to have like, a hairtieTINT item--it would have to be finite colors?
that I'm not familiar enough with how items with different textures are handled and how to setup custom hair styles linked to custom hair cut tools
silly bandz mod when
your mod proposal sounds very cool! would love to see how it turns out!
if you make it, also consider the "untie hair" option to return the hair tie
Yup, or have hairs untie naturally

i'll try to figure out if it's possible then
i just wear a lot of scrunchies irl and i was like "hey...what if scrunchies" LOL
PLS DOOO A MOD FOR SHOES LIKE CONVERSES I NEEDED
@stark gull
THANKS 
no problem drunk man
im missing all the stuff on the right side how do i get id back
could someone help troubleshoot my mod
@onyx sage I recommend asking a more specific question... "help troubleshoot" is rather broad; you'll have better luck if you explain what you know and ask a specific question that follows from it. E.g., if your mod isn't showing in MODS, you would go, "I have my directories set up like this [screenshot(s)], and my mod folder is here [screenshot], and my mod.info looks like this [screenshot], but I can't see my mod in MODS. Any ideas why?" Agreeing to troubleshoot broadly is potentially a much bigger commitment from anyone lurking in this channel than answering a specific question in a specific context.
Or, if you are completely unaware of any information that would be relevant to your question, at least be specific in the question, such as, "How do I make my mod appear in the MODS menu so that I can enable it?"
apologies for vaugeness, Ive set up my mod correctly as far as i can see but it does not appear in the mods tab to enable it, can any provide some insight into what could be the reason or maybe have a look at the files and see if you can spot something i have missed
Post screenshots of your directories expanded from %UserProfile%/Zomboid down through your mod's subfolders. Also post mod.info file.
That'll most likely tell us what we need to know
Also no need to apologize for being vague; I was just trying to help you get helped. Some people might agree to sit down and help you troubleshoot with no particularly obvious end goal in sight, but I suspect most wouldn't... A much higher percentage of people who know what you need to know will respond in a moment of free time if your questions are specific than if they aren't. Could be waiting all day for general support when a specific question would've gotten you where you wanna go.
Hmm okay that's pretty weird. @onyx sage Sure looks normal to me at a glance. If you DM me a zip I'll try to play with it on my end and see if it's visible for me. I would expect to be able to see it. I'm unfamiliar with usage / consequences of the tiledef and pack tags, tbh, but the rest looks normal and I would expect it to work at a glance.
its supposed to be a custom tile mod to add my cat as a picture into the game ill dm you know ty!
i think you got the folder structure wrong, try updating it to the path Zomboid/mods/Beaus Poster/Contents/ and put inside Contents your current Beaus Poster folder
the other mods i made like CUAZ works without the contents bit tho
No, that's if it's in Workshop.
Chinny has it in Zomboid/mods
Zomboid/mods corresponds to Zomboid/Workshop/Mod Name/Contents/mods
This one loads just fine for comparison (don't get hyped, it will never be released, Brutal Handwork does it best imo):
I think tiledef may require a number. I am seeing info online suggesting the number needs to be somewhere between 100 and 8000.
Custom .pack files If you have custom map tiles, you will need to create a .pack file containing those tiles for the game to load. This can be done using the "Create .pack file..." command, found in the Tools menu in TileZed. Place your tilesets into a directory, then click the + button to add th...
@onyx sage
mod.info:
name=Beau Poster
poster=poster.png
id=beau
description=Picture of Beau
tiledef=beau_poster 2024
pack=beau
I just randomly used 2024 because that's the year.
I have no clue if the specific id chosen is extremely important or how to make the decision, but it must exist or your mod.info file will be invalid (and therefore as you saw the mod will not appear in MODS). @onyx sage
@onyx sage Okay I think this is key here:
https://pzwiki.net/wiki/List_of_Tiledefs_in_use_by_mods
Okay, so they can go from 100 to 16382 according to that page, and 2024 is available
❤️ Good luck!
ok it works 80% just gotta get it to place the correct tile now ahhaha
potentially silly question but i've not found this for some reason
how does ZombieLore.Speed map to the in-game speeds? in this case i'm trying to check if the zombies are set to be sprinters
Reason: Bad word usage
It's updated with sandbox options
And wdym how does it map to the in-game speed ?
You mean its outputs what it means ?
yeah
It outputs a number
1 to 4
I have an excel sheet with it's equivalent name in the sandbox options but not sure if I can access it rn
please do if you don't mind
thank you very much
Updating sandbox zombie speed either requires restartintg the save or setting to inactive then active the zombie you update the speed
Also allows you to have different speeds for different zombies
nah i just need to get it once
hacking together a rebalance of the music director and want to make it so that having sprinter zombies chasing you spikes drama massively compared to shamblers
though honestly sprinters feel like they deserve a soundtrack of their own
just overwrite the vanilla music director entirely
it seems to be fairly simple? like a hundred lines of code in a single lua file
Fmod ?
as for the specific factors that'll play into drama calculation - so far the factors are sleepiness, exertion, panic (fixing the fourth wall with this one), hours survived and zombies killed
the moodle factors are linear but for the hours survived and zombies killed i'm messing around in a graphical calculator to figure out some nice curves
wdym
im not touching the soundtrack if that's what you're talking about
the bit about sprinters needing a separate one was just a comment
I'm not familiar with how musics are handled but ik for every other sounds it's handled by fmod and to replace the soundtracks or general sounds you need to manually install .bank files
And fmod is not exposed so I don't believe you can modify it
nah the only thing the director rly does is it picks a track from MusicChoices and calls a function to play said track
Yeah so that's not handled by the same thing at all then
interesting things to do could be assessing the player's gear and skills + checking if there is a house alarm / helicopter / recent meta event
ok to the car modders out there am i correct in thinking that when a item that is on a car like a roofrack is uninstalled is juts vanishes like how the wheels do
perhaps you could shut down the game's soundtrack playing system entirely and replace it with your own external audio files - dunno if the director is the only "source" of music though. might experiment with that
You could, but what would be the impact on performances
no clue whatsoever
Probably depends how you program your vehicle
was gonna basically use the code from KI5 cars, and from what i can tell thats whats happening