#mod_development
1 messages · Page 202 of 1
exactly there is no tag
so it is not trivial to add new items to them
wack
So how does the game recognise it? :O
albion above answers exactly that
Oh, I see
Damn
Is there a list of Tags somewhere?
SkillRequired:Foraging=8,
Trying to do a recipe that requires foraging,
is foraging the wrong word though?
I know like Metalworking is MetalWelding , so is there a similar thing for Foraging?
PlantGathering
I'll test this, thank you!
Is there a list of these terms though somewhere? It be useful to have them somewhere if so
Thank you so much ❤️
Maybe a guru can confirm this for me... In single player any code will stay resident in the game no matter what. But on a multiplayer server all map changes must go through the server? Does this mean that if I create a function that destroys and replaces a sprite object into a container item that the server must run the code, not the client? Or does the client just need to update the server on the removed sprite and update the new container to the server? Thank you for any replies. digging through the forums and it seems like its all seperated but I do not understand how to make this connect.
as a partial answer: Jump uses dynamic terrain changes that are strictly client-sided in MP and lost on terrain reload.
When it comes to commissioning mods, where would y'all say would be the most approriate or way to find people for that case of scenario?
It seems that I can use this command to remove the old sprite. But then the new object has not way to update. transmitRemoveItemFromSquareOnServer()
I would say good luck. I tried for a year, gave up and started coding. Unfortunately the information that you need to learn the functions are all over the place.
Jesus.
and everything seemed to be going well until it met the mutliplayer world, where nothing is compatible it seems
Now you're just giving me anxiety for what's to come 
For such expected behaviour in MP, you can store in GlobalModData the replacement and use that at LoadGridsquare time
you can ask here. be as explicit as possible to attract as many modders as possible.
thanks I will dig into GlobalModData and hope to find an answer.
Ah, gotcha.
aint not specifics in GlobalModData for this. this is just a place where you can save whatever
I wanted to ask some questions as well if you wouldn't mind.
Like, what would y'all say is an appropriate comission rate?
Well, any direction is better than the lack of wind I have in my sails. I can get the container up and running but it's not sharing to anyone and anything dropped inside disappears. I guess I made a map black hole.
even object weights that changed with customweight never update to other players. I guess the engine has no innate communciations
i'd actually say it automatically networks too much usually
just not in these specific areas
ok, maybe as a first try for ponctual sprite changes initiated from the client side, you could use a simple client command to the server and receive it server side where you modify the target square ```lua
function myCreationFunction(xPos,yPos,zPos,spriteName)
local args = {x=xPos,y=yPos,z=zPos,name=spriteName}
sendClientCommand("MyModId", "CreateASpriteCommand", args)
end
transmitUpdatedSpriteToServer() I found this one but it doens't pull the container even though it's the same object. I tried setting up a OnClientCommand to do the entire transformation but it did not show back up on the client if it ever actually processed.
well done and sorry then.
transmitCompleteItemToServer() I found this too but it also does not seem to take the object on regardless of what type it is.
thank you for helping. in the forums there are a few posts that explain the scenerio but none seem to step on the same spot that I am at.
You should be able to duplicate the way vanilla behaves when a client is building a wood crate from carpentry context menu.
i've had luck with transmitAddObjectToSquare
oooh, I haven't tried that one. Thank you, will go test it.
Just realized I have tried that but not sure if I am using it correctly. Going to try a few things.
I know it's very weird question, but is it possible to empty the recipe result?
{
farming.Strewberrie=15,
ATTS.Zamabox1=1,
Result: ATTS.ZaFarmbox=1,
~~~~~~~~~~~
OnCreate:Zafarmresult,
}```
And this is Zafarmresult, function Zafarmresult(items, result, player) local gambletime = ZombRand(1, 100); if gambletime < 24 then player:getInventory():AddItem("Base.PaintYellow"); elseif gambletime < 75 then player:getInventory():AddItem("Base.PaintWhite"); else player:getInventory():AddItem("Base.PaintBrown"); end player:getInventory():RemoveOneOf("ATTS.ZaFarmbox"); end
RemoveResultItem:true
Weird question, but I think I might need some help trying to figure this out. I have variables I want to keep track of through a recipe. The player is allowed to use a set of different items for the recipe, but I want to keep track of how many of each item they used.
So, if the options for the recipe were effectively 10 total = Ruby, Sapphire, and/or Emerald. And they could use any combination that added up to the total.
I am trying to figure out how to go through that list and check the corresponding values to push that to the end result of the recipe.
u can do this with big workaround
like require item ruby/sapphire/emerald
1 count
OnTest:func
where u return true if total count 10
OnCreate:func2
where u remove 10 items
Tooltip:localisation string
where u write thing like:
"On total count should be =10!"
thats all
for remove items u can use cicle for with count 9 where u check Inventory like:
if has ruby then remove 1 ruby
elseif has emerald then remove 1 emerald
elseif sapphire then remove 1 sapphire
end
i hope u understand me 😅
I have been testing this out and keep getting errors, is this how you would call this? MyObject:transmitAddObjectToSquare()
MySquare:transmitAddObjectToSquare(MyObject, MyObject:getObjectIndex())
MySquare should be the square the object is on (MyObject:getSquare() if you don't already have it)
Thank you! I just realized looking in the index that its pulled from the gridsquare. Thank you so much!
Thank you, no more error but I am not sure it's doing what I need it to do. the container still fails to remember anything inside it. I'll start again tomorrow. 🙂
You want to replace a tile when it is first spawned? Take a look at some of game's map files like server/Map/MapObjects/MOCampfire.lua and MOCompost.lua.
How can I search the fanny pack's inventory? I've tried to use getClothingItem_Torso():getInventory() but it didn't work out.
Also, maybe your issue is from how you change the sprite properties. It's best to change them during loading, before the map chunk start loading.
Similar to this.
https://github.com/quarantin/zomboid-ladders/blob/962ac2c29a572a8090d1495dcf3b8ad7f66c6405/media/lua/client/Ladders/Ladders.lua#L253C23-L253C23
Guys, need help
i try inject tooltip for clothes, but it's not work, without any error...
hey folks im having issues with this line
return ZombRand(SandboxVars.DrivingSkill.XPgainChance * GameTime:getInstance():getInvMultiplier()) == 0;
end```
im wondering what the sandbox var would do to xp and how it is actually done - any help would be greatly appreciated 😄
This returns true or false. The higher the setting number, the less likely it should roll true and give you xp?
#mod_support is more suited to talk about using mods
Hello there, is any good way to make a code/script a horde spawn at some specific places working for sp/mp?
I will look at that, thank you
recipe Forge a Katana
{
MetalBar=3,
SheetMetal=2,
SmallSheetMetal=2,
ScrapMetal=4,
Result:Katana,
Time:1000.0,
Category:MetalWorking,
Sound:Hammering,
SkillRequired:MetalWelding=10,
}
Can anyone see anything wrong with this :?
Keep getting recipe result as Null
Try Base.Katana
Hi
I still struggling with my problem form above:
#mod_development message
So far I found out that if I use the following lines to add and remove the items nothing seams to happen on the client.
container:addItemOnServer(resultItem)
container:removeItemOnServer(item)
But if I exit my hosted game (local) and restart. The container contains the correct item and the old one is removed. So it assume that the container doesn't sync to the clients. But I found no function to enforce a sync or something similar.
Does anyone have an idea how I can do this?
you might need also to check SCampfireGlobalObject:addContainer for adding a container.
A dirty way to update a container from server is to use sendObjectChange('containers'), this can cause errors on clients though.
Thx. I'll check this...
errors are limited if you make the UI dirty and cancel transfer actions.
Do I have to make the UI dirty or the container?
I think fallen seraph said it works best to make the container dirty.
Is there any way to move my custom context options place? I wanna put it between the Favorite and Equip but I have no idea how to do it.
context:addOption(activatezasc, getSpecificPlayer(player), onScannerUI) I believe I have to do something in here for that.
I found it! insertOptionAfter
Right... Thanks for the info! I will post there and ask 🙂
what does the get instance and get inv multiplier do in this case?
it adjusts the chance by the framerate so it doesn't trigger more times when the code is running faster
it's not really done properly though so idk if it actually works
I tried using the MapObjects.OnLoadWithSprite command from the campfire to update the sprite into a container, works great in single player but either doesn't run or doesn't update clients in multiplayer. So even this function doesn't end up syncing the server with the clients. so close yet so far...
I finally got it to work. I will post my results when I get done coding. This method should allow any unused sprite in the game to get converted into a container if anyone needs that effect.
Anyone got an idea of how to add a custom part to the vehicle mechanics menu/a reference to how its done in vanilla? Can't seem to find it
as long as the part exists it will be in the menu
nodisplay is for not appearing, use other categories.
how do i make a custom part "exist"?
you create it in the vehicle script
ah i found it in the scripts folder ye
there a way to make a part exclusive to certain vehicles?
it is only on the vehicles that it is defined in
parts don't exist independently of vehicles, they are a child element
you can inherit from them as 'templates' to emulate that
A vehicle will only have the parts from it's script.
ah so i need to create a template first for the part then add it to the vehicle's script file, got it
thanks so much!
you don't have to create a template if it's only for one vehicle, it's just so you can reuse script without copy pasting
i am actually adding a custom part, airbag, to multiple vanilla vehicles
Any idea why a simple template file isn't working when I am trying to add it to a vanilla vehicle script? Adding the part directly to the script works
module Base
{
template vehicle Airbag
{
part Airbag
{
area = Engine,
}
}
}```
Vehicle's script:
...
template = Battery,
template = Airbag,
template = Engine,
template = Muffler,
template = EngineDoor,
...```
Added it using this script. Works better for my approach
Vehicle script placed in "module Base"?
yea I copy-pasted the vehicle script from vanilla file and added the template to the script but no luck
can you send vehicle script file?
^ After adding the Airbag, template before the battery
This approach works well for tweaking existing vehicles.
But the script would work for other vehicles added by mods, yea?
I felt I didn't need to explain how to target specific vehicles.
hmm lemme try
explain 😄
I think it's better way for improve vanilla cars
I will have to target specific vehicles either way, I believe I can do so by names easily
@hollow current you just want add airbags to vanilla cars? Then better not overwrite vanilla scripts. Some mods can do same and then your mod will not work with this mods
yea renaming the file worked
crap haven't even thought about that. makes sense
either ways I am gonna resort to the script-ish way of adding the part instead of modifying the actual vehicle script file
that way I will have more freedom on which vehicles to target, since I aim to have an option for lore-friendly airbags
MyModifications = {
["Base.Van"] = "{template=MyModificationModule.van_modifications,}",
}
for k,v in pairs(MyModifications) do
local vehicle = manager:getVehicle(k)
vehicle:Load(vehicle:getName(),v)
end
similar to this
it had separate templates for different vehicles
how does PlayAnim from IsoZombie work? doesn't play any animations with PlayAnim(string)
How to remove parameter from items without overwrite scripts file?
like
local function zReAdjustItem(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
but remove param
What do you want to change, maybe there is a specific method to change it.
i need remove FabricType from some items
zReAdjustItem("Base.Vest_BulletPolice", "FabricType", ""); (example)
If this parameter is at least somehow specified, then in the clothing inspection interface all actions related to sewing are available for it
The IsoGameCharacter PlayAnim doesn't do anything. Also I'm not sure there are easy work arounds like emote or timed actions for zombies. Maybe you can target a specific state and add a variable to trigger what you want?
this seems like the only way to change it. Does it cause errors when used like this?
Nope, its not create error
Main problem - FabricType defined
if it defined - it's open all path for sewing and another stuff
Does anyone know if its possible to use a placed tile as part of a crafting recipe?
You can use a movable as part of a recipe
but, what if it exists and has no uses like "" or "null"?
"" - i can patch with any clothes type, i can repair hole with any clothes, but not full repair, because need strips with (lol) ""
i'm try nil - look like this is string type
i will try it with null, one min
It seems like you need to patch the UI 😦
yep, same
bruh
That would be an InventoryItem not an IsoObject though. Just to clear things up.
ehhh...
it's possible to inject this stuff?
like
if not self.clothing:getFabricType() or self.clothing:getFabricType() == zReFackThisShiet then
local x = (self.bodyPartColumn - self.noRepairWidth) / 2
self:drawText(getText("IGUI_garment_CantRepair"), x, 22, 1, 0, 0, 1, UIFont.Small)
end
?
I have an idea, patch the getFabricType function.
like this
#mod_development message
not sure how to do this...
ping me later if you don't figure it out. You would need to use the Clothing class most likely.
public class Clothing.ClothingPatch
okey, i'm will try it tomorow, should go on work ^^'
thanks for help
Is there any way to access the fields in java classes from Lua? I can see in the debugger that bodyLocation https://projectzomboid.com/modding/zombie/characters/WornItems/BodyLocation.html has a field called exclusive that I want however only a method isExclusive seems to be exposed so rn I have to compare every bodyLocation to each other to get the exclusives
declaration: package: zombie.characters.WornItems, class: BodyLocation
Is it possible to speed up tile erosion with code?
You should be able to call all methods listed in the java doc you linked in lua code. To get an idea what body locations the vanilla game has, you can check the vanilla code in media/lua/shared/NPCs/BodyLocations.lua. This file lists all body locations present in vanilla game and contains info about related stuff (e.g. what locations are exclusive, what locations hide other locations etc.). This file also should give you an idea how to use the java methods in lua code.
I did always wonder where that was defined, thanks! I haven't touched java in a while and just remembered the field I wanted will be private so I can't get to it. my issue is that there's a private field called exclusive that I seemingly can't access from lua
the only way to get to it seems to be through a method isExclusive which is really annoying because I'm having to compare every body location to see if they are exclusive with each other
@lusty marsh a method literally called "exclusive" seems indeed not present for the bodylocation class. but there is setExclusive and isExclusive
maybe I should have clarified, I'm trying to find what a bodylocation is exclusive with not change it myself
To do this, you can check the lua code I mentioned and just read off what body locations the game declares as being exclusive, then hard-code whatever you'd like to do with them. As an alternative way, you can also iterate through all body locations via lua code and then test for exclusiveness. The latter method might be even a little bit better since it might increase compatibility with future vanilla updates as well as compatibility with other mods (updates or mods which change body locations or add new ones). But depends on what the specific goals of your work are ofc.
yeah I'm doing the latter rn I was just seeing if it could be done a little cleaner bc it's going to get slower as the new locations stack up from other mods but it looks like this is my best method, thanks anyway!
in case you just have to iterate once (say before game starts) there probably won't be any performance issues since there aren't so many body locations. even if mods adds new ones, chances are good that you won't have 1000s of them
yeah true, I was told there was some performance problems so I was squeezing it out of everywhere but there's probably something I'm missing elsewhere in my mod
hmmm... I am definitely not an expert on performance questions but a single iteration through body locations shouldn't be a huge issue I guess...
(presupposed that you don't iterate through them all the time during actual game play)
dw I think I just had a brainfart I read my code again and I think it might have been reapplying clothing items to the model in a loop so that's probably what was wrong
Is there a mod that enchances the visuals? Like filters
@fast galleon, bro, can I ask you to write this code, please? This would save a lot of my free time...
Hello frens 
I'm running a modded server to play with some friends, but some mods aren't translated into our language. Not all mods have a GitHub page, so I cannot necessarily create a PR for all of them.
Can I somehow still translate those mods without ripping and reuploading them to the workshop? Like simply create the translated files server-side, so the clients can download them?
You can make a mod that has only translations. It can be either a single mod with everything or you can break it down into submods for easier organisation.
Obviously mods need to support translations for this to work.
If I create a mod with only the translations, how would I do that? Would I simply copy the folder structure of the original mod, just for the translations? And would I have to upload it to the workshop, or can the clients download it, if I place it inside the mods folder?
I've read this post so far (especially the mods section): https://steamcommunity.com/sharedfiles/filedetails/?id=3006690572
A well made mod would be easy to translate, like this.
https://github.com/TheIndieStone/ProjectZomboidTranslations
Other mods are hard to translate and you might need to tell the modders to use translatable texts.
The mods I have in mind do have the translation files. I've just found another mod on the steam workshop, which does the same as I want to do, just for different mods. I'll see how that mod does it and simply try to copy it, just for the mods I use 🙂
you can also just directly copy the whole mod add your translations and upload the workshop under "Friends Only" or "Unlisted"
if you wanna be lazy
honestly i wouldn't say that'd be any easier
You can just include the structure in the translate folder, nothing else. The game will pickup the translations and add them.
but not all mods use getText in lua for localisation stuff and if its on not native lang thats can be problem
Yeah I figured out a decent enough image
So I've uploaded a mod and posted about it in #pz_b42_chat, is that pretty much the extent of the advertising I can do on the server? It's not a substantial mod by any means, but I imagine it'll just be a word-of-mouth thing from this point on?
Generally yeah, pzchat is also kind of a deluge, so trying to link there isn't really that effective
Atl east when I post any mods there usually the on-going conversations bury it
Gotcha, I guess my work is done for the moment
https://steamcommunity.com/sharedfiles/filedetails/?id=3063138703
Just a mod that changes the banana eating sfx, but it seems like everything works on the Steam side of things. Open to feedback and such though
Nah, I think just translating is enough. I don't know how to publish to the workshop, though. But I'm sure that I can google that 😄
its surprisingly easy lol
I've never ever published something to the steam workshop for any game before 😄
put the file click one workshop upload thats all
just google it to make sure and you will be fine 😄
just what I though 😄
Just curious: Can I reload LUA ingame or do I always have to restart my game?
I have the mod manager installed, btw, if that helps
If you change active mods from main menu or loading screen it will reload it without restarting

@fast galleon @zenith igloo It worked, thank you :3
happy to help 🙂
who are you
how do i find the id for a food item that's cooked
coz i wanna use cooked meats for a custom recipe but i can only find the raw base item in items_food.txt
or whats the function i need to check if an item is cooked
coz i found
function Recipe.OnCanPerform.Uncooked(recipe, playerObj, item)
if item and not instanceof(item, "Food") then return true end
return item and not (item:isCooked() or item:isBurnt())
end
but from what i understand it tells you if the item is uncooked but i need it to only allow the recipe to continue if the item is cooked
@tranquil kindle do you know which it would be
I just modified it to be```
function Recipe.OnCanPerform.Cooked(recipe, playerObj, item)
if item and not instanceof(item, "Food") then return true end
return item and not (item:isUncooked() or item:isBurnt())
end
hopefully should work
isUncooked doesn't exist; you'll want not item:isCooked() to check if an item is not cooked
good point
forgot about boolean algebra
damn you de morgen
wait but that just brings me back to the original function
On the topic of boolean algebra, if you do make that change you can simplify the expression
yeah nand
It doesn't, because you'd be replacing the isCooked call with the negation of its result
nand? It'd be DeMorgan's law, which you referenced
right
but i said damn you de morgen coz i hate his laws
always forgot them
would it just be
if item and not instanceof(item, "Food") then return true end
return item and not (item:isCooked() or item:isBurnt())
end
``` then
The function you're modifying has return item and not (X or Y). You want the négation of X while still not wanting it to be burnt (I assume), meaning you would change it to item and not (not X or Y). Application of the law on the latter part of the expression means distributing the negation and changing or to and
In other words, item and X and not Y
oh right
yeah i remember commutative and associative and shit but not de morgen's
even tho his laws are arguably easier since they're similar but opposite if you know what i mean
Tbf I never actually think of the law, once you're used to it you can just apply it without needing to think through the logic
I say that to say I wouldn't worry all that much about not remembering the exact laws (unless you're studying CS)
i remind myself when i use them so i can think to myself "fuck you de morgen"
im studying cs for a level but i'll be moving onto cybersecurity at uni coz i was 1 singular mark below a grade 6 in maths gcse meaning i cant do compsci at most unis
Gotcha, in that case it's worth knowing for the classes that ask for it then lol
yeah
zRe ARMOR ABSORB SYSTEM
-New update:
- Added tooltips UI!
- Added KP armor compatibility!
- Added More Gloves compatibility!
https://steamcommunity.com/sharedfiles/filedetails/?id=3057997341
im moving to VSCode, is there an up-to-date plugin/way to autofill PZ methods?
thanks!
Why isn't the player's sickness being removed in multiplayer?
local function fix_sickness()
local player = getPlayer()
local name = player:getFullName()
local stats = player:getStats()
if name == "Hima Ukid" then
if stats:getSickness() >= 0.75 then
player:Say("Sick")
stats:setSickness() = 0
else
end
else
end
end
Events.EveryTenMinutes.Add(fix_sickness)
Hi folks ! Can someone tell me where to find the player death information into pz files ?
Like if it pop in a log.txt ? Where is this file , how it is specified ? " Character name is dead "
Thx a lot ❤
I think you need to use getSpecificPlayer after you iterate through the list of players in the server. Please correct me if I'm wrong.
@fast galleon @zenith igloo based on your support, I've started a small repo to collect mod translations and automatically build the corresponding files. It's in an early stage, but I plan to automate compiling and publishing soon ™️
It requires a ton of refactoring, though. But it works for now, if the user doesn't make a mistake
Hello everybody! I'm trying to make a mod that add a custom category to the makeup menu. And it seems that I did everything (maybe, of course, not everything, but I shoveled a lot of information and similar mods to understand how and what to do) but for some reason when I throw the mod into the mods folder, all categories disappear in makeup in general 😦 Like in-game lipstick, eyeshadows and so on. Any help?
how do I access values stored during an "OnEat" function in a different function?
Please show your code somehow (like GitHub or smth), so we can understand what you're doing
What do you want to achieve? If you call your own method, you can simply pass the required data as an argument
im trying to store the players strength when eating the item, increasing it, then a few in-game hours later setting it back to the original level
local currentstrength = player:getPerkLevel(Perks.Strength)
player:setPerkLevelDebug(Perks.Strength, 10)
buffdata = player:getModData()
buffdata.buffduration = 2
end
local function EveryHours()
if buffdata.buffduration == nil then return end
if buffdata.buffduration >0 then
buffdata.buffduration = buffdata.buffduration -1
end
if buffdata.buffduration == 0 then
print("times up")
player:setPerkLevelDebug(Perks.Strength, currentstrength)
end
end
Events.EveryHours.Add(EveryHours)```
currentstrength is a local variable set in the scope of a different function so it doesn't exist in the second function.
yeah i know, thats why im asking how to do it
i dont want it to continously store the players strength, only when the item is consumed
I have this code from an unfinished mod:
function SomeMod.DecreaseAttribute(player,modData,attribute,magnitude)
print("DecreaseAttribute: "..tostring(attribute).." by "..tostring(magnitude));
local Xp = player:getXp();
local attributeXpArray = {1500, 3000, 6000, 9000, 18000, 30000, 60000, 90000, 120000, 150000};
local stats = player:getStats();
local perk = nil;
if attribute == "Endurance" then perk = Perks.Fitness; end
if attribute == "Strength" then perk = Perks.Strength; end
if attribute == "Speed" then perk = Perks.Sprinting; end
if attribute == "Endurance" or attribute == "Strength" or attribute == "Speed" then
local attributeLevel = player:getPerkLevel(perk);
if attributeLevel - magnitude < 0 then magnitude = attributeLevel; end
if magnitude > 0 then
local attributeXpFraction = 0;
local attributeXp = Xp:getXP(perk);
Xp:setXPToLevel(perk,attributeLevel);
local attributeXp3 = Xp:getXP(perk);
local attributeXp4 = attributeXp-attributeXp3;
local attributeXp2 = attributeXpArray[player:getPerkLevel(perk)+1];
attributeXpFraction = attributeXp4 / attributeXp2;
local attributeXpRemainder = 0;
for i=1, magnitude do
player:LoseLevel(perk);
end
Xp:setXPToLevel(perk,player:getPerkLevel(perk));
if modData.storedExtraXP ~= nil then
if modData.storedExtraXP[attribute] ~= nil then
attributeXpRemainder = attributeXpFraction + modData.storedExtraXP[attribute];
modData.storedExtraXP[attribute] = nil;
end
end
Xp:AddXP(perk,(attributeXpFraction*attributeXpArray[player:getPerkLevel(perk)+1])+attributeXpRemainder);
end
end
end
function SomeMod.IncreaseAttribute(player,modData,attribute,magnitude)
print("IncreaseAttribute: "..tostring(attribute).." by "..tostring(magnitude));
local Xp = player:getXp();
local attributeXpArray = {1500, 3000, 6000, 9000, 18000, 30000, 60000, 90000, 120000, 150000};
local stats = player:getStats();
local attributeLevel = nil;
local perk = nil;
if attribute == "Endurance" then perk = Perks.Fitness; end
if attribute == "Strength" then perk = Perks.Strength; end
if attribute == "Speed" then perk = Perks.Sprinting; end
if attribute == "Endurance" or attribute == "Strength" or attribute == "Speed" then
local attributeLevel = player:getPerkLevel(perk);
if magnitude + attributeLevel > 10 then magnitude = 10 - attributeLevel; end
if magnitude > 0 then
local attributeXpFraction = 0;
local attributeXp = Xp:getXP(perk);
Xp:setXPToLevel(perk,attributeLevel);
local attributeXp3 = Xp:getXP(perk);
local attributeXp4 = attributeXp-attributeXp3;
local attributeXp2 = attributeXpArray[player:getPerkLevel(perk)+1];
attributeXpFraction = attributeXp4 / attributeXp2;
local attributeXpRemainder = 0;
for i=1, magnitude do
player:LevelPerk(perk);
end
Xp:setXPToLevel(perk,player:getPerkLevel(perk));
if attributeLevel < 10 then Xp:AddXP(perk,(attributeXpFraction*attributeXpArray[player:getPerkLevel(perk)+1])+attributeXpRemainder);
else
Xp:AddXP(perk,(attributeXpFraction*attributeXpArray[player:getPerkLevel(perk)])+attributeXpRemainder);
if modData.storedExtraXP == nil then modData.storedExtraXP = {}; end
modData.storedExtraXP[attribute] = attributeXpFraction;
end
end
end
end
Copied and pasted
There's also onPlayerUpdate to get the timing of buff removal more precise than every hour.
yeah, but i want it to last 2 hours so its fine
It may last 1 hour and 1 minute
oh true
Or 2 hour 1 minute idk how u code it gtg for a few minuts
https://github.com/plumbobspixels/ProZMods I don't know if I uploaded the file correctly, I have little experience with github 👀
Theoretically. Just don't zip them 😄
can you help?
I haven't created any real mods, but I googled a bit and there seem to be a mod data object that you can store data on
Hi all, I'm back, and taking another crack at my mod. I've been sifting through some of the game files for both the Camping Section and the Farming Section of the lua scripts, trying to understand how the game stores custom data on objects, and I've run into two functions that I don't quite under...
You might be able to use that to store the duration and strength data on the player and then retrieve it later on
thanks, ill try
Here's the javadoc for the class behind:
https://projectzomboid.com/modding/zombie/world/moddata/ModData.html
declaration: package: zombie.world.moddata, class: ModData
Hi everyone! Do anyone knows if there is a way to open a TCP/UDP connection to an external server from the client side and of course, I'm not talking about the PZ official server tool. Is there any API in Lua modding for that or do I need to mod the Java part to make this work?
I want to call an external API that stores some stuff I send from PZ.
So you want to access an HTTP API? I'm not sure about that, tbh.
Exactly! In more details: I want to make a live-map website and my mod needs to be able to send the player position once every second or so.
Hi guys. I have a question. I need to close the garage doors automatically at 9 o'clock, for example.
I have part of the code, but I can't make it work.
I'm honestly not sure if the PZ API allows to do network requests, as it might be a security vulnerability
this worked, thank you
nice, I will check it later. I have a bit of automation in place too. I use it to auto fill missing translations and it often helps me find minor issues of submitted translations.
https://github.com/Poltergeistzx/pz-translate-zx
How to remove known recipe?
It's an ArrayList of strings, right? get them and remove an element.
what variable is responsible for the miniature icon of the object that should be displayed in the admin panel, or created objects in the mod cannot have miniature icons.
why wont setPerkLevelDebug affect level 0 skills?
This is hard to read, do you mean the icon for context menus?
#mod_development message
)) I think I said it as transparently as possible) I’ll send a screenshot right now.
what commands i should use?
getKnownRecipe("RecipeID")
but how to remove recipe?
or playerObj:isRecipeKnown("RecipeID")?!
declaration: package: zombie.characters, class: IsoGameCharacter
im just practicing/learning about how to insert spawns in procedural distribution tables, i think i got that part down but how can i add loot spawns on zombies?
I Noticed that when i made .pack file containing all icons with the same names and made mod use this file, it made icons appear in debug mode if thats what you looking for.
thanks, I'll try that now)
The Poltergeist version coped with the task)) A couple of lines of code, but such a cool result.
So mine wasnt what you were looking for, or it did not work?
Is there a easy way to use Zombie animations as a player for testing?
are you making a mod for new zombie animations?))
I want to create outfit for zombies to use, but i wear it on player for testing weights, but i'd prefer if i could use zombie animations while doing so
Does anyone know what script to use for searching entire containers near the player?
anyone please?
How does this work, in the zombie spawn/horde manager window? Are these outfits in the game? Or specifically pre-made zombies? I see some of my mods have outfits here. How would I go about making my own outfits? (I want to spawn specific zombie types for rp events on my server)
Is it in scripts?
As idea, you can use this
or
thanks!
Okay I've figured it out
Is there a function in the outfit manager that lets you pick a specific variant if an item has like 12 variants?
Guys
how to trigger all equipped clothes?
from all slots
not like:
ArmorSlot_TorsoExtraVest = playerObj:getWornItem("TorsoExtraVest");
playerObj:isEquippedClothing(ArmorSlot_TorsoExtraVest) and ArmorSlot_TorsoExtraVest:hasTag("zReAAS_TAG_Vest")
i need get all clothes, take only with tag and work with it
So I'm trying to make a recipe for a fishing net from Ivery's Mod to catch shrimp.
It works when you place it down because its considered an item, but then when you pick it up , its a moveable and the game no longer recognizes it for the recipe. How could I fix this?
{
keep ivery_SmallFishnet/ivery.Moveables.ivery_community_01_75,
I've been trying to figure it out for a while, would really appreciate some help ❤️
keep ivery_SmallFishnet/Moveables.ivery_community_01_75,
.
is it possible to make a item that can only be used X amount of times to craft? if so, how?
look like it doing with drainable items
yeah i might have to
yeah that's a drainable
alright, i didnt know if it had to be drainable exlusively or if i could keep it as an item. but i will have to do some ghetto trickery to get it to behave how i want
in item UseDelta = N
where N < 1, for example N = 0.25 - it's mean item have 4 charge.
in recipe item = X
N* X = total charge of items
So I've changed it to say the following:
recipe Fish For Shrimp
{
keep ivery_SmallFishnet/Moveables.ivery_community_01_75,
BaitFish=2,
Result:Shrimp,
Time:10.0,
Category:Fishing,
Sound:Hammering,
SkillRequired:Fishing=7,
}
The issue is , the item is also a tile, so when its picked up having been placed down it becomes Moveable, but that's not an item in the item list. How would I make the tile into an Item specifically?
If I'm making sense
so if i want it to have 2 charges, i make UseDelta 0.5 and X is 2?
number of uses = 1 / useDelta
0.5 delta - item have 2 charge.
in recipe x = 2, then all item be used, because 2 charge
maybe transform with recipe
where u take moveable.object and in result get just an item
I did not know that was a thing. How would I do that for example?
Is it like an evolved recipe?
I've always wondered if it fraction with a remainder...
like 0.33 - it's 4 charge, or 3?
recipe MyShiet
{
Moveables.ivery_community_01_75,
Result:ivery_SmallFishnet,
Time:10.0,
Category:Fishing,
Sound:Hammering,
SkillRequired:Fishing=7,
}
should be 3
I'm going to copy & paste this exact recipe and see if it works xD. My struggle with it has been because the tile is not an item and its a tile it can't be used.
hmmm... i'm not have issue when im use moveable items in my recipes
i think u should find what items in tile
Do you know how to make an item moveable?
That's somethign I'm struggling with too, because I could just make a moveable item with the exact appearance.
item LabChromatograph {
Type = Moveable,
DisplayCategory = Furniture,
Icon = LabChromatograph,
Weight = 16.0,
DisplayName = LabChromatograph,
WorldObjectSprite = demonius_vaccine_01_4,
Tooltip = Tooltip_LabChromatograph,
}
WorldObjectSprite = demonius_vaccine_01_4, - it's tile
but in total its Moveable.LabChromatograph
for example
same stuff should be in your mod
some item has WorldObjectSprite = ivery_community_01_75
Oh from Demonius' Right..
So I see how liek the item is still called even after placing 🤔 and its name doesn't change.
Guess I'll need to play around with it more then
Where do you have Moveable.LabChromatograph in your items though? Is just marking it as type = Moveable enough?
Gotcha okay, so every tile needs an item for it? It just seems like the item reverts is my issue. I'll play around with it more though
should be
Maybe it's just that specific tileset. 🤔
just create item in script like module Base { item MyItem { Type = Moveable, DisplayCategory = Furniture, Icon = MyItem, Weight = 2.0, DisplayName = MyItem, WorldObjectSprite = ivery_community_01_75, Tooltip = Tooltip_MyItem, } }
Will do and test it out ^_^ , thanks so much
Hope i come back with good results
😄
find bottle in vanilla and copy
item MayonnaiseEmpty
{
DisplayCategory = WaterContainer,
Type = Normal,
DisplayName = Empty Bottle,
Icon = TZ_MayonnaiseEmpty,
Weight = 0.1,
ReplaceOnUseOn = WaterSource-MayonnaiseWaterFull,
CanStoreWater = true,
StaticModel = MayoJar,
WorldStaticModel = MayoJarEmpty_Ground,
Tooltip = Tooltip_item_OnlyPurifyMicrowave,
}
item MayonnaiseWaterFull
{
DisplayCategory = Water,
Type = Drainable,
DisplayName = Water Bottle,
Icon = TZ_MayonnaiseWFull,
Weight = 0.5,
ReplaceOnDeplete = MayonnaiseEmpty,
UseWhileEquipped = false,
UseDelta = 0.16,
ReplaceOnUseOn = WaterSource-MayonnaiseWaterFull,
IsWaterSource = true,
CanStoreWater = true,
FillFromDispenserSound = GetWaterFromDispenserPlasticMedium,
FillFromTapSound = GetWaterFromTapPlasticMedium,
StaticModel = MayoJar,
WorldStaticModel = MayoJar_Ground,
Tooltip = Tooltip_item_OnlyPurifyMicrowave,
}
for example
ok so i cant manually drink just autodrink? while using UseDelta
module Volke
{
imports {
Base,
}
recipe Fish For Seaweed
{
Base.BookFishing1/Base.BookFishing2/Base.BookFishing3/Base.BookFishing4/Base.BookFishing5,
keep Base.KitchenKnife/Base.HuntingKnife,
Result:Base.Seaweed,
Time:10.0,
Category:Fishing,
Sound:Hammering,
SkillRequired:Fishing=5,
}
recipe Fish For Squid
{
keep ivery_SmallFishnet/Moveables.ivery_community_01_75,
BaitFish=2,
Result:Base.Squid,
Time:10.0,
Category:Fishing,
Sound:Hammering,
SkillRequired:Fishing=9,
}
}
None of these items are reading either x_x
Is there any noticable errors in the code ?
hm, maybe its discord but wouldnt the formatting be the issue, or is the imports base wrong?
try it like this
Isnt base the base game?
I'll try both 🙂
Everything looks fine to me though. Though I don't think vanilla items need base Infront of them if you're importing base already
For a use you need to have the full useDelta. The item might not be empty in the end but it will not have a use either.
Here is another example 0.2 useDelta is not exactly 5 uses either because of float value.
Did that work or is it still busted
It wasn't the problem entirely - but I did remove Base and I cleared up a bunch of errors and things started working
So it was the start. thank you @autumn temple ❤️
Niice
function: zReRipClothing_GetItemTypes_XXX -- file: zReRACAAS_recipecode_vanilla.lua line # 11 | MOD: zRe ARMOR ABSORB SYSTEM by kERHUS function: RipClothing_Leather -- file: zReRACAAS_recipecode_vanilla.lua line # 32 | MOD: zRe ARMOR ABSORB SYSTEM by kERHUS java.lang.RuntimeException: Object tried to call nil in zReRipClothing_GetItemTypes_XXX at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973) 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:1827) at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:122) at zombie.inventory.RecipeManager.LoadedAfterLua(RecipeManager.java:166) at zombie.inventory.RecipeManager.LoadedAfterLua(RecipeManager.java:133) at zombie.inventory.RecipeManager.LoadedAfterLua(RecipeManager.java:119) at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:103) at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145) 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)
local function zReRipClothing_GetItemTypes_XXX(scriptItems, fabricType)
if not ClothingRecipesDefinitions["FabricType"][fabricType] then
return
end
local allScriptItems = getScriptManager():getAllItems()
for i=1,allScriptItems:size() do
local scriptItem = allScriptItems:get(i-1)
if (scriptItem:getType() == Type.Clothing) and (scriptItem:getFabricType() == fabricType) then
if ClothingRecipesDefinitions[scriptItem:getName()] then
-- ignore
elseif scriptItem:hasTag("zReRepairableVest")
or scriptItem:hasTag("zReRepairablePart")
or scriptItem:hasTag("zReRepairableChemsuit")
or scriptItem:hasTag("zReRepairableSCRAPS") then
-- ignore
else
scriptItems:add(scriptItem)
end
end
end
end
@fast galleon what's wrong
why hasTag nil
don't undertand how to exclude items with tag
for recipe
what type does getAllItems include in its list?
all items
line 11 is this if (scriptItem:getType() == Type.Clothing) and (scriptItem:getFabricType() == fabricType) then?
11 where tags begin
Item doesn't have hasTag, use getTags() and contains("tag")
like scriptItem:getTags():contains("zReRepairableVest")?
When making a crafting recipe, are you able to have one of the ingredients be some of an item?
Like you craft something using baking soda, but it only uses 1/10 units of baking soda?
Use semicolon after the item like this: BakingSoda;10
Is there any event that guarantees that getPlayer() is already existing at its runtime?
Does this also work with bleach?
It should work with food. Maybe drainable items too.
So yes.
I'm just wondering how it would display.. does the weight of the item just go down?
Is it 4 units for each 1/4th you're able to consume?
Or does a green bar appear once you use some?
Like with Remaining:
Hm, I was wrong, I don't think you can drink 1/4
Bleach might be a single-use item
It's not food?
It is a food class, I just don't know how it would indicate to me if.. it was any less than full
Sorry, still getting a grasp on modding
does anyone here understand how to make multiple texture clothing use multiple icons?
what I mean is red hazmat gets the red hazmat icon while the green hazmat keeps the green hazmat
oh hey I got the builder title, nice :D
currently trying to trigger random weather events, managed to find a function that actually works well with mp -
getClimateManager():transmitTriggerBlizzard(12)
This currently sets the blizzard to trigger for what I'd assume is 12 hours but the climate debugger shows the current weather event as 14 hours (not sure why, though it does indeed start a blizzard at least)
Any ideas on how to best go about randomly triggering this?
what app is used to make pz mods?
lol, notepad++'ll work
But for unpacking the gamefiles, I've only heard that currently none of them are working, but that could be old news
cant i use java for it?
Yes
Hello everyone people, I'm looking for a modder. It's a paid work 😗 ❤️
@bronze yoke thanks, managed to achieve this as a mod with isotoscreen
Also if somebody wondering there is an easy way to get a proper color picker for yourself like this one
https://i.gyazo.com/ea136de8de8ec5a896d9e6df0f9d158a.png
Snippet as example from my createChildren of UI
self.textField = ISTextBox:new(0.001, titleH, self.width, inputH, "", self.text);
self.textField.anchorRight = true;
self.textField.anchorLeft = false;
self.textField:initialise();
self.textField:enableColorPicker();
self.textField.yes:setVisible(false);
self.textField.no:setVisible(false);
self.textField:onPickedColor(self.color);
self.textField:setVisible(true);
self:addChild(self.textField);
enableColorPicker() enables it onPickedColor(color) sets and existing color from { r, g, b }
VS Code can spot errors in your Lua syntax and that could save you some code failures debugging.
Hello gents, not sure if this is the appropriate chat to ask this but is there anyone willing to be commissioned for a custom job mod?
Hello everyone gents people, I'm just checking if there's a bot that puts spiffo on hello messages.
:o
can someone tell me why these sizes are so weird? they stay the same no matter what i put in scale, and basegame tofu is also larger
i put them on 0.5 here
here's the entire text
you need a comma at the end of the scale = 0.5 line, otherwise it might not be read
oh i can't believe i missed such a basic thing. thank you
it worked with comma but basegame tofu is still getting scaled up
how do i fix that?
I dont understand why placing my item on the ground bricks the game, it never did that before and i didnt change anything?
if anyone has an idea how to make this work, let me know. I created a CO2 tank item that I want to deplete when it's used and the weight to match. I have it working in single player without issues but it doesn't update to multiplayer. It reverts to a full tank when found by another player. I have tried self.tank:transmitCompleteItemToServer() and self.tank:getWorldItem():transmitModdata() with no luck.
Maybe you do something wrong in script. It's container? Send your script
Where you call function with :Use() ?
appologizes i was eating. I dont know which script to send. all it was is a custom food item
I removed the OnEat line, and it still break's when i place it on the ground
so i dont think it was that OnEat code that broke it
I have been calling it from a timed action sequence. It updates perfectly for a single player game. In multiplayer it shows up as updated until it transfers to another player. Then the customweight and uses reverts to the initial weights and uses.
Maybe you miss Icon = ... ?
Are you sure that :Use() not work?
Maybe you somewhere reset tank?
or recreate
Thanks for checking I'll keep looking
i will throw a random icon on and see
oh... that was the problem
thanks
Interesting, if I drop the tanks on the ground they update to all players on the server. Is there something in code that happens when items drop on to the floor that is correcting the failure? anyone know where I can find the code executed when a player drops something?
nevermind I found the drop code, looks like AddWorldInventoryItem might be the difference
and found another bug, if I add an item directly to a container, when a player takes the item it disappears. I noticed this with other mods too. If I put the items on the ground and them pick them up they don't disappear. example: if machine:getContainer() then
machine:getContainer():AddItem("FunctionalAppliances.FATheaterPopcorn")
the popcorn spawns, we can both see it, if we try to eat it directly from the container or grab it directly from the container it disappears a second after we grab it. If we drop it on the ground and pick it up then it stays without issues.
and it only happens in multiplayer
huh, ive never had a texture error like this happen before
maybe the texture did not match the model?
oh it does, i just forgot to rename the texture to match what i named it in code. so i know what the issue is
but ive never seen it look like that ingame
been there 🙂
usually the item would just be invisable, not that jumbled mess
when I was making kegs I accidently made one bigger than the pub...
looks like it just threw a random texture from the game onto every one of its vertices
Hey hi, I'm wondering if someone knows where fall damage is applied?
IsoGameCharacter's DoLand
Could anyone figure out why my SandBox option is not translating? ```VERSION = 1,
option ATTS.jew
{
type = integer,
min = 1,
default = 5,
max = 10,
page = ATTS,
translation = ATTS_jew,
}
option ATTS.jew2
{
type = integer,
min = 1,
default = 6,
max = 12,
page = ATTS,
translation = ATTS_jew2,
}This is a sandbox-options.txt andSandbox_EN = {
Sandbox_ATTS = "Zamazon V2",
Sandbox_ATTS_jew = "Silver Jewelry Price",
Sandbox_ATTS_jew_tooltip = "Adjust price for jewelry. Default price is $4+CreditBonus",
Sandbox_ATTS_jew2 = "Silver Gem/Gold Jewelry Price",
Sandbox_ATTS_jew2_tooltip = "Adjust price for jewelry. Default price is $6+CreditBonus",``` this is a Sandbox_EN.txt which is translation file.
is sandbox_en definitely in the correct location?
has this mod been posted to the workshop previously?
Yes, and I just updated it with sandbox option.
unsubscribe to the mod and restart the game
never test while subscribed to your mod, but sandbox options especially tend to bug out
It works when I remove other mods
Try using media/lua/shared/Translate/EN with capital T.
After unsubscribing my mod, it works! I really appreciate it, Albion! You saved me a lot of times.
I'm glad I test with nosteam, makes things much better.
i've recently set it to use a separate cache dir and refuse to load workshop
still steam mode, just no workshop
how do you do that, with -modfolders ? Can you load workshop mods with -nosteam?
yes, -modfolders mods,workshop
the steam workshop is referred to as steam there iirc
not tried using that to make nosteam load steam workshop, would be neat but i wouldn't expect it to work
I'm not sure it works.
#mod_development message
Hey Everyone, I want to announce the release of my second mod, Dynamic Body Shape, which dynamically changes your character model to reflect your stats 😄 ,
Check it out:
https://steamcommunity.com/sharedfiles/filedetails/?id=3066054201
(warning: requires java modding, it's just copying some files)
I can't count the many times I downloaded my own mod from the workshop and couldn't figure out why my non-workshop version wasn't working. The pain is real.
But I properly back up my stuff now so I don't need to use my workshop as a file backup
Backup is nice, git is nicer.
Helps to find when and where you broke something... and a lot more...
You need both, but git is for version control like what was described above.
How would I loop a sound for a single recipe?
Like for a single sfx for example, I want to loop the shoveling sfx for a single recipe but not make all shoveling sfxs loop for other recipes
Make a custom sound that is as long as the action you do
Either a sounds loops all the time or it plays once i dont think there is an inbetween
goddamn it xD 🤣
aLSO @neon bronze since I'm currently in the testing phase; is there anyway to spawn in with stats maxed to test recipes or items? I hate having to get it each time x_x
like increase stats through stat menu, etc.
Make a OnCreateCharacter event function that pops all your stats to max
Will have to look into that ^_^
up
{
CatToy,
CannedSardinesOpen/TunaTinOpen/filcher.SFCatfoodOpen,
Result: Black_cat,
Time: 5000.0,
Sound: hungrycat,
Category: Trapper,
AnimNode:followme,
SkillRequired:Trapping=4,
}```
So I'm trying to figure out why the AnimNode for followme doesn't work. Can animnodes only be actions :?
Everything else works, and other standard actions seem to work , just asking for anyone that has more experience
How would I use an emote as an action ? Or using something not under player/actions like fishing
make an XML file in actions.
I assumed that, but for the case of getting it in a mod so that other people would be able to use it as well when they try to the 'action'
How would that work like for adding that xml to others
Basically I want to use the emote comehere for a recipe on a server that will be used with other people. if that makes sense 😅
make a mod with same file structure media/AnimSets/player/actions fix for typos.
You can manually play an emote during crafting, go with whatever you think is easier. Making the XML should be easier.
Righ that's what I tried to do was copy the exact same thing - I named it different, should it have the same name?
Actuall I'll try it and tell you how it goes first 
you can change the name. The important part is to change the conditions.
<m_Conditions>
<m_Name>PerformingAction</m_Name>
<m_Type>STRING</m_Type>
<m_StringValue>FollowMe</m_StringValue>
</m_Conditions>
FollowMe would be the string you use in the recipe.
So this is the followme one,
I copied it over and make the exact same file structure. Okay so...
extends will cause ussues
extends?
Sorry I'm new to coding 😅 , only picked it up very recently
OH
Nvm i see extends
Gotcha that's the issue I was having I think 🤔
forageDefs.LLWildRose = {
type = "LLWildRose",
skill = 2,
xp = 2,
categories = { "WildPlants" },
zones = {
DeepForest = 50,
Forest = 50,
Vegitation = 50,
FarmLand = 50,
Farm = 50,
TrailerPark = 50,
TownZone = 3,
Nav = 3,
},
}
does "Nav" here stand for roads?
Navigation meshes
THE DEVS Said to ONLY use the square drawing tool for zoning. The polygon tool is used for making the in-game map.
In this video we go over how to add foraging zones
Link to the video mentioned
https://youtu.be/XdCdm7zFgRo
If you want to support me here is a link to my patreon:
https://www.patreon.com/DaddyDirkieDirk
So yeah roads often
oh
i want certain items to only spawn on roads, do i increase their nav number here for it then?
(thank you for the video i didn't realize dirk himself had tutorials, will watch them asap)
I did the recipe and instantly crashed my testing X_X
I copied what you said I think....
X_X
Also I removed the extend from ORIGINAL [BELOW]
The name and type should not be changed in the condition I posted.
Hey just curious, whats the last lua event to load when the game starts? Trying to load an event but it seems to be triggering too early, I've tried OnLoad but no joy.
I guess an alternative would be run the event using EveryMinute and make it initially call a function which checks if the functions/objects exist yet then remove the event, not sure if that would work though?
Oh I didn't change the type but I did change the name. I think I forgot a line of follow me in haha
give me a moment, you should copy values from default to this new file.
IT WORKED!
😮
@fast galleon Thank you so much ❤️ - this is all really new to me, but you showing me this means I can now repeat it in the future with other actions, so thank you for taking the time to show me
Anyone got a quick example on how you would go about overriding an existing IsoGameCharacter method with a conditional which either runs a new method, or the original?
local original = IsoGameCharacter.originalMethod
IsoGameCharacter.originalMethod = ...
My issue is on how to use/pass on self.
This only changes behaviour of calls from Lua.
self (arg 1) is the class object, then follow the rest of the arguments, if there are any.
You would need to patch the function of the target class, so IsoPlayer for example and not IsoGameCharacter.
Is it possible to make a mod that allows you to attach more containers to your body?
i.e. backpack on your back, fanny packs on front and back.. then the mod could add duffle bag on side, first aid kit on hip etc...
Have you seen Authentic Z mod?
I have not :v
Is it worth getting? Does it add something like that?
Hm, looks awesome, I'll have a go at it
If you just want fanny pack front and back then there's also eggons fanny pack mod.
Authentic Z has more than 10 attached slots, it will probably have something like what you're looking for.
Thank you! :v
noirs attachments
I will look at this one also, hoping I can use them together without conflict
im trying to add recipes using Crafting Enhanced Core stations and in the readme example is this:
recipe Make Convert Nails
{
Screws=1,
keep Hammer,
Result:Nails,
Time:100.0,
Category:Chemistry,
Sound:Anvil,
NearItem:Laboratory Table,
AnimNode:BuildHigh,
Prop1:Hammer,
Prop2:Source=1,
}
my question is what does "Prop2:Source=1," stand for here?
Can i safely add vehicle mods to an existing game? will the new vehicles spawn?
prop2 is for animation of secondary hand item, source=1 is for the source item 1 used in the recipe.
it's relatively safe to add / remove vehicle mods.
so i can ignore it completely right?
it'll just make character's hands look empty with the animation
is that correct?
You can even remove animnode and both props completly as far as i remember. However im not sure if NearItem is a thing, if someone could confirm?
I'll take a look at it once im home since im curious about it. Maybe it works for tiles?
https://pzwiki.net/wiki/Scripts_guide/Recipe_Script_Guide#NearItem
NearItem exists but it doesn't work well in this version. It requires the objects to have names and they don't all have it.
it's what scrap mods use you are probably familiar with it
it makes it that you need to be in a certain tile distance of these tiles for the recipes to be craftable
i'd love to talk more about it since i barely understand how they work 
If i knew it sooner id probably use this in my TLOU gun mod.... I was looking for a way to use table tiles as workbench, then would probably do my own tile.
Hm, it seems Authentic Z is not compatible with noirs attachments.. once a bag has been upgraded, noirs attachments won't interact with it
scraps workbench not tile
they swapped to CEC
they dont use workbench anymore afaik
wow
(hi im a fan of your mods btw
)
MUAHAHHA
need to look into scraps, thanks for info, its can help me so much :з
ah, yep, hello
before and after.
I made small changes to the hazmat, reduced the gloves and changed the boot model.
Now if you wear military boots this becomes visible.
And it is compatible with any mod that uses the game's vanilla model
but you made a remake
well I guess kinda
i maded only a little few changes, and it's not a stand-lone mod
true
It's from my mod "Boots over overalls"
Makes all coveralls to be tucked in boots, and a made the hazmat the same thing
Thanks :)
But your model, it's look awesome man. You are doing a great job
thanks
funny thing is the hazmat is a combination of the hoodie model with hood up and shellsuit pants
works great
The only main noticeable its the boots
and i reduced a little the gloves
not so many changes
When a mod has a requirement file does the compiler look only in the mod, the mod and the core game, or all mods and the core game for the file? I know this one looks for a file called ProceduralDistributions but does it know the full path? Is there a way to distinguish where its coming from or can I pull a file from another mod I already created if it's a listed prerequisite? Example: require "Items/ProceduralDistributions"
I'm very happy to read this thank you, and keep doing your mod it's gonna look great
updated
You too man, embrace your ideas. In this community everyone can make difference
Thanks man, i'm waiting for you to post more mods here and share your ideas
Hey
Have same one a Mod to Read Faster? it is so slow i need a Mod that works i have the Faster reading with Flsh on the Mod but its dont work have some one a mod for me
🤔 Its under player actions but It still isnt doing the animation.
Okay, I see it String Value is fill_container_tap ,
What it just be as simple as changing the string value with FillBottleFromTap?
is this right? cause I cant seem to get it to spawn
Try to increase spawn chance, like 100 to see if it spawns
i already tried 100 but changed it to 10 cause i thught 100 was breaking it
my Base and your RE31999 before the item what does that mean
it was just in the example so i put it
still cant get it to spawn, i can use another mod to spawn one in my inventory but the model is massive but it wont spawn anywhere in the map
Does anyone have a tutorial on how to create clothes? I use blender 3.6
I have a problem to update my mod and want to your help. I would like to get answer by quoting of someone's question, same as me.
quote
I want to update my mod by adding 3D models to my items, but the models don't work - item icons show up when I place them. I got the models in "WorldItems" folder inside "models_X" folder in .FBX format. The textures of the models is in the right place too. I added "WorldStaticModel = ItemModel," to the item script as well.
unquote
How is the name of that config file? the one that contains the spear data?
It's called SpearSupremecy_weapons
And the name of the distribution file is ss_ProDistrubution
is it possible to give a melee weapon an animation. such as having a part of it constantly rotating or moving?
like an example being a sawblade like the Whirligig from bloodborne, the blades constantly spinning and when i go to attack the spin ramps up through the attack animation.
how to correlate the coordinates like
attachment att {offset = 0.1400 -0.0300 0.0900, rotate = 280.0000 025.0000 85.0000,
with the position on the body?
It can be anything activated. The path is relative after the shared/client/server folders. These 3 folders load in that order, to require something successfully, their folder must have started being loaded.
Did you press escape and edit the setting? I think it's under settings -> (mods) -> then it should say "reading speed"
Hmm
So I was looking in regards to soundblocks, and while looking at skill journals I saw this:
sound PencilWriteSounds
{
clip { file = media/sound/Pencil1.ogg, }
clip { file = media/sound/Pencil2.ogg, }
clip { file = media/sound/Pencil3.ogg, }
clip { file = media/sound/Pencil4.ogg, }
clip { file = media/sound/Pencil5.ogg, }
clip { file = media/sound/Pencil6.ogg, }
}
sound PenWriteSounds
{
clip { file = media/sound/Pen1.ogg, }
clip { file = media/sound/Pen2.ogg, }
clip { file = media/sound/Pen3.ogg, }
}
If its written like that, does it mean it plays all of those sounds?
Or does it randomly choose one or how would the game read it?
{
category = Item,
is3D = true,
clip {file = media/sound/wildturkey.wav, }
clip {file = media/sound/wildturkey2.wav, }
}
I tried to make my own with wildturkey sounds and the first one is a turkey gobbling and the second is a gunshot being fired so I was wondering if that would work 🤔
For... Xp functions, is there anything specific or orderly about it?
player:getXp():AddXP(Perks.Tailoring, 1);
end
function Recipe.OnGiveXP.Tailoring2(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Tailoring, 2);
end
function Recipe.OnGiveXP.Tailoring4(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Tailoring, 4);
end
function Recipe.OnGiveXP.Tailoring6(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Tailoring, 6);
end
function Recipe.OnGiveXP.Tailoring8(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Tailoring, 8);
end
function Recipe.OnGiveXP.Tailoring11(recipe, ingredients, result, player)
player:getXp():AddXP(Perks.Tailoring, 11);
end```
-- These functions are defined to avoid breaking mods.
Get1TailoringXP = Recipe.OnGiveXP.Tailoring1
Get2TailoringXP = Recipe.OnGiveXP.Tailoring2
Get4TailoringXP = Recipe.OnGiveXP.Tailoring4
Get6TailoringXP = Recipe.OnGiveXP.Tailoring6
Get8TailoringXP = Recipe.OnGiveXP.Tailoring8
Get11TailoringXP = Recipe.OnGiveXP.Tailoring11
I see this but I also see like...
player:getXp():AddXP(Perks.MetalWelding, 5);
end```
Give2MWXP = Recipe.OnGiveXP.MWXP2
Give4MWXP = Recipe.OnGiveXP.MWXP4
Give5MWXP = Recipe.OnGiveXP.MWXP5```
Is there a specific style? Do you need every skill or only if your using that specific amount of experience points for a recipe?
you don't need to make anything you aren't using
they're just functions, the reason they're kept neat is for ease of use and maintenance
im trying to figure out how to see how many charges a drainable item has
item Gravelbag
{
DisplayCategory = Material,
Weight = 2,
Type = Drainable,
UseWhileEquipped = FALSE,
UseDelta = 0.25,
DisplayName = Gravel Bag,
Icon = Gravelbag,
ReplaceOnDeplete = EmptySandbag,
ReplaceInSecondHand = Bag_Sandbag_LHand holdingbagleft,
ReplaceInPrimaryHand = Bag_Sandbag_RHand holdingbagright,
WorldStaticModel = GravelBag,
Tooltip = Tooltip_item_empty_sack_container,
}
is it the "UseDelta" part?
0.25 means it uses 0.25 of the entire thing and it means the item has 4 charges?
and if yes, can i change it to any custom amount while making a new item or do i need to write a lua for it like we do with custom exp amounts?
this is correct
if you want to change gravel action then it's a bit more hardcoded in lua. I have a mod for buckets that makes it more customisable.
so for new drainable items i need to use pre-decided numbers?
basically copy paste from vanilla items
no i was thinking it for a new item in the future possibly
total use count = 1 / UseDelta
yep
and yep, like poltergeist say:
If item uses from actions - its coded on lua, like for gravel bag.
For recipes like with wood glue or other same - just without another lua-stuff

precious info as usual
saved me some time from trying to figure out why my 100 charge flintstones wont work without fancy lua thingies
thanks again
my guess is still that you simply forgot something while setting up everything. bringing 3d models into game requires completition of several steps and is super prone to errors. at least for me, it almost always happens that I am convinced that I've done everything right and the model still isn't there. it always turns out that I still forgot smth. 😅 can only speak for me but my guess is that other modders (even experienced ones) know this as well.
so I suggest to double, triple and also quadruple check everything you've done. you might also have a look at other working mods introducing new 3d items and try to set up everything in the same way as those mods.
Here is a tutorial which explains the basics about bringing a new 3d model (including clothes) into the game: https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
Thank you for your words. I appreciate if you can tell me other steps that you guess I missed for applying 3D models except I commanded above~ : )
you don't seem to mention a model script in your post
as albion said, you also have to set up a special script entry of the form
model JarFoodBellPeppers_Ground
{
mesh = WorldItems/JarFood,
texture = WorldItems/JarFoodBellPeppers,
scale = 0.4,
}
those entries can be added to a new txt file in your mod's script folder and appended to module Base { }. I am not exactly sure about naming convention for those file and its entries. (don't know this by heart).
I also don't know anymore what exactly you have to write behind "model...", "mesh = ..." and "texture = ..." to make it work
in case you can't find an answer here in chat, it can easily be figured by reverse engineering other mods or vanilla game
Thank you so much guys~ I'll check and try again!
anyone familiar with tiles / tilesheets? I am having difficulties.
I have made tile properties modifications before, but I am trying to import my first texturepack.
I appear to be doing everything correctly- my folder structure is media\texturepacks, my .pack file is present, in the mod.info I have defined my tildef and pack, but whatever I do the tiles won't show in the brush tool. mod is present in-game
is it possible to have a melee weapon be animated separate from its normal idle and attack animations?
Hello! I have defined some Tiles in a tiledefinitions.tiles file using the editor. How do I use them in Lua? I want to replace a default vanilla tile when the game loads with one of the tiles defined in the tiledefinitions.tile file.
hi- maybe this will help you. not quite exactly what you're looking for, but this is when @fast galleon made an oven sleepable
local tiles = { "appliances_cooking_01_16", "appliances_cooking_01_17", "appliances_cooking_01_18", "appliances_cooking_01_19", }
Events.OnLoadedTileDefinitions.Add(function(manager)
for _, name in ipairs(tiles) do
local props = getSprite(name):getProperties()
props:Set("BedType","goodBed",false)
props:Set(IsoFlagType.bed)
end
end)
😆😆😆
Understood thanks 🙂 , I'm new to all this so I appreciate it ^^
does anyone know why my game isnt using my distribution, i can spawn the item in but it just wont spawn in any containers
optimisation question:
OnPlayerUpdate: compare current state with cached state
Vs
OnAiStateChange: check instanceof IsoPlayer
It seems like player update is less efficient unless there are a lot of zombies actively changing states.
I'm trying to modify an existing mod so that it reduces plant health based on the temperature of the tile plant is on. I can load the mod into a server but it just won't do anything. The original mod that uses the outside temperature does work. I am not sure why it is not working.
If this is not a huge undertaking(I assume it is not) I am also happy to commision a modder that can make this change for my server
I just sent a txt version so that it can be a collapsable text on discord. The original is in lua, and I can see it as a mod when I am in the server
dont think you were talking to me but thank you so much
Thank you! Just realized that the only thing I need to do is to specify the name of the sprite in my code and it works just like the vanilla sprites. I'm new to modding this game and its fun. Thank you for being an awesome community 😄
Hello buddys, i'm doing a second weapon mod, but it's don't appear, it's invisible, and shows on console "FAILED TO LOAD MESH", but it appears on attachament editor, what i could do to fix that?
When i spawn it, it's invisible :/, someone know how to fix?
So for animations. If I want to make a custom animation for using an item. Do I just make a normal method of making character animations by using the character model but just adding the item to the model?
Can someone remind me how require works in zomboid modding, and how it affects the loading of files?
I'm trying to come back into modding and I keep finding myself with _FilenameHere or 0Filename just to make sure a file is loaded before another one
What type of object is the Floor inventory that items go to when dropped?
Trying to get a list of all items on the floor within reach of the player
this is what AutoLoot mod does
Took me a sec to find, but AutoDrop.PlunderSquare had what I needed, mod dev chat is a huge help as always!
is there a way to allow a listBox multiple selections
Your file will be loaded after all required files have been loaded
Okay, amazing, thank you.
which sintax am I supposed to use? require "namehere" or require(namehre) cause my IDE tells me they are both valid.
both are perfectly valid
any function that takes one string argument can use this syntax
Anyone got a clue how I'd go about overriding a method in IsoGameCharacter?
I've tried the following:
ConfigurableFallDamage.originalIsoGameCharacterDoLand = IsoGameCharacter.DoLand
IsoGameCharacter.DoLand = function(self)
ConfigurableFallDamage.updateFallTime(self)
ConfigurableFallDamage.originalIsoGameCharacterDoLand(self)
end
This doesn't appear to work, however
Wait, crap, do the IsoGameCharacter methods need :?
nothing needs :, : just adds an implicit self
yeah, just waiting for my own projects to load up so i can double check and not tell you the wrong thing 😅
Much appreciated! 😄
it's been a while so i forget the exact syntax
I have an unanswered question about animations if anyone is knowledgeable enough to assist me
local metatable = __classmetatables[IsoGameCharacter.class].__index
local original_DoLand = metatable.DoLand
metatable.DoLand = function(self)
-- you know this part
end
turns out i was exactly right and did not need to check 😔
one thing to keep in mind though
Ah, so I need to do the classmetatable stuff first?
yeah, you need to edit the class metatable
you always want to overwrite the function on the class it is being called on, even if the function is inherited
IsoGameCharacter is an abstract class so overwriting a function on it doesn't really do anything
if you're trying to target players you should overwrite the IsoPlayer metatable
It seemed that DoLand was only implemented in IsoGameCharacter, so I figured that'd cascade down to any child classes?
Or am I wrong there?
it would, but that's just not how they're propagated to lua
oh another important thing you might not be aware of
Ah, alright, so I should override in IsoPlayer instead.
this will only override the function for lua's purposes
if it's called from java there's not really anything you can do to it
the metatables store lua's references to the java methods, not the java methods themselves
if it's called from java, no not really
Any idea if there's a sane way of reducing fall damage? An alternative would be reducing it on player update (and making sure you don't reduce every single tick), but that seems... ugly
someone who needed to eradicate fall damage just reset the falltimer every player update
I want to make it configurable
E.g. 50% fall damage
I know how to do it using player update, but that seemed pretty ugly
Considering you'd have to take into account each time the falltime value updated and whatnot
Hence why I was hoping to just grab the final value before DoLand
No way to fire a method before a java method is called?
Some kind of pre-event hook?
/ make custom events?
you could wait for isbFalling to become true, count the time, wait for it to become false again, and then apply fall damage
while keeping the fall timer at 0 so java doesn't apply any damage
Hm
There's a fair bit of conditional logic in DoLand, however
Applying fall damage myself seems like it might act oddly in some scenarios / not play well
yeah, i'm going for a full reimplementation angle here
you could modify the fall timer, e.g. each tick calculate a fall timer delta and halve the amount it changed by to (approximately) halve fall damage
Guess I'll go for something akin to
previousFallTime = 0
on player update:
if fallTime > previousFallTime:
fallTime = fallTime * percentageFallDamage
Does fall time update each tick?
I'll go with the delta idea
Good idea
That's an elegant solution, actually
Thanks!
Just curious, what usecase would there be to override a class's metaclass if it doesn't propagate to the actual execution? @bronze yoke
whenever the method is called from lua, some methods are exclusively called from lua and others are at least sometimes called from lua
Ah, is there some documentation on this?
e.g. in one mod i overwrite InventoryItem's getName since the ui lua uses that to get the item's name
This should technically work, if DoLand were to be called through LUA, right?
--- Store the original IsoPlayer:DoLand() method.
local metatable = __classmetatables[IsoPlayer.class].__index
ConfigurableFallDamage.originalIsoGameCharacterDoLand = metatable.DoLand
--- Override method IsoPlayer:DoLand() to apply the fall damage multiplier.
metatable.DoLand = function(self)
ConfigurableFallDamage.updateFallTime(self)
ConfigurableFallDamage.originalIsoGameCharacterDoLand(self)
end
Just so I've got it down for potential future mods
looks good to me
Got'cha, thanks
Is there any documentation which methods are called through LUA, and which through Java?
not really
sometimes it's intuitive, sometimes you just have to look through it yourself
Alright, thanks!
How does one actually check if all players are asleep?
IsoPlayer has isAsleep() to check if the given player object is asleep, but it also has allPlayersAsleep(). The latter is just causing my mod to hang anytime it calls allPlayersAsleep() regardless if it's singleplayer or multiplayer...
how are you calling it?
p:allPlayersAsleep()
p being an IsoPlayer object of course
IsoPlayer.allPlayersAsleep()
it's a static method so it can't be called on an instance
Huh, the more you know. So I can just call it like IsoPlayer.allPlayersAwake()?
The answer is yes it would seem, thanks albion!
There is a bug with falling and fast forward, that may also break this formula.
Falling time registered without fast forward: ~90
Falling time registered with fast forward and bug: only time before pressing fast forward ~0 to ~90.
From this it seems like the last tick would miss the last fallTime update. This is rather insignificant without fast forward.
since it only modifies the rate of change, it should only be affected to the same extent vanilla is
I didn't register the damage received but it seems like it would not scale the fallTime gained during the last tick.
There's an alternative to add back the "FALLDOWN" damage, but it's also not perfect.
Is there an other way to extract bank to wav, other than Fmod Bank Tools ?
My final version seems pretty solid. Went with a timedelta thing.
It should work well in 99% cases.
Can I use multiple images on a single item? like item Zabpbody { DisplayCategory = Junk, Weight = 0.1, Type = Normal, DisplayName = ProtoType Part Fragment, Icon = Zamapart1;Zamapart2;Zamapart3, }
You can do that for clothing items that have multiple variations defined in their xml as they use the "IconsForTexture" parameter instead of "Icons".
Not for any other item though.
Ah ha, that's why only the clothitems have multiple icons/textures. Thank you!
I'm going to place an item I made on the floor and use it as a tool to make another item. I'm trying to apply vaccine mod "on test" engine, but I don't know what <IsNearLabEquip> is.
---------------------------------------- OnTest ----------------------------------------
-- Checks if there is Microscope near by
function LabRecipes_IsNearMicroscope(sourceItem, result)
return LabRecipes_IsNearLabEquip("LabMicroscope") ~= nil;
end--function
does anyone know to make a true music mod
its second func
find it
Oh I found it..! Thx!!
I have a mod idea i just don’t know how to code.. i can do the modeling but if someone would like to colab with me and do the code that would be great 😭 dm if ur interested
Hey there is there a way to do a "getparam" like there is "doparam" ? i was making a mod for personal use that added a sandbox setting to adjust the weight of "ALL" (included modded in) items. i got stuck on WeightWet and WeightEmpty. is there a way to "read" these values? whenever i try to adress them i only get "nil" back.
silly example if i dont adress these values is a propanecanister that weights 2.5kg when full and 5kg when empty..
Anyone know if a higher res inventory UI mod exists? Something's been bugging me lately about the inventory icons taking nice crisp pixel art and barfing out blurry pixel icons
did anyone get around checking crafting enhanced core stuff?
is there an extra step i need to take to make my recipes have dependancies on another mod?
If your mod requires another mod then you should add require=id in the mod.info file.
that's to add it to steam page right?
no, this is for the game. You will to enable the required mod for your mod to be enabled.
you can access most stuff of other mods as long they have it. the dependency is mainly for your users. if they only enable yours.... it wont work. the require makes sure they enable it.
so require=id is what makes the requirement load in too when you pick a mod to ensure they load in together
right?
the module in your script and in your distributions file don't match
so I should use the same? like FALANGE.camiseta_falange?
yeah
module volke
{
imports
{
Base
}
item tiedbranch
{
Weight = 3.0,
Type = Normal,
Icon = tiedbranch,
DisplayName = Tied TreeBranches,
ResizeWorldIcon = -0.3,
}
}
What's being read wrong here?
🤔
I was trying to change the icon size
maybe that's whats wrong 🤔 ...
Just the item is really big haha 🤣
Let me try and play around with it some
Item being big?
you're looking for ScaleWorldIcon
module Volke
{
imports
{
Base
}
recipe Make Bundle of Twigs
{
Treebranch=10,
Sheetrope=2,
Result:tiedbranch,
Time:75.0,
Category:General,
Sound:ClothesRipping,
CanBeDoneFromFloor:true,
}
recipe Unbundle Treebranch
{
tiedbranch=1,
OnCreate:Recipe.OnCreate.GiveRope,
Result:Treebranch=10,
Time:50.0,
Category:General,
Sound:ClothesRipping,
CanBeDoneFromFloor:true,
}
}
Oh should I have that instead?
Yeah I'll screenshot it shortly. I might need to change the resolution of it
are there any experienced developers here that are able to answer a few questions about the limits of modding in PZ
sure
I'll shoot you a dm real quick
im currently messing around with lua scripting and ran into a problem. i am making a mod for personal use (for now) that adds a sandbox setting to adjust the weight of "ALL" (including modded) items. it works fine with getActualWeight() and "doparam()"i got stuck on WeightWet and WeightEmpty. is there a way to "read" these values? whenever i try to read these values i only get "nil" back. i can set them just fine with doparam but i need their orginal values for the sandbox settings
wasnt there a parameter "hastobe learned" or something like that? maybe add that. i would need to google the correct wording.
there's no getters for these values but you can read them from the fields, unfortunately the vanilla syntax for reading fields is an absolute nightmare, you have to call several functions - i have an api mod that simplifies to what you'd expect (literally just item.WeightWet) if it's not an issue to require it https://steamcommunity.com/sharedfiles/filedetails/?id=3001901955
oh, hold on
i tried "item.WeightWet" it returns nil...
yes, that syntax only works with my api installed
apparently i just missed the getters though 😅 you don't need to use the field
item:getWeightEmpty() item:getWeightWet()
my first experiment returned something silly. full Propane tank : 2.5kg . empty tank 10kg ;P
item:getWeightEmpty() these return "nil" as well.
ahh. your mod. right.
also i think the performance impact is low on my end. even if using your mod. cuz i only invoke it once at the creation of the server. i just loop trough all the items ;P
there shouldn't really be any large impact, but if the getter is returning nil i'm not sure if my api would help
weightEmpty and WeightWet dont have getters according to https://zomboid-javadoc.com/
i'm able to see them on here https://projectzomboid.com/modding/zombie/scripting/objects/Item.html
ok now i am very confuzzled. did i mess up some other way?
dives back into notepad++
yeah, i checked and the getters don't do anything strange, so my api is not needed here
it doesn't seem like it should ever return nil, it does have a default value of 0 so even if it wasn't set somehow you shouldn't get nil
ahh right i got confused lemme try that again.
works like a charm now. however i get strange trails.
LOG : General , 1698864393223> [CustomizableWeightMultiplier] Item: Base.Pillow
LOG : General , 1698864393223> [CustomizableWeightMultiplier] Old Weight: 0.800000011920929
LOG : General , 1698864393223> [CustomizableWeightMultiplier] New Weight: 0.07999999821186066
that's fine, just floating point inaccuracy
but it really gets every item now. included modded. this is with a multiplier of 0.1 (10 times ligther)
LOG : General , 1698864394391> [CustomizableWeightMultiplier] Item: TW.LargePropaneTank
LOG : General , 1698864394391> [CustomizableWeightMultiplier] Old Weight: 20
LOG : General , 1698864394391> [CustomizableWeightMultiplier] New Weight: 2
LOG : General , 1698864394391> [CustomizableWeightMultiplier] Old WeightWet: 0
LOG : General , 1698864394392> [CustomizableWeightMultiplier] New WeightWet: 0
LOG : General , 1698864394392> [CustomizableWeightMultiplier] Old WeightEmpty: 10
LOG : General , 1698864394392> [CustomizableWeightMultiplier] New WeightEmpty: 1
i should remove the "print()" calls i used for debugging now
i was going to mention that, prints are the most expensive thing in the game so they should be disabled/removed when a mod is finished
i wonder if such a mod would be worth publishing. 🤔
my idea was why try to increase carry weight if its limited to 50kg anyways. why not reduce the weight of everything instead?
yes i am a hoarder
since math.floor isnt working anyway im removing that too.
also a last question. what "Events." should i use? i currently use Events.OnInitGlobalModData.Add(myfunction) i wonder if thats the best option.
nod nod thanks albion.
off to the next adventure! equalizing runspeedmodifier, stomppower and combatspeedmodifier!
the first thing to discover on this adventure is that runspeedmodifier doesn't do anything
i plan ahead 🙂 many mods do also
plan : run trough all items. note down the highest value of each. run trough them again and adjust to the highest value.
will report back when i get it to work 🙂
module Volke
{
imports
{
Base,
}
item tiedbranch
{
DisplayCategory = Furniture,
Type = Normal,
Icon = tiedbranch,
Weight = 3.0,
DisplayName = Tied TreeBranches,
ScaleWorldIcon = 0.1,
}
recipe Make Bundle of Twigs
{
Treebranch=10,
Sheetrope=2,
Result:tiedbranch,
Time:75.0,
Category:General,
Sound:ClothesRipping,
CanBeDoneFromFloor:true,
}
recipe Unbundle Treebranch
{
tiedbranch=1,
OnCreate:Recipe.OnCreate.GiveRope,
Result:Treebranch=10,
Time:50.0,
Category:General,
Sound:ClothesRipping,
CanBeDoneFromFloor:true,
}
}
Trying to figure out what's wrong here
I've seldom made custom items
Not sure if this is the right channel, but I'm looking to commission someone that's able to make me a few clothing items. Feel free to DM me!
Capitalization is off.
Treebranch should be TreeBranch
Sheetrope should be SheetRope
Is there a way to force a refresh of the items in a container? Example: If you have a stack of food items and change the state of them to cooked it doesn't update immediately. I have seen this in the player's inventory too if its in a stack, the player needs to click on an item before it updates and separates the cooked item from the rest of the stack.
Any idea how I could add more sounds to schizo? Would love to add a Discord ping sound just to mess with the schizos on my server
Where can i find the 3d files for the vanilla cars?
If you are adding just the discord ping; add it to the sound file (ogg format) to the sound folder, then go into ClientTrait.lua, add it to the sound tables. Update ZombRand(8)+1 to ZombRand(9)+1 in function "insideSchizoAttack(Request)" and ZombRand(6)+1 to ZombRand(7)+1 in function "outsideSchizoAttack(Request)"
Would anyone know the function for removing an overlay?
Trying to have overlays come and go on sound queues, I can get them to popup, but dont know how to remove them
How would I make that Steam Workshop compatible? I'd rather sneak it into the server in my mod rather than have the server owner edit the game files (cuz that just gives away the secret and would break when the game updates)
Add the mod to your modpack(if you have one). Then you can sneak things into it without your players knowing
That's what I plan to do!
So I'll put the ping.ogg in the media/sound folder of the mod
But then how would I override ClientTrait.lua?
(Also I can't seem to find the ClientTrait.lua file)
lua; client; Schizophrenia; ClientTrait.lua
i made a mod but my stupid brain cant decide to publish it or not -.- ----what if it still has bugs,---- what do i use for pictures,---- what do i write into the description... aaaarrrghh
For bugs anything that doesn't brick the save is ok. As long as you are confident you have tested it enough it will be fine.
For description, you can start with something simple. You don't need anything fancy to start.
its a pretty simple mod. it just adds a sandbox option to change the weight of all items (included modded ones) by a multiplier. 0.5 half as heavy, 2.0 double as heavy.
im not a graphics guy so. how do i make screenshots for that laughs
I don't see Schizophrenia in client. Am I doing something wrong?
You need to go to the Schizophrenia mod folder.
e.g. Steam\steamapps\workshop\content\108600
Ohhhhh I thought Schizo was vanilla
I am dumb
When loading mods through the workshop, how do I make sure my modpack always gets loaded at the end?
For servers you would list it last in the ini. For solo you turn it on and off.
If you just want to edit other lua files, you can require that file in your lua file and then make changes.
How would I do that? I haven't worked with dependencies before
nevermind, everything is local and not as a module. Overwrite the full file.
I just keep the file in my mod, and it should get overwritten, correct?
Use the exact same path.
i did it. feedback would be appreciated : https://steamcommunity.com/sharedfiles/filedetails/?id=3069424394
kinda happy. released a the mod 2 hours ago. 23 people looked at it and 13 currently have it subscribed 🙂
whopping 50% subscribers 🙂
How can I make a mod that changes zombie sounds?
There was this one mod that let you set, which items you empty from a bag to which container, emptying with one button.
What was it called?
Brilliant!
Do the mods update in-game or do I need to reboot the game until a new mod appears in it?
Download depends on your steam settings. To add a mod you will need to quit to menu and enable the mod for the specific save.
where can i find "Idle_Weapon2" ive been looking into trying to modify that for a custom weapon mod but i cant seem to find the animations
same thing with Run_Weapon2
i cant find any reference of them when searching, even though you have to put them in your weapons
I think IdleAnim & RunAnim are not used in the latest version.
seems safe to not add them
Up
Maybe you can give more detail about what you are looking for?
Thx for you reply I've edited my initial message
is it about player death?
yes
There are logs user % died, % is dead, % killed %.
Logs are in your cache folder, e.g. %user%/Zomboid/Logs
thanks you so much !!!
No need. Try finding somebody with more knowledge about this, there are servers that track this information.
hm. then what animations are used for the idle and running with weapons in hand?
anybody knows how to modify the over-encumbered damage?
In debug you can use animation monitor to see what animation activates. It will tell you the AnimSet name from which you can find the animation name.
You can also use Animation Viewer to browse animations.
e.g. AnimSets/player/run/run2hands.xml
ok so the animations for attacking and moving are separate from the weapon itself from what i see in the animation viewer. so i cant just edit the animation to change something on the weapon.
You can select animations by changing player variables.
I heard dhert's handwork is good example.
but would that allow me to animate the weapon not the character? beacuse thats what im trying to do
anybody knows how to modify the over-encumbered damage? i wanna raise to more than 75%
this being the example, with this item in my weapon pack. I want the blades to constantly be rotating
I don't know if that's possible.
ive been trying to ask it for 3 days with no luck of being noticed 
iirc its somewhat possible with vehicles. but i didnt know if it was possible with other things
This is something that is necessary for a working whip weapon.
@fast galleon do you know each number part for bodyPartIndex?
so its basically another thing that i need to wait for build 42 to hopefully make possible?
which seems to be a trend with like 90% of the things i want to do 
declaration: package: zombie.characters.BodyDamage, enum: BodyPartType
where i can find index?
do you have a part or blood object? You could use part:index()
Some items go to my pocket automatically (emptying a pot, shredding clothing).
Is there a mod that moves them automatically to whatever container I carry on me?
RecoilDelay on guns - it's ROF?
kinda

