#mod_development
1 messages ยท Page 12 of 1
eee... there is no mod for mp and they are outdated from what I'm seeing
also mod options (build 41) is broken? I have no issues with that, comments say otherwise tho
๐ค
Apparently for some people, with a certain combination of mods it does not work; for other people with the same mods it does work.
I have no idea myself, but it's a been problem for some but not all users.
huh, alright, guess that's why some of the fully working mods do give an error
if mod is not working as client then I guess that while I'm hosting it's not working either? XD
I should probably dump some of the mods I'm using...
also, was this mod deleted?
I can't access it, nor find it on worksohp
alright, modding this game is like coding
I deleted one mod, and suddenly new options for older mods popped up in sandbox settings
Hello survivors! ๐ I was thinking about a feature that might be helpful for admin purposes. The ability to "spectate" a player, that means select the player you want to spectate on and the camera will automatically follow that player. Do you think this is something achievable by writing a mod?
not sure if it's possible to make the player invisible to itself, but I guess if you teleporting the player to another player every tick or something lol, would probably be a bad solution though
Unless the admin player is invisible and in noclip mode and following the player they are spectating, I do not think that is possible,
I see, it happened that from time to time I just wanted to spectate some players without having to use the admin character.
I just wish one day this magic button "spectate" will appear in the the players list ๐ค
Honestly, there's probably some utility for an auto-follow admin tool?
But ah, PZ is very specific about how it instances the environment re the player account.
you could do this in a very hacky way right now by turning on god+invis+noclip and running a teleport call to the target's coords every X ticks
when they're in a vehicle though, oh boy is that going to suck
I see a lot of use cases, just a few:
- just see how players are doing, this is great for server admin to understand if the server settings are OK
- for live streaming purposes, being able to spectate it would be great to stream a server activity without having to mess with the players
There's technical matters that as the newest, stupidest member of the team I'm not qualified to properly explain that make adding spectator mode problematic?
It actually dovetails with other matters like how teleportation in problematic in MP and can crash servers, etc.
but yeah, I agree that this a "vanity" feature probably. It won't add or improve anything to the game.
such a thing can be quite handy on RP servers for admins running events
I see it commonly used on DayZ RP servers
I see, in case, just keep this as a future feature request โค๏ธ
I mean, if you make a tool where admins have noclip/ghost mode/are invisible(can be done with clothing modding)/and stick to a player you have that?
But adding a tool that can crash servers as a vanilla feature (spectator mode), probably not in the cards.
this is the dirty/hacky way I don't like to be honest.
Well, the actual (and more generic answer) that solves it is a freecam
The engine don't support that.
nothing is supported until it is ๐
Yes, it is not that important @willow estuary , mine was just an idea ๐ Maybe it will be implemented in the future
Again, I'm the newest and stupidest member of the team, so I'm not qualified to defend the matter for internet court, but I know it's not possible?
definitely possible, but almost certainly an inordinate amount of work to do
I'm the newest and stupidest member of the team so yes, anything involving an inordinate amount of work is going to be impossible ๐
if you're the newest, how do you know you're necessarily the stupidest ๐
Because I know my place? ๐คช
aaaaaaaaaaaaaaaaaa fucking steam
the files didn't synchronise and I lost my backpack with all my gear!
how does this game saves stuff?
periodically, and when you quit
can I access older saves?
"How it feels to be the new guy at work 101" I feel you man. 
question, why do some mods break others?
I had few mods that add some actions or coding like Zed health or vehicle dismantling, barridace and such standalone staff, but when I deleted them I lost some parts of my own equipment and some of the things stopped working?
It's because of how each modder can inject and edit the original pz code
so I can't safely delete a mod for furniture without breaking my weapons?
it's hard to say, but usually very different mods should not affect eachothers
A difference is when two mods are similiar or related
eg: Proximity Inventory vs Alternate Inventory Rendering
These two will cause issue to eachother unless both devs decide to find some common fixes
Also, the "how" you mod it's important for mod compatibility
Let me give you as example my mod "Show Exact Level Number" the first version was not compatible with "Fix XP View"
And it all boils down to how you write the mod
In the first version I was overriding the entire drawXpBoostMap function, this made it so I was "owning" entirely that function, and I was forcing all the other mods to use my version of drawXpBoostMap
CharacterCreationProfession = CharacterCreationProfession
function CharacterCreationProfession:drawXpBoostMap(y, item, alt)
local dy = (self.itemheight - self.fontHgt) / 2
local levelString = ' ('..item.item.level..')';
self:drawText(item.text..levelString, 16, y + dy, 0, 1, 0, 1, UIFont.Small);
local percentage = "+ 75%";
if item.item.level == 2 then
percentage = "+ 100%";
elseif item.item.level >= 3 then
percentage = "+ 125%";
end
local textWid = getTextManager():MeasureStringX(UIFont.Small, item.text)
local greenBlitsX = self.width - (68 + 10 * 4)
local yy = y
if 16 + textWid > greenBlitsX - 4 then
yy = y + self.fontHgt
end
for i = 1, item.item.level do
self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - (68 + 10 * 4) + (i * 4), (yy) + dy + 4
, 1, 1, 1, 1);
end
if item.item.perk ~= Perks.Fitness and item.item.perk ~= Perks.Strength then
self:drawTextRight(percentage, self.width - 16, yy + dy, 0, 1, 0, 1, UIFont.Small);
end
yy = yy + self.itemheight;
self:drawRectBorder(0, (y), self:getWidth(), yy - y - 1, 0.5, self.borderColor.r, self.borderColor.g,
self.borderColor.b);
return yy;
end
Instead, in the second version, I was "injecting/hooking" my custom code into the original function drawXpBoostMap, this made it so if another modder is hooking in this function in the same way I did it, both our code will run side by side, as long as we don't override eachother
CharacterCreationProfession = CharacterCreationProfession
local old_CharacterCreationProfession_drawXpBoostMap = CharacterCreationProfession.drawXpBoostMap
function CharacterCreationProfession:drawXpBoostMap(y, item, alt)
local result = old_CharacterCreationProfession_drawXpBoostMap(self, y, item, alt)
local dy = (self.itemheight - self.fontHgt) / 2
local levelString = ' ('..item.item.level..')';
self:drawText(item.text..levelString, 16, y + dy, 0, 1, 0, 1, UIFont.Small);
return result
end
I hope this makes sense @unreal garnet
The rule of thumb of modding IMHO is that you should keep the amount of custom code you write to the minium and use as much vanilla code as possible to ensure max compatibility and long term sustainability
well, I deleted few unrelated mods
which fixed few other also unrelated mods and broke other unrelated mods
may God help you
this mod atleast was working for me. not sure about MP. but you can still make modifications manually atleast. And if you don't want to manually do it, you can copy the sandbox vars to an SP save, modify it with the mod, then copy paste it back to the MP save. https://steamcommunity.com/sharedfiles/filedetails/?id=2670674997
This also applies to the style in which you should intercept game functions.
Consider:
function SomeGameTable:someFunction(a,b,c)
-- do stuff
return oldFunc(self, a,b,c)
end```
As opposed to:
```local oldFunc = SomeGameTable.someFunction
function SomeGameTable:someFunction(a,b,c,...)
-- do stuff
return oldFunc(self,a,b,c,...)
end```
if a new version of the game code adds additional arguments, the first version has definitely broken the game.
less-common though nonetheless sensible semantics for returning apply if you have to call the original function first and can't immediately return its result:
-- do stuff
return unpack(ret)```
welp, I don't need it anymore
for MP, you can edit the files directly
Hello!
Is this updated? https://projectzomboid.com/modding/
zombie.characters.IsoGameCharacter.setSpeedMod does not work as I would expect.
Does (...) work if there are no more params?
Cause if it does I could add it automatically everytime I generate a new hook to my vs devtools https://github.com/mxswat/vscode-pd2-dev-tools
This extension gives some snippets for PD2 modders - GitHub - mxswat/vscode-pd2-dev-tools: This extension gives some snippets for PD2 modders
Also can you explain this more please? what is the point of using unpack? ๐ค
because a function can return an arbitrary number of arguments
it ensures that when your function returns, it passes back precisely whatever the original function did
and yes, (...) works as the only "parameter"
you can even access it inside your function by wrapping it into a table
Why does this in game only allow me to use the "Wet bath Towel" and not both?
Recipe something
{
Destroy BathTowel/BathTowelWet=1,
Result : RippedSheets=4,
}
local args = {...}
Oh, so that would solve the issue of me having to add the following code?
result1, result2 = oldFUnction()
return result1, result2
yes
99% of steam users don't read mod descriptions, most of my mods have no sense comments , I just leave them on to see how far an user can go with his comments lol
anyone know if there is a specific size required for item icons? eg. im creating a backpack mod, does the inventory icon for the backpack need to be a specific size, such as 32x32?
32x32 is correct ๐
Amazing! Thank you so much dude!


lol, we have an almir emoji on here?!?
i created 2 icons that are both 32x32, and yet they dont appear in the inventory as icons while in-game. im assuming i havent linked them properly....
Nope, it's from mws lol
MWS?
modworkshop
I guess they like Payday 2
yeah, it was pretty bad
Yeah ๐ฆ
some IRL shit
Loads of shit, money stuff too, too bad, aj was one of the guys that gave me a massive hand when I got into modding for the first time as a modder. Good times ๐ง
i think you need to put item_ in front of their names
already got that done :(
got it done like that
im not sure, ill have to double check
Does anyone know why this in the game only allow me to use the "Wet bath Towel" and not both?
Recipe something
{
Destroy BathTowel/BathTowelWet=1,
Result : RippedSheets=4,
}
the bathtowel and bathtowelwet are a drainable item so they have to be destroyed otherwise it only drains them a little...
or is there something else then "destroy" I can use
you dont need to use Destroy
if you specifiy "keep" then itll keep the item
otherwise it gets used up
if you perform this recipe in game you get to repeat it 10x before the towel is used up
So, how do I make it use the whole towel? @drifting ore
Recipe Rip Towel
{
BathTowel/BathTowelWet=1,
Result : RippedSheets=4,
}
that should consume the whole item i believe
it sadly doesn't
try adding destroy in front of it
destroy BathTowel/BathTowelWet=1,
trust konjima, not me xD
when doing
Destroy BathTowel/BathTowelWet=1,
it only show the BathTowelWet as a possible ingredient and the BathTowel cant be used
destroy BathTowel/BathTowelWet
BathTowel is a drainable and BathTowelWet is just a normal item
but when looking at other recipe that use destroy item such as Battery it just use destroy Battery
and battery is a drainable
I see BathTowelWet is Normal indeed
any way to still do what im trying to do?
I tried
Destroy BathTowel/BathTowelWet,
Destroy BathTowel=1/BathTowelWet=1,
Destroy BathTowel/BathTowelWet=1,
only the wet one shows
alright then remove the destroy tag
and add a OnCreate function that remove the bath towel (dry or wet)
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyBathtowel(items, result, player)
for i=0, items:size()-1 do
local item = items:get(i)
if item:getType() == "BathTowel" or item:getType() == "BathTowelWet" then
player:getInventory():Remove(item)
end
end
end
something like that
but you could also just use
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyIngredients(items, result, player)
for i=0, items:size()-1 do
player:getInventory():Remove(items:get(i))
end
end
since your recipe only destroy the ingredients
oh sweet konijima's here! I just needed to ask you something
did you ever implement some example mods for pzpw?
I'm trying to get started with it now :)
I don't understand this entirely. xD
The recipe stays like this and we use the function to remove the towels after the recipe is completed?
{
BathTowel/BathTowelWet=1,
Result : RippedSheets=4,
}
also how does this know what items to delete?
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyIngredients(items, result, player)
for i=0, items:size()-1 do
player:getInventory():Remove(items:get(i))
end
end
Recipe Rip Towel
{
BathTowel/BathTowelWet,
Result: RippedSheets=4,
OnCreate:YourModID.OnCreate.DestroyIngredients
}
create a file in your mod lua/server/YourModID_Recipes.lua
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyIngredients(items, result, player)
for i=0, items:size()-1 do
player:getInventory():Remove(items:get(i))
end
end
thanks a ton
I see, ill try this now
it looks like it works ^^
๐
if I wanted to use this how would I adopt it?
-- add thread sometimes, depending on tailoring level
if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
local max = 2;
if nbrOfCoveredParts then
max = nbrOfCoveredParts;
if max > 6 then
max = 6;
end
end
max = ZombRand(2, max);
local thread = InventoryItemFactory.CreateItem("Base.Thread");
for i=1,10-max do
thread:Use();
end
player:getInventory():AddItem(thread);
end
just add it to the function
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.RipBathTowel(items, result, player)
for i=0, items:size()-1 do
player:getInventory():Remove(items:get(i))
end
-- add thread sometimes, depending on tailoring level
if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
local max = 2;
if nbrOfCoveredParts then
max = nbrOfCoveredParts;
if max > 6 then
max = 6;
end
end
max = ZombRand(2, max);
local thread = InventoryItemFactory.CreateItem("Base.Thread");
for i=1,10-max do
thread:Use();
end
player:getInventory():AddItem(thread);
end
end
ohh for some reason i thought it would be a lot harder
thank you so much @thin hornet โค๏ธ
Basements mod is released ๐ค
@heady crystal @worldly stone @cosmic condor
https://steamcommunity.com/sharedfiles/filedetails/?id=2849247394
Oooh
I'm wondering, how can I show a message above the character head without using :say() ?
I don't want to accidentally aggro zombies
wisper?
It's not the same, zombies can still hear it, and players too I'm looking for something completely client sided
so if I add a server command listener, how do I call that command?
the example here: https://github.com/asledgehammer/PipeWrench/wiki/Client-Server-Commands#client
shows how to add listeners for commands, but how is the onClientCommand triggered?
Maybe HaloTextHelper.addTextWithArrow? Something like the below...
HaloTextHelper.addTextWithArrow(player, getText("YOUR TEXT HERE"), false, HaloTextHelper.getColorRed())
@floral lodge
onSomeEvent.trigger(param1, param2, ...)
Thank you!
so it would be called within code, ok, thank you!
side note: I tried to speed up time on a server and clients basically desynced
I can figure that part out, but I'd like to just confirm if anyone knows it's possible :P
well server speed up when everyone is asleep might wanna check on that part
ah yeah true
I think I did it wrong before, so that each client was speeding up but the server itself wasn't
You can also do HaloTextHelper.addTextWithArrow(player, getText("YOUR_TEXT_HERE"),true, HaloTextHelper.getColorGreen()) if you want the arrow to point up (the true/false part)
but I think that's where the commands come in :)
can anyone help me out? i made a addon for true music and i want to add new songs to it mid save, how do i do that?
attachments on guns i add do not show up even though i have them set up as model parts and i set the attachment positions - i briefly had one showing up at some point but i cannot recreate that success
this is the x2 scope set parented to the "scope" point, so u can see it should sit there ok
then in game it's attached..
and yet..
and yes i've hit save, lol
world position for the gun works fine
from the file just to confirm
attachment scope
{
offset = 0.0040 0.0210 0.0790,
rotate = 0.0000 0.0000 0.0000,
}```
anyone?
hello i am trying to edit the values of a backpack but the values dont change in game it is from a mod
i change it with note pad plus but the values do not change in game do i have to do something else?
if you link the mod and tell me what you want changed I may be able to help you
but I will say, after you change the values that I would copy the folder of the mod into your mods folder at C:/users/yourusername/zomboid/mods
because maybe workshop is just changing the values back or something
@red rapids
also have you tried going back to the main menu and clicking reset lua at the bottom right?
that may update your changed values
i am changing the first aid bag from authentic z
capacity to 100
for SP
but i think this eliaz better bags mod is overwrriting it gonna test it without it
๐
it is still not applying
okay im gonna try this now
oh that'll work too
in game it says the function doesn't exist in the log...
{
DishCloth/DishClothWet,
Result : RippedSheets=2,
Sound : PZ_ClothesRipping,
Time : 220.0,
Category : Survivalist,
AnimNode : RipSheets,
OnCreate : Recipesplus.OnCreate.RipTowel
}```
it may be only in debug mode come to think of it, but I have it at the bottom right of the main menu, a little blue button
I'm gonna try doing that but if it doesn't work what else could I do?
@quartz cave I haven't done recipes before, but do you need to insert parameters into the function call?
This is the zomboid mods folder i dont know where to put the modified mod
so like: Recipesplus.OnCreate.RipTowel() or Recipesplus.OnCreate.RipTowel(items, result, player)
copy the folder of the modified mod to this folder
the same folder with the examplemod folder in it
ok
pretty much the first function works in game but the others don't... do they need a file per function or what am i doing wrong
drop it right there and reload game, then I would comepletely unsubscribe from the original mod so when you go to select it in-game you aren't confused on which one to pick
ok
I'd just look for any minor differences between the one that works and the one that doesn't, though I'm sure you've done that
cant i change the name?
yeah if you go into the mod info file you could
but just make sure that the original and edited mod aren't loaded at same time
i just did time to test
aight
Not showing in game
I thought it would be easy to just modify values lol
I was proven wrong
make sure there aren't spaces in any of the ids for the mod info
use camelCaseLikeThis or underscores_like_this
make sure your file is in lua/server/
it is :"(
mhm
can i have more then one function per .lua file?
It did showed up now, now to test if it works
:D
Display name still shows as the one from before but now I'm loading to see if the values changed
WORKED
woop
Thanks!!!
ok whatever you do don't touch anything looool
hopefully mod doesn't update and break it again
I was worried it wouldn't work, but glad it did, no problem
I can only get the first function to work....
function GetThread should work its from the base game...
function test , didn't work and function RipTowel is the one you send which also doesn't work....
idk whats wrong, i've been looking at the base games recipecode.lua for reference and such but im at a loss
this is all im getting
revolution are you using vscode?
yes
yes
yea
darn
๐จ
Recipesplus = {}
Recipesplus.OnCreate = {}
-- destroys ingredients on create
function Recipesplus.OnCreate.DestroyIngredients(items, result, player)
for i = 0, items:size() - 1 do
player:getInventory():Remove(items:get(i))
end
end
-- get thread sometimes, depending on tailoring level
function Recipesplus.OnCreate.GetThread(items, result, player)
if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
local max = 2;
if nbrOfCoveredParts then
max = nbrOfCoveredParts;
if max > 6 then
max = 6;
end
end
max = ZombRand(2, max);
local thread = InventoryItemFactory.CreateItem("Base.Thread");
for i = 1, 10 - max do
thread:Use();
end
player:getInventory():AddItem(thread);
end
end
function Recipesplus.OnCreate.RipTowel(items, result, player)
Recipesplus.OnCreate.DestroyIngredients(items, result, player)
Recipesplus.OnCreate.GetThread(items, result, player)
end
btw you can do this instead of repeating the code
try this idk if i fixed it vscode stopped complaining
ill try it now ๐
Is there any way to check if the player has hit a zombie?
I need to figure out the weapon used, the zombie hit, and obviously detect the hit lol
Events.onHitZombie
The speed of that reply was illegal
loool
Thank you though, you saved me like 10 hours of searching through code lol
hey @tranquil reef
here's an awesome tip
use this https://github.com/Konijima/pzpw
and search no more
to find that command, all I did was go into my editor, type hit, and the function for onhitzombie popped up
what did you change.... it works prefect from the looks of it
and I pretty much know how to use the tool after just an hour or 2
thats the thing, i have no idea what ive done
lolll
removed the test function, reformatted a bit
hey can you help with with something
if (enabled) {
checkIfTimeBasedTasks()
if (skipTime) {
setGameSpeed(3)
getGameTime().setMultiplier(20)
} else {
setGameSpeed(1)
getGameTime().setMultiplier(1)
}
skipTime = true
}
})
function checkIfTimeBasedTasks() {
for (let i = 0; i < getNumActivePlayers(); i++) {
let player = getSpecificPlayer(i)
let queue = ISTimedActionQueue.getTimedActionQueue(player)
if (queue) {
let current = queue[1]
if (current) {
print(current.type)
if (current.type != ISReadABook) {
skipTime = false
}
}
}
}```
this is flipping back and forth between game speed 1 and 3 and I feel like I'm missing something
I made a mistake somewhere
lmao, you are a wizard โค๏ธ
I'm probably just dumb but I don't fully understand what exactly it does nor how it works lol, but I'll look into it later
it's just making mods but better and easier :D
it just lets you program in typescript, along with easily finding function calls rather than searching for them manually
wow
I use visual studio, is it something you can just kind of plug in lol?
visual studio is much heavier than vscode
for this kind of work at least
would stilll work
no worry about it
both created by microsoft pretty sure it act the same way
but vscode has the tasks panel to run package.json commands
hi guys, any experienced modder available for hire?
$1M ๐
define experienced ๐
what do you want, out of curiosity?
some custom development for a server I want to build, basically I'd like to have pre-generated characters instead of allowing the user to build their own
sounds really cool and I'm sure its possible to do
but I'm not experienced enough sadly
im looking to build some sort of survival server where there's no respawn and last character standing receives a reward
i want to generate the characters myself and assign them randomly to users
basically have the game sync with my server and check which character is assigned to a specific user
ok, I'm trying to set the game speed for the server, but it doesn't actually do anything...
anyone have tips?
$1M
true
the length of the day?
nono
so... deleted few shit mods I didn't need and... my whole game is slowly falling apart?
like in singleplayer how you can speed up time
I gotta know
falling apart how
@unreal garnet more of a #mod_support question though
this is for mod development
want to call attention to my problem from earlier, attachments won't show up on custom guns: #mod_development message
I dont know what the issue could be but maybe you can see how its done in other mods?
maybe that could help you somehow?
that's the thing, i'm already doing the same thing as a known-working mod
heh
the only difference is that im patching my weapons into the attachments mount-on list during loading instead of overwriting the script file
but i have a hard time believing that that would matter, since it lets me attach them fine
it seems that speeding time is a java sided thing for the server side
i dont find anything exposed to allow you to do it
the only thing i can think of is when everyone is sleeping at the same time
and that is happening in GameServer.java but thats private
they send a special packet and then they syncTime
you could probably do your own fast forward using getGameTime() and setting time on the server using this and syncing clients with it
nevermind
lol
Can I request the developers or something somewhere to expose the function :P
or find a way
what exactly does the fast forward do in your thing?
cause logically if people are not sleeping it cant really fast forward
in single player when you fast forward and press a key it stop it cause you cant move if fast forwarding right
It just makes it so that when all players are doing a long term task like reading or working out then they can vote to fast forward until one of them finishes it or moves
Fast forwarding auto cancels when moving
That's super unfortunate, maybe there's a way for the clients to trick the server that they're sleeping? Then just making sure to reset their sleep where it should be
Hello guys. How are you ? Are your families ok? (vin diesel)
Well I created a Single Player and modified the lua file
lua/client/DebugUIs/ISSpawnHordeUI.lua
so that it would allow me to spawn zeds with a very large life like 999999999999
It works very well, however when I try to replicate in MP the zed just dies and disappears.
The maximum health I can add to a zed MP is 32.7....
Does anyone have any suggestions on how I can make an extremely strong zed?
Have you considered giving it something like an armor with 999999999 defence? Or edit his incoming damage to be 0?
I really hadn't thought of that.
Zombies do have special properties that affect their health and stuff, so I'm sure that you could set their stats that way
You should check how some special zombie mods handle different HP pools
Thank you for the tips. I'll try, especially put iron armor on the zombie
do armor stats that zeds wear affect them in combat?
speaking of that
or wud u have to fake it by adjusting hp/etc
never looked into that system
but curious
I never really looked into it
Well what I did was changed the zombie's life using /createhorde2
This command has an interface that is managed by lua I sent
why is this not running? everyOneMinute.addListener(() => { if (!isServer()) return; getSpecificPlayer(0).Say("it's running")
should this not have my character saying "it's running"?
I've also tried if(isClient()) return;
I need support from fellow experienced modders, how can i give to a ItemContainer a fake parent, so that I can set that parent to "locked/padlocked"?
I'm trying to improve my proximity inventory mod
function ISInventoryPage.GetLocalContainer(playerNum)
if ISInventoryPage.localContainer == nil then
ISInventoryPage.localContainer = {}
end
if ISInventoryPage.localContainer[playerNum+1] == nil then
ISInventoryPage.localContainer[playerNum+1] = ItemContainer.new("local", nil, nil, 10, 10)
ISInventoryPage.localContainer[playerNum+1]:setExplored(true)
ISInventoryPage.localContainer[playerNum+1]:setOnlyAcceptCategory("none")
ISInventoryPage.localContainer[playerNum+1]:setParent(IsoThumpable.new(getCell()))
end
return ISInventoryPage.localContainer[playerNum+1]
end
I tried this but im getting loads of errors
Using Typescript? ๐
Also, I think that you can play single player and both isServer() and isClient() returns false.
I'm not sure how getSpecificPlayer(..) operates in a single-player context.
yes I'm using konijima's tool
that why it's typescript
but I'm on a server playing by myself, not singeplayer
try printing?
try looping through all player indexes? idk if there's a case where you wouldn't be 0 if you're the only one but worth a shot
trying now
Could write a function that checks against player names.
this is a shared script im assuming right?
wdym
nope it's in /server ๐
is that bad
Loop through all players and do a string boolean operation.
maybe but how's that help me :P if looping through all players and using the say command doesn't work I'm not sure how looking for a name would do anything
not putting down what you suggested or anything, I might just not understand what you mean
Ehh. Thought you had an issue getting the right player.
ok looping through player index and using say not working
here:
everyOneMinute.addListener(() => {
if (isClient()) return;
print("running?")
for (let i = 0; i < getNumActivePlayers(); i++) {
getSpecificPlayer(i).Say("it's running")
}
can you even do a say from serverside? you probably can but i am a beginner so im not sure
You can use sendServerCommand and then hook into the event that ISChat listens to.
Strings sent to ISChat for Server messages prepend an identifier to handle it differently than normal text.
I just setup a command sent from server to client to talk
I think you can set the msg and timer for the chat instance without having to modify it.
though I am growing increasingly less confident in my ability to do things like that correctly
ok well that's not working either
maybe I'm just awful at this
on sec
client:
if (module == "setSpeed") {
getPlayer().Say("my time is set")
if (command == "speed=") {
getGameTime().setMultiplier(args[0])
}
return
}
if(module == "talk"){
getPlayer().Say("talking now")
}
})
server (not the entire file since that would be a lot)
if (isClient()) return;
print("running?")
for (let i = 0; i < getNumActivePlayers(); i++) {
getSpecificPlayer(i).Say("it's running")
sendServerCommand(getSpecificPlayer(i), "talk", "Yes") // send normally if server
}
if (enabled) {
checkIfTimeBasedTasks()
if (skipTime) {
getGameTime().setTimeOfDay(calculateFinalTime())
}
if(skipTime != prevSkipTime){
for (let i = 0; i < getNumActivePlayers(); i++) {
let player = getSpecificPlayer(i)
let speed = 1
if(skipTime){
speed = speedMultiplier
}
if (isServer()) {
sendServerCommand(player, "setSpeed", "speed=", { speed }) // send normally if server
} else {
triggerEvent("OnServerCommand", "setSpeed", "speed=", { speed }) // send hack for single-player
}
}
prevSkipTime = skipTime
}
skipTime = true
}
})```
Oh. You're talking about the player text above head.
for (let i = 0; i < getNumActivePlayers(); i++) {
const player = getSpecificPlayer(i)
player.Say("it's running")
// send normally if server
sendServerCommand(player, "talk", "Yes")
}
๐
getSpecificPlayer is for local players not all players connected to a server
split screen
Haha. Needs that good old documentation.
are you kidding me noooooo
You should be able to get all players.
A moment.
also I'll see if your thing works delta
getOnlinePlayers()
for (let index = 0; index < players.size(); index++) {
const player = players.get(index)
}
seriously super grateful, what a mistake loool
Not your fault. The API for PZ is full of these silly technicalities we've all learned over time.
ahhhh that's good to know ๐ค
hey awful news
The tools that you're using allows for documentation from other modders to be contributed to otherwise API without any documentation at all.
it didn't work
everyOneMinute.addListener(() => {
if (isClient()) return;
print("running?")
let players = getOnlinePlayers()
for (let index = 0; index < players.size(); index++) {
const player = players.get(index)
player.Say("it's running")
// send normally if server
sendServerCommand(player, "talk", "Yes")
}
If that's on the server, I don't think the .Say(..) method will work but I could be wrong.
right, but calling getPlayer().Say("something") in client should work
Correct.
if (module == "setSpeed") {
getPlayer().Say("my time is set")
if (command == "speed=") {
getGameTime().setMultiplier(args[0])
}
return
}
if(module == "talk"){
getPlayer().Say("talking now")
}
})```
You return if the execution is on the client so that code won't run.
hm?
everyOneMinute.addListener(() => {
if (isClient()) return;
sorry I'm a little new to modding
it's supposed to run on the server, and tell the clients to do things
that's why I'm doing the messages
Ok. Trying to understand your code.
are you saying I can prevent clients from even seeing the method?
anyway delta, to explain my code:
I want the server to tell the players when they should do something
so no client needs access to anything in the server file
if isServer() {
everyOneMinute.addListener(() => {
print("running?")
let players = getOnlinePlayers()
for (let index = 0; index < players.size(); index++) {
const player = players.get(index)
player.Say("it's running")
// send normally if server
sendServerCommand(player, "talk", "Yes")
}
}
๐คฆโโ๏ธ that makes sense
would give you an example on how to do that kind of server client communication but its lua
well tbf itll be mostly the same
yeah the typescript and lua are just about the same
You write TypeScript now? ๐
very similar, typescript is just a bit easier to use
nah i much prefer lua
Ah. Yeah. Experienced Lua modders don't need TS.
too bad I'm not experienced :P it also just looks neater to me though anyway
can be an experienced lua modder and still not know how to properly write lua
lollll
do agree most people should use the ts transpiler
When I'm not busy, I'll be writing documentation for the PZ API.
A tool for documenting the TS stuff.

lua can be very particular with its code the transpiler does everything for you
speaking of typescript im having issues with adding to the distribution tables:
import { getGlobal } from "PipeWrench-Utils"
let ProceduralDistributions = getGlobal<KahluaTable>("ProceduralDistributions");
// Add it to the same parts of the distribution table as the WeldingMask
table.insert(ProceduralDistributions.list.ArmyHangarOutfit.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.ArmyHangarOutfit.items, 1);
table.insert(ProceduralDistributions.list.CrateMetalwork.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.CrateMetalwork.items, 2);
table.insert(ProceduralDistributions.list.CrateRandomJunk.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.CrateRandomJunk.items, 0.6);
table.insert(ProceduralDistributions.list.GarageMetalwork.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.GarageMetalwork.items, 4);
table.insert(ProceduralDistributions.list.MechanicShelfOutfit.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.MechanicShelfOutfit.items, 5);
table.insert(ProceduralDistributions.list.MetalShopTools.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.MetalShopTools.items, 3);
table.insert(ProceduralDistributions.list.ToolStoreAccessories.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.ToolStoreAccessories.items, 3);
table.insert(ProceduralDistributions.list.ToolStoreMetalwork.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.ToolStoreMetalwork.items, 2);```
same thing works in lua but gives me an error here ๐ค
any idea? looks like it's having problems getting the global var itself
my favorite thing with typescript is how crazy easy it is to find functions
Wouldn't know. Maybe @thin hornet knows.
yeah I like that part too. and I'm much more familiar with js so it's easier for me lol
yeah i just have bothered Konijima so much lol ๐
believe it or not I never liked javascript
Lua tables are a WIP with PipeWrench.
but I'm liking typescript with this
ahh gotcha that makes sense
You can write your own typings ontop of PipeWrench's typings to fix missing table stuff if that becomes an issue for right now.
The white paper for PipeWrench actually shows how to do this.
yeah i saw that on the wiki page as well, i guess in this case I'm just confused what it's actually missing
how'd you eventually do it?
idk :D
literally got no clue what fixed it
When I restarted the server it was fixed, for some reason reloading the scripts just wasn't doing it
Sooooooo PZ doesn't use Lua modules. The Lua example here uses modules.
The ISUI.d.ts example is simply wrapping and defining the module that you return with the ISUI.lua file.
It's basically mapping pre-existing Lua code.
ahhh I see
i feel like i will definitely encounter something like this in the future so thank you!
Packaging basically.
No problem.
Think of PipeWrench as one giant phone book directory.
this is what i was referring to when writing it since there already seems to be wrappers for these functions: https://github.com/asledgehammer/PipeWrench/wiki/Creating-Items-Distribution
Interesting ๐ค ! It will probably take a bit for me to see it that way haha
No worries.
also I think I can confirm that player.Say() doesn't work from server ๐
Would be fun to rewrite the entire ISUI library in Typescript.
that would be pretty cool
It'd fix some mistakes in there with overloading property signatures in the Lua tables for classes.
Also ambiguity with table structures like joypad data, UI-specific metadata, etc.
sounds like it would be a bit of work as well
Reusability to prevent copied / wet code.
I'd say that PipeWrench is best with scalability.
has anyone used the new fluid system in the latest update to make a purple drank lean mod?
i thought the fluid system was build 42 stuff
just spent 15 minutes debugging because I didn't notice my "enabled" variable was set to false by default ๐ญ
@jagged ingot there is a problem with lualib_bundle.lua substring method
im trying to fix bugs in basement mod but i cant even reproduce them so its HAARDD
some people experience the bug on new and existing savegame
like the map is not loading so its void
but like i cant reproduce that, map always load for me
weirddd
yeah i can build a basement and enter it normally with no issues
actually wait i reproduced it by adding a basement on an old save
@jagged ingot can I send you a dm? I have some modding questions and Iโd really appreciate your guidance ๐
yeah somehow the map wont load in an existing save even if you never went there, so weird
new patch changed lots of map stuff i guess
so the issue i'm facing is from lualib_bundle.lua for pipewrench and it occurs when __TS__StringSplit makes a call to __TS__StringSubstring(self, start, ___end) but without a third param
out[count + 1] = __TS__StringSubstring(source, index)
end```
and then `__TS__StringSubstring` freaks out cuz there's no third param when it tries to do this i guess?
`return string.sub(self, start, ____end)`
im sure that made no sense tho lol
okay my b for spam but i got it to work by adding a check in __TS__StringSubstring:
____end = -1
end```
if anyone else happens to have this problem when accessing ProceduralDistributions in typescript
there's prob a better way to do it but it worked lol
This might be a silly question but... I'm working on fixing the item distribution for an outdated mod I want to use. I found a way to add items with table.insert but I want to verify my code by observing the loot table. I found LootZed in the debug tools and I've been using that. Unfortunately you need the container to already exist to observe the table. There are tons of containers I either can't locate or spend an hour or more teleporting around the map before I find. Additionally lootzed seems to be completely ineffective for observing vehicle and zombie loot tables. I wanted a more direct way to observe loot tables and found ItemZed by turbotutone but it looks like it's a few years old at this point and I couldn't get it to work. https://theindiestone.com/forums/index.php?/topic/21923-itemzed-updated-11b/ Does anyone know of an easy way to QA loot table adjustments?
fwiw I'm working on updating https://steamcommunity.com/sharedfiles/filedetails/?id=2371410264. This mod adds a recipe magazine and two tools. I have successfully added all three to a few very common containers but I wanted to be more thorough.
im having the same issue it will be resolved soon
Did you ever figure it out? I was thinking maybe the scale is off or something like that
I'm way over my head here but the only difference I notice between our distribution updates is that I also have require Items/ProceduralDistributions. I'm not positive I even need it but I'm modifying code I didn't write and wasn't sure what I could scrap.
yea you need this file I believe. I have it setup like that
what are you trying to add?
Me? or Gilbz? I've successfully added a recipe magazine and a few tools. I'm looking for a better way to verify they're in the right containers.
you, and I think you just need to use the debug and teleport around to see how common it is and if it spawn in the right places
I was really hoping for a better tool than that but if that's the best we have ๐ฆ That's what I've been doing.
Its the only way I know...
its probably easiest to make it spawn 100% in the right container
and then change the rarity
debug mode has a tool called lootzed that shows you everything that can spawn in a container and it's spawn chance. I just can't find some containers.
what container can't you find? @novel barn
Ooo yeah donโt worry youโre using lua so what I was talking about doesnโt apply
I gave up looking for GarageFirearms after spending close to 2 hours hunting. I also spent some time looking for Hunter which I assume is a zombie spawn. However lootzed doesn't work very well with vehicles and zombies.
do you have the distribution.lua?
for the mod or for the base game? I have both open.
I'm not completely sure what you're asking but I understand what you were asking now. You meant for me to literally look in GarageFirearms appears to be its own category in ProceduralDistributions.luaDistributions.lua not proceduraldistributions. I do see that GarageFirearms is in the proclist of locker.
Was I wrong assuming Hunter was an actual zombie?
Incredible. Yeah I've seen a ton of antique crates. I didn't realize Hunter was in that pool as well
I got lazy with Hunter because I had already given up on GarageFirearms
I think the Garagefirearms is the weapon locker in a garage/secure storage
I looked at just about every locker I could find in Louiseville and a few in Muldraugh and they were always a different kind of weapon storage. I appreciate the help but I think I'm going to head to bed. If I ever stumble across this container I'll be sure to let you know!
I'm happy I could help you somewhat haha, goodnight maybe with a fresh head it will come together ๐
Is it hard to make zombies 'say' something? Like show text above their head?
Because I've tried :say and either I'm doing something wrong or that's not the way to do it
coming soon
nice!
The :say checks if the character is a zombie and doesn't do anything in that case.
Try addLineChatElement instead
How do the tiles rotate when the vehicle moves? ๐คฏ
That sounds like a stupid check. But fair, if that's what's needed, I'll try that. Thanks for the tip! ๐
Q: I'm new to modding Zomboid. And I'm trying to update an old (Build 40) mod so it's no longer broken. I think I've figured out how to fix it. But I'm wondering:
If the old mod is both broken and abandoned, then is there any issue to releasing my updated version with the same Mod ID?
Would that cause a problem? I mean, is there any advantage to changing the ID in that case?
You might wanna make a new ID like TC_originalIDhere
I think that's best
I also don't think it lets you use the existing ID when uploading
Unless there is some very good reason to do otherwise, please don't use existing mod IDs for workshop uploads. It causes no ends of issues with MP server file mismatches.
๐
I'm bumping this, can someone advice me regarding this?
I'm looking to have this working in MP too
This looks AMAZING!
what question?
๐
how do i overwrite or change a lua variable
be more specific
i want to change daySruvived
do i just overwrite it?
i want to change the variable daySurvived to something else
under AttachedWeaponDefinitions
for assaultifleonback
so itd be something like
you edit another mod?
what mods?
what does daySurvived do?
id = "assaultRifleOnBack",
chance = 5,
outfit = {"ArmyCamoGreenMale"},
weaponLocation = {"Rifle On Back"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
weapons = {
"Base.AssaultRifle",
},
}```
it only spawns that attached weapon
after you have survived that specific number of days
i want to change the number from 0
how do i do that
basically you can just change it
its not a table
uhh
yea i can change it on my end but im making a mod to connect 2 mods together
but if you want your friend to have the same effect that you edited, you have to create a new mod
is there a function to change that variable
yea im doing that
can i just overwrite it
just change 0 to whatever you want?
well, we don't know what control those variables
you better just change it and give it a test to see if it works
ill ask around a bit more
im just trying to edit the variable
its a variable you declare on your own, nothing controls the variable
How do i make submenus within context menus?
nvm
this is a table
i just have to uh
nvm
i still have no idea if im doing it right
so assaultRifleOnBack is a table itself
im trying to change the index of chance and days survived
table.insert(AttachedWeaponDefinitions["assaultRifleOnBack"].chance, 20);
could i just write this
does it overwrite or add to the old value
require "Definitions/AttachedWeaponDefinitions"
AttachedWeaponDefinitions.assaultRifleOnBack.daySurvived = 420 -- whatever number of days you want it to be
should work
missing semicolon?
or do i not need one
lol
It is an integer and is the number of days since the start of game.
Can someone point me in the direction of a link or forum post or something to explain in detail how to use the table.insert and table.remove LUA functions (particularly table.remove)?
Well, examining the code inside certain mods, I think I've got something of a grasp on table.insert.
Like so:
table.insert(ProceduralDistributions["list"]["ClassroomDesk"].items, "MAG.Actionmanga");
table.insert(ProceduralDistributions["list"]["ClassroomDesk"].items, 2.0);
local myTable = {
"im index 1",
"im index 2"
}
--- table, indexToRemove
table.remove(myTable, 2)
myTable is...?
what ever table you pass to it
table.remove(RemoveItemFromDistribution["all"]["ClassroomDesk"].items, "base.VideoGame");
table.remove(ProceduralDistributions["list"]["ClassroomDesk"].items, "base.VideoGame");
which to remove from ClassroomDesk?
@short fulcrum
example
--- remove videogame from ClassroomDesk
RemoveItemFromDistribution(ProceduralDistributions.list.ClassroomDesk, 'VideoGame', false, true)
--- remove videogame from all ProceduralDistributions
RemoveItemFromDistribution(ProceduralDistributions, 'VideoGame', false, true)
So, IsoThumpable is setExposed in the java\Lua\LuaManager.java
Then why I can't create one in lua ๐ฆ ?
I'm trying to make one in memory, but I don't want to place it anywhere in the world ๐
quick question, not sure if anyone can help me but can someone direct me to a mod guide for making guns. Iโve made the models and looked online but all the tutorials are outdated
are there any mods that give traits that are a little unbalanced? a little op?
i haven't dabbled with the typescript stuff. Is it smart enough to figure out that the call needs to be with a colon in the lua? does it know what to use for all the different functions?
i dont use ts i simply changed the code they posted
I'm still scrolling through messages but incase someone hasn't said, the reason why it doesn't work is that when you reload a lua file from the f11 UI, it doesn't reload lua files on the serverside when playing MP, just the client. there is a command you need to use to tell the server to reload some file. can't remember it exactly rn, but you can probably find it from this channel. also the event stuff has some funny business with regards to loading in MP, so sometimes you need to restart to fix it properly
couldn't find a great example from vanilla, but I compile a more simple one from another mod.
Hydrocraft.doBuildMenus = function(_player, _context, _worldObjects)
local player = _player;
local context = _context;
local worldobjects = _worldObjects;
local HcMenuOption = context:addOption("Building", worldobjects); this adds a new option to the right click context menu
local HcSubMenu = ISContextMenu:getNew(context); <-- this creates the new context menu object
context:addSubMenu(HcMenuOption, HcSubMenu); <-- this associates the created submenu with the new option that was added previously
Hydrocraft.BuildOptionGlassRoof(player, HcSubMenu) <-- this calls a function that will populate the submenu with options
end
Hydrocraft.BuildOptionGlassRoof = function(player, HcSubMenu)
local option
local tooltip
option = HcSubMenu:addOption("Glass roof", nil, function() Hydrocraft.onBuildGlassRoof(player) end); <-- this is the line that add the new option to the submenu. The third field is a function that you want to call, if the player clicks on the submenu. you can leave it as nil, if you just want to display info when hovering over the option
tooltip = Hydrocraft.toolTipcheck(option)
tooltip:setName("Glass roof") <-- the following couple lines affect another window that displays the following text. you can use more complicated lua to make it more dynamic if you want
tooltip.description = "<RGB:1,1,1>Welding Mask <LINE>Propane Torch <LINE> Steel Rod: 2 <LINE> Glass Pane: 1"
tooltip:setTexture("roofs_02_55")
end
local function func_Init()
Events.OnFillWorldObjectContextMenu.Add(Hydrocraft.doBuildMenus)
end
Events.OnGameStart.Add(func_Init)
im not sure if you can make like a virtual isoThumpable what doesn't belong to a square as it takes a square and sprites as parameters. from the lua you can see isothumpable being used.
local cell = getWorld():getCell()
self.sq = cell:getGridSquare(x, y, z)
self.javaObject = IsoThumpable.new(cell, self.sq, sprite, north, self);
what exactly are you trying to achieve with a virtual isothumpable? doesn't it kind of defeat the purpose of being thumpable if it doesn't exist in the world?
I'm getting this error when trying to upload my mod. Can someone help? I also attached the files tree
If something has the Cosmetic = TURE, Tag, what does that function mean, and or do?
Nice!! looking forward to it -- maybe swimming goggles could be used?
To swim?
i did not, and i decided that the models were too high res and decided to go learn 3d modeling, but i've made my first gun and will be testing with this model now 
another modder told me that if you use more than one texture per model it can cause issues with attachments, turned out to be model declarations rather than the actual mesh, but that wasn't my issue
Hello
Does somebody knows what the different parameters of the drawTexture() function means?
I'm trying to add a custom moodle to my mod and I have been reading other mods code to see how they do and all use the drawTexture() but I can't make the game draw anything 
Are you drawing inside a ISElement? Inside prerender
also image has to be a png
Hmmm you mean this?:
DTOverdoseMoodle = ISUIElement:derive("DTOverdoseMoodle");
Yes it is a png
To be honest this is me right now. I have been doing modding mostly related to IsoGameCharacter since I started so everything that's related to textures I have no idea how it works, trying to understand it now ๐คฆ๐ปโโ๏ธ
๐
Hey all ๐ does anyone have some up to date links/resources on how to add custom categories for the crafting menu by any chance ? Tried to add "Category=XXXX," in my recipe but since it doesn't work I'm assuming I would have to tell PZ that said "XXXX" is actually a category first, right ?
it would be in the translation files
IGUI_CraftCategory_Fishing = "Fishing",
so you would create this in your mod media\lua\shared\Translate\EN\IG_UI_EN.txt
and add your own translation for each new category you create @cobalt arrow
IGUI_EN = {
IGUI_CraftCategory_MyCustomCat = "My Custom Category",
}
Thanks a lot @thin hornet , really appreciate it ๐
does anyone knows whether the vanilla game by default respawns cockroaches, dead mouses and dead rats which can sometimes be found in trash cans or various containers?
whats the name of the zombie sting file?
looks at CyberCow2077

the violin sting?
not sure off the top of my head but there's a mod that removes it which should make it real easy to figure out
something along the lines of "no violin sound"
probably replaces it with a blank file
@steady herald
this one
how would it be easier to find in the files? lol
because the mod will contain one file
fair point
someone also needs to explain why stuff like this are in the files
found it
stab 1 2 and 3 are the culprits
now my dastardly plan can begin 
Thank you, I tried but yeah, I can't make it virtual ๐ฆ
Oh aye
I shouldnt make mods when tired
But thats when i get the most autistic ideas
I'm looking for help regarding my mod, I can't keep items highlighted without having to use the onTick,
Without onTick they blink a lot
Problem is on some PC using ontick kills the FPS, how can I make this work without having to rewrite the entirety of ISInventoryPage:update?
I was thinking about checkingif the user is moving or something, in that case I could avoid invalidating my container cache
made a quick PR for something unrelated to your question
https://github.com/mxswat/pz-ProximityInventory/pull/4
Now for your question I think you have to highlight object in a loop all the time cause somehow they are highlighted every tick.
Safehouse does the same when selecting the custom area in the render function.
is there really a big fps drop when highlighting a couple boxes?
Hello guys. Goodnight.
I need to see a zombie's inventory.
I'm using the DoomZombies mod as a base, I'm studying how the mod structure works.
I'm trying to use this function, but it's throwing an error. How can I check if this function exists in this "variable"
local bool_scanner = corpse:getContainer():contains("ScannerModule")
Well I tried to create a variable to understand if it works like boolean
This appears to be generating an error.
local container = corpse:getContainer()
local scanner = container and container:contains("ScannerModule")
if scanner then
end
Thanks
Hi, I tried to make the change you suggested but I still can't
move it in there
you still need to check if the corspe is a corspe
if that still dont work post the error from the console.txt that will be more detailed
Right
So, I purposely removed this IF because it is not working as expected.
And I'm just picking up zombies from the ground. However, I will modify as you recommended
give me more info, more code and more error log ๐
Ok, ok
Basically I'm trying to read a zombie's inventory.
The idea is, when a player picks up the body an action occurs.
The action would be to check if the zombie has an item in the inventory
I'm using a mod as a base, to create this function
But I notice that some functions are not working as expected, maybe the mod hasn't been updated over time
so you are hooking into function ISGrabCorpseAction:perform() ?
local original_ISGrabCorpseAction_perform = ISGrabCorpseAction.perform
function ISGrabCorpseAction:perform()
print(self.corpseBody) -- exist
original_ISGrabCorpseAction_perform(self)
print(self.corpseBody) -- dosn't exist anymore
end
Not exactly, I'm using the event:
Events.OnContainerUpdate.Add(jiangshifuhuo)
but you want to do something during the action of picking up a dead body?
Yes, exactly
I want to see if inside the body there is any specific item
local original_ISGrabCorpseAction_perform = ISGrabCorpseAction.perform
function ISGrabCorpseAction:perform()
local container = self.corpseBody:getContainer()
local scanner = container and container:contains("ScannerModule")
if scanner then
print('i found scanner in the corpse inventory')
end
original_ISGrabCorpseAction_perform(self) -- corspe is now deleted and is just an item in the player inventory
end
what you see here is a way of adding code inside an existing function without overwriting the function, i call this hooking
by looking at the original function you can see what you have access to using the self variable
we then call the original function and pass its self so that the original function execute. You can execute it before or after your own code addition.
in your case you can see in the original function you have access to the corpseBody being picked up.
you can also see that the body will be removed and deleted after the execution of this function.
Hooking the clean way
local original_ISGrabCorpseAction_perform = ISGrabCorpseAction.perform --- this save the original reference of the function
function ISGrabCorpseAction:perform() --- now we are overwriting it
original_ISGrabCorpseAction_perform(self) --- when ready we call the original reference and pass the 'self' back to it
Hooking into a method that return something
local original_ISGrabCorpseAction_new = ISGrabCorpseAction.new --- this save the original reference of the function
function ISGrabCorpseAction:new(...) --- now we are overwriting it
local o = original_ISGrabCorpseAction_new(self, ...) --- we call the original reference and pass the 'self' and other parameters and get the original result
o.something = 123 --- we change what we want here
return o --- we don't forget to return it
end
Now that you know this, there is over 150 timed action you can hook into ๐ค
doesnt work
I'm reading, but I already see that this will help a lot
Thank you very much!!!
Ahh I understand and it worked as I wanted.
you are a demigod
Anyone know where the script for washing clothing is in the base game files? As in, the one that calls the timed action, not the timed action itself
\media\lua\client\ISUI\ISWorldObjectContextMenu.lua
Thank you
can someone make a screamer zombie mod please!? id pay!
https://steamcommunity.com/sharedfiles/filedetails/?id=2811259189 this one is not what you want?
its almost perfect, the screamer is super jank, skeleton of the model is corrupted and the screamer teleports
its broken but would be cool if it worked
thats basically the same thing as customizable zombies
You should make a YouTube clip to advertise that it's not the same. ๐
your mods are cool
oh wait now i see but can you edit the chance of it spawning in?
it doesnt seem so
thats a major deal breaker the fact it has all the other variables but not that
I hope everyone can see your mod collections
I don't want to ruin the surprise, hahaha and I know its in the description but most people don't read mod descriptions ๐
there's a reason for that
thank you โค๏ธ
I guess everyone that plays MP is always surprised by the mods that the server owner puts on a server
?
cdda zombies has one too
It doesnt seem to have much customizability
Looks cool tho
so what exactly are you looking for? you only said you wanted a screamer 
Screamer and variable customization. So many good mods are ruined due to not being able to adjust them๐ฅ
what kind of customization?
Simply just the spawn chance
ah, I could add that in my mod, but you probably will hate the other features it has๐
Aslong as i can 0 them out and and only let the screamer spawn in that would be awesome
I have sprinters at 13% so i wan a keep it that way
So you are using other zombie mod?
Anyone know why I keep getting this error? ๐ญ
Trying to post my first mod but Iโm new to all this โฆ
first time seeing that error, seems that you are missing some folders? it should be like /Contents/mods/yourModFolder
its look fine, idk 
I know how to take a screenshot ๐๐
I just took these pics cause I was in a hurry ๐๐คฆ๐ฝโโ๏ธ
I canโt for the life of me figure out what Iโm doing wrong โฆ๐ค
double check that there aren't any hidden files in any of those folders
I trying to make traits which:
1.Allow you to add or siphon gas faster
2. Make campfires faster, fuel to campfires faster.
Anyone can give help me with? I tried to modify timeactions but not working. :c
Customizable zombies
modeled a simple pair today and they work! also added a sandbox option so you can have your vision tint when you wear them or a welding mask but that's up to you. I need to alter the model for the male model and clean stuff up but I'll post it soon!
How do I change a traits icon ?
I checked the files but only 4 trait icons are shown and I really have no idea how to change them
vanilla traits btw
Is there a guide or tutorial on how to repack mods for a server? I'd like to reduce my 170 mods into something manageable for my friends. I have a collections page set up already but I'd like combine things that are abandoned, etc.
also is there anything like AMUMSS (No Mans Sky mod conflict merger) for PZ?
you more or less just take all the mods and merge their media folder, and reupload it. You should ask for permissions though. there technically isn't a rule against it but is very disrespectful to do so without perms. and alot of mods anyways don't give permissions for that stuff. why do you want to pack them anyways? it doesn't really make much of a difference from just subscribing to a collection
thank you, ill try it out and see if it works. I would probably only merge mods that weren't active and would credit them anyway. It's mostly so my friends don't look at the modlist and say "what the fuck, 160 mods?"
just btw crediting is nice, but still not the same as permission
Yeah I wouldn't be packing mods if they forbid it and I'd ask permission if they required it, no worries.
hi, there is a function to add to a recipe to give no result?
add removeresult=true to the recipe, and it will remove the result
then basically the result item specified only provides the png for the recipe
thx!
I want to dismantle an item into more than one parts, is it necessary to make a function oncreate or can I just put them all in the result?
yeah you need to use an oncreate if you implement it as a recipe. there isn't any other way to get multiple items from a recipe
ok weird, I have moveable item full type "mymodule.myitem" but when I place it and pick it up it has fulltype "moveables.spritename"
PS: finally figured where to set the mysterious customitem
is there anyway to trigger an in game event like the jumpscare? for somereason im having a hard time getting it to happen lmao
Metalworker
something like that should work
getPlayer():getEmitter():playSoundImpl("ZombieSurprisedPlayer", nil)
how do i do that in game?
i tested it, it works just use that line anywhere you need to use it
replace getPlayer() by the correct player object as needed (for splitscreen support)
errrr
how?
how do you access debug console?
ah cheers me dears
well crap
my mod didnt work
thought i followed the pathing pretty well
is that not the correct pathing for a sound mod?
what about your scripts?
i have to add scripts too? even if its just changing the sound effect?
when you load a game, does it show any of the files from your mod being loaded?
no idea
@wooden falcon hey mate
for ChangeSandboxOptions2
can you add this line getSandboxOptions():toLua() for the new settings to apply directly please.
{
sound HeadSmash
{
category = Zombie,
clip
{
file = media/sound/stab1.ogg,
}
}
sound HeadStab
{
category = Zombie,
clip
{
file = media/sound/stab2.ogg,
}
}
}```
are you sure thats the right one? cause im trying to change the jumpscare sound effects.
weird they are called stab tho
sound ZombieSurprisedPlayer
just add this into a script folder in a txt file called script.txt?
yes. also, your folder should not contain any space to avoid problems
like so?
better rename it to something more unique to avoid overwriting
alright
ill update the mod and try again
nyet
still plays the original sting sounds
you can download any jumspcare mod on the workshop and see its code
check what you did wrong
can figure out yet?
will momentarily
just renaming everything
....
@cosmic condor
i forgot the s on scripts
folder? lol
yep
renamed and it works
thanks for the help
and thank you @thin hornet for the debug line
now you've learned, and you will remember this forever lol ๐
probably tags from a sound library, royalty free or paid
i mean why are they unused
id love our character to go insane and hear whispers
I guess it was used before, maybe too annoying so they removed it?
give it a week lmao
theres also 4 random cut screams
finally
my first pz mod
odd ive only modded zombie games...
congratz, you are now a modder ๐
for pz. been a l4d2 modder for a while
thats why i had a bit of issues lol
finally, the mod we needed

the first of many mods to come
i wanna try and add my artwork into game next. just to hang them up on stream
Does any one take commissions out here?
I understand mods arnt easy but like no one wants money lol
i can do a terrible job for ยฃ1000 
Atleast ur honest
Lets convert that into yen
171,266.02 yen
but im nice
lets make it 171,267
just to round up
kinda curious tho @dark finch what ya want commissioning?
Special infected zombies
Tbh im pretty picky but i just hate the design choices of most of whatโs currently available which is barley much at all.
ahhh
Is there a way to check the skin color of a zombie?
use getHumanVisual() on the zombie
Alright, thank you
Anyone familiar with UI?
Trying to add a combobox to a window and its just not appearing
combobox is the one with a drop down right?
A drag and drop UI editor would be amazing
I take back everything bad I said about mapping
UI is way more tedious
self.assignComboBox = ISComboBox:new((self.width/2)-50, (self.height/2)-1, 160, 22, nil, nil, nil, nil)
--self.assignComboBox.internal = "ASSIGN"
self.assignComboBox.borderColor = { r = 1, g = 1, b = 1, a = 0.4 }
self.assignComboBox:initialise()
self:addChild(self.assignComboBox)
self:populateComboList()
printing if it exists works, and there are no errors
What code defines an item so that you do not cut your hands when picking up glass?
is that code inside createChildren() ?
not at all ๐
this I how I did it some time ago, looks similar to yours
self.bountyRewardCombo = ISComboBox:new(bountyTitleX+70, bountyTitleY+140, width, 20)
self.bountyRewardCombo.font = UIFont.Small
self.bountyRewardCombo:initialise()
self.bountyRewardCombo:instantiate()
self:addChild(self.bountyRewardCombo)
self.bountyRewardCombo:addOption("Muldraugh",{})
self.bountyRewardCombo:addOption("Westpoint",{})
it's inside of a initialise()
well it should work anyways, hard to know with just that piece of code
but feel free to DM me if you need help with that ๐
i have encountered the strangest error with my gun mod. when i mouse over the gun in my inventory the popup panel of info just says the gun name then some blank space below it, and errors are constantly thrown out while i'm doing this. if i right click the gun I get only a partial context menu, equip/unequip, drop, and insert magazine iirc
the insert magazine does not know what magazine goes in it, and is always red with no tooltip
in the log it says that it can't run getDisplayName because the result of getting the item is null
does this for a few different things that cause the error, mousing over it and right clicking generates the one
i feel like it has something to do with the magazine due to this
the assignment in the gun script is
it is defined as
{
CanStack = FALSE,
Weight = .6,
Type = Normal,
DisplayName = PPSh-41 Drum Magazine,
Icon = PPShDrum,
MaxAmmo = 71,
AmmoType = Base.762Bullets,
WorldStaticModel = PPShDrum,
}```
(the module is UdderlyGuns)
the kicker is i have a drum magazine and it exists and has no issues with the tooltip/etc.
so perhaps that's a red herring
the locations the error occurs in
function: render -- file: ISToolTipInv.lua line # 108 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 593 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla```
guess i'll poke through those when i get back and see if there's any hints in the context
turns out i had a comma after the item name on the item script, somehow - bet that's it.
scripts sure could use a parser that did some form of error checking
Is there a mod for trading? or stores?
yeah noir made a store mod that's public
and bikinihorst has a vending machine/shops mod that's less player-controlled
included as part of his PARPChat mod
wrong channel tho
this would be more #pz_b42_chat or MAYBE #mod_support
Thx
it was
I really need to write that GUI application for scripts.
I keep coming back here and seeing these issues costing people a lot of time they could've spent working on their mods. =/
Still on my TODO list.
Did anyone try to make a weapon with PiercingBullets = TRUE and MaxHitCount > 2? If yes, did it work for piercing more than 2 targets?
Asking because I'm trying to make something like a railgun that would pierce like 5+ targets in a straight line, and even if I spawn a ton of zeds, the aim cone debug doesn't ever show more than 2 targets for a weapon that I'm pretty sure I've set MaxHitCount correctly
i just had the best idea but i dont know if it would work
anyone know the code for pressing q?
Is there a mod that will, like, quarter the amount of cigarettes that spawn in the world? Or at least makes Smoker less OP?
you could probably go to Smoker distro table and reduce values further yourself i guess
also Lucky quite twists up Smoker if you're into too much "realism" thing
if i wanted to change the sound that plays when you die would i change it from event to the sound file. or do i add it to the sound
local key = _keyPressed; -- Store the parameter in a local variable.
print(key); -- Prints the pressed key to the console.
-- We test if the correct key is pressed.
if key == 12 then
local player = getSpecificPlayer(0); -- Java: get player one
local inv = player:getInventory(); -- Java: access player inventory
-- Java: add the actual items to the inventory
inv:AddItem("Base.Axe");
inv:AddItem("Base.Katana");
inv:AddItem("Base.Bag_Schoolbag");
inv:AddItem("Base.Garbagebag");
inv:AddItem("Base.Bag_FannyPackFront");
end
end
Events.OnKeyPressed.Add(addItems);```
what am i doing wrong here? making my first code following robomats old 2013 guide since i can't find updated guides..
i just enabled the debug menu and it doesnt seem like it's printing anything
yes i set it up in client
what directory did you put the mod in? is it set up correctly?
but i did base everything off of a 2013 guide so i'm not sure its accurate
easiest thing for me was to download some mods off the workshop and then study those
and also look at the prexisting lua/folder structure from the actual game
that is what i've been trying to do, but i havent found one that lets you add to inv with a keypress
for adding stuff to player's inventory, I think you need sth like this:
local item = InventoryItemFactory.CreateItem("Base.Axe")
inv:AddItem(item)
i have it set like this
okay thanks i'll test it out
just the first thing which came to my mind. but still possible that there are other things in code which may not work...