#mod_development

1 messages ยท Page 179 of 1

tribal oasis
#

yo could someone help me figure out the last steps to making a map mod? I've been following a guide on youtube and have the basic test map made and setup- I just don't know how to export it over ๐Ÿ˜…

mellow frigate
#

Someone has already been able to modify a trait cost from sandbox options ? I'd prefer not to reimplement that if it is available. ๐Ÿ˜„ lazy dude

mellow frigate
#

you rock

#

you do elegantly some serious work with those metatable tricks.

dark wedge
#

I've added a bunch of "overlay" icons that can be set on an entry in the radial context menu. It's an easy way to add some context to an icon you're setting without having to actually add a bunch of icons yourself. This isn't all of them, but shows the gist/vibe of what I got. Player is for scale of the radial's size. Unfortunately the big issue with this mod is that entries from other mods won't have icons unless they use a vanilla string or function I catch, or set the iconTexture themselves. Hopefully these overlays help to encourage y'all to add support for this when adding context entries, and I tried to do this in a way that won't conflict with vanilla even with this mod disabled. I'll have documentation on all this on release though (which should be soonish).

mellow frigate
nimble yarrow
#

lol @ the endgame

lone nest
#

hello everyone, I like to introduce my new NPC framework mod for B41 (with the aim of replacing all Superb Survivors variants).

This is very much a work in progress, the NPCs are currently limited to hold position and follow at the moment for their basic orders.
https://steamcommunity.com/sharedfiles/filedetails/?id=3001908830

I have included 2 projects as a starter and examples for other modders to try their hand at creating their own NPCs.
Standalone, no group NPC: https://steamcommunity.com/sharedfiles/filedetails/?id=3001910188 (< 200 total lines of code)
Grouped NPCs: https://steamcommunity.com/sharedfiles/filedetails/?id=3001909546

Framework main github: https://github.com/shadowhunter100/PZNS
Example standalone NPC: https://github.com/shadowhunter100/PZNS_AgentWong
Example grouped NPCs: https://github.com/shadowhunter100/PZNS_RosewoodPolice

I am also looking for help to further develop the framework; as in it's current state, it is very barebones, but 100% stable in my own testing.

#

What it means to use the framework; a dependent mod can call the required framework and use all of the framework functions without needing to write additional data management functions.
https://imgur.com/a/OaaK2tG
NPCs in action example: https://youtu.be/F_AcFR68qs8

B41 - PZNS - (Project Zomboid NPC Spawner) Mod Framework preview

NPCs Invite to Group Test Demo.

The Police Group is actually a separate mod, this test demo shows the Framework mod can be extended/referenced by other mods.

https://imgur.com/a/OaaK2tG

Zombie population set at INSANE.
Using Bikini Tools, Professional Framework, and Insurgent P...

โ–ถ Play video
mellow frigate
lone nest
mellow frigate
#

This will allow you to avoid all the lua code questionning whether the framework is active or not

hollow current
#

Still looking for an answer about this

fast galleon
#

You mean loot?

hollow current
fast galleon
#

There are special distribution tables in Distributions.lua near the bottom.

#

Based on the event, a table is selected. Stash houses can use any table you set.

hollow current
#

I'll look into it, thanks!

tribal oasis
fast galleon
hollow current
# hollow current I'll look into it, thanks!

okay seems to be what I've been looking for but one more thing, anything specific for car wrecks/general car containers on the road that seem to be in a bad condition? (Want to handle spawns in cars but generally not have the item spawn in cars which look to have good condition)

bronze yoke
#

onfillcontainer check general condition of the parent vehicle

#

do wrecks even spawn items? if they do then you can check wreck too

hollow current
#

well obv not wrecks which contain cars at an unsuable condition those don't spawn loot afaik

#

so basically onfillcontainer, check if its a vehicle, check overall condition, and if condition is above threshold and item spawned in it, just delete the item

bronze yoke
#

yeah, something like that

hollow current
#

Thanks! :)

nimble yarrow
#

if I declare a local, can i get the length of it in lua?

local myListOfThings = {
  "thingA",
  "thingB",
  "thingC",
}

for i = 0, myListOfThings:size() - 1 do
for i = 0, myListOfThings.count - 1 do
for i = 0, myListOfThings(length) - 1 do
lone nest
#

iirc :size() is used if the list is from Java.

bronze yoke
#

it can only count array-like tables correctly

#

it just counts from 1 until it reaches nil

#

if you need the length of another style of table then i think you have to resort to```lua
local count = 0
for _, _ in pairs(myListOfThings) do
count = count + 1
end

lone nest
#

... come to think of it, doesn't lua list index start at 1?

nimble yarrow
#

so this is no good? refactoring my ProdecuralDistribution

for i = 1, #locationsCommon do
    addLoot(locationsCommon[i], itemToAddHere, 1.0 * rarityMultiplier)
end

or is it

local count = 0
for _, _ in pairs(locationsCommon) do
    addLoot(locationsCommon[count], itemToAddHere, 1.0 * rarityMultiplier)
    count = count + 1
end
lone nest
#

albion stated as such

#

your first for-loop should work from what I can eyeball at least.

bronze yoke
#

yeah that looks correct

#

well it depends on what addLoot expects, the syntax looks a bit odd around that

#

but the loop itself seems correct

nimble yarrow
#

Hmm, I didn't even get a print in my console. but maybe the function got called at a bad time.

local locationsSchool = {
  "SchoolLockers",
  "ClassroomShelves",
}

for i = 1, #locationsSchool do
  print("iteration " .. [i] .. ", about to add loot to " .. locationsSchool[i])
end
bronze yoke
#

that should be perfect

nimble yarrow
#

oh. my print caused a stack trace unexpected symbol near [.

bronze yoke
#

oh right

#

iteration " .. [i] .. ", should be iteration " .. i .. ",

#

square brackets are only used when you're trying to index something

nimble yarrow
#

should locationsSchool[i] be #locationsSchool[i] as well? or just the i is the problem

bronze yoke
#

just the i i think

nimble yarrow
#

cool

bronze yoke
#

if you did #locationsSchool[i] you would basically be trying to index a number, since # returns the length

autumn temple
#

So I have an item that acts just like eating something, I wanted to ask if there was a way to limit movement while the items are being consumed?

strong scaffold
#

do you guys know where to find the mod.txt file anywhere? it has the list of mod active on a server.

#

it could be called loaded.txt

nimble yarrow
#

your currently active mods C:\Users\user_name\Zomboid\mods\default.txt
a particular server's mods C:\Users\user_name\Zomboid\Saves\Multiplayer\ip_address_here\WorldDictionaryLog.lua

not exactly what you were looking for, but the mods are listed in that .lua, if you open it with notepad

#

@strong scaffold

cobalt fiber
#

Just a probably dumb Lua question: if I create a local table like "local myfunctions = {}", then do "function myfunctions.myFunction()", will that function be local without needing the local modifier?

bronze yoke
#

yeah

#

it doesn't exist outside of that table, so access modifiers don't really apply to it

hollow current
#

any idea what method to use to return overall condition of a vehicle?

strong scaffold
strong scaffold
#

i just want the exact same mods

nimble yarrow
#

thats more of a question for #mod_support channel,
but, your game should download all mods from a server, when you try to join. you don't need to do it manually.

nimble yarrow
#

anyone see the problem here?
my code isn't 'closing' correctly?
lua would probably be easier to use, learn & understand with accurate spacing, intellisense and visual studio, umbrella, zomboid studio, whatever. but for right now im just in Notepad++, and i feel like this should 'close'?

I normally write C#, but according to my google searches, this should be good to go, in lua

#

cringe

#

thanks

lone nest
#

and PZ has its own flavor in kahlua

slender oar
#

Let's request they change it to tcl

fickle relic
#

Fun progress ๐Ÿ˜Š panels instantiated when hovering over containers

#

OOP is hard in Lua cold

nimble yarrow
#

Here's my procedural distribution lua script.

local function addLoot(proc_name, itemToAdd, chance)
  local data = ProceduralDistributions.list
  local c = data[proc_name];

  table.insert(c.items, itemToAdd);
  table.insert(c.items, chance);
end

this works:

addLoot("SchoolLockers", myItem, 6.0)
addLoot("ClassroomShelves", myItem, 6.0)

I would like to refactor it, to work like this. But 8 hours in, it just won't work.

local locationsSchool = {
"SchoolLockers",
"ClassroomShelves",
}

for i = 1, #locationsSchool do
  addLoot(locationsSchool[i], myItem, 6.0)
end

Does anything jump out as wrong with this?

note; THIS debugs fine! it looks great! they are both added nicely
print("iteration " .. i .. ", adding myItem to " .. locationsSchool[i] .. "with rarity = " .. 6.0)

the error I've been getting all day reads:
Callframe at: getLootModifier
function: doRollItem_CalcChances -- file: SpawnRateChecker.lua line # 158 | Vanilla

not much comes up on google for those errors

lone nest
#

i also wouldn't rely too much on chat gpt and google for kahlua/lua

#

because lua has far fewer projects those AI/LLMs have trained on

#

they can create basic examples and explain some of the workings, but don't expect 100% accurate and working code from your first query.

lilac flower
#

I am trying to align attachments to the player and I have been quitting out of the game, updating the .txt document which contains the attachment point and starting up the game to check my updates.

Is there a better way of doing it?

fickle relic
#

Two questions ๐Ÿ™

  1. How can I get the nice display name of a container? (container:getSprite():getName() is pretty ugly)
  2. How can I get some unique way to identify a container or a container's IsoObject (to differentiate them from each other) ?
sour island
#

Anyone know of a way to send a message into chat for only a player to see? like a system message?

tranquil kindle
lilac flower
#

that is super useful, thanks!

tranquil kindle
#

Until i had it figured out i usually had to put muzzleflash where stock is , and scope/reddots were usually upside down in here

sour island
#

Had it on the shelf for a bit, decided it was not doing anything there. ๐Ÿ˜…

hollow current
ivory gyro
#

For everyone have troller in your server !

sour island
ivory gyro
sour island
#

๐Ÿ‘

ivory gyro
#

Working on a new mod.

ivory gyro
cold monolith
#

you guys think it would be possible to have a robot race where they need to learn mechanics and stuff to repair themselves like a car and they need coolant and batterys to live?
the lore could be
Escaped darpa lab robot heads out to find signs of life and adventure
or a tesla robot type thing

#

instead of bites taking you out maybe you loose wires controlling your left of right arm or something

#

and other weird debuffs like not being able to use guns and youre noisy when walking

#

or extra noisey when running

tawdry solar
#

could i create an item that when interacted does a teleport event?

sour island
sour island
tawdry solar
#

im actually doing this for a commission

sour island
#

๐Ÿ˜…

#

Fortunate timing then

tawdry solar
#

yeah

gilded hawk
#

Is there a mod a way to have combobox/multiselect as a sandbox option?
At the moment I only see these options:

boolean
double
enum
integer
string
text
bronze yoke
#

enum?

gilded hawk
#

Isn't enum a single options?

tawdry solar
#

what enum

bronze yoke
#

enum is drop-down list

tawdry solar
#

ah

gilded hawk
bronze yoke
#

then use booleans?

gilded hawk
#

I can't because I need to generate the list at run time ๐Ÿ˜…

#

Unless, there is a way to dynamicaly add sandbox settings ๐Ÿค”

#

Example of what I would like to have

mellow frigate
#

multiple enums ๐Ÿ˜ฆ

gilded hawk
#

Manually added multiple enums? ๐Ÿ˜ฆ

mellow frigate
#

yes shame

gilded hawk
#

Maybe I can do something to make this work ๐Ÿค”

#

If I can hijack the ISTextEntryBox for setting.type == "text" when it's loaded inside SandboxOptions.lua I could use a format like this [Value1,Value2,Value2] as serialized array ๐Ÿค”

worthy sparrow
#

Third time since middle school I used trigonometry for something

gilded hawk
#

๐Ÿ˜ฎ

#

Is this in-game?

worthy sparrow
#

no no its a website im working on ๐Ÿ˜…

versed bear
#

i was thinking... is there any way to configure a mod of npcs in pz with artificial intelligence? i've seen it done in several games, like skyrim and matrix, for example

spice saddle
#

is it pz related? what does it do?

#

@worthy sparrow ^

worthy sparrow
# spice saddle is it pz related? what does it do?

For now its going to be a crafting tree with everything, I plan to implement custom items and to visualize how things are crafted, whats in them (eg. Bread = Flour, Yeast, Water, Salt ...) if someone wants to make a mod with lots of new items or just something complicated it would help to visualize stuff.

jaunty marten
worthy sparrow
#

And looking back into one of thursdoids I saw an image with super huge crafting tree and wondered how would that look detailed and interactable, like you press an item and it highlights all the steps and stuff required to make that item, like a cake recipie lol

worthy sparrow
worthy sparrow
#

Still a WIP

#

ouch the colours broke

lofty mantle
#

hello guys i want to start moding this game but i dont know where is the docs etc. also i think its java code is it correct?

lofty mantle
#

yeah but i do want to do car mod and i wanna do like animated doors etc.

#

where can i access the library?

worthy sparrow
lofty mantle
#

so java knowledge enough for modding?

bronze yoke
lofty mantle
bronze yoke
#

most mods are just lua scripts, java mods are possible but not commonly made and not many people will install them

spice saddle
lofty mantle
#

it will be a basic car mod rx7

bronze yoke
spice saddle
#

lua should be enough to make car mods

lofty mantle
#

thing is i dont know lua

#

and know java instead

spice saddle
#

if you know java, you can pick up lua

lofty mantle
#

yes but i dont want to learn whole new language for just a game

bronze yoke
#

java mods require manual installation and you won't really find any support in the community for making them

lofty mantle
#

ahh i seee

#

than how do i write with lua? which program should i use? and how i will access with lua?

worthy sparrow
#

lua syntax is easy, however it is limited and its best to get to know it first, codecademy has a free course about lua

bronze yoke
#

i like using intellij with the emmylua plugin, vscode is popular too

worthy sparrow
#

I recommend VS Code and extensions

lofty mantle
#

i love intelliji and jetbrains program

#

so ill never using vs code

bronze yoke
#

emmylua is kind of crappy tbh and vscode has much better support for lua, but i take that sacrifice to use jetbrains

spice saddle
# worthy sparrow

tool looks cool.. but can you tell me more about the zomboid automated test framework??

lofty mantle
lofty mantle
worthy sparrow
lofty mantle
worthy sparrow
# spice saddle tool looks cool.. but can you tell me more about the zomboid automated test fram...

https://github.com/Notloc/zomboid-automated-test-framework I just added bunch of usefull links there, all of them are from here

GitHub

A simple framework for writing unit tests for your Project Zomboid mods. - GitHub - Notloc/zomboid-automated-test-framework: A simple framework for writing unit tests for your Project Zomboid mods.

tawdry solar
#

dawg

worthy sparrow
spice saddle
#

woah nice

#

srsly pz modding community is a beast

worthy sparrow
#

and like there arent any ; and {}

lofty mantle
worthy sparrow
#

but I think you can use them anyway

lofty mantle
#

i saw a gtr mod and it was wroten with java i guess

#

and you really wasnt able to manual install it

worthy sparrow
#

for loop becomes

for i=1,50 do
  (...)
end
lofty mantle
bronze yoke
#

you can use ;s but not {}s

novel barn
#

Not to distract from the current conversation but we were talking about StackExchange a few days ago and how awful it is. After spending all day stuck on some selenium stuff I finally found my answer on SE and wanted to thumb it up as a thanks. I created an account and everything, only to find out I don't have enough reputation to thumb it up...

worthy sparrow
#

I'm scared of posting any questions there, people are so toxic if you do one mistake in your question

spice saddle
#

i'm forever thankful for those poor souls who ran into issues that i had but were brave enough to post there so that i may get help lol

novel barn
#

I think Albion is right on the money with this one "i just google, and if google doesn't have the answer it's impossible" #mod_development message

worthy sparrow
#

Theres ChatGPT to the rescue!

#

or to make the question even more impossible to answer

lofty mantle
#

its basicly using templates

mellow frigate
#

Hum, I added new sandbox options values (with default values set) to a mod and someone seems to have the new lua code without the sandbox options. how is it possible ? I thought the default values were used when loading in a preexisting game save.

abstract raptor
#

@mellow frigate Hiiii love your mods

mellow frigate
abstract raptor
#

I have an idea for this animals that move with you thing I was wondering if you might be interested in collabin' to make it more awesome

#

Like maybe they have health or can attack zombies if there's a zombie on the square they move to

worthy sparrow
#

Getting there

mellow frigate
abstract raptor
#

eh I iwll figure it out, just gotta loop over the square when the animal spawns in it's spot and if there's a zombie object we deal damage to it and play a sound effect

nimble yarrow
#

if player can be made to face a direction, can you face the dogs and alligator
player:faceLocation(isoObjectHere:getX(), isoObjectHere:getY())

jaunty marten
abstract raptor
#

Eh itll Bridge things

#

Also the animals are items so we have to use SetWorldZRotation

#

I had it working in an earlier version where I calculated the charachters rotation value and then assigned the correct z rotation but I lost the code snippet of it working.

nimble yarrow
#

"right before" b42 lol

jaunty marten
abstract raptor
#

Honestly I've heard its months out still and its more of a novelty mod anyway.

#

Tryna think of other uses for the system of an item that follows you.

#

Can probably do interesting things with like models that affect the appearance of the ground.

nimble yarrow
#

new idea:
since this is working,

addLoot("ClassroomShelves", myItem, 6.0)

but this is not

local locationsSchool = {
  "SchoolLockers",
}

addLoot(locationsSchool[1], myItem, 6.0)

maybe I need to cast it to a string? (if lua can)
locationsSchool[1].tostring()
string(locationsSchool[1])

unlikely, as they both return strings, when i print them to console, but maybe?

bronze yoke
#

in lua it's tostring(var), but yeah doesn't seem like it should help

jaunty marten
bronze yoke
#

well it doesn't work

#

the second one throws errors and we don't know why

jaunty marten
#

what's the error?

bronze yoke
nimble yarrow
#

a vanilla script media\lua\client\isui\adminpanel\lootzed\spawnratechecker.lua

#

so, i only get a stack trace when i check the container. with lootzed

#

otherwise, checking school lockers, they do not have my new item(s)

nimble yarrow
#

the problem appears to be line 158 local lootModifier = ItemPickerJava.getLootModifier(itemName)
but i'm not the greatest at understanding the PZ debug error window, or the stack trace info in console.txt

sour island
jaunty marten
#

anyway it can't not work, it's absolutely same cos u push same string there and strings can't be referenced thing to smth else

#

can u give me ur test code fully?

nimble yarrow
#

ye

sour island
nimble yarrow
#

i have it. any way tp clear the list, aside from closing PZ?

#

quitting to main menu, and starting a new game, my errormagnifier ends up having 20 things in it. i guess the one at the top is newest?

gilded hawk
#

But it lacks UI, which is what I'm trying to achieve, thank you, this will be such a good base for my work!

worthy sparrow
#

How Time is defined in the game? Like disassembling furniture is eg. Time=500, Hows thats calculated to ms/s? And game speed is basically 1x,2x,3x?

gilded hawk
worthy sparrow
worthy sparrow
#

from getting the raw materials to finished item

gilded hawk
#

Cool, good luck man! You might want to use some of my code as a base for your mod

It intercepts every single timed action

local ActionBlacklist = {
  ISWalkToTimedAction = true,       -- Always ignore
  ISPathFindAction = true,          -- Always ignore
  -- ISEquipWeaponAction = true,    -- Can be skill depended but enabled because makes the game snappier
  ISReloadWeaponAction = true,      -- Skill depended
  ISReadABook = true,               -- Affected by FastReader and SlowReader
  ISGrabItemAction = true,          -- Affected by Dextrous  and AllThumbs
  ISInventoryTransferAction = true, -- Affected by Dextrous  and AllThumbs
}


local old_ISTimedActionQueue_addToQueue = ISTimedActionQueue.addToQueue
function ISTimedActionQueue:addToQueue(action)
  local actionType = getmetatable(action).Type

  CasualoidPrint("FasterActions: actionType: " .. actionType)
  if not ActionBlacklist[actionType] and action.maxTime > 0 then
    local modifier = SandboxVars.Casualoid.FasterActionsModifier
    CasualoidPrint("FasterActions: old maxTime: " .. action.maxTime)
    action.maxTime = math.max(action.maxTime * (1 - (modifier * 0.01)), 0)
    CasualoidPrint("FasterActions: new maxTime: " .. action.maxTime)
  end

  return old_ISTimedActionQueue_addToQueue(self, action)
end

worthy sparrow
#

Another weird question, is there a way to iterate over all items using lua?

rustic elm
#

looking for somone help me finish fairly simple mod just need lil help with traits and random things character will say

#

if you can help

#

please dm me

#

il credit you in description

bronze yoke
gilded hawk
#

๐Ÿ˜„

gilded hawk
# worthy sparrow Another weird question, is there a way to iterate over all items using lua?

Yes

local allItems = getScriptManager():getAllItems()
    for i=1,allItems:size() do
        local item = allItems:get(i-1)
        if item:getType() == Type.Literature then
            if SkillBook[item:getSkillTrained()] then
                table.insert(skillBooks, item)
            elseif item:getTeachedRecipes() ~= nil then
                table.insert(other, item)
            end
        end
        local mediaCategory = item:getRecordedMediaCat()
        if mediaCategory then
            media[mediaCategory] = media[mediaCategory] or {}
            table.insert(media[mediaCategory], item)
        end
    end
nimble yarrow
#

odang, a random varaible, which was supposed to be camelCase, was UpperCamelCase. im so used to visual studio and my C# compiler, not letting me use bad variables. but notepad++ don't care. well, my problems fixed now

bronze yoke
#

one of many reasons not to use notepad++ ded

#

using 'bad variables' isn't wrong in lua but most ides will at least help you identify that

drifting ore
sour island
#

Uh it's using the internal error list ๐Ÿ˜…

#

So technically no, but I can try to just manually track after the fact and "hide" them

#

Oh wth discord took its time to update/send messages

#

@nimble yarrow

sour island
#

And yeah, I have a string manipulation fetish ๐Ÿ˜‰

nimble yarrow
#

@sour island error is gone, i had a typo somewhere

sour island
#

๐Ÿ‘

nimble yarrow
#

this is a snippet from vanilla proceduraldistributions

GigamartHouseElectronics = {
rolls = 4,
items = {
  "Battery", 20,
  "Battery", 10,
  "Radio.CDplayer", 20,
  "Radio.CDplayer", 10,
  "CordlessPhone", 20,
  "CordlessPhone", 10,
  "VideoGame", 20,
  "VideoGame", 10,
},

If i wanted to remove cordlessPhones, would i need to remove it twice, from the table?
edit: i guess it shouldnt be too hard to test, with lootzed
update: just tested it, you must remove it twice.

gilded hawk
#

Did it ever happened to anyone that a function that in the debugger is clearly returning something, on the file it has been called, it returns nil?

#
function CasualoidStringToTable(_string)
  local values = {}
  local map = {}
  for text in string.gmatch(_string, "([^;]+)") do
    values[#values + 1] = text
    map[text] = true
  end

  return values, map
end

For some reason it keeps returning nil when called

local _, map = CasualoidStringToTable(self.selectedValuesString)
bronze yoke
#

the debugger needs some debugging

#

it doesn't understand multiple assignments like this

gilded hawk
#

Ah, no?

bronze yoke
#

if it's the debugger telling you it's nil i wouldn't trust it basically

gilded hawk
#

wtfff it still returns nil

#

I changed it to this: local res = CasualoidStringToTable(self.selectedValuesString)
and this

function CasualoidStringToTable(_string)
  local res = {
    values = {},
    map = {}
  }
  for text in string.gmatch(_string, "([^;]+)") do
    res.values[#res.values + 1] = text
    res.map[text] = true
  end

  return res
end
#

And it stil says nil when it's not nil!

#

I think pz studio shat itself and was not updating my code ๐Ÿ˜ nope pzstudio is fine

bronze yoke
#

๐Ÿ˜

gilded hawk
#

Look

#

This is stupid, why is this not working

jaunty marten
gilded hawk
#

wtf is happening, why is the table not inside the res var O.o?

gilded hawk
jaunty marten
#

any actual error there?

gilded hawk
#

Nope, no error, the function just returns nil

jaunty marten
#

did u tried to exactly print it instead checking in debug menu?

cobalt fiber
#

Sorry to interrupt you guys, but is there any event that is triggered when the user clicks on "Accept" in the Game Options screen?

#

I can't seem to find anything related to that

abstract raptor
#

man I can't for the life of me seem to be able to set the WorldZRotation of this item I'm placing down and it's driving me nuts

#

bout ready to give up on it

nimble yarrow
#

wow, I removed the vanilla item "Video Game" from 10 vanilla procedural distributions lists. went to a school locker, bam - a vanilla VideoGame. it doesn't appear in LootZed. hmmmmmmm, i didn't know things could spawn in containers, if they were not in lootzed.

if an item spawns, but is NOT in the ProceduralDistribution, it must be in SuburbsDistributions, or some other list, right?

#

you said you had it working, but 'lost' the code snippet. where was the last place you saw it? ๐Ÿ™‚

bronze yoke
#

when did you remove it?

#

at script load or on an event/during gameplay?

nimble yarrow
#

events.OnGameStart. should i move this to OnInitGlobalModData ? ๐Ÿ˜ฎ

bronze yoke
#

the loot tables don't get read directly from lua, the java copies them in at a specific point and if you change them after that lootzed is wrong

#

it's actually even before OnInitGlobalModData

#

you can call a method to make java parse them again

fickle relic
#

Does anyone know any mods that use a tickbox ? Having trouble rendering one

jaunty marten
bronze yoke
#

yeah, you only need to reparse it if you want sandbox options or something

#

the requires aren't necessary though

jaunty marten
jaunty marten
bronze yoke
#

well, it's a style choice, some people like it for organisation

#

but i like to make sure people know that it doesn't change anything about the execution of the code

jaunty marten
#

I hate those who choose require "abc.lua" instead of require("abc.lua") rage

bronze yoke
#

one time i included require "abc.lua".func() in a mod just to annoy anyone who read it

jaunty marten
nimble yarrow
#
<!-- comment in xml -->
-- comment in lua
--[[ long comment in lua --]]

how to comment in txt? will --this still work?

bronze yoke
#

java comments

#

/* hello world! :D */

nimble yarrow
#

ok cool

bronze yoke
#

they were asking about txt

#

oh sorry

#

i didn't look ๐Ÿ˜…

jaunty marten
bronze yoke
#

๐Ÿ˜‹

carmine herald
#

Im having an issue with getting Perks

This Seems to work

player:getPerkLevel(PerkFactory.getPerkFromName("Lockpicking"))

But when trying to use it in AddXP it return an error

local player = self.character;
player:getXp():AddXP(PerkFactory.getPerkFromName("Lockpicking"), 2);

Attached is the error

fickle relic
#

Thank you @jaunty marten , that link worked like a charm !

jaunty marten
fickle relic
#

toot ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

bronze yoke
#

yeah i just had a look at the source, it seems to imply there's something wrong with the perk list

jaunty marten
#

not sure for 100% but player.getPerkLevel can accept any value and if it's invalid then it just retunrs 0

bronze yoke
#

or your perk isn't real yeah

carmine herald
#

Hmm well my perk is Init'ed in perks.txt

as

perk Lockpicking
{
    parent = Stealth,
    name = Lockpicking,
    translation = Lockpicking,
    passive = false,
    xp1 = 50,
    xp2 = 100,
    xp3 = 200,
    xp4 = 500,
    xp5 = 1000,
    xp6 = 2500,
    xp7 = 4000,
    xp8 = 5000,
    xp9 = 7000,
    xp10 = 9000,
}
#

but not showing any errors on boot

bronze yoke
#

why does AddXP check the entire perk list for the perk you already gave it?? seems very spaghetti

jaunty marten
#

just print it

bronze yoke
#

does your perks.txt open with the VERSION = 1, line?

carmine herald
#

yep

bronze yoke
#

getPerkFromName uses the translated name stressed

carmine herald
#

Printed results

bronze yoke
#

use Perks.Lockpicking instead of the method call, or your mod will break when played in different languages

carmine herald
#

Alright

#

In all parts?

bronze yoke
#

yeah, getPerkFromName uses the translated name (!?!?) so if it changes it won't find the perk

jaunty marten
carmine herald
#

Ahh ok, That make no sense but thanks for that

jaunty marten
#

nope, it make sense cos otherwise ur mod will errors for everyone but en lang players

#

instead PerkFactory.getPerkFromName("Lockpicking") use Perks.Lockpicking

carmine herald
#

Ok it works now, still a bit confused as to why it wasnt working earlier but it works

#

thanks you

bronze yoke
#

i'm not even sure why that fixed it, it should've still worked in english

carmine herald
#

I think the .txt was bugged

#

not sure tho

verbal yew
#

Gentlemen modmakers. I'm not sure how to ask this properly...

#

There are two situations:
One. ะกar, you are driving, the window is closed. Right mouse button doesn't work.
Second. Car, you are driving, window is open. The right mouse button is working - the camera is moving away in the direction.

Where do I dig this to make the second case work when the window is closed?

abstract raptor
#
                        local zombies = resultSquare:getMovingObjects()
                        for j = 0, zombies:size() - 1 do
                            local zombie = zombies:get(j)
                            if instanceof(zombie, "IsoZombie") then
                                -- Knock down the zombie
                                zombie:setKnockedDown(true)
                                
                                -- Play the sound "MetaDogBark"
                                resultSquare:playWorldSound("MetaDogBark", resultSquare, 0, 10, 1, true)
                            end
                        end```

![thonk](https://cdn.discordapp.com/emojis/747927771023540286.webp?size=128 "thonk")  How come this throws an error saying non table is null ![thonk](https://cdn.discordapp.com/emojis/747927771023540286.webp?size=128 "thonk")
bronze yoke
#

which line

abstract raptor
#

one sec lemme test one more time to see which line is highlighted

#

for j = 0, zombies:size() -1 do

#

more context if helpful

bronze yoke
#

isogridsquare has no method playWorldSound

abstract raptor
#

Oh thonk I thought it did,

#

looks like it's just play sound

#

derp

#

but that doesn't explain why its not knocking the zombies down

bronze yoke
#

is setKnockedDown sufficient to knock down a zombie?

abstract raptor
#

I guess maybe not thonk

#

Hmmmmmm

#

How ... do I do dis?

sour island
#

where b is fall on front

abstract raptor
#

lets see this in action then!

#

๐Ÿ˜„

#

Time to knock down a zed with a corgi

#

I was inspired by the dog training section of World War Z

nimble yarrow
#

did you figure out the lookDirection ๐Ÿ˜ฎ

abstract raptor
#

No not yet ๐Ÿ˜ฆ

sour island
#

look direction? Like how to turn the dog?

nimble yarrow
#

yeah, since its an item on the ground

sour island
#

You can get angle between two points

abstract raptor
sour island
#

nice

abstract raptor
#

yeah I've been trying to set the dog's rotation with setWorldZRotation but it hasn't been working

sour island
#

What is the math you're using?

#

Have you tried setting it's angle to the same angle as the player?

#

Bothers me the chop tree context menu doesn't check for items the same way that damage checks does

#

cleavers do 15 tree damage ๐Ÿค”

abstract raptor
#

No I just can't set the world z rotation of the world inventory object

#

it keeps saying it's nil every which way

sour island
#
local function predicateChopTree(item)
    return not item:isBroken() and item:hasTag("ChopTree")
end

pain, it's local

nimble yarrow
#

they also bust through garage doors effortlessly o.O

sour island
#

I think thumpable damage is calculated using treedamage

#

15 is pretty high for a cleaver

#

screwdriver is 1

#

๐Ÿ’€

#

fireaxe/pickaxe is 35, woodaxe is 55

#

But the context menu for chopping trees looks for the choptree tag

#

not if they have treedamage > 0

nimble yarrow
#

and comparing 2 integers has gotta be more performant than parsing a string

sour island
#

I think you could probably break something giving an item the choptree tag and 0 treedamage lol

#

the overhead would be parsing through the inventory - which it has to do anyway

#

if predicates could be a loadable module that would be great ๐Ÿ˜ฆ

#

The entire context menu is handled by a giant if tree - I guess I could slide in the context menu after the fact -- add one if chop tree isn't already there

abstract raptor
#

how do I do damage to a zombie with code?

nimble yarrow
#

zombie:setHealth ?

#

or perhaps Hit function is less buggy, as per this discord history

abstract raptor
#

hm, on second thought

#

Too OP

#

it's already too OP they trip everytime

#

then again you have to be real close for it to actually trip a zed

nimble yarrow
#

anyone know what determines Say("string") color above player's head? seems to be random each time i make a new character.
would be nice if it could be overloaded as an additional argument, but proooobably not?
edit: nvm, just found this, ill try it
Say(String line, float r, float g, float b, UIFont font, float baseRange, String customTag)

verbal yew
#

Gentlemen modmakers. I'm not sure how to ask this properly...
There are two situations:
One. ะกar, you are driving, the window is closed. Right mouse button doesn't work.
Second. Car, you are driving, window is open. The right mouse button is working - the camera is moving away in the direction.

Where do I dig this to make the second case work when the window is closed?

nimble yarrow
#

I don't understand your question.
i can look, by holding right mouse, while in a car, with window up OR down. if you can't do this, it might be a bug caused by a mod, or something?

Or, are you wanting to make a mod that restricts sight, so that the player must roll down their window first?

verbal yew
nimble yarrow
#

could be a feature of a car mod. might make sense, if you have metal plates on the window.

verbal yew
#

i'm have only SHARK mod pack

bronze yoke
nimble yarrow
#

there is a 'personal text color' variable, players can set, in the multiplayer game options.
I mean, the getPlayer():Say("hello") <-- that color

bronze yoke
#

but that doesn't get affected by that?

nimble yarrow
#

nah. its default green. my Say() text was yellow yesterday, and is purple right now

#

yellow will look good for my mod screenshots, so i wanna change it, lol.

#

there is only 2 overloads, so i need to provide it with a UIFont. will try that now

sour island
#

the overloads skip around a bit for say

#

to change color you need to go up to the overload with like 5 booleans at the end (or was that for range ๐Ÿค” )

#

or I could be thinking of addChatLine

nimble yarrow
#

that's addChatLine. and it... might be multiplayer only?

sour island
#

addChatLine goes overhead and needs to be fired through a command to work in MP

#

kinda odd that one

nimble yarrow
#

if it works in SP ill use it, instead of Say()

#

assuming i can't get the big Say overload to work

#

i think my only problem is accessing a font.
getPlayer():Say("asdf", 50.0, 50.0, 50.0, UIFont.Dialogue, 10.0, "customTagHere")
I might need to do something else, such as
UIFont[5].values()
UIFont.valueOf("Dialogue")
UIFont.FromString("Dialogue")

sour island
#

You can just call UIFont.Dialogue

#

It's exposed

#

as for customTagHere - pretty sure that won't work

#

the only way I got colors to work was using radio there

#

"radio"

nimble yarrow
#

aah nice

#

that fixed it

sour island
#

yeah sorry, it's been a minute since I messed with them for cnd speech

#

all those hours came flooding back

abstract raptor
#

How hard do you think it would be to do a functioning piano roll in lua?

thonk

sour island
#

Is that like how starbound instruments are handled?

#

Always hoped someone would make a mod like that

abstract raptor
#

Well the idea is like playable guitar, but instead of binding the keys to the keyboard and having to play in real time, we'd draw the notes in a piano roll and then you could select the tempo and save your arrangements and play it back.

#

That way there'd be no latency.

#

Additionally I was thinking there'd be a way to synch up to form bands so that the music always plays in time, (each arangement added in a band would be played at the same time on each client )

#

I'm trying to mock it up in python to get a feel for it

bronze yoke
#

ABC files are for this purpose

#

lord of the rings online uses it for exactly that

sour island
#

indeed, thats where I got most of my songs for starbound

abstract raptor
#

I don't wanna rely on ABC files to play prewritten melodies, I want the users to be able to draw and make their own compositions

sour island
#

couldn't you do both?

bronze yoke
#

and how will these compositions be stored?

abstract raptor
#

Not sure yet! ๐Ÿ˜ญ

#

The idea just came to me

sour island
#

space station 13 lets you use prewritten and writing your own

bronze yoke
#

iirc the abc format is like

#

literally just the notes in plain text

jaunty marten
sour island
#

yep, its just shorthand notes

abstract raptor
#

Oh I see then

#

But it's not like zomboid supports abc?

sour island
#

it's just text

bronze yoke
#

you're definitely going to have to do whatever you go with yourself anyway

abstract raptor
#

oh so it's like a json for musical notes

#

sorry I'm way tired if I say something stupid it's probably stupid

#

I'm just sayin, I think a DAW like approach would be the best way to do actual compositions in zomboid

#

and to solve the issue of latency and allow for collaborative performance

sour island
#

Check out spacestation 13's stuff

#

although I have not played for a while

abstract raptor
#

If anyone is like, interested in collabing with me on this I can provide all the musical samples we'd need -- I own a very well known library.

sour island
sour island
abstract raptor
#

ah you should dm me link

#

I'll join up

sour island
#

I thought you were already in there?

abstract raptor
#

I'm in the mapping discord I think

#

er i know i am

sour island
#

That section is for large projects one may be working on but could also use help

abstract raptor
#

but not the modding one

#

I'd like to recruit peeps to work on a DAW like project for sure

bronze yoke
#

i'd honestly be quite interested in helping out with that, but i really shouldn't take on more work with the crazy stuff i'm up to right now

sour island
#

It's a really good idea, but I'm not musically inclined enough to tackle it lol

bronze yoke
#

i'm not ui inclined enough to tackle it stressed

sour island
#

I wouldn't mind handling the UI tbh

#

Those crazy guys made an online version

#

Kind of ruins half the fun irritating everyone on the station as you compose

#

Oh misread - it actually converts audio into the shorthand version - interesting still

abstract raptor
#

I'm musically inclined

#

๐Ÿ˜„

#

I'll chat at ya'll some more about it in the other discord

neat gorge
#

I've been losing my mind over this so I've had to come here. Is there any way to conveniently check distribution lists, to see what is actually being added to containers and what's not being added?

#

When there's items with a low spawn chance it's difficult to see if they are in fact spawning or not

bronze yoke
#

enable LootZed from the debug cheats menu

#

then right click the container icon in the inventory and a drop-down with 'Open LootZed' should appear

#

that lets you check spawn chances and reroll loot

neat gorge
#

... you see now I just feel like an idiot.

#

atleast I didn't smash my monitors like I felt like doing yesterday

#

Thank you truly!

nimble yarrow
#

if two separate mods add the same file, the last mod loaded in the load order will 'overwrite' the first.

buuuuuuuuut what about media\clothing\clothing.xml ?

I can see both brita's armor zombies and authenticZ zombies walking around. shouldnt one of their outfits be overwritten? hmmmm

neat gorge
#

I'd assume it "merges" them together only replacing things with the same exakt name within the file?

verbal yew
bronze yoke
#

assets can be overwritten

verbal yew
#

in txt recipes with the same name cause their duplication in the game, if they are in two mods, for example, even with the same file name.
As for items - only Module and item ID matters to overwrite the item (in script).
As for XML - identical headers overwrite each other, but not the file itself (for Clothing.xml it's should be Name or GUID)

#

LUA is more complicated - global fuctions with the same name overlap each other. Two files with the same name overlap each other.

bronze yoke
#

txt files will overwrite each other

verbal yew
#

I don't think it should, as far as I remember from the tests....

bronze yoke
#

it definitely does

verbal yew
#

Okay, I trust you more than myself xD

nimble yarrow
#

interesting. so in this case, in the clothing.xml
<m_MaleOutfits> <m_Name>Brita_Sheriff_4</m_Name> from birta's armor, clothing.xml
<m_MaleOutfits> <m_Name>AuthenticAbeLincoln</m_Name> from authenticZ, clothing.xml
so what would the "header" be, <m_name>, possibly? (both mod authors were careful not to make something generic, they all have prefixes)
or maybe <m_Guid> ? (not sure what these are. example, 1101721c-3d8f-4ccd-8344-b9cf13321475) <-- clearly unique, hash looking number and unlikely to ever be overwritten.

#

@ albion, they can't possibly overwrite, or how would i combine authenticZ and britas zombies - they both need their clothing.xml files

verbal yew
#

That is, there can be several variations of a zombie under one name (different GUID)

#

And in case of zombie spawning - a random outfit should be taken (same name, different GUID)

bronze yoke
#

i was just commenting on txt

nimble yarrow
#

oh.

verbal yew
# nimble yarrow oh.

Most likely, if you want to overwrite some zombie, use the same name and GUID - 100% variant)

nimble yarrow
#

swag

verbal yew
#

in vanillas has two variant zombies on same name and guid - but different female and male

slow graniteBOT
#
dogeking has been warned

Reason: Bad word usage

rain shard
#

Hello everyone,

Is there a function akin to processSayMessage that does it as a system message instead? I am trying to run in-game tips for players but unfortunately the say message does actually transmit to other players, so I'm looking for alternatives

ivory gyro
#

His someone know how to remove every attachment on a weapon with an function ?

spice grail
#

i assume i can add more lines to weight related grids aye? (tetris inventory)

#

im having a hard time making these into more realistic sizes

ivory gyro
mellow frigate
#

Hello there, from lua , how can I change the color of a clothing inventory item ? (e.g. from an instance of 'Base.Vest_WaistcoatTINT') I do not find the info in the load function of Clothing.java

#

I'll ask Transmog, they seem to do so.

mellow frigate
#

getVisual():setTint(ImmutableColor color)

tawdry solar
#

If I play a sound on press Q (idk the event) will it play a sound if they are typing ingame

nimble yarrow
#

yes. it will even play in the main menu. which is why you start the 'keypressed' function with 'if player not ready return end'

tawdry solar
#

But it's gonna be a nod?

#

Mod

#

How will it play in menu if its a mkd

nimble yarrow
#

the Events.OnKeyPressed event works in the main menu. all mods are loaded when you launch PZ, as well as when you activate one or more in the mods menu, and press Accept

#

unless typing, in multiplayer, avoids this problem. not sure, never tried to use a keybind while in multiplayer while typing.
(or as you said, type a word that has a keybinded letter)

tawdry solar
#

Oh damn

#

I'm tryna make a sound play when shouting

nimble yarrow
#

if you type in: mod_development into the discord search bar, you can search only this specific channel, and then i searched sound shout and it looks like people may have already worked on similar projects, which you might be able to look at or read about

tawdry solar
#

Ty

harsh jewel
#

The local Gas 2 Go nationalist suggested I ask here, so I'm copy-pasting my question here:
Is there a main Fallout-themed PZ project people are working on? I've seen a number of Fallout models posted here and on the Steam workshop, but the latter ones are sparse.

nimble yarrow
#

not sure. but, you can go to project zomboid's steam workshop, and at the top, under the Browse drop-down, instead of looking at items you can look at collections.

then you can search 'fallout' and sort by most popular / all time (or whatever) and there seems to be some 'project fallout' modpacks

#

alternatively, theres a separate modding discord for group projects. im not in it, but its possible theres a big fallout project over there?
I personally wouldn't spend time working on something that could get a cease and decist, though.

tawdry solar
#

I think I'm in it

#

I just don't have the modder role

#

And I don't think I can

#

Cause I don't use ko fi

weary matrix
#

@silent mural Hey hello, I'd like to talk to you in private, can I DM you please?

nimble yarrow
#

Anyone know how to overwrite an outfit from a mod's clothing.xml?

for example, I want to remove the hat from AuthenticAbeLincoln.
I can simply add a line of text: <probability>0.0</probability> above the hat, and it is gone.

However, I need this in my own mod, which will be loaded after AuthenticZ, in this case.

If I create my own media\clothing\clothing.xml and create an <m_MaleOutfits> entry for AuthenticAbeLincoln, however, he just appears naked in-game.

weary matrix
#

thx

cunning dome
nimble yarrow
#

the whole entry

cunning dome
#

And the probability just for the hat's GUID not anything else?

#

I haven't worked with the XMLs before, but looking at it, I'd assume that's how it works.

nimble yarrow
#

yeah, everything else should be 100% by default,

cunning dome
#

Paste me your edited XML?

ivory gyro
#

Someone know who make an Camo Outfit mod ?

#

Like more camo than vanilla

nimble yarrow
#

@cunning dome at the moment, its just the first 73 lines of AuthenticZ's clothing.xml.
but the relevant bits:

#
<outfitManager>
<m_MaleOutfits> <m_Name>AuthenticAbeLincoln</m_Name>
        <m_Guid>a541548a-9933-4bbc-bff1-4931cb5d5c94</m_Guid>
        <m_Top>false</m_Top>
        <m_Pants>false</m_Pants>
        <m_AllowTopTint>false</m_AllowTopTint>        
        <m_items> <!-- Suit Pants -->
            <itemGUID>52acd769-424a-4cbb-b02a-441cb723b747</itemGUID>
        </m_items>
        <m_items> <!-- Stove Pipe Hat -->
            <probability>0.0</probability>
            <itemGUID>0601a52d-84c8-49f8-b216-d2b1fc54c3a9</itemGUID>
        </m_items>         
    </m_MaleOutfits>
</outfitManager>

I would assume he should spawn with pants and no hat. instead, he spawns completely naked.
(i deleted the other lines, it also specifies socks, shoes, watch, shirt, jacket)

cunning dome
#

Your full XML includes the lines for his other clothing items right?

nimble yarrow
#

nah, i just deleted them, to match what i posted above. so just pants, really.
but this is AuthenticAbeLincoln in game:

cunning dome
#

If you haven't included them then I would assume he would spawn wearing nothing. You're effectively overwriting the entry for his outfit GUID, so you've got to include everything you want him to wear.

nimble yarrow
#

yeah that would make sense

cunning dome
#

So try...

<outfitManager>

<m_MaleOutfits> <m_Name>AuthenticAbeLincoln</m_Name>
        <m_Guid>a541548a-9933-4bbc-bff1-4931cb5d5c94</m_Guid>
        <m_Top>false</m_Top>
        <m_Pants>false</m_Pants>
        <m_AllowTopTint>false</m_AllowTopTint>
        <m_items> <!-- White Zed Skin -->
            <itemGUID>9c87b588-b784-4560-bada-fd4cf7e44d48</itemGUID>
        </m_items>            
        <m_items> <!-- Suit Pants -->
            <itemGUID>52acd769-424a-4cbb-b02a-441cb723b747</itemGUID>
        </m_items>
        <m_items> <!-- Socks -->
            <itemGUID>ebea15c8-99b3-4e20-905b-d22cf82b8217</itemGUID>
        </m_items>
        <m_items> <!-- Shoes -->
            <itemGUID>593bea3d-c127-4574-ac1e-2197dc56e486</itemGUID>
        </m_items>
        <m_items> <!-- Tie -->
            <itemGUID>1be7cae9-82bd-473f-8de9-23a8d9ca3117</itemGUID>
        </m_items>
        <m_items> <!-- Formal White Shirt -->
            <itemGUID>ac7976de-2c73-44ea-9392-5d24ac1fb649</itemGUID> 
        </m_items>
        <m_items> <!-- Suit Jacket -->
            <itemGUID>eecd5923-4944-4b33-9c4c-66045ea6984e</itemGUID>
        </m_items>
        <m_items> <!-- Watches -->
            <probability>0.9</probability>
            <itemGUID>4cbb081e-0e9a-4248-bec1-0aa226e082e1</itemGUID>
            <subItems>
                <itemGUID>e4b3135f-a541-4870-a7b9-2ba6f730bc5c</itemGUID>
            </subItems>
        </m_items>
</m_MaleOutfits>
</outfitManager>```
_Edited:  Forgot a line_
#

ERrh

#

There, just with the Stove Pipe lines deleted, basically.

#

Or with probability 0 if that doesn't work I suppose.

#

If still not, then it's beyond me. ๐Ÿคฃ

#

What have you got against ole Abe's hat anyway!? ๐Ÿ˜›

nimble yarrow
#

its part of a larger mod where I remove any 10-years-later lore-unfriendly zed from brita's and authenticZ.
its mostly done, but there are some zeds that i want to keep, but remove an item
(football player is fine. carrying a football in his hand, is not) ๐Ÿ˜›

cunning dome
#

Aaah~ Neat!

nimble yarrow
#

wait, why does your code, above, work? huuuuuuuuh

cunning dome
#

ยฏ_(ใƒ„)_/ยฏ

#

XML is finicky as hell.

#

Miss a single closing tag or improperly format and it throws a fit.

nimble yarrow
#

only difference i could see was you didn't have <m_items> <!-- Dismembered Bone_Arm_L -->, but i assume that's because its an additional 30 lines for discord

cunning dome
#

Hell it might even just be the XML Schema doesn't allow probability 0 as an entry.

nimble yarrow
#

true, i didnt think of that

cunning dome
#

Though you said it worked when you edited the original.

nimble yarrow
#

well, i think i tried 0.000000001, but that could also have descended into scientific notation and made xml mad

cunning dome
#

All I did was copy the lines straight out of AuthZ, erase the Stove Pipe Hat and spit it back out and close tags.

#

Well as long as it works, the console isn't throwing any weird errors and the game is happy, I'd say we've solved it. ๐Ÿคฃ

nimble yarrow
#

@cunning dome its broken now. I copy+pasted immediately, when you posted. but then as my game was loading, you edited it 2 or 3 times

#

can you un-do whatever you did? the original 'mistake' you posted is the only thing that works

cunning dome
#

Huh... All I did was I forgot the </m_MaleOutfits> line

#

Which I would have thought would break it, not being there.

nimble yarrow
#

um... if i copy+paste your snippet up there, Abe is naked.
If I DELETE the </m_MaleOutfits>, he spawns with full clothes + no hat.. bruh

#

how does that make sense looool

cunning dome
#

๐Ÿคฃ

#

I just realised I actually missed a bunch of dismembered/bone hand parts too.

nimble yarrow
#

i figured you left them out to save 30 lines of discord space

cunning dome
#

I mean I guess. ๐Ÿคฃ

#

I'm curious if it cracks it with the </outfitManager> missing as well?

nimble yarrow
#

theres no way that'd 'compile', so to speak. the thing is, I need to edit multiple zeds, not just Abe.

but how can i edit them, if they arent allowed to have </m_MaleOutfits>? hmmmmmm.. very strange

cunning dome
#

Try adding a second outfit entry then and see if the first/Abe one starts working then?

nimble yarrow
#

ah, for sure

cunning dome
#

I even ran your original code through an XML Validator and it was happy with it.

#

All this said, I'm not sure if overwriting a GUID like we're doing is "supported" so ...

#

But I can't find any damn documentation on any of this anyway, so how am I meant to know what's even valid..? XD

nimble yarrow
#

i was thinking maybe the very very very first line of the document was it, (i never pasted it into discord)
<?xml version="1.0" encoding="utf-8"?> but removing it doesn't seem to do anything

cunning dome
#

Usually that's just boilerplate and non-strict interpreters will be fine with it missing.

#

Best I can find googling around is vague "This file is for this" instructions, nothing at all about the actual Schema or expected syntax.

#

So unless someone else can point me to a resource I haven't been able to locate, we're stuck looking at examples/pre-existing code and extrapolating.

#

Hang on... did you still have the probability edited to 0 in Authentic Z?

nimble yarrow
#

nah, i deleted the hat, and other things.

cunning dome
#

In the original mod's local workshop files?

nimble yarrow
#

oh, um...

#

it might be. i should probably unsub, delete my leftover files, and then re-sub, to undo anything i tweaked over there

cunning dome
#

If the edits are still there, I'm willing to bet the invalid XML just got ignored and it fell back on your changes to the original mod.

nimble yarrow
#

my 0% edit is still over there, in the authenticZ workshop files. oops,

cunning dome
#

Yyyyeeaaah ๐Ÿคฃ

#

Okay well that answers one question at least.

#

My code didn't work. ๐Ÿ˜›

#

Could try just copying the entire set of AuthenticZ XMLs and then making edits..?

#

If you were planning on making sweeping changes anyway, it's a bit heavy handed but might get past this hurdle?

#

Because I'm wondering if any GUIDs your own mod is referencing have to exist locally.

#

I don't know why that would be the case but I'm kinda clutching at straws here given the lack of info.

nimble yarrow
#

oh. so maybe i need authenticZ's media\fileGuidTable.xml then, if that is the case.

cunning dome
#

There's a good chance.

nimble yarrow
#

i didnt think i need it, because while an "outfit" has a GUID, it is never used, anywhere, ever (as far as i know)

cunning dome
#

Yeah; items referenced in the outfits still do however.

nimble yarrow
#

hence him being naked, i guess.

cunning dome
#

shrug?

#

Worth a shot.

#

I came from editing distribution tables which involves directly modifying the Lua tables, so it doesn't matter which mod does it. For all I know the XMLs are scoped per-mod rather than globally.

nimble yarrow
#

so, fresh install, full outfit copy, and fileGuidTable copied, hat is properly removed.
so I'll be able to slowly remove stuff until i get to what breaks, so its not so heavy handed

#

thanks for the help

cunning dome
#

No worries, good luck.

rustic elm
#

the the looking for someone help me finish fairly simple mod just need lil help with traits and random things character will say
if you can help
please dm me
il credit you in description

cobalt fiber
mellow frigate
#

What code should I put in render and what code should I put in prerender for ISUIElement daughter classes ?

autumn temple
#

OMEGALUL for some reason putting "ReplaceOnUse" for using an item, crashes my game

#

so its a frankenstein of an item.

#

the item is treated as a food, that when consumed it should just replace it with itself, then also gives some stat effects on consumption

#

but replacing the item with itself is what is causing it to crash

mellow frigate
neon bronze
#

You also need a eatsound for your item

autumn temple
autumn temple
gilded hawk
#

New WIP mod, disable traits, and profession from the server sandbox options, compatible with all traits and profession mods!

#

This will make life so much easier for server owners and players like me who want to disable noob traps when playing with friends

calm shale
#

Is there anyone here whoโ€™d be willing to accept a commission for a mod? Iโ€™d like some custom stuff for my server.

gilded hawk
calm shale
#

Is that so

bronze yoke
#

not with his reputation

autumn temple
#

Of being a gigachad*

autumn temple
#

He has a kofi page you order them through

calm shale
karmic fog
#

Ayy, does anybody know where I can find a complete list of item variables? Like, I'm trying to add a clothing item and I'm unsure which variables I need. For example, Glasses have the attributes cosmetic and weight. So, is there a list of every available variable somewhere?

karmic fog
#

thanks!

#

oh damn, that's quite the list. many thanks BcaLove12

#

Are variables false by default? bunny_peek

bronze yoke
#

i think it probably varies

cunning osprey
#

Anyone know the ideal dimensions to use for the poster/preview images?

bronze yoke
#

workshop preview must be a 256x256 png

#

i think in-game posters are a lot more lenient with resolution but most people just use the preview

worthy sparrow
#

is there a green + icon in the game assets?

#

i looked through like 4 tilesets and found none

cunning osprey
worthy sparrow
#

can you send me the file?

cunning osprey
#

sure thing

#

PM'd it

worthy sparrow
#

Thank youu

cunning osprey
#

incase anyone else searches for this

tawdry solar
#

Guys

#

Why does mu mod lead to black screen when trying to play

worthy sparrow
#

check console.txt

bronze yoke
#

press f11

#

if an error happens during that loading sequence it doesn't open the debug menu, but it still pauses as if it had

#

so you need to press f11 to 'close' it

worthy sparrow
#

I had this issue when playing on brita armor pack, running the game without debug works

storm ingot
worthy sparrow
#

while being in main menu you can disable the "Break on Error" and that should prevent it

mellow frigate
#

@heady crystal I joking on your Icecream mod thread, If you find it offensive or just not funny, please tell me and feel free to remove my comments :drunk:

heady crystal
mellow frigate
heady crystal
#

Ahahah

#

I see it

#

Woah I can't believe you exposed my plans of microwaved ice cream domination

#

There is only one way to solve this

karmic fog
#

Hello wavecat I'm back again! I've been doing some sculpting and stuff, but I haven't quite figured out how to implement my blender file and icon into a mod yet. The guide on the wiki that explains how to add clothing is apparently not available anymore, as the link takes me to a 404-not found site dead Does anybody have a link to a guide?

worthy sparrow
#

How to make a pizza ๐Ÿ•

bronze yoke
#

try putting the link into wayback machine

karmic fog
#

ooooh, good idea

#

thanks

#

actually smart

mellow frigate
abstract raptor
#

tcherno is my hero

sage eagle
#

is there a tutorial to make a True Music Addon

karmic fog
#

Wait, I have my blender file of my clothing item.. how the hell do I convert it into an .x File, so I can put it into the model_X dictionary?

#

Blender seemingly discontinued the export into .x files dead

mellow frigate
# karmic fog Wait, I have my blender file of my clothing item.. how the hell do I convert it ...
The Indie Stone Forums

Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...

sage eagle
#

how hard is it to mod in actual video

#

and audio

#

for a tv

#

cause i had an Idea for a mod that loops an Emergency Alert System Message after the normal tv channels stop playing

#

this is the video i made and would like to use: https://www.youtube.com/watch?v=kUA4xV02dcA&t=1s

I made this in like 3 hours (learning experience) as a start to what I hope will become a Project Zomboid mod, feel free to use this for whatever purpose.

I'm sorry guys, it must be done...

project zomboid 100 days,
project zomboid 100 days multiplayer,
project zomboid 100 days rooftop,
project zomboid 100 days modded,
project zomboid 100 ...

โ–ถ Play video
bronze yoke
#

audio? fairly easy

#

video? absolutely insane if even possible

sage eagle
#

is video possible

#

like

#

or at least a photo

#

basically the thumbnail

bronze yoke
#

i think you can just add an extra tv sprite for that

sage eagle
#

i uh

#

i dont think im that good

autumn temple
mellow frigate
vagrant valley
#

Are there any ways to open x files in blender

sour island
cunning osprey
vagrant valley
#

Im on 2.93

cunning osprey
vagrant valley
#

Alright

#

Thank you

#

Everytime i have to say x files, it just reminds me of the show

nimble yarrow
autumn temple
#

ive been digging through the console file, no errors or stacktrace

#

the only thing the console shows, is the error for missing translation, because I didnt make a translation file for the context menu yet. then like 5 ticks of my print messages, then nothingness

sage eagle
#

@heady crystal

#

cant actually get it

#

nvm

#

sorry

heady crystal
#

Wdym?

sage eagle
#

it works now

#

it wasnt letting me view its page at first

heady crystal
#

I am updating the description

#

So that's probably it

sage eagle
#

ah

#

thx

#

what inspired you to make this

#

and secondly, I wanna ask you about a mod idea

#

i see that you could benefit from it if you knew how to make something like this

fickle relic
#

I moved code for a IsPanel from :render() to :prerender(), because there was a noticable lag when I was trying to make the height of my panel dynamic (panel.SetHeight()) INSIDE the render() function

#

But now that I moved everything to prerender, there is no background/border at all ?

jaunty marten
#

why do u even need to change heaight of panel each frame

#

just change it when list of items is changes

fickle relic
#

true ๐Ÿ˜„

neon bronze
#

Youd have to put the background into the prerender

cunning osprey
#

Does anyone know how difficult it would be to make a positive trait that gives bonus happiness when eating a specific food item? I'm completely stuck with this rn

neon bronze
#

add the trait and hook into the eating action i think that would suffice

nimble yarrow
#

resolved!!

drifting ore
#

is there a way to add custom sentimental items for the more traits mod?

nimble yarrow
#

I just made a mod that removes jewelry from zeds (BellyButton x15, Bracelet x10, Earring x19, necklace x26, ring x20), by removing them from the outfits in clothing.xml. it works great.

Now I want to get rid of the underwear: boxers x5, bra strapless x4, bra straps x3, briefs x2, frillybra strapless x3, frillybra straps x3, frillyunderpants x3, smalltrunks x4, underpants x4 ... but underwear doesn't seem to be part of an outfit. it must be generated elsewhere?

googling "project zomboid remove underwear" isn't going to get me anywhere. anyone have any ideas?

sleek forum
#

perv!

sour island
#

If anyone can guess what this is for I'll give them a cookie

vagrant valley
#

Im guessing it has to do with sound somehow

sleek forum
#

@nimble yarrow you might wanna check UnderwearDefinition.lua
-- used to spawn underwear automatically on zeds

nimble yarrow
#

media\lua\shared\Definitions\UnderwearDefinition.lua found it, i'll check it out!

sleek forum
#

if so, you emit sound by standing still somehow too?

#

or is that just detection

nimble yarrow
#

the circle keeps getting bigger because of a keypress.

mellow frigate
sour island
#

No, sorry lol

#

What is your bug related to? drawing circles?

mellow frigate
#

but, I am using UI function while you are using marker

worthy sparrow
sour island
#

It's related to sound

sleek forum
#

zombie sound detector?

worthy sparrow
#

Is this some kind of echolocation lol

vagrant valley
#

Is it how far player made noises travel

sour island
#

Somewhat close guesses

#

I think brody technically got it?

nimble yarrow
#

i dont get why it keeps pumping once the player stops walking

#

unless this is just our first peek at how sound actually propogates in PZ engine

sour island
#

It's related to sound but it's not in-game sounds ๐Ÿ™‚

#

๐ŸŽ™๏ธ

nimble yarrow
#

oh no

neon bronze
#

Is voice chat actually picked up by zombies?

sleek forum
#

are you saying i can fart in my mic to summon zombies?!

vagrant valley
#

So you dont need q anymore

#

Just scream into your mic

sour island
#

Yes x3

sleek forum
#

nice

neon bronze
#

Do you give the zombies the player in their aggro list?

#

And do you do that through the server?

sour island
#

It just catches microphone activity and uses addSound()

neon bronze
#

I thought it needed way smarter stuff for it

#

Can you get the micro activity through lua?

sour island
#

Yeah

#

I used the same stuff from the menu - the voice activity is picked up and displayed there

neon bronze
#

Ahhh the settings

#

Is it through the core functionality?

nimble yarrow
#

"Operates regardless of push-to-talk." good thing my computer fans sound like a rocket engine

sour island
#

Getting photoshop to produce AI-gen art that looked decent took longer than writing the mod

sour island
neon bronze
#

I think most people have push to talk

mellow frigate
sour island
#

Took super long cause I'm picky as hell lol

mellow frigate
#

How the hell did you get the right number of fingers with Imagine AI ? I always get 6 minimum

sour island
#
  • having to get creative to get blood and gore. For example, this man is actually drooling red paint ๐Ÿ˜…
#

Oh the hands were from PS

nimble yarrow
#

drooling red paint, good grief

sour island
#

They were gnarly as hell, and the gloves were an accident but I liked them lol

mellow frigate
#

gg

#

push to talk wil be required for streamers but it is a good ambiance realism directly from the mike

worthy sparrow
#

That mod can nicely elevate to a RP mod with walkie-talkies, headsets that actually work like a in game way of communication with others ofc. drawbacks such as not using anything -> widest radius, walkie talkie -> smaller radius, headset -> lowest radius

vagrant valley
#

Things like that makes you wish you got a whole crew ready to take any kind of photographs

mellow frigate
#

Is there a way to make a player not targetable by zombies ? (out of god mode invisibility that also makes invisible to players)

sour island
karmic fog
#

I'm having a severe skill issue trying to spawn in my own clothing item.

It appears in the item list, although with no item icon and when I try to spawn it, it just gives out an error

#

I believe I referenced it correctly in the .xml files dead I'm helpless

#

Does anybody know where the problem could be?

#

Fixed it! Apparently I needed the "<m_AttachBone>" thingy in the xml file!

#

that thingy should be at hip height, so uh, now just gotta figure out the elevation

sleek forum
#

is that a piece of ginger?

nimble yarrow
#

chicken breast?

mellow frigate
karmic fog
sour island
slender oar
#

in a mod recipe, what does like "Pasta;20," mean in something like

    recipe Prepare Yakisoba in Wok Pan
    {
        Pasta;20,
```?
#

the couple guides i read seem to say it should be like Pasta=20? is ;20 something different?

#

or possibly a bug?

#

i don't think bug, i see a ton of them like that with the ; instead of =. maybe just an old format?

rich void
#

Hey guys, I'm trying to familirise myself with remote calls it's been something I've struggled with grasping for a while, say I have a bunch of playerobjects grabbed from within the server side code and I want to execute a function for just those players client side, could anyone help with a basic demonstration or point me in the right direction, I'd be very grateful as always ๐Ÿ™

neon bronze
#

Look into sendservercommand and receiveservercommand i believe they are called

#

Thats how you can communicate from server to player and vice versa

rich void
#

Yeah I had a look at these, I was hoping I could pass a function straight through

public static void sendServerCommand(IsoPlayer player,
String string,
String string2,
KahluaTable kahluaTable)

I guess I would need to create a table to contain the function I wish to run? or am I overthinking this cus #everythingsatable kekcry

#

Oh I think I get it.. I can use the events for onservercommandreceived and check for the string the command sent

#

Thank you I think I can trial n error from here ๐Ÿ‘Œ

slender oar
#

the number after the ; must not mean count required like = does. it doesn't make sense for most recipes that it would be. don't need 20 pasta to make 1 dish of that.

#

i think it must be the % of the item that is consumed

#

recipe Dip Nacho in Chili Bowl
{
TortillaChips=1,
BowlofChili;4,

#

uses 1 tortilla chip, and 4% of your bowl of chili?

#

seems reasonable

autumn temple
#

So for the item I made that keeps crashing my game, I made a new set of items and slowly added every line from the crashing item into the new one. No issues at all with the entire item remade. So I have literally 0 clue why the item was causing crashes

slender oar
#

@tacit plover that sound right?

autumn temple
#

This is going to send me to the mental ward man

slender oar
#

@autumn temple lol tell me about it. so much stuff in PZ is like that. undocumented or out of date documentation...

tacit plover
slender oar
#

ooooh. interesting. i could not find that little bit of information ANYWHERE haha

tacit plover
#

also, seems like my update broke some stuff with vanilla recipes, but you were being getting kicked before the update so i have two issues to fix now shockedmilk

sleek forum
#

if you really want to know how the code works you can decompile the java code

#

it contains a lot of stuff you're not going to find in the lua code

slender oar
#

@tacit plover don't worry too much about my kick issue. it may have been an issue for a very long time, but everyone just disables anticheat 21 so it got ignored

#

@sleek forum that's too much effort right now, maybe later haha. i saw someone in a "certain forum" already did that and posted it tho

hollow current
#

testmod.addContextMenu = function(player, context, worldobjects)
    for _, object in ipairs(worldobjects) do
        print(object:getSpriteName())
        print(object.name)
        print(object:getName())
        print(object:getType())
    end
end

Events.OnFillWorldObjectContextMenu.Add(testmod.addContextMenu)```

I am trying to call this function when the player right clicks on an item placed/dropped in the world. I want to return the type of the item that the player is clicking on (or more specifically, find out which item the player right clicked on). It's behaving weird and I am not sure why. getType() is always returning "MAX". object.name and getSpriteName() always return "nil". object:getName() return "nil" unless I pick up the the item and re-place it, and is not reliable in case the item's name was changed
#

Any idea what's going on here?

sleek forum
#

don't know really, but it reads like it's not reading up to date data (because it's missing, and then not)

hollow current
#

for reference, the item has an instance of IsoWorldInventoryObject

hollow current
#

alright solved had to do object:getItem():getType()

karmic fog
#

How does blood work? I'm currently modeling a facemask, and I want it to be all black.

And when you kill zombies, it gets painted red with their blood, but does the game do that itself, or do i need to like, show where the blood lands or something?

hollow current
# hollow current ```lua testmod.addContextMenu = function(player, context, worldobjects) for...

something else--

Frogshire.frogContextMenu = function(player, context, worldobjects)
    local frog

    for _,     object in ipairs(worldobjects) do
        if instanceof(object, 'IsoWorldInventoryObject') then
            objectType = object:getItem():getType()
            if objectType == "Frog" then
                frog = object
            end
        end
    end

    if frog then
        print(frog:getItem():getName())
    end
end

Events.OnFillWorldObjectContextMenu.Add(Frogshire.frogContextMenu)```

Right now, "frog" is assigned to whichever is lucky enough to be the first object in the "worldobjects". That's not ideal for items clustered around closely together. Any way to make it only be assigned to the closest object to the click?
slender oar
sleek forum
#

dont you just love it when you're so invested in creating something you can't be bothered to eat or sleep

#

time flies by and its already midnight

slender oar
#

watcha working on @sleek forum?

sleek forum
#

im working on a program that renders the zomboid maps in real time

bronze yoke
sleek forum
#

hehe, you're in deep

#

good shit

slender oar
#

what programming language dezuzel?

sleek forum
#

C/C++, and SDL2 library

slender oar
#

good luck ๐Ÿ™‚

sleek forum
#

thanks man

slender oar
#

isometric/overheader? or going to let us walk thru in 1st person? ๐Ÿ˜›

sleek forum
#

haha i'm going to start with an overheader

#

i'm curious how fast a framerate i'm going to get once i get it all working

nimble yarrow
sleek forum
#

that's the idea yea

nimble yarrow
#

seeing it all 10-years-later'd would be pretty cool

sleek forum
#

reason being is that pre-rendering takes aweful long

nimble yarrow
#

for sure

slender oar
#

once it's working then you can port it to browser ๐Ÿ˜›

nimble yarrow
#

LOL

sleek forum
#

haha

#

what does that use, webgl or something

slender oar
#

like this ๐Ÿ˜› they ported whole c++ game into browser, it runs great

tawdry solar
#

this just DOESNT work

#

i press f11 and nout happens

slender oar
#

new fork doesn't work for me in firefox tho ๐Ÿ˜ฆ

bronze yoke
#

you could be getting many errors then

#

check your console.txt

tawdry solar
#

this is my entire screen

#

other times its like that

#

others its just black

#

or others its stuck on the main menu

bronze yoke
#

oh it breaks that early?? i thought you meant it broke when starting a game

tawdry solar
#

where is console.txt

bronze yoke
#

zomboid folder

tawdry solar
#

now its on the main menu screen

#

im confused on what this mena

#

i could move it to a new folder

#

backup is a crazy thing

sleek forum
#

@slender oar thats awesome

#

reminds me of unreal tournament 2000

slender oar
#

in the game hit E key and there is in game editor that is really cool

#

i use to play the regular game and just spend ours in multiplayer on servers with friends co-op editing

#

it has a cool in game editor

karmic fog
#

How to make an item appear as a 2D icon when I drop it on the floor? bunny_peek There's the attribute "WorldRender" which prohibits it from rendering as 3d, but it didnt use the icon instead

sleek forum
#

thats crazy

#

in 10/20 years we'll be running games that need 4090's to run now

#

in the browser

dark wedge
#

Finally. I think I'm done with assigning icons to everything in the vanilla world context menu. I've also made it so the highlighted texture renders in the center. Just a few more functions to add that I'm missing, then I think first release is ready.

slender oar
#

@sleek forum too bad we went so far back technology when they went from flash to html5 ๐Ÿ˜ข

#

now a game that ran fine in flash back in like 2005 will still barely be able to run on the latest average hardware if made in html5

ivory gyro
#

Hello guys ^^ This is not a mod, but I made script for server owner want to control they PZ server with an discord bot ^^ With RCON, and start command ! ๐Ÿ™‚

slender oar
#

o_O

#

this, what?

#

spammer i guess

mellow frigate
dark wedge
# mellow frigate what is the interface for other mods to adapt ?

Just add stuff to the conxtext menu like normal. That will add an entry without a texture, unless you're adding one for a string/function I check for. To add an icon and stuff, here is the basic example I was going to give:

local decor = (getActivatedMods():contains("SUI-RCM") and require("RadialContextMenu/Decorator")) or { overlays = {} }

local example = function(player, context, worldobjects, test)
    -- Add a context cption just like normal
    local option = context:addOption(getText("ContextMenu_Turn_On"))

    -- Set the Icon for the Radial Slice
    option.icon = getTexture("media/ui/Container_ClothingWasher.png")
    -- The following can also be used for compatibility with the Context Menu:
    --- option.iconTexture = getTexture("media/ui/Container_ClothingWasher.png")

    -- There is also this function to pass a texture directly, ONLY works with this mod enabled:
    --- local option = context:addRadialOption(name, texture, target, onSelect, params...)

    -- To set an overlay icon (optional)
    option.overlay = decor.overlays.poweron

    -- To set a color:
    --- option.color = decor:Color(0, 0, 1) -- returns: { r=0, g=0, b=1 } -- blue!
end

Events.OnFillWorldObjectContextMenu.Add(example)
gilded hawk
#

Does anyone know how to get in touch with "Brita" or "Arsenal" I can't understand the english they used for their tooltips

Does an higher number give less ammo or more ammo?

zinc prairie
#

Is it possible to add more challenge scenarios via mods?

#

I havent seen any on the workshop

bronze yoke
#

yeah, i think there's a few

wide sierra
#

How can i get the zombie 3d models for creating custom textures?

nimble yarrow
#

@gilded hawk higher number gives more. use 0% to remove ammo completely

gilded hawk
nimble yarrow
#

do they seem opposite? ๐Ÿ˜ฎ how so?

gilded hawk
#

Idk man the language used in the tooltip is confusing me

nimble yarrow
#

basically,
"reduce or remove weapons based on type/calibur ammunition" (by lowering this enum)
this will affect associated items and ammo
only when those are not used by another category (if you disable crossbow bolts, crossbows will not spawn, or visa versa.)

#

i always play Pre-1993 USA ONLY, so I disable 4g, 10g, 7.62x54mm R, 5.45x39mm, 7.62x39mm, .45-70 GOV, 5.7x28mm
(these are either post-1993 or outside the USA)

so yeah, lowering the enum should disable ammo types, right?

gilded hawk
#

So, if I do 100% I'm reducing the spawns by 100%? ๐Ÿค”

nimble yarrow
#

no. you're doubling spawns

#

starts at 50%. can drop down to 10%, or even turn off completely at 0%. you're now increasing from 50% to 100%, double loot

gilded hawk
#

Ah okay good, thank you โค๏ธ

#

That was confusing me so much ๐Ÿ˜…

cobalt fiber
#

Great work pancakes_hedgehog

#

Just to clarify, what is the max range it can trigger zombies? (Tiles) stressed

sour island
#

I think shout has a range of 30.

#

It's very trippy to suck my teeth to call over zombies.

atomic salmon
#

I'm a bit of a dingus, so bear with me - but shouldn't this output the key # to the log? Nothing's been happening

    print(key);
end

Events.OnKeyPressed.Add(ShowKeyPressed)
bronze yoke
#

it should, where is your file located?

atomic salmon
#

mods>myfolder>lua>client

#

in users

bronze yoke
#

is the mod structure working? you can select it from the mods list and everything?

#

oh, right

#

myfolder/media/lua/client/

atomic salmon
#

yeah i have it active, a diff function i have in the same file is outputting

bronze yoke
#

hmm

balmy swan
#

There's a small mod idea I had to get used to code modding in PZ. I've been looking through the javadocs, but I couldn't find anything there.
How would I go about calling a function when a specific gun is fired, or if a person/zombie is hit by a specific weapon?

bronze yoke
#

i would've guessed it was a loading issue because i don't see why it shouldn't work

atomic salmon
#

i'll try a restart or smthn

#

i hate having to troubleshoot outputting logs lol

#

but i have no idea what i'm doing so it's no biggie hehe

bronze yoke
#

troubleshooting the troubleshooting drunk

cobalt fiber
#

I'm managing a playthrough with my friends only using in-game VOIP and walkies. It's gonna be rough ded

#

Thanks again for the mod and the info

atomic salmon
#

yeah a restart and now the keys are outputting lol rip me

bronze yoke
#

weird, were you resetting lua between tries?

atomic salmon
#

i was just reloading the file i was working on with f11

#

jus the one

neon bronze
#

Functions added through events wont reload if you edit them

atomic salmon
#

ok thanks

bronze yoke
#

you should still see the print since it'd add the new one on top of the old one

atomic salmon
#

it was printing nil

cobalt fiber
#

In your function, you can filter if the weapon is the one you are looking for, and do what you want

balmy swan
#

Ahhh. So it'd be more of a generic function that would keep running, rather than something in the weapon that calls it?

cobalt fiber
balmy swan
#

Righto! That'll be helpful, PeteR. Thank you ๐Ÿ™‚

hollow current
#
function Frogshire.getFrogFood(player)
    local playerObj = getSpecificPlayer(player)
    local invent = playerObj:getInventory()

    local foodTypes = {
        "Maggots", "Maggots2", "AmericanLadyCaterpillar", "BandedWoolyBearCaterpillar",
        "MonarchCaterpillar", "SawflyLarva", "SilkMothCaterpillar", "SwallowtailCaterpillar",
        "Centipede", "Centipede2", "Cockroach", "Cricket", "DeadRat", "DeadMouse",
        "Grasshopper", "Millipede", "Millipede2", "Pillbug", "Slug", "Slug2", "Worm"
    }

    local combinedTable = {}

    for _, foodType in ipairs(foodTypes) do
      local items = invent:getItemsFromType(foodType)
      for _, item in ipairs(items) do
        print(item)
        table.insert(combinedTable, item)
       end
    end
end```

Trying to return all items of specific types in a player's inventory and put them in one table. ``local items = invent:getItemsFromType(foodType)`` works correctly and prints "items" as it should for each type, however, when I loop over the ``items`` table in ``for _, item in ipairs(items) do``, nothing is printed or added to the combinedTable. Am I iterating over them incorrectly?
neon bronze
cobalt fiber
cobalt fiber
balmy swan
balmy swan
neon bronze
#

Which you have to iterate over differently than the lua tables