#mod_development

1 messages ยท Page 44 of 1

bronze yoke
#

yeah, that's what we've spent the last few hours doing ๐Ÿ’€

#

i'm looking through this mod at the moment to see any signs it could break something

hearty dew
#

Mm, kind of hard if you can't repro it yourself. Ideally, you could see both server and client logs to verify the server command was or wasn't sent and the client-side did or didn't pick up the command

bronze yoke
#

i have asked him for server logs before, but it seems pretty clear that the client is the issue

#

i don't see any sign in the other mod that it would break this one, and certainly not permanently

#

it might be the save file... there is some weird stuff going on there

#

something i noticed early on is that every container has an extra item in it that is literally just nil, i have no idea what that's about

trail lotus
bronze yoke
#

if that was it it'd happen on my end too, and it would've caused errors the whole time, definitely just something weird that's happened in your save

trail lotus
#

Hmm. Hopefully the next go around we can prevent the save from being corrupted in this way.

hearty dew
#
Utils.getNumberOfClients = function()
    local onlinePlayers = getOnlinePlayers()
    if not onlinePlayers then
        -- onlinePlayers is nil in singleplayer
        return 0
    end

    local onlineIDs = {}
    for i = 0, onlinePlayers:size() - 1 do
        local player = onlinePlayers:get(i)
        table.insert(onlineIDs, player:getOnlineID())
    end

    table.sort(onlineIDs)
    local numClients = 0
    local nextClientsPlayerID = 0
    for i, id in ipairs(onlineIDs) do
        if id >= nextClientsPlayerID then
            numClients = numClients + 1
            nextClientsPlayerID = math.floor((id + 4) / 4) * 4
        end
    end

    return numClients
end
odd notch
#

the way i ended up doing it was storing to the item's moddata the original values i needed to keep track of when the user opens the edit item menu

#

an ugly way could be creating an item of it's type, copying it from that, then deleting said item but that felt too excessive and prone to ||unforseen consequences like the item not getting deleted in time/tidily||

thick karma
#

@undone elbow Sorry to bug you, but is there any way to push a settings change to Mod Options without entering the options menu and have that change actually appear in the menu?

#

I tried :set on the gameOption in one of the options objects that we get back from .options_data, but the options screen checkboxes were unaffected, so not sure if I did it wrong or it's just not possible

trail lotus
#

If anyones interested Iโ€™m currently working on a Project zomboid Roleplay server that contains no zombie lore and is purely player to player interaction. Thereโ€™s tons of custom systems and ui I have planned and need help implementing them. If youโ€™re interested in joining the team let me know! Weโ€™ve got a large discord server with tons of members to give feedback. I also plan on creating a board of where we are now and where we need to be in terms of creating new mods. Also you will most likely have to work with others to help integrate each otherโ€™s systems and make them work together. I will share a brief and bare sheet containing the planned systems or systems we currently have in place. I will also be providing a separate server duplicate to the beta the players play on. This server will be accessible to all devs working on this project and you will be free to test your mods with our current mods before testing it on the main server

#

And of course Iโ€™d be buying you coffee if you joined my team and helped us on this journey ๐Ÿ˜‰

thick karma
#

lmao your crew is gonna need a hell of a lot of coffee @trail lotus

bronze yoke
#

hehe well that works for me

ancient grail
ancient grail
#

I bet sir nolan can do the npc part of this

ruby urchin
#

if a player death, his ModData is reset?

ancient grail
hearty dew
#

No idea. Maybe it is copied over to the IsoZombie? ๐Ÿ˜…

astral dune
#

I imagine a new character is a new object, ya

ruby urchin
#

I can test it, but well I just ask here to save a little of time

ancient grail
#

Or maybe its just there but wont have anything to do with the player that respawns

#

Why theres no modder streaming while doing mod? Cuz it ruins concentration? Hehe

#

Id like to watch u guys in action

astral dune
#

I can't imagine watching somebody coding, lol

ruby urchin
#

AuthenticPeach stream modding on twitch

astral dune
#

I don't even like watching myself coding

ancient grail
#

Well not twitch but on a room where its direct and people help out too oreveryone doing own work but is just there streaming for social reasons

#

Anyone has snippets for moddata?

late hound
ancient grail
late hound
#

mainly, but I don't do mapping there (personally not a fan of doing map modding)

ancient grail
#

ok ๐Ÿ™‚ ill watch sometime when i see you thnx for the heads up

odd notch
drifting ore
#

Can anyone direct me to the mod that provides a live minimap of all active zombies within the vicinity as they move about?

ancient grail
#

theres already something like that

drifting ore
#

Yea do you happen to know the name of it?๐Ÿ˜…

#

Trying to find it on the workshop.

odd notch
#

right click -> ui -> zombie population i believe

ancient grail
#
ZombiePopulationWindow.OnOpenPanel();
drifting ore
#

Ohhh, alright. Saw it in a vid, figured it might've been a mod.

ancient grail
#

do this when you are on debug @drifting ore using lua console

#

or what buffy said .. hehe

ancient grail
#

this is amazing

odd notch
#

takes the item they view and rolls the chance of it being a certain tier

#

can apply to any item from any mod

#

in my use case it applies to weapons via

if item:getModData()['_itemTier'] == nil then
    if instanceof(item, "HandWeapon") then
--etc
ancient grail
#

yeah but it overwrites how distrib does things right? makes it easier for non modder admins

odd notch
#

it negates distribution entirely

bronze yoke
#

extremely interested to see what people will do with that

ancient grail
#

aw then what if you have an item that you dont want to spawn entirely ,. if you install this mod will it spawn by dfault or what

#

ah cool

odd notch
#

it's an in-house mod for my rp server

fast galleon
#

I need some help, when I try this in debug it works (set to 0, never find Burned Houses). But when I play I still find burned houses.

        for i=1,getWorld():getRandomizedBuildingList():size() do
            local story = getWorld():getRandomizedBuildingList():get(i-1)
            if instanceof(story,"RBBurnt") then
                print("test fires 2: story chance",SandboxRandomChance[SandboxVars.WorldOnFire.RBBurnt])
                story:setChance(SandboxRandomChance[SandboxVars.WorldOnFire.RBBurnt])
                break
            end
        end
weak sierra
#

oh it's not public?

odd notch
#

itssssssssssssssssssssssssssssss theres a collectionnnnnnnnnnnn ill dm you one sec

weak sierra
chilly flint
#

Sorry if I'm asking obvous but I just was not able to find it.
I would like to create a mod wich makes a new generator type.
This should be a 3 tile structure wich increased distance and fuel-capacity.

I just don't know where to start when it comes to modding.
Coding is no problem, I can learn that but I think this Idea is mostly copy and paste, the only problem is I don't know where to start and I can't find a proper guide for this idea

fast galleon
#

@chilly flint 3 tile structure? how do you place it, is it part of map?

chilly flint
#

part of the map

ancient grail
#

they just made moveable tiles worked earlier i think

chilly flint
#

don't need that, i want them to stay where they are for now

#

I just need a proper interduction wich I was not able to find. I'm just better when somebody tells me what to do

fast galleon
#

generators by themselves have a set range, can't edit that. You'll have to do some manual wizardry.

chilly flint
#

at this point I just want to get this Idea work. The how's can be adjusted later

ancient grail
#

try to duplicate the generator first i guess

#

thats a start

fast galleon
#

The steam powered generator, replaces the movable with an IsoGenerator when you place it. This solar battery bank needs more sprites and places a generator on top of moveable.

ancient grail
#

wow you know all about this @fast galleon

fast galleon
#

I started updating ISA for my SP and ended up with most of Lua made by me.

#

You can make it so that when an object with your sprite is first loaded something happens.

bronze yoke
#

generators have a fixed range? that sucks

#

at least i get to find out before i actually work on anything though

chilly flint
fast galleon
astral dune
#

is it possible to spawn a sprite or model on screen that isn't a vehicle/item/moveable? For example a balloon that just floats up for a bit before disappearing?

ancient grail
#

it is

#

check my script on my mod

#

it actually lets you pick whatever sprite

#

you can just pick from a custoim tile you do

astral dune
#

can you animate/move it when its on screen?

ancient grail
#

its possible but i havent done anything that animates. but the concept for that is just destroying the sprite and create another 1

#

just dont know how to make it so that its simultaneous

astral dune
#

is this tied to a particular cell or is it a free moving entity?

ancient grail
#

hmmm i think its tied to a cell but you can try to move it it might work if you setXYZ i havent really tried

astral dune
#

ok, well I'll have a look, thank you

fast galleon
astral dune
#

dislaik is always up to some crazy stuff

#

but now that I think on it EHE adds indicators pointing towards the helicopter which I don't think are vanilla, that may be a possible route as well

#

๐Ÿค” somehow this will work

ruby urchin
#

I mean, ModData disappear

#

Does anyone know if you can set the fps limit for a specific UI?

ancient grail
#

wow that looks awsome

#

is it mp ready?

fast galleon
hearty dew
ruby urchin
#

sorry I did my question poorly, you can set UI FPS on game options, but I would like to set an upper limit

fast galleon
#

if doUpdate then ...
another function sets doUpdate as true or just some condition when it needs to update

#

ah

civic lava
#

hey can someone help me qucik in VC

#

i need a question answers its simpole

civic lava
#

so... im trying to so If Panic = Panic 25-100 == true then chancemod = chancemod + 4;

#

but i need someone to help me

#

as if i write it wrong slightly it will break the whole thing or simply not work with conastant little errors on bottom right

hearty dew
civic lava
#

PLEASE i have been editing for over 6 days, my head hurtsm if anyone is feeling kinda PLEASE vc me & ill share my screen, i need a human to talk to

hearty dew
#

Can you just paste the code or screenshot?

ruby urchin
#

thx guys, This what I was searching getCore():setOptionUIRenderFPS(fpsTable[box.selected]) (I think I can see the difference between 30 and 60 fps lol, it looks good)

summer rune
ruby urchin
#

yeah, it's a waypoint mod, but I think it will take a while, I'm working on 4 other mods

summer rune
#

fantastic. i am hyped for this. ๐Ÿ™‚

thick karma
#

Y'all... there has to be a way. There just has to be. I must update the gd Options menu when my mod options get set. Anyone here an expert on the settings menu, especially how to toggle a redraw of the Mod Options page?

ancient grail
# hearty dew Can you just paste the code or screenshot?

yeah went to the vc with him and ended up giving him this

        if panic >= 50 then  
        basechance = basechance + 1 ;
        elseif panic >= 25 then  
        basechance = basechance + 2 ;
        end

turns out hios already being helped bysomeone else so i left

ruby urchin
#

lol this is weird, why require on server side always load client side, isn't this supposed to work like this?

undone crescent
#

anybody has an idea of an easy way to make a custom tile like a door unbreakable by Z, i tried with the tiledefinitions but with no luck so far ๐Ÿ˜ฆ

#

or like set the maxhp of that tile to super high?

undone elbow
#

Wait

#

:set should work

thick karma
#

Well I kind of ran out of energy after who knows how many hours updating 3 mods, lol, but if I get back to it I'll try to find a manual way. I ended up just leaving it up to players to reset defaults my having them click a toggle.

undone elbow
#

Why you need this?

thick karma
#

For me, :set works just fine if I do it from within your onUpdate(), but not outside of it.

#

Someone has loaded a mod of mine into a large population server and they would like to push new defaults to the players who have saved settings already @undone elbow

#

I was clientside, I don't know if that matters.

#

But yeah multiple times I verified that neither :set nor changing the action option in MyStuff.mod.options affected the appearance of the tickboxes in Options.

#

Although both worked

#

They both changed the setting

undone elbow
#

I think it also should work in OnApply

thick karma
#

Right, but I need it to work when the player loads into the game.

#

I was hoping to force the settings change at the request of the host.

#

As I said, I gave them a solid ass workaround, but still

undone elbow
#

settings:loadFile()
options.myoption = true -- default

#

Well, I'm not sure why you need this feature OUTSIDE of the mod (i.e. if the ModOptions is disabled?)

thick karma
#

No I need to fire it outside of the main menu

#

Mod Options is enabled

#

I need to fire it without the user's confirmation

undone elbow
thick karma
#

What exactly is settings? Is that the variable that goes into the instantiate call or whatever you called it? (Afk for a minute)

undone elbow
#

loadFile - loads options from file,
then you may overwrite the values

#

settings is the main instance of ModOptions and also it's settings of your mod

thick karma
#

And loadFile refreshes the Main Menu Options screens?

#

Or at least refreshes Mod Options screen?

undone elbow
#

loadFile() makes so it won't load later on load for your mod.

thick karma
#

You mean if I load from file it will not overwrite what I load with saved user settings?

#

That's the goal here. I can change the settings already. Only their appearance in the menu is the problem.

#

They change, but they LOOK unchanged

#

Incorrectly

undone elbow
#

I'll answer in 50 min, a bit busy now

thick karma
#

No rush at all

#

I might pass out tbh I've been modding for a long time today

ancient grail
thick karma
#

I just finished so much modgress successfully

#

I want to play now @ancient grail lmao

#

I'm pretty sure I haven't played this stupid game in hundreds of hours

ancient grail
#

i havent played it in months lol

#

have a good one

#

anyone uses a tool for making their UI?

undone elbow
#

@thick karma ```lua
-- These are the default options.
local OPTIONS = {
box1 = true,
box2 = true,
reset_deafults = false,
}

-- Connecting the options to the menu, so user can change and save them.
if ModOptions and ModOptions.getInstance then
local settings = ModOptions:getInstance(OPTIONS, "MyDebugMod", "Debug Mod")

local reset_deafults = settings:getData("reset_deafults")
function reset_deafults:onUpdate(val)
    if val ~= true then
        return
    end
    settings:getData("box1"):set(true)
    settings:getData("box2"):set(true)
    settings:getData("reset_deafults"):set(false)
end

end```

#

(implementing the way 1)

clear bloom
#

hey everyone

#

i had a mod i was making

#

and i stopped making i got busy with other stuff

#

and then i got sick(still am haha)

#

today i tried doing more stuff for the mod but nothing works

#

at this point i literally had one script change

#

the file is the same

#

and everything

#

if anyone could help i would really appreciate it

ancient grail
#

whatcha working on?

clear bloom
#

a mod about stakes

#

for now i had it so stakes are made with planks

#

3 stakes

#

btw how do you do that different looking text for coding

#

module UppingTheStakes
{
imports {
Base
}

recipe Make Stake
{
Plank,
keep [Recipe.GetItemTypes.SharpKnife]/MeatCleaver,

Result:Stake=3,
Time:80.0,
Category:Survivalist,
OnGiveXP:Recipe.OnGiveXP.WoodWork5,
    Override:true,

}

}

#

i had this is the files

#

it was on the folder the game says the mods will be in

#

@ancient grailshould i maybe remove it from the other mod folder?

ancient grail
clear bloom
#

the one in the steam files

ancient grail
#

what are you saying? what steam files?

#

you mean lua?

vocal onyx
#

How can i get a permission

ancient grail
clear bloom
#

one separate from steam

#

and one on the steam folder

ancient grail
#

the users?

clear bloom
#

ye ye

#

the users one

#

that's the one the game says the mods with be in

vocal onyx
clear bloom
#

should i remove it from the steam folder?

ancient grail
#

are you just asking where to put your files to upload to steam?

ancient grail
clear bloom
#

no no no i mean is the fact that i put them on the 2 folders the thing that makes the mod not work

ancient grail
#

i really dont understand what your saying ๐Ÿคช
can you be more specific as what did you put to what exact folder

clear bloom
#

i put the script file for my mod on the users zomboid folder

ancient grail
#

...\SteamLibrary\steamapps\common\ProjectZomboid\media

#

dont put anything here

clear bloom
#

SteamLibrary\steamapps\common\ProjectZomboid\mods

#

i mean this

#

the steam one

#

Users\kopv1\Zomboid\mods

#

this is the users one

clear bloom
ancient grail
#

u have to put the mods on the users

#

Workshop if your going to upload it

clear bloom
#

ye and put them there

ancient grail
#

dont have to put it on the steam

clear bloom
#

but should i remove them from the steam one

ancient grail
#

yes

clear bloom
#

ok ok

#

didn't work

#

@ancient graildo you have any idea why

ancient grail
#

What do u mean ?

clear bloom
#

the mod still doesn't work

ancient grail
#

Do u see modtemplate on the workshopfolder of the users folder

#

Use that put your script there properly and learn the pz file structure in regards to modding

clear bloom
#

everything seem to be in order

#

i have the mod.info file next to the media folder

ancient grail
#

whats writtien on the mod info

clear bloom
#

the name and the description

ancient grail
#

which is?

#

you have to keep the id blank

#

did you put anything on the id

#

the workshop is going to give you the id number once you upload it

clear bloom
#

name=Upping the Stakes
description=Mod centered around making stakes a more practical weapon to use, including improved accessibility and quality of life/realism improvements.
Included changes:
Making stakes able to be crafted with wooden planks. 3 in fact.
Making stakes able to be repaired(not that useful but just makes sense). Half the requirements of a spear.
Making stakes have a carpentry boosted maintnence stat.

ancient grail
#
name=Upping the Stakes
description=Mod centered around making stakes a more practical weapon to use, including improved accessibility and quality of life/realism improvements.
description=Included changes:
description=Making stakes able to be crafted with wooden planks. 3 in fact.
description=Making stakes able to be repaired(not that useful but just makes sense). Half the requirements of a spear.
description=Making stakes have a carpentry boosted maintnence stat.
id=
poster=poster.png
undone elbow
clear bloom
#

i replaced the folder with that

#

*file

#

should i have a image named poster on the same folder

#

so it uses that image

ancient grail
#

have you activated the mod? maybe you didnt activate it?

clear bloom
#

maybe?

#

how do i activate it tho

ancient grail
#

Users\kopv1\Zomboid\Workshop\ModTemplate\Contents\mods\ModTemplate\media

#

here do it here

#

just put it there make a script folder and activate modtemplate

#

dont modify anything else

clear bloom
#

ok ok

#

still doesn't work

#

ok it works

#

@ancient grailthanks

#

just weird how this is the only way for it to work

#

even tho it used to work completely fine

ancient grail
#

thats not it theres something wrong with your file structure or modinfo .. the template ensured less human error

deep depot
#

guys, is there any mod out there that make our character can't be killed? still get fatally injured but not get killed...

drifting ore
#

anyone know a good build for the More Traits mod?

ancient grail
#

guys is it possible to do elseif _ and __

ancient grail
#

havent personally tried it tho

clear bloom
#

@ancient grailhey dude

#

btw

#

i was messing with the files and i got my mod to appear in the mod option in the game

#

with the description and the correct name for the mod

#

but when i click to enable the mod

#

nothing happens

#

it doesn't turn green and doesn't say enabled

ancient grail
#

can we use gif as mod poster

ancient grail
clear bloom
#

hmmm

#

i just copied the mod template folder

#

and replaced the maps with my scripts

ancient grail
#

and you only have one file right

clear bloom
#

while naming it what i wanted and putting my image

ancient grail
#

you should put it on a folder named scripts

clear bloom
#

ye i did that

ancient grail
#

then its on your scripts

#

paste it here

clear bloom
#

i deleted the maps folder and put it on the scripts folder

ancient grail
#

right then paste the code here

#

must be something there

clear bloom
#

C:\Users\kopv1\Zomboid\Workshop\upping the stakes\Contents\mods\upping the stakes\media\scripts

ancient grail
#

no imean the contents of the txt file you added

#

did you add?
module Base {
}

clear bloom
#

the script file didn't change

#

it never changed

#

and it worked when i just put the scrip folder in the mod template

#

module UppingTheStakes
{
imports {
Base
}

recipe Make Stake
{
Plank,
keep [Recipe.GetItemTypes.SharpKnife]/MeatCleaver,

Result:Stake=3,
Time:80.0,
Category:Survivalist,
OnGiveXP:Recipe.OnGiveXP.WoodWork5,
    Override:true,

}

}

#

@ancient grailbut just in case i got something wrong

ancient grail
#

Just make it base since its baseitems

clear bloom
#

the category?

ancient grail
#

Remove the override whats that for. Havent seen that

#

The module UppingTheStakes
No reason to do this

#

Youre not creating an item anyways ๐Ÿ™‚

clear bloom
#

ok ok

#

module base
{
imports {
Base
}

recipe Make Stake
{
Plank,
keep [Recipe.GetItemTypes.SharpKnife]/MeatCleaver,

Result:Stake=3,
Time:80.0,
Category:Survivalist,
OnGiveXP:Recipe.OnGiveXP.WoodWork5,

}

#

so this?

ancient grail
#

Add module Base

#

Ahhhh the result

#

You cant have multiple items as result lol

clear bloom
#

really

#

but when i did it it worked

ancient grail
#

Thats why

#

Ehhh?! Woah really? Nah it doesnt allow multiple result

Can anyone vouch for it?

Or am i the only one who didnt know that was possible?
I had to use OnCreate
And added lua files with additems

Lol

#

But if it worked for you then whats the problem then ?

clear bloom
#

nah you can do it more than 1

#

i can vouch for it

#

it's worked for me

clear bloom
#

the weird part is that the mod worked perfectly

ancient grail
#

Cool then youve done the mod ๐Ÿ™‚ congrats

clear bloom
#

it just suddently stopped working

ancient grail
#

Yeah i dont have a clue on that one sorry

clear bloom
#

it's alright

#

you have helped me so much man

#

sorry to bother you so much

ancient grail
#

๐Ÿซก

clear bloom
#

@ancient graili did it!!!!!

#

it's even being uploaded to the workshop

rose trail
#

Im making a mod to add recipes and an item but somehow when i click the craft menu it brings me to this page

devout galleon
#

anyone knows if you can have multiple animations in a recipe? for example first Blowtorch animation followed by hammering?

devout galleon
#

it could be a simple thing like a typo

#

or forgetting a comma

ancient grail
devout galleon
#

stuff like more builds as example is cool and all but sucks for MP servers

#

its broken and unbalanced and lots of lazy coding

#

and the menu bloat is insane

#

so i am shifting all of that to the actual crafting menu

ancient grail
#

this is all i have that involves what you want to do

getPlayer():playEmote("Build");
getPlayer():playEmote("BlowTorch");
getPlayer():playEmote("BlowTorchMid");
getPlayer():playEmote("BlowTorchFloor");
getPlayer():playEmote("Craft");
ancient grail
devout galleon
#

i see

#

would you know how to chain them?

#

like

#

lets say time =1200

#

and every 200 it changes the animation

#

thats kinda the plan i have

#

but honestly finishing the recipes rn before i add that

ancient grail
#

I really dont but if u dig deep enough i believe tyrir posted something that lets u que action

devout galleon
#

i see i will have a look at that

ancient grail
#

Not 100% if it was him tho

devout galleon
#

will figure it out eventually

#

just want to have some nice immersive animations

#

since i mainly make this mod for the rp server i run rn

#

and immersive animations/recipes are like one of the best things for that

ancient grail
#

Awsome pls do share if u manage to pull it off . It will add extra flair to any mod

devout galleon
#

yeah will 100% share it

#

i wish it was as easy in the recipes to like
time=200
animation xyz
time 300
animation xyz

๐Ÿ˜‚

#

might be easier tbh to just create new animations by chaining them together

#

but allowing to queue them properly would make it easier to be applied to other mods

#

and to customize

ancient grail
#

Yeh kinda does make you wonder why its not

devout galleon
#

yeah TIS prolly never expected a bunch of RP servers to pop up that really value immersion in every small thing ๐Ÿ˜‚

ancient grail
#

Yeah you could make it like evolverecipe ithink or is it that one for like wall structure levels

#

U just need lots of tile for that tho

#

Like imagine building a table
Where the first part would be puting the objs on the ground with looting animation
Then swtting it up with hammer animation and a tile that shows the legs not yet attached
Then screwing them

#

Would have to just repeat it with every table lol sounds like lots of pain tho

devout galleon
#

yeah but its way cooler than

#

Anim=BuildLow

#

haha

dim geode
#

Mod idea (if someone hasnโ€™t said this yet Iโ€™d be surprised)
Vault over counters in buildings like Knox bank and the ice cream shop to quickly get away from zeds (especially when you play sprinter zombies!)

steep copper
#

Hi, do we have any documentation about the context menu ? I wanna add an option on a item in the right click menu
Thx

#

I can't find information on the forums/google

ruby urchin
ancient grail
#

my mod is done but i just need one last thing.. when i added an item on the ground how do i refresh so that it apears? i tried the
ISInventoryPage.renderDirty = true;
but it didnt show

ancient grail
ruby urchin
#

finally Non-global environments

#
local ENV = require 'DislaikLib/ENV';
local EVENTS = require 'DislaikLib/Events';
local _ENV = {};
ENV.Add(_ENV, EVENTS);




Test() --> THIS IS A TESTITO XD
#
print("FDISLAIK START")

print(Test) --> nil
#

ENV and EVENTS are local modules

gilded hawk
grim rose
#

hello ya all its me again, and i come here looking for help (again)

#

last time MX allowed me to check his code how to make pills usable, and its great

#

but i can't script pills to remove food poisoning efects

#
PILLCore.init = function ()
 local player = getSpecificPlayer(0)
end

PILLCore.applyMedication = function ()
    player:getBodyDamage():setFoodSicknessLevel(player:getBodyDamage():getFoodSicknessLevel() + 20)
    player:Say("I feel bit better")
end
#

this is my code for now

#

it "works" if command for food sickness works

sour island
#

@weak sierra I whipped up some sandbox options for named lit ๐Ÿ‘

sullen bobcat
#

Hi. First time making a mod, and I'm having a bit of mare of it, and any help would be very appreciated. I'm trying to mod in a few firearms, of which the base functionality is working fine after a lot of trial and error. I am now trying to get attachments working for these guns - currently the base game red dot sight. While the attachment is now in the right place - the model is somehow inverted, with only the back of the model displaying - with the camera facing side of the mode see through. The model is however perfect when placed, but having this inverted issue when equipped. I can show screenshots/ code where required - but for the attachments, I've been simply using the -debug mode attachment editor system. Thank you for reading

grim rose
#

anyone at least knows a what type food poisoning is?

#

is it body damage

#

do i need to create custom lua file to be able to affect it?

ruby urchin
sullen bobcat
ruby urchin
sullen bobcat
ruby urchin
#

Can you send images of the issue?

sullen bobcat
#

Sure

#

Im not sure how well it will come on in screenshots

#

You can see the back glass peice though the side

#

If i get the M16 to show as a comparison, you can see the issue

#

On the proper M16, the sight is rendered correctly, so the front facing side is correct, as you can see the glass sight on the red dot is such that you can only see the front, not the back piece at the angle, unlike the modded weapon

jade chasm
#

attachment reddot
{
offset = 0.0000 0.0850 -0.0480,
rotate = 0.0000 0.0000 0.0000,

#

use this in your media/scripts/(yourSMGname).txt

#

and rotate the attachment with x y z

sullen bobcat
#

back to square one - gotta love modding eh

#

Thank you though

#

Ive been such on this for a few hours

jade chasm
#

i'll DM you the .txt of a firearm i'm making and you can see the general format

ruby urchin
#

Anyone knows if there are a function like getCurrentNameMod or something like that?

vagrant geode
#

Any know of an NPC mods for multiplayer servers?

undone crag
#

(deleted, found it, was looking in the wrong part of the code)

swift sequoia
#

Am I correct in guessing that if I want to modify a mod, then I can just set the original mod (TheyKnew) as a dependency and it will load my mod (Shenanigans) after the original one, allowing my mod to overwrite parts of the original mod?

undone crag
#

I think so because I set something as a dependency and had a lua file with the same name and it prevented the original one from running.

swift sequoia
#

Okay cool

weak sierra
#

in SP perhaps that will work

#

but on a dedicated server u shud make sure to include instructions

#

all dep ensures is that it loads the other mod

drifting ore
#

is there anywhere i can look for a proper 'getting started' modding tutorial?
the wiki and such are quite outdated it seems

weak sierra
#

pick apart an existing mod instead is generally the answer you'll get around here

#

but there are some less out-of-date tutorials around

#

check pins maybe

drifting ore
#

dang, that sucks
ill have a look around on youtube and see if i can find anything helpful

#

i looked through the pins already and the wiki link is outdated and not helpful :c

weak sierra
#

u can certainly find tutorials for certain things

#

but

drifting ore
#

also doesnt help im new to lua but i can grasp it

weak sierra
#

"how do i make mods" is incredibly broad

#

kinda hard to covr that

drifting ore
#

well im not entirely looking for specifics, you know?
i was more so looking for a "getting started" kind of thing

#

just the basics of getting one goin

weak sierra
#

that varies by mod type

#

the way u hook in is different depending on the task

#

u can add items without ever writing a line of lua

#

etc

drifting ore
#

there IS specifics but i didnt think it was needed, my apologies

currently im looking for a way to detect when the player consumes food/drink/whatever else

#

a while back i found "ISEatFoodAction" but with the latest update to the game that suddenly broke the mod and i just ignored it until now lol

weak sierra
#

u would probably wanna find the code that handles that in the PZ lua files and then hook the relevant function by setting a var to it, then overwriting it and calling that var inside

#

ah

#

well something akin to that still exists im sure but i dont know off the top of my head

drifting ore
#

where would i look for PZs lua files?

#

i can find it on my own just didnt know where to look ig

weak sierra
#

in the media folder in the game dir

drifting ore
#

ohhh! im dumb lmao

#

thank you

weak sierra
#

/home/evelyn/.steam/steam/steamapps/common/ProjectZomboid/media/

#

linux but

#

im sure u can figure out waht that means for windows :P

drifting ore
#

yep

#

thank you very much

weak sierra
#

mhm

drifting ore
#

im super duper new to lua so i wanted to learn it via playing around with PZ modding

elfin stump
#

Awesome. Thank you, I will give this a shot!

civic lava
#

i made a mod but it doesn not show up in the game, its in the porper PZ mod files list inside a folder with a random numbers like the other form workshop

#

how do i gte my mod to be shown in the game?

undone crag
#

If you gave it random numbers then I think maybe you made a mistake and did something like this: \zomboid\mods\1234567890\contents\mods\yourmod\media instead of \zomboid\mods\yourmod\media.

odd notch
#

anyone know a way to disable collision on a tile object like stairs or a cabinet in-game?

#

trying to find a way to have it so i can set objects to be nocollided dynamically

civic lava
#

does anyone enjoy helping noobs mod PZ lua code in NotePad++, i request help! if you would like to chat & help me out a bit in Voice chat contact me any time, i have been streaming every day for 8+h trying to overhaul the game to be as realistic as possible but im not as skilled at some of the rest of you, so what takes me 2 hours might take you 30s

fast galleon
#

I wonder if it's possible to have a fake controller... Seems like Java side isn't exposed, but a lot of it is Lua side in JoyPadSetup.

clear bloom
#

anyone had problems uploading a mod to the workshop?

#

i made a mod and i wanted to upload it and it worked

#

but bcs i thought the only way to update it was to delete the mod from the workshop and upload it again i deleted it

tardy wren
#

You'll need to remove its ID I believe, from the workshop.txt file

clear bloom
#

ok ok

#

thanks

tardy wren
#

That's my guess at least, it tries to update a mod that doesn't exist

hearty dew
clear bloom
#

ye ye it worked

#

thank you

hearty zodiac
#

Hello, is it possible to โ€žpushโ€ a playerโ€™s character? Iโ€™m thinking about how human body would be sent flying on impact with a high velocity vehicle

#

Iโ€™m not asking for a code, just if itโ€™s theoretically possible

tardy wren
#

Well... You can shove a player in PvP to my knowledge

#

There's also a mod that lets you jump out if a moving vehicle, and you tumble out of it when you do

orchid moth
#

What are the best gun mods

drifting stump
#

did william tell you you can ask me anything about it? dont have much time to code but answering questions is simple

it also seems like you dont understand whats going on
everything should be local
you can access the variables from other files (like a global) by doing a module which is that return thingy at the end

worn sierra
#

Any good Tank Mods?

#

Like

#

A good, working one, wich isnt a WW2 one, for the current Version?

teal island
#

I might be misunderstanding what I've seen on YT, but is it possible to switch zombies back to being sprites?

#

I was looking into trying to insert custom sprites for a replacement/new unit thing

#

quality issues aside, it's mostly to toy around with it

tardy wren
#

The main reason Zombies were switched to 3d was performance, somehow they can render more of them 3d models than sprites. Also, lets them be more dynamic...

I very much doubt it would be easy, compatible, ir performant

sour island
#

I think the main reason was just scalability of animations / visuals

#

If 3D models were somehow more efficient then bodies wouldn't be flattened into sprites on death

#

Speaking of which, 3D ragdoll corpses would be neat

thick karma
#

I want the zombie to go barrel rolling to one side when my bat kills them in standing position

sour island
#

The two positions are because of the animations they use I think

#

I wonder if it would be difficult to add more

gilded hawk
#

Is there a way to disable seasons? ๐Ÿค”

sour island
#

I doubt theyd go for true Ragdolls, but I imagine they could have them ragdoll in some third party simulator and export those out

vast nacelle
#

Imagine the corpse piles.... Add collision and you could literally block yourself in while making a stand.

sour island
gilded hawk
#

I'm preparing myself to make a Zomboid Total conversion mod, that turns the game into SCP-3008

#

(SCP-3008 : The Infinite IKEA)

sour island
#

That'd be pretty neat

#

I kind of wanted to take a shot at procedurally generated stuff

#

Are you going down that rabbit hole?

gilded hawk
#

No no thank you, I still like having some degree of sanity

#

I'm planning in making a single massive map that repeats itself

#

if possible, as big as the vanilla map

sour island
#

Repeated by hand?

gilded hawk
#

I'm planning in using tile zed to make the template and then repeat it manually, but I want to see if I can make a tool to do it for me

#

But I need to learn how to make maps first, shrug cause I usually do only code

sour island
#

I wonder if it would be possible to have the game generate entire regions based on a template

#

Like just keep stacking more of the same map over

gilded hawk
#

I was thinking that it could be done, since we have the brush tool and the brush tool can add and remove tiles shrug

#

Maybe we can make a full lua generator shrug

sour island
#

That'd be pretty neat

#

I thought the interior cars mod was doing that

#

But I think they're using predone areas off to the side

gilded hawk
#

That's my assumption too, but I haven't looked into it

sour island
#

Basements should be generated as per the blog

#

I wonder if that's going to be expanded to the homes based on a lot to lot basis

gilded hawk
#

๐Ÿค”

sour island
#

Unless I woefully misread the recent blogs, basements are procedurally generated

#

I assume they meant even the map/furniture and not just loot

gilded hawk
#

Oh, that's quite cool

sour island
#

I could swear they had a really really old blog about mapping tools that basically filled a room/house automatically based on parameters

#

Like youd slap down an empty house, make room size changes, hit a button and it would populate it

#

Then you could tweak it as needed

gilded hawk
#

๐Ÿ˜ฎ

#

That would be so much usefull!

sour island
#

Can't seem to find the blog post

#

Maybe it's a fever dream

gilded hawk
undone crag
ruby urchin
#

custom triggerevent

#
--- client.lua
local onKeyStartPressed = function(key)
    local source = getPlayer(); if not source then return end

    if key == Keyboard.KEY_NUMPAD0 then
        TriggerServerEvent("ClientToServer:Example", "TESTITO")
    end

    if key == Keyboard.KEY_NUMPAD1 then

    end
end

Events.OnKeyStartPressed.Add(onKeyStartPressed);
#
---server.lua
RegisterEvent("ClientToServer:Example", function(source, asd)
    print(source)
    print(asd)
end)
fast galleon
#

probably need a send command in between

ruby urchin
#

also, they are made in a non-global environment, so those functions are not propagated in other files

bronze yoke
# drifting stump did william tell you you can ask me anything about it? dont have much time to co...

for some reason i was under the impression that requiring a file would create a local copy, not a reference to a global object๐Ÿคฆbut i just tested it and that is not the case at all... i thought doing things that way would make a mod difficult to patch
more importantly, in retrospect i feel that message was a little condescending towards you, i apologise
thanks for the offer of help, but it doesn't seem like the issue we're facing is likely much to do with the behaviour of the player shops mod, it's probably some strange mod conflict or something like that, so there isn't much i can think to ask you; i will keep that in mind though!

drifting stump
#

here you go

#

if you want to take it to an extreme you could also locally override the global space

#

the mechanism behind a module is when the file gets parsed and executed the final return statement gets stored. from there any require statement for that file returns that stored variable

bronze yoke
#

i knew what requiring did, but i didn't know that altering the variable in one file that requires it would affect it in other files that require it - i thought it was just a local copy

drifting stump
#

it also neatly deals with file dependencies

#

nah its a pointer

bronze yoke
#

i'll definitely be making use of that in the future, thanks for that!

drifting stump
#

and remember kids globals were a mistake ๐Ÿ‘‹ back to work

rancid barn
#

is the "Robomats Modding Tutorials" post still relevant for modern pz modding?

civic lava
#

is this broken code for effecting the player negatively if i add a negative

#

also how would i make this a thing where its a random chance to trip

#

i want the player to have negative effects such as dropping weapons & tripping when under extreme stress & many other overhauls (PS) i dislike more traits mod version that does similar things

fast galleon
#

How do I make tooltips appear for world menu with my fake controller ๐Ÿ˜…

#

which button is it

gilded hawk
#

Good news! The workshop.txt editor is going good!

blissful salmon
#

I did some testing with reanimated players (as zombies). I think (really not sure) if I check if the zombie is reanimated on server side (first occurence of this zombie in onZombieUpdate event) and send a command to the client, the client doesn't necessarily already know the zombie ID. Can anyone confirm that?

undone crag
#

I have tried sending zombie references between client server and it has failed. :/

gilded hawk
blissful salmon
#

I don't expect refernces to work... Because they can't be the same over network... (client/server)

sour island
#

Zombies should have something to match network ID

#

Worst case scenario you can have the sound play to the same xyz

#

If they're out of sync that's another issue entirely

placid delta
#

Added Avatars to Superb Survivors quest dialogue windows:

sour island
#

That's neat

#

I would suggest cropping it to the face and zooming in

#

This is done with the hairstyle UI tweak mod

blissful salmon
summer rune
#

Could someone help? I want to include a recipe for cooking 10 Base.Grapes for 20 minutes in a Pan and the result should be Base.Sugar. However it should remove 1 Base.Paper from the inventory (for the packaging).

sour island
gilded hawk
#

Well, it's finally time to say good bye to poor in-game editor for the workshop.txt

I got all the steam BB code covered ๐Ÿ’ช

#

I'll release this as soon as I'm done with the debugging ๐Ÿ™‚

blissful salmon
weak sierra
#

@hearty dew your mod desc for misc patches doesnt talk about the item tweaker thing, so i didn't even know that was there to try, but i have an extensively modded server so perf increases/time saving is very wanted. i read the code but it's made of lua wizardry and i have no idea what it's doing, mind kinda.. explaining wtf is going on in summary so i have some idea what i'd be putting on my server? xD

#

i can see u intercept the tweakitem stuff and prevent other instances through metatable dark magic

#

but what's the performance improvement approach

livid locust
#

I want to make a project zomboid mod but I have no skill

#

It would be cool to make this in pz, a welding machine on a trailer

#

and then a new animation for welding that looks more realistic

#

like this

#

I'm just thinking

#

and using the trailer machine can make stronger barricades/fences etc

hearty dew
# weak sierra but what's the performance improvement approach

Regarding the perf improvement of tweak item, it reduced the tweakitem api OnGameBoot time from 44sec to around 0.5 sec with the mods I play with. The bulk of that improvement was inserting all the print lines into an array, then at the end doing print(table.concat(printoutput, "\n").
The rest of it was shenanigans to deal with all the ways different mods did their own implementations/copies/modifications of the tweakitem api in order to hook them all into my implementation to minimize the boot time.

#

If there's something more specific you're curious about, I'd be glad to explain more.

#

It only improves the game boot time. Not sure how important that is if you have a server running that doesn't get rebooted often though.

weak sierra
#

are print statements that performance-eating?

#

:|

bronze yoke
#

prints are crazy expensive

weak sierra
#

so it means server boot time and client load-in time is huge

hearty dew
weak sierra
#

yeah i dont use the slider mod because of that issue

#

:P

#

sounds like overwriting the print function to buffer it and spit them out once every N might yield a net gain in server performance eh?

#

and client

hearty dew
# weak sierra are print statements that performance-eating?

Yea, so it was like 40s to print 8000 lines (each of the tweaked items). Something like that, I don't recall exactly. But with that mod enabled, it will print out the # of items and time it took to run the function to do all the DoParam calls

hearty dew
#

I never noticed much log output serverside, but I only run with my two test clients ๐Ÿ˜…

weak sierra
#

i run over 400 mods on my server

#

there's a lot of log lines.

#

a lot of noisy mods

hearty dew
#

Then that might be worth doing

weak sierra
#

certain mods that don't need to be, too

#

yeah

#

thanks for the insight on that..

#

do i need to know any metatable-fu to do that or can i overwrite a base function with typical approaches?

#

i have never touched a metatable really

frosty estuary
#

Is there a way to set which body parts are protected by a clothing using a Custom BodyLocation ?

hearty dew
#
PrintBuffer = PrintBuffer or {}
PrintCount = PrintCount or 0
PrintEvery = PrintEvery or 100
local original_print = print
function print(...)
  PrintCount = PrintCount + 1
  local printParams = {...}
  if #printParams == 0 then return end
  local line = tostring(table.remove(printParams, 1))
  for i = 1, #printParams do
    line = " "..tostring(printParams[i]) -- I can't remember the format print() uses for multiple args atm
  end
  table.insert(PrintBuffer, line)
  if PrintCount % PrintEvery == 0 then
    original_print(table.concat(PrintBuffer, "\n"))
    PrintBuffer = {}
  end
end

Something like that, idk. :p Gotta head off to go eat so getting impatient ๐Ÿ˜…

#

tostring would make it not error out in some places were default print would. Not sure if that's something that concerns you

hearty dew
weak sierra
#

my god i look away and u just write the whole thing pretty much

hearty dew
#

Probably with blow up when ran though ๐Ÿ˜…

#

Don't have a way to test it atm

weak sierra
#

was thinking every N time rather than lines

hearty dew
#

print uses something different than tostring, I'm sure, but probably not an issue

weak sierra
#

wonder which is better

#

every N time will prevent too much wait to see lines when things are slow

#

hell maybe could throttle on both

#

if >100 lines or >5 seconds then dump

hearty dew
#

Oh, can use the that debounce api for that

weak sierra
#

i have heard the term debounce but have no idea what it means :)

hearty dew
#

.

weak sierra
#

im one of those "i taught myself everything i dont know terms" programmers

hearty dew
#

Basically means it will wait 5 seconds (or whatever you set) after the last print to print everything. If during that 5 seconds another print comes along, it will reset to 5 seconds again

weak sierra
#

that sounds like the opposite of what i want, though yet another option

hearty dew
#

In other words, buffers everything until X time has passed with no prints

weak sierra
#

i'd wanna ensure no more than X passes without letting things print rather than ensuring it doesn't until a gap

#

lol

#

quite the opposite

#

anyone here have interest in joining the modding team for my server, btw? could really use others to help with all this shit i make, rn i'm doing wayyyyy too much of the work alone

#

the list grows faster than i can do the things

hearty dew
#

Ah. Just use the regular interval timer that debounce uses. It's in that same link

livid locust
#

I'm sorry, how do I get scite to use lua?

jade chasm
#

Suggestion for any modders out there looking for an idea for a project. I'm wondering if anyone is interested in working on a mod that adds concrete walls?? I was thinking that players could build (zombie) indestructible walls but they require a lot of concrete powder and maybe a metal frame? The material cost would be high to prevent spamming but would allow players to build permanent defenses in vanilla. Visually, the walls would be thick like log walls. Possibly half-walls could also be included. Concrete walls could be demolished with a sledgehammer of course.

#

I can make textures and such but I don't have enough experience to do most of the core lua stuff. I'm mostly just throwing the idea out there to see if anyone wants the idea and offering to help with what I can. Seems like the idea isn't really on the workshop outside of Soul Filcher's Building Time but that includes a bunch of other content.

livid locust
#

I think I got it nvrmd

placid delta
astral dune
livid locust
#

hello I am on the wiki learning how to mod but it wants me to use pipewrench for project zomboid which is typescript. do I have to learn another programming language?

#

I just learnt basic lua

bronze yoke
#

you only need lua, pipewrench is just for people who want to use typescript

astral dune
#

ye, no point in learning a whole new language unless you really want to

#

everything can be done in lua

livid locust
#

ok i'll go on to the next section of the wiki

#

I don't understand this ๐Ÿ˜ข

astral dune
#

that one teaches you how to decompile the java in Intellij, so that you can read the java source code if you'd like

#

its not strictly necessary, although it helps

livid locust
#

ok thanks

#

I want to create a vehicle mod so I will go onto that section of the wiki

astral dune
livid locust
#

ok now I just have to learn how to use blender

astral dune
#

to make the models? ya probably, haven't gotten that far myself, haha

hearty dew
# weak sierra <@479489390121582612> your mod desc for misc patches doesnt talk about the item ...
  • The ItemTweaker patches described above. It does a number of things to route different mods copies/duplicates of the ItemTweaker code into one place so they all benefit from the performance improvement.
  • Reduces the weight of a number of base items that seemed too high to me e.g. changing a pen's weight from 0.1 kg to 0.01 kg.
  • ModOption options to configure ClothingBoxRedux loot rarity. By default the value is unchanged (factor of 1.0).
  • ModOption option to change chance of Attached Weapons to zombies. Felt it was too high, so I change it from 6% to 3% personally, but by default with no configuration, it remains at 6%.
  • Loads a SnakeUtilPack file earlier in the lua load order because it override a tooltip function that several other mods decorate. That should fix tooltip compatibility issues between snake's mods and the others that modify that tooltip function (can't recall them atm).
  • Fixes the MapSymbolSizeSlider incompatibility with that other map icon mod described earlier.
  • Patch for an minor exception that occurred in the Basements mod when right-clicking on a placed radio.
weak sierra
#

aren't mod options client-side and thus a really weird prospect for a dedicated server?

#

for stuff like that

hearty dew
#

Didn't put much effort into writing it all up properly. Someone else wanted to use the itemtweaker improvements, so I put it on steam with a little info. I wasn't really expecting any others to use it beyond that

livid locust
#

what aspects of modding will I need to make a character use a tool for a timed action? I assume blender first

hearty dew
livid locust
#

if I want to creat the tool

hearty dew
summer rune
#

what is the point of fileGuidTable.xml which u can see in some mods? what will happen if this file is missing?

hearty dew
limpid moon
#

how do you get a zombies tile location

fast galleon
#

Nolan is already on v43 ๐Ÿ˜‚

young edge
#

Tyrir, which mod are we currently talking about? tried scrolling up, but maybe I'm just blind

hearty dew
#

It contains misc patches ๐Ÿ˜…

young edge
#

it really is just called "Misc Patches", huh... (โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

#

but thank you for further enabling my mod hoarding

hearty dew
#

Yep. It's my hodgepodge of patches. Only tossed it up on steam bc someone wanted the itemtweaker perf improvements from it so it's named confusingly and what it does isn't made clear in the description :p

young edge
#

Similar to Eve, our server runs virtually every mod under the sun.
I made some vehicle spawn related mod, but it's still being ironed out

#

might yeet it on here for some quick "ooh, aah" testing before I release it into the wild

livid locust
#

ok so I made a task list for the welding mod I want to create

undone crag
weak sierra
#

lmao

young edge
#

I feel like one of the mods we're using is having an insane memory leak (yay 32gb use of ram), any moderately simple way of checking which one it is, other than turning stuff on and off?

undone crag
#

Hmmm I don't actually feel like playing Project Zomboid much soon actually... maybe not...

weak sierra
#

im unaware of any tool that would break things down for you..

young edge
#

yeah... feared as much

#

our server runs approx the same amount as yours so you can probably tell the pain I feel KEK

weak sierra
#

there might be some lua magic that can be done to hook all the functions at once and get stats on them but i wouldn't know

young edge
#

Transmog 2.0, Eggons sharpen your blades, ammo smelting and fixing the laggy crafting menu + everything has a name comes + rename containers comes to mind
but hmm.

weak sierra
#

fix laggy crafting menu is not an issue

#

at least not on its own

#

i use that

blissful salmon
#

Is there a way to get all SoundNames which are from the same directory? For example if I have media/sound/colletion1/file1,file2, ... I want them in a table/list so I can later choose one of them.

#

Or maybe there are better ways to do that...

hearty dew
#

I remember seeing in code that sounds conceptually contain sound clips. I wondered if that meant that you can have different clips that can be selected from one sound entry. Idk if this is relevant or could help your situation though, more of a pondering ramble :p

blissful salmon
#

Looks like they to stuff like this:

GameSound var1 = GameSounds.getSound("Helicopter");
               if (var1 != null && !var1.clips.isEmpty()) {
                  if (inst == 0L) {
                     GameSoundClip var2 = var1.getRandomClip();

technically what I want I just don't know if I can create them by myself... I investigate further into the code ๐Ÿ™‚

young edge
sour island
blissful salmon
sour island
#

Not that I know of - but if you dig in the java you can see all the parameters for sounds

#
module Base {

    sound icecreamAlarm {
        category = Vehicle, loop = true,
        clip { file = media/sound/vehicle_cream1.ogg, distanceMin = 10, distanceMax = 20, reverbFactor = 0.1,} }

    sound icecreamWall {
        category = Vehicle, loop = true,
        clip { file = media/sound/vehicle_cream2.ogg, distanceMin = 10, distanceMax = 20, reverbFactor = 0.1, } }

    sound icecreamYelp {
        category = Vehicle,    loop = true,
        clip { file = media/sound/vehicle_cream3.ogg, distanceMin = 10, distanceMax = 20, reverbFactor = 0.1, } }

    sound IceCreamFlyBy {
        category = EHE: Main, loop = true, is3D = true,
        clip { file = media/sound/vehicle_cream1.ogg, distanceMax = 500, volume = 2.0, reverbFactor = 0.1, }
        clip { file = media/sound/vehicle_cream2.ogg, distanceMax = 500, volume = 2.0, reverbFactor = 0.1, }
        clip { file = media/sound/vehicle_cream3.ogg, distanceMax = 500, volume = 2.0, reverbFactor = 0.1, }
        clip { file = media/sound/vehicle_cream4.ogg, distanceMax = 500, volume = 2.0, reverbFactor = 0.1, } }
}
#

goes in scripts folder

#

same scripting format as the other types of scripts

#

although I think the inclusion of {} inside of others is unique to sounds

#

also doesnt take , for clips

blissful salmon
#

I completely forgot about the script folder... This should help. Thanks.

sour island
#
sound {
         if ("category".equals(var7))
         } else if ("is3D".equals(var7))
         } else if ("loop".equals(var7))
         } else if ("master".equals(var7))
         } else if ("maxInstancesPerEmitter".equals(var7))

 clip {
         if ("distanceMax".equals(var6))
         } else if ("distanceMin".equals(var6))
         } else if ("event".equals(var6))
         } else if ("file".equals(var6))
         } else if ("pitch".equals(var6))
         } else if ("volume".equals(var6))
         } else if ("reverbFactor".equals(var6))
         } else if ("reverbMaxRange".equals(var6))
#

pulled from the java

#

maxInstancesPerEmitter hmm - this would be useful

blissful salmon
#

from which class is this?

sour island
#

zombie/scripting/objects/GameSoundScript.java

blissful salmon
#

Thx. I'll try this. The script files seems to be exactly what I need.

young edge
#

zomboid wins this time >:(

noble shale
#

Hey y'all, I have a quick question!

I want to make a wallet that holds money found in-game. Is it fine to edit the existing wallet item to do this, or is it best practice to create a separate item and allow the player to craft the new item using the base item I'd want to use in the first place?
Also, is it possible to restrict the kinds of items a bag can hold? In this case, money and credit cards?

blissful salmon
# noble shale Hey y'all, I have a quick question! I want to make a wallet that holds money fo...

I don't know if its better to change or create a new wallet. I still have to test this. But to filter the items I use this:

SoulMod.ItemFilter = function(inventoryContainer, inventoryItem)
  local scriptItem = inventoryItem:getScriptItem()
  local category = scriptItem:getDisplayCategory()
  if category == "Ammo" then
    return true
  end
end

and apply it to the items AcceptItemFunction
item:DoParam("AcceptItemFunction = SoulMod.ItemFilter"); -- in lua
or
AcceptItemFunction = SoulMod.ItemFilter -- in items.txt

civic lava
#

what is the best program to use to edit or make mods for PZ?

young orchid
civic lava
#

hahahaha

#

i swear im so used to it that i cant use any other color mode

blissful salmon
#

Is it correct that I can't access public variables on exposed classes?

public final class GameSound {
   public String name;
   public String category = "General";
   public boolean loop = false;
   public boolean is3D = true;
   public final ArrayList clips = new ArrayList();

I'm interested in the clips in this case...

fast galleon
blissful salmon
#

Thx. I'll check this...

dapper geode
#

Is there any event for player after he killed another survivor? Just like "OnZombieDead" triggered after he kill zombie?

dapper geode
#

Btw, Is there a way for us to store data permanently in the player? The data should not be lost even if the player comes out of the game and returns.

limpid moon
#

ive been looking for something like this website for forever. just gotted started on modding

#

thank you kindly sir

fast galleon
#

omg after lootzed breaks something, you need to restart the save in order for your own script to fill container to work.

dapper geode
fast galleon
dapper geode
#

I think the client script only run by the client that trigger the event? not every client that connected to the server, right?

rancid barn
#

Ok question: if I wanted to make a mod that allowed you to ring church bells, how complex would that be? Would it just be like a timed action and maybe some mapping stuff for the rope?

ancient grail
#

is it possible to hack the map discovery by editing the user files? or does that have to match the servers file too?

ancient grail
rancid barn
#

Alright thank you

fast galleon
steep copper
#

Hi, maybe you have the answer :
How i can identify an item through an item kahlua table, but not with his name ? How can i find the module.item value ?

steep copper
#

i found the answer by myself !
local item = itemTable[1].items[1]; print(item); print(item:getModule()); print(item:getName());

steep copper
#

Maybe it can help someone else

limpid moon
#

what does getVeryCloseEnemyList() return?

#

I know its an array but an array of what

tardy wren
#

I think it would be zombies

#

Although you can print the items of that list to see what class it js

dapper geode
#

Hey, how to get SteamID from serverside lua?

hearty dew
limpid moon
#

Ty ty

hearty dew
#

I'd try that

young edge
#

Tyrir, regarding my attempts yesterday, is there absolutely no way of finding out what is hogging ram?

Someone mentioned debug mode to me but I genuinely have no idea

dapper geode
young edge
#

I've been tryingto remove mods and get back to square 1 but so far I've not been able to tell what the problem is

hearty dew
hearty dew
# young edge Tyrir, regarding my attempts yesterday, is there absolutely no way of finding ou...

The way to do that would be to run the java process in a java memory profiler of some sort. I'm unfamiliar with those sort of performance tools for java though, but that's where I'd start. I'd then try to connect the dots from those java objects using large amounts of memory to where they fit into kahlua or into other pz objects (e.g. memory leaks causes by large textures that indie stone devs have warned about). Hopefully there'd be enough context to infer what mod is the source of the issue.

dapper geode
# hearty dew What is a steam owner?

So It's the steam that owning PZ, and you play using another steam via family sharing, I can see it show SteamID and Owner ID or something on pz database

hearty dew
hearty dew
dapper geode
molten cobalt
#

Hey all, I'm new here and I was wondering if there is a guide or any tips on making some additionally towns/locations - I plan on having a mess around with the aim of making a unique town/village at some stage

ancient grail
#

Mapping would be a suited channel for this @molten cobalt

molten cobalt
#

Apologies will do

kind forge
#

so i'm lookin to add in new sounds for custom explosive items. i've got it working well enough, but if i walk a considerable distance away from it, there is no explosive sound. i'm guessing it might be something to do with distant sounds? since the vanilla explosives have two sounds, the close up and the distant one. right now i cant seem to figure out a way to define the distant sound with my own, if that is possible

blissful salmon
# kind forge so i'm lookin to add in new sounds for custom explosive items. i've got it worki...

I'm also working on sound stuff at the moment. I could solve the distance problem by setting up a proper sound.txt file in the script folder. for example my current sound I'm testing:

    sound ZombieDemonScream
    {
        category = ZombieScreams, is3D = true,
    clip 
    { 
      file = media/sound/ZombieDemonScream.ogg, 
      distanceMin = 10, 
      distanceMax = 120, 
      reverbFactor = 0.1,
      volume = 0.9,
    }
    }

See: #mod_development message
and
#mod_development message

#

hope this helps...

kind forge
#

oh alright! i'll work with it, thanks

blissful salmon
#

let me know if it works ๐Ÿ™‚

kind forge
ancient grail
#

Hows your mod @blissful salmon

blissful salmon
# ancient grail Hows your mod <@355732070435258368>

I'm still working on some conceptual problems. I think I have my zombie sound stuff in an ok working state. Now I mess again with the zombie modData stuff. I'm still a little confused and do some testing atm.
CraftingOverTime like reading a book seems to work. Just need some code clean up.
So all in all I'm a little slow but things start getting to work ๐Ÿ™‚

sour island
#

So you don't actually need a zombie reference

#

You can also set an attraction event which is also refered to as sound but isn't actually audible

thick karma
#

So I have this partly working Mod Options function that is driving me insane and I am wondering if anyone of you brilliant heroes can help me make another little breakthrough...

    function resetServerDefaults:onUpdate(value)

        local varsOfTheZed = SandboxVars.DawnOfTheZed
        
        if value and varsOfTheZed then

            gamepadShortcut:set(varsOfTheZed.gamepadShortcut)
            hideNames:set(varsOfTheZed.hideAllPlayerNames)
            hideByDefault:set(varsOfTheZed.hideUserInterfaceByDefault)
            hideMouseCursor:set(varsOfTheZed.hideMouseCursor)
            keepMyHotbar:set(varsOfTheZed.keepMyHotbar)
            keepMoodles:set(varsOfTheZed.keepMoodles)
            keepMiniMap:set(varsOfTheZed.keepMiniMap)
            keepButtonPrompts:set(varsOfTheZed.keepButtonPrompts)
            
            if hideHaloNotes then hideHaloNotes:set(varsOfTheZed.hideHaloNotesIfPossible) end 

            if varsOfTheZed.toggleBehaviorOnMap == DOTZ.sandboxAutomaticCursor then

                autoShowCursorOnMapOpen:set(true)
                closeMapOnHide:set(false)
                shortcutActivatesCursorOnMap:set(false)

            elseif varsOfTheZed.toggleBehaviorOnMap == DOTZ.sandboxShortcutClosesMap then

                autoShowCursorOnMapOpen:set(false)
                closeMapOnHide:set(true)
                shortcutActivatesCursorOnMap:set(false)

            elseif varsOfTheZed.toggleBehaviorOnMap == DOTZ.sandboxShortcutActivatesCursor then

                autoShowCursorOnMapOpen:set(false)
                closeMapOnHide:set(false)
                shortcutActivatesCursorOnMap:set(true)

            else -- varsOfTheZed.toggleBehaviorOnMap.option4 

                autoShowCursorOnMapOpen:set(false)
                closeMapOnHide:set(false)
                shortcutActivatesCursorOnMap:set(false)

            end
        end
    end

So this function mostly (kindasorta) works, except for one very important detail. When I grab SandboxVars.DawnOfTheDead, it doesn't grab the options as they appear live in Change Sandbox Options, and it doesn't grab the options as they have been set in the .lua config file either. It grabs the sandbox options as they were when the server was first created. Can someone help me understand why, and for bonus appreciation help me adjust it so that I'm tracking the sandbox variables from the server's config file, in the same place something like Change Mod Options sets them?

#

In fact, when I change Sandbox Variables with Change Mod Options, it doesn't even update SandboxVars in the actual game... what gives?

#

I just printed something set to false in the lua AND in Mod Options, and it printed true, which was its state which I created the server.

#

So confusing!

gaunt meteor
#

sandbox not being in sync is known and old issue

#

someone else can contribute more to your solution but i just wanted to put that out there lol

thick karma
#

Thank you for telling me that Yule

#

That is helpful because it makes me feel less insane

#

I've been banging my head on the table about this for awhile

bronze yoke
#

yeah that's just how it is

thick karma
#

"Is there a way to sync them manually?" becomes a potential follow-up question.

gaunt meteor
#

it can depend on mods or your server host. if you are hosting locally i dont know much as ive only hosted via dedicated

bronze yoke
#

there is, let me find it

thick karma
#

โค๏ธ

blissful salmon
#

I try to keep it all server side. What me currently confuses if I add modData to a self created zombie, I can't find it after server restart. Also no other zombie seems to have the new modData. But my resurrected player zombie always keeps the modData. So I try to figure out the difference...
This is how I spawn the zombie serverside:

function SoulMod.server.commands.SpawnZombie(player, args)

  if args and args.X and args.Y and args.OutfitName then
    local zombies = addZombiesInOutfit(args.X + 6, args.Y - 6, 0, 1, args.OutfitName, 100)
    local zombie = zombies:get(0)

    local modData = zombie:getModData()
    local zombieData = {}
    local zombieID = SoulMod.shared.getZombieId(zombie)

    zombieData.WalkType = "sprint1"
    zombieData.CanWalk = false
    zombieData["ZID"] = zombieID

    modData["SoulMod"] = zombieData
    zombie:transmitModData() -- relict because I do everything serverside and send the soundCommand to the client.
    
    SoulMod.server.ApplyModDataSettings(modData, zombie) -- function which sets the walktype etc. for the zombie
        
    zombie:transmitCompleteItemToClients()

    local x, y, z = zombie:getX(), zombie:getY(), zombie:getZ();
    local zombieId = SoulMod.shared.getZombieId(zombie)
    local args = {}
        
    args.zid = zombieId
    args.x = x
    args.y = y
    args.z = z
    args.screamName = "ZombieDemonScream"
        
    SoulMod.server.SendCommandToClient("DoZombieScream", args)
  end
end

Everything works as expected only the modData is lost on restart. So I can't reapply the settings.

gaunt meteor
#

so i got a queston what is iType? is it name or category or something else?

#

where is it defined

#

(of an item)

bronze yoke
#

getSandboxOptions().load() was thrown around as a way to do this

thick karma
#

omfg I hope it's so easy

blissful salmon
thick karma
#

Wait...

#

lmfao

#

It does the opposite of what I want @bronze yoke

#

So instead of loading up the Change Sandbox Options version or the lua version, it actually pushes the server's saved Sandbox options into Change Sandbox Options again!

#

i.e., it just overwrites the changes I'm trying to make live with the server's birth settings

#

Ahhhhhhhhhhhhhhhh

#

loses mind

bronze yoke
#

oops, well it was thrown around specifically as a way to load them early, so that makes sense

gaunt meteor
thick karma
#

I am doing this update for someone else

#

they cannot just remake their world

#

To get the defaults they want

#

For any new server, my technique is fine

#

For any existing server, it fails

gaunt meteor
#

only reason i ask is where the files are

thick karma
#

I am hosting r.n.

#

a copy of the server

#

they're in Zomboid/Server or something iirc

gaunt meteor
#

have you tried changing the actual file in server folder?

#

and not ingame

#

sometimes this fixes desync

thick karma
#

Yes

#

Well not programmatically but manually yes

gaunt meteor
#

one of the issues i observed was installing a mod that added to sandboxvars, then the mod being uninstalled, but their lines still being in sandboxvars, so it stopped syncing altogether until the entire file was reset

thick karma
#

I have edited that file manually multiple times... 3 things sync: server_SandboxVars.lua, the actual settings menu for editing your server settings (before hosting a game), and the settings displayed in Change Sandbox Options all sync up. But the in-game variable known as SandboxVars.yourModName does not get updated after the server already exists. @gaunt meteor

#

I wonder... if I just deleted the SandboxVars.myModName variable when I quit the server, would it automatically make a new one when I join again using the defaults? Or just bug out eternally because it did not expect that to ever happen?

#

sigh

blissful salmon
sullen bobcat
#

So I know I asked this before, but sadly the issue remains - despite the help, many thanks to @jade chasm for your help, even if we couldn't get the issue resolved. I am trying create a small firearms mod and when I add a base game attachment to the modded firearm, the attachment model is rotated 180. I can see through the front of the attachment model with the back of the model being rendered. Regardless of how I attempt to rotate the Attachment, this error persists, with the front of the model facing away from the player in effect. I believe the issue is with the model I am using, as when replaced with a base game model, the attachment model is correct, however i have no what the issue with the model is, nor how to fix it. Any help would be greatly appreciated. Thanks

#

Image above shows the issue

gilded hawk
#

The workshop.txt editor is finally complete! ๐ŸŽ‰ (only works on chrome/edge)

#

Now I can finally take a break from PZ modding/toolmaking

ancient grail
#

Congrats man

gilded hawk
sour island
blissful salmon
sour island
#

The thing about that is save() is different per object

#

For the most part most objects save modData

#

But most objects are also pretty stationary

blissful salmon
young edge
sour island
#

Zombies only save health, location, outfitId, and a few other things

gilded hawk
#

Application live ๐Ÿ‘‰ https://mxswat.github.io/pz-description-editor/

Sauce ๐Ÿ…: https://github.com/mxswat/pz-description-editor

โš ๏ธ Limitations :

  • Only works on Chrome, Edge and chromium browsers
  • Malformed BBCode will break the app
  • No Bullet list preview because of some issues with the [*] BBCode
Example of malformed BBCode: 
[img=http://projectzomboid.com/images/MODS_03.png]
Use instead: -> [img] http://projectzomboid.com/images/MODS_03.png [/img]

spinning_golden_apple Tips: CTRL+O and CTRL+S To quick open and quick save

GitHub

Contribute to mxswat/pz-description-editor development by creating an account on GitHub.

#

I think this will make 10x easier editing the workshop file, and hopefully it will make it easier to have better looking workshop descriptions ๐Ÿ’Œ

blissful salmon
gilded hawk
blissful salmon
#

I'll check the flags. If this is the only one or if there's one that I can abuse...

rancid barn
#

Are there any resources for adding/creating modded animations?

blissful salmon
lyric bolt
#

Hey all ๐Ÿ‘‹ ๐Ÿ‘‹ Brand new here and I was wondering if I could get some help with a simple patch I want to make between two mods. I wan't Arsenal weapon attachments to work with the fallout weapon pack. Does anyone know of a patch for one that exists already I could reverse engineer? I code but have no idea where to start on PZ stuff.

I tried to just copy the mod, make a few edits to the ID, and add the weapon to the attachment list in the GunFighter_Weapon_Parts.txt file. But then all my guns/parts broke in solo, the icons were all the question mark one, and none would attach anymore.. Thanks for the help all! ๐Ÿ˜„

worn sierra
#

Hey, is there a Mod out there that makes the Voicechat with Radios on MP Server sound like...well...Radio Chat? And not like the Person is standing next to you. Like, a bit static.

weak sierra
#

anyone ever see this before? a few items, now two in two different mods, do this to me but not others

#

some failure of tooltip rendering

#

i run the game on proton under linux

#
    self.item:DoTooltip(self.tooltip);
#

that line..

#

gonna try this to see if it suppresses it```lua
local original = ISToolTipInv.render

function ISTooltipInv:render()
if self.item ~= nil then
original(self)
end
end```

#

tho i'd rather know WHY it's happening

#

:P

sour island
#

Could it be named lit?

weak sierra
#

nah happens even when that's not runnin

#

lol

#

i reproduced this with cheatmenu and mod manager and th mod in question

sour island
#

You were able to widdle down the mod?

weak sierra
#

and similar problem happens to only me on my server without those two mods running for clothesbox's waterproof overalls

#

yeah

#

it's the mod that has the item

#

:p

sour island
#

What mod?

weak sierra
#

in this case the MAS-36 gun in the Chiiku Arms mod

#

clothesbox's waterproof overalls also does it

sour island
#

Only that item?

sour island
#

Could be something to do with the script that is calling something

weak sierra
#
    {
        DisplayCategory            = Weapon,
        DisplayName                =    MAS-36,
        Icon                        =    MAS36,
        WeaponSprite                =    MAS36,
        Weight                        =    3.0,
        AmmoType                    =   Base.762Bullets,
        AmmoBox                     =   Base.762Box,
        MaxAmmo                     =   5,
        RecoilDelay                    =    40,
        ReloadTime                  =   35,
        AimingTime                  =   20,
        MinRange                    =    0.61,
        MaxRange                    =    13,
        MinAngle                    =    0.965,
        DoorDamage                    =    25,
        MinDamage                    =    2.4,
        MaxDamage                    =    2.6,
        StopPower                   =   2,
        PiercingBullets             =   TRUE,
        KnockdownMod                =    5,
        PushBackMod                    =    0.4,

        
        CriticalChance                  = 30,
    CritDmgMultiplier        = 10,
        AimingPerkCritModifier          = 15,
        HitChance                       = 60,
        AimingPerkHitChanceModifier     = 15,
        AimingPerkMinAngleModifier      = 0.01,
        AimingPerkRangeModifier         = 3,
        
        
        SoundVolume                = 90,
        SoundRadius                = 110,
        SwingSound                = mas36shot,
        BreakSound = MSR700Break,
        InsertAmmoSound = MSR700InsertAmmo,
        EjectAmmoSound = MSR700EjectAmmo,
        RackSound = mas36rack,
        BringToBearSound = MSR700BringToBear,
        HitSound                = BulletHitBody,
        ClickSound = MSR700Jam,
        EquipSound = MSR700Equip,
        UnequipSound = MSR700UnEquip,
        InsertAmmoStartSound = MSR700InsertAmmoStart,
        InsertAmmoStopSound = MSR700InsertAmmoStop,
        EjectAmmoStartSound = MSR700EjectAmmoStart,
        EjectAmmoStopSound = MSR700EjectAmmoStop,
        ShellFallSound = MSR700CartridgeFall,

        
        Type                            =    Weapon,
        SubCategory                        =    Firearm,
        IsAimedFirearm                    =    TRUE,
        UseEndurance                    =    FALSE,
        ConditionMax                    =    20,
        JamGunChance                    =   0.25,
        Ranged                            =    TRUE,
        MetalValue                      =   45,
        SwingTime                        =    0.5,
        MinimumSwingTime                =    0.5,
        ToHitModifier                    =    1.5,
        SwingAmountBeforeImpact            =    0,
        MultipleHitConditionAffected    =    FALSE,
        SplatSize                        =    3,
        SplatNumber                        =    3,
        SplatBloodOnNoDeath                =    TRUE,
        ImpactSound                        =    null,
        NPCSoundBoost                    =    1.5,
        SoundGain                       =   2,
        SwingAnim                        =    Rifle,
        RunAnim                            =    Run_Weapon2,
        IdleAnim                        =    Idle_Weapon2,
        ShareDamage                        =    FALSE,
        MaxHitCount                        =    1,
        KnockBackOnNoDeath                =    TRUE,
        ProjectileCount                    =    1,
        ConditionLowerChanceOneIn        =    210,
        TwoHandWeapon                   =   TRUE,
    RackAfterShoot            =   TRUE,
        RequiresEquippedBothHands       =   TRUE,
        WeaponReloadType                =   boltactionnomag,
        AttachmentType                  =   Rifle,


        ModelWeaponPart = x8Scope x8Scope scope scope,

    }```
#

there's the script for that item

#
    at zombie.inventory.types.HandWeapon.DoTooltip(HandWeapon.java:317)
    at zombie.inventory.InventoryItem.DoTooltip(InventoryItem.java:607)
    ... 45 more```
#

that's the tail of it

#

so it looks liek it's failing to get the display name

#

the display name has random spaces/tabs in the start of it

#

but it says it's cuz CreateItem(String) is null

#

not cuz the display name is problem

#
public final class InventoryItemFactory {
   public static InventoryItem CreateItem(String var0) {
      return CreateItem(var0, 1.0F);
   }```
#

mm

#
   public static InventoryItem CreateItem(String var0, float var1) {
      return CreateItem(var0, var1, true);
   }

   public static InventoryItem CreateItem(String var0, float var1, boolean var2) {
      InventoryItem var3 = null;
      Item var4 = null;
      boolean var5 = false;
      String var6 = null;

      try {
         if (var0.startsWith("Moveables.") && !var0.equalsIgnoreCase("Moveables.Moveable")) {
            String[] var7 = var0.split("\\.");
            var6 = var7[1];
            var5 = true;
            var0 = "Moveables.Moveable";
         }

         var4 = ScriptManager.instance.FindItem(var0, var2);
      } catch (Exception var8) {
         DebugLog.log("couldn't find item " + var0);
      }

      if (var4 == null) {
         return null;
      } else {
         var3 = var4.InstanceItem((String)null);
         if (GameClient.bClient && (Core.getInstance().getPoisonousBerry() == null || Core.getInstance().getPoisonousBerry().isEmpty())) {
            Core.getInstance().setPoisonousBerry(GameClient.poisonousBerry);
         }

         if (GameClient.bClient && (Core.getInstance().getPoisonousMushroom() == null || Core.getInstance().getPoisonousMushroom().isEmpty())) {
            Core.getInstance().setPoisonousMushroom(GameClient.poisonousMushroom);
         }

         if (var0.equals(Core.getInstance().getPoisonousBerry())) {
            ((Food)var3).Poison = true;
            ((Food)var3).setPoisonLevelForRecipe(1);
            ((Food)var3).setPoisonDetectionLevel(1);
            ((Food)var3).setPoisonPower(5);
            ((Food)var3).setUseForPoison((new Float(Math.abs(((Food)var3).getHungChange()) * 100.0F)).intValue());
         }

         if (var0.equals(Core.getInstance().getPoisonousMushroom())) {
            ((Food)var3).Poison = true;
            ((Food)var3).setPoisonLevelForRecipe(2);
            ((Food)var3).setPoisonDetectionLevel(2);
            ((Food)var3).setPoisonPower(10);
            ((Food)var3).setUseForPoison((new Float(Math.abs(((Food)var3).getHungChange()) * 100.0F)).intValue());
         }

         var3.id = Rand.Next(2146250223) + 1233423;
         if (var3 instanceof Drainable) {
            ((Drainable)var3).setUsedDelta(var1);
         }

         if (var5) {
            var3.type = var6;
            var3.fullType = var3.module + "." + var6;
            if (var3 instanceof Moveable && !((Moveable)var3).ReadFromWorldSprite(var6) && var3 instanceof Radio) {
               DebugLog.log("InventoryItemFactory -> Radio item = " + (var0 != null ? var0 : "unknown"));
            }
         }

         return var3;
      }
   }```
#

so this is the method that's somehow failing

#
         DebugLog.log("couldn't find item " + var0);
#

since that doesnt show

#

it's not that.

#

so i guess this must be null?

#
         var3 = var4.InstanceItem((String)null);```
#

where

#
         var4 = ScriptManager.instance.FindItem(var0, var2);
#

so either var4 is null or InstanceItem is null

#

presumably?

summer rune
#

I have a problem which i am struggeling with since 2 days. i have a method called fetchSandboxVars which is called on the server side if not isServer() then return end; in the Events.OnServerStarted event handler.

that is basically everything that is part of the mod, except the sandbox-options.txt. However when i start my server with the mod the servertest_SandboxVars.lua gets cleared, and the mod specific entries get deleted. and then obviously my fetchSandboxVars function reports an exception, that my SandboxVars... calls return null on a non-table.

Anyone knows why this chicken, egg problem happens?

weak sierra
#

ah ur making the thing that forces those to load early? been planning to do that too

#

dunno.

#

is OnServerStarted prior to normal sandbox var loading?

#

they don't load until relatively late in the process

#

and now that im re-reading it doesnt look like ur triggering them to

weak sierra
#

if it's a weapon it runs this

#

which means literally any field could make this fail eh

sour island
#

You could try comparing it to a vanilla weapon

#

There's alot of fields I've never seen before

#

It could be a left over field that's triggering old code in the tooltip

#

Or worse yet, a missing field

weak sierra
#

author claims it doesn't do it to them on other servers

#

so it's either something finnicky with proton/linux

#

or something else weirdly specific..

fast galleon
#
            int var4 = this.thumpDmg;
            int var5;
            if (var3 >= var4) {
               var5 = 1 * ThumpState.getFastForwardDamageMultiplier();
               this.Health -= var5;
            } else {
               this.partialThumpDmg += (float)var3 / (float)var4 * (float)ThumpState.getFastForwardDamageMultiplier();
               if ((int)this.partialThumpDmg > 0) {
                  var5 = (int)this.partialThumpDmg;
                  this.Health -= var5;
                  this.partialThumpDmg -= (float)var5;
               }
            }

I've had too much java today, what's the best to set thumpDmg here for small health loss, is 666 good

weak sierra
#

java modding, eh?

#

or are u just poking at it

#

most decent damage to a thumpable is like 20-25 for guns hitting doors iirc

#

so 666 is massive

#

if what u mean is "high health so it doesn't care" then u want like 10k or something

#

if what u mean is "low damage so it doesn't do much" u want like 1-2

#

unclear which way u were talkin about

fast galleon
#

Just poking to see what I need to do make certain work. I want my object to break very slowly, so that players don't have to worry too much about it when first finding it.

sour island
weak sierra
#

for this test just cheat menu, mod manager, and the mod in question

sour island
#

What happens if you change the name?

#

Removing at least the hyphen

finite rover
# rancid barn Are there any resources for adding/creating modded animations?

Hi! if you find smth on this pls share with me) I'm trying to do animations with Fragmotion+blender with blender source tools as found here https://docs.google.com/document/d/1jTx34yyClwSq7JiR_TagUuNexlA3ljcNxdbDtse6sXQ

Now I'm stuck on animations being "pile of character" in game))

fast galleon
#

In contrast, objects you place get the maximum damage possible, thumpDmg is set at 1

alpine scroll
#

Anyone knows how to trigger a "Container visual update"? I got a function that forces the respawn of items on a container, however if , for example, a bookshelf was empty before, it doesnt update the shelf with the books

#

Its MP, if it matters

#

Dedicated server, to be more specific

fast galleon
#

getContainerOverlays():updateContainerOverlaysSprite(isoObject)

empty wagon
#

Is there a mod that makes crawlers not able to break fences so I can just chill with the 2 fence between 1 crate glitch?

summer rune
hearty dew
summer rune
#

@hearty dew has the id (modid) in the mod.info a max length, you know about? Could that be a thing?

#

Because with the shorter id the mod is behaving completely different

worldly olive
#

Heello!
Any clue on why this stopped working to force the player to sleep? ๐Ÿค”
ISWorldObjectContextMenu.onSleepWalkToComplete(player:getPlayerNum(), nil)

Probably stopped working since the last patch as I remember this was working some weeks ago

summer rune
safe silo
#

Looking into distributions/item spawning, what's a number that almost makes it 100% it spawns in that container? Want my magazine to spawn in bookstores

weak sierra
#

20? :p

#

honestly if you set it to anything >=1 it's pretty common

#

though number of books and loot limit

#

there's a lot of competition there

safe silo
#

Thanks!

hearty dew
winter thunder
#

Anyone know if it is possible to make a radio function in ranges outside of the typically allowed ones? Like~ <0.2mhz or >1000mhz

#

Have been trying, just limited success so far

#

and by that- I mean I havent gotten it to work at all... lmfao

winter flume
#

Hello all. Super niche question does anyone know how to get the id for an entry in the ZombiesZoneDefinition.Default table? I am trying to remove a zombie that is added by another mod

drifting ore
#

any mods that change UI?

jade chasm
#

Hey is there a drive through gates mod? I just saw there is a run through doors and gates mod where it auto open/closes for you when you run through.

safe silo
#

Where can I find the lua for these?

OnCreate:Recipe.OnCreate.DismantleRadio

I'm looking in the PZ source folder

Went into LUA/ but not sure where to go from here lol

ancient grail
#
function Recipe.OnCreate.DismantleRadioHAM(items, result, player, selectedItem)
    local success = 50 + (player:getPerkLevel(Perks.Electricity)*5);
    if ZombRand(0,100)<success then
        player:getInventory():AddItem("Radio.RadioTransmitter");
    end
    if ZombRand(0,100)<success then
        player:getInventory():AddItem("Base.LightBulbGreen");
    end
    DismantleRadio_OnCreate(items, result, player, selectedItem);
end
#
function Recipe.OnCreate.DismantleRadio(items, result, player, selectedItem)           --TODO adding return items/chance based on selectedItem value
    local success = 50 + (player:getPerkLevel(Perks.Electricity)*5);
    for i=1,ZombRand(1,4) do
        local r = ZombRand(1,4);
        if r==1 then
            player:getInventory():AddItem("Base.ElectronicsScrap");
        elseif r==2 then
            player:getInventory():AddItem("Radio.ElectricWire");
        elseif r==3 then
            player:getInventory():AddItem("Base.Aluminum");
        end
    end
    if ZombRand(0,100)<success then
        player:getInventory():AddItem("Base.Amplifier");
    end
    if ZombRand(0,100)<success then
        player:getInventory():AddItem("Base.LightBulb");
    end
    if ZombRand(0,100)<success then
        player:getInventory():AddItem("Radio.RadioReceiver");
    end
    --if selectedItem then
        --print("Main item "..selectedItem:getName());
    --end
    for i=1,items:size() do
        local item = items:get(i-1)
        if instanceof(item, "Radio") then
            item:getDeviceData():getBattery(player:getInventory())
            item:getDeviceData():getHeadphones(player:getInventory())
            break
        end
    end
end
civic lava
#

Someone please help, i need the player to fall, i know the code works but it has 2 bugs, 1 being... the player does fall he only "stops running" & the second is once this happens maybe 1-3 times it seems to just stop running the code

civic lava
#

i could really use advice, as im new to this & i've been doing this over over a week, 1 trait... over a week... just to learn lua... i seriously need help

ancient grail
#

if ou actually do that code on lua it will make your character stuck

#

it wont make you stumble and fall

civic lava
#

so what the hell do i do

#

what can i add?

ancient grail
#

๐Ÿ™‚

civic lava
#

im gonna cry

ancient grail
#

ill do the same if im able to figure it out too ayt

civic lava
ancient grail
#

maybe you can look at the debug thing where you can right click and set the fall

#

but it doesnt happen on the server side it only animates the thing for the one who did it

civic lava
#

do u mine VC'ing for a moment? for free time? im just sitting here coding for the next few hours

ancient grail
#
DebugContextMenu.onTick = function()
    if DebugContextMenu.staggerBacking then
        DebugContextMenu.stagTime = DebugContextMenu.stagTime - 1;
        if DebugContextMenu.stagTime < 0 then
            local chr = IsoPlayer:getInstance();
            DebugContextMenu.stagTime = 300;
            chr:setBumpType("stagger");
            chr:setVariable("BumpDone", false);
            chr:setVariable("BumpFall", true);
            chr:setVariable("BumpFallType", "pushedFront");
        end
    end
end
ancient grail
safe silo
#

Can I do this in LUA? And would I access it by ElectricianExperienceGain[dismantleSomething].experienceGain or how would it look?

ElectricianExperienceGain = {
    dismantleSomething = {
        experienceGain = 30,
    }
}
hearty dew
#

yes, that or ElectricianExperienceGain.dismantleSomething.experienceGain

safe silo
#

Sweet, thanks โค๏ธ

#

Also I'm Mr. 1000 questions today, is it possible to have a file that remains.. "static" on mod updates?

Say I have a file where I keep an overview of variables such as above, a table where I store all the set experiences players gain from doing X tasks. Now I run a server and want to balance the experience gain so I change the values. If the mod that uses this file is updated, it will reset back to what the mod's default values are but can it be avoided? I know most ppl probably modpack it but was wondering if it could be another solution.

ancient grail