#mod_development

1 messages · Page 296 of 1

grizzled fulcrum
#
PlayersToAdd:insert(PlayerArray:get(PlayerTempNumber))
PlayerArray:remove(PlayerTempNumber)
abstract cairn
#

So the problem was the :add method doesnt exist?

grizzled fulcrum
#

Yes, because these variables are 2 different types

#

Are you using Umbrella?

abstract cairn
#

I have no idea what that is

#

so no

#

likely not

grizzled fulcrum
#

look at pinned post

#

4th one

#

go to the github and follow the install guide

abstract cairn
#

interesting

#

but this method is more performant?

#

than the PlayersToAdd:insert

grizzled fulcrum
#

yes, that's why I did it

abstract cairn
#

I'll do that then

#

and now we pray

#

and reupload the mod to the workshop and restart the server lol
ty I appreciate it

grizzled fulcrum
#

When you do, you can add above the variables their types, it's not a "real" type as lua doesn't have real statically-typed types, but it's useful to keep track of what variables have access to what functions

#

So with the extension you can do

--- @type IsoPlayer[]
local PlayersToAdd = {}
#

and getOnlinePlayers() already has it's return type documented so it will fill in the blanks for a lot of things automatically

grizzled fulcrum
#

First one if B41, second one if B42.

abstract cairn
#

ye but where is the button to enable it T_T

grizzled fulcrum
#

oh true that

bronze yoke
#

i think the button doesn't show up if you don't have git...?

#

this happened to someone else and i forgot what happened with that

grizzled fulcrum
#

Oh yep I remember that, yes you need git

abstract cairn
#

no way i dont have git no way

grizzled fulcrum
#

It's possible you have git but it's bundled with some random thing so it's not technically installed

bronze yoke
#

you don't actually need to use git or anything, you just need to install it since this uses it behind the scenes

grizzled fulcrum
#

ik that happened with me with gitkraken for a minute and I was questioning my sanity

abstract cairn
#

welp i just updated git but i think this is the issue but i also am literally going to go crazy

silent sky
#

hey guys anyone see this happen before i made this bag and noticed this when i joined multiplayer with my friend

#

have no idea how this is even possible

ebon dagger
abstract cairn
grizzled fulcrum
#

So you want to remove soemthing from ArrayList or from a lua table?

grizzled fulcrum
#

do you have the index of what you want to remove?

abstract cairn
#

yes

#

this is causing errors

#

AllCodeWordsArray is defined as this (with a lot of stuff in it)

grizzled fulcrum
#

is it possible at all for CodeTempNumber to be nil?

#

that should work, idk why it wouldn't

#

what is the error

#

but the similar equivalent to the table call is tbl[idx] = nil

abstract cairn
grizzled fulcrum
#

hmm weird

abstract cairn
#

line 63 hold on

grizzled fulcrum
#

if you have the error, pls post, if not just try using AllCodeWordsArray[CodeTempNumber] = nil

abstract cairn
#

function: AssignPrey -- file: MInit.lua line # 63 | MOD: Chops
function: onClientCommand -- file: MInit.lua line # 16 | MOD: Chops

ERROR: General , 1737614704595> 31,589,793,925> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in AssignPrey at KahluaUtil.fail line:82.
ERROR: General , 1737614704595> 31,589,793,926> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in AssignPrey
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
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.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:214)
at zombie.network.GameServer.receiveClientCommand(GameServer.java:4168)
at zombie.network.PacketTypes$PacketType.onServerPacket(PacketTypes.java:1022)
at zombie.network.GameServer.mainLoopDealWithNetData(GameServer.java:1532)
at zombie.network.GameServer.main(GameServer.java:800)
LOG : General , 1737614704597> 31,589,793,927> -----------------------------------------
STACK TRACE

function: AssignPrey -- file: MInit.lua line # 63 | MOD: Chops
function: onClientCommand -- file: MInit.lua line # 16 | MOD: Chops

grizzled fulcrum
#

and whats line 63

#

the AllCodeWordsArray removve thing?

abstract cairn
#

honestly

#

i could just rewrite it

#

maybe

#

would it be .remove?

grizzled fulcrum
#

I honestly can't say whjy that wouldn't work

#

either table.remove(tbl, idx) or tbl:remove(idx)

abstract cairn
grizzled fulcrum
#

though it's possible that maybe table.remove isn't in kahlua? (doubt)

abstract cairn
#

ill try the table.remove

grizzled fulcrum
#

basically it tried to call the remove() function but couldn't because the function didn't exist

abstract cairn
#

yeah ill try the table.remove ig n see if it gives errors still

tacit pebble
#

i could be wrong btw

abstract cairn
#

This works (PlayerArray is the ArrayList return from all players)

#

this doesnt work (both are tables)
[im trying the table.remove now]

tacit pebble
#

because getOnlinePlayers() returns arrayList?

grizzled fulcrum
grizzled fulcrum
#

it's just syntax sugar, table.remove(tbl, index) is the exact same as tbl:remove(index)

#

: just passes self as the first arg (in this case the table is itself)

abstract cairn
#

table.remove works now

#

gracias everyone

#

@grizzled fulcrum you carrying me lmao

grizzled fulcrum
#

but at least it works lol

bronze yoke
grizzled fulcrum
#

eh? I have done this all the time in the past to just normal {} tables

#

I thought tables inherit table functions by default, because I use them all the time like that

tacit pebble
bronze yoke
#

if true it would have to be kahlua specific but i really thought it wasn't true even in kahlua

grizzled fulcrum
#

tried it in an online lua interpreter and true it is nil

#

idk why that I can use it in pz though

tacit pebble
#

i don't know about tech but yeah i tried too and they just didn't work before,
and internet told me something about metatable and __index and blah blah lol
🤯

grizzled fulcrum
#

I might just be crazy

bronze yoke
#

you can do this with strings for some reason so maybe you're thinking of that?

grizzled fulcrum
#

it's probably beccause I don't use any table functions in the first place

#

just the equivalent of them basically

#

personally I think the tables should automatically inherit table functions, it kinda makes sense

bronze yoke
#

i feel like it'd be more annoying than anything

#

lookup tables would come with entries for the table library for example

grizzled fulcrum
#

true

tacit pebble
#

you don't have to post it both mod support channel and mod development channel

abstract cairn
#

calling this in the client is giving me errors (presumably with the playerRef being accurate to the local player)
is HaloTextHelper not global?

tacit pebble
#

when you print(playerRef) before halotexthelper, are they printed?
because HaloTextHelper is global as I'm aware?

abstract cairn
#

hold on let me look at error message

hot plinth
#

I am so damn confused, after some rewrites im getting an error in a recipe, after some attempts just getting the same error i decide to isolate it completely and remove the entire recipe file. But my zomboid keeps giving me the same error, how in the hell is it giving me the recipe code when the recipe doesnt exist anymore. Ive made sure the mod isnt in both mods & workshop and theres only 1 it could be loading. 😭

grizzled fulcrum
abstract cairn
#

Object tried to call nil

#

line 135

#

is AddBadText not something I can call

#

or is it supposed to be :AddBadtext

grizzled fulcrum
#

it is exposed, just checked

#

oh is this b42? then I have no clue

abstract cairn
#

i dont see addBadText

grizzled fulcrum
#

it's not in b41 either

abstract cairn
#

bro?

#

wha

#

where did

#

lmaO where did I get that from

tacit pebble
#

oh you are in b41?

abstract cairn
#

ye

#

its a mp mod

#

for mah servr

tacit pebble
#

it should be HaloTextHelper.addText(playerRef, text, HaloTextHelper.getColorRed())

abstract cairn
#

anyone know a good RGB value?

abstract cairn
abstract cairn
tacit pebble
abstract cairn
#

it works!
is there a way to make the duration of it longer?

tacit pebble
#

display twice? idk 😛

abstract cairn
#

are say's client side?

bronze yoke
#

yeah

abstract cairn
#

can I make the say's longer?
or rather is there a way to display a client-only message to the player for a duration?

#

or perhaps delay? (Im sending more than one message)
I could make a reminder to repeat the message thats linked to an event.

tacit pebble
#

repeating/delaying is able to be implemented without ui

abstract cairn
#

im gonna try to code something with the every 10 minutes logic

tranquil reef
#

Were sandbox values broken in some way this patch

#

Custom sandbox option is enabled, I check if it's true, it worked before. Now unless I comment out the if statement checking for the sandbox value, it just doesn't work

#

My character is also rotating weird, might be a buggy patch. Can't tell lol

tacit pebble
# abstract cairn how would I delay it i cant seem to find delays

oops accidently removed previous message.
I imagined this quick, not sure it's working but anyway,

function sayNow()
    HaloTextHelper.addText(getPlayer(), "Hello")
    Events.OnTick.Add(sayNotNow)
end


local Tick
function sayNotNow()

    if not Tick then
        Tick = 0
    end

    Tick = Tick + 1
    
    if Tick == 150 then
        HaloTextHelper.addText(getPlayer(), "GoodBye!")
        -- Or function you want to call

        Events.OnTick.Remove(sayNotNow)
        Tick = nil
    end
end
#

if you want to repeating then

  if Tick < 150 then
    HaloTextHelper.addText(getPlayer(), "Hello, I'm saying!")
  else
    Events.OnTick.Remove(sayNotNow)
    Tick = nil
  end
silent zealot
#

Do spawnpoint mods really need to return a list of different professions, or will it all default to "unemployed" if a specific profession isn't in the list?

#

(assuming the spawnpoint mod doesn't want to make use of profession-specific start locations)

bright fog
silent zealot
#

Quick test - I set up "unemployed" only, spawned a police officer, it worked.

#

1/7th of the effort for the same results.

#

Also, seems you can't put the map folder in 42 and it has to be in common.

dusty egret
#

local skin = InventoryItemFactory.CreateItem("base.example item") why not working structure

winter bolt
dusty egret
small topaz
#

yes. you can use local item = player:getWornItem(bodyLocation) where bodyLocation contains the string ID of the body location. Works for modded and vanilla body locations.

tacit pebble
#

if png outline is dirty(?), should I turn off anti-aliasing in photoshop?

#

sorry I don't have screenshot right now, I will upload later. I suddenly realized

vast pier
#

- Players with the speed demon trait will sometimes very rarely (1% of the time) spawn with a Speeding Ticket in their inventory.
This value feels too low

#

I feel like it should be like the profession items, basically guaranteed

#

- Rope belts that a character crafts should only provide one left hotbar slot.
yet there still isn't a way to spawn without a starting belt?

#

Would it be possible to make it so holsters need to be attached to a belt?
seems a bit silly to be able to just clip a holster to your skin

vast pier
#

- Fixed campfires being destroyable by fire.

#

fantastic bugs

ancient grail
#

anyone figured out the best way to make zeds ignore only specific player
dont wish to use setuseless or setTarget(nil)

bright fog
ancient grail
bright fog
#

None of these

#

I literally just don't have a solution

ancient grail
#

i have this idea

bright fog
#

Currently my go to to make blind Clickers is going to use Bandits's method of manually controlling the zombie

ancient grail
#

setvariable then change animation

#

since thats local

bright fog
ancient grail
#

maybe on the lunge
set the anim to idle

#

its for a trait
so it will still come near player with trait
will stop if it has the variable
(since lunge occur when player is near)
and if the target player doesnt have the trait remove the setvar

#

vould work right?

#

but question is
do i need to make all player setvariable

ancient grail
bright fog
steel moss
#

You know Silent Hill, how the monsters don't seem to bug characters like Laura who's completely safe within the game?

It's like that. It's for a personal mod to make PZ more like silent hill.

royal crest
#

ANY MOD FOR WALLHACK LOG (SHADOWS) TO GET DETECTION OF WHO IS USING IT?

burnt trench
#

is it possible to make client side mods or is that outside of the scope of what is possilbe

worn tendon
#

Hey all! I'm new to PZ Modding and was wondering how I can grab when an item is used/updated? I essentially want to do the following:

item is used - > trigger event that checks if it now contains or doesnt contain a liquid -> if it matches criteria, change its category

#

Thanks!

slim swan
#

is that any setting to show full about the left side XYZ location

bright fog
#

If you already know how to use Lua, you might actually not learn much

dull moss
#

is it possible to get a forage item category?
fore example, in shared\Foraging\Categories\WildPlants.lua

local function generateWildPlantsDefs()
    local itemDefs = {
        Violets = {
            type = "Base.Violets",
            minCount = 3,
            maxCount = 6,
            xp = 5,
            categories = { "WildPlants" },
...

Can I somehow from lua side pick up what forage category item is. I't tracking how many herps players picked up and currently it's hardcoded like this:

local original_forageSystem_addOrDropItems = forageSystem.addOrDropItems;
---Decorating forageSystem.addOrDropItems() here to insert ETW logic catching player picking up herbs while foraging
---@diagnostic disable-next-line: duplicate-set-field
function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems)
    if ETWCommonLogicChecks.HerbalistShouldExecute() and SBvars.TraitsLockSystemCanGainPositive then
        local player = getPlayer();
        local detailedDebug = detailedDebug();
        if not _discardItems then
            for item in iterList(_items) do
                local herbs = {
                    -- Medical herbs
                    "Base.Plantain",
                    "Base.Comfrey",
                    ...
                }
                for _, herb in pairs(herbs) do
                    if herb == item:getFullType() then
                        -- proceed with my logic here
#

and I want to avoid hardcoding it

bronze yoke
#

looks annoying, you'd probably have to parse them at launch and build a map

dull moss
#

ew

bright fog
#

You just want to detect herbs getting picked up right ?

dull moss
#

Medical herbs, Wild Plants, Wild Herbs

#

are 3 categoris that are counted to my counter

bright fog
#

I don't know about the WildPlants category, I'd suggest looking at how they set foraging zone as you might be able to directly pick up on items linked to that category

#

Something you could maybe do, is link to the context menu option or action of picking up

dull moss
#

I'm already decorating picking up foraged items

bright fog
#

As for the function you've shown, I don't know when it's called tbf

bright fog
dull moss
#

its called when u pick up foraged items

bright fog
#

You can't actually access the foraging icon item

#

Which might have the category info you're looking for

sly monolith
#

i'm trying to make new pants, I imported the base game model, edited it, exported the way it was when i imported it, but i get this error in game WARN : General f:743, t:1737657430583> AnimatedModel$AnimatedModelInstanceRenderData.initMatrixPalette> skinningData is null, matrixPalette may be invalid, it feels like it got imported wrong cuz the mesh isn't connected to the armature, but idk how that stuff works so yeah

dull moss
#

wdym by "foraging icon"

bright fog
dull moss
#

Why do I want an icon?

bright fog
#

That shows either "?" when player can't properly see the item, and that you can right click to forage

bright fog
#

That's how I did my hunting mod which detects if the foraged item are tracks and override the context menu options of it and the foraging action

#

HuntingMod.onFillSearchIconContextMenu = function(context, baseIcon)
    -- verify it's valid
    if not baseIcon or not context then return end

    -- verify it's a forage icon
    if baseIcon.iconClass ~= "forageIcon" then return end

    -- verify it's one of our items
    local itemType = baseIcon.itemType
    local animal = HuntingMod.ForageAnimalTracks[itemType]
    if not animal then return end

    HuntingMod.HandleIcon(context,baseIcon,animal)
end

Actually it might not give the WildHerb info you're looking for

#

But hey, might be an idea to explore who knows

bright fog
# ancient grail

Yea that's the lunge animation, I had managed to do something like that

dull moss
#

forageDefs are global actually

    for key, value in pairs(forageDefs) do
        if type(value) == "table" and value.type then
            print("Key:", key, "Type:", value.type)
        end
    end
Key:    Zucchini    Type:    Base.Zucchini
Key:    Corn    Type:    Base.Corn
Key:    Eggplant    Type:    Base.Eggplant
Key:    Leek    Type:    Base.Leek
Key:    Carrots    Type:    Base.Carrots
Key:    Broccoli    Type:    Base.Broccoli
Key:    Potato    Type:    Base.Potato
Key:    Cabbage    Type:    Base.Cabbage
Key:    Tomato    Type:    Base.Tomato
Key:    RedRadish    Type:    Base.RedRadish
Key:    Daikon    Type:    Base.Daikon
Key:    Peanuts    Type:    Base.Peanuts
Key:    Pumpkin    Type:    Base.Pumpkin
Key:    Violets    Type:    Base.Violets
Key:    SunflowerSeeds    Type:    Base.SunflowerSeeds
Key:    GrapeLeaves    Type:    Base.GrapeLeaves
Key:    Rosehips    Type:    Base.Rosehips
Key:    Acorn    Type:    Base.Acorn
Key:    Dandelions    Type:    Base.Dandelions
Key:    Nettles    Type:    Base.Nettles
Key:    GingerRoot    Type:    Base.GingerRoot
Key:    Thistle    Type:    Base.Thistle
bright fog
#

But I don't get why you'd take this approach if the zombie is supposed to completely ignore you

dull moss
#

kek

dull moss
#

yea theni can just fetch category from an item

#
        type = "Base.SawflyLarva",
        skill = 0,
        xp = 5,
        rainChance = 10,
        snowChance = -20,
        nightChance = 100,
        categories = { "Insects", "FishBait" },
        zones = {
            Forest      = 3,
            DeepForest  = 3,
            Vegitation  = 3,
            FarmLand    = 3,
            Farm        = 3,
            TrailerPark = 3,
            TownZone    = 3,
            ForagingNav = 3,
        },
        months = { 3, 4, 5, 6, 7, 8, 9, 10, 11 },
        malusMonths = { 3, 4 },
        forceOutside = false,
        canBeAboveFloor = true,
    },```
bright fog
#

Yeah, was the idea I gave before, thought you knew about these 😅

ancient grail
dull moss
#

it's literally what i was looking for, I was looking how to get all items in specific category

#

All I need to do is loop through forage defs once

#

lul

bright fog
#

Yikes

dull moss
#

when forage defs are generated? I'm thinking when its better to loop over them. will forage defs be ready before OnGameStart?

bright fog
#

I'm not sure

#

Check the file where they are defined

#

Things are getting setup in there I believe

dull moss
#

yea I looked it over but couldn't find

#

Eh whatever I'll jsut do it on gamestart and see if it works KekW

bright fog
#

That's when you need to add stuff to forage def

#

So you can go back to when it's called

#

You might actually just need to link to it too

errant bluff
#

Hi! I'm trying to register pushes ( and stomps but when I get the first one ) and I'm being guided by this:
https://pzwiki.net/wiki/IsoZombie#Zombie_taking_damage

For now it always detects me when I push a zombie but I want it to only detect it when the zombie starts the falling to the ground animation, so that it is successful. Would anyone know how to proceed?

#

I also looked at the existing animations in the game folder, but I don't see any that fit well ProjectZomboid\media\anims_X\Zombie

ancient grail
dull moss
#

HYPERS

Filtered Types Map:
Base.Basil
Base.Chives
Base.Cilantro
Base.Oregano
Base.Parsley
Base.Rosemary
Base.Sage
Base.Thyme
Base.Plantain
Base.Comfrey
Base.WildGarlic2
Base.CommonMallow
Base.LemonGrass
Base.BlackSage
Base.Ginseng
Base.Violets
Base.SunflowerSeeds
Base.GrapeLeaves
Base.Rosehips
Base.Acorn
Base.Dandelions
Base.Nettles
Base.GingerRoot
Base.Thistle
---Generates a list of herb types based on valid categories
local function generateHerbsList()
    local validCategories = { WildHerbs = true, WildPlants = true, MedicinalPlants = true };
    local filteredTypes = {};
    for key, value in pairs(forageDefs or {}) do
        if type(value) == "table" and value.type and value.categories then
            for _, category in ipairs(value.categories) do
                if validCategories[category] then
                    table.insert(filteredTypes, value.type);
                    break
                end
            end
        end
    end
    local filteredTypesMap = {}
    for _, herbType in ipairs(filteredTypes) do
        filteredTypesMap[herbType] = true;
    end
    print("Filtered Types Map:")
    for herbType, _ in pairs(filteredTypesMap) do
        print(herbType)
    end
    filteredForageHashMap = filteredTypesMap;
end
ancient grail
autumn garnet
bright fog
ancient grail
#

where? idk where bro
i thought youre the one handling the wiki when it comes to mod informations

bright fog
#

I am not the chief of it, I'm just here to serve as a lighthouse to modders to get their modding informations there

ancient grail
#

ah yes
but its harder to do the wiki
the resource are just links
but if you can create a list page that i can use to just add links then ye sure

bronze yoke
#

god please no the modding page is enough of a nightmare already

ancient grail
bright fog
bright fog
#

@ancient grail we can discuss more about it, but like the example that guy above sent, you can see the idea I've been trying to get informations stored about specific objects for example

#

If you aren't sure where to put stuff, you can ask me and we can figure it out

#

I've been wanting to go through your mod resource list one day, but if you want to contribute to the wiki, please go for it, ask me anything if you need help and stuff, don't hesitate to ask in #pzwiki_editing too for more general formatting stuff or how to do stuff on the wiki

#

Also check the wiki channel in the modding Discord

#

There's a bunch of pinned resources

bright fog
#

I still need to clean up the external links list at the bottom of the Modding page, but this is an example of what you should not do for example

true nimbus
#

Hello!
I tweaked an existing mod to add some useful features.
Since there's no "lockdown" mode or something, it's ok if i post it, right?

The mod is udderly cell file lister.
Sorry i don't know much about those posting rules

crystal canyon
#

this latest update making me want to play again mmm so many fixes

dull moss
#

so yes

ancient grail
#

@bright fog sure lets discuss it in the near future , rn ive got tons of shit to do ,but ill help you out whenever.
maybe provide a snippets page that are categorized by objects maybe or function?
like for example

#

local function clipAllFirearm()
    local result = ""
    local items = getScriptManager():getAllItems()
    for i=1, items:size() do
        local item = items:get(i-1)
        
        if item:getType() == Type.Weapon and item:isRanged() then   
            result = result .. tostring(item:getName()) .. "\n"            
        end
    end
    Clipboard.setClipboard(result);
    print(result)
    getPlayer():setHaloNote(tostring("open notepad and press ctrl + v"),150,250,150,900)
end
clipAllFirearm()
bright fog
#

ah yeah copy pasta stuff

#

Imo Clipboard should be a page, as it's an object, and explain how it can be used

#

For example

ancient grail
bronze yoke
#

we should be avoiding big list pages like the plague imo

#

everyone hates the modding page and its big list of links

bright fog
#

Agreed

bright fog
#

But yes

#

A bit list of things is bad

bright fog
#

For each tools

#

Depending on how big they are

dense gorge
#

is there a way to heal a survivor back to 100 without actually healing injuries?
player:getBodyDamage():setOverallBodyHealth(100); doesn't work.
i'm looking for a way to "reset" the time it takes for the survivor to die to said injuries

potent loom
#

looks like b41.1.1 broke addVehicleDebug and addVehicle functions. Vehicles spawn in wrong coordinates and the function no longer return spawned vehicle object

silent sky
#

Hey guys im trying to replace the modern vehicle with a honda civic any ideas how i can make this use my texture and not generate random colors

#

i have tried adjusting these here just keeps using the other texture

knotty stone
#

you are using the vehicle_moderncarshell this has alpha channel where the car has colors so the game randomizes that. u have to use a texture where the UV matches the texture

#

if you fill up the alpha channel with black all cars will be black

silent sky
#

i baked out a texture that matches the model

#

but it wont change

dull moss
#

hey, can someone confirm me something? in SP are there such things as server/client commands?
I know that both server and client load their stuff in SP on client but I'm wondering if commands are sent

silent sky
bronze yoke
#

client commands work, server commands don't

dull moss
#

so client sending commands -> server receiving them -> work
server sending commands -> client recieving them -> doesn't work
right?

knotty stone
#

@silent sky the grey checker

silent sky
#

i have replaced that whole texture withmine and it does not take

knotty stone
#

the uv matches?

silent sky
#

yeah

knotty stone
#

hm

dull moss
#

also I'd recommend #modeling, this is more for coding stuff

hard nova
#

What if there was a moodle mod that after you read an adult magazine, you get a (redacted) status

#

I need something like that for my Chris Chan character

dull moss
hard nova
#

ITS FOR CHRIS CHAN

#

MY NAME IS NOT IAN BRANDON SOMETHING

dull moss
bronze yoke
#

yeah

dull moss
#

I see

#

hmm

#

does it mean that if I have server-side code that sends commands back to client it should be structured like

function a()
  -- some server stuff here
  if SP then
    -- SP code here as if it was a client file
  else
    -- send command to client
  end
end
bronze yoke
#

yeah probably

dull moss
#

hmm

#

cheers

bronze yoke
#

i have in the past called the command handler directly to try and imitate the mp structure as much as possible

dull moss
#

can you provide a snippet pls? flushge

bronze yoke
#

like```lua
local sendCommand = function(command, args)
if isServer() then
sendServerCommand("MyModule", command, args)
else
local MyClientModule = require("MyClientModule")
MyClientModule.onServerCommand("MyModule", command, args)
end
end

dull moss
#

Oh that's much better than my stuff KekW

dull moss
distant inlet
#

hi all, is anyone set up to remote exec lua commands into a locally running PZ client? I'd like to easily test methods to learn more quickly

bronze yoke
#

@frank elbow if you need it for something specific, you could actually get the contained object in a ClickObject with the field reflection api, it doesn't rely on exposure

frank elbow
bronze yoke
#

i'm sure field access will lead to a vulnerability eventually and that's why they don't want it to work outside of debug but i haven't found one yet so i'll just remain thankful for it

fading horizon
#

Does blocking a user on steam prevent them from accessing your mods?

#

How do I blacklist a user from ever interacting with my mods again because I'm tired of dealing with them?

cursive pilot
#

Guys, can anyone give me some technical help

#

Garrett seems to have left out the new head condition Settings

cursive pilot
#

I need to add the HEAD CONDITION to the module file

astral lake
#

Hi all so Im trying to change some building recipes like small drying rack to be more wilderness survival friendly and not use nails, and i ran to this issiue that materials get consumed yet entity doesnt spawn any ideas where to look for possible fixes? (Build 42.1)

cursive pilot
tranquil reef
#

did 42.1 or 42.1.1 fix the animset problems?

vast pier
#

Is there a way to force the player to unequip an item using lua?

#

Deleting the belt from the player on game start deletes the item, but the game still thinks it's equipped so you have the belt slots still

bronze yoke
#

character:removeWornItem(item)

vast pier
# bronze yoke ``character:removeWornItem(item)``
function: RemoveBeltOnStart -- file: Beltless.lua line # 4 | MOD: No Bel On Spawn
function: OnNewGame -- file: Beltless.lua line # 10 | MOD: No Bel On Spawn
java.lang.RuntimeException: attempted index: removeWornItem of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:624)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1790)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:81)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:364)
    at zombie.iso.IsoWorld.init(IsoWorld.java:3117)
    at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:301)
    at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:251)
    at java.base/java.lang.Thread.run(Unknown Source)

Am I using this wrong?

    local inv = player:getInventory();
    local BeltItem = inv:getItemFromType("Base.Belt2")
    character:removeWornItem(BeltItem)
    inv:DoRemoveItem(BeltItem)
end

local function OnNewGame(player)
    if player:getHoursSurvived() == 0 then    
        RemoveBeltOnStart(player)
    end
end

Events.OnNewGame.Add(OnNewGame);```
bronze yoke
#

your variable is player so it should be player:removeWornItem(BeltItem)

tacit pebble
#

character:removeWornItem(BeltItem) -> player:removeWornItem(BeltItem)

vast pier
#

worked, thanks 👍

#

Unrelated, but like.
The firefighter pants clearly have a belt built into them, why do they not take up belt slot + give belt attachments?

tacit pebble
#

PZ logic

vast pier
#

Are there any other pants like that?

#

could be a neat lil mod

#

would be one less thing taking up carry weight, even if it's only 0.06

silent zealot
#

Also, probably because it would be a hassle to have to re-equip hotbar items every time you change pants.

vast pier
#

I mean sure but I was more specifically meaning why do the ones that have it visually not take up the belt slot AND have the same belt attachment slots

#

Not all pants have belts visually

vast pier
#

how do I go about making an item take up multiple equip slots?
Do I have to define it or can I assign multiple equip types at once

#

I wanna make it so firefighter pants take up its normal pants slot and also the belt slot

bronze yoke
#

you have to define a new body location that's incompatible with both of them

vast pier
#

how would I go about doing that

bronze yoke
#
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation("MyLocation")
group:setExclusive("MyLocation", "OtherLocation")
```etc
#

you'll probably have to copy every location the originals are mutually exclusive with too

vast pier
#

Is there a file where this info is visible or is it hard coded

bronze yoke
#

it's all done in a lua file

#

i don't remember where but searching for BodyLocations.getGroup("Human") will probably bring you to it

tacit pebble
#

NPC folder maybe?

vast pier
#
    local inv = player:getInventory();
    local BeltPantSlot = player:getWornItem("BeltPants");
    local BeltItem = inv:getItemFromType("Base.Belt2")
    if BeltPantSlot == "Base.Trousers_Fireman" then
        player:removeWornItem(BeltItem)
        inv:DoRemoveItem(BeltItem)
    end
end

local function OnNewGame(player)
    if player:getHoursSurvived() == 0 then    
        RemoveBeltOnStart(player)
    end
end

Events.OnNewGame.Add(OnNewGame);```
Haven't run this script yet, any glaring issues that may come up?
#

easier to read like this

#

I'm still learning this, so catching any issues before they happen could help my understanding

#

Hmm no error spit out, but I think that's just because the player doesn't automatically equip the pants due to a conflict with the belt. Guess I'll need it to check inventory instead, and then force wear the pants

tacit pebble
#

just a question, shouldn't it be like this if you want to compare item by type?

local BeltPantSlot = player:getWornItem("BeltPants"):getFullType()
vast pier
#

I have no idea what I'm doing

#

idk what the difference would be

#

I want it to check player inventory for the pants, if they exist, delete belt2 and equip the pants

#

I already know the OnNewGame function works fine

tacit pebble
vast pier
#

I do not understand

tacit pebble
#

sorry my bad,
while you worn fireman pants,
and when you fired function,
function can remove belt?

abstract cairn
#

Not for my mod, asking for a friend
Is there a way to change the speed of the animation of zombies so they are faster?

vast pier
#

I need to check the inventory for the pants since belt takes equip priority on game start

teal glacier
#

Yo guys do you know a good minimap mod (tried eris but it seem broken)

vast pier
#

Isn't minimap just a sandbox option in vanilla?

teal glacier
#

Yeah but better hud

#

Aight thx

vast pier
#

Really if I can just get it so it forces you to equip the item from your inventory, I could just make it so it always deletes the belt since so many pants types have visible belts anyway

#

equipping the item is priority

tacit pebble
vast pier
#

Still need to be able to check for the item

#

I think

tacit pebble
#
local item = getPlayer():getInventory():getItemFromType("Base.Trousers_Fireman")
getPlayer():setWornItem("bodyLocation", item)

maybe? sorry i always say "maybe" :/
i always can't be sure for what i haven't done before.

#

oh you've already done once before with BeltItem

vast pier
#

oml you're right lmao

#

haha

tacit pebble
#

was I right..? I actually have no idea what I'm talking about 🤣 most confused conversation ever.🤣

gaunt leaf
#

Hello 👋 Iam considering making a mod. Planning custom items (Weapons/Clothing) but Iam totally new to this, Iam seeking some informations about what tools I might need to do this.

tacit pebble
dull moss
abstract cairn
#

Line 61 is throwing this error. Thoughts?

I think im missing a few required lines, im gonna see if that fixes it

tacit pebble
#

what is the ISWorldMap_instance?

abstract cairn
vast pier
#
    local HasFirePants = getPlayer():getInventory():getItemFromType("Base.Trousers_Fireman")
    return HasFirePants;
end

local function RemoveBeltOnStart(player)    
    local inv = player:getInventory();
    local BeltItem = inv:getItemFromType("Base.Belt2")
    local FirePants = inv:getItemFromType("Base.Trousers_Fireman")
    if HasFirePants(true) then
        player:removeWornItem(BeltItem)
        inv:DoRemoveItem(BeltItem)
        player:setWornItem("BeltPants",FirePants)
    end
end

local function OnNewGame(player)
    if player:getHoursSurvived() == 0 then    
        RemoveBeltOnStart(player)
    end
end

Events.OnNewGame.Add(OnNewGame);```
This script will check the player's inventory for the firefighter pants. If the item is in the player inventory when spawning in, it will delete the starting belt, and equip the pants.
tacit pebble
abstract cairn
tacit pebble
#

bottom left, there's a small window and you can type it directly

abstract cairn
#

says nil

#

but

#

when I open the map and then do it

#

its not

tacit pebble
#

when your function is called then? i mean, error will pop-up if you called your function when you are not watching worldmap

abstract cairn
#

It's supposed to get called on a timer... i might see if it works without world map open IF ive already opened the worldmap

abstract cairn
# abstract cairn

well it doesnt give an error after its no longer nil which is good

#

but now im getting error further into the logic (but again the line isnt giving errors now...)

tacit pebble
#

oh so they seems to be cached after open worldmap

inner coral
#

hey everyone, i’m interested in starting mod development for project zomboid. i was curious how easy it is to test the mods you make. do i have to keep uploading a new version of the mod to my game each time i wanna try something or is there a more convenient way to test/debug?

inner coral
#

i’m planning on messing with how long it takes to do stuff like open cans etc

abstract cairn
#

If your making something like I am which inherently involves a multiplayer dedicated server, then yes you need to upload it to the workshop to test it fully

Most mods can be done locally in singleplayer though, and you can reload your lua files mid game.

#

Theres a few good starter things on how you debug/test it on youtube I believe one is by Blackbeard and the other is someone who made the dried meats mod

tacit pebble
#

then maybe just add a nil check like

local function myfunction()
  local symbolAPI
  if ISWorldMap_instance then
    symbolAPI = ISWorldMap_instance.java..blahblah...:getSymbolAPI()
  else
    return
  end
end
abstract cairn
#

nil check that just tells the person "Hey open your map or else it wont work lmao"

inner coral
#

oh okay nice. reloading midgame is insane. do you setup a custom game setting with like no zombies or something for best testing? i just wanna get it setup to test as easy as possible for development

abstract cairn
abstract cairn
tacit pebble
tacit pebble
abstract cairn
#

well it works for now

#

this is giving me a client side error but doesnt break the game

#

i dunno how to remove the symbol from the map

#

oh wait

#

Line 100 giving this error as well

#

for reference this is what PingData is

#

omg it was a typo lmao

#

PingDataArry instead of PingDataArray lmao

#

ima see if it works now lmao

ancient grail
#

@bright fog i had this idea
we probably need a page (not just for modders)
to be able to determine errors and use the debug panels error thing
perhaps teach how to open the error, cloee the panel, use the search box and the buttons

if theres no guide yet

tranquil reef
#

is it possible to make traits depend on sandbox options

#

like one doesn't show in the creation menu unless you have it enabled in sandbox

sweet mural
#

does anyone know how i would make a sprinter slightly faster, going past the sandbox settings speed

abstract cairn
#

Well it removes some of them...
It gives me a null value and doesn't remove all of them. Thoughts? Might be the remove function.

bronze yoke
#

loop backwards instead with for i = symbolApi:getSymbolCount() - 1, 0, -1 do

#

when you are removing things from the list you're looping over you should always do this as removal causes the list to change size + indexes of individual elements shift

abstract cairn
#

but im worried the RemoveSymbolByIndex doesnt actually shift it... but we'll see

trim quartz
#

Hi all, should I be able to render an icon / texture on a scrolling list box?

Everything seems good, but it doesn't draw and the error counts flys up but never actually breaks out to the debug windows

I assume that means something is breaking in the java side?

#

I should mention I'm attempting the icon render in an overloaded version of doDrawItem

vast pier
#

Is there a way to get a list of every item in your inventory using the debug menu?

abstract cairn
#

These are throwing errors now (I am SO close to finally fully functional) [(thank you albion when you read this, it fixed it flawlessly ^-^)]

abstract cairn
vast pier
vast pier
abstract cairn
#

maybe (I'm looking to see if that would work in the docs lol)

#

that should work maybe

trim quartz
#

ScriptManager is your friend on that one

abstract cairn
#

it implements getInventory

vast pier
abstract cairn
#

you got an error from printing in debug?

vast pier
#

yes

abstract cairn
#

I didnt...

#

print(getPlayer():getInventory())

#

bottom left command console

#

print(getPlayer():getInventory():getItems())

abstract cairn
vast pier
#
function: DoLuaDebuggerOnBreak -- file: LuaDebugger.lua line # 95 | Vanilla
java.lang.RuntimeException: Object tried to call nil in new
    at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1760)
    at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
    at zombie.ui.UIManager.debugBreakpoint(UIManager.java:1516)
    at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:79)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1760)
    at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
    at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
    at zombie.ui.UIDebugConsole.ProcessCommand(UIDebugConsole.java:421)
    at zombie.ui.UITextBox2.onKeyEnter(UITextBox2.java:1141)
    at zombie.core.Core.updateKeyboardAux(Core.java:2524)
    at zombie.core.Core.updateKeyboard(Core.java:2690)
    at zombie.core.Core.DoFrameReady(Core.java:3706)
    at zombie.GameWindow.frameStep(GameWindow.java:949)
    at zombie.GameWindow.run_ez(GameWindow.java:814)
    at zombie.GameWindow.mainThread(GameWindow.java:615)
    at java.base/java.lang.Thread.run(Unknown Source)
abstract cairn
#

whats line 141

sweet mural
vast pier
#

Dawg I don't know what happened to my game, I don't think this is related

#

I can't open the main menu lmao

#

gonna restart my game

#

might be related to errormagnifier

silent zealot
#

Recipe breaking parser?

vast pier
#

Would there be an easy way to loop a function for every item in a list?

#

instead of copy pasting the function for every single instance?

abstract cairn
#

if its one you got from the game IE arraylist from the :getinventory then you need to do something different

#

but yes you can do a for loop, hold ill find an example

vast pier
#
    "Base.Trousers_ArmyService",
    "Base.Trousers_Black",
    "Base.Trousers_Chef",
    "Base.Trousers_SantaGreen",
    "Base.Trousers_HuntingCamo",
    "Base.Trousers_NavyBlue",
    "Base.Trousers_Police",
    "Base.Trousers_PoliceGrey",
    "Base.Trousers_PrisonGuard",
    "Base.Trousers_Ranger",
    "Base.Trousers_Santa",
    "Base.Trousers_Sheriff",
    "Base.Trousers_SuitWhite",
    "Base.Trousers_SuitTEXTURE",
    "Base.Trousers_Suit",
    "Base.Trousers_SuitWhite_White",
    "Base.Trousers_Fireman",
    "Base.Ghillie_Trousers",
    "Base.Trousers_LeatherBlack",
    "Base.TrousersMesh_Leather",
    "Base.Trousers_CamoDesertNew",
    "Base.Trousers_CamoDesert",
    "Base.Trousers_CamoMilius",
    "Base.Trousers_CamoGreen",
    "Base.Trousers_OliveDrab",
    "Base.Trousers_CamoTigerStripe",
    "Base.Trousers_CamoUrban",
    "Base.Shorts_CamoDesertNewLong",
    "Base.Shorts_CamoMiliusLong",
    "Base.Shorts_CamoGreenLong",
    "Base.Shorts_OliveDrabLong",
    "Base.Shorts_CamoTigerStripeLong",
    "Base.Shorts_CamoUrbanLong",
    "Base.Trousers_WhiteTEXTURE",
    "Base.Trousers_WhiteTINT",
    "Base.Shorts_ShortFormal"
}```
#

?

abstract cairn
#

as in you made the list

#

in lua

#

yeah you can just do something like this

#

the # indicates the size of the array

#

so you start at 1 (IE Base.Trousers_ArmyService) and then go up to the max size [however many items that is, which would be Base.Shorts_ShortFormal as the last one]

#

so to get it, inside the loop it would be like

PingDataArray[i]

#

for i=1, #ExampleArray do
ExampleArray[i] -- insert rest of code you want to do with that thing in the list, ExampleArray[1] == "Base.Trousers_ArmyService"
end
[this is for arrays you make though]

vast pier
#

yeah I converted the printout from console into the local list I printed above

abstract cairn
#

then you should be able to do this to go through each one of those in the list and do whatever you want to do with them ^-^

vast pier
#

change all occurances is such a time saver

abstract cairn
#

Does anyone here happen to know why it's not making a new symbol? I'm not getting any errors but its not appearing where my player is

vast pier
abstract cairn
#

Ive never done this stuff before but what is the list of strings you have beforehand used for?

#

like the "Base.Trousers_ArmyService" right

vast pier
#

Yeah I edited the above text to show better.

abstract cairn
vast pier
#

Sorry I'm having trouble understanding with the way that's worded

silent zealot
#

I feel this violates several coding best practices...

abstract cairn
# vast pier Sorry I'm having trouble understanding with the way that's worded

So
local pantswithbelt = {} -- [your list here]
for i=1, #pantswithbelt do -- this gets the amount of items in pantswithbelt, and then does the code below that amount of times
ItemName = pantswithbelt[i] -- this would be getting each item from the list one at a time
local item = ScriptManager.instance:getItem(ItemName) -- the variable ItemName references the pantswithbelt[i] which is the individual item in the list, and is a string
if item then
item:Load(item:getName(),
[[{

        BodyLocation = BeltPants,
        AttachmentsProvided = SmallBeltLeft;SmallBeltRight,

        }]])
    end

end

[this is for arrays you make though, as #Pantswithbelt wouldn't work for arrays given by the game, as well as they would start at 0]

abstract cairn
silent zealot
#

This is how I handle doing something for each element in lua:

For each syntax ("for i=1, #things do","for k,v in things do", "for k,v, in ipairs(things) do", "for i=0, things:size()-1 do") {try loop syntax; if (code works) then break;}

#

I can almost never figure out which one to use without trial and error.

abstract cairn
#

im only saying this with confidence since i just spent the past few days fixing my code cause ive been doing the same thing lmao

silent zealot
#

I think that's the root problem - lack of clarity in Zomboid code which type of thing you have.

abstract cairn
#

docs are op (and also coolfish + albion)

silent zealot
#

I mean, you have a table.

#

You always have a table. Everything is a table.

abstract cairn
#

im going to see if I can just add a symbol at 0 0

silent zealot
#

Is the code inside if IsWorldMap_instance 100% for certain getting called?

abstract cairn
#

the print was working

#

the symbol was just not appearing on the map... or at least not where I intended (on my player)

tacit pebble
#

Does anyone have Idea why outlines are ugly?
(sorry for that code was captured, Discord won't let me upload code directly, idk why)

abstract cairn
#

the UI?

tacit pebble
abstract cairn
#

are those moodles or custom made UI

tacit pebble
abstract cairn
abstract cairn
#

you might want to add a feather to it since its likely not being feathered already

#

like to the textures I mean

#

I also don't see what you mean might want to circle it

#

cause i dont see anything that looks bad... lmao

tacit pebble
soft hornet
abstract cairn
tacit pebble
#

bigger: 96x96
smaller: 64x64

#

I'm just wondering if I'm doing wrong or it's just a limit of modification

abstract cairn
#

so how big is your game res?

tacit pebble
#

I think it's most common resolution for gamer still?

#

or I'm too old XD

tacit pebble
abstract cairn
#

making the icons higher res that is.

#

There is also a chance that the UI for the left one is being scaled up differently

#

without feathering

#

like uh

#

your UI might be scaled with interpolation

#

the other UI might not

#

hence clean pixel edges

#

on theirs and weird soft blurry on yours

#

solution might be just to make higher res icons so when it scales it, it has more data to work with and less interpolation

abstract cairn
#

Why is this returning 0
im trying to get the worldX and worldY so i can convert it into the pingmap stuff

#

PlayerIsoCell:getWorldX is giving a 0/y is too

silent zealot
#

How can I spawn a car facing a particular direction, or turn a car after it is spawned? the global addVehicle() only has co-ordinates, no facing parameter.

#

And I can't find an obvious "setDirection" type thingy for a Vehicle

#

I'm hoping it's not in BaseVehicle.QuaternionfObjectPool because Quaterions can %$#^@! off. I've not dealt with them since screwing around in Second Life.

silent zealot
#

found it - obviously you have to use the addvehicle function with "Debug" in the name.

#

local car = addVehicleDebug("Base.SUV", IsoDirections.N, nil, getCell():getGridSquare(13270, 5439, 0));

grizzled fulcrum
#

Try using IsoCell.getWidth() and IsoCell.getHeight() for XY values

split summit
#

Hi, having a problem right now with the mods folder in pz, I add my mod to test in there but there is no mods showing up on the menu when I boot the game, even tho the mod.info and the folder is all correct

#

did anyone ever had this problem before?

ancient grail
tacit pebble
#

so if all of mods are gone, the issue could be from mod.info parameters

split summit
#

Folder name Stalkertraits

#

is just a custom trait mod for our server wip, but I'm following the same concept of all the other traits that we worked on, but now the game menu doesn't show the mods anymore, only the ones from workshop, I already tried to reinstall the game fully

split summit
#

Yes yes

tacit pebble
# split summit Yes yes

my bad I should ask this at first, sorry to say this but I have no ideas if you are on B41 and if it's server. I have no experience with mp

split summit
#

I mean, I am testing on my game first, not on server yet

#

the mod still wip, but I want to test some stuff and not even shows up on the menu

tacit pebble
#

but still not sure if mod.info caused same issue on b41.
in b42, if mods are gone, then mostly mod.info issue

#

anyway let me search which parameter is nacassary in b41

split summit
#

I know right, should be mod.info, but everything seems right uff, I always get crazy over this small stuff keeps bugging

#

@tacit pebble Idk man, I just closed and opened my steam and it's showing up now lmao

split summit
#

yeah, I spent like an hour

#

getting crazy

#

Well thanks for the help, you are like a godsend, already helped me 3 times just this week

tacit pebble
trim yacht
#

Any suggestions on how to efficiently identify if a player is within a couple squares of my custom object without checking every OnPlayerMove? I am wanting to highlight the front square much in the same way vehicles do with doors/hoods

main pasture
tacit pebble
main pasture
main pasture
round thorn
#

So Ive been thinking that with the new crafting system there is something that is missing, there is no way to set a crafting project and give it an extended duration to completion. all crafts are done while the player is in the UI, within a minute or so at most. An example of the issue is say firing pottery in a kiln, that should take 30 minutes to an hour in game. the player should be able to start it, go do other things then be back in time to finish it, kind of like cooking, or say drying grass, its not something that should be completed instantly, the player should put it on a rack and come back half a day later or so and it be dry. I don't think we have any tools to do this kind of crafting.

trim yacht
round thorn
#

Not sure if we could highjack the oven logic, and use that as a way to have some crafting take significant time.

silent zealot
main pasture
silent zealot
round thorn
#

Yeah thats the only solution I can think of.

silent zealot
#

Put wet hide on drying rack and it dries, put logs in charcoal pit and let them cook to charcoal, etv

round thorn
#

exactly, I think its a major missing part of the crafting system, things being completed near instantly is weird.

silent zealot
#

this is limited to one input -> one output, but a pre-cooking recipe to make a "raw" item is fine

#

I'd like to know if they are already working on something like that, I hope so

round thorn
#

that too. and we wont know for sure unless they say something, they never have been the best at answering questions.

silent zealot
#

I don't blame them, if they said "were working on that and exist to have it out early february" people will yell for it being late on Feb 2nd, people will yell if the feature is delayed, people will yell if I'd didn't turn the way they thought it would work, people will yell they should be coding NPCs instead....

round thorn
#

well yeah, should never give dates.

silent zealot
#

"Soon, but on a geological time scale"

round thorn
#

They also seem to take queues from the mod scene, so if something was made a mod and people like it, it could inspire them to add it to the base game, has happened many times already.

tranquil reef
#

anyone know if it's actually impossible

#

or if he was just unaware of something

bright fog
#

No idea

winter bolt
# tranquil reef

it should be possible to add an OnCreate function to the item that sets the texture index to whichever one you want

#

actually nvm i forgot you'd need to make a new item for that anyway lol

tranquil reef
#

Luckily what I'm doing is gross and a loophole, so I need to create a new item anyway

dull moss
#

+11 MB mod size but whatever PepeLaugh

round thorn
#

I wish we had a lot more traits that did things instead of just give skill points.

dull moss
#

Those require a lot of additional coding PepeLaugh

round thorn
#

well yeah. but they are far more interesting.

#

@dull moss ah man, not sure if you knew, but Evolving traits seems to totally break More Traits.

dull moss
#

how

round thorn
#

I am using part of More Traits that modifies the default carry weight, as soon as I activated Evolving Traits, it boke it and reverted it to the default values.

dull moss
#

i havent touched more traits yet, I'll look into it

round thorn
#

Which means it probably breaks Packmule and Packmouse as well.

#

More Traits has some really interesting things in it, basically very vew skill point related ones, or maybe even none, I can't recall.

winter bolt
dull moss
#

ye

ornate sand
#

I'd really recommend using .ogg instead

winter bolt
#

ogg cuts the file size by an insane amount

#

i had a sound mod go from 25mb wav to 2.5mb ogg

ornate sand
#

Oh yeah and I had a True Music mod for B41 that was 1 gb in .ogg
I don't even want to know what it would've been in .wav
10 gb at least.

mint hawk
#

Would it be possible to make wooden buckets (and other buckets I guess) behave in the same ways sacks do?

round thorn
mint hawk
bright fog
mint hawk
#

Is there an easy way to see what file an item is in? For example I'm looking at the items text files ot find where the buckets are listed?

ornate sand
#

And use the PZ media folder as your workstation.
Then search for what you want in scripts

mint hawk
#

Ah yea I wasn't sure if PZ had a way of showing it in debug or not

#

Kate has a search function that does the same thing so that's cool

outer sail
#

hi, i don't have any prior experience with lua or modding, but i'd like to know if anyone could give me some pointers on how to make an image appear when the jumpscare event is triggered? i haven't found any mods on it.

dull moss
bright fog
#

Nice !

hot plinth
#

Ima put this question in mapping since its kinda half related to both but probably more likely to be known there. xD

main pasture
# outer sail hi, i don't have any prior experience with lua or modding, but i'd like to know ...

Hi. It seems the jump scare is done completely in java, and doesn't trigger lua events. This might be the reason there are no mods for it as it complicates it a lot.

I think your options are:

  1. Implement a jump scare yourself that plays the same, or other sound and shows the image (not very easy to do convincingly, but you can get at least most of the required stats for it with lua)

  2. Make a java mod and edit how the jump scare works or an add event for it (harder to make than a lua mod and cannot be installed (automatically) from workshop)

#
//IsoPlayer.java
public void updateLOS() {
    - -
    if (this.isAlive() && var9 > 0 && this.stats.LastVeryCloseZombies == 0 && this.stats.NumVisibleZombies > 0 && this.stats.LastNumVisibleZombies == 0 && this.timeSinceLastStab >= 600.0F) {
        this.timeSinceLastStab = 0.0F;
        long var24 = this.getEmitter().playSoundImpl("ZombieSurprisedPlayer", (IsoObject)null);
        this.getEmitter().setVolume(var24, (float)Core.getInstance().getOptionJumpScareVolume() / 10.0F);
    }
    - -
}```
bronze yoke
#

since it uses timeSinceLastStab to rate limit the jumpscares, you could periodically check that - if it was over 600 last time you checked, and it's under 600 now, a jumpscare has happened

main pasture
#

Nice. Didn't think about that, so didn't include more of the code. This might cause some issues if (this.stats.NumVisibleZombies > 0) { this.timeSinceLastStab = 0.0F; } I quess you still have to do some checks, otherwise can't know if the reset was caused by the jump scare or not

outer sail
#

i'll see what I can do with the very, very limited knowledge I have. it's just a little mod to scare my friends so it doesnt need to be lua necessarily. thank you for the help.

astral flower
#

There is any mod upcoming in 42 about the "light"? like connecting Lamp Post to the generator or making a lamp pillar?

#

without batteries

long beacon
#

I'm doing a retexture of the base-game coveralls for a project, what files/lines of code would I need to put in my mod folder besides the obvious texture and model?

#

I think it's referred to as boilersuit in the files

true plinth
long beacon
bright fog
#

Didn't see you mean scripts

bright fog
#

Zed Script

#

I will test your extension however

#

And link it in that wiki page

winter bolt
#

if youre just using the normal model you dont need to include it

bright fog
#

Cloned it, but how do I actually activate it in VSCode ?

keen fog
#

Hi, I would like to know more about mod dev, I would like to know the ultra basics to create a very simple mod

#

feel free to dm me

severe tundra
#

Does anyone know how to use the britas weapon pack claymores on remote mode

true plinth
bright fog
#

Bash commands ?

#

I'm not familiar at all with compiling this kind of stuff

true plinth
#

bash command or git bash command, you must check if npm/node is installed on your workstation.
But if you are not sure, wait for the official extension 😄

bright fog
#

The commands are not recognized, so I'll probably not go to the effort of doing things to compile ityea

#

Make sure to tell me about it whenever it gets in the extension market so I can test it out and link it in the wiki

severe tundra
#

Does anyone know how to use the britas weapon pack claymores on remote mode

main pasture
#

Here is a very basic mod that does a image and sound jump scare using timeSinceLastStab that albion suggested (with an additional timer). Do what you want with it (Tested only with B42)

dull moss
#

like -80% size lmao

bronze yoke
#

it's less how good ogg is and the fact that wav is literally uncompressed audio with a header lol

dull moss
ornate sand
dull moss
#

from 11mb to 780 kb

night pagoda
#

Hi there, I'm hoping this is the right place to ask this. I've been playing B42 splitscreen with my boyfriend (we know it's not officially supported) and we want to turn off sleeping because it's just a pain with speed controls disabled. We found a mod that does that but it only half works in splitscreen. It works for Player 1 until Player 2 joins and then it only works for Player 2. So I'm trying to edit it to work for multiple players. Here's the original code:

    local player = getPlayer()
    local stats = player:getStats()
    
    stats:setFatigue(0)
end

Events.EveryOneMinute.Add(EveryOneMinute)```
And here's my attempt to fix it:
```local function EveryOneMinute()
    local numActivePlayers = getNumActivePlayers()
    for i = 0,  numActivePlayers - 1 do

        local player = getPlayer(i)
        local stats = player:getStats()
    
        stats:setFatigue(0)
    end
end

Events.EveryOneMinute.Add(EveryOneMinute)```
It still only works for one player at a time but I feel like I'm close. Can anyone help me with what I'm missing?
bronze yoke
#

use getSpecificPlayer(i) instead of getPlayer(i)

dull moss
#

did they remove sandbox option to disable sleeping?

#

or is that MP only?

bronze yoke
#

that was a server setting yeah

dull moss
#

Ah I see

wind lance
#

Are there any modders who are familar with item and recipe modding that I could ask a question? I'm trying to get change an existing recipe and make part of the inputs 4 twine or 1 rope. Im not very experience so any knowledge or would help

oak hornet
#

So... is the getPerk() and getAmount() of xp_award still locked?

#

I still have no luck getting through

candid egret
#

I was wondering why my moodle mod wasn't functioning. Then I realized that the devs changed the Moodles file structure. This is kind of a pain for me insult

#

i feel sorry for every other dev too. 5 different moodle size folders??

outer crypt
#

Should this work? If I create and item with this: DisplayCategory = TMSBrains, and Category = TMSBrains, with a sprite that is a container to allow these items if I set it to: braintank:getItemContainer():setOnlyAcceptCategory("TMSBrains")

#

I have tried setting the category and getting it from the container and it prints the right category, but when I set it, it allows nothing into it afterwards.

outer crypt
#

I see, even with Category and DisplayCategory set in the item a getCategory() of the item returns "Item"not "TMSBrains"

outer crypt
winter bolt
#

im not sure

#

you should definitely be able to do it with tags though

#

money has the "FitsWallet" tag

outer crypt
#

The problem is that the object is a sprite originally not a container item to carry.

#

so if I set the Type=Normal and look at getCategory() despite setting a category it shows "Item" and if i change the Type=Food then the getCategory() is "Food". If I set setOnlyAcceptCategory() on the sprite container to Item or Food in this instance then it accepts those items. So I am guessing it is linking the item Type to the setOnlyAcceptCategory() ...

#

I had hoped setOnlyAcceptCategory() would look at whatever I added in the item with Category = or DisplayCategory =

#

or Type = overrides the category setting

winter bolt
#

type and category are hardcoded since theyre the actual item classes i think

outer crypt
#

so I guess I wouldn't be able to make a unique item to fit in the container with the setOnlyAcceptCategory() variable then...

#

I could track when items are added to the container and refuse based on the FullType(). I was just trying to avoid decorating the transfer commands

winter bolt
#

you should be able to just doParam AcceptItemFunction onto the item i think?

#

ScriptManager.instance:getItem(Name):DoParam("AcceptItemFunction = AcceptItemFunction.Wallet")

#

then replace the function with your own

outer crypt
#

or maybe this OnItemMoved

sly ivy
#

heya, sorry, im nearly fully done on my mod, just a little confused by the "WeaponSprite" part of rifle coding

#

is it the icon? model?
also, is the "mesh" the UV_wrap?

bronze yoke
#

it's the model

sly ivy
#

thank you!

red tiger
#

@main pasture Your pfp gives me anxiety and childhood nostalgia

#

#NetScapeGangGang

sly ivy
#

anybody know an example mod for a good start to creating an ammo type for a mod?

silent zealot
#

Do you mean a new ammo type for a new gun, or are you wanting to do something fancy like give the option of using more than one ammo type in a weapon?

#

Rain's B42 Firearms adds 7.62x51 and 7.62x39 if you want an example. it's pretty easy provided you stick to the vanilla design of every gun has one type of ammo and one type of magazine.

sly ivy
#

as in like, if i were to create an entire new ammo type for a mod, sorry,
like able to create boxes of rounds

#

thank you, i'll take a look at that, and i appreciate the help!

#

<3

silent zealot
#

Converting rounds <-> boxes <--> cases is done with recipies.

#

Ideally you would be able to add a BoxMyBullets -> MyBullets mapping to the existing recipes

#

But I'd start by adding your new gun, new ammo and (if applicable) new magazine.

#

Finally done - a new spawn point that includes your car which has run out of gas, a tire iron in one hand and an empty gas can in teh other, fishing gear in the boot and a perfectly ordinary farm.

#

Including clearing out the immediate zombies at the gate.

sly ivy
#

another thing, whats this?

silent zealot
sly ivy
#

pfft

dusk hound
#

don't forget to get an Amulet of Mara

silent zealot
#

...obviously not yet implemented.

sick tiger
#

out of curiosity just wondering if recipes can output fluids (or if they can only output a filled fluid container)
just in case i ever try modding out again

silent zealot
#

Who needs an amulet of Mara when you could 7.62x39mm ammo?

bronze yoke
#

does absolutely nothing in this build of the game

sly ivy
#

thanks :)

silent zealot
silent zealot
dull moss
#

man I wish we could write test cases for our mods

#

instead of manual testing

small topaz
#

Hello everyone! In B42, lua code controlling UI elements often has a "create()" function. Does anyone knows whether those create functions are always executed on game boot or immediately after a mod has been loaded vie "Reload Lua"?

bronze yoke
#

they're called when that ui element is instantiated, so it depends on the ui element

#

many of them are created once at lua load

small topaz
silent zealot
#

Can you start with a default value and change it later after sandbox vars are initialized?

small topaz
silent zealot
#

Messy code will fit right in with the vanilla code. 😆

#

yeah, definitly need ot work through test cases before release.

small topaz
#

a threesome! that's a new one for me XD

silent zealot
#

The "spawn your car" code has no check for "is there something already there" or "is this a second caharcter in the same save?"

native swift
#

I have 2 questions. Im messing with a pants mod and there is no fbx file in there. The only thing I can find in the scripts is that it calls for the Trousers_Ground.fbx which is like a world static thing that shows the pants on the actuall ground, not on the player model. My buddy sent me a PlayerModel.fbx that he said someone had sent him which is working for the retexture for now. So my question is, how is the mod knowing to skin the legs of the player if the only fbx it calls for is the ground model. and my other question is where even is the player model in the vanilla files? I have the one that my friend sent me which works, but it definitely isnt from the vanilla files

#

Here is what the clothing script looks like:
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Skinny Jeans,
ClothingItem = Trousers_SkinnyJeans,
BodyLocation = Pants,
BloodLocation = Trousers,
Icon = TrousersDenimBlue,
BiteDefense = 10,
ScratchDefense = 20,
RunSpeedModifier = 0.98,
Insulation = 0.65,
WindResistance = 0.60,
FabricType = Denim,
WorldStaticModel = Trousers_Ground,
}

#

im just trying to find out what model its calling for in the files to physically put it on the character

abstract cairn
#

Asking for a friend does anyone know how one could theoretically make zombies blind but still functional (and not use the useless mode).

And also without using sandbox settings... as they can still see fairly well.

[im looking at possible ways of doing this myself, thought I'd ask tho]

earnest glade
#

Guys, a question, I'm making a mod for the main screen, I see that every so often thunder sounds and the background lights up. I understand that the sound of thunder is not linked to that of the rain in the background, since I have found the sound files. Does anyone know if there is a lua file that I can access to modify the time interval at which the thunder sounds?

onyx valve
#

With this change in B42 "Increase item icon sizes to integer scale from native 48px (previously 32px)" does it mean that 48 x 48 will now be the base size for item icons?

earnest glade
#

ty @albion !

abstract cairn
#

If anyone knows how I can get the correct values for these functions (WorldToUIY/X so I can place a symbol at the players location that would be epic.
I'm gonna keep trying other methods/ideas but I cannot for the life of me figure out how or where I'm supposed to put it...

#

oh my god i solved it

#

this is stupid

#

for if anyone ever looks into this, the worldtoUIX isnt even needed

bronze yoke
#

i'm not sure any of those methods have any meaning with what isocells do

abstract cairn
#

they make a function specifically for converting real world coords into UI coords but then its not even useful T-T

bronze yoke
#

they used to represent map areas but now they're just the entire loaded area, they don't have a fixed width (or even a 'current' width since it can represent multiple different areas at once)

abstract cairn
abstract cairn
abstract cairn
#

This appears to be true for every player... even if the player doesn't have the trait. (This is being called on the server side)
Thoughts? [I might move it to the client side and see if that works by bringing a IsoPlayer ref over]

tacit pebble
#

is someone know how to check profession from player? something like
if player:HasTrait("SpeedDemon") then

bronze yoke
#

if player:getDescriptor():getProfession() == "fireofficer" then

tacit pebble
#

I've been trying to find that like for an hour already :/

bronze yoke
#

yeah it's a little more complicated than traits, profession isn't really meant to matter much

abstract cairn
#

I dunno how to put it more simply but HasTrait is not working... on server side...

shut sapphire
#

hey guys, how are you doing? 🙂 I could use help with converting/parsing a B41 to B42 mod (Weapon Condition Indicator from NoctisFalco). having almost everything of functionality running, but having some trouble with torches 😦

PD: I'm a newbie on this modding world, just starting 🙌✨

abstract cairn
shut sapphire
# shut sapphire hey guys, how are you doing? 🙂 I could use help with converting/parsing a B41 t...

this is the line that's giving infinite errors in game, and this is the error itself, along with some debug info I've managed to get, in case that helps. I don't think that the getUsedDelta method dissapeared, coz in the steamapps\common\ProjectZomboid\media\luaexamples\other\recipecode.lua it's being referenced (and so it's being used in-game)

the error happened when I tried to equip this new flashlight to the Alice braces or whatever that item is called, but is the one that allows you to attach this flashlight, and also when I tried to use it on the secondary hand. any piece of advice will be really appreciated, so thanks in advance 😄

PD2: if I'm asking on the wrong channel, please let me know, so I can post this info where it belongs

scenic mica
#

Is there a way to edit the discomfort modifier of an instance of an item?

#

My mod idea hinges on that and I don't see any method to set that particular value

distant inlet
#

hi, I'm testing+learning the PZ Lua/Java APIs. Is there any way to force your character to move to a specific tile (i.e. x,y,z coords) on the map? I'm capturing key combos (e.g. shift+f6) already to print world data and have been trying to capture a combo for moving but it always fails with an exception

#

this is basically what i've tried:

local position = Position3D.new(10894, 9470, 0)
local action = ISWalkToTimedActionF:new(character, position)
ISTimedActionQueue:addToQueue(action)
tranquil reef
#

Is there an OnEat type thing for fluids?

abstract cairn
#

LOG : General , 1737787794002> 31,762,883,333> TraitCollection(Thinskinned, HighThirst, SlowHealer, Conspicuous, HeartyAppitite, Pacifist, ProneToIllness, NeedsMoreSleep, Smoker, WeakStomach, ShortSighted, SpeedDemon, NightVision, Dextrous, FastReader, Outdoorsman, Graceful, Jogger, Tailor, Mechanics, Gymnast, FastLearner, KeenHearing, Hunter, Feeble, Fit, Very Underweight)
LOG : General , 1737787794004> 31,762,883,334> false

I tried to see if doing this would work, IE getting all the traits and seeing if I have it that way. Nope. For some reason the trait simply isnt in the list of traits in the collection.

abstract cairn
#

lua command line, just trying it out in game works fine SAME EXACT GAME i get false in server console [I accidentally added it 3 times trying different add methods to see if hte server recognized any of them]

abstract cairn
#

Does anyone know if IsoPlayer references change between sessions?
Like if I did getOnlinePlayers() on the server, would the isoplayer reference be consistent per character?

Follow up, how does one attach mod data to an IsoPlayer/player obj [and have the server be able to read that data] (in case my previous statement/plan doesnt work)

[[all because hastraits simply is completely desynced on the server for some reason]]

abstract cairn
abstract cairn
#

why am I getting a nil reference when trying to get mod data

silent zealot
#

How does ModData work for objects/players/etc? I've only used fooData = ModData.getOrCreate("Foo")

#

Is it the same way of using , but you pull it out of someObject:getModData() instead and it gets saved attached to that object?

bronze yoke
#

yeah

silent zealot
#

In that case, what sort of object is playerRef?

abstract cairn
#

isoplayer

#

(i am losing my mind over this I hate mod data so much)

abstract cairn
abstract cairn
grizzled fulcrum
#

well I actually dont know since you're not creating a subtable, you're only creating a var in the table

#

but you should put your mod data in a subtable anyway

#

but it also depends where youre accessing the mod data

#
--- @type ModDataDummy
local mdata = player:getModData()[mod_constants.MOD_ID]
mdata.testField = 123
#

This what I did, you should be able to literally just do this

bronze yoke
#

nothing here would initialise it

grizzled fulcrum
#

true there I assume that the table exists alr

#

I mean in my code I don't use ModData anywhere, you cn just create the table like

player:getModData()["lalala"] = {}
``` and then access it fine
unique harbor
#

Is there a way to see the engine logs?
Game is just crashing when I try to do something.

silent zealot
#

Is it when you aim?

#

C:\Games\Steam\steamapps\common\ProjectZomboid\hs_errXXXX.pid

#

I just had to do a big cleanup because I was getting carash-to-dektpo when aiming (also, I was overdue to clean up)

unique harbor
#

It's when I try to access a nested container with a container button, which makes no sense to me since I can print the inventory just fine. The game just instantly freezes when I try to open it, I get no logs also no hs_err file.

silent zealot
#

I suspect it was a "improved body model" mod, that then causes issues when the game tries to work out which part of a zombie a gun is pointed at...

#

Very different problem then

#

Is CPU use/memory going high? wonder if it's getting in an infinite loop somehow

unique harbor
#

Hmm didn't really check that, thx for the hint

silent zealot
#

Also, wha do you mean by access - via lua code, or through the GUI when playing?

unique harbor
#

You see, I have a backpack and there's a wallet inside.
But once I try to access that wallet It will crash the game.
The inventory of the wallet works fine, I can get the inventory / items so I don't understand why.

tranquil reef
#

item textures are 32x32 right

#

too lazy to open the files and my memory is that of a summer ant

silent zealot
#

What's the code you're using to access it?

#

And are you using that mod that puts nested container in the inventory list?

unique harbor
#

I'm only using my mod which gets the job done so far but not if i want to go deeper.
It even shows the inventory of the wallet but then just freezes.

containerButton = inventoryPage:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())

I mean it's the vanilla code to create the button so nothing fancy really.
Of course after looping through the items of the backpack.

umbral raptor
#

Is it possible to make a stove that uses propane tanks use propane bottles instead?

#

Im trying to make new furntirue and want to use the propane bottle. Do I gotta write a new lua or is it possible by editting .tile files?

silent zealot
#

Like a BBQ where you right click -> add propane tank, right click -> remove propane tank?

#

That would need some LUA to add the context menu - add a function to the OnFillWorldObjectContextMenu event that is basically
if thing is not myStove return else check if there if propane bottle to remove and if so add "Remove propane bottle" to context menu, then if empty and player has a propane bottle add "add propane bottle" to context menu"

#

You'd be able to copy a lot of that from the existing BBQ context menu & functions

silent zealot
#

I'm guessing the vanilla InventoryPage or InventoryPane is making an assummption that the container is in your player inventory or a directly accessible container, and somwhere that is causing an issue - maybe because it does a getParent and it's not the player or player inventory so it just gives up on life.

dense orchid
#

Has anyone figured out animal mods yet? I'm Big Hoping for some honse mods lol

#

or even dogs

silent zealot
#

Short version: animations are a huge problem

unique harbor
silent zealot
#

Everyone who tries goes insane and starts gibbering about AnimSets

silent zealot
#

Everything should be in ISInventoryPage and ISInventoryPane.

#

I'd start with the Update function since that from memory populates all the inventory items

unique harbor
#

Do I have to copy / overwrite the whole function?

smoky egret
#

Morning all. Suppose I would like to have a zombie spawns carrying a bag containing specific items (say, a duffel bag full of money, or a mailman with satchel carrying books and magazines), is there a mod that does this or a guide that I could study? Thanks!

silent zealot
#

\media\lua\client\ISUI\ISInventoryPage.lua and ISInventoryPane.lua

vast pier
#

That's odd?
The black pants don't get equipped, but every other pants type does.
I know it's the right name for the black pants, cuz it's deleting the belt on spawn properly

#

If it was the wrong item name, it wouldn't delete the belt and would just ignore it

#

I'm gonna pretend I didn't see this

#

and just continue working

frank elbow
vast pier
#

shii you right

frank elbow
#

I also have some general pointers on the code, if you're interested

vast pier
#

Sure, I tried doing this a couple other ways but gave up and started doing it manually lol

frank elbow
#

You're doing identical checks in your HasX functions—for example, you already have FirePants in scope which will be identical to the result of HasFirePants (assuming getPlayer() is the same player, but if it isn't that seems like a bug). You could get rid of those helpers and just use the variables directly. So if HasFirePants()if FirePants

Further: (definitely pressed enter on purpose, totally intentional, building suspense)

vast pier
#

Unrelated but I did the doctor profession to see the pants id and I think it spawned me in the wall of this building??

#

I spawned in and everything was dark and I had to noclip out

#

I think it spawned me in this cube??

frank elbow
# frank elbow You're doing identical checks in your `HasX` functions—for example, you already ...

Since the branches are mutually-exclusive & the function is only doing that one operation, you could do each check separately & return after so you don't make calls you don't ultimately need. So, instead of

local FirePants = inv:getItemFromType('...')
local BlackPants = inv:getItemFromType('...')
if FirePants then
  ...
elseif BlackPants then
  ...
end

You could rewrite as

local FirePants = inv:getItemFromType('...')
if FirePants then
  ...
  return
end

local BlackPants = inv:getItemFromType('...')
if BlackPants then
  ...
  return
end

-- etc.
vast pier
#

Would that still work for having it all be in the RemoveBeltOnStart(player) function?

#

because it needs to run on game start

frank elbow
#

Yeah—the return here is just "done running this function" (rather than "returning a value")

winter bolt
# vast pier

unless i'm missing some context the hours survived check is redundant since OnNewGame only runs when the character first spawns anyway

vast pier
#

Does it run when leaving and rejoining a save?

winter bolt
#

no OnCreatePlayer does that

#

OnCreatePlayer is whenever you rejoin but OnNewGame is when the character spawns after character creation

#

no idea why theyre named like that lol

tranquil reef
#

Anyone know if the game always used lua? Back in the original pre build 40 days was it using just java?

#

Curious to know if they had to go in and reprogram things to expose it for lua or if it just always had it

vast pier
#

New issue that I found on accident

#

dying with only the mod I'm working on enabled causes an error screen :)

#

My first thought is that it's possibly the fact that my character is wearing a new clothing type? Since it's not using a vanilla body location, maybe it's bugging out on a zombie?

#

maybe something relating to trying to call for the player character but there not being one? unsure

#

All I know for sure is I have zero idea how to fix this :)

unique harbor
vast pier
#

Oh nevermind it's happening with NO mods enabled!

#

what is going on

#

What on earth

crisp fossil
#

is there an easy way to tinker attachment offset and rotation without reloading game?

sly ivy
#

so the mesh is the .fbx right?

winter bolt
#

im assuming they added a lot more lua exposed stuff in b41 because i remember the workshop being fairly dead before then

grizzled fulcrum
#

Isn't there also an event (might be a OnCreatePlayer param I dont remember) that has an newGame param that essentially does the same thing

#

It'd be nice to know the difference

harsh spoke
red tiger
quiet hill
#

does anyone know anyone who does vehicle mods? Im willing to pay for a custom vehicle mod

ornate sand
night pagoda
ornate sand
main pasture
round notch
#

Did they fix animations yet?

outer crypt
#

if I do a getText("Recipe_AddACigarette") on a recipe shouldn't it give me the "Add Cigarette to Pack" string back? when I print(getText("Recipe_AddACigarette")) it prints in the log Recipe_AddACigarette the same if I don't use getText()

pulsar sinew
#

Currently trying to add a select few items into the character creation menu, and although it is working for most other items there is this problem where the red and blue trainers don't appear in the menu along with the usual randomly colored sneakers, which I am adding in by essentially overwriting the specific dropdown:

ClothingSelectionDefinitions.default.Female.Shoes = {
    items = {
        "Base.Shoes_Random",
        "Base.Shoes_TrainerTINT", -- random color sneakers
        "Base.Shoes_Strapped",
        -- additions
        "Base.Shoes_RedTrainers", -- red trainers
        "Base.Shoes_BlueTrainers" -- blue trainers
    },
}

As of now the two unique trainers don't show up as separate options and the original "Sneakers" option simply selects the the tinted sneakers. They do actually show up occasionally on a character when you spam the random button a few times but they remain unselectable by the player, my guess is that it has to do with the three different sneakers being named "Sneakers" which causes the option to only appear once for the first item in the list

wraith carbon
#

hi new to modding, how do i add my mod to my game for testing

autumn sierra
#

and then enable it in game

#

id also recommend turning on debug

wraith carbon
#

thank you

round thorn
#

sadly it looks like the mod manager mod from b41 may never get updated, TIS seems to have redone the ingame manger and now its part of the main menu.

#

the default one wouldn't be bad if it had a more features like the modded manager.

low badge
#

Hey guys, also very new.
Trying to make a very simple mod. Struggling with step 1, the structuring.

I saw the File structure outline on https://pzwiki.net/wiki/File_structure#Workshop_folder.
If I'm only working on B42, do I put all of my mod files into the 42/media/ folder, or if I put it into common/media/, will it pull through?
Do I also need to specify 42.1 // 42.1.1. or will 42/ folder pull through for all B42 builds?
Feel like I'm struggling with the very first step haha.

round thorn
#

technically common, or 42 will work. and no you dont need specific version numbers.

#

anything in common will also show up in other versions.

low badge
#

I thought so. So if I'm building in common, do I still need a 42/ folder at all, even if it's empty?

round thorn
#

Im not sure if its needed, remove it and test, but having an empty folder shouldn't really matter either. its not good practice to put everything in common however, as you will get people on b41 trying to use the mod and if its made for 42 obviously it wont work.

low badge
#

Will do, thanks LT!

round thorn
#

np

umbral raptor
queen oasis
brittle geyser
undone elbow
# pulsar sinew Currently trying to add a select few items into the character creation menu, and...
do -- add shoes options
  local t = ClothingSelectionDefinitions.default.Female.Shoes.items
  table.insert(t, "Base.Shoes_RedTrainers")
  table.insert(t, "Base.Shoes_BlueTrainers")
end

do -- allow similar names in drop down clothing menu
  local fn_false = function()
    return false
  end
  
  -- makes that the combo allows any duplicates
  local function fixCombo(combo)
    if combo then
      combo.contains = fn_false
    end
  end
  
  local old_createClothingCombo = CharacterCreationMain.createClothingCombo
  CharacterCreationMain.createClothingCombo = function(self, bodyLocation, ...)
    old_createClothingCombo(self, bodyLocation, ...)
    fixCombo(self.clothingCombo[bodyLocation])
  end

  local old_createClothingComboDebug = CharacterCreationMain.createClothingComboDebug
  CharacterCreationMain.createClothingComboDebug = function(self, bodyLocation, ...)
    old_createClothingComboDebug(self, bodyLocation, ...)
    fixCombo(self.clothingCombo[bodyLocation])
  end
end
#

Hm, it doesn't work. But now I fixed it. @pulsar sinew

warm vector
#

Hey, been thinking for a while and one of the things that REALLY bothers me about Project Zomboid is the whole progression system with reading books.
Think it's a bit annoying and distruptive to the gameplay.
Does anyone know of or ever considered making a mod that removes all the default skill books entirely from the game.
And rather reward a very very tiny % of multiplier for each action you did towards a skill?
So that the more you did e.g. metalworking ingame, the higher your multiplier would become over time?

pulsar sinew
winter bolt
umbral raptor
#

Hey guys I just had an idea for a mod

#

It could be either easy as shit to program or hard as shit

#

Simply water freezes in winter, becomes ice, and all water becomes floor. You can still extract water by drilling or chopping the ice. Maybe in the future things like ice breaking could be added

#

Would that be easy to add in or hard? Like is it possible to make a lua that once it detects say -5c, it auto converts all water tiles to ice floor

frank elbow
#

Instant subscribe

bronze yoke
#

awesome

dull moss
#

Adding UI aware

winter bolt
#

it took me like 3 days to get a working dropdown menu when i started lmfao

copper abyss
#

anybody know what is causing this error? Thousands and thousands of errors are popping up for my gunmod..

#

attempted index: setVehicle of non-table: null function: onExitVehicle -- file: ISVehicleDashboard.lua line # 614 | Vanilla function: damageChecker -- file: ISVehicleDashboard.lua line # 666 | Vanilla java.lang.RuntimeException: attempted index: setVehicle of non-table: null at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:624) at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963) at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1790) at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66) at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139) at zombie.Lua.Event.trigger(Event.java:81) at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:315) at zombie.gameStates.IngameState.onTick(IngameState.java:1893) at zombie.GameProfiler.invokeAndMeasure(GameProfiler.java:195) at zombie.gameStates.IngameState.updateInternal(IngameState.java:1777) at zombie.gameStates.IngameState.update(IngameState.java:1443) at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101) at zombie.GameWindow.logic(GameWindow.java:377) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:76) at zombie.GameWindow.frameStep(GameWindow.java:921) at zombie.GameWindow.run_ez(GameWindow.java:814) at zombie.GameWindow.mainThread(GameWindow.java:615) at java.base/java.lang.Thread.run(Unknown Source)

round thorn
#

@umbral raptor how is that going to interact with the mod MRE XIII which makes MREs realistic, ie containers that have the components of an MRE.

umbral raptor
#

both MREs spawn naturally

dull moss
#

anyone remembers if ZombRand(x) generates (0,X] or [0,X)?

umbral raptor
#

there should be no reason for conflict.

#

but my first strike MREs will make you want nothing more in life. -70 hunger and a juice packet with every single MRE

round thorn
umbral raptor
#

i mean they only spawn in surplus stores and military bases

#

and these places tend to be filled with more zombies than Louisville

#

but i got like 47 other things in the mod haha

#

the mre mod has just MREs

round thorn
#

yeah, the other stuff is what im interested in, but it also contains the MREs. which would mean I have more than one MRE spawn happening.

umbral raptor
#

just leave em behind if u dont want em

#

i based my MREs off the vanilla MREs mod

#

which is awesome imo

silent zealot
#

Maybe (and this is huge maybe) you could redefine the water tiles to ice tiles with different texture properties & passability flags so you don't need to update tiles. Also, you're going to have to figure out what happens to a player/zombie that is on the ice when it melts.

silent zealot
#

With your mods I can now wear an open jacket to show off my abs.

round thorn
silent zealot
dull moss
#

i jsut ctrl+f in game code for it KekW

function ISLootStreetTestUI:getRandomKitchenCounter()
    local nbr = ZombRand(4);
    if nbr == 0 then
        return "KitchenDryFood";
    elseif nbr == 1 then
        return "KitchenBreakfast";
    elseif nbr == 2 then
        return "KitchenBottles";
    else
        return "KitchenRandom";
    end
end

found this

#

so figured it's [0,X) xd

copper abyss
round thorn
round thorn
#

search for another mod that was doing similar and reach out to its creator to see how they fixed it? sorry, best advice I have for you.

silent zealot
silent zealot
#

did you accidentally break getPlayerNum() somehow?

brittle geyser
bronze yoke
#

having b41 recipes in a b42 mod bricks player data

copper abyss
copper abyss
silent zealot
#

If you remove that, is the problem fixed? that's the quick way to know if it is that code causing odd issues.

copper abyss
#

either one I haven't removed yet

round thorn
#

recipes makes sense, as the entire system changed for b42.

silent zealot