#mod_development

1 messages Β· Page 515 of 1

safe sinew
#

Occupation Expertises mod makes the game freeze when you select a trait preset unhappy

#

Those job perks sounded really neat too

drowsy shadow
#

think this will work ?

#

if so where can i put it

#

maybe just a folder within the client folder and put the lua file there

drifting ore
#

I don't get what is command and Commands.

  1. Is Commands[command] just a string or a function?
  2. If so, do I need to init some command function?
  3. But what is that function and what is it use for ?
  4. Don't I need to you sendServerCommand ? Maybe it's what Commands[command] do
#

I'm so freaking lost

drowsy shadow
#

someone pls help

drifting ore
#

I think you are trying to recover objects that are not objects, walls are not objects in the game, I think, for example

broken kayak
#

The line :


Commands[command](players, args)

Is invoking the function stored in Commands at key "command" with players and args as arguments

I have limited knownledge in LUA but it should work something like this :


function fooBar()
  print("Hello world")
end

local Commands = {}

Commands["fooBar"] = fooBar

-- Prints Hello World
Commands["fooBar"]()
glossy mural
#

ive been looking for a mod that makes crates have more space any 1 know a good 1

primal knot
drifting ore
#

Is there a way to make players to spawn with random loot on my server? For example, I want to add m4, double barrel and magnum to the spawn list, but when the player spawn, he get random one from those three

quasi geode
# drifting ore I don't get what is command and Commands. 1. Is Commands[command] just a string...
  1. as Delran said (sort of) Commands is a table, command is a string key in that table that returns a function. using the same example above:
Commands["MyCommand"] = function(player, arg)
   -- do something
end
  1. I have no idea what you mean
  2. The function is used for whatever you want. its how you can get a client to call a function on a server and vice versa. what you use it for will vary
  3. likewise sendServerCommand is called wherever you want. If your trying to have a client request info from the server (a ping/pong scenario), then yes you would put it in the function to send data back to the client
drifting ore
broken kayak
#

Also not familiar with LUA's terminology =X

#

And incidentally, I suck at explaining anything.

quasi geode
#

so not too far off XD

broken kayak
#

And I wanted to say hash table but ended up with hash map πŸ€”

quasi geode
#

tables are a weird sorta container if your coming from other languages. its a hashmap/unsorted array...its a sorted array...and its a object (not really, but can simulate one for OO programming)

broken kayak
#

I've done most languages, from extremely rigid collection in C++ to maps that are implicitly convertible to arrays in Python so, nothing is weird for me anymore.

quasi geode
#

idk, tables really are something else. to quote what i wrote up about them in the modding guide:

There are no objects, sorted/ordered lists or unsorted/unordered lists. These are all the same thing in Lua: a table.

Tables can operate as a sorted or unsorted list, or a in a object-like structure with inheritance (metatables). They can also operate as all 3, at the same time.

When used as a sorted list, table indexes start at 1, not 0

Both , and ; are acceptable separators for entries in a table.

Using MyTable.myFunction() calls a function in a table normally, while using MyTable:myFunction() calls it as a object method. It is the same as MyTable.myFunction(MyTable)

A example of how strange (and versatile) tables can be:
#
-- mixed table
local MyTable = {"a", "b"; "c", nil, d = 5; [6] = 'e', f = function(self) print(self.d) end, "The End" }

-- as a sorted list
print(MyTable[1]) -- prints "a"
print(MyTable[2]) -- prints "b"
print(MyTable[3]) -- prints "c"
print(MyTable[4]) -- nil
print(MyTable[5]) -- prints "The End"
print(MyTable[6]) -- prints "e"
print(#MyTable) -- prints 3. Stops at first nil

for i, v in ipairs(MyTable) do
    print(i, v) -- prints "1 a", "2 b" and "3 c". Stops at first nil
end

-- as a unsorted list
print(MyTable.d) -- prints 5
print(MyTable['d']) -- prints 5

-- with functions
MyTable:f() -- prints 5
MyTable.f() -- errors, no 'self' argument passed
MyTable.f(MyTable) -- prints 5
MyTable.f({d = 7}) -- prints 7
MyTable['f']() -- errors, no 'self' argument passed
MyTable['f'](MyTable) -- prints 5
broken kayak
#

Yeah

quasi geode
#

they're pretty messed up XD

broken kayak
#

print(MyTable[5]) -- prints "The End"```
#

This one though

quasi geode
#

mind you, you can do some neat things them.. though you probably shouldnt lol

#

heh ya

#

especially since i explicitly declared MyTable[6] earlier lol

broken kayak
#

Can make some insane obfuscation out of all that

#

No one will ever be able to update any of my mods

drifting ore
#

Starts to look like something usable

glass ravine
#

so if you were to make a item distribution mod, how would you make the zombies spawn with the items equipped?

crisp fable
#

How reliable is the debug mode lua reload thing? It worked a few times but at some point it just stops updating the file and i gotta restart the game again. is that how i should be doing it anyway or am i missing something with debug mode?

kind surge
crisp fable
#

@kind surge i mean this button here, i'd expect it to refresh the single chosen file with new changes. if there is a way to reload everything without restarting the game that'd be useful too

willow estuary
kind surge
# crisp fable <@!876702750606524416> i mean this button here, i'd expect it to refresh the sin...

I've had issues using that button when the Lua code has certain programming techniques within it. I believe the issue is that that button only interprets the current contents of the file once again and does not purge anything from the result of that file being interpreted the first (or any subsequent) time. So it should work fine if that file is only doing things that would be completely overwritten by interpreting it again, but there are several techniques that are necessary when modding in PZ that violate that constraint. So I always quit back out to the main menu and reload the save when I am testing something like that.

kind surge
crisp fable
#

I see, thanks. Looking back at that screenshot I actually saw that there is another reload button at the bottom of the upper right frame and that one seems more consistent but I'll keep in mind that it's not foolproof. It's pretty useful if you're just doing small changes to an interface that you can reload ingame.
Are there shortcuts for the line-by-line debugging, like for step over or step in? I only know of f11 which seems like regular Continue

willow estuary
rigid dock
#

Lol

#

Are all keys for the same house labled the same?

#

@willow estuary

willow estuary
#

Those aren't house keys, they're lootbox keys πŸ˜‰

rigid dock
#

Wait what? That a mod?

#

Oh I see from your earlier screenshots, that's awesome!

#

Would you find the key in the same house?

#

Or building

willow estuary
# rigid dock Wait what? That a mod?

Unreleased wip, but the idea is that when it's complete that there will be assorted cases and keys that spawn in the world with the loot.
And every case will have a matching key, and vice versa, but there's no guarantee that they will spawn in the same building? It could be two people at opposite ends of the world. In fact, that's how I'm trying to have it work, so people are encouraged to communicate and cooperate in order to get the loot cases open?

rigid dock
#

I have always thought it would be awesome if the bank in rosewood had a room full of safety deposit boxes, and you had to find the keys all over the map in different towns or hidden locations and you got really cool loot from them if you went back to rosewood and opened the correct box.

Which also kind of ties into my idea of hidden rooms and houses, maybe there is a room that doesn't quite reach the end of the house and you might be able to notice from the outside. It doesn't look quite right, and there is a doorway hidden behind a big dresser or something that that leads to the hidden room where you can find good loot and maybe a key to a safety deposit box. Honestly, the game could also borrow a lot of hidden loot ideas from 7 Days to die, that's probably one of my favorite parts of the game is all the neat ways to find hidden loot. Using a shovel to dig up hidden loot would be awesome Also if you followed a map.

#

@willow estuary The safety deposit boxes are pretty similar to what you did! I think it's an awesome addition

#

It would also be nice if you can find the keys for safety deposit boxes in other loot rooms, giving some real loot to locked rooms that normally have little such as the secure room in jewelry stores.

odd notch
languid nimbus
#

Don't know if this is the right event for a server

#

Does anyone knows how to create a new weapon type or a mod that created a new one? I already have the new items and animations, but I don't know how make the xml files work property

tulip valve
#

Anyone know why this happends to my custom profession?

#
    hitman:addXPBoost(Perks.Aiming, 10)
    hitman:addXPBoost(Perks.Reloading, 10)
    hitman:addXPBoost(Perks.Fitness, 5)
    hitman:addXPBoost(Perks.Axe, 10)
    hitman:addXPBoost(Perks.Blunt, 10)
    hitman:addXPBoost(Perks.LongBlade, 10)
    hitman:addXPBoost(Perks.Spear, 10)
    hitman:addXPBoost(Perks.SmallBlunt, 10)
    hitman:addXPBoost(Perks.SmallBlade, 10)
    hitman:addXPBoost(Perks.Maintenance, 10)
    hitman:addXPBoost(Perks.Driving, 10)
    hitman:addFreeTrait("TrainedAssassin");

    UI_prof_Hitman = "Hitman",
    UI_profdesc_hitman = "Extremely high combat skills. Starts with a silenced handgun, a knife and some extra magazines.",```
#

obviously the UI stuff is in UI_EN.txt

grizzled grove
drifting ore
tulip valve
#

arg? What is an arg xD

#

Argument?

drifting ore
#

Yes

tulip valve
#
    cabdriver:addXPBoost(Perks.Driving, 10);
    cabdriver:addXPBoost(Perks.Mechanics, 2);```
#

This is what I have for the Cab Driver, its exactly the same and yet it works

drifting ore
#

So maybe its because there is no Driving perks

tulip valve
#

Your surgeon example dosnt work, it broke everything lol

tulip valve
drifting ore
# tulip valve There is, I have put Driving Perks on all the other Profession and they work jus...

O ok mb, so there is the full code that add the profession in my mod:

local function AddProfession()
    local surgeon = ProfessionFactory.addProfession(
            'surgeon',
            getText("UI_prof_surgeon"),
            "profession_surgeon",
            -6,
            getText("UI_profdesc_surgeon")
    );
    surgeon:addXPBoost(Perks.Doctor, 4);
    surgeon:addXPBoost(Perks.SmallBlade, 3);
    surgeon:getFreeRecipes():add("Make metal hand");
    surgeon:getFreeRecipes():add("Make metal hook");
    surgeon:getFreeRecipes():add("Make wooden hook");
    surgeon:getFreeRecipes():add("Combine real surgeon kit");
    surgeon:getFreeRecipes():add("Combine surgeon kit");
    surgeon:getFreeRecipes():add("Combine improvised surgeon kit");

    local profList = ProfessionFactory.getProfessions()
    for i=1,profList:size() do
        local prof = profList:get(i-1)
        BaseGameCharacterDetails.SetProfessionDescription(prof)
    end
end

Events.OnGameBoot.Add(AddProfession);
#

It's go in shared!

tulip valve
#

same problem, used that code :/

#
            'hitman',
            getText("UI_prof_hitman"),
            "profession_hitman",
            -40,
            getText("UI_profdesc_hitman")
    );
    hitman:addXPBoost(Perks.Aiming, 10);
    hitman:addXPBoost(Perks.Reloading, 10);
    hitman:addXPBoost(Perks.Fitness, 5);
    hitman:addXPBoost(Perks.Axe, 10);
    hitman:addXPBoost(Perks.Blunt, 10);
    hitman:addXPBoost(Perks.LongBlade, 10);
    hitman:addXPBoost(Perks.Spear, 10);
    hitman:addXPBoost(Perks.SmallBlunt, 10);
    hitman:addXPBoost(Perks.SmallBlade, 10);
    hitman:addXPBoost(Perks.Maintenance, 10);
    hitman:addXPBoost(Perks.Driving, 10);
    hitman:addFreeTrait("TrainedAssassin");```
#

Game dosn't like Hitman, that must be it.

rocky wagon
#

Okay, this is gonna seem a little crude, but I'm trying to work on a personal, local-only edit of the More Traits mod. How or where are trait exclusions handled usually? Is there a particular place for those to be defined, or are they usually somewhere in the core script/code for the trait?

#

Nevermind, I just found em. Defined in the NPC code, odd.

drifting ore
#

Is there a way to make spawnitems be already equipped when I respawn?

opal wind
#

guys im a lua noob here ,im trying to make my first lua coding, i manage to learn from other mods some, i set this on my lua file for Medicine Effects; i made a anti-sickness pill (-sickness) and a stimulant pill (-fatigue), the first one is already working, but i dont know if my code is right for the fatigue part, it doesnt work 😦

#

function WizRemoveSickness(items, result, player) <------------- first part works
local sickness = 10;
MSPStats(player, sickness);
end
--stat stuff
function MSPStats(player, sickness)
player:getBodyDamage():setFoodSicknessLevel(player:getBodyDamage():getFoodSicknessLevel() - sickness);
end

function WizRemoveFatigue(items, result, player) <---- this how do i set fatigue?
local fatigue = 10;
MSPStatsB(player, fatigue);
end
--stat stuff
function MSPStatsB(player, fatigue)
player:getBodyDamage():setFatigueLevel(player:getBodyDamage():getFatigueLevel() - fatigue);
end

hollow shadow
bright acorn
opal wind
#

Btw when i set like this i got no errors it just wont remove fatigue

languid nimbus
bright acorn
languid nimbus
#

Default settings, didn't change anything

#

It works perfectly for me when changing an existing AnimSet, but I can't figure out how to create my own animset for a custom gun type

bright acorn
bright acorn
languid nimbus
autumn torrent
#

Is there any documentation or anything on how to parse how the LUA is designed? Like, I just want to make another dropdown selection in the sandbox UI, but I can't find anything in the LUA that traces back to the dropdowns that already exist, like Hearing or Sight, and it feels like that for pretty much everything I try to not make from scratch.

drifting ore
#
function MyUI:create()
    self.comboBox = ISComboBox:new(x, y, w, h, self);
    self.comboBox:initialise();
    self.comboBox:instantiate();
    self:addChild(self.comboBox);

    local keys = {"One", "Two", "Three"}
    for key,value in pairs(keys) do
        self.comboBox:addOption(key);
    end
end
odd notch
#

sandbox_en.txt goes in your lua/shared/translate/EN

#

i set the page to BuffysMods so it created a new page with the string listed by the same variable in the sandbox_en.txt i've never tried adding them to existing pages but i imagine you just... set the page name to the same as the basegame one, no?

#

best practice to make your own page section for your mod stuff though. end users aren't reliable to comb sandbox options to find your settings themselves, nor recognize a non-vanilla setting in a list of vanilla ones ameowsparkle

autumn torrent
odd notch
#

i figured it worked that way xD

autumn torrent
#

But I appreciate the help. Thanks a lot you two πŸ™‚

drifting ore
autumn torrent
#

Oh, no. I was actually trying to make UI under the ZombieLore page, but I think I'll stick with having it on its own page for now so I can work on something other than UI lol

drifting ore
#

If anyone is available 5min for me to test my mod on my server that would be great. Just log in, I tp you, I do a medical check and it's good. I'm available for about 40min. Send me a mp

#

hey guys how do i make clothing like jackets open and close using right click menu

drifting ore
bright acorn
#

well that and export groups I think, one of those things fixed it lol

opal wind
#

darn lol why this code wont work? fatigue just dont change

#

function WizRemoveFatigue(items, result, player)
local Fatigue = 10;
WizStatsB(player, Fatigue);
end
--stat stuff
function WizStatsB(player, Fatigue)
player:getStats():setFatigue(self.character:getStats():getFatigue() - Fatigue);

end

#

it does not give errors

#

aaah man i cant believe it was just a type error lol

#

guys is there any place i can see these game stats and such?

#

how people can mod these, like they guess too like i did?

autumn torrent
#

I'm also looking for these stats. I'll let you know if I find anything useful.

opal wind
#

also like for example, how do i know what is fatigue value when the player is extremly tired and such

#

i will let u know too!

autumn torrent
#

I think all player stats are on a scale from 0-100, but thats just my guess

willow estuary
#
    local stats = player:getStats()
    local fatigue = stats:getFatigue()
    stats:setFatigue(NEW_VALUE_HERE)
autumn torrent
#

I think fatigue is actually on a scale of 0 to 1, which might be why subtracting 10 doesnt work. try doing player:getStats():setFatigue(self.character:getStats(): getFatigue() - self.character:getStats():getFatigue()); and seeing if that removes the player's fatigue

lavish citrus
#

Can anyone tell me why all the cities I downloaded worked in my regular hosted game, but are not showing up and are not in my map world for this dedicated server i started.......

autumn torrent
lavish citrus
#

Yes and they did when i ran a regular hosted server

#

Not in my dedicated tho......

autumn torrent
civic galleon
#

player:getStats():setFatigue(math.max(0, modData.swfFatigue)) if you want to prevent values from dipping below 0

#

you also will likely want to use mod variable to change a player's stats

#
local player = getPlayer()
local modData = player:getModData()
modData.swfFatigue = player:getStats():getFatigue()
modData.swfEndurance = player:getStats():getEndurance()

This way the data is stored by a variable that can exist even after your function has ended, as otherwise values do not save

#

I am unsure how helpful any of this info is, but its the one thing I have spent some time messing with

#

also someone please correct me if I am wrong about anything ive said

autumn torrent
#

Can anybody find the file(s) indicating how the sandbox options are applied to the game? Like, where's the code that handles changing the radius of zombies hearing when a player selects "Pinpoint" from the Sandbox Hearing combobox?

civic galleon
#

default if hosting on Windows is C:\Users\your_user_name\Zomboid\Server\servername_SandboxVars.lua

opal wind
civic galleon
#

When using local var = getStats() that var loses its value when the function ends

#

It does not hold if you were to call that var again after that function that called and created it ends.

#

I am not sure if you need to store stats beyond a single application, but that is how I do it for Sleep With Friends

wintry zealot
#

Where can I find information on setting up IntelliJ?

opal wind
#

you mean it wont save like after you reload the game or just for servers?

civic galleon
civic galleon
lapis dagger
#

I'm not sure if this is the right section for this question but does anyone know of a simple mod that allows access to tools/meds from containers in a backpack without first equipping the item, for example if i want to sew something up from my sewing kit that's in my backpack it'll find it for me and then equip it.

forest socket
#

any idea how long the "Air raid siren" event goes for in expanded helicopter mod? Hoping its just a single day

#

really ominous and scary lmfao

civic galleon
#
function test()
  local player = getPlayer()
  local fati = player:getStats:getFatigue()
end
function test2()
  local player = getPlayer()
  local player:getStats:setFatigue = fati
end

running function test2 would result in attempting to set the players Fatigue to nil as the variable fati does not save outside of the function it was created in, unless you set the variable to a players ModData, like so:

function test()
  local player = getPlayer()
  local modData = player:getModData()
  modData.fati = player:getStats:getFatigue
end
function test2()
  local player = getPlayer()
  local modData = player:getModData()
  local player:getStats:setFatigue = modData.fati
end
wintry zealot
#

where are mods stored locally?

#

I cant see them in the steam workshop folder

quasi geode
civic galleon
#
function swfIG()
    local player = getPlayer()
    local modData = player:getModData()
    if player:isAsleep() then
        if  modData.swfLoopCheck == 1 then
            modData.swfFatigue = (modData.swfFatigue - modData.swfFatTwo)
            modData.swfEndurance = (modData.swfEndurance + modData.swfEndur)
            player:getStats():setFatigue(math.max(0, modData.swfFatigue))
            player:getStats():setEndurance(math.min(1, modData.swfEndurance))
            if player:getStats():getFatigue() <= 0 and SandboxVars.SleepWithFriends.AutoWake == 1 then
                modData.swfLoopCheck = 0
                player:forceAwake()    
                end
        elseif modData.swfLoopCheck == 0 then
            modData.swfFatigue = player:getStats():getFatigue()
            modData.swfEndurance = player:getStats():getEndurance()
            modData.swfFatOne = (SandboxVars.SleepWithFriends.SleepLength * 60)
            modData.swfFatTwo = (1 / modData.swfFatOne)
            modData.swfEndur = (modData.swfFatTwo * SandboxVars.SleepWithFriends.EndurMulti)
            modData.swfLoopCheck = 1
        end
    else
        modData.swfLoopCheck = 0
    end
end
#

wait, I did waht I did because I am not directly applying saved values, but editting them before applying

quasi geode
#

no need to store in moddata unless you need persistence across restarts, just store in a variable defined outside the function scope

civic galleon
#

JK I remembered my issue wrong

#

Thanks for the trick that will clean up my coding

opal wind
#

im very confused rn lol

quasi geode
#

well obviously its going to depend on the nature of the code too (and how its called) but its easier to pass variables between unrelated functions that way

civic galleon
#

I was attempting to teach how to store vars, as I was under the impression vars never saved without being included in data outside of the function, and I never thought to do what was just taught to me lmao

#

ope

opal wind
#

well its working fine like this:

#

function WizRemoveFatigue(items, result, player)
local Fatigue = 10;
WizStatsB(player, Fatigue);
end

function WizStatsB(player, Fatigue)
player:getStats():setFatigue(player:getStats():getFatigue() - Fatigue);
end

#

i just need to change that local fatigue value

#

you saying if i load the game again my char will be tired again?

civic galleon
#

no

opal wind
#

so i can keep it like that?

#

since someone told fatigue is 0-1 i prb need to set that to 1 i guess or o?

civic galleon
#

1 fatigue is completely fatigued

opal wind
#

yes but its what i reduce

#

so its tired 1, i reduce -1

#
  • Fatigue);
#

it is working with 10 thou for some reason lol

civic galleon
#

if all you are doing is setting fatigue to 0 you can use getPlayer()getStats():setFatigue(0)

#

just jump straight to setting the stat to 0

opal wind
#

yeah i guess but like that i can edit the value as i want

civic galleon
#

of course

opal wind
#

hum

#

thanks a lot man i will test it out later to see if its working fine

civic galleon
#

if you have a need for that, I was only saying if you are only setting Fatigue to 0 in one move

#

we both learned something so thank you

#

and thank you @quasi geode

opal wind
#

yeah i guess it makes sense too, its a pill, but maybe setting to 0 would be kinda OP lol, the item gives 10 uses (10 pills ) πŸ˜„

civic galleon
#

hmmm

opal wind
#

i was thinking if it accept values like 0.5

civic galleon
#

I am sure you will find a good balance

#

it will

#

in Sleep With Friends it edits the Fatigue by as low as -0.0042 an in game minute

opal wind
#

hum

civic galleon
#

I use get and set stats with a formula to set how long it takes for a char to fully recover while sleeping, using values set by the host to complete the formula

opal wind
#

so there are 4 states of Fatigue; Drowsy, Tired, Very Tired and Ridiculously Tired (this would be =1)

#

then 0 is not tired

civic galleon
#

correct

#

I know they are not linear as well (.25, .5, .75, 1)

opal wind
#

yes correct

#

hum so maybe 0.25 would be kinda balanced; 3 pills to remove ridicul tired to 0

#

i mean 4

blissful plinth
#

hi

#

i came here to ask if anyone knew if there is an option or mod to add a smoke effect when you smoke

#

sorry for my english xD

opal wind
#

smoking have effects on smoker trait chars; removing negative moddlets

#

but if you want to add extra effects you can look the cannabis mod structure, im sure you will find something there

blissful plinth
#

sorry maybe i expressed myself wrong, i mean a mod that adds like a visual cloud of smoke

opal wind
#

self:addSliderOption(body,"UnhappynessLevel", 0, 100, 1);

#

0,100,1

#

on fatigue is just 0,1

quasi geode
opal wind
#

but what about unhappines? if i want a 'happy' pill i need to use the 100 scale or the 1 scale?

quasi geode
#

i'd assume its a integer value from 0 to 100 since thats what the slider uses. cant say for sure though without looking

autumn torrent
#

Does anybody know why the names of my UI elements appear like this: Sandbox_AIZ_Speed_option3 instead of being displayed by the value I set in the Sandbox_EN.txt file?

#

as i link the wrong image several times drunk

#

It's probably an error in the Sandbox_EN.txt file, now that i think about it

weary matrix
#

@autumn torrent try this maybe: translation = AIZzombieConfig_AIZ_Speed and Sandbox_AIXzombieConfig_AIZ_Speed_option3

#

but maybe you'll have to get rid of the underscore in AIZ_Speed

autumn torrent
#

I'm actually surprised to find that i think i have to name it translation = AIZ_InactiveSpeed and Sandbox_AIZ_InactiveSpeed I know you don't have to use the object name (or whatever you wanna call it) cuz Foraging Buff doesn't, and that's what I've been using as my guide.

#

The messed up part is that there's no highlighting or anything, so the error could be practically anywhere and idk what it is lol

drifting ore
autumn torrent
#

For some reason, I can't get the example MySandboxMod mod, which contains the syntax for setting up modded sandbox options, to even show in the mod list, which is strange.

#

I'm a dummy. My Translate folder is in the wrong directory. Yikes

opal wind
#

function WizRemoveSickness(items, result, player)
local sickness = 10; <------------------ i was testing this in-game and its like just take a little bit, the queaze effect comes back and you have to take like more 2-3 pills to remove it
WizStats(player, sickness);
end
--stat stuff
function WizStats(player, sickness)
player:getBodyDamage():setFoodSicknessLevel(player:getBodyDamage():getFoodSicknessLevel() - sickness);
end

#

because i think food poison is like it gives this damage to the body for a time, so when you take the pill and remove 10, the food poison comes again damaging X, i guess works like that right?

opal wind
#

i mean foodsickness damage is over time, not on a single 'blow'

#

i can be wrong thou lol

heady forum
#

Good day,
Anyone know why when I "place" my modded item in-game, I do not see the item by the mouse cursor like other items?
I can still click and the character puts it on the ground, and I can see it on the ground, but during the "place" function, I'm not seeing it.
Thoughts?
Thanks!

opal wind
#

i think you prb are talking about Tiles, and your item is a 3d object?

autumn torrent
#

When you get so carried away with the backstory of your custom scenario that you accidently write a 400 word essay that no one will ever read.

heady forum
# opal wind i think you prb are talking about Tiles, and your item is a 3d object?

thanks for the thought. I think I may have figured it out. I didn't have the 3d object in the correct folder. I just can't seem to get it to use .fbx. I can use a .x, but that's not my model. When I try to use my model (.fbx) it doesn't show up.

Also,
do you know what the difference is between
StaticModel =
and
WorldStaticModel =
in the item description text file?
Much appreciated.

opal wind
#

it does not show as .fbx because of scale

#

.fbx models are x100 times smaller than .x ones

#

u can just fix that scaling

#

staticmodel is the one that shows on your hand, worldstatic is the one that show when its on ground/world

#

like when you take a pill for example, the staticmodel is the pill bottle on your hands

heady forum
#

Thank you so much. That helps immensely.
Do you know if there is an online resource (wiki for example) for explaining these descriptions rather than asking in a chat?

opal wind
#

i wish man, i could use that too

opal wind
#

anybody knows what is causing this error? happens when i hover the mouse over the clothing

#

just 2 specific pieces

#

this is the item that give these errors when i hover the mouse it on the inventory

#

item Wiz_BurterArmor
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Burter Armor,
ClothingItem = Wiz_BurterArmor,
BodyLocation = TorsoExtra,
Icon = Wiz_BurterArmor,
BloodLocation = ShirtNoSleeves,
ScratchDefense = 100,
BiteDefense = 100,
Weight = 2.0,
BulletDefense = 70,
Insulation = 0.5,
WindResistance = 1.0,
WaterResistance = 1.0,
WorldStaticModel = Wiz_BurterArmor_ground,
}

weary matrix
#

See the class cast exception at the end of the stack trace

fair frost
karmic heath
#

Anyone knows why i can't extract a pack as a tileset ? only as separate images.

karmic heath
#

Also i can't make a pack that works ingame.

#

i'm trying to make a simple mod that adds movable posters. The recipe works, i can craft the item, then, when i try to place it on a wall, it doesn't work.

#

The only thing i have which is different from other similar working mods is the texture pack.

#

i'm using gimp for the image export, and most tutorials use photoshop, maybe the export format is wrong ?

fleet sedge
#

Is there a mod where I can control where my second character will spawn if my first one dies? I don't want to spawn very far from my safe house if ever my character dies.

karmic heath
#

Which texture orientation should WorldObjectSprite point to ?

{
    Weight    =    0.2,    
    Type    =    Moveable,
    WorldObjectSprite =    my_flag_01_13,
    DisplayName    =    MyFlag,
    Icon    =    Flag,
}```
weary matrix
rain pumice
#

is this one still relevant

primal knot
#

How could I get all the squares that belong to a building? I achieved to get them from a single room with

getPlayer():getCurrentSquare():getRoom():getSquares()

but I don't know how to get all IsoRoom from an IsoBuilding. Tried to access the public property

getPlayer():getCurrentSquare():getBuilding().Rooms

but for some reason this always returns nil

charred knoll
#

I have a quick question, do I have to relog every time i edit my mod or is there a way to 'restart' it ?

drifting ore
#

and you don' t start the game

#

Afterwards, if you change the translations or the textures, it doesn't work. Have to restart the game

charred knoll
#

Will do thank you πŸ™‚

leaden notch
#

is there an api to toggle electricity/water in the whole world? i've been going through the vanilla files and cant seem to fine anything directly related nvm i found the setHaveElectricity function

#

cant find anything about water tho

#

is there a way to get all grids in a world?

languid nimbus
#

If anyone knows how to set a new weapon property that can be checked under conditions so that I can change the animations please let me know, almost giving up Γ§_Γ§
Or a list of properties that can be verified in m_Conditions

low yarrow
#

Anyone know how you can turn into a ghost (Runnin through objects and very quickly)?
I managed to do it once but i forgot how

#

(Debug mode)

charred knoll
#

I am back here to ask for some help...
For some reasons that I don't understand when I turn on my mod that just add an item it break the crafting tab.
(Sorry for the french part) I didn't do much so I am kinda wondering what happened

burnt axle
#

hey, me and my friend are playing on a server with mods that we added, and everything's going fine, except for brita's weapon pack not working, any idea as to why this is happening?

outer laurel
#

anyone know a mod to load gasoline into bottles?

#

hello?

drifting ore
#

@quasi geode Ok so I tried different thing and I end up with that but it's not working and I can't make it work. Do you have any idea why ? My player say just Asked player xx, with the good name. But that it. No error so I guess the SendServer function is nevercall.

#

Server:

---Server side
local Commands = {}

Commands["SendServer"] = function(player, arg)
    arg["To"]:Say("To")
    arg["From"]:Say("From")
    sendServerCommand(arg["To"], "TOC", arg["command"], arg)
end

local onClientCommand = function(module, command, player, args)
    if module == 'TOC' and Commands[command] then
        args = args or {}
        Commands[command](_, args)
    end
end
Events.OnClientCommand.Add(onClientCommand)
#

Client:

local Commands = {}

function Ask(player)
    local arg = {}
    arg["From"] = getPlayer()
    arg["To"] = player
    arg["command"] = "SendOriginal"
    sendClientCommand(moduleName, "SendServer", arg)
    getPlayer():Say("Asked to " .. player:getUsername())
end

Commands["Get"] = function(arg)
    TOC_PATIENT_ModData = arg["toSend"]
    getPlayer():Say("Get")
end

Commands["SendOriginal"] = function(arg)
    local o = {}
    o["From"] = getPlayer()
    o["To"] = arg["From"]
    o["command"] = "Get"
    o["toSend"] = getPlayer():getModData()
    sendClientCommand(moduleName, "SendServer", o)
    getPlayer():Say("Send org")
end
#

The problem may be that I send isoplayers. Is it better that I send the player index and get the player on the server side ?

quasi geode
#

yep. cant send IsoPlayer instances

drifting ore
#

Ok, can I get the iso player on the server ?

quasi geode
#

eh use the player index like you said, though theres no reason for sending this to the server: o["From"] = getPlayer()
the server already knows who its from local onClientCommand = function(module, command, player, args) << with the player argument there
which should be passed to the function in your Commands table... instead of calling it like this Commands[command](_, args) since your passing it _ which is nil. that should be player

drifting ore
#

yep, that the first test ^^ I just want it to work and after I optimize.
So I change arg["To"] = playerNum and it's work ?

#

Like sendServerCommand(player, module, command, arg), player is an ID ?

quasi geode
#

you'll need to fetch the instance from the id number

drifting ore
#

like that : getSpecificPlayer(playerNum) ?

quasi geode
#

ya

drifting ore
#

Ok, a rly big thx that should work this that !

#

O and player:getPlayerIndex() is the online index ?

frank rivet
#

Is there a mod tutorial section in this discord I can refer to? Thank you. Sorry if posting in wrong channel

drifting ore
# frank rivet Is there a mod tutorial section in this discord I can refer to? Thank you. Sorry...
GitHub

Guide to modding various aspects of Project Zomboid - GitHub - FWolfe/Zomboid-Modding-Guide: Guide to modding various aspects of Project Zomboid

GitHub

Contribute to MrBounty/PZ-Mod---Doc development by creating an account on GitHub.

dull parrot
#

yep, i like this community, very active and fine XD

small topaz
#

hi! there is this strange behavior of the transparent stockings and tights vanilla clothing items. some of you have probably already noticed. they make the player model somewhat transparent so that you can seen parts of the environment which usually should be hidden by the player model. see the screenshot to see what i mean. my question is whether there is a "correct" way to make transparent clothing items which do not have this undesirable behavior of the vanilla tights and stockings. they should simply show parts of the player model but nothing else. one way to solve the problem is by "glueing" some parts of the player texture to the texture of the clothing item but i am wondering whether there might be a better way...

#

the white-ish area on the stockings are in fact part of the fence. can be seen better when you are in game and move.

broken kayak
#

I've never noticed any transparency on stockings, though I had this problem when I tried to make transparent clothing way back.

broken kayak
#

Well clothing that have no 3D models directly replace the character's skin texture everywhere the alpha channel isn't zero, and I don't know if there is a way to counteract this.

undone crag
#

Maybe you could make the mask partly transparent rather than the texture? I have not used masks for a long time so I may not be able to reliably say exactly what they do now.

small topaz
small topaz
#

but i have never actually used masks. so i do not really know anything about that. πŸ˜‰

undone crag
#

It is a png. Its file path is in the .something file like how its texture file path is. You could copy a mask folder or file (one of the two) as a template and make it a bit transparent to test?

small topaz
undone crag
#

I have not modded PZ xml files for a while. Mask ID's hide body parts, which is good for clothing with its own model. The mask png thing, I don't know what to type.

opal wind
opal wind
autumn torrent
#

This is probably a silly question, but if I want to add some code to one of the functions in a lua file from the base game, I have to copy the whole file to my mod folder and then edit it, right? I can't append functionality to a function, or just overwrite a single function?

opal wind
weary matrix
#

which function do you want to replace?

autumn torrent
#

Well, I really just want to add my own sandbox preset alongside my mod, but the sandbox presets are initialized in SandboxOptions.lua

opal wind
#

this error im getting is so strange, because these itens are not inventory containers

weary matrix
weary matrix
autumn torrent
weary matrix
small topaz
autumn torrent
#

very new to lua

weary matrix
opal wind
opal wind
#

i never post anything on Githug not a clue how to do it... 😦

weary matrix
#

@autumn torrent try something like this in your mod:

local SandboxOptionsScreen_loadPresets = SandboxOptionsScreen.loadPresets
SandboxOptionsScreen:loadPresets()
    SandboxOptionsScreen_loadPresets(self)
    -- add your custom preset here
end```
opal wind
#

its so strange only happens when i hover the mouse over those items

small topaz
opal wind
#

maybe i could .zip all my scripts and lua files?

weary matrix
leaden notch
#

Is there an api to set whether the world/chunk/grid has an unlimited water supply?

weary matrix
#

if you do a proper hook it should have no impact for example

small topaz
weary matrix
small topaz
#

btw mods being incompatible with other mods is fairly standard and occurs quite often, even without overwriting stuff

weary matrix
weary matrix
autumn torrent
#

I'm going to intervene

opal wind
#

haha good point, and i dont think most mods are incompatible with each other, most times people use packs with dozens of mods without problems

autumn torrent
#

@small topaz while overwriting might ensure your code works with a new update, if the new update would have otherwise caused your code to stop working, then youll need to update it anyways as your mod file might be overwriting new functionality that could cause issues elsewhere or even omit new features of the update

weary matrix
#

way more chance to break a save by overwriting a full file than replacing a single function in that file

small topaz
small topaz
weary matrix
#

@small topaz anyway I told you I respect your opinion, now let's just agree to disagree

small topaz
autumn torrent
shut zinc
#

Quick question, is it true that on MP there is a max distance at which user data is no longer updated on a client, specifically, every users X,Y Coordinates?
Also, is there a way to import the Zomboid libraries into intellij ultimate to get that sweet, sweet autocomplete?

small topaz
#

but i agree that issues might arise elsewhere. it is therefore advisable to check what other luas are calling functions from the lua you'd like to overwrite. i definitely agree that you always should be very careful when overwriting stuff.

small topaz
autumn torrent
#

I think both sides have their reason, but not overwriting and instead appending just seems like better practice in general. I'm sure there are cases where overwriting can be fine, or even better, but vast mod compatibility is a VERY valuable asset to any mod, especially if you're forcing a potential user to choose between your mod and someone else's, and possibly leaving them with a bad taste in their mouth cuz one of those two mods is now causing them issues due to incompatibility. You can make the argument of not using files that are frequently overwritten, but you can't take into account EVERY mod in the workshop

small topaz
autumn torrent
#

Does anybody know of a mod that adds a sandbox preset that I can use as a reference?

magic compass
#

Is this the area I can request mods?

autumn torrent
mint sphinx
#

is it possible to make a lua scrip at a template for items ? i have like an item there should have a,b,c,d items and recipes for each item. is it possible to make a lua script there and read the items and crate + add it to the game it self? just like how the items.txt and recipe.txt do?

strong bough
drifting ore
high condor
#

So i stumbled upon this page while looking for how to setup InteliJ https://github.com/Konijima/PZ-Libraries/blob/Tutorial/README.md
But i wonder, do i have to decompile the java files to make it work, i assume it helps with auto completion. And how do i do that, the tutorial doesnt show how to and i couldnt find anything specific anywhere

GitHub

Decompiled Java/Lua Files for modders. Contribute to Konijima/PZ-Libraries development by creating an account on GitHub.

mint sphinx
#

does anyone know when the mods items.txt loads into the server setting ?

strong bough
drifting ore
strong bough
drifting ore
#

Trying a new approach. To see if it will be better

strong bough
#

Also you can't get to the tailoring screen easily, through that menu, you have to do it through the inventory

#

So that mod is "kinda" useless already lmao, its just a kinda cool reminder as to what you have on you, not so much for functionality

drifting ore
#

Yes the goal of my mod is to no longer go to the inventory for the equipment at all

strong bough
#

So disregard what I said initially, yours is looking great

strong bough
#

How stable is it rn?

leaden notch
#

I'm confused about how power works, I've tried running

getPlayer():getSquare():setHaveElectricity(false)

but the appliances in the area appear to still be powered? lights are on etc
is there something else I should do?

drifting ore
#

But main features are here and work

strong bough
cold burrow
# drifting ore Prototype of my scrolling list with folder for my equipment tab

And it's me again. Let me know if i bore you with my opinion. :D

Could be great, if items shows right below specific section.
Like Accessory section and then all accessories below name Accessory. It's pretty hard to explain.

Currently:

Leg
Accessory
Head
Body
  Belt
  Holster

What i mean:

Leg
Accessory
  Belt
  Holster
Head
Body
drifting ore
strong bough
#

It should work with mods that add guns because you're hooking to the vanilla inventory, which shows the modded guns, right? I'm not much into modding but I dabbled in some lua back in the day on roblox lmao

#

Oh shit i'll check it out

drifting ore
cold burrow
strong bough
#

Quick question, typically mods are tested on the workshop and therefore the creators include the "multiplayer" tag if they are known to work, right? well, is that exclusive for mods that don't have the tag and therefore still work on multiplayer just not tested extensively?

drifting ore
#

But it's depend

strong bough
#

Yeah, makes sense

#

I can't get project russia to work on my MP server :C

mint sphinx
willow estuary
strong bough
#

So I can assume its safe to download mods without multiplayer tag and just test them one at a time to see if shit breaks?

#

Another question is there a way to stress test or is it basically if-it-starts-its-good type of thing

willow estuary
#

That's how people should be doing things anyways TBH IMO?

quasi geode
#

tags are near meaningless. people apply them to things that completely dont fit

willow estuary
strong bough
#

I just put build 41 and multiplayer

#

which seems to show the best mods in most cases of the 500+ mods i've thoroughly looked through

#

I only have 150 on my server tho, lots of not so "realistic" mods on the realistic tag lmao

#

I wish we had an immersive tag but maybe thats the bethesda gamer in me

willow estuary
#

Tags quickly become useless on most platforms as the platform becomes more popular IME?
People "spam" the fuck out of tags on their pages to get more traffic + subs, etc.

strong bough
#

ahem

#

LUL

sage epoch
#

where can i mod the frozen food not being available for stews and soups?

#

\media\lua\client\ISUI

#

ISInventoryPaneContextMenu.lua

#

maybe?

mint sphinx
willow estuary
# mint sphinx i agree but the problem is does it work for server multiplayer or the other muli...

Honestly, I believe people should just become accustomed to testing and evaluating mods themselves vs trusting tags?

Anyone can click on a tag when uploading a workshop item. But that person could be mistaken. Or could be lying.
There's nothing keeping insane 9 year olds or trained chimpanzees from uploading mods to the workshop, and saying that it works in MP. But that doesn't mean that it actually does work properly in MP?
Like Fenris said, tags quickly become meaningless 🀷

odd notch
#

so i'm creating a button but,, for some reason it just won't?? let me press it dfgvhgvdsgfh

#
        self:drawText("Click a (Buffy Dice) skill to roll a d20.", left + 5, y, 1, 1, 1, 1, UIFont.Small);
        self.reset = ISButton:new(10, y + 30, 20, 20, "Reset Dice Skills", self, reset_skills);
        self.reset.internal = "OK";
        self.reset.anchorTop = false
        self.reset.anchorBottom = true
        self.reset:initialise();
        self.reset:instantiate();
        self.reset.borderColor = {r=1, g=0, b=0, a=0.5};
        self:addChild(self.reset);
        y = y + 30
mint sphinx
odd notch
#

what did i mess up

strong bough
willow estuary
# strong bough Thats what the comment section is for, to know if shits borked or not πŸ˜›

Personally, I believe there is a batshit bonkers insane amount of confused misinformation in the comments sections, I would not trust statements in the comment sections, and I believe that misinformation spreading via the comment sections is a genuine problem. Any time I look at the comment sections for mods, more often than not, I see people making outrageous claims that I know are wrong, and they're often very agitated about it as well?

strong bough
#

Yeah people don't know how to fix the most common issue which is steam being absolute utter garbage with auto-updating and workshop related issues

willow estuary
#

Same problems that society deals with outside of steam TBH, but, like tags, it's a case of a source of information becoming tainted,

weary matrix
small topaz
#

presupposed that your button should have an effect on a single click. btw i am not an expert on this...

drifting ore
#

How do I make player corpses despawn every in game hour on my server?

drifting ore
odd notch
#

oh i probably need- an onmousedown func dont i

drifting ore
#

reset_skills is the function call when you press the button

crisp fable
#

it's a bit weird you have a global function for a button click event but otherwise it looks fine imo, i dont define anything but the last param either for it

odd notch
drifting ore
#

Like a windows and you put the button in it

opal wind
#

tags... πŸ™‚

drifting ore
mint sphinx
# willow estuary Same problems that society deals with outside of steam TBH, but, like tags, it's...

do you know if is possible to make a template.lua for items? like when i make an item in items.txt i want it to crate item a,b,c,d behind the scene so. and example have the item foonoditem { import base {} item foo { ....}

then make have the template.lua make the items
item bar_foo {
...
...
...
}
item bar_bar_foo{
..
...
...
} and so on and so on. what im doing really just need to be able to do in a template would make it easier to edit as well instead of edit on 140 items as it like right now

autumn torrent
#

Where in the world is the time of day stored? I neeeeeddd it

odd notch
autumn torrent
weary matrix
#

@autumn torrent are you looking for in-game time of day?

willow estuary
# mint sphinx do you know if is possible to make a template.lua for items? like when i make an...

I've never heard of or seen anything that would imply as such, aside from vehicles having template functionality?
It might be worth looking at how vehicles do it, and experimenting with following, but it could be a dead end.
If you wanted to somehow automate applying parameters to items, maybe using the DoParam function with lua might be a solution?

local item = ScriptManager.instance:getItem("Base.Hat_Army")    
if item then 
    item:DoParam("BulletDefense = 100")
end
mint sphinx
#

it just have to run it all before it even spawn the items as well. but okay fair enough

drifting ore
#

Do you guys think it would be feasible for a vehicle that is locked to follow railroad track tiles

#

I imagine checking for the tile under a vehicle isn't impossible since its what prevents you from driving your cars across water tiles

mint sphinx
drifting ore
#

Yea

#

The only issue I see with the concept is turns

lapis dagger
#

Hey guys is it possible to disable the godmode option and invisible option when im hosting a server? /setaccesslevel none doesn't seem to work and I don't want to feel tempted to use godmode to fix my character when I'm playing with friends.

drifting ore
mint sphinx
drifting ore
#

The long-awaited ladder

lapis dagger
#

@odd notch Not currently, no.

odd notch
#

in the admin panel -> edit admin powers

#

uncheck everything and hit save

#

and setaccesslevel requires a string username if you type it in chat like /setaccesslevel buffy none

lapis dagger
#

@odd notch Ok gotcha thank you, let me try that out.

#

@odd notch Still seem to have the option to enable godmode through the client panel after disabling godmode and setting my access to none

odd notch
#

you're the localhost, yes?

#

you will always have the admin panel

#

coop servers

chrome sky
#

Could anyone familiar with True Music tell me where the tapes/vinyls usually spawn ? Sifting through the mod files I cant find any info

odd notch
#

you can see the distributions in the media/lua/server/items folder

odd notch
#

should throw up a dedicated server instead

lapis dagger
#

@odd notch I thought about that actually, I'm just being lazy and don't wanna go through the process of learning how to do that lol

odd notch
#

assuming your save is called like 'servertest' im pretty certain if you just run projectzomboidserver64.bat it will put up your save

#

you can find a guide for going from coop -> dedicated though it might be more complex

lapis dagger
#

@odd notch Ok cool, thank you so much for helping me out 😁

odd notch
#

gives me something to do while waiting for my game to load 81/81 chunks

#

speaking of my new dnd update is complete! now there'll be dnd style skills people can level separate from basegame skills for their d20 rolls Dance_

#

@drifting ore can u tell i gave up on the button concept :)

drifting ore
lapis dagger
#

Oh that's dope!

odd notch
#

hilariously i followed your guide, im going to wager it was due to the button being instantiated deep within conditions and far away from where the ui was created

#

or perhaps some trickery with that specific ui; theres an element thats overlaying it or something idk

drifting ore
#

Try the full example, he work I just try it

#

It open an UI at you mouse

undone heron
#

yo MrBounty since you seem knowledgeable. Do you know where Strength and Reading is initialized in character creation so they start at 5?

#

marking
passive = true,
in the skill section seems to do absolutely nothing atm. Well, aside from Chuck checking it for skill journal mod.

sage epoch
#

what are the key bindings in the lua debugger? I have found F6 is step and F11 is continue

#

and how do I add a watch?

quasi geode
# willow estuary I've never heard of or seen anything that would imply as such, aside from vehicl...

used to work in b40. digging around some old code snippits:

 local script = {"module Base {"}
for sound, range in pairs(swingSounds) do
      table.insert(script, "\tsound ".. sound)
      table.insert(script, "\t{")
      table.insert(script, "\t\tcategory = Item,")
      table.insert(script, "\t\tclip")
      table.insert(script, "\t\t{")
      table.insert(script, "\t\t\tevent = ".. sound ..",")
      table.insert(script, "\t\t\tdistanceMax = ".. range ..",")
      table.insert(script, "\t\t}")
      table.insert(script, "\t}")
end
table.insert(script, "}")
getScriptManager():ParseScript(table.concat(script, "\r\n"))

that was from a loop i used to generate the sounds.txt for orgm back in the day, using print on the last line to generate the file instead of :ParseScript though, used to be able to generate items with similar code, recipes were funky though, idk how well it will work with the new WorldDIctionary stuff, it probably wont work anymore in 41 though

crisp fable
# sage epoch and how do I add a watch?

F5 also does something, not sure if it's the same as step though.
to add watch right click one of the variables in the middle bottom screen (or maybe locals instead)

sage epoch
#

nice, thanks for the help

brittle jewel
#

F5 steps over (will stay in the current file) F6 steps in (will continue on the code path, into the next file).

elder ermine
#

Hi just have a question about a mod which is the Auto Tsar Trailers, If i add the mod in the middle of my playthrough will it still spawn the different types of trailers around the world/map?

mint sphinx
quasi geode
#

in theory yes, but it didnt work out so well...i had it generating all the mod's ammo types and boxes (items) and the recipes to open them. but the recipes wouldnt fully register. there was probably some validation step on recipes that was missing since it was generating later in the boot sequence, i never fully investigated the issue

#

instead i had it auto generate the items and recipes and print to file

willow estuary
#

πŸ˜„

quasi geode
#

since that was better for compatibility and other people trying to understand what the mod was doing

mint sphinx
quasi geode
#

eh loot spawns mostly as the world is explored. i really have my doubts though that autogeneration of items at runtime will be viable in 41, especially in a mp environment. better off to just use it to generate to a actual script file, assuming you only need it for generation due to timesaving (ie: avoid large amounts of redundant typing)....if you truely need dynamically generated items and recipes then that could be really problematic. but idk i really havent looked at this new worlddictionary stuff

mint sphinx
#

the items still need to be made set into the managementscript and then into Distributions hmm okay going to be interesting

mint sphinx
sour salmon
#

Anyone know of a mod that increases the skill ceiling for first aid? By that I mean that it makes it more difficult for someone with no knowledge to just wrap their injury in ripped sheets and be healed in an hour.

autumn torrent
#

Is there an event for when the time changes in-game? something like what handles the changing of the time on a watch? I think I could use the OnTick event and just check gameTime:getTimeOfDay() each tick, but that seems incredibly inefficient

autumn torrent
#

wow i literally looked right at that event as well. thanks lol

autumn torrent
viscid elbow
drifting ore
plucky sluice
#

Anyone managed to setup emmyLua on vscode.. the plugin came with no doc and I hardly see a link between the available config and the one for intelliJ πŸ€”

chrome nimbus
#

Is it difficult to change what tools is required to destroy or disassemble something? I want to destroy the house porch/deck fences or the fences around fields with a hammer and saw. Is this easy to change?

viscid elbow
drifting ore
viscid elbow
#

burglar

drifting ore
#

It's "burglar" in the file game so it should work

#

Otherwise you can try

local profList = ProfessionFactory.getProfessions()
for i=1,profList:size() do
    local prof = profList:get(i-1)
end
viscid elbow
#

Yeah I'm just doing it like that for now

drifting ore
#

Stay like that. Never change something that works xD

viscid elbow
#

but that also means you have to do this, which is the nice thing that ProfessionFramework usually takes care of:

local OldDoProfessions = BaseGameCharacterDetails.DoProfessions
local function DoProfessions() 
  OldDoProfessions()
  local prof = ProfessionFactory.getProfession("unemployed")
  prof:addFreeTrait("trait") 
end
BaseGameCharacterDetails.DoProfessions = DoProfessions
feral anvil
#

can you use a bbq grill in your house? just found one and never tried lol

chrome nimbus
#

You don't think it can be done or don't think it's hard?

drifting ore
#

I don't think it's that hars but you have to understand coding and it gonna take some time

#

Especially learn how PZ works

chrome nimbus
#

Java won't be hard

drifting ore
#

It's lua, not java

chrome nimbus
#

I just need to find an example of the existing code and change the item reference

#

Lua then

quasi geode
drifting ore
#

You gonna need to check the vanilla game file to see where the code to destroy is made, them understand how it's done and try to copy that to a new item. But start to make a custom item, check the pinned message

willow estuary
#

media/lua/shared/translate/EN is actually a pretty good shortcut for getting things like the names for professions, traits, etc.

chrome nimbus
#

The sledge action for those items already exists, and there are multiple recipes and action that exist that can use one of several tools to complete an action

quasi geode
#

if theres a value it cant change on the vanilla ones that way it will throw a error msg in the console about it

viscid elbow
quasi geode
#

though if i remember right it should beable to change everything on the default profs, just some of the default traits it will not beable to change a few things like cost

drifting ore
chrome nimbus
#

Ahhh

#

Is the test mod provided with the game a good place to start to see how I should be setting things up?

#

I'm assuming I can copy, rename it and then make any changes I need to

viscid elbow
lyric jungle
#

any mods to fix that VHS XP bug where if you create a new character after the previous one has seen the VHS, they don't gain skills

#

or like, another way to fix it?

gritty edge
#

would anyone be willing to help me make a mod at all? gonna read the modding guide but if anyone would like to help that would be great ^^

autumn torrent
#

Quick question: whats the syntax you would use to call this function? CIZSandboxOptions.checkIfUpdateCIZSettings = function() end

#

I noticed throughout the files that functions were being defined in two different ways and I got confused. Some functions are defined likeCIZSandboxOptions.checkIfUpdateCIZSettings = function() and others are defined likefunction CIZSandboxOptions:checkIfUpdateCIZSettings()
What's the difference?

viscid elbow
#

There's no difference

#

They're both called by CIZSandboxOptions:checkIfUpdateCIZSettings()

autumn torrent
quasi geode
#

theres a minor difference.

function CIZSandboxOptions:checkIfUpdateCIZSettings()
end

is the same as

function CIZSandboxOptions.checkIfUpdateCIZSettings(self)
end

calling them:

CIZSandboxOptions:checkIfUpdateCIZSettings()

is the same as

CIZSandboxOptions.checkIfUpdateCIZSettings(CIZSandboxOptions)
#

if its using : then it adds a variable argument self which contains the table holding the function

#

basically : is used for "Object Oriented" style programming

autumn torrent
#

I see. So in other words, I'm gonna be defining functions with the : from now on lol

quasi geode
#

as long as you call them with : as well, otherwise it generally gets confusing/leads to typo errors...but theres not much point unless the function needs a pointer to the table its contained in, like if your running multiple instances of the same table

autumn torrent
#

Right, that makes sense

quasi geode
#

things like IsoPlayer objects are a fine example, normally the functions need to know which player and theres multiple instances, why its player:Say("blah") and not player.Say("blah")
although you technically can do player.Say(player, "blah")

viscid elbow
#

Is there a way to make sure your OnGameBoot event gets called after another mod's?

grand condor
#
if (this.Activated && (GameTime.instance.getHour() > 22 || GameTime.instance.getHour() < 5)) {
    WorldSoundManager.instance.addSound((Object)null, (int)this.getX(), (int)this.getY(), (int)this.getZ(), 50, 3);
}```

Was told to put this here. Friend went and looked for the light switch noise code
cold burrow
quasi geode
# viscid elbow Is there a way to make sure your OnGameBoot event gets called after another mod'...

kinda a pain, if you know exactly which file in the other mod is adding the event, you can ensure yours gets loaded after either by using require or naming so it comes after in alphabetical order.
you could probably fake it by adding a function to another event firing before, and having that one add the real to OnGameBoot thus ensuring it falls last (i used to do this is with the events firing on sound banks loading...not sure if they still fire in build 41)

quasi geode
#

OOP doesnt actually exist in lua

#

it can fake it though

#

basically using metatables

autumn torrent
#

Another quick question: Where do print() statements get sent?

quasi geode
#

console

cold burrow
autumn torrent
#

That's what I was hoping you didn't say lol

quasi geode
#

basically ya...though they arent quite associative arrays...tables are a hybrid of associative arrays, ordered arrays and fake objects XD

cold burrow
cold burrow
#

Much appreciated your help and time. :)

#

Now i need to rewrite a few things :D

viscid elbow
quasi geode
#

uh i'm not sure theres any lists actually defining order. I havent actually done much modding for 41 yet so not currently sure whats happening before OnGameBoot

#

you can try OnLoadSoundBanks thats what i was using to delay adding to OnGameBoot

#

but not sure if its still valid

viscid elbow
#

Fair enough, thanks. I'll play around some different ones

quasi geode
tulip valve
#

Fenris being very active now it seems, is this a sign that Orgm is being worked on?Pogey

quasi geode
#

working off some of that rust. even started playing a game πŸ˜…

tulip valve
#

A game of zomboid?

quasi geode
#

lmao well i didnt mean some other random game 😜

tulip valve
quasi geode
#

damnit. i keep messing that example up..i'm just off today LOL

cold burrow
#

Fenris_Wolf, while you are here, i just can't not to ask.
I already trying to ask here, but still can't find solution.

Is there any way to completely remove item from a game with lua?
I already tried this one pretty bad workaround and it's works, but it leads to errors. This is .txt variant:

module Base
{
  item ExampleItem { }
}

But i'm pretty sure there should be method to remove item.

cold burrow
quasi geode
#

i cant say i've ever actually tried to completely remove something

#

somewhere i have a half completed tutorial on lua metatables/OOP that i ment to throw in the modding guide but never finished it off to my satisfaction, 1 sec (its in markdown format though)

#

its still pretty crude though, more technical then tutorial i think...and only got so far as covering __index (basic inheritance) and not any of the other oper overloading

cold burrow
#

I found this one example:

--class
Person = {}
--class body
function Person:new(fName, lName)

    -- properties
    local obj= {}
        obj.firstName = fName
        obj.lastName = lName

    -- method
    function obj:getName()
        return self.firstName 
    end

    -- magic!
    setmetatable(obj, self)
    self.__index = self; return obj
end

--creating class 
john = Person:new("John", "Silver")

--call a prop
print(john.firstName) --> result: John

--call a method
print(john:getName()) --> result: John
autumn torrent
#

Is there a function to get ALL IsoZombie objects? (god bless my performance)

quasi geode
#

self.__index = self; this is entirely unnessessary and recursive...actually the whole example is pretty strange lol

cold burrow
#

Β―_(ツ)_/Β―

#

Oh, it's from 2015. :D

quasi geode
#
--class
Person = {}
--class body
function Person:new(fName, lName)
    -- properties
    local obj= {}
    obj.firstName = fName
    obj.lastName = lName
    setmetatable(obj, {__index = self} )
    return obj
end
function Person:getName()
    return self.firstName 
end
edgy nymph
#

whenever i start up a modded server it says file missing night watch anybody know a fix?

eager pulsar
#

Is there a mod that allows players to claim any house ingame?
trying to claim the fire station with my gf but it wont allow us

quasi geode
#

the other is 'technically' valid but meh

#

self.__index = self this alone is horribly recursive and not needed (its a cheap shortcut using the Person table as the metatable. bad format...only specific keys are actually used in a metatable, such as __index, __newindex __add, __sub etc)
ideally the metatable should be small, even that example i just showed could be optimized

Person = {}
local meta = { __index = Person } -- reuse this metatable for every instance
function Person:new(fName, lName)
    -- setmetatable also returns the new table (the one passed in as the first arg, so no need to actually define it above)
    return setmetatable({ firstName = fName, lastName = lName}, meta )
end
edgy nymph
#

anybody know when i host a server it says missing file

gritty edge
#

are you using all mods the server is using?

edgy nymph
#

but it just says missing file as soon as i load in my character

#

anybody know how to fix missing night watch in media file

tulip valve
#

@cold burrow Arsenal26GunFighter mod removes vanilla weapons and items with lua code in /server/items/ you can check that

cold burrow
craggy furnace
#

@pearl prism having a lot of fun adding my stuff to this

noble marlin
#

I want to ask

#

So i just recently play this game

#

I download a lot mod which is up to date to the version

#

I didn't touch the mod load order

#

Every mods were turn green which is working

#

But when i play solo session

#

Sometimes in the right bottom corner

#

It's show error 79 sometimes error 40+

#

How do i check error logs?

dark solar
#

for console.txt

noble marlin
#

Ah i see thanks

opal wind
dark solar
#

already answered πŸ˜„

shadow dust
#

How do I replace a tile with another tile in lua?

#

like lets say I want the code to pick a random asphalt tile and replace it with a grass tile

opal wind
viscid elbow
#

Found a pretty reliable way to make your OnGameBoot Event fire last xD
Events.OnGameBoot.Add(function() Events.OnGameBoot.Add(MyFunction) end)

merry turret
#

Is it easy to swap the "shout" mechanic text bubble for an actual sound?

viscid elbow
odd notch
#

is there a helper for if a survivor gets near something?

#

or a lua event?

odd notch
#
__classmetatables[IsoPlayer.class]["__index"]["Callout"] = function(self, doEmote)
    local range = 30
    local shoutPath = "New"
    if getCore():getGameMode() == "Tutorial" then
        shoutPath = "Tutorial"
    elseif self:isSneaking() then
        range = 10
        shoutPath = "Sneak"
        processSayMessage(string.format('*156,108,108*' .. "%s" .. getText("UI_verb_whispershouts_roleplaychat") .. '"%s"', ISChat.instance.rpName, getText("IGUI_PlayerText_Callout"..ZombRand(1,4)..shoutPath)));
        addSound(self, self:getX(), self:getY(), self:getZ(), range, range);
    else
        processShoutMessage(string.format('%s' .. getText("UI_callout_shouts_roleplaychat") .. '"%s"', ISChat.instance.rpName, getText("IGUI_PlayerText_Callout"..ZombRand(1,4)..shoutPath)));
        addSound(self, self:getX(), self:getY(), self:getZ(), range, range);
    end
    if doEmote then
        self:playEmote("shout");
    end
end

Here's how jade did it in our roleplay chat mod

#

you'll ignore the processshoutmessage stuff lol

#

if you just want it to play a sound, you can literally just remove everything except addSound and the range variable, and just getPlayer():getSquare():playSound("yoursoundgoeshere") underneath it or something lol

merry turret
drifting ore
#

hey, any guide on how to add custom sounds to my gun?

viscid elbow
opal wind
#

hey guys im doing this futurisitic visor that works like a digital watch, i manage to make it work doing 2 itens (same as watch;right/left), but since my item is just 1 location i was trying to make it as 1 item only, but settting like this dont allow me to equip the item;

#

item Wiz_DBScouter
{
DisplayCategory = Accessory,
Type = AlarmClockClothing,
DisplayName = Sayan Scouter (Green),
ClothingItem = Wiz_DBScouter,
CanBeEquipped = MaskEyes, <--- i try to set this but still wont equip
BodyLocation = MaskEyes,
CanHaveHoles = false,
Icon = Wiz_DBScouter,
Weight = 0.1,
ChanceToFall = 10,
WorldStaticModel = Wiz_DBScouter_ground_green,
Cosmetic = TRUE,
SoundRadius = 7,
AlarmSound = WatchAlarmLoop,
Tags = Digital,
clothingExtraSubmenu = Wiz_DBScouter_blue,
}

#

is there a way to make it equip without creating a second item?

opal wind
#

i think i made it work now, i removed the line i pointed there and add this

#

ClothingItemExtraOption = Wiz_DBScouter_equip,

#

but now it give me errors

#

function: doClothingItemExtraMenu -- file: ISInventoryPaneContextMenu.lua line # 3496
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 726
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1426

ERROR: General , 1643272251170> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: get of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1643272251170> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: get of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onRightMouseUp(UIElement.java:1458)
at zombie.ui.UIElement.onRightMouseUp(UIElement.java:1416)
at zombie.ui.UIManager.update(UIManager.java:902)
at zombie.GameWindow.logic(GameWindow.java:253)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:745)
at zombie.GameWindow.run_ez(GameWindow.java:661)
at zombie.GameWindow.mainThread(GameWindow.java:475)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1643272251172> -----------------------------------------
STACK TRACE

viscid elbow
high condor
drifting ore
drifting ore
primal knot
#

How can I get the Base ID of an Item with Lua? For example the Base.Schoolbag string

mint sphinx
odd notch
#

best i can think of is like,,, an ugly math checker that checks adjacent tiles on a tick

#

but,.,. how would i check if a player is in a square?

#

i know i can find objects by like,, for _,obj in ipairs(worldobjects)

drifting ore
#

I don't think it exists. But yes I think the best is to check the tile of the player and the one around. What are you looking to detect exactly ? An 3d item add to the world or a movable object like a oven ?

drifting ore
#

But you just gonna get schoolbag, not base.schoolbag

odd notch
odd notch
#

there’s an option in the f11 menu to show detailed tooltips that include the full item type

drifting ore
#

Like an alarm or a mine? No idea I admit, except to detect the surrounding tiles

odd notch
#

i’ll figure it out and post about it here i’m sure trippin

drifting ore
#

There is a getNearItem for recipe, you can maybe check that

#

But it's from the player

#

Otherwise I have a piece of code in my mod that outputs all the items at hand. You could use and check if the item is in

weary matrix
#

@odd notch is it for a single object?

odd notch
weary matrix
odd notch
#

how often does onplayerupdate run?

weary matrix
odd notch
#

i like to use everytenminutes uwu

#

it’s odd nobody has made like an addtimer helper yet

#

speaking of ticks

#

i would love one

weary matrix
uncut jasper
#

Hi, its possible for modify a square inside To square outside? I like this "player:setcurrentSquare(isoflag:exterieur)" For all player get this square .
I search script.

pearl prism
craggy furnace
drifting ore
#

Can I have items that are in bags that the players are carrying?

craggy furnace
#

waiting for the next update

drifting ore
# drifting ore Can I have items that are in bags that the players are carrying?

Found how to get backpack :

local it = player:getInventory():getItems()
local playerBags = {}

-- found a container (Backpacks and other)
for i = 0, it:size()-1 do
    local item = it:get(i)
    if item:getCategory() == "Container" and player:isEquipped(item) or item:getType() == "KeyRing" then
        table.insert(playerBags, item:getInventory())
    end
high condor
#

How do i check if lua script got loaded?

crisp fable
#

in debug mode, press f11 and then you can search the scripts in the bottom right panel

high condor
#

Ok thanks

#

Also is there way to reload the scripts in menu?

crisp fable
#

yep, once you open it there (double click it), there's a reload button at the bottom of the code. it doesn't always work 100% tho, you'll have to restart sometimes if you see its bugged or you made big changes

high condor
#

Alright thanks

uncut jasper
#

"Setsquare" existing please ?

#

Ty for debug tips, i reload game for testing script, but i Will testing reload ingame directly....^^

high condor
#

Another question, where do i exactly put the mods? In the mod menu it says <user>/Zomboid/mods but when i've put mods there, they dont appear in the mod menu

crisp fable
#

should be the Zomboid/Workshop folder, not mods

high condor
#

It says this path, either way in neither of those locations it's showing up

crisp fable
#

not sure how i arrived to the workshop folder but it works for me, there's a blank template to copy as well

high condor
#

it worked with enabled steam tho

crisp fable
tropic olive
#

Can anyone tell me how i need to set drop chance values to prevent items from keep dropping? I want them very rare, but i played with the values, looks like whatever low number i put on the end of the lines like "0.00001", they just keep dropping :\

mint sphinx
#

anyone here have used the parseScrip for like a new item ?

pine fiber
#

If I delete the "recorded_media.bin" file in the existing save, will this reset the tapes seen by the players or il will just break the save? (i'm trying to reset recorded media of each players on the server) thank you

mint sphinx
#

if i make an item an get it into getscriptmanagement():parsescript() how do i persist the item to the save file so i dont loose it when i save world and rejoin ?

mint sphinx
#

guess no one knows atm ^^

sinful beacon
#

is there any good twitch extensions for zomboid yet?

#

like a kill counter?

pulsar saddle
#

can i (and if so how) set up so that custom items only spawn in specific places, like louisville university and the west military base?

quartz badge
#

how would you go about adding more zombie variants

#

with vanilla clothing

drifting ore
#

Any mod to spawn furniture?

#

Like large metal shelves or anything

golden atlas
#

are there mods for electricity like windmills ?

mint sphinx
cold burrow
golden atlas
drifting ore
mint sphinx
mint sphinx
mint sphinx
#

@drifting ore i wouldnt say yes or no because i wouldnt use that mod my self for the reason it not working on mp maybe the reason i didnt knew about it ^^

viscid elbow
crisp fable
#

Here's a small showcase of a mod i'm working on - a radio manager that lets you easily transfer channels between different radios. started out as a simple notebook and I ended up adding automatic tune-in and preset generation πŸ˜„
https://www.youtube.com/watch?v=IbVSRtpA0F8
Thanks @drifting ore for the UI guide that got me started with it

Small project zomboid mod showcase. The radio manager enables easy copying of channels between different devices.

β–Ά Play video
hollow dew
#

hi, is there a way to access java fields from lua?
want the values strength, speed ... stored in the IsoZombie class
saw an example to __classmetatables a few messages above and now i am curious if this is possible

crisp fable
#

yes, you just need to do it through the getters, so instead of p.name you say p:getName()

drifting ore
#

Good job !

crisp fable
#

thanks πŸ˜„ its been fun, theres still so much more to do though

#

also, if any of you have a guide on local storage and how to persist stuff, that'd be great as well πŸ˜›

hollow dew
crisp fable
#

probably depends on the java class in question, i saw the getters for my object in the debugger. sry can't help more

hollow dew
#

no problem, maybe another one knows a way

pure ermine
#

anybody know why the issue happnes with britas weapons where none of the guns spawn?

drifting ore
#

Just use player:transmitModData() to save the list

#

otherwise it's not save between reload

crisp fable
#

nice, thanks. do i just save tables directly or should i convert to json or sth like that?

drifting ore
#

just table is ok

opal wind
#

and how do you say when people help you? 'thank you' ? πŸ™‚

hidden estuary
#

anyone knows what are the jumpscare sounds called in the files?

opal wind
#

the ones that almost give me heart attacks? πŸ˜„

hidden estuary
#

yes!

opal wind
#

they are not on the sound folder?

hidden estuary
#

I'm looking for the originals

#

but they're not named jumpscares or scares

opal wind
#

hum maybe they are compiled in the code? like the tiles and lots of textures are? if its the case i think u prb can extract them just like people do with the textures

viscid elbow
opal wind
#

πŸ™‚ hehe

#

GL with it andros!

opal wind
#

you can DM me anytime if you need some pointers, i just started on PZ about 2-3 months ago but i will help if i can

#

you are trying to make a new fuel source?

#

would be cool to have Ethanol, lots of cars are moved by ethanol here on brazil, its does not burn as good as gasoline buts its a renewable source of energy; you can plant sugarcane and make ethanol with it; that can be a cool mod idea

#

sorry my english

kind surge
hollow dew
drifting ore
errant meteor
drifting ore
crisp fable
drifting ore
crisp fable
#

unfortunately not, i looked for it too but no luck

hollow dew
kind surge
viscid elbow
quasi geode
kind surge
prisma marsh
#

hi guys, do anyone knows how to enable debug mode on a linux server?

quasi geode
#
      @LuaMethod(
         name = "getNumClassFields",
         global = true
      )
      public static int getNumClassFields(Object var0) {
         return var0.getClass().getDeclaredFields().length;
      }

      @LuaMethod(
         name = "getClassField",
         global = true
      )
      public static Field getClassField(Object var0, int var1) {
         Field var2 = var0.getClass().getDeclaredFields()[var1];
         var2.setAccessible(true);
         return var2;
      }

the exposed global functions lua uses to get the fields that way

prisma marsh
#

i'm trying to check if extended heli works

#

but can''t spawn one

quasi geode
#
         if (Core.bDebug) {
            this.setExposed(Field.class);
            this.setExposed(Method.class);
            this.setExposed(Coroutine.class);
         }

Field.class isnt normally exposed unless debug is enabled

willow estuary
mint sphinx
#

@quasi geode is there an easy why to look up where an item comes from . like in which module its origin is?

willow estuary
quasi geode
#

^^^ this. the second version is for script items, first for inventory items

mint sphinx
#

thx guys ^^ so i gess item:getName() will give me the items name πŸ˜›

quasi geode
#

probably not what you'd expect...its more similar to display name (prefixed with 'broken' or 'tainted' etc)

#

least for inventory items

mint sphinx
#

no no i would need the realy name of the item not the translated name of the item ^^

#

displayname is the translated one right ?

quasi geode
#

:getType()

#

ya

#

though it maybe getName for script items just not inventory items

#

not sure on that one tbh

mint sphinx
#

just to be sure

item foobar                       <- item:getType()   retunr "foobar"
    {
       DisplayName = "foo"        <- item:getDisplayname() returns "foo"
        }

?

quasi geode
#

yes but again, theres a difference between a script item (unspawned template) and a inventory item (specific spawned instance of a item). they use different methods
for script items it might be getName i'm unsure and not digging through the files atm. for inventory items getType returns the string you pointed at in your example

#

also the displayname wont likely be "foo", it will be whatever is in the translation files for "foo" and will return the translated version

mint sphinx
#

also all the items is able to be in inventory and not isoitem so fa r

#

also i would never use the word foo normal in my code ^^ so i know that πŸ™‚ just tried to make a more abstract and generalized question

crisp fable
bleak grotto
#

Are the statistics of the players kept in the database?
For example, how many zombies did they kill?

karmic heath
#

Anyone has an idea of what could be the cause of the warning : Warning: Moveable not valid
It is displayed 5 times when crafting my custom moveable item.
The item is still successfully crafted, then i get the following error message when trying to place it: RecipeManager -> Cannot create recipe for this movable item: AnselmeFlags.TestFlag

fair frost
opal wind
#

yeah cool i guess i works, thanks!

#

i wonder if we really need this thou, because like that my inventory clothing now have 2 'equip' options lol

drifting ore
#

I got a weird bug. When I try to create a new UI. Same way as before that worked.
I get an error at the line o.x = math.max(0,math.min(x,maxX-width))
But x = 0, maxX = 1920 and width = 400 so that should work.
I rly lost on that one

#

The line is in ISUIElement so it's at the root of the creation of the UI

viscid elbow
#

if x = 0, then math.min(x, maxX-width) is just returning 0

drifting ore
viscid elbow
drifting ore
#

Ok that was something else but still, weird error

covert osprey
#

Hello friends, I'm trying to learn how to mod and want to try and work myself up to the point of writing some form of unit test to try out different evolved recipes (I want to get to the point of understanding evolved recipes enough to implement a way to jar/can prepared dishes) where would I look to see where PZ defines "evolvedrecipe"?

drifting ore
#

How do I know if an item is a melee weapon ?

#

I know that the item has a variable type that store "Weapon" but I can't get access

fair frost
quasi geode
drifting ore
viscid elbow
#

item:getType() == "Weapon" and item:isRanged() == false should work

quasi geode
#

getType will return the item name

#

item:getCategory() == "Weapon" and item:isRanged() == false will work as well

willow estuary
#

name, type, category, display category πŸ€ͺ

viscid elbow
willow estuary
#

Nah, Fenris is right, as always, getType() returns the item's "script name", ie if used on a schoolbag you get "Bag_Schoolbag" and not "Container"

drifting ore
willow estuary
#

It's confusing AF to be fair πŸ€ͺ

quasi geode
#

its a weird inconsistency

willow estuary
#

You just get used to it eventually? 🀷

viscid elbow
#

I see, getType isn't actually the Param Type

#

that's weird af

willow estuary
#

There's a lot of those in PZ πŸ€ͺ

quasi geode
#

lol ya XD

willow estuary
#

Think of it as a minigame to be defeated? πŸ€ͺ

quasi geode
#

i believe though if you call getType() on a script item though it gives you the type param

viscid elbow
#

If only there was a way to check if SubCategory == "Swinging" xD But of course there's no getter for that

willow estuary
#

Using notebook++ & searching the lua files in the PZ media directories is my go-to when I need to remember/figure out/outsmart some of these reverse-logic puzzle function names.

quasi geode
#

theres a item:getSubCategory()

viscid elbow
willow estuary
#

SubCategory = Swinging yeah, Fenris was on it.

quasi geode
#

ya i should clarify its for HandWeapons, not InventoryItems

willow estuary
#

local swing = item is a weapon and item's sub category is swinging to pseudocode it

shut valley
covert osprey
heady forum
#

Good day,
Does anyone know how to make an item, once placed, solid, so that characters cannot pass through, like a table? Is it a simple as defining it as furniture? Or?

sour island
#

I forget who, but there was investigation into globalmodData and whether or not it was server-side and shared/universal? what came of that?

bitter frigate
#

howdy everybody! i've been working on a pitch for a mod/suggestion for a while now, but it only just dawned on me to check with ya'll and see if it's even feasible. i want to play a type 1 diabetic. the principal mechanic behind that would be monitoring a new need/status called blood glucose. is it possible to create a new need/status? and if it is, can they be tied to a trait?

covert osprey
abstract raptor
#

Can anyone tell me how the snow is rendered? I was wondering if it'd be possible to recolor the snow accumulation on the ground

opal wind
#

easily? wow you are good man, i dont think this would be easy at all

drifting ore
#

I find that ok

#

After that if you want something nicer, you reduce the value of the sugar level with the difference in weight between 2 times, as it depends on the energy spent (running, walking, sport). And it's just ideas like that

opal wind
#

its not very easy to make new custom traits

#

not with new effects

drifting ore
#

I mean, it can be done. Some come and ask if we can redo the game

gritty canyon
#

Anyone know of any mods that could possibly interfere with large pre spawned fences? Found a wharehouse with large fences surrounding it but there are now gaps. Assuming a mod, but wasn't 100% sure.

willow estuary
opal wind
drifting ore
willow estuary
viscid elbow
#

Anyone have an idea of why the Louiseville gates have a sync issue most of the time?
Was thinking of patching it, but no idea what could be causing it honestly.

frank elbow
#

Is there any way to play a dynamically created sound? I see methods on classes like WaveData and AiffData for creating sounds from byte buffers, but I don't see anything similar on the SoundManager (or see how to use those to do that). Alternatively, is there a way to create temporary files? I feel like the latter is even less likely, but figured I'd ask just in case

frank helm
#

does the trash from trash and corpse mod from algol cost us performance ?

opal wind
calm shoal
#

Is there a mod that allows you to armor your car like mad vehicle

drifting ore
#

does anyone have

#

2482660773

#

it was a mod patch for brita's and SF's blacksmith for ammo compatibility

#

mod author removed it

#

@echo leaf what happened to your patch?

#

i wanted to ask before i attempt to make it again

cedar salmon
faint jewel
#

anyone have a basic mod that adds a single piece of moveable furniture?

opal wind
faint jewel
#

basically, a mod that just adds an end table (holds loot or not doesn't matter) and a 2 piece table. so i can learn how to implement my own.

lavish thunder
#

Is there an easy way to make moveable objects useable? As in right click to call a function or something?

#

After they've been placed I mean

opal wind
#

i end up making my world forniture as a 3D object for now

ashen star
#

what is the correct code to add a custom profession to the list of bonuses in the forage system? I tried
`require "Foraging/forageSystem";

forageSystem = forageSystem or {};

-- Same as park ranger bonuses
forageSystem.professionBonuses["CUSTOMNAME"] = 1;
forageSystem.weatherEffectModifiers["CUSTOMNAME"] = 33;
forageSystem.darknessEffectModifiers["CUSTOMNAME"] = 10;`

in a lua file in the same folder, but I think it didn't work out (I saw a mod using a similar code).

The vanilla file is in \media\lua\shared\Foraging\forageSystem.lua

stone rock
#

If the trunk capacity of a bag or vehicle is large, the letters overlap like that. Is there a way to move the location of the name text of the button or container to the left, such as 'acquire all, floor, trunk'?I saw the LUA file, but it was difficult for me to find out.😒

gray kelp
#

@fair frost

mint sphinx
faint jewel
#

i want to make NEW art... could you throw together a basic mod?

sharp wind
#

How do I create a mod pack

mint sphinx
sharp wind
#

is it simply dropping all the mods that I want in the pack under \Contents\mods ?

mint sphinx
#

wait is the mod pack like couples of mods or the texture.pack files?

mint sphinx
sharp wind
#

I opened the snakes mod pack, and it really is just that

mint sphinx
#

steam do have a create steam workshop collection which is the modpack you talking about right ?

sharp wind
#

a bunch of mods

sharp wind
#

When you download a modpack, it's just one steam workshop item

#

in it will be a bunch of folders

#

Take a look at 2719327441

#

or like this one

mint sphinx
sharp wind
#

I know about steam collection

#

the problem is once you have a lot of mods, the server description run out of character

#

and it will appear as version ??? and the mod list will disappear

#

the only way to fix that is to put things into a pack

mint sphinx
#

which in the worse case can be hit by an DMCA. if you don't get permission from the person who made the mod. atleast in barothrauma modders like to dmca people there do that what you talking about and i dont know how the zomboid modder communities are like ^^

sharp wind
#

doubtful, it's a private and only visible to certain people

faint jewel
#

HMMMMM

mint sphinx
# faint jewel HMMMMM

have the larges brain fart right cant think i did get enough sleep to night even failing to print out a list in debug mode xD

ashen star
#

is it possible to edit some proprieties of generators like effect radius and condition loss rate?

faint jewel
#

i'm working on making a base mod lol.

#

something for adding movables.

dry coral
#

where can i get player model rig to animate it

tulip valve
high condor
#

Anyone knows how to integrate zomboids javadoc into project? I've read through many threads, tried all that capsid/ZombieDoc and stuff but nothing seemed to work for me

faint jewel
#

can you make a craftable furniture item?

#

like you build it via the crafting menu, but place like furniture?

odd notch
#

can use the crafting menu to do just about anything

mint sphinx
faint jewel
#

hmmm where is "WorldObjectSprite=" set?

#
    item Mov_FoldingChair
    {
        DisplayCategory = Furniture,
        Type            = Moveable,
        Icon            = default,
        Weight              = 0.5,
        DisplayName        = Moveable,
        WorldObjectSprite    = furniture_seating_indoor_01_60,  <<<< - this part
    }
mint sphinx
#

world sprite like when you place it as a isoObject?

faint jewel
#

well that sets the moveable item for a folding chair.

#

i need to know where the world object sprite is set.

#

it only shows up in lotheaders and the place i posted.

drifting ore
#

Does getDisplayName() change with translation?

drifting ore
#

Fck

mint sphinx
#

do getType

drifting ore
#

yes but I want ammo

mint sphinx
#

the ammo have a name right ?

drifting ore
#

yes but it's if mod don't follow the same name shema

mint sphinx
#

ΓΈhm it kind of look like it does

#

only problem i have rigth now is how to go though my userData lol

drifting ore
#

So every ammo have a bullets in there name and box box ? But what if an other item have also box in the name

#

Can I get the displayName of the current language in english ?

fading citrus
#

where does the base game store trait scripts? specifically I'm looking for hemophobic to use as a base for a similar modded trait

drifting ore
#

Is it possible to get a list of all the getTypes of all items? Like a global functions

drifting ore
fading citrus
#

got it, thanks, figured it was scattershot looking at the directories directly

ashen star
mint sphinx
#

i think i have to iterate though the object i get back from getScriptManager():getAllItems() but some how i fail to do a
ipair or pair on the object i receive. so how would i be able to iterate though the object i get back ?

mint sphinx
ashen star
#

I understand that it is more complicated than I thought it would be, so thank you.

mint sphinx
#

i know if i do a lua print(type(obejct)) its a userdata object and i know when i just try to print(obejct) it look like a json object but from that i dont know how to convert it to somehting i can do an iterate over all the objects ^^

ashen star
mint sphinx
#

how you did it up the is how i would have done it as well

mint sphinx
drifting ore
calm depot
#

so, any of y'all into Java modding? I've been working on a thing in my spare time and it's (just barely) polished enough for me to release it

mint sphinx
drifting ore
#

I just try with a french version

mint sphinx
calm depot
#

yes, you can't just enable arbitrary code execution

#

although you could have answered that question for yourself if you'd read the page

#

unfortunately, that makes no sense

#

the JVM doesn't care what your code does

frank elbow
mint sphinx
#

but nice work. last time i did anyhting like that was in wurm unlimited.

calm depot
#

@frank elbow are you talking about in Lua or Java?

#

the game uses FMod so you might want to check their docs

frank elbow
#

Lua. I know I could do it via Java modding, but I'd rather not go that route

#

Is there direct access to fmod?

calm depot
#

sure, it can be useful to poke through the Java side to get a quick idea of what's exposed to Lua

#

I don't know offhand, but if I wanted to, I'd crack open IntelliJ and grep through it πŸ˜‰

frank elbow
#

Yeah, I've looked at the source code & the API docs

#

I still didn't find anything like what I described above; I'm asking if anyone knows of a way to do that because I couldn't find one after a while of searching

calm depot
#

well, looks like there's a playSound function on the character object

#

seems to take a string

frank elbow
#

That takes a filename yeah

calm depot
#

I'm not so sure it does

frank elbow
#

I want to either create a sound via a byte buffer, as in the sound "Data" classes (WaveData, AiffData, etc.), or create a temporary file which I can then use with playSound

calm depot
#

fmod has sound banks

#

and for example, I can't find BuildWoodenStructureLarge in the game folder, which makes me think it's in a sound bank instead

frank elbow
#

I believe it uses both sound banks and filenames

faint jewel
#

okay this is gonna make me mad. why is my recipe not working.

calm depot
#

alright, so have you tried dropping a sound file in with your mod and trying to play it?