#mod_development
1 messages ยท Page 157 of 1
I've seen this question a few times so I'd assume it's not possible atm.
What kind of texture
Just lil icons for the ui
I could be absolutely wrong.
Nope idk..
I only know you can change them with doparam but thats not helpful at all to your situation
And you can scale it
Ah wait sorry ui
I thought item
Hmm i think burryaga has something related to this
Its not a big deal, just a workflow optimization for the future
any way to give a player fully loaded magazines for guns?
or does it have to be ammo + magazine separately
Yes
yes to which one
If you have a gun equipped on primary hand
This will fill up its ammo
local pr = getPlayer():getPrimaryHandItem()
if pr and pr:isRanged() then
local mag = nil
local gun = getPlayer():getPrimaryHandItem()
if gun:getMagazineType() then
mag = InventoryItemFactory.CreateItem(gun:getMagazineType())
mag:setCurrentAmmoCount(gun:getMaxAmmo())
getPlayer():getInventory():AddItem(mag)
if not gun:isContainsClip() then
ISTimedActionQueue.add(ISInsertMagazine:new(getPlayer(), gun, mag))
end
else
gun:setCurrentAmmoCount(gun:getMaxAmmo());
end
getPlayer():getPrimaryHandItem():setRoundChambered(true)
end
Posted on team orbit discord
Debug code library
For server admins to easily setup events
Since its tedious to look for magazine pair
For bunch of guns you need for events
this still looks like you're queueing up the "insert bullets in magazine" action though right?
i want to make a scenario where u start out with a bunch of loaded magazines but it seems like there's no way around having to actually load the mags in-game
scripted or non scripted
Nah try it
If you just need the mag
You can reverse engineer this
Just take the syntax
Saves you time looking for stuff
Everything for that function u need
Written there
Except maybe which mag
You need to replace the getMagazineType()
...he wants to SPAWN with magazines already fully loaded
when you spawn into the game you have nothing equipped in primary
so that script doesn't work for what he wants
.. I think you're confusing this modder.
Sending another snippet thats not what you need but has what you need
Ahh am i
Sorrry
Im on mobile i cant fix the code
If you have an answer and would like to present an example, clearly explain it or let someone else help.
You certainly confused the heck out of me.
lol
lol
function InsurgentWeaponUtil.addMag(player, magName)
local mag = player:getInventory():AddItem(magName)
mag:setCurrentAmmoCount(mag:getMaxAmmo())
return mag
end
function InsurgentWeaponUtil.equipAndFullyLoadWeapon(player, weapon, magName)
local mag = InsurgentWeaponUtil.addMag(player, magName)
mag:setCurrentAmmoCount(mag:getMaxAmmo() + 1)
InsurgentWeaponUtil.equipWeapon(player, weapon)
ISTimedActionQueue.add(ISInsertMagazine:new(player, weapon, mag))
end
What do i type for syntax highlight again?
Thats how insurgent does it
We also chamber a bullet into the gun
```lua
..
It's fun to markdown in Discord
print("Hello, World!");
Pin that msg and reference it so I can stop making the same image over and over.
lol
``
--lua codeblock for discord
``
Do not fear the man who has practice how to reload 1000 different guns
Cuz his saying image
...what?
Fear the man who has practiced how to reload guns 1000 different ways
Oh i thought you meant everyone posting the reload implementations
he was asking a mod to pin the method to write code blocks into discord he posted
I thought workshop mechanics could pin
okay, whoever capable
I may not be capable of pinning but I can ping
Can this be pinned?, @tame mulch โค๏ธ

great, delete a post that requires other posts to be deleted in order to not mess with the flow of the conversation
@wet sandal
Cuz u said it was redundant i removed it
you can include an additional argument to timed actions to make the time 0 I believe
Apologies for ruining the flow of conversation
that should eliminate any clumsiness with actions loading up
I had to delete mine too because of it
wait, someone asked about making timed actions 0?
what will point to them
you deleted an image that wasn't replied to, causing my comment after it to be directed at something else entirely =P that's dangerous
I had to scroll up to see what was going on - and it shows someone wanting a loaded gun ready to go on player load in - someone provided a snippet to do so, but the gun was being loaded in timed actions and they expressed concern over it being a timed action.
that snippet wasn't the code of the modder asking
he just wants his starter kit to have loaded mags
yes, this.
he could use the same snippet to figure out how to trigger the load bullets in action though
what in the blue hell is going on in here.
also I'm surprised this hasn't come up as an issue before tbh
yea, but wouldn't it just make more sense to figure out how to spawn in a magazine already loaded, than a roundabout way of adding a new timed action of 0 speed?
NotLoc's snippet does this
I mentioned im on mobile
I just took what snippet i had closest to it
oh, I didn't even -see- Noc's snipper
but doesn't this just spawn a magazine and load it into the gun?
he wanted multiple mags
The first function is just magazines
oh okay, so those don't trigger at the same time. right
been a long time since I've actively done stuff
2nd calls the first - which is good practice, as the first is useful outright
if you didn't already see the answer yet, this apparently will help you do it
^
lol
i didnt expect this much conversation around this question
thank you to all though
I dunno if I'm going insane, but it seems like the Events.OnPreFillInventoryObjectContextMenu hook isn't actually giving me the player?
it should give player, context, and items
Looks like a player ID
:o
brain = flat
you're right, it would be nil if it didn't exist
this is what your brain looks like on embedded, I'm used to 00 or FF being empty
Either it's wrong or the PZWiki is wrong.
PZWiki says it gives an isoPlayer
I don't think any of the context events use isoplayer
๐ค
local playerObj = getSpecificPlayer(player)
yup, figured that out right quick
triggerEvent("OnPreFillInventoryObjectContextMenu", player, context, items);
now I have other terrible bugs causing issues
can't argue with the 2nd point, but they do follow some patterns... sometimes
my favorite is randomly multiplying and dividing by 2
trying to figure out how crit works for guns was hell because... it's everywhere
Yes usually playerObj is the isoplayer, most notable exception I think is ISMenuContextInventory.lua that defines playerObj but then saves it as self.player and player id is self.playerNum
is it possible to have a weapon use a drainable object like a gas can for ammo instead of regular magazines?
got an example? if you decompiled java there's some weirdness that can come out of it
Defined stat exists of range increase per level for a gun. This number is actually just halved
that's the only one I remember 100%
same thing with the aiming perk crit modifier
if the gun script says 10, it's actually 5
tests ingame in debug mode confirm both
which is... annoying
I ran into an issue with I think stress modifiers on books being scripted to be -10, but actually -100 on the inventoryItem lol
Nerf Guns? A function would be able to reload it but I don't know what would happen to the weapon's script in that case
It might be more work to try and jerry rig the gun system to do what you want
the wiki is wrong, but those pages are autogenerated and my pull request hasn't been noticed
I noted this in #pzwiki_editing
i'm trying to make a flamethrower type weapon that uses gas cans as fuel. I technically can add a special "bullet" thing crafted from gas but I really would rather try to have the gas itself be the ammo if possible
Half my time modding is spent deciding if I should/could warp the vanilla system to do what I want or just build something from the ground up and leverage it in like a jenga block
There's event for weapon swing
you could create your own gun system so to speak
Does anyone know which code removes and adds bandages from the player model?
Otherwise you'll need to make a magazine for the flamethrower to take
i tried having the mag be gas cans, the ammo itself be gas cans, neither even let me load the thing.
the next best thing i can think of is my own custom fuel tank item that technically has ammo but the ammo just constantly updates to be the number of uses left
Why couldn't you load the gas can as a magazine?
guns seem to only accept items with type "normal" as ammo or mags, and gas cans have "drainable"
Also the approach for a gas-can magazine would be to not have an ammo item for it - and instead have it use a recipe or custom timed action to refuel it
Don't make it drainable
that part isn't the mechanic you want to lean on
ill add a custom fuel item and set it to be type normal see if anything changes
you could add your own context menu, that uses the drainable and reloads the weapon
^
or if you intend this to be a rare item, just have the magazines assumed to be full when found and use modData to simulate them draining
In particular how is the game handling multiple items in the Bandage body location? group:setMultiItem("Bandage", true)
i plan on it being craftable only
I think it uses an invisible item/body location with an attachment model
What exactly do you mean by handling?
sup mx
Ithink theres a reset on the syntax i dunno exactly .. but this removes eveything iirc
Mybe you can look into codes that are medical related
How does the game equip and unequip the items in these 3 categories?
group:setMultiItem("Bandage", true)
group:setMultiItem("Wound", true)
group:setMultiItem("ZedDmg", true)
I was trying to make a clothing can can be stacked in the same BodyLocation, but once I equip it, even if I unequip it, it stays on my character model
can a syntax even be reset?
Ill let you know if i see what im trying to refer i totally forgot .
Oh also time action might want to check that
There yeah but i only to reset everything idk how to remove just one thing
In my case zed dmg for the skins im using
This is also my roadblock now
resetModelNextFrame?
Theres another one
Its what i used for vampire mod
And another roadblock of mine is that i cant use attach or equip syntax to zeds idk why
-- -- player:getWornItems():clear() -- This unequips all clothing the player is wearing :-|
-- getPlayer():getHumanVisual():clear() -- this randomizes the body, skin, and hair and similiar
These are all the uses of ZedDmg
Seems like it's using it as a keyword for more specific things
also this comment -- don't add the ZedDmg category, they are just equipped models
Yaaaaayy.. Cryptic and undocumented objects..
Yeah I saw that too
there's a few mods that accidentally make zeddmg visible
you'll see it sometimes as body.damage (?)


Oh wait
public void setItem(String var1, InventoryItem var2) {
this.group.checkValid(var1);
int var3;
if (!this.group.isMultiItem(var1)) {
var3 = this.indexOf(var1);
if (var3 != -1) {
this.items.remove(var3);
}
}
I think I can remove and add these items, if I manually call the remove and add functions in java\characters\WornItems\WornItems.java
Idk if you mentioned - but what are you trying to do? like end goal
It's related to my transmog mod.
I'm making a clothing item, that uses a BodyLocation set as MultiItem
eg:
group:getOrCreateLocation("Bandage")
group:setMultiItem("Bandage", true)
So it looks differently depending on the location it's placed?
So, that I can use a single bodylocation for all my transmog items.
I have around 1K script items, and I'm trying to have all of them in the in a single body location, it would make it easier to manage
WHAT
I'm not sure what a transmog is and Im too afraid to ask
Also Idk if this helps but you can create your own custom bodyLocation for items
and the item can be equipped there
This https://steamcommunity.com/sharedfiles/filedetails/?id=2768901065
And this: https://steamcommunity.com/sharedfiles/filedetails/?id=2870193357 (current version)
I did that, but I can't unequip them now ๐ฆ
uhhh
See
These 2 items have the same bodylocation, and I can't unequip them ๐ฆ
You're equipping them using standard equipping methods?
Yep
Also, script items for reference
item TransmogItem_0
{
DisplayCategory = Transmog,
Weight = 0,
Type = Clothing,
Cosmetic = TRUE,
DisplayName = TransmogItem_0,
Icon = Belt,
BodyLocation = TransmogLocation,
ClothingItem = TransmogItem_0,
WorldStaticModel = TShirt_Ground,
}
item TransmogItem_1
{
DisplayCategory = Transmog,
Weight = 0,
Type = Clothing,
Cosmetic = TRUE,
DisplayName = TransmogItem_1,
Icon = Belt,
BodyLocation = TransmogLocation,
ClothingItem = TransmogItem_1,
WorldStaticModel = TShirt_Ground,
}
If they're under the same location how are they not unequipping the other?
it's because I set the bodylocation to multi item
group:setMultiItem("TransmogLocation", true)
Sure take your time
I have this note in my code
-- -- player:getWornItems():clear() -- This unequips all clothing the player is wearing :-|
Maybe I can make a custom unequip button
In the debug ouput does it say anything about a timed action failing? invalid?
No logs
wouldnt be an error
There notthing printed in the console at all, no error, no logs
elseif self.item:IsClothing() then
self:setActionAnim("WearClothing");
local location = self.item:getBodyLocation()
self:setAnimVariable("WearClothingLocation", WearClothingAnimations[location] or "")
self.character:reportEvent("EventWearClothing");
This is under function ISUnequipAction:start()
perhaps you can overwrite it to check for transmog items first, and if not throw it back to the original
But where is the code that actually removes the item from the player model?
I believe that's handled in the player's update
I think what's probably going on is the game never intended to handle something like this and the old item is getting scuffed
Hello, is there anyone here who want to be my savior 
Thanks for every answer if you think you have an answer
Edit : I checked everything and every links, still doesn't work
While I wait for my answer I will dig this channel 
Nvm got confused with equip and wear due to the context menu
self.character:setWornItem(self.item:getBodyLocation(), self.item);
ISWearClothing.lua
You should be able to unequip 1 though
like putting on 1 and taking off 1
it then calls the OnClothingUpdated event which has the isoplayer as the arugment
could try
public ItemVisual removeBodyVisualFromItemType(String var1) {
for(int var2 = 0; var2 < this.bodyVisuals.size(); ++var2) {
ItemVisual var3 = (ItemVisual)this.bodyVisuals.get(var2);
if (var3.getItemType().equals(var1)) {
this.bodyVisuals.remove(var2);
return var3;
}
}
return null;
}
it's from humanvisual
so you'll need to grab that object from isoplayer
you're in luck it's exposed
๐ธ Cheers for slow progress on mods.
lol
God knows I've come to a crawl on my projects lately.
Dude I haven't modded a game in like 4 months now
Depression is a bitch to deal with
Are you sure that ISWearClothing is used also to unequip clothing?
I remember when @ancient grail asked the same question when he was making a chainsaw mod
I was curious where it could be overwriting the item if there was a list of worn items
but I don't think that was the issue
IM SO FUCKING GOOOOOOOOD
AAAAAAAAAAAAAAAAA
And I'm half asleep
I still know how to moooooooood
๐
local old_ISUnequipAction_perform = ISUnequipAction.perform
function ISUnequipAction:perform()
old_ISUnequipAction_perform(self)
-- code
if self.item:getCategory() ~= "Clothing" then
return
end
if self.item:getBodyLocation() ~= "TransmogLocation" then
return
end
local wornItems = self.character:getWornItems()
wornItems:remove(self.item)
end
Now it's possible to harness the setMultiItem BodyLocations
Apparently the game just does not know how to handle multiple clothing in the same bodylocation, unless it's one of the 3 pre-existing locations
I'm also half asleep
I was trying to figure out how or why that looked off -- you're looking for and comparing the self.item
it works very well ngl
Yeah lol
Now I updated it
No I mean -- you can just call remove(self.item) ?
I've been stretched at work ๐ฆ
need to sleep but I have a mod commission to work on
Dude sleeping it's a bit more important then commissions. Sleep now, and wake up a bit earlier tomorrow
Atleast you can code with 100% of your brain active
I have work tomorrow too
Still waiting for these zomboid mod sub money to kick in
any day now
Just don't overdo it mate, cause you risk burnout like that, and it's not a good experience
I can die in peace ๐ฟ
Strangely enough I don't mod.
I write tools.
congratz
I am building a vscode extension for the scripting format for PZ.
I'm currently in the linter phase that'll follow up with formatting.
I do both, and it's good but also exhausting some times
It is in the marketplace and operational.
Plus, my actual job is making modding easier ๐คฃ 
I remember.
Time for some advertisement...
PZPW
Unleash your creativity and elevate your Project Zomboid modding experience to new heights with pzpw!
Crafted specifically for mod enthusiasts and developers alike, pzpw is a remarkable tool that allows you to write your Project Zomboid mods in JavaScript or TypeScript. This groundbreaking utility is not just about writing mods - it's about enhancing your coding experience and transforming the way you create.
One of the standout features of pzpw is the built-in auto-complete/intellisense for both Java and Lua. Imagine having the power to write cleaner, faster, and more efficient code - and that's exactly what you get with pzpw. No more second-guessing your code or spending countless hours debugging. With auto-complete and intellisense, you're able to focus more on creating and less on the tedious aspects of coding.
With pzpw, mod writing becomes a seamless, professional process. Your code will not only be more organized, but also more readable, maintainable, and adaptable. It makes modding accessible, enjoyable, and rewarding.
The best part? pzpw is FREE! Yes, you heard that right! This powerful tool is available at no cost! It's our way of giving back to the modding community, empowering developers to create better, more engaging mods.
So why wait? Step up your modding game with pzpw today! Dive into the world of JavaScript/TypeScript modding, and experience the joy of creating in a whole new way! You won't look back. Transform your Project Zomboid modding journey now with pzpw!
https://github.com/Konijima/pzpw/wiki/Tutorial:-Creating-Project-Zomboid-mods-using-PZPW
I'm doing the exact thing for PZ @gilded hawk
Also am first for ever supporting the format.
Is this a branch of Pipewrench? or both you and Jab did the same thing? ๐ค
Pipewrench is the core, mine is an utility tools that wrap everything you need to use pipewrench
Oh wow
That's cool!
Shit I might actually convert my transmog mod to use typescript then
it allow to create a mod project in one command, then it allow to manage your project (which can contain multiple mods) into one place, it compiles it, and copy it directly into your Zomboid/mods or Zomboid/workshop directory ready to test in game.
How do you do stuff like this in TS? Including overriding the return? ๐ค
local old_ISUnequipAction_perform = ISUnequipAction.perform
function ISUnequipAction:perform()
old_ISUnequipAction_perform(self)
-- code
I followed your tutorial ๐ค ๐ค
You have auto-complete and suggestion for everything from mod.info (which is handled into pzpw-config.json to Java and Lua intelisense
you can use hookInto utility function to hook into existing functions
you can also access the _G global object
Can you do both pre and post hooks? ๐ค
Ah okay that's very nice
let's go for the next step of the tutorial, double click on createRunConfigurations ๐
...
๐ฟ
I have to be honest this is very cool, I'll give it a shot tomorrow, cause right now I'm just too tired ๐ด
That is an old example of hooking into an Action.
import { ISTakePillAction, IsoPlayer, InventoryItem } from "PipeWrench"
import { hookInto } from "PipeWrench-Utils"
// Hook into ISTakePillAction:new
hookInto("ISTakePillAction:new", (_new: Function, self: ISTakePillAction, character: IsoPlayer, item: InventoryItem, time: number) => {
const obj = _new(self, character, item, time) as ISTakePillAction
obj.maxTime = 300 // change action properties here
return obj
})
// Hook into ISTakePillAction:perform
hookInto("ISTakePillAction:perform", (_perform: Function, self: ISTakePillAction) => {
const player = self.character as IsoPlayer
const item = self.item as InventoryItem
player.Say(`I took a ${item.getDisplayName()}!`)
return _perform(self)
})
sleep well
aaaand nope
false hope.
@thin hornet can I use you as a joker for this one since I follow your tutorial ? It would really help me ๐
this worked amazingly, thank you!
also is it possible to have a flashlight with a different light color, like an oragne/yellow light instead of pure white?
not easily
its been a while
rip, i am stuck forever
it could be the version of java that is installed or many other thing, could be outdated too, pzstorm is abandonware i believe (or at least last time i saw)
Do you know javascript?
nope, I should learn it seriously
It a good language to learn in the modern world of today yeah
It similar to lua in many aspect
I know basics
I know more of javascript that I know in Java ๐ ๐ง
try this tutorial to get started with pzpw #mod_development message
Then research typescript and javascript, maybe ask chat gpt to teach you or something.
what I mean by that : I am not completely new to programming, I understand how code works
pzpw is really simple, in less than 4 commands you are ready and set
then you can test around typescript and compile and run in the game, then modify, compile again, and restart the modified script in game
the goal of my capsid tutorial was to get intelisense in lua to mod pz right?
well pzpw offer all that intelisense built-in in a much less effort setup
I will check that, thanks again for your time, that was a good joker ๐โโ๏ธ
So no need to restart the game after typescript recompile ? awesome.
Yeah just restart the script as you would with lua
pipewrench just transpile typescript into lua in the end.
me and a contributor are working actively on making the compiling process much faster and smoother
I am cursed to get errors for no specific reasons 
npm i?
Yep I am installing PipeWrench Template
i dont see the node_modules directory
run npm install in your console from within your project directory
pzpw new should have installed it but not sure what happened here
nope
what version or nodejs ?
node -v```
version of your tutorial, the recommended, let me check for you
what was the output in your terminal when you used the command pzpw new
I am playing all this in hardcore mode I haven't even started
Are animated textures a thing or is that not possible in PZ
I don't think that is possible, would love to be proven wrong though
Ive done skin and tile animation(mortar mod)
Can weapons have animated textures?
le sigh, this is gonna be fuin.
when does Events.OnPlayerUpdate fire? is this checked every tick of the game? is this checked upon user input?
the only documentation I see is https://pzwiki.net/wiki/Modding:Lua_Events/OnPlayerUpdate
hello I am creating a new class in the game but I need to find the file that manages the choice of profession interface to be able to choose it. Does anyone know where this file could be and what its name would be?
try looking at profession framework on the workshop and using it as a dependency. I'm pretty sure it does all the heavy lifting so you can easily add new professions.
ok thanks i m gonna try that but if someone know the file i m talking about
it is called every tick for every player that are in the client (for example in splitscreen singleplayer, not sure if it does for MP remote players tho)
how can i check if the player is wearing gloves? im doing a thing that involves fire and i want a risk of burns if the player isnt wearing hand protection
Doing a sleepless night to fix this.
Fixed first problem yet but still have issues with @asledgehammer error
Does anyone have the name of the file?
hi
i extracted the game's sound banks but couldn't find the smoking sound files
where are they located?
i think i figured out a pretty modular system. how can i get insulation on one specific body part
isn't the node 18.x the current LTS?
anyway, it looks very promising!
lol surprire?
hmm
there's no working vehicle sound mods on the workshop
is that a sign that it's very difficult?
cause i'm trying to do that

LET'S GOOO I MADE IT ๐ค
@thin hornet
Sorry to be so insistent but i really need the file that manages the choice of profession interface. I m making a big mod with many addons
@thin hornet
#mod_development message
Can you make an update for only intellisense for those who don't know typescript.
is there a way to make a mod reload its scripts after you change it instead of painfully closing and reopening the game?
also can you make a sound louder by making its multipler larger than 1? like 1.5f or 2f? or is 1 the maximum
and the sounds i changed are muted
great
{
sound VehicleDoorOpenStandard
{
category = Vehicle,
clip
{
file = media/sound/vehicle_door_open_1.wav,
}
}
sound VehicleDoorCloseStandard
{
category = Vehicle,
clip
{
file = media/sound/vehicle_door_close_1.wav,
}
}
}```
can someone tell me why the sound is muted?
am i missing something here
what texture maps do zomboid models support having
and does that include normal and emission
could be a the car mod i have doing something
no it's not the car mod i had affecting it
hmm
it does, every frame a player updates, it's called
so since my door opening/closing sounds are muted
i'm guessing my mod is working, but the sound is too quiet or something
maybe the radius is 0?
do i have to give it a sound radius?
maybe the audio doesn't fit?
ok apparently it has to be
sound VehicleDoorOpen
not
sound VehicleDoorOpenStandard
so I created a new trait called "test". Here's how it looks:
--trineTraitCreator.lua
require('NPCs/MainCreationMethods');
local function Loader()
local test = TraitFactory.addTrait("test","Test",1,"Some text",false,false)
end
Events.OnGameBoot.Add(Loader);
and now I am trying to implement the following logic here
--trineTraitMain.lua
function GiveTest(player)
local Inventory = player:getInventory()
if Player:HasTrait("test") then
for i = 0,10,1 do
AddLoadedMagazine(player, "Base.9mmClip")
end
end
end
function AddLoadedMagazine(player, magName)
local Inventory = player:getInventory()
local mag = Inventory:AddItem(magName)
mag:setCurrentAmmoCount(mag:getMaxAmmo())
Inventory:addItemOnServer(mag)
return mag
end
Events.OnNewGame.Add(GiveTest)
However it doesn't seem to recognize that the player has the "test" trait. Am I missing something here?
I'm testing this by launching a solo game with just my mod and selecting this "test" trait
if player:HasTrait(โtestโ)
if you change your active mods they'll reload
yes thank you
also my mod is working
for some reason, same exact code
if you have your mod disabled on the main menu then it'll be reloaded every time you load your test save
yeah i've figured it out thanks
IsoSpriteGrid works only with Moveables, is there a similar system to easily get all objects of something you want to be built only?
I like it because you can grab all objects through java. I'll try to make one myself, hopefully it won't trigger any side effects.
it was surprisingly easy to make
how come there's no such mod
i think car door opening/closing sound being annoying and loud is a popular opinion
welcome in the idiots team dude
you can have a try at typescript/javascript, it's easier than lua in my opinion.
If you come from a Lua background, there will certainly be new concepts to learn in JavaScript. However, the basic principles of programming remain the same, and your experience with Lua will definitely help you to understand JavaScript.
--
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "Base.Belt2");
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 98.0);
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "Base.Belt2");
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 98.0);```
But so how would I write this in typescript ?
That methodology pains me everytime I see it - idk why
I am the greatest noob of all times. period.
It's not you, it's just the way that's established
Imo it's very simple to use two inserts but it could be cleaner/harder to screw up if it was a function
Messing up the distros is a pretty easy thing to do
especially with a lot of mods using hundreds of lines of these
most of my mods do things heavily programmatically so it's no good for me but i wonder if the distribution merge thing would be more useful for most people
i've barely seen any mods use it
Distromerge merges the tables but if one person copypastes a table insert out of order it will cook the rest of it
Even just a function that inserts within it but uses two arguments would be easier
Another idea for the community proj
so you're clearly saying I am doing right something wrong ? 
No it's technically fine/correct, it's just ugly/prone to accidents ๐
And it's the standard thrown around
function addItemToDistro(distroAddress, itemType, spawnChance)
table.insert(distroAddress, itemType)
table.insert(distroAddress, spawnChance)
end
Probably over-egineering it, but it's also a baby-gate for those that may need it.
Its certainly better than seeing 500 table.inserts
Hopefully during the summer I can work on all the pending issues on commProj
And maybe pick up a comrade or two ๐๐
Damn I lost my emote using the hammer and scythe sprites
if it's can help you ```lua
require 'Items/SuburbsDistributions'
require 'Items/ProceduralDistributions'
local LootRarity2 = {}
LootRarity2.Common = 15
LootRarity2.Uncommon = 8
LootRarity2.Rare = 2
LootRarity2.VeryRare = 0.5
LootRarity2.ExtraRare = 0.01
local suburbsDistribution = {
all = {
inventoryfemale = {
items = {
"Needle", LootRarity2.ExtraRare,
"Gum", LootRarity2.VeryRare,
"Cricket", LootRarity2.Rare,
"Paperclip", LootRarity2.Uncommon,
}
},
inventorymale = {
items = {
"Needle", LootRarity2.ExtraRare,
"Gum", LootRarity2.VeryRare,
"Cricket", LootRarity2.Rare,
"Paperclip", LootRarity2.Uncommon,
}
},
},
Bag_BigHikingBag = {
items = {
"TinnedBeans", LootRarity2.ExtraRare,
"Paperclip", LootRarity2.Uncommon,
},
},
Bag_NormalHikingBag = {
items = {
"TinnedBeans", LootRarity2.ExtraRare,
"Paperclip", LootRarity2.Uncommon,
},
},
Bag_DuffelBag = {
items = {
"TinnedBeans", LootRarity2.ExtraRare,
"Paperclip", LootRarity2.Uncommon,
},
},
Bag_SurvivorBag = {
items = {
"TinnedBeans", LootRarity2.VeryRare,
"Paperclip", LootRarity2.Uncommon,
},
},
}
for location, data in pairs(suburbsDistribution.all) do
for _, value in ipairs(data.items) do
table.insert(SuburbsDistributions['all'][location].items, value);
end
end
in : \lua\server\Items
in LootRarity, you can add what you want : LootRarity2.ExtraRare3 = 0.003 and after you just need to add
"TinnedBeans", LootRarity2.ExtraRare3,
you can check with LootZed the %
you should make the lootrarity2 table local
edited thanks ๐
oh my god
i accidently hit this button
and now all my sounds are back to vanilla
is there a way for me to activate my modded sounds again?
without restarting
cause i'm hosting for my friends and it will take too long to restart
Don't think so. This is a TIS issue since it's vanilla stuff.
You can try loading them back in manually but it'd probably cause issues.
yeah i am forced to restart anyway since
Sounds like an actual bug.
siren switch?
TIS?
The Indie Stone
lol
There used to be a panel for adjusting all sounds even modded, unscripted were added in real time to a general tab.
Was that ever fixed/readded?
i'm surprised that they can't join just because i reloaded vanilla sounds
It was broken with the sound update -- I looked into it but it was a java sided issue -- something to do with juggling the sound onto a test player if I recall(?)
Oh it's causing a checksum?
How do I change the link to an image that opens when I consult a document/map?
Hey Lore ๐
Could you explain a bit more?
Hey!
Yes
I am working on the translation of Save our station
There is a diagnostic manual that when you read it, it opens up an image
Since the image is in English, I would like to change it to another one
I'm not sure it can be if it uses the maps system - EHE has a similar problem with flyers
Do vanilla maps get translated?
I guess it does
It uses the same animations as when you open a map in the game
Is there no way then to say, "Hey, use this image instead of that one"?
Not sure, but most likely yes if the process isn't handled by java
Okay, and how do I know that?
wait what
my friends are having an issue
with a mod i made
i gave them the files but it says doesn't match?
Sorry, but in modding I know nothing ๐ฅฒ
nvm
If I get around to it I'll post it
That's great, thank you very much!
How does clothes modeling work for PZ?
Hi, is it me or there is no more Weapon jamming in B41.78.16 ?
I've had weapons jam plenty in my testing last night
What weapon are you using ?
semi-autos
modded ?
pump actions and bolt actions, while they do technically jam, they instantly clear
because the character automatically racks after every shot
modded, yeah as I was testing what I was working on
and none the jam chances there were insane
I was testing if my folding stock script preserved jams, which required a jam
can you give me a name of a Vanilla semi-auto weapon ?
M16, M14
thx
M9, M1911, DE Pistol
well I'm surprised I did not achieve any jam with the 9mm in 100+ shots
it's also condition based
from my experience a 100% condition firearm won't jam
a 10% or 20% will jam a lot
I was at 10% condition all test long
no clue
I do want to dig around the firearm java and figure out exactly how jamming works
the M16 jammed at 36 rounds ๐
jamming is lua stimulated ๐ thanx for the weapon cues
hello I am creating a new class in the game but I need to find the file that manages the choice of profession interface to be able to choose it. Does anyone know where this file could be and what its name would be?
The main files would be ProffesionFactory and MainCreationMethods.lua .
Can I force a reload of a texture ?
I'm missing something obvious. My model isn't displaying in game; just the icon.
Icon is is in the textures folder with Item_ prefix. Texture is in the Texture/Worlditems folder. Model is in the modelx_x/WorldItems folder. I can't see what I missed, lol.
Edit: As @neon bronze suggested, I switched up my naming convention due to lack of caffeine. WorldStaticModel was incorrectly named.
shouldnt it be BF_Rubber_Scrap?
yes but you defined the model as BF_Rubber_Scrap
so far i know you need to call it in WorldStaticModel as that, BF_Rubber_Scrap
OH
So, I was editing 1 of brittas grip attachment in blender and when I exported the model .x it did not appear on weapon and only showed as attached to weapon
Was there something I did wrong during export process?
"it did not appear on weapon and only showed as attached to weapon" Elaborate on this please.
did it only appear on the weapon when you put it down?
It did but it doesnt appear when I hold it in my hand
yea i think(?) there is a definition for attachements in the weapons model script
like their offset
{
offset = 0.0000 0.4700 0.0300,
rotate = -180.0000 0.0000 -180.0000,
}```
thats for the vanilla shotgun and its choketube attachement
ok yeah because I change the position in blender
maybe tinker with that for your brittas weapon that you change
Ok and I noticed the kb memory of the model was 2 lower than the original after exported it in blender
Many clothing items are simply a texture applied on top of the others, some are a simple model that gets attached to the character's model, like hats or glasses, the more complicated ones are clothes that need to be animated, like jackets. For those you need to use a converted player base model as a base
Hi there! I'm trying to set up spawns for the vehicle without using vehicle distribution zones. It's almost ready, but has one annoying and not desired feature. It has chance rolling to decide whether it's gonna spawn or not. The problem is that chance rolling each time anyone get to this cell / square resulting that vehicle will eventually be spawned. Any suggestions how to prevent that and make it roll chance only 1 time?
Pif ! Paf ! Boom !
Bang !
https://steamcommunity.com/sharedfiles/filedetails/?id=2971765105 Here come the comic speech mod !
Can you make one for Zombies that are not visible behind Walls because of IsoMetric view? Like a thump sound when they are breaking the wall, or when you first notice them ๐ค
Like the surprise sound ?
Anyway you can use this mod for that purpose: https://steamcommunity.com/sharedfiles/filedetails/?id=2863908612
What is that ?
Thank you
it looks like you are using visual studio code, I recommend installing some extensions to help you catch those variable casing issues.
I can use "Result: BF_Scrap_Rubber=3, " to get an item from a recipe. Can I use the "/" to get more than one result item in the same way that I can have multiple ingredients for the recipe?
Alternatively, can I use result twice?
Result twice? Probably not, it will use the last result entry as its result, try using slash or semicolon if that doesnt work use OnCreate
How does that work exactly?
For clothes like jackets
You probably reference the jacket vanilla model but give it your custom texture
Nah but for making a new model
you can set a number of the same item but you can't give multiple item types through result
I think there is a guide pinned in this channel with the required files to get started
@nimble spoke I've gotten the general idea already, but I was hoping I wouldnt need an entirely different Recipe.OnCreate for it. Guess there's no easy way to use recipe for multiple result items. Now I've got to figure out the lua function part. WOO!
anyone have an example for how I can include "Desensitized" as part of my custom trait? I've been looking at the JobTraits mod but all it does is add "Desensitized" to the TraitFactory.
Essentially I am creating a trait "Special Forces" which gives stat bonuses (easy enough) as well as a full loadout upon spawn (figured out). But I also want my "Special Forces" trait to give the player "Desensitized".
I'm thinking on PlayerUpdate I could keep resetting the panic level back to 0 but I'm wondering if there's a much easier way to do this that I'm missing
Hm... do you have the "Insurgent" mod installed?
nope. I want to do this within my mod without a dependency on an external mod
you can download it and look at the mod code - i'd advise against copying it.
That mod has customized traits and occupations, the workshop id is 2907683021, which you can then find in your steam folder
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\2907683021
Look through the events there is one when your character gets first initialised thats where you give the player the trait
Actually anyone knows where the getFileWriter points to?
hi does anyone know how to remove specific zeddmg and not all of em
cuz the way im doing it is
player:clearWornItems()
player:resetModel()
here is how i toggle it
https://imgur.com/SnaIIN1
and it removes all of the clothing
but i just want to remove the zeddmg which is what i used to mask the player
(to make it look like his under water )
this is why i need it
but i dont want to remove every clothing
if theres anyone who might know the syntax pls share
ive been trying to find this the whole day
https://imgur.com/ml3o68X
function SWIM.wear()
local player = getPlayer()
local item = 'Base.SWIMmask'
if item then
local inv = player:getInventory()
local equip = inv:AddItem(item);
player:setWornItem(equip:getBodyLocation(), equip);
end
end
function SWIM.strip()
local player = getPlayer()
player:clearWornItems()
player:resetModel()
sendVisual(player);
triggerEvent("OnClothingUpdated", player)
ISInventoryPage.renderDirty = true;
end
function SWIM.isMask(player)
local wornItems = player:getWornItems()
for i=1,wornItems:size() do
local item = wornItems:get(i-1):getItem()
if item:getName() == "Base.SWIMmask" then
print(item:getName())
---getPlayer():getInventory():Remove("Base.SWIMmask");
return true
end
end
return false
end
function SWIM.toggleWear()
local player = getPlayer()
if SWIM.isMask(player) then
SWIM.strip()
getPlayer():getModData()['isSwimming']=false
else
SWIM.wear()
getPlayer():getModData()['isSwimming']=true
end
print('isSwimming')
print(getPlayer():getModData()['isSwimming'])
end
{
DisplayCategory = ZedDmg,
Type = Clothing,
ClothingItem = SWIMmask,
BodyLocation = ZedDmg,
WorldRender = FALSE,
}
https://steamcommunity.com/sharedfiles/filedetails/?id=2971855491
Hello, I wanted to promote my mod. I made sure all the coveralls were dressed so that the pants were tucked in and tucked inside the shoes :)
and if you have any mods that use the vanilla coverall model, that will also apply.
attache case mod? ๐
Pretty much
are you able to rotate items
Aiming for the tarkov inventory system
or no
thats p cool
so im making a sword that has 2 different modes, functionally the 2 modes work flawlessly, but id like a visual indicator of which mode the sword is currently in. I'm using vanilla models for now and will have different custom models for it later.
the goal is to have the sword swap models based on the current mode but it isnt changing. its staying at the default model.
okay its recognizing the modes when i place it on the ground but its not changing when im actively holding it
Ah, I was wondering when or if someone would try and make a Axe-Shovel survival tool... Chop wood and Dig Furrows with a single tool would be neat.
that shouldnt even need a special lua file cuz that function is in the script tags of the weapon
How will modded items sizes be determined?
Hi ๐
Hello
Sapph is back from taking a break.
So you should hear from her soon
Thats all
Nice, Thanks for the heads up. ๐
As a tarkov player, to show me this and not let me play, is trying to hurt me ๐ฆ
and yes, I have read that it is about to, that there are problems with the anticheat.
Automatically with some math, or modders can provide a compatibility file.
Will have bit ready for launch.
Very cool. I'm very much looking foward to this and the susceptible update.
speaking of which any news on susceptible if you don't mind me asking?
I watched a video about how zombies spawn inside buildings and based on that I need to rework how the air is modelled
It's not a huge amount of work, but I'm trying to bash Inventory Tetris out first
Also need to work out a performance issue in Louisville skyscrapers
oh damn. a spore nest in a skyscraper sounds nuts.
can't wait. Good luck ๐
@ancient grail any idea how i can update the weapon sprite while the player is holding it?
call character:resetEquippedHandsModels() after changing the model
ill try that
Check out double barel shotgun
Anim sets
Its reload
When we made the nitrogun i had to make an animation that basocally swapped the sprite via anim set
that worked. tysm!
How did you change it?
Nice
Nice
its in an onPlayerUpdate function atm so i will need to change that for optimization
but i can do that on my own
Whats isactivated? Like flashlight?
not strictly for flashlights, just anything with a toggle. i dont know of anything outside of the base game that uses it and isnt a flashlight though
if you have it applied to a weapon and have said weapon equipped to hotbar, pressing the key to take it out also activates the item. to get around this i made it so having it holstered removes the "canBeActivated" attribute and makes it so you can draw it as usual. you still have to holster it the manual way, but while its in your hand you can press the hotbar key to toggle it which is a really neat system
im making the shishkebab from fallout 3/nv/4, a fire sword that sets enemies on fire, and since fire is super destructive in this game i wanted to have the option for not having it not spread fire.
theres also a pretty solid ammo system, made with a lot of help from Chuckleberry Finn, and the sword is refillable with gas cans.
still need to make the crafting recipe for it
i also want to add a chance of burning your hand if you swing it without wearing any protection. my initial plan was checking insulation but i cant figure out how to get insulation of a specific body part
nice i should have used this for chainsaw and protoSuit
ill send you the files for it once i get something more refined
effect im going for is if the right hand has insufficient insulation, the character has a chance to burn their hand. every time this code runs the conditional throws an error, and i cant see what it is
ohh
my bad
i've never seen someone use the part constructor like this
bodydamage doesn't have a fromindex method, were you thinking of BodyPartType? but either way i think that entire section is just trying to do character:getBodyDamage():getBodyPart(BodyPartType.Hand_R)
that must be it
Ok I'm fairly new to modding pz and I have no idea what's causing it but a bunch of items from the base game seem to disappear from the game when I load the mod I'm working on
I'm trying to make an item that lets you craft tools into other tools.
For the most part it's working but it somehow removes the saw, hand saw, needle, and the trowel
only things I've added are one item and a bunch of recipes
I removed all mentions of them in the recipes and they are back in the game, So clearly something from the recipes causing it.
I'm gonna try rewriting those parts but I still have no idea why it was doing it.
nevermind I forgot to turn the mod back on
They're still gone
no mention of them at all in the mod
does your mod overwrite any vanilla files?
I don't see any reason it would
i arose from the dead specifically to make a mod someone mentioned like once lol
was originally using highlights but those are a tad laggy
nice
that's actually pretty dope. can I offer a suggestion?
Sure
(Also turns out the generator range is a lot larger so I had to use a formula to compensate, 20 units in a marker is NOT 20 tiles)
@faint jewel just in case lol
well the outer ring seems awfully thick. maybe have it do a gradient fade
I can investigate, just dunno what the full capabilities of markers are
Though I may need to tweak a few other things first, it likes to linger around if you pick up the generator with the menu open
anyone know a way to remove an element from a UI on demand?
I think you can get similar effect by hiding them
is there a blanket hide function for ui elements?

ISUIElement should have a setVisible(bool) method.
Did Dislaik delete his client-server guide from steam?
self:setVisible(false)
self:removeFromUIManager()
Thats what i used and jt worked
Doesnt work on children though
By children i mean panels that are popping up through buttons
Wait, all his mods are gone too, wtf Happened? ๐
I think you are having a Butterfly effect


We need to form a search n rescue team, #OpFindDislaik
What kinda mods did he do?
He made a lot of big mods
Like?
Im sure he did
Says community is too toxic for him
Idk what he ment
Ohhhh, I understand
๐ฆ
Huge lost..
Yeah...
His library is amazing
But i never once understood how to use it
He made the dogs mod,
Skateboard, motorcycle,
But thats not his biggest contribution
It was the guides he made
Animation, clothing guides
Thankfully the google cache has saved stuff https://webcache.googleusercontent.com/search?q=cache:6XvKBcsDVNcJ:https://steamcommunity.com/sharedfiles/filedetails/%3Fid%3D2735092774&cd=2&hl=en&ct=clnk&gl=uk
I know where he is but he wont come back
His in the cultural plaza
Wonder what he meant by too toxic
Then you haven't made enough mods ๐คฃ
I have been modding for 10 years now, and the amount of assholes you have to deal with is absurd
Especially when you have to deal with entitled little shits
It's not for everyone
I quit Arma 3 specifically because that community is so toxic though ๐ but like... Actually toxic, the modders of that game are legit some of the worst people in existence.
I just really haven't seen the same level here. Idk, seems like a lot more chill scene than other games
Eh it depends
Anyway, people can be assholes, and not everyone can be bothered to deal with this shit
And you also have to deal with obtuse and room temperature IQ users. Like even I got really really pissed #mod_development message
Yeah, I made a mod that appeals to newer players and unfortunately they shine a light on problems with navigating the menus.
The number of times I typed
for on-going saves you have to go through the "load" menu, then "more", and then "change mods"...
People just don't read, and this pissed me off
That's another issue yeah, I'd say 8/10 it's a "I took a breath and gave up, help me"
The easier it is to navigate the menus though the less ... I wouldn't even call it troubleshooting
But the less modders have to do it
Also if your projects are a mess on the comments, I moved to GitHub discussions
Much more pleasant experience
I also got this out of it: https://steamcommunity.com/app/108600/discussions/0/5532143202606699480/
https://steamcommunity.com/sharedfiles/filedetails/?id=2458631365 it's a good mod... but what's weird is all the hidden links. even the commentsection is an image with a link. I don't want to imply anything, but it's suspicious
Jesus christ, that so stupid 
He never made a question as far as I know.
Any form of deterrence will shave off a lot of comments/reports but the ones left over are probably 10x more useful
This is the fake comment section btw
It's a hyperlink to the repo's issues page ๐
Steam is too bare bones - you can do so much more with GitHub
Yeah, agree
I toss up all my projects there. I set up a mod-template repo-template for team orbit, and honestly wish I thought of that sooner
Also, my transmog mod v4 is surprisingly working ๐ค
V4??
v1 is the first version I made
v2 is my attempt to have it working for MP too, but it was a bit of mess and confusing
V3 I never released it because it was too experimental and required changes to the java files ๐
So, now I'm at v4 to try and make this work SP and MP once and for all
What was I helping you with like a day ago? V2?
Ah, I guess the poster says 2.0
Have you tried firing commands to apply the same effects on each client side?
I'm still working on it
Does anyone know what code dictates if the hair are squished by the hat or not?
I wonder if it's dictated by the m_HatCategory in the xml ๐ค
If one of the hair guys is still around they might be able to help
people more inclined to be in modeling may know as well
That is it. Hat category
Is there a way from lua to make it so that the game ignores the m_hatcategory?
Cause this is giving me a cuple of issues with my transmog
I have no idea, never tried that
Is there a file that contains all the hair definitions?
Hmmm... I think this doughnut is too large for my taste.
I started today learning how to mod PZ today, but I didn't expect 0.1 units in Blender to be the size of a massive house in-game with scale unspecified (scale=0.4 in the image).
Am I doing something wrong?
hmm
i'm having a weird issue where the mod i made, enabled on my server
isn't working for others
only me
That's actually hilarious. Last time I looked at the mod page it didn't include this delightful feature ๐
it's a mod that replace car door opening/closing sound
only i can hear the change despite it being enabled on the server
This is very common - perhaps a modeler could better explain why - but you have to scale everything down substantially
There was even some vanilla items that were not scaled down when the world items were first added
Yeah, the comments got to be repetitive, and I don't blame anyone for not wanting to sift through them -- and almost no one read the pinned discussions cause they are only pinned within the discussion page -- not to the description.
Import a model from pz of a similar object to help you scale it properly. PZ models are tiny
Just searched, and it seems like it might be that Blender exports .fbx-files at 100x the size. I should just learn to search better I guess.
Maybe this can be adjusted in Blenders preferences.
I'll at least check it out.
Most people just scale it down in the model script I believe
I wonder if there's a performance hit for that

Good morning.
I wouldn't know. Sorry.

I'd like a bit more info, is your mod published (unlisted or otherwise) to the workshop?
not published
it's a small mod i made for myself
but i have given the mod to my friends
and have it enabled on my server
Oh then that might be it.
Yeah your game sees it because it's not on the other players' computer.
Yea no, that just aint gonna work.
Publish it to the workshop as unlisted and add it to your modid and workshopid settings lines. Then give it a try. If it still doesn't work we'll discuss further but it should work
why does it work for me tho
Some optimization could be done with cutting down how many bytes one use for variables, but I don't think modders have the power to influence that trough models or mod files. Thereby, I also dont think scaling down has any performance hit, at least not after the item is already loaded. Still just a guess from me though.
And btw, found the perfect combo for my model sizes (see image): Scale to 0.4 in model script, scale to 0.01 when exporting model. Result: Properly sized doughnut (more accuratelly smultring in this instance).
Modders don't have control over their data types because their work is inside the Lua environment.
TIS can spend ~15 minutes introducing packaged primitives and primitive collection wrappers to Lua.
I have no idea what that last sentence means, but Lua handles data types itself or something i guess? Only time I have had to care about data types has been when I have checked out low-level languages.
You don't have a choice on what size in bytes your numeric values uses, byte or float.
Say I have a client side mod, the lua files are in the client folder.
If I move them all to the shared folder... does that mean it is now a file that sends data to the server while also working on the client?
No
The folder you put the files in dictates what order the files load & what can be required (that is, client from client and shared, server from server and shared). If my memory isn't failing me, client files don't execute on the server, but everything else (including stuff in server) executes on both client and server
This may clear up how they interact
I understand what Chuck is saying. I spent years optimizing several codebases for these exact issues.
ah gotcha, understood. I'm trying to understand why nested containers acts the way it does on servers (doesn't send inventory updates to the server)
I've also been inside of PZ's Java & Lua codebase for over a few thousand hours. =/
A lot of improvements can be made not only with choice of data types. A giant optimization for runtime calculations of PZ would be moving from a decimal-based chunk solution for the map to a power of two chunk solution.
There's extra functions you need to call now
for example Remove() from containers is clientside and I guess expecting it to be in the player's inventory
but now there's a removefromserver function that in vanilla lua checks that it's not in players inventory
both are called in actions alongside eachother
A fun side project would be to copy the PZ folder twice and modify one of them to use a map system based in pow2.
Benchmarking it would be fun.
I remember this
Posting this on the resource thread
Resource thread? Is there a resource thread here?
Hope it helps
Thanks. I did not know that about Discord, that there are threads here.
Its not obvious
i was originally planning to have some overlaps set up, but for V1 this will likely do.
(client can only really accurately track one generator because of how the UI is set up)
Hi, I was playing with this recently for BattleRoyale mod. beware the UI is not precise. Its center is set in integer with an internal offset of 0.5 for both X and Y.
you can use this if you prefer precision to beauty getIsoMarkers():addCircleIsoMarker(sq, r,g,b,alpha)
does addCircleIsoMarker support radius properly?
yes it does self.circleMarker:setPos(zone.x, zone.y, 0)
self.circleMarker:setSize(zone.ray)
I see
very similar to getWorldMarkers():addGridSquareMarker but ugly and precise
The slight offset doesn't seem to be a huge issue on this scale thankfully, at least not from what it seems like
It lines up pretty well with the 20 tile radius
I may still look into the other implementation though, thank you for the heads-up.
from memory the worst offset is on bottom or top of the screen
you can set boss at the same time to compare ๐
both
wow
Yo, just recently started learning LUA, I almost finished the add on mod but I'm missing one detail please help, what needs to be fixed so that an item that can be moved can be used with recipes.
--LOG -- RecipeManager -> Unable to create a recipe for this moveable item: Antiserum.LabSpectrometer.
How do I flip the models, because I tried to do it in blender, but it didn't work
Saw a sword mod that has a couple of rotation axis and such at 180deg. Maybe you can add this under your model (where you define mesh and texture) and use it to move the knife about as you need. I haven't tried anything such before, but it may work.
I did not reply on last message, see above ^.
Which rotate axis, y or x
z
Dont know
And in Blender, it may work if you rotate the mesh in edit mode, and not rotate in object mode, if that was what you where doing.
Thanks man
For testing purposes, is it possible to add mods manually to a server without them being on the workshop?
yes
Yea, I keep all my inprogress mods in the User/Zomboid/Workshop folder
Should be able to setup the server settings in game with the mod there
and just add them via mod id, forget the steam id?
Exactly, just skip the workshop bit
Got the stress test scenario for refreshing the grid down from 78ms to 5ms 
Nice difference
Hi there. I would be happy if an axperienced coder could look at this error and code and help me with fixing it.
Briefly speaking, after testing in Single Player and making sure that all works as supposed, I came to uploading update to workshop, however the results were not positive and I recieved multiple reports that the update was game breaking.
It might be a silly mistake, but in the current condition and moment, I am struggling to find a solution and test it on server. Thank you for your help .
function: spawnHelicopters -- file: UHSpawnHeli.lua line # 354 | MOD: UH 60 Helicopter SP/MP I V 2.0.
[07-05-23 00:13:56.950] ERROR: General , 1683407636950> 69 285 772> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getModData of non-table: null at KahluaThread.tableget line:1689..
[07-05-23 00:13:56.951] ERROR: General , 1683407636951> 69 285 772> DebugLogStream.printException> Stack trace:.
[07-05-23 00:13:56.953] LOG : General , 1683407636953> 69 285 774> -----------------------------------------
STACK TRACE
function: spawnHelicopters -- file: UHSpawnHeli.lua line # 354 | MOD: UH 60 Helicopter SP/MP I V 2.0.
[07-05-23 00:13:56.954] LOG : General , 1683407636954> 69 285 775> -------------------------------------------------------------
attempted index: getModData of non-table: null. ```
The code itself starting from line 352:
local pl = getPlayer()
if pl:getModData()["TriedHeliSpawn"] == nil then
pl:getModData()["TriedHeliSpawn"] = {}
end
-- Chance
for i, p in ipairs(Heli_spawn_points) do
if p.x == square:getX() and p.y == square:getY() and pl:getModData()["TriedHeliSpawn"][i] == nil then
pl:getModData()["TriedHeliSpawn"][i] = true
if ZombRandFloat(0, 1) < p.chance then
if pl:getModData()["SpawnedHeli"] == nil then
pl:getModData()["SpawnedHeli"] = {}
end
pl:getModData()["SpawnedHeli"][i] = true
spawnHeli(p.x, p.y)
end
end
end
end
getPlayer() is returning nil
Perhaps a check to guard against it running as the server, as the server wouldn't have a player to return for getPlayer()
So this is kinda fun... you know how you can rename duffel bags in the base game?
It's not a fully MP compatible feature
if you rename something while it's not in your inventory (like in the trunk of a car) those changes won't be seen by the server unless the OG player puts the bag in their inventory. If the server restarts before that happens it'll revert to default
Moveables can't be ingredients in recipes, only the resulting item I think
Thank you very much, I'll try to make changes and I'll let you know how it turns out.
So after couple hours of trial and error.... It still is like this
Tried rotating it in blender, and attachments. Nothing worked
Would anyone have advice on how to write a patch mod to remove modded items from spawning? I specifically want to remove the skill books that another mod adds to the game. Normally I would just edit the distribution file of the mod locally, but I'm looking at running a server and so need a better solution.
the easiest way is to just do what you're already doing but override their file in your mod
if a file with the same name and directory exists in multiple mods only the one with the latest load order will be loaded
there are lua functions to remove item from distribution too
make a mod that simply remove the item and load it after
Has someone modelised or precisely described the Cell Vs Chunk Vs Mapload systems ?
server/mod_name_distribution_patch.lua
local function postDistributionMerge()
RemoveItemFromDistribution(SuburbsDistributions, "ModuleName.Razor")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
cell: the currently loaded area centered around the local player(s), size varies based on resolution; not related to 'mapping cells' which are 300x300 areas
chunk: 10x10 areas - the cell is always an integer number of chunks, a chunk is never 'half loaded'
mapload: are you referring to the OnPreMapLoad/OnPostMapLoad events? those are called before and after the cell object is first created when the game is loading
as far as i've been able to tell 'mapping cells' just straight up don't exist ingame
thx, I was confusing cell and mapping cells. your definition of cell explains partially what I referred as mapload systems.
yeah, it's a very common confusion
Also what happens to map objects (and zombies) when they leave the cell ? (when the cell leaves them). I see they are still available when the cell comes back later
i honestly have no idea, i assumed they were unloaded immediately so you probably know more than me in that regard
So I'm trying to make a wallet thats like the keyring, but holds money. Does the keyring have some special code to make it show up as a container in the players inventory automatically?
distant objects are unloaded
Yes, PZ code is filled with keyring specific references. This is a tricky path. I'd suggest to refer to common bags instead. there is code ready to restrict what can be put in any container.
ty, i'll check it out
They must be stored somewhere as they reappear when coming back.
was common bags the mod name?
everything is stored in the maps files
loaded only when needed
things like food that rots are special code that probably use timestamps to compare and advance their rotten state for example
but as the food item is unload it doesnt exist anymore so it is not rotting unless you come back 3 days later, game loads it and compare the timestamp to update it rotten state
Yep, it's the setAge() function
its a theory i didnt check the source for what im saying
Generators technically do the same thing when you leave their cell
The only reason it does a loop in cell is for the noise checks
Otherwise it would also only ever update when you check it
No, I was refering to vanilla bags. You can see an exemple in Autoloot mod, Autoloot_InventoryContainerFilter.lua the key word is "AcceptItem"
ah ok, ty
so can you only set it by category, or can you set it for exact items?
sorry for so many questions
more precisely, for your wallet, you can add in the script AcceptItemFunction=MyFunction and implement function MyFunction(container,item)
you can write a function to make it filter items by whatever you want
in that function return true if the item is the one you want
it must be a nightmare code to handle the different cases when the zone powered by the engine is partially loaded
the power is written into squares
generator updates nearby square for the electricity value
There was a big bug with generators - I think if you came back quick enough from out of the cell the fuel wasn't spent
so if I leave my generator zone when he is nearly depleted and comes back 1 month later and wake up my fridge before the generator, the food will be considered fresh. If I wake up my generator before my fridge, the food will be rotten ?!
I'll change my base layout immediately ๐
honestly its misterious how things works lol
Agreed, implementing the Coolbag was a nightmare because of that.
function AcceptItemFunction.Wallet(container, item)
local itemName = item:getFullType()
return itemName == "Base.CreditCard" or itemName == "ModuleName.Money1" or itemName == "ModuleName.Money5"
end
ty, I was looking at the luaexample in the vanilla folder trying to figure this out
i had an unreleased mod with all money and wallet things just like you want to do. Pennies, Dimes etc
not sure where that is now
yeah the one on the workshop wasn't working for me because i think they copied the itemapi code and slapped it in their module. I was trying to make something simple just for the credit cards and money in the game.
turns out trying to just copy the keyring item script didn't work out lol ๐ฆ
yeah editing base wallets is a pain
had a lot of trouble getting wallets to work
at some point my player were just not using them cause of random bugs where they lost their money etc
So i made custom wallets and removed base wallets
you could use ReplaceItemInDistribution to replace them if you end up making custom(using same texture and models) one, but this would also remove existing(prior to installing that mod) wallet in save games
tysm, I got them accepting only money and credit cards now
now i just gotta get them working in the player inventory
you mean like without equipping them in hands?
yeah
check in media\lua\client\ISUI\ISInventoryPage.lua line 1343
OK, I am curious, at what point is a mod considered "abandoned"?
Thank you for the help ๐
ty, gonna mess with that line to get it working with the wallets!
There isn't a universally agreed-upon definition for when a mod is considered "abandoned." However, a mod can generally be considered abandoned if it meets some or all of the following criteria:
- Lack of updates: The mod hasn't received any updates or bug fixes for an extended period, which could be anywhere from several months to years.
- Unresponsive developer(s): The mod author(s) or team is no longer responding to user inquiries, bug reports, or feedback on their official channels (e.g., forums, websites, social media).
- Incompatibility with newer game versions: The mod is no longer compatible with the latest version(s) of the game it was created for, and the developer(s) have not provided any updates to address this issue.
- Declared abandonment: The mod author(s) or team has explicitly stated that they will no longer support or develop the mod.
- Disappearance of the mod from official channels: The mod has been removed from its official hosting platform(s) by the author(s) or team, without any indication of plans to re-upload or continue development.
It's important to note that the perception of abandonment can vary among the community, and sometimes, mod authors may resume work on a mod after a long hiatus. In other cases, abandoned mods may be picked up by other developers or modding teams and given new life.
Yeah, I read the TIS policy on modding
I've been trying to follow-through and get clarity, even email TIS (no response though >_<)
Contact the mod author and ask the community. It's usually common sense but also the community may know about the mod author if he disapeared etc
Also, for more context...
Mod in question: https://steamcommunity.com/sharedfiles/filedetails/?id=1905148104
I have been working to update that since I found it on the steam workshop, but it has not been updated for over 3 months.
There have been a ton of issues with the mod reported by the mod users and the author has not responded to any of them.
However, there are some functioning stuff that got me interested enough to update it on my own and run it locally for my own use.
I reached out to the current author, who has been non-committal about letting me updating it... and unclear about me distributing it on the workshop.
Current Author is "loosing drive" to update
https://steamcommunity.com/workshop/filedetails/discussion/1905148104/3823036151085423787/#c3823036783902626787
My permission request thread
https://steamcommunity.com/workshop/filedetails/discussion/1905148104/3823036151095293803/
The other (previous) author permitted the go ahead using the current author's mod as a base.
https://github.com/DartVonRyuu/SuperiorSurvivors_Revisited/discussions/52#discussioncomment-5738269
Removing the embeds...
No food will be rotten, the gennie bug was that if you came back before it would have run out the fuel would pick up where it left off with the in-cell ticks
So it would be a rollback effectively
so basically the game load the square and do some magic calculation to know about how long the genie has ran out of fuel to apply the correct rotting value
How do you add code here ?
AcceptItemFunction is a global TIS object.
so create a server/MyMod_AcceptFunction.lua file and add your function in it, make sure to prefix your function too, so it doesnt conflict with other mods
-- This is based off media\lua\server\Items\AcceptItemFunction.lua
WAcceptItemFunction = WAcceptItemFunction or {}
function WAcceptItemFunction.Wallet(container, item)
local itemName = item:getFullType()
return itemName == "Base.CreditCard" or itemName == "Base.Money" or itemName == "Base.SheetPaper2"
end
thats what mine looks like and it works
How do you add code here (in discord !) ๐
```lua
-- code
```
oh sorry ๐ฆ
3 tilde marks (left of 1) i think
'''lua -- code '''
haha i feel so dumb, i couldn't find the tilde mark key so i had that pasted in a text file........
it was smudged out on the keyboard :S
` not '
then in your script.txt you would use:
...
AcceptItemFunction = AcceptItemFunction.Wallet
...
there are two way to limit container item:
OnlyAcceptCategory
AcceptItemFunction
beware, 'bugs' reports are often just errors or misunderstanding on the user side. and if a mod works no update is a proof of resilience, not an abandon.
from what i've heard there's already multiple continuation projects for superb survivors
oh, i'm aware, hence I have a repo fork of the steam version... with all the credits the og author did not include.
https://github.com/shadowhunter100/SuperbSurvivorsContinued
... in fact, are you the author of "CharacterSave"?
yes
right, the author apparently had a "required" import of your mod that I had to remove, turns out he never credited you... so uh, I guess i'll apologize on his behalf.
I do not see how superb survivor can have any dependency on character save.
the former was initiated long before the later.
and topics looks very different
Don't ask me, I saw it in the code
and I was wondering why it was required
and since I found out it wasn't actually used anywhere, I removed it in my own update
if it's required but not used it was probably to enforce load order
yeah so it was only a require failed warning in the console log. not a dependency
and i don't think a require call is really something you need to credit someone for ๐ (if it's not actually then using the code it's requiring)
hrm, so i must be doing something wrong, i have this in the lua > client folder
local it = playerObj:getInventory():getItems()
for i = 0, it:size()-1 do
local item = it:get(i)
if item:getCategory() == "Container" and playerObj:isEquipped(item) or item:getFullType() == "Base.Wallet" or item:getFullType() == "Base.Wallet2" or item:getFullType() == "Base.Wallet3" or item:getFullType() == "Base.Wallet4" then
-- found a container, so create a button for it...
containerButton = self:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())
if(item:getVisual() and item:getClothingItem()) then
local tint = item:getVisual():getTint(item:getClothingItem());
containerButton:setTextureRGBA(tint:getRedFloat(), tint:getGreenFloat(), tint:getBlueFloat(), 1.0);
end
why don't you simply add a new container position specific to your wallet ?
I see, I'll keep that in mind, it just seems awkward there were numerous references that were simply there without context...
you're right, but imagine maintaining a big thing like Superb survivors..
Yeah, IMO, the author overgrew what it should have been doing.
I was trying to use the keyring code :S
You'd be better off asking Aiteron for his project tbh
or permission to continue a fork of it
SuperbSurvivors is not written very cleanly, and when Nolan returned he smushed all the codebases together quickly
So you have many many hands and very little QA
- it is old
You can use the event OnRefreshInventoryWindowContainers
let me try something to show you
please point me in the right direction as I didn't find any other npc spawning on the steam workshop :(
He never uploaded it afaik and he never "finished" it
My mod doesn't work with PZPW but work when I create all files manually. What is the problem ? (I don't know if it is well explained)
He has a discord server - but he was hired on -- he's the same Aiteron in red at the top
Ah... then he must be working on that for build 42/43...
Someone uploaded it to the workshop - gross
I don't see his server so I guess he closed it
Ooof.
I did client/media/scripts file.txt
I don't see where I missed something ๐ฟ ๐ง
all i wanted were some npcs to guard the base with a rifle and maybe automate some farming work.
All scripts and image etc goes into assets/the-mod/media/etc, it will be copied automatically on build
try adding this to your client script:
Events.OnRefreshInventoryWindowContainers.Add(function(_self, event)
if event ~= 'begin' then
return;
end
local playerObj = getSpecificPlayer(_self.player)
if _self.onCharacter then
local it = playerObj:getInventory():getItems()
for i = 0, it:size()-1 do
local item = it:get(i)
local fullType = item:getFullType()
local isWallet = fullType == "ModuleName.Wallet1" or fullType == "ModuleName.Wallet2"
if item:getCategory() == "Container" and isWallet then
-- found a container, so create a button for it...
containerButton = _self:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())
if(item:getVisual() and item:getClothingItem()) then
local tint = item:getVisual():getTint(item:getClothingItem());
containerButton:setTextureRGBA(tint:getRedFloat(), tint:getGreenFloat(), tint:getBlueFloat(), 1.0);
end
end
end
end
end);
Idk if this was the latest pass or not
Yeah, over 2 years ago at a glance.
Oh. ๐ฟ ๐ง
I am the greatest noob, you all are just imitations
remember after publishing the mod to the workshop it will assign an ID, add that id to your pzpw-config.json so that it generate the correct stuff after
But how can I find this information by myself without spamming this channel ? I mean I am learning all steps by steps with patience, how to check errors in console.txt, checking documentation, but sometimes I just don't get it 
Well you can even try asking chat gpt but otherwise just ask here lol
Thanks! I don't know if I'll use that or ask to use it; but the code itself is definitely easier to read than what I had to work with in SS...
it's definitely something I can try referring to if I ran into an issue.
๐ Aiteron's a machine - he got alot done quickly
Nobody here will be annoyed if I keep spamming for help ? I want to ask help of community for great problems, not stupid ones like this one 
Honestly idk what is a stupid question, try researching and if you dont find ask here.
yep I think I will learn more how to find the answer by myself before asking here
๐ค
ChatGPT won't help much with PZ-specific LUA... but it can help you automate some functions generation.
