#mod_development

1 messages Ā· Page 31 of 1

hearty dew
#

4 is the index for the hashCode() method on java.lang.String

#

That may only work on non--debug clients though

#

I'll test that too. I'm curious :p

#
local x = "hi"
print("This should be 3329")
print(getClassFunction(x,4):invoke(x))```
This works with `-debug`.

Without `-debug`, however, causes an error because `invoke` isn't exposed.

LOG : General , 1664924179296> This should be 3329
LOG : General , 1664924179302> -------------------------------------------------------------
attempted index: invoke of non-table: public int java.lang.String.hashCode()```

#

in zombie.Lua.LuaManager.Exposer:exposeAll(),java if (Core.bDebug) { this.setExposed(Field.class); this.setExposed(Method.class); this.setExposed(Coroutine.class); }
java.lang.reflect.Method is only exposed when Core.bDebug is true. So calling java.lang.reflect.Method:invoke() fails with that error in non-debug clients

cosmic pumice
#

Can any modders here please look in mod support, i really just am trying to figure this issue out

median prairie
#

Hello! I'm sorry to interrupt you, Tyrir.

I'm making a mod that utilizes corpses and I'm currently creating the recipes for it.
Unfortunately, picking up a female zombie corpse turns it to a male corpse ( the item type - not visual ) and so I'd like a right click drop-down menu for male and female ( and maybe even race )

TL;DR I was wondering if I could create a drop-down menu in a recipe code? Much like ClothingItemExtra / ClothingItemExtraOption found in clothing scripts. Is it possible?

` recipe White Female Corpse Splayed Hair Clothes
CorpseMale,

    Result:Body_Femme_b_01,
    Time:100.0,
    OnCreate:Recipe.OnCreate.Body_Femme_b_01,
    Category:General,

`

Any pointers appreciated.

bronze yoke
#

i don't understand what you're asking here

hearty dew
#

Could try implementing a simple hash function for strings if you don't need anything cryptographically secure. This is djb2

function djb2(str)
    if type(str) ~= "string" then
        error("don't do that")
    end

    local hash = 5381
    for i = 1, #str do
        local c = str:byte(i)
        hash = hash * 33 + c
    end
    return hash
end
hollow current
#

Quick question
I am trying to debug an issue that is caused when my mod is running with another mod.
for _,worldObject in ipairs(worldobjects) do

for _, size in pairs(Basement.Sizes) do

The first line is from mine, the second line is from the other mod. I am not sure, but could it be the _ of both mods overlapping together? As in some kind of a variable name/value overlapping?

mystic meteor
#

ideally this would be unique enough to see what ItemTweaker changes happened

#

so that will probably do the job

#

Thanks for looking into it for me!

#

also no worries about the delay, I'm mostly information-gathering right now

bronze yoke
hearty dew
hollow current
#

aah im gonna have to look into it further then, thanks!

median prairie
hearty dew
#

When right-clicking an item in the inventory or in the game world?

median prairie
#

Yes, when right clicking an item. It's a crafting recipe that I need this to apply to.

#

Not a clothing item.

hearty dew
#

You can add another entry to the context menu that is rendered when you right click an inventory item, yep

glacial flicker
#

Any tips or guides for zombie behavior? or how they move?

median prairie
#

O hey 8hoursofsleep, it's Mister E!

And thank you so very much Tyrir, I'll give it a shot. Goodluck with your work.

hearty dew
#

@median prairie You do it in lua though

#

sec, that was for world object, not inventory items

median prairie
#

Right! Alright, thanks so much again that is absolutely lovely.

#

Oh right right

hearty dew
#

Here is the basic code for it

median prairie
#

Oh that is so much easier. Thanks! You've saved me from pulling out (most) of my hair šŸ˜›

glacial flicker
#

Good to see you around

hearty dew
#

Put that in media/lua/client/mymodid_contextmenu.lua

thorny garnet
#

Anyone here have experience with Noir's Shop/ShopX mods?

#

Specifically I need to know if there's an upper limit to the # of tabs you can have, as I've triple checked everything yet my custom tabs are not appearing

#

the All tab contains all of the items listed for each tab, but the categories themselves don't show

sour island
#

Are some tabs appearing?

#

Can you scroll through tabs?

#

If there's a finite space for them to appear I would assume that'd be it?

thorny garnet
drifting ore
#

How do thangs

thorny garnet
#

I've got the definitions set up, the individual .Lua files named correctly for each tab and the translations set up, but no dice

sour island
#

I've never used that mod, but if custom tabs is a feature the maybe the author is here or you can leave a comment

sturdy panther
#

Hey, so just to get it out of the way, I am complete code illiterate, so I was wondering if someone with absolutely no background in coding could essentially splice two mods together to create an ultimately new concept; To elobrate - There is RV interior mod, and then there is a black hawk mod. - more or less a good starting point for what im trying to do; Now I bring this up because Im trying to recreate a complete meme of a conversion of a sikorsky utility helicopter into a flying RV. https://www.motor1.com/news/598285/winnebago-flying-rv-camper-cabin/ - To summarize, im just wondering if one would consider it ethical first off to use the codes of others to create this,(I plan to post credit where its due), furthermore could anyone point me in the right direction as far as tools I would need to undertake such a meme of a project?

Motor1.com

In the late 1970s, Winnebago commissioned a flying motorhome that featured a fully functional camper interior with a full kitchen and a shower.

hearty dew
#

Hrm.. is it possible to run pz or the dedicated server in non-steam mod while having available your dev mods in ~/Zomboid/Workshop? It's a pain to get the client to connect to the dedicated server via steam (You have to have a publicly visible IP, it seems. Local loopback or LAN IPs don't seem to work)

#

If I were on linux, I could make symlinks into ~/Zomboid/Workshop from ~/Zomboid/mods, but can't make symlinks to directories on windows 7 afaik (at least not with cygwin tools)

ruby urchin
# sturdy panther Hey, so just to get it out of the way, I am complete code illiterate, so I was w...

As far as I'm concerned, we all copy, if you copy too much of something, you will have to add credits or ask the creator for permission, everything will depend on the license that he has in the mod description. You can also go the extra mile to copy and enhance, modify so much that it's no longer recognizable, you'll be able to get out of a DMCA request, that said, it'll all be on your conscience.

astral dune
sturdy panther
ancient grail
#

where can i find the script to add evolved recipe

#

item Lemon
{
DisplayName = Lemon,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Lemon,
EvolvedRecipe = HotDrink:2;HotDrinkRed:2;HotDrinkWhite:2;HotDrinkSpiffo:2;HotDrinkTea:2;Cake:5;FruitSalad:5;Pancakes:5;Waffles:5;Muffin:5;PieSweet:5;Stir fry Griddle Pan:5;Stir fry:5;Soup:10;Beverage:2;Beverage2:2;Beer:2;Beer2;Taco:2;Burrito:2,
FoodType = Citrus,
Spice = true,
DaysFresh = 7,
DaysTotallyRotten = 9,
HungerChange = -10,
ThirstChange = -5,
Calories = 17,
Carbohydrates = 5.41,
Lipids = 0.17,
Proteins = 0.64,
CustomEatSound = EatingFruit,
StaticModel = RoundFood_Yellow,
WorldStaticModel = Lemon_Ground,
Tags = HerbalTea,
}

#

or do i use item tweaker?

#

to add my own item on the evolved recipe?

ruby urchin
#

Guide updated and added 3 examples

  • Example 1 - Sending data to Server
  • Example 2 - Sending data to other clients
  • Example 3 - Sync player instances
hearty dew
#

Nifty little tool to simulate network latency, dropped packets, bandwidth limits on windows

next narwhal
#

Hello, when I reload lua in debug mode F11, it's updating just fine, but the source code preview still shows old code. Have to quit and continue to see updates. Any chance to fix this?

fast galleon
next narwhal
hearty dew
#

Also, might try closing the old source code preview windows in the debug UI. They seem to stay up forever until you close them

#

I tested dedicated server's behavior with isClient() and isServer(), and it seems to function identically as coop hosted MP, if anyone was curious.

In Singleplayer, pz is run as a single process. Both isClient() and isServer() are false. No surprises there.

In Co-op Hosted Multiplayer,

  • pz runs two separate lua environments
    -- Actually, it forks a separate process running java.exe to run zombie.network.GameServer (the same code the dedicated server runs), so in fact a separate process space.
  • In the client process, isClient() is true and isServer() is false.
  • In the server process, isClient() is false and isServer() is true.
  • The lua environment on the client loads shared/ then client/ then server/.
  • The lua env on the server loads shared/ then server/ (it skips lua files in client/).
  • Each environment has its own _G as you might expect.
  • The list of events that are registered are equivalent on server-side and client-side. However, the Events tables (the one in the client process and the one in the server process) and its values are separate.
    -- Interestingly, Events.OnTick is raised roughly every frame on the client, and it is raised 10 times per second on the server.

The Dedicated Server Multiplayer seems to function nearly identically to co-op hosted multiplayer, except of course the java process that runs zombie.network.GameServer is started manually, instead of forked from ProjectZomboid.exe.

shouldRunServerCode = function()
    --                             | isClient() | isServer() |
    -- Singleplayer                | false      | false      |
    -- Multiplayer Client          | true       | false      |
    -- Co-op Host (client process) | true       | false      |
    -- Co-op Host (server process) | false      | true       |
    -- Dedicated Server            | false      | true       |
    --
    -- This is a single player game or is a coop host server process or is a dedicated server
    return not isClient()
end

shouldRunClientCode = function()
    -- This is a single player game or is a coop host client process or is a client connected to a remote server
    return not isServer()
end
ancient grail
abstract raptor
#

Lookin for help finishing this mod uwu

#

Anyone wanna help me finish this ?

ancient grail
#

how does EvolvedRecipe actually work

velvet girder
#

how do you change the item type...i have a shop mod that doesnt yet support literature items and i have another mod thats literature...wanna change its type so i can put it in the shop

reef rose
# abstract raptor

I can't, but this definitely needs crosses, arrows and such, to mark visited homes and show directions

reef rose
#

that's a mod I'd use. And I don't use many for usual šŸ˜‰

gray slate
#

Is there a mod that allows to set player zombies as sprinters?

grim warren
#

I want a landscaping mod to make my own beaches

mystic meteor
#

I'm running a couple junctions from <data>/workshop/ to <data>/mods with no issue.

mystic meteor
gilded hawk
dim hill
#

Are there mods that make food not rot if it's cold weather?

gilded hawk
#

Is it possible to require files from another mod? šŸ¤”

gilded hawk
#

Which is the syntax for it?

#

In my mods I do require like this

require "Utils"

But this is usually limited to files in the current folde

grim rose
#

I don’t really know, but ā€žtsar true actionsā€ require its framework to work

#

Look it up

mystic meteor
#

similarly the current version of ItemTweaker does the same. https://steamcommunity.com/sharedfiles/filedetails/?id=566115016

-----------------------------------------------------------------------Begin File
if getActivatedMods():contains("ItemTweakerAPI") then
require("ItemTweaker_Core");
else return end

TweakItem("Base.Needle","Icon", "Worm");
TweakItem("Base.Needle","Tooltip", "Wearable: Waist");
TweakItem("Base.Needle","DisplayCategory", "Repair");
-----------------------------------------------------------------------End File
dim hill
#

What happens to a savefile (multiplayer) if a map is updated and people actively live/play around that area?

quasi geode
gilded hawk
bronze yoke
#

yes

quasi geode
#

ya

mystic meteor
#

Does lua not care about the difference between require "" and require("")?

quasi geode
#

they're both effectively the same

gilded hawk
#

Alright, thank you both hughug hughug hughug hughug hughug

bronze yoke
#

i think any function that takes a single string argument can be used that way

thick karma
#

So I notice dual wielding is just for show and there are no good mods to make it do anything worthwhile (such as let you attack faster). Is this a limitation of the mod engines (e.g., making character attack with left hand weapon is just not allowed on a fundamental level somehow), or have modders just not gotten around to doing it well? (Or does everyone who mods PZ hate dual wielding as a premise?)

bronze yoke
#

aren't there a couple dual wield mods already?

quasi geode
bronze yoke
#

yeah i've never seen it used that way (and using it that way would look a bit confusing anyway)

quasi geode
#
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> function x(a) print(a) end
> x "t"
t  

this one accepts fine

> y = "t"
> x y
stdin:1: '=' expected near 'y'

this one does not

#

valid:

for _,y in ipairs {"a","b"} do end

invalid:

> z = {"a", "b"}
> for _,y in ipairs z do end
stdin:1: 'do' expected near 'z'
#

weird design choice if you ask me, like you said just makes it needlessly confusing

bronze yoke
#

i like using it on my requires because i think it looks pretty, but i only do that because requires are usually pretty isolated from the rest of the code, so inconsistent syntax doesn't really matter

#

otherwise doing things inconsistently like that really doesn't offer you anything to gain

quasi geode
#

its fairly common on require, often you see the () version on requires that return a table/module, so i tend to stick to that format. bracketless for no return requires

#

but other then require ya i wouldnt use that feature anywhere else

mystic meteor
#

anyone know why this is happening when I try to host a test server on 41.77?

[05-10-22 10:20:35.191] ERROR: General     , 1664979635191> 833,831,166> java.net.ConnectException: Connection Startup Failed. Code: 5.
[05-10-22 10:20:35.191] ERROR: General     , 1664979635191> 833,831,166>     at zombie.core.raknet.UdpEngine.<init>(UdpEngine.java:80).
[05-10-22 10:20:35.191] ERROR: General     , 1664979635191> 833,831,166>     at zombie.network.GameServer.startServer(GameServer.java:1449).
[05-10-22 10:20:35.191] ERROR: General     , 1664979635191> 833,831,166>     at zombie.network.GameServer.main(GameServer.java:740).
#

This is from the main menu's host option, for the record

thick karma
# bronze yoke aren't there a couple dual wield mods already?

The two I see are not working well to various degrees. One doesn't really change anything and just lets you alternate swings afaik... one adds dual-wield combos, but unfortunately the off-hand just sort of shoves the enemy (it's not really animating as an attack as in the off-hand mod)... I'm sort of looking for a blend, where both weapons swing and overall attack rate can be slightly higher (since I assume damage per hit is higher when two-handing, as that would make sense and is pretty standard).

thick karma
#

Does anyone have a profession mod template by chance? Does such a thing exist? Or could I perhaps use someone else's code as a template and credit you if/when I publish it?

next narwhal
#

Not template, but you can download any profession mod from the Workshop and check out the source code.

thick karma
#

Oh, okay, thanks. Will attempt that and combine that info with the link to the GitHub for Profession Framework

buoyant merlin
#

tried searching for this but can't find it -- is there a simple way to change zombie spawns so that a higher ratio spawn indoors?

restive notch
#

is it possible to debug server-side lua code?

buoyant merlin
#

found that one, but chatter sounds like it's been broken

mystic meteor
azure dock
#

Hey is there a mod that makes it possible to teleport between worlds?

#

like from kentucky to cherbourg?

#

without losing player progress?

shrewd ether
#

is this the channel to ask to learn how to make mods

ancient grail
#

anyway to check how hot the water is when pouring into a cup

shrewd ether
ancient grail
#

ow yeah ill try to find where the bar gets its variable

#

item:getHeat()

mystic meteor
undone elbow
#

Let's say I did ```lua
local moodles = player:getMoodles()

How to get the player back?
```lua
local player =  ?????? (moodles) ?????
ruby urchin
sour island
#

If the moodle object doesn't have a reference back you'd be out of luck

#

Not many cases where that would be needed tbh

abstract raptor
#

Once again asking for help with the Graffiti mod šŸ™

#

I put it on github

#

if anyone's interested in helping out

ruby urchin
abstract raptor
#

Well I basically had someone else working the code side of this and I designed all the tile sheets being utilized in it and came up with the initial concept;

currently it works this way: You press Y to paint after using the lua console to set the text or symbol, as well as determining what style is chosen.

The problems that prevent it from being done are this:

  1. Need to have a spray can in your inventory in order paint
  2. Need to fix the Tag Wall UI so that you can choose the style, symbol or text to be sprayed
  3. Need to tie the color to be relevant to the spray can used
  4. Durability of the can should drain upon use
  5. Anim for spray painting? This is just polish at this point.

That's about it I think

shadow geyser
abstract raptor
shadow geyser
#

well, its easier than having to type it out every time

abstract raptor
#

that's like telling someone to "just google it" -- or linking them to google. But I digress, I forgot to say what the problem I was having is so whatever

shadow geyser
#

because multiple times, I have just said a simple, "what is the problem" and them still not wanting to put the effort in. and wanting for someone to commit to helping before elaborating

abstract raptor
#

Yeah, that's just people unfortunately but now we're burying my call for help with meta talk >.<

ruby urchin
abstract raptor
#

There's already a UI built, it's just not totally finished yet I think

#

Like currently it doesn't populate the style list with options, and hitting tag does nothing

#

And I guess before we were doing it so that you can select what color the thing is from this menu, but I think having predefined colors would be more realistic and graceful

hearty dew
#

Makes me wonder why cygwin's ln doesn't create junctions when symlinking šŸ¤”

hearty dew
#

Oh, wait, nm

#

The one on steam doesn't do that

hearty dew
undone elbow
#

No mods. Unhappiness Level falls down -1 per sec. Why?

#

I guess some mod changed some multiplier before I turned them all off.

candid silo
#

Not sure if this is the right channel but I'm looking for a mod that let's you enhance vehicles in game? Like roll cages or stuff like that is there anything?

midnight mica
#

Does anyone know if there is a way to mark a VHS tape as listened to, without actually watching it?
The only thing i was able to find so far is the static class MediaData.MediaLineData.getTextGuid() which wont let me select a certain tape.

There also only seems to be one way to learn a tape and that is by the lines that are broadcasted on tv, using player:addKnownMediaLine(mediaLine)
But i can't seem to find a way to fetch these lines anywhere, could anyone point me in the right direction?

shadow geyser
#

here is one of the functions which I think is likely relevant

---@param player IsoPlayer|IsoGameCharacter
function SRJ.getListenedToMedia(player)

    local knownMediaLines = {}

    local ZR = getZomboidRadio():getRecordedMedia()
    local categories = ZR:getCategories()
    for i=1,categories:size() do
        local category = categories:get(i-1)
        local mediaType = RecordedMedia.getMediaTypeForCategory(category)
        local list = ZR:getAllMediaForType(mediaType)
        for j=1,list:size() do
            ---@type MediaData
            local mediaData = list:get(j-1)

            print("Watched - mediaData: ".." ("..mediaData:getId()..")  "..mediaData:getLineCount())

            for jj=1, mediaData:getLineCount() do

                ---@type MediaData.MediaLineData
                local mediaLineData = mediaData:getLine(jj-1)
                if mediaLineData then
                    print(" ---getTextGuid: "..mediaLineData:getTextGuid())
                    local lineGuid = mediaLineData:getTextGuid()
                    if lineGuid and player:isKnownMediaLine(lineGuid) then
                        print("Watched - "..tostring(lineGuid))
                        table.insert(knownMediaLines, lineGuid)
                    end
                end
            end
        end
    end

    return knownMediaLines
end

gilded hawk
midnight mica
shadow geyser
#

oh mb

midnight mica
#

managed to make my tv spit out the lines i need, but this requires actually watching the tape

bronze yoke
#

search Recorded_Media_EN.txt for the lines you need

midnight mica
drifting ore
#

How do i add flags to Project Zomboid

hearty dew
# drifting ore How do i add flags to Project Zomboid
drifting ore
#

Fr

hearty dew
#

Once you have your flag created in blender, that guide has instructions on how to package it into into a pz mod

drifting ore
#

I know nothing abt modding i just want my flag in gamešŸ”„

#

I once made an orange in blender o7

hoary bear
#

Thought of a mod idea today but I don't mod. Functioning radio stations/towers. Other survivors on the map can tune into it and maybe it can be a way of recruiting survivors to your encampment when NPCs are implemented into the game

bronze yoke
#

isn't that a vanilla feature

true vault
#

Is there a way to require X number of units of tainted water in a recipe directly?

undone elbow
#

How to tune existing recipes (not by overriding)?

undone elbow
#
-- check that the water isn't tainted when used in a recipe
function Recipe.OnTest.NotTaintedWater(item)
    if item:isWaterSource() then
        if item:isTaintedWater() then return false; end
    end
    return true;
end
#

You just need to make your own function and mention it in your recipe

true vault
#

That is exactly what I was looking for, but wasn't sure what to even begin searching with haha... Thanks @undone elbow ā¤ļø

astral dune
#

a small map mod that puts a tv station somewhere , probably luisville

#

give it power and VHS tapes, and whatever is on the tapes gets broadcast

#

could be a neat way for server admins to help new players well after the power goes out

bronze yoke
#

i could give it a try

#

i've been messing around with those sorts of things recently, not completely sure if it's possible but if it is i could probably find out how

astral dune
#

I know you can turn the power back on, but can you trick the tv's into running again? Might have to create your own channel, again if that's possible. It sounds like a fun project

#

anyone know what offroad efficiency actually does? I've set it to 0 and to 100 and had no appreciable difference in how the vehicle runs offroad, is it just a durability thing?

#

ah ya, there is a chance of vehicle parts taking random damage over time. The vehicle itself has an offroad efficiency, and each individual part also has a modifier for offroad damage. Now I know

bronze yoke
#

i'm never touching grass ever again

astral dune
#

Looks like how well you drive offroad is the same for every vehicle

#

best I can tell, your engine force is divided by your current Gear*1.5 while offroad... which means the higher gear you're in the weaker your engine becomes, which I guess makes sense

#

Also explains why my Semi hauling a Trailer filled with the organized trait could only move in 1st gear offroad

astral dune
#

Can public members of java classes be accessed, or only methods?

hearty dew
#

Fields and methods

#

but methods can't be invoked in non-debug mode

astral dune
#

how do you access a field?

hearty dew
#

Don't think visibility even matters when using java reflection (haven't messed with that in years, so no sure

#

The global object has 3 functions related to fields, if I remember right. One to enumerate the fields of an object, one to get the field, and a third to get the value of that field from the object

astral dune
#

but none to write to it?

hearty dew
#

Don't think so.. However, java.lang.reflection.Field probably has a method to set a value, and that should be exposed lua-side

astral dune
#

ya, I have no idea how that would work trying to do it from lua, it would be hard enough in java

hearty dew
#

Once you have a field object, try printing it out. Then try printing out its metatable too using this ```lua
printR = function(t, depth)
if not depth then
depth = 1
end

local printR_cache={}
local function subPrintR(t, indent, depth)
    if depth == 0 then
        print (indent, 'max depth reached')
        return
    end

    if (printR_cache[t]) then
        print(indent.."*"..tostring(t))
    else
        printR_cache[t] = true
        if (type(t)=="table") then
            for pos,val in pairs(t) do
                if (type(val)=="table") then
                    print(indent.."["..tostring(pos).."] => "..tostring(t).." {")
                    subPrintR(val,indent..string.rep(" ",string.len(tostring(pos))+8), depth - 1)
                    print(indent..string.rep(" ",string.len(tostring(pos))+6).."}")
                elseif (type(val)=="string") then
                    print(indent.."["..tostring(pos)..'] => "'..val..'"')
                elseif (type(val)=="userdata") then
                    print(indent.."["..tostring(pos).."] => ".."("..type(val)..") "..tostring(val))
                else
                    print(indent.."["..tostring(pos).."] => "..tostring(val))
                end
            end
        elseif (type(t)=="string") then
            print(indent..'"'..t..'"')
        elseif (type(t)=="userdata") then
            print(indent.."("..type(t)..") "..tostring(t))
        else
            print(indent..tostring(t))
        end
    end
end
if (type(t)=="table") then
    print(tostring(t).." {")
    subPrintR(t,"  ", depth)
    print("}")
else
    subPrintR(t,"  ", depth)
end
print()

end```

#

hmm, let check java's docs to see what you'd look for

#

If it has set() exposed, that's what you want

hearty dew
astral dune
#

lol, so to call a method you do vehicle:method(), a field, well...

hearty dew
hearty dew
#

if I can find a way to get ahold of an instance of the java class in the lua console

astral dune
#

BaseVehicle.forcedFriction

hearty dew
#

Offhand, know a way I can get a BaseVehicle object via the console?

astral dune
#

getVehicleById(int id) is typically the way I roll, but you'd need the id of a vehicle that's currently loaded. I think there are other global functions like that though, I'd have to look

hearty dew
#

Do you know how I can work out an id of one that's loaded real quick to try that?

astral dune
#

something like this is what I'm currently doing:

local newMechanicsAction = ISOpenMechanicsUIAction["new"]
function ISOpenMechanicsUIAction:new(character, vehicle, usedHood)
print(vehicle:getId())
return newMechanicsAction(self, character, vehicle, usedHood)
end
#

then it just prints out the id when I open the hood

hearty dew
#

I haven't fiddled with vehicles yet, so figured be quicker to ask than to figure out myself :)

astral dune
#

no worries

hearty dew
#
x=getVehicleById(252) ; print(getClassFieldVal(x,getClassField(x,233)))```
#

that prints it out

#
for i=0,getNumClassFields(x)-1 do print(i, getClassField(x,i)) end```
#

that enumerates the fields

#
LOG  : General     , 1665031851843> 233 public float zombie.vehicles.BaseVehicle.forcedFriction```
astral dune
#

hmmm, I get an invocation error if I try

#

oh whoops, let me try agaiin

hearty dew
#

Setting works too.. but I just realized, it too, like Methods, is only exposed when running in debug mode :/

#
getClassField(x,233):setFloat(x,5)```
#

Set it to 5 there

astral dune
#

I mean, you can call methods all day out of debug mode

#

as long as they're exposed, of course, but most are

#

but yes, I managed to read from the field this time, its -1, which is expected

hearty dew
# hearty dew in `zombie.Lua.LuaManager.Exposer:exposeAll()`,```java if (Core.bDebug) ...

This java code is what exposes java to lua. It exposes Method, Field, and Coroutine only in debug mode. So you can use the global getClassFieldVal to get the value because that's a method in zombie.Lua.LuaManager.GlobalObject. However, you can't directly invoke setFloat on Field, because that's in the java.lang.reflect.Field class, which is only exposed in debug mode

astral dune
#

so I guess long story short is Fields are read only

hearty dew
#

yea, except in debug mode

astral dune
#

not the end of the world, I can still mess with wheel friction by messing with the wheels themselves, it just would have been real handy to use the vehicle level override that was that field

#

thanks for looking into it

hearty dew
#

Can also muck around with the effects of those fields by changing them in debug mod without having to reload a mod

#
getClassField(x,132):setFloat(x,1)```
Set mass to 1
astral dune
#

hahaha ya, messing with mass is hilarious, near zero you just go sideways if you try to accel

#

its also not a bad way to give the vehicle the impression of being more powerful, because it can accel a lot easier

#

tends to flip real easy though

#

weird, could have sworn the mechanics UI showed tired friction, now its gone. I guess we'll give this another stab tomorrow

hearty dew
#

Huh.. I increased the maxSpeed to light speed and it uses up fuel absurdly quick, before I even get up to a reasonable speed :p

astral dune
#

that's interesting. Hadn't look into fuel efficiency yet

astral dune
#

whelp, I'm not convinced wheel friction does anything, at least not on roads. Normal limits are 0.2 to 2.3, and with shenanigans I've even tried it at 0 at 10, no noticeable difference in acceleration, turning radius, stopping time or distance or anything else that I can think of. Either it only matters off-road, or only makes your tires squeal marginally louder/quieter or something else hard to notice

#

guess I'll try to dig deeper in the code tomorrow. Problem is these values are fed to the Bullet physics engine, which I don't appear to have the source code for

ruby urchin
undone elbow
#

How to get item property like "WorldRender" etc? Seems there is no function for it.

low sky
#

i can barely understand c#

gilded hawk
#

I was wondering, did anyone develop a parser for the .txt files zomboid uses for items and vehicles?
Like this kind of file media\scripts\clothing\clothing_bags.txt

drifting ore
#

someone should make a mod where "The Gonk" plays after you die

ancient grail
#

is it possible to call a server function without args. if the function doesnt need any variables ?

drifting ore
#

We need a mod called "Fucked Starts" where you just spawn in a locked jail cell and shit so you can experience what it is liked to be fucked.

Just credit me with the idea in the bio when you make it.

spiral sparrow
#

You jest but I'd actually like that just for dynamic stories with your friends where you have to save someone

spiral sparrow
#

Dear god

mystic meteor
#

is there documentation on the ContextMenu's addOption function? I was trying to find it in the code but can't find its definition anywhere

gilded hawk
#

Does anyone know how SoundRadius and SoundVolume affect zombies when you use a firearm?

mystic meteor
#

to my knowledge SoundRadius is directly the number of tiles the sound will reach, and volume likely has something to do with their hearing abilities

calm acorn
#

the hearing ability sandbox setting just multiplies the radius that a sound can be heard from by 3 for pinpoint and 0.75 for the hard of hearing setting, im not at home right now but its in world sound manager just search for sandbox. I wanted zombies to hear generators and found the hard coded 20 setting point there and then found the hearing setting. the problem is it scales all sounds.

shadow geyser
shadow geyser
mystic meteor
#

in other news, the live-update function of my remake of itemtweaker is starting to come together, bar stupid issues I wasn't able to test until recently

TVK_ITE: WARN: Updating live info for Base.AssaultRifle.
TVK_ITE: ERROR: Update function for [MinRange] is not currently supported.
TVK_ITE: ERROR: Update function for [MaxRange] is not currently supported.
thick karma
#

Aloha, friends.

#

Is there a simple mod that lets me access any container in inventory at any time without equipping it?

#

It's pretty stupid that I have to equip things to open and inspect them.

meager lion
#

drop them

thick karma
#

That's a clever solution but a bit annoying lol

meager lion
#

Lol

thick karma
#

Needing to unequip other things makes sense to a degree, but honestly not even that. I could easily lean my bat on my shoulder while I open a backpack and thus have it .25 seconds from being useful while also looking inside of a bag in real life.

meager lion
#

As far as i know on a serious point, there isnt

thick karma
#

😭

#

No worries

#

I'm looking at the sac mod in ExtraSauce QoL

#

Not sure how it works or how it makes container life easier

#

Might be my only hope

meager lion
#

Odds are it wouldnt be hard to make happen, albeit a bit time consuing

#

Since the only thing that stops you from looking through them normally is they need to be equipped. One approach that could be taken is allowing players to equip more then one, another is make proxy equipped containers that weigh nothing but are populated with the items of the corresponding one

#

3rd idea would be a floating dummy object at the players feet if all else fails, but that would be the last route i would take

thick karma
#

Fair enough. I am gonna try EasySauce's Sac and get back to you. (That's not nice, EasySauce.)

ancient grail
shadow geyser
#

hmm?

#

there is only ever one server

shadow geyser
ancient grail
#

ammm cuz i need it to read files from serverside but whn i do it as client it reads it from client side

ancient grail
bronze yoke
#

can you explain what you're trying to do?

shadow geyser
vast nacelle
#

Need a bit of explanation on client/server interactions.
I have a mod that adds a new healing action. It currently doesn't work when one player applies it to another player because I didn't write code to handle that properly. So I need to make a sendClientCommand that has the client send an alert that this healing action has occurred and let the server apply the effects of the action to its own copy of the healed player, right?
Is that it? Everyone (including the person being healed) will see the effects of the item? Or does the server also need a function to send out a notice to all clients (or at least to the person getting healed)?

ancient grail
bronze yoke
#

no, unfortunately, health only exists on the client, so you'd have to have the server then send it to the player being healed

vast nacelle
#

Alright. Thanks.

astral dune
#

Code in the server folder also runs on the client, also the folder the code is in doesn't determine where it runs, the only real effect it has it that /client/ code isn't accessible by the server

#

If you want the folder to read a file, but the trigger to make that happen is client side, like through a GUI, you would have to send a client command to tell the server to read the file, and likely a server command to send the data back to the client if it's needed there

shadow geyser
bronze yoke
#

it does

#

we were talking about this the other day, so we tested it

ruby urchin
vast nacelle
#

@ruby urchin Thanks. That makes things very clear.

sour island
#

When you know your update didn't break anything.

mystic meteor
#

very nice

#

in other news, the fact that Indie Stone is inconsistent about their is* function capitalization is driving me up a wall. You've got IsWeapon and isTrap, etc, all on the same item.

#

not to mention the mix of public and private attributes on the Item class that seem to be a buildup over time of different code styles

grim rose
#

quick question

#

StaticModel = .Base/PillBottle,

will this work?

ruby urchin
#

nop

#

I think, never I did use it like that, but from what I remember, if it's a Base module, you just need add the name model, if it's other module, should be something like Dislaik.MyModel_Ground

burnt steeple
#

GUYS please HELP HOW to remove scratch from trees ? i am tring to modify outdoorsman trait in main creations lua but i dont know what to do anyone can help me ??

grim rose
#

look it up

#

now i need your help because i can't look it up, anyone knows where to look for icons from main game?

tribal bane
#

Hey, want to maybe make a mod for a server was wondering is there any way to make it so a specific safehouse is tresspassable and lootable for a set amount of time?

#

The end goal would be to make players have to schedule their raids against a specific safehouse rather than doing it at any time without warning

grim rose
#

any idea why my pills can't be ingested?

mystic meteor
#

Well, after beating my head against the wall for a few hours, I give up and I think I've decided that you just... can't read the public fields on a zombie.scripting.objects.Item

ancient grail
#

can we get an adjacent square but a bit further?

astral dune
#

no fields, only methods, final destination

mystic meteor
astral dune
#

the truth is you can read fields, just can't write to them unless you're in debug mode

astral dune
sour island
grim rose
#

oh no

sour island
#

You can also call getSquare() using another squares xyz

grim rose
#

pills are lua

#

dammit

sour island
#

Medicine ingestion is Java isn't it?

grim rose
sour island
#

There's like 3 hard coded variables

#

If you wanted to make more types of medicine you'd have to create your own health system from scratch

#

There's a medicine overhaul nod

astral dune
#

antibiotics are food iirc

grim rose
#

today i will make quick mod

mystic meteor
grim rose
#

Why bother

astral dune
mystic meteor
#

oh you need to do weird shit with getclassvariable huh. Easier to just use the stored variables I have. I was trying to read from a prototype to set an instantiated item, which would be better done using the prototype since it can do type-correctness checking. But I'm not gonna try to do weird things that hardcode to specific variables like that

#

when I already have the data, better to maybe break by having bad data than to definitely break when the class structure changes

astral dune
#

thats fair, I would avoid using it if possible as well

mystic meteor
#

good to know, though

shadow geyser
# grim rose any idea why my pills can't be ingested?

to my memory, the pills and just like sleeping tablets and antibiotics. They are all hard coded to have the "take pill" action in the java, so it is not trivial to mimic medicine. and if you just want to utilize food, I faintly remember it needing a minimum of 1 hunger, for the eat option to be there.

#

probably the best way to simulate medicine is to make it a drainable, then just add a custom context menu for it

grim rose
#

so i do second thing, i make pills unpackable

drifting ore
ancient grail
ancient grail
grim rose
#

it doesn't need to nutricous to be ingested

#

it just need type food to be edible

ancient grail
dense totem
sour island
#

When you have the IsoPlayer you can use getX, getY, getZ inside of getSquare

#

@ancient grail

#

You can do x + 4 for example

dense totem
#

I would make a scrap laser gun mod but it would take me the rest of my human lifespan

sour island
#

If you need ALL tiles within 4 tiles there's a bit more to it

grim rose
#

so somewhat near that

dense totem
grim rose
dense totem
#

Yeah I stopped cuz c# is cursed

#

I do know lua tho

#

But idk how to even start making a mod so

grim rose
#

i know neighter of them, i made a progress because peeps help me out there

grim rose
#

it just bit outdated

ancient grail
dense totem
#

And it also needs models

#

I do have a friend who is a modeller

#

But I wouldn't want to waste his time if I don't even know how to make a mod

grim rose
#

How complex mod you want to nake it

#

?

dense totem
#

That can be crafted and uses battery's as ammo

#

And some sort of way to recharge batteries

grim rose
#

It isn’t that hard

#

I could help you with basic

dense totem
#

I mean I could try but idk if it is worth the effort

grim rose
#

If you would have fun after doing it why not?

dense totem
dense totem
#

My dream tho is to make either a basic chemsitry system or RC vehicles

grim rose
#

Like bleach and ammonia?

dense totem
#

But RC vehicles would defo be cool

#

Like strap a pipe bomb to a RC car and drive it into a horde

shadow geyser
sour island
#

Hopefully there's an event for mixing included out the gate

#

Would love to see some SS13 level chemistry achieved in PZ

grim rose
#

maybye all that tutorials how to made homemade illegal stuff from bait videos will be put into use when they would implement chemistry

#

on antoher note

#

can someone help me

#
{
    imports {
        Base
    }
    recipe Open box of active charcoal
        {
        destroy ACT,
               Time:10,
        Result:ACTP=10,
        OnCreate:Recipe.OnCreate.OpenACT,
        Sound:PutItemInBag,
        Category:Health,    
        }
}```
#

the zomboid simply doesn't read that

#

whats funnier

#

i use same formula in other mod of mine- it works

#

any idea why it just doesn't work?

sour island
#

Is destroy actually a thing?

#

Afaik item types alone are for ingredients, and : for a value/delta

#

"keep itemType", would not use the thing

#

You also wouldn't need an oncreate unless you want extra stuff to happen

grim rose
#

like egg carton

sour island
#

OnCreate is for adding extra functionality - the recipe itself adds a context menu

grim rose
#

okay then i will check

sour island
#

I also don't recall seeing "destroy" used as a syntax before

grim rose
#

its from main game

sour island
#

Weird

#

I'd have to look that up, maybe it's redundancy / new for clarity's sake

#

The other issue might be the fact you're not using the module for ACT

#

Might have to be DAC.ACT even if you import base

grim rose
#

i think i found a issue

gilded hawk
# grim rose any idea why my pills can't be ingested?
module NeuroTraits {
    imports    {
        Base
    }

    /** 
        If the name of an item starts with 'Pills' then in the ISInventoryPaneContextMenu
        You can hook into ISInventoryPaneContextMenu.onPillsItems
        As an alternative, if are not using Drainable items, 
        you can copy how the cigarette works via overriding the oneat function (OnEat_Cigarettes)
    **/
    item PillsAdderal
    {
        DisplayCategory = FirstAid,
        Weight    =    0.2,
        Type    =    Drainable,
        UseDelta    =    0.05,
        UseWhileEquipped    =    FALSE,
        DisplayName    =    Adderal,
        Icon    =    PillsBetablocker,
        Tooltip = Tooltip_PillsAdderal,
        StaticModel = PillBottle,
        WorldStaticModel = PillBottleGround,
        Medical = TRUE,
    }
}
require "TimedActions/ISBaseTimedAction"

local old_ISTakePillAction_perform = ISTakePillAction.perform
function ISTakePillAction:perform()
    local result = old_ISTakePillAction_perform(self)
    if self.item:getModule() == 'NeuroTraits' then
        self:useNeuroTraitPills()
        self.item:Use();
    end
    return result
end

function ISTakePillAction:useNeuroTraitPills()
    local type = self.item:getType()
    if type == "PillsAdderal" then
        ADHDCore.applyMedication()
    end
end
gilded hawk
gilded hawk
grim rose
#

thanks m8

vast nacelle
grim rose
#

Do i apply my own

        ADHDCore.applyMedication()```
#

i need to make function that removes nuesea

#

don't i?

#

@gilded hawk ?

gilded hawk
grim rose
#

allright then i have to find how to change food poisoning level

#

i will continue tommorow

#

my head is crushing me rn

weak sierra
#

hey how do ya decrement an item's uses programmatically

#

does it use condition for that?

#

or is it that "jobDelta" thing

#

oh it's probably "Uses"

#

derp, didn't see that

thick karma
#

No regrets about trying Sac

ancient grail
#

on the oncreate functions for recipe it says
(item result player)

ammm which o e is the props? or source?

or maybe im looking at the wrong thing

ithink i should look at on test
i only wanted to make a recipe that uses hot water only and dont need to cook cuz after the recipe makes the character do animation then its cooked

safe silo
#

How would I change the model of a pop can?
I've made my own model, put it in models_x and made the texture in textures

In my code file i've set it to be
StaticModel = MYMODEL,
WorldStaticModel = MYMODEL,

However it still does't work. It takes the vanilla pop can and fucks the texture up on it

ancient grail
safe silo
#

yea I tried that to like

model CocaCola
{
mesh= .x file
texture = .png file
}

still nothing

#

And then ofc staticmodel = CocaCola etc

#
 item CocaCola
    {
        StaticModel     = CocaColaModel,
        WorldStaticModel = CocaColaModel,
    }

    model CocaColaModel
    {
        mesh        = CocaColaCan,
        texture        = CocaColaCanTexture,
    }

ancient grail
#

ahh perhaps its supppppppppeeeeeerrrrrrr tiny

safe silo
#

I used a regular pop can as scale as my model

ancient grail
#

try adding scale=,

safe silo
#

Yea scale = 1 did nothing either ;_;

ancient grail
#

might still worth a shot sir

#

if u dont put the scale the 1 is the scale

#

also try puting it on
WorldItems folders both the texture and the mesh but on their respective parent folder

safe silo
#

Okay seems to work now

#

This was weird

#

Sorry!

#

But thank you for the help ā¤ļø

ancient grail
#

``models_X/WorldItems/CocaColaCan

textures/World Items/CocaColaCanTexture``

meager lion
#

Awesome good to know

hearty dew
#

@mystic meteor Are you still in need of a general purpose hash function in lua? I might have something if you still do

boreal crow
#

I want to make a mod that lets you build a wall using vehicle tires, so far I got a new "moveable" but I'm stuck - where's a good resource to learn how to make a new moveable?

dim geode
#

someone should make dismemberment modddd

mystic meteor
astral dune
#

More vehicle testing today, and the results are:
Wheel friction just really doesn't matter at all. Set it from -100, to 0, to 100 and had absolutely no noticeable difference in how the vehicle runs. Normal limits on it are 0.2-2.3, btw
Engine loudness is affected by RPMs, but there is a lot of RNG as to how loud it is at any particular moment and the differences between the standard levels you'll normally see is pretty small. For example, a sportscar with a perfect engine and performance muffler has a noise radius of a few car lengths, while a beat up truck with no muffler at all going full speed has a noise range of maybe triple that, going out to about a block in length
A little bit disheartening for me, as I'm making my own mechanics overhaul mod but I am finding the list of things we have access to is fairly small and many of them don't seem to have much effect

hearty dew
#

Interesting. I'd have expected the noise radius to be a bit greater in those 2 scenarios, but it just seems on par with what I'd expect from a normal car in good condition. Did you notice whether the car noise radius much greater while the car is in reverse?

#

Regarding the wheel friction, maybe that friction refers to the static friction of the tires against the road (not the rolling friction)

#

i.e. how far it'll slide when spinning out or when brakes lock up (idk if pz cars have anti-lock brakes šŸ˜… )

astral dune
#

I went 150 mph into a full e-brake slide and it still didn't seem to matter, lol

hearty dew
#

Oh well :p

#

Might just be some properties that were added in but never used or perhaps changed but the properties were left in

astral dune
#

I'd love to look into the physics engine and know for sure, but I don't have the source or any documentation on it

#

lets see how loud speed-demon reverse actually is...

hearty dew
# mystic meteor I could still use something yeah
TahvohckUtils = TahvohckUtils or {}

TahvohckUtils.rshift = function(a, disp)
    if disp < 0 then return TahvohckUtils.lshift(a, -disp) end
    return math.floor(math.fmod(a, 2^32) / 2^disp)
end

TahvohckUtils.lshift = function(a, disp)
    if disp < 0 then return TahvohckUtils.rshift(a, -disp) end
    return math.fmod(a * 2^disp, 2^32)
end

TahvohckUtils.isArray = function(t)
    local i = 0
    for _ in pairs(t) do
        i = i + 1
        if t[i] == nil then return false end
    end
    return i
end

TahvohckUtils.create_multitype_comparator = function(to_comparable)
    to_comparable = to_comparable or tostring
    return function(left, right)
        local left_type = type(left)
        local right_type = type(right)
        if left_type ~= right_type then
            return left_type < right_type
        elseif left_type == "number" or left_type == "string" then
            return left < right
        elseif left_type == "boolean" or left_type == "nil" then
            return not left and right
        else -- "table" or "function" or "userdata" or "thread"
            return to_comparable(left) < to_comparable(right)
        end
    end
end

TahvohckUtils.sorted_pairs = function(t, compare)
    local sorted_keys = {}
    local initial_control_variable = nil
    --for k in next, t do -- wtf. kahlua 2 has removed next
    for k in pairs(t) do
        table.insert(sorted_keys, k)
    end
    table.sort(sorted_keys, compare)
    return function(state, control_variable)
        local next_key = table.remove(state)
        if next_key ~= nil then
            return next_key, t[next_key]
        end
    end, sorted_keys, initial_control_variable --, closing_value
end

TahvohckUtils.knuth = function(x, lengthInBits)
    --[[
    -- knuth multiplicative hash
    -- Numerous issues because this hash functions on integers that overflow, while lua uses doubles for numbers.
    -- Numbers beyond 9007199254740991 lose precision, eventually causing hash to always be 0
    if type(str) ~= "number" and math.floor(x) ~= x then
        error(string.format("TahvohckUtils.djb2: Can't hash non-integer types (%s)", tostring(str)))
    end
    ]]

    local hash = 2654435769 * x
    if lengthInBits then
        hash = TahvohckUtils.rshift(hash, 32 - lengthInBits)
    end
    return hash
end

TahvohckUtils.djb2 = function(str)
    --[[
    -- djb2 hash
    if type(str) ~= "string" then
        error(string.format("TahvohckUtils.djb2: Can't hash %s types (%s)", type(str), tostring(str)))
    end
    ]]

    local hash = 5381
    for i = 1, #str do
        local c = str:byte(i)
        hash = TahvohckUtils.lshift(hash, 5) + hash + c -- = hash * 33 + c
    end
    return hash
end
hearty dew
# mystic meteor I could still use something yeah

And here's the actual hash function to call:

TahvohckUtils.hash = function(x, lengthInBits, strict, state)
    --assert(lengthInBits > 0 and lengthInBits <= 32)
    lengthInBits = lengthInBits or 32
    strict = strict == nil and true or strict
    local t = type(x)
    local hash = 99531109
    if t == "number" then
        if math.floor(x) == x and x < 3393263 and x > -3393263 then
            -- Hash integers in the range that won't cause issues due to no integer overlow and precision loss due to
            -- doubles, which all lua numbers are. On 64bit, precision loss happens beyond +-9007199254740991
            -- Alternatively, could hash all numbers as strings, but the string hash is O(log x) while this is O(1)
            hash = TahvohckUtils.knuth(x)
        else
            -- Hash doubles and large integers as strings
            hash = TahvohckUtils.djb2(t..tostring(x))
        end
    elseif t == "string" or t == "boolean" or t == "nil" then
        if t ~= "string" then x = t..tostring(x) end
        hash = TahvohckUtils.djb2(x)
    elseif t == "table" then
        state = state or {}
        state.hashcache = state.hashcache or {}
        state.hashcachecount = state.hashcachecount or 1
        local cachedhash = state.hashcache[x]
        if cachedhash then
            return cachedhash
        else
            -- Because tables may be recursive, we cannot cache the hash of the table. Also since a table's hash
            -- is not unique to an instance (e.g. all empty tables have the same hash), we do not cache the hash
            -- of the table. Instead, a hash of a counter is cached. This enables the final hash to capture whether
            -- the same instance of a table was inside the containing table multiple times. For example, it can
            -- distinguish between {a,b,b} and {a,a,b} where a={} and b={}
            state.hashcache[x] = TahvohckUtils.hash(state.hashcachecount, lengthInBits, strict, state)
            state.hashcachecount = state.hashcachecount + 1
            local array_length = TahvohckUtils.isArray(x)
            if array_length then
                for i=1,array_length do
                    hash = TahvohckUtils.lshift(hash, 5) + hash + TahvohckUtils.hash(i, lengthInBits, strict, state)
                    hash = TahvohckUtils.lshift(hash, 5) + hash + TahvohckUtils.hash(x[i], lengthInBits, strict, state)
                end
            else
                local to_comparable = function(a)
                    if strict then
                        error(string.format("TahvohckUtils: Cannot reliably compare %s type (%s)", type(a), tostring(a)))
                    end
                    return type(a)
                end

                for i, j in TahvohckUtils.sorted_pairs(x, TahvohckUtils.create_multitype_comparator(to_comparable)) do
                    hash = TahvohckUtils.lshift(hash, 5) + hash + TahvohckUtils.hash(i, lengthInBits, strict, state)
                    hash = TahvohckUtils.lshift(hash, 5) + hash + TahvohckUtils.hash(j, lengthInBits, strict, state)
                end
            end
        end
    else --elseif t == "function" or t == "userdata" or t == "thread" then
        if strict then
            error(string.format("TahvohckUtils: Cannot reliably hash %s types (%s)", t, tostring(x)))
        end

        -- Hand wavy hash based only on the type
        hash = TahvohckUtils.djb2(t)
    end

    -- In Kahlua, the % operator breaks on on sufficiently big numbers, so using math.fmod.
    -- Verify with 2^37%100 and 2^38%100
    return math.fmod(hash, 2^lengthInBits)
end
#
print( TahvohckUtils.hash("woohoo") )
print( TahvohckUtils.hash( { "my", "array" } ) )
#

Kinda slow, but seems to work well, in so far as hashing can be done in lua :p

#

If you set the strict parameter to false, it will do its best to hash functions, threads, and userdata (things like IsoZombie objects from java). But on those objects, lua (or kahlua in the case of functions) don't have a good way to hash/fingerprint those types. Also if it encounters a table with another table as a key, it will error because it can't sort those keys (same for functions, userdata, or threads as keys), but you can set strict to false and it will work with some caveats.

Basically, set strict to false if you are okay with collisions due to poor hashing of function objects, userdata, and thread objects and okay with hashes not being repeatable when a table contains those types or tables as keys.

glacial flicker
#

Anyone know of a mod that disables military clothing and zombies that spawn with it? In the future I'd like people to drip differently, not the classic military gear because it's the safest

boreal crow
#

Where can I find learning resources for doing the following:
ā—½ļøNew Moveable (E.G. a Tire Wall)
ā—½ļøRecipe type system on an item that's on the ground (E.G. scrap a car door, without picking it up?)

hearty dew
boreal crow
#

I'm guessing for an on-ground system, I'd use some custom context menu option on X(Valid craft item), and an Action that checks that there is a nearby X

hearty dew
#

And could remove the individual military clothing items from the other loot distribution/definition tables @glacial flicker

glacial flicker
hearty dew
#

Might ask in #mod_support if such a mod already exists. I don't know of one

swift kiln
bronze yoke
#

it's fairly old, but a lot of the resources there are still useful

#

if you're going to use the javadoc, make sure to use the one linked as 41.65, the official version is hugely outdated

mystic meteor
#

@hearty dew damn, that's quit a bit of code. I'll look over it!

#

also wtf do you MEAN lua has String.Format AyaneHyloStabAngy

#

I've been doing concat this whole time

#

hm... it's a naive hash, but it might work. I actually saw some Lua hashes that implemented MD5, so I might try to replicate those instead

hearty dew
#

Mm, those are cryptographic hashes. Mine above are more fingerprinting, which seemed to be what you were after

hasty lodge
#

This has probably been asked numerous times, but is there any way to reload vehicle spawns without completely resetting the map or editing the chunks at all? My friends and I keep adding mods and at this point we won't see any of them unless we completely wipe.

hasty lodge
#

Thank you!

mystic meteor
#

I'm very used to the "small changes, big difference" mentality of them

#

As long as they're suitably unique they do the job

hearty dew
#

If you call tostring on a table, for example, you get something like table 0xfa120012. So you end up hashing a memory address, which is not going to give a consistent hash value across machines nor across opening/closing pz

#

Most of my code is iterating over objects and handling different types in a way that avoids those problems

#

Only like 10 lines are the actual hashing of data šŸ˜…

#

the djb2 string hash and knuth hash for integers

mystic meteor
#

Ha, fair

hearty dew
#

and some stuff to avoid precision loss when numbers get too large

mystic meteor
#

That's how hashing goes...

hearty dew
#

You could drop in md5 (or whichever other hash function) in place of djb2 in my code too, btw

mystic meteor
#

I still need to get the rest of the code running before I even look at implementing that in the end

#

And noted!

hasty lodge
bronze yoke
#

do you mean the sandbox options aren't showing up when you configure the server? you need to have the mod activated from the main menu for options to show up there

hasty lodge
#

Okay, one second. Sorry, brand new to modding this game

hasty lodge
bronze yoke
#

i'm glad it's working ^u^

meager obsidian
#

So I have the rv interior mod and all the required mods with it, and I have not found a single rv yet.

hasty lodge
# bronze yoke i'm glad it's working ^u^

One more thing, I promise. The mod is saying that "Player claimed vehicels are not removed (via Valhalla Aegis, a simplistic claim system will be added to this mod in the future)" However I can't find a vehicle claiming system under that name. Am I missing something?

hasty lodge
#

Okay

dense totem
shadow geyser
plucky ledge
#

Hello there, I wanted to ask if it is possible to integrade a custom made skeletton rig into the game. Does someone know something about this and could point me into the right direction ?

Because of the recent popups of silent hill related mods I wanted to integrate this bad boy here:

reef rose
#

hey šŸ™‚ Is there a way to adjust the brightness or color/taint of indoor lights, when the room lights are on?

gilded hawk
#

Which is the best way to convert mp3 in ogg for zomboid?

smoky meadow
#

guys need help! how to get a fresh item from recipe. i want to add a recipe to get a apple but when i do that. the apple do not spoiled. there's no fresh in his display name.

thorn cipher
mystic meteor
gilded hawk
mystic meteor
#

I'm not sure if PZ has any special restrictions. You should be able to do a direct conversion with no issue.

#

and ffmpeg is smart enough that you should be able to just do ffmpeg input.mp3 output.ogg for all the files

mystic meteor
#

ha, nice

dim geode
#

I keep bringing it up but I jus think about what sets zomboid apart from other games in its genre:
Your character is actually vulnerable from infection
Shows the breakdown of the world and subsequent erosion and overgrowth that takes over (custom sandbox settings)

That’s why something like dismemberment could be huge for this game- the attention to detail is already there and it would be a personal dream of mine to see it happen. I’d even be down to fund it

#

Like I said the pitch is relatively simple:

Any time you attack infected with a bladed weapon and successfully land a hit a dice is rolled to determine whether or not dismemberment occurs and at which appendage/or the head.

Certain weapons have a higher chance of dismemberment, would pair really cool with some added gore from the sandbox settings tab.

bronze yoke
#

that sounds doable

dim geode
#

The head could have the least likelihood of being dismembered

#

While the arms and finally the legs would have the highest

bronze yoke
#

personally i'd have the head only able to be dismembered on a blow that would kill anyway

glacial flicker
#

How does one use the Bob_ animations?

dim geode
#

But it would be cool to be running around with a katana slicing through the hordes and seeing all the body parts

bronze yoke
#

i can't think of a way to have like, flying body parts or anything

#

but having the dismembered parts disappear from the zombie's model seems quite doable

gilded hawk
#

Do I need to convert the in game coordinates to a different kind of coordinates to make a spawn points mod?

vast nacelle
#

Depends on which type of coordinates you have. The absolute ones that are like 8935x7431 or the relative ones where you have a Cell coordinate and an X,Y coordinate relative to that cell. You need the Cell + Relative for a spawn point.

gilded hawk
#

I assume it's one of these right?

vast nacelle
#

Yeah. You need the Cell coords there as worldX and worldY.

#

posX and posY then are
posX = SquareX - (worldX * 300)
posY = SquareY - (worldY * 300)

#

Then the spawnpoints.lua would look like this for that position

return {
  burgerflipper = {
    { worldX = 41, worldY = 12, posX = 40, posY = 58, posZ = 0 }
  },
}
end```
gilded hawk
#

I'm a bit confused

#

So, worldX is the cell?

vast nacelle
#

Yes

gilded hawk
#

Okay, so worldX = 41, worldY = 12,

vast nacelle
#

And posX and posY are the square coordinates relative to that cell so need to be calculated from the SQUARE coordinates in the tool since those are relative to the world

gilded hawk
#

Okay, so

  • posX 12340 - (41 * 300) ?
vast nacelle
#

Yes

gilded hawk
#

Okay, I hate how zomboid handles coordinates, but I get it now, thank you

gilded hawk
# vast nacelle Yes

Does this look good?

local function getCoords(squareX, squareY, cellX, cellY, z)
    return {
        worldX = cellX,
        worldY = cellY,
        posX = squareX - (cellX * 300),
        posY = squareY - (cellY * 300),
        posZ = z ~= nil and z or 1
    }
end
vast nacelle
#

yeah

gilded hawk
#

Alrigh thank you again

shadow geyser
ancient grail
#

hi guys is it possible to only enable an on event
if i put the event.On___
inside a function

or do i need to create a boolean that just returns it if the function isnt triggered yet?

thick karma
#

Anyone want to help me understand a probably very basic issue? I am trying to get a Hello World mod working, and I can see the mod and description in my list, and I can enable it, but when I go into the game, it doesn't seem to be working as expected. The code is very simple:

local readingReadyBB = false

local function readingConceivableBB()

    local player = getPlayer()

    player:Say("Hello World! The variable's value is " .. tostring(readingReadyBB))

end

Events.OnEquipPrimary.Add(readingConceivableBB)

Events.OnHitZombie.Add(readingConceivableBB)

Events.OnPlayerAttackFinished.Add(readingConceivableBB)

I only add the function to so many events because OnHitZombie wasn't working...

I am following a tutorial from December 2021... the set-up did not suggest I need anything beyond this lua and the mod.info file in the right places... the above lua is in ...User\Zomboid\mods\MobileReader\media\lua (where User is my username on my PC)

bronze yoke
#

you need to place the lua file in lua\client

thick karma
#

I see.

#

Thanks

#

Trying now

#

Worked, thanks so much

#

I don't know how I missed it, but I went back and vid said that clear as day at 4:23, but it happened so fast I must have been looking away

boreal crow
#

Can someone assist me? I'd like to make a new type of wall (moveable? I'm not sure) but basically I want it to be added to the build menu, where could I learn where to start?

#

And am I correct in assuming I build 2d sprites, with rotations, then use tileZed to make a .tiles for my mod?

gilded hawk
#
ERROR: General     , 1665169521319> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: can't create player at x,y,z=12458,3668,1 because the square is null at IsoWorld.init line:2779.
ERROR: General     , 1665169521319> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: can't create player at x,y,z=12458,3668,1 because the square is null
    at zombie.iso.IsoWorld.init(IsoWorld.java:2779)
    at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268)
    at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225)
    at java.base/java.lang.Thread.run(Unknown Source)
#

Okay, working with spawnpoints is now the thing I hate the most

gilded hawk
#

Alright, I can't be bothered to deal with this

I was trying to make the character spawn in Louisville in the hospital, if someone can do it please let me know, I'm attaching my non functional code hre

thick karma
#

I'm seeing a lot of exceptions in the debug menu for files like More Simple Traits, More Traits, and Proximity Inventory, among other things... and the little down arrow button in the F11 menu seems to take me to a lot of break points that involve ISUI files... Do these exceptions indicate issues with those mods? Where is the ISUI stuff coming from? That doesn't sound like a mod I installed. Is it common for highly reviewed mods to throw lots of little exceptions? The exceptions often seem to get thrown from player object loop declarations...

tranquil reef
#

I'm not certain about your problem but ISUI is a folder in the game directory

vast nacelle
#

@gilded hawk The issue is you put "posZ = 1". '0' is the ground floor so you were trying to spawn players in the air and the game didn't like that.

tranquil reef
#

It contains, UI scripts lol

thick karma
#

Understood... is it possible a mod is causing exceptions to be thrown from the UI file?

#

E.g. Proximity Inventory, which seemed broken afaik?

shadow geyser
tranquil reef
#

I think ISUI exceptions are fairly common, especially when you have a lot of mods together

tranquil reef
shadow geyser
#

lmao

tranquil reef
tranquil reef
thick karma
#

Hmmm okay no problem thanks. Intuitively errors feel sus, but I could see that perhaps there are acceptable ones.

#

I mean I see them consistently referencing the loop for some reason and I'm wondering if perhaps it fails because the player count drops to 0, and 0 - 1 is -1, so the loop says "Do a for loop from 0 to -1!" and the compiler says "learn math!"

#

And perhaps nobody cares enough to notice or catch that error because the program doesn't crash over it?

#

I need to simulate the error in my own mod and play with it I guess

#

Thanks anyhoo

#

Anyone who understands the maps well able to tell me how big a "volume" I should use to get zombies attention using DoFootstepSound from maybe 20 feet away?

#

I think 1 unit corresponds to a "tile" of the map?

#

Not sure exactly how big that is in practical terms

#

It actually says "volume" online and doesn't specify if it's a cell or a tile 😭

timid saffron
#

Is there a mod that let's you throw bags over fences/out of windows?

gilded hawk
#

It was not in the air

vast nacelle
gilded hawk
vast nacelle
#

This is where I spawn in with the Z set to 0

gilded hawk
#

O.O

#

Odd

#

I'll re try in game and let you know

astral dune
#

is this an "off by one" scenario? How big is a cell?

gilded hawk
#

I just found out there is a spawn points editor 😐

#

goddamit lol

round depot
#

Is there a mod that lets you bail out of moving cars

#

If there is, can someone link it

#

If there isn't, can someone make it šŸ™

astral dune
#

I'm certain I've seen one. I do not remember what it was called though

#

Anyone know why Paint My Ride is single player only? Is there something in the engine preventing it from working or does the mod dev just not have the time to put MP compat in?

bronze yoke
#

i have no idea why it'd be singleplayer only

#

i haven't specifically tested colour, but those things usually do work in multiplayer

astral dune
#

I'm wondering if it's literally just a servercommand thing they haven't implemented

bronze yoke
#

i think paint my ride has been around for a pretty long time, so my best guess is they just haven't had time to update it since b41 multiplayer came out

astral dune
#

thats the one. Its funny I literally searched for "tuck" and didn't see it

hearty dew
thick karma
#

I'm having trouble figuring out what the actual exception is, sorry. Still trying to learn to work that menu and I have been busy for last couple hours, hence dropping the question on here while I'm busy

#

Figured maybe an answer would show up that made sense while I was afk

#

I just know it kept pulling up various files in those mods

hearty dew
thick karma
#

Thanks, I was actually going to have to research or ask for confirmation that the same file is being shown in-game

#

I actually g2g, but if you're feeling bored and generous with your brilliance, I am going to be hunting through the media folders in search of the LUA file that affects whether I can walk while I read... If you happen to know already and want to share, I'll appreciate it when I have time to look later! Haha.

hearty dew
hearty dew
thick karma
#

Also trying to figure out how to see what they did xD

#

Will learn more later... g2g

#

Thanks again

vast nacelle
#

Do one of the anti-cheat measures prevent altering player health outside of a timed action?
I have a function that heals wounds when using a new item and it works fine when that function is called from a Timed Action (person uses item on themself) but doesn't when its called outside of that (server command telling a client to apply the item when one player uses it on another)?

#

If I rapidly use the item on another player, it'll still heal a wound or two which makes me suspect the anti-cheat isn't fast enough and is nixing it mid-call if it occurs frequently enough.

hearty dew
thick karma
#

Interesting... Thanks šŸ™

steel delta
#

Is there a function to get all players in the game, I've been looking for one without luck

ruby urchin
steel delta
#

thanks

#

It looks like that function only returns players while the game is running on a server, I will fallback on getSpecificPlayer when in single player

ancient grail
#

whats the diffrence between
blahblah = function()
function blahblah()

shadow geyser
ancient grail
#

ow i see

#

i read something about saying its loadstring or something

thick karma
#

Okay thanks. Is it in pseudo-meters, double-feet*, mystery units, or what? Any guesses

weak sierra
#

they're tiles

#

i don't have some specific ratio i've just got like 2000 hours in the game so i have a feel for what 20 feet might be roughly :p

thick karma
thick karma
thick karma
#

Attempted index of a non-table... implying player doesn't exist anymore perhaps?

#

This error only ever seems to trigger after I die

#

also other errors like it

hearty dew
# thick karma

That code assumes getSpecificPlayer() may not return nil when using an index in the range of 1 to getNumActivePlayers(). Quickly looking through the vanilla lua code, it doesn't make that assumption. It checks that the player object is not nil before using it

thick karma
#

Okay that's what I was trying to get at. So just if player ~= nil then stuff end?

hearty dew
#

yea, or if player and player:isAsleep() then ... end in that code

thick karma
#

So if player is the same as if player ~= nil in LUA?

hearty dew
#

not exactly. nil and false are the only falsy values. Everything else is truthy

#

but you expect nil or a player object as a return in this case

thick karma
#

Can an 18+ mod have "shit" in the name on the Workshop? (The need to ask this makes my brain hurt.)

thick karma
hearty dew
#

Right. Also nil and false are the only falsy values in lua. Everything else is truthy (even 0)

thick karma
#

Oh whoa

#

@ 0 being truthy

#

Moving forward r.n.... I am inspecting More Traits on homie's GitHub, and I see many cases of local player = getPlayer(); followed by no check to see if player returned something non-nil... think maybe that's why it throws exceptions in -debug after I die?

#

Also he says he has multiplayer issues... Ogre said I need to use the loop and getSpecificPlayer to avoid multiplayer issues... could that be part of why More Traits has MP issues?

astral dune
#

could be. My only interaction with More Traits so far has been investigating the Expert Driver trait, which does things like change the weight of the vehicle and then immediately wipe out those changes by calling an update function that recalculates the car's weight. Also increases the regulator speed, which does exactly nothing. Very curious

thick karma
#

Is TraitFactory reliable or does it throw errors too? I kind of want to create 1 trait for a mod I'm running, but I don't want dependencies that throw sloppy exceptions...

little girder
#

I had ideas for mods, don't know if they exist already BUUUUUTTT I'll still voice them here if anybody wants to run with them (just name them after me or something if you use the idea ;P )

#

First would be a Semi Truck w/ a Car Trailer on it. yknow the big ones that can hold like 6 cars at a time and haul it down the highway. As someone who builds their base in the scrap yard outside of Riverside and collects neat vehicles, it would be a nice addition to have for runs into towns where I KNOW theres multiple vehicles I want to secure rather than running my tow truck into the ground for them.

#

The other idea was for a snow plow, either attachment or whole vehicle, that could be used in winter months for clearing paths. could also maybe be used for clearing bodies out of roads if the present system allows for that sort of thing

astral dune
#

Question for the lua gurus, if I want something like

local v = player:getVehicle():getId() or "none"

but player:getVehicle() could be nil, what is the cleanest way to check for that? Right now I'm doing

local v = player:getVehicle()
if v then
   v = v:getId()
else
   v = "none"
end

and honestly I don't like it much

hearty dew
#

Could do something like ```lua
local v = player:getVehicle()
v = v and v:getId() or "none"

But I wouldn't say it is an improvement in readability imo
astral dune
#

that is weird, how does and work in this scenario?

hearty dew
#

It makes use of the fact that the logical and operator is short circuited, so v:getId() is never evaluated if v is falsy

#

and similarly that or is short circuited, so 'none' isn't evaluated if (v and v:getId()) are truthy

bronze yoke
#

wouldn't that return true, though?

#

if it was a vehicle, i mean

astral dune
#

yes, thats what I don't get, if v is "true" (and contains a vehicle object), what the heck happens when you try to and it with its own ID?

bronze yoke
#

both values are not false or nil, so it returns true, surely?

hearty dew
#

if v is truthy, it still has to evaluate the right side of the and operator (because both operands of and must be true for the result to be true)

bronze yoke
#

well i ran it through a lua console and it does work

hearty dew
#

in lua (and other languages too btw), the result of the last expression in logical and operators is returned (so it can be used like this)

bronze yoke
#

i had no idea

astral dune
#

that is strange, but I suppose it saves you having to do an actual comparison

hearty dew
#

The comparison is still done

#

x and y, that will check whether x is truthy. If it is, it will then evaluate y. If it is not, whatever false value x resulted in is returned

astral dune
#

ya, thats not a real comparison

#

next question, lol, anyone know how to tell which vehicle a player just left? OnExitVehicle() doesn't tell you what vehicle it was, lmao

#

OnUseVehicle also fires when you're getting out of the vehicle, but it doesn't really tell you the player is getting out

bronze yoke
#

if IsoPlayer:getNearVehicle() returns the nearest vehicle (i have never used it, but it seems likely) you could use that

astral dune
#

oh, and thanks for the lesson Tyrir, these kinds of shortcuts are always useful

#

I think getNearVehicle works, but I'd be worried about getting the wrong vehicle in edge cases where they're all mashed together

bronze yoke
#

you could store the vehicle's id in mod data upon entry

astral dune
#

in the player's mod data?

bronze yoke
#

that's what i would do

astral dune
#

makes sense

#

I really wish there were just some OnPartDamaged events or DamagePart commands I could use instead of having to try to make an efficient system to scan a particular vehicle at relevant times

#

😭

bronze yoke
#

yeah i've been running into that with my vehicle upgrades mod

#

i decided to just drop it on the part update, which doesn't seem to run *too* often

astral dune
#

I did have a different concept that I haven't investigated yet. Is it possible to make your own parts fit on a vanilla vehicle? Like a different windshield?

bronze yoke
#

i think so

astral dune
#

If so, you could make a custom "Reinforce" context choice that would replace the part with a version of it that has more hitpoints. Let the normal damage calculations happen but get an effective "damage reduction" by scaling the total health of the part

#

not sure how to render bars over the window for example while the new "reinforced windshield" was in, but that seems possible

hearty dew
#

I think that Tsar's jeep mod might do that

#

I know it has upgrades that you install to add container space on top

#

And think it has wheel upgrades

astral dune
#

ya, new attachments aren't to hard to do, I just don't know how open to alternative parts the vanilla vehicles would be

bronze yoke
#

i was thinking about that but it seemed like the complex way of doing things

astral dune
#

slightly complex mechanism, sure, but as efficient as possible

bronze yoke
#

i'm considering it though just for the 'what if the window breaks' issue

astral dune
#

I don't know about you but I get some pretty bad perfomance issues when I have too many vehicle mods with armor slots on them. I think they're all fighting for cpu time to watch your car's parts for damage

bronze yoke
#

hmm come to think of it... this is sort of the hard way of doing it

#

you could just do the regular method of installing the parts and alter the main part's condition on installation

astral dune
#

I assumed its maximum condition would be hardcoded

bronze yoke
#

well i haven't looked into that yet

astral dune
#

there is a modifier from the skill level of the person who installs it, but its kept as a separate thing

#

looks like vehicle part condition is clamped between 0-100

#

yep, looks like a bust

bronze yoke
#

of course... stopped by a hardcoded value

astral dune
#

what partupdate event/command were you referring to?

bronze yoke
#

update on the script's lua

astral dune
#

??

bronze yoke
#

like in the vehicle script?

#

you can put an update function onto a part

astral dune
#

that's news to me

bronze yoke
#

i'm not quite sure how often it's called, it's certainly not every frame or anything

astral dune
#

how do you do it?

bronze yoke
#
            {
                update = UpgradeableVehicles.Update.WindowProtection,
            }
#

just like an install/uninstall/test function

astral dune
#

I haven't actually touched the scripts themselves

bronze yoke
#

how are you adding new parts?

astral dune
#

I'm not

bronze yoke
#

oh yeah i forgot your mod works weird

astral dune
#

right now it doesn't do much of anything, lol. I had to abandon plans of creating unique vehicle scripts due to syncing issues. Mx has the same problem with his transmog mod

bronze yoke
#

i'm sort of doing things the simple way, like i'm not really that satisfied with the update function solution, and vehicle scripts have some weird and clearly unintended limitations, but i don't want to rewrite the whole vehicle system quite yet

astral dune
#

update seems like the perfect solution tbh, if its called every time the part is looked at by the code, a quick check of its condition at that time shouldn't be too bad

bronze yoke
#

i'll go test when it's actually called

astral dune
#

I'm assuming I can use a similar process to itemtweaker in order to insert a update method onto vanilla parts, I'll need to look at that

bronze yoke
#

there's a vehicletweaker

astral dune
#

is this lua you posted on the vehicle or the part?

bronze yoke
#

the part

#

it just seems to be called periodically

#

only while a player is in the vehicle though

astral dune
#

ideal for my uses

#

just trying to track down a scripting guide now so I can see what's possible

bronze yoke
#

in theory, a zombie attacking an abandoned car could destroy it through the armour, but... i don't care

#

that's too niche

astral dune
#

do zombies even attack empty cars?

bronze yoke
#

sometimes

#

sometimes right after i've abandoned a vehicle they'll continue attacking it

astral dune
#

do you have a particular resource or tutorial or something for script stuff? I'm struggling to find anythingn

bronze yoke
#

no i just worked it all out myself

ancient grail
#

guys anyone using github?
is it fine to use the actual workshop mod folder as github location? cuz if you do this the .git folder with the files also goes with the mod upload. is it ok for this to happen?

bronze yoke
#

followed the vanilla scripts until i got it

astral dune
#

🤯

astral dune
ancient grail
#

ow yeah make sense.. i dont even know whats inside that folder anyways

#

thnx for the heads up tho

astral dune
#

so that's how these functions in Vehicles.lua are called, by the part scripts themselves

#

looks like there is create, init, update ,use, and some install and uninstall actions that you can assign functions to. No damage, which is a shame, but update handles all the wear and tear parts take over time so that's close

weak sierra
#

why would chunk ever be nil for an IsoGridSquare

quasi jasper
weak sierra
#

yes

quasi jasper
#

i found one in game but i didnt see a way to open it

#

do u know how?

weak sierra
#

go to the back of it

#

and hit e when the green box appears on the groudn

quasi jasper
#

i was and i was hitting E

#

there wasnt agreen box

weak sierra
#

then ur either at the wrong spot or its' a trailer that doesnt open like a fuel container

#

try standing slightly further from the back of the trailer?

quasi jasper
#

it was the camo one that had a folded ramp off the back of it

#

this one

#

i was standing by the back of it

#

couldnt see a way to open it

weak sierra
#

ive never used one of those, as long as i've played with that mod, lol

#

ive used like everything else in the mod

#

xD

quasi jasper
#

oh lol

weak sierra
#

i would still expect it to be at the back

quasi jasper
#

ill try again when i go back to the military base

#

thanks

weak sierra
#

but walk around the whole thing lookin for green square on the ground shrugGirl

#

i can say it DEF has storage

#

cuz i've seen the stats at some point

#

but where the access point is idk

quasi jasper
#

how much can the trailers hold?

weak sierra
#

those hold the least of the different ones

#

i dont recall the stat

quasi jasper
#

is it like 1000

weak sierra
#

the larger ones with the little windows hold like 1300 and the ones with no windows hold 1430

#

if u have organized

#

the small one probably holds somewhere between 1000-1250 but i dont know

#

(the one ur talking about)

quasi jasper
#

dayum

#

could fit my whole base into one of those

astral dune
#

I think the access is at the front by the hitch on that one, but I don't quite recall

#

so far no luck adding an update function to the engine of a vehicle with a script, but I feel like I'm not formating it right

quasi jasper
#

oh okay

#

thank you

astral dune
#
local script = vehicle:getScript()
local _, name = vehicle:getScriptName():match"([^.]*).(.*)"
script:Load(name, "{part Engine{lua{update = Mek.UpdateEngine}}}")

@bronze yoke do you see anything immediately wrong with this? I'm firing it when someone uses a vehicle. but so far no good

bronze yoke
#

i didn't do it this way so i don't know

astral dune
#

its essentially the equivalent of doing
TweakVehicle("Base.SportsCar", "part", "Engine {lua{update = Mek.UpdateEngine}}"

#

it may simply just not work because template = Engine already exists in the script for the vehicle

thick karma
#

I did it!

#

Special thanks to OgreLeg, Tyrir, albion, and anyone else who answers people when they have questions.

magic nymph
#

Nice! Can you drive and read?

thick karma
#

Not sure about that yet. Just walk and read. But that's a tempting expansion

#

I'll look into that next @magic nymph

#

For now, it reliably lets you walk and doesn't seem to cause any problems (but I use normal server settings for fast reading, no mods)

#

(i.e. minutes per page .005 or something; not sure if it's rounding that, but it's fast).

undone elbow
#

When I made such a mod first time , I wrote exactly the same lines of code. Then I realized that you can't just walk and see everything around. It's not realistic to read and look around. Also it's uncomfortable to use context menu every time you want to read next 2 pages, so I added hot key. So the mod became more complicated but still simple enough.

#

The mod is 38 kilobytes šŸ™‚

thick karma
#

I don't think my periphery should be jet black.

#

I could see you had strong personal opinions, and saw no point in posting for requests. šŸ™‚

#

Agree to disagree about the limits to your vision while reading.

thick karma
undone elbow
thick karma
#

Not "easy"

#

Difficulty is easily achieved by crazy strong, fast, and plentiful zombies in tough enough maps without preventing people from reading while they walk imo šŸ˜›

thick karma
# magic nymph Nice! Can you drive and read?

Gonna have to chug away at this more tomorrow. I don't really know where the reading event signal checks to see whether you're driving... I know isValid seems relevant, but I don't know how to make the isValid function behave differently without simply editing that LUA file directly... which I'm guessing is bad practice, if it would even work at all.

hollow current
#

Quick question

function ISRenameEverything:onRenameItemClick(button, player, item)
    if button.internal == "OK" then
        if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
            item:setName(button.parent.entry:getText());
            local pdata = getPlayerData(player:getPlayerNum());
            pdata.playerInventory:refreshBackpacks();
            pdata.lootInventory:refreshBackpacks();
        end
    end
end```

This is a code (that ofc works with other parts of code), that lets you rename an item in the inventory. It works good so far, but it has a problem where it doesn't work with items that aren't within the item list of debug, but can appear in your inventory, such as a chair, a cardboard box, etc. Everything works fine. No errors, nothing, but it just doesn't change the name. Any idea what may be the issue there?
thick karma
hollow current
#

it also renames all items except the items you'd pick up from the world and not find in containers

#

Would it be some kind of a bug/limitation or is there a way around it in the code?

thick karma
#

Omg I deleted a mod before unsubscribing and the hassle is enough to make me self-combust

#

Caused so many problems

#

Currently reinstalling Zomboid in hopes it helps

thick karma
#

Still no driving, but if you want it for walking, it's up and running now... make sure you unsub from old one if it's still up for you.

finite marsh
#

Hello everyone, I wanted to know how you could change the outfit of an entire zombie group

#

like "student" group

#

or military

thick karma
#

Woops

thick karma
#

lol jesus I have been awake too long

thick karma
#

Is there an easy way to invoke a function when your character shouts (MP friendly please)?

#

Or alternatively easiest way to detect player making any noise?

thick karma
#

Or any way to activate an event when zombies get too close to you? Losing it here lol

mental spire
#

Anyone else looking for a mod where you can use a car battery as a generator? For all of us playing 10 years later it would really be nice. Figured you could be able to connect a car just like a generator (just like the generator trailers) but instead you would use the cars battery so you would have to sacrifice your cars health to power up let say a building to loot.
Anyone?

shadow geyser
thick karma
#

I can catch events... hence this

#

An event made me invisible to them, and will make me visible again if I stand up

#

But what I want is for them to eat me when they get this close, even if I am invisible (i.e., I want their proximity to cancel my state of invisibility).

#

Unfortunately, I have tried 64548 things and failed at all of them

#

I can shout and make them approach, but I can't figure out how to use that shout as a trigger...

#

I can use things as triggers, but deriving a way to infer proximity after being triggered is killing me.

lone whale
hearty dew
austere finch
#

I accidentally deleted a workshop item, and when trying to correct this / re-upload it am getting the very vague and unhelpful error of 'failed to update workshop item, result=9'; does anyone know how to resolve this? Google has been fruitless.

hearty dew
#

Deleted your dev version the workshop item that you upload? Or deleted the version that is downloaded when subscribing?

austere finch
#

On the workshop page itself hit delete -- I'd uploaded and overwritten a mod with a second one when I accidentally neglected to give it a new workshop ID.

uneven vault
#

Is it against the rules to ask for commission for custom workshop items?

thick karma
#

I actually unsubbed from everything (after favoriting them) to reset my subs, because I had deleted the file and thus couldn't unsub from it directly.... I tried a lot of other stuff first

austere finch
#

It isn't that I'm subscribed to a missing mod, it's just not letting me re-upload the intact work copy I have to the same workshop ID

thick karma
#

Including reinstall Zomboid etc.

#

I got stuck there too... I was not able to reupload my mod because the deleted mod was taking its space and the ids were the same.

#

So the updates were pushing to an invisible place and doing apparently nothing

bronze yoke
#

i don't think you can reupload to the same workshop id if you delete the item

austere finch
#

That's mildly horrifying

#

I don't want to have accidentally boned somebody's server because it's looking for an absent workshop ID

bronze yoke
#

if you accidentally upload to the same workshop id, you can revert to a previous version from the change notes

austere finch
#

I didn't think of that at the time and panic-fumbled the delete

hearty dew
#

I'm trying to find an explanation in the steam api docs, but not finding a 9 error yet. From a quick google search, someone said that error indicates the item is missing, so it might be that a deleted id can't be found and thus can't be updated?

austere finch
#

Ugh

austere finch
#

Is there any possible resolution to restore it / replace it there?

hearty dew
#

I'd contact steam's dev support if I couldn't find anything online

austere finch
#

Slim likelihood of a response there, but I appreciate you looking

shadow geyser
#

I don't think it is feasible to make yourself invisible to some zombies and not to others. although you could try manually setting the target of the zombie to your player

hearty dew
#

@austere finch Is there no option to revert to a previous (non-deleted) version in the steam UI?

austere finch
#

Not that I’ve been able to find, there is no stub for it in my workshop items and I get the same MIA page a regular user does going to it manually

hearty dew
#

@austere finch Might also try contacting regular steam support and asking them "Hey, I accidentally deleted my workshop item, id=1234. I'm unable to update it now and the page is gone. Can you please undelete it?"

thick karma
#

Did this last night

bronze yoke
#

string id...?

thick karma
#

In your workshop or mod info file (i forget) there is a string id for the mod

#

Literally called id

bronze yoke
#

that isn't related to the workshop

thick karma
#

Could be point of confusion

#

Fair

#

It shows on Steam

#

Steam pulls the given (string) id and shares it

#

Idk what related means in this context

#

Seemed relevant

#

But yeah only the numerical id is unique afaik

bronze yoke
#

for the steam workshop only the numerical id matters, the workshop just downloads the folder you uploaded, it doesn't have a concept of mod ids

thick karma
#

So it just shares that as plaintext i.e.?

#

Doesn't even know Zomboid gave it a string called id?

bronze yoke
#

i'm not sure what you mean

thick karma
#

I'll share screens when I get home

bronze yoke
#

zomboid just automatically adds the string mod ids to the description for user convenience, the steam workshop doesn't really know about them

drifting ore
#

in the britas gun thing are all the guns properly 3d modeled to the style of the others in the game or is he/she still working on it?

bronze yoke
#

they're all modelled, although i wouldn't say they're exactly in the vanilla style

drifting ore
#

oh ok that makes sense I thought it was an issue on myside

shadow geyser
young grotto
#

hey guys, how do I patch a mod with another mod? for example, viperel recycling centre allow us to repair katana and wood axe. I want to patch the recipe to make it harder without remaking the whole mod again. For example, in the original scripts file:

{
    imports
    {
        Base
    }

    recipe Repair Katana
     {
        keep WeldingMask,
        BlowTorch=2,
        WeldingRods=1,
        SmallSheetMetal=1,
        ScrapMetal=2,
        destroy Katana,
        
        Result:Katana,
        Time:500.0,
        Category:Welding,
        Sound:BlowTorch,
        SkillRequired:MetalWelding=6;LongBlade=2,
        OnGiveXP:Recipe.OnGiveXP.MetalWelding10,
        AllowDestroyedItem:true,
     }    
}
#

I want to make the skill required to metalwelding=8 and longblade=8

#

is there a way to make the new mod import the VPR_recycle module? If so, how do I proceed?

shadow geyser
# young grotto hey guys, how do I patch a mod with another mod? for example, viperel recycling ...

you need to grab the recipe from the script manager, so something like the following. you can see all the relevant functions here https://zomboid-javadoc.com/41.65/zombie/scripting/objects/Recipe.html#skillRequired

function modify_recipe()
    local recipes = getScriptManager():getAllRecipes()
    for i = 0, recipes:size() - 1 do
        local recipe = recipes:get(i)
        if recipe:getName() == "Repair Katana" then
            recipe:addRequiredSkill(Perks.Longblade,2)
        end
    end
end

Events.OnGameBoot.Add(modify_recipe);
#

not sure about the correct perkname though, you would have to find that yourself from the vanilla code

young grotto
shadow geyser
young grotto
#

alright, will give it a try, thank you so much my good man

#

found the perk in the class file, its Perks.LongBlade and Perks.MetalWelding

young grotto
#

and is my code correct if I add more perk requirements?

function modify_recipe()
    local recipes = getScriptManager():getAllRecipes()
    for i = 0, recipes:size() - 1 do
        local recipe = recipes:get(i)
        if recipe:getName() == "Repair Katana" then
            recipe:addRequiredSkill(PerkFactory.Perks.LongBlade,8)
            recipe:addRequiredSkill(PerkFactory.Perks.MetalWelding,8)
        end
    end
end

Events.OnGameBoot.Add(modify_recipe);
wise zinc
#

OKAY SO

#

here's a modding idea

young grotto
wise zinc
#

Special zombies that either give panic and unhappiness as long as they're in your LOS (as in : family, friends, loved ones, etc), that carry a memento. Panic would last for 30 minutes in game, the depression would last weeks or months without ADs.

Memento give you 'hope' (as in, slightly decreases unhappiness gain) as long as they're in your main inventory.

#

Would this be implementable ?

shadow geyser
ancient grail
#

i guess you really can ban a player without an admin. the server by itself doessnt allow this 4 somereason

thick karma
quasi jasper
#

is there a mod that wont reduce trunk capacity when i ram zombies?

austere finch
#

In pursuit of cross-mod compatibility patching, is there a best-practices / clean way to append additional eligible components to existing recipes? E.g. adding more bladed items for a cooking recipe, or making duplicates of something interchangeable between three sources.

austere finch
quasi jasper
austere finch
#

Yup

quasi jasper
#

tyty

hearty dew
# austere finch In pursuit of cross-mod compatibility patching, is there a best-practices / clea...
local function doMyTweaks()
  if getActivatedMods():contains("mod1") and getActivatedMods():contains("mod2") then
    local recipe = getScriptManager().instance.getRecipe("namespace.recipe")
    if recipe then
      recipe.doSource("Foo=1")
    end
  end
end

Events.OnGameBoot.Add(doMyTweaks)

Maybe something like that. No idea if that'll work. Didn't test it. May need to utilize other methods on the Recipe object. Can check the pz api doc

thick karma
#

Anyone wanna help my tired brain by pointing me to any function that will let me add a reaction to either the proximity of zombies or the noises I make when My character shouts....?

ancient grail
hollow current
#

maybe someone from the devs got an idea how they're handled?

tiny horizon
#

Does anyone knows how to get the png of vanilla items

boreal crow
#

Anyone have a reference .png for x2 tilesets

dark finch
#

Any good mods for letting players rank up and receive rewards every mile stone?

#

Im looking to commission a mod like that if need be.

shadow geyser
# hearty dew Are those world items you pickup different types than the usual inventory items?...

I haven't looked at the code about this, but from what i've heard, tiles don't strictly have a name in the same way that normal items do as they don't have scripts. the name that is show in inventory is generated on the spot for the tile for the inventoryitem, so they probably arent using the same namefield that normal items do. you should probably just take a look at the java to try to figure out how it is done

fast galleon
#

Moveables have a movables file in translate folder, which is based on group name or smth.

weak sierra
#

losing my mind over two problems

#
  1. when i do getOrCreateGridSquare sometimes the square has null chunk, causing errors when u try to do something with it that checks that.
#
  1. when i try to override ISDismantleBurntVehicle.start the code just never runs when i dismantle a car.
bronze yoke
#

just to make sure, you mean ISRemoveBurntVehicle, right?

weak sierra
#

i do yes

#

it is correct in the code

#

just derped

#

i've modified perform in the same way in another mod without issue

#

but i can't get this mod to modify start, new, perform or update

#

the lua file loads and in the correct order

#
local original = ISRemoveBurntVehicle.perform

function ISRemoveBurntVehicle:perform()    
    print("UDDTST: TEST")
    if not Aegis_IsOwned(self.vehicle) then
        original(self)
    else
        Valhalla:say(getText("IGUI_VVC_CantDismantleClaimedVehicles"))
    end
end```
#

it isn't complex code

#

print statement never shows in log

#

ah

#

i have two vehicle recycling mods and i mixed up which one uses the vanilla action or not :|

mortal widget
#

@weak sierra yo i don’t mean to make it look like i’m ā€œtracking you downā€ but i just remembered something i was going to ask if that’s alright.

weak sierra
#

hm?

mortal widget
#

do you have any plans on adding support for noirs attachments and the ā€œtwo weapons on backā€ mod for your backpack mod?

weak sierra
#

noir's attachments is already supported

#

was since first version

mortal widget
#

oh i must’ve had it mixed up my bad

weak sierra
#

am unfamiliar with the latter, thus i don't have any plans xD

mortal widget
#

gotcha, thanks for the response

hearty dew
hollow current
#

hmm lemme try that out

hearty dew
vast nacelle
#

Do clients handle zombie loot? I'm trying to spawn unique zombies that have specific, configurable items and "addItemToSpawnAtDeath" works in SP but doesn't in MP. The server says its adding the item, but its not appearing when the clients loot the zombie.
Is there a simple way to have the server add an item to a zombie that will appear when clients kill the zombie?

hollow current
# hearty dew <@325476003763716096> using this, try this in the console:```lua printR(object, ...

throws an error at printR(getmetatable(item), 3)

ERROR: General     , 1665272931167> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in onRenameItemClick at KahluaUtil.fail line:82.
ERROR: General     , 1665272931167> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in onRenameItemClick
    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.pcallBoolean(KahluaThread.java:1924)
    at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
    at zombie.ui.UIElement.onMouseUp(UIElement.java:1228)
    at zombie.ui.UIElement.onMouseUp(UIElement.java:1183)
    at zombie.ui.UIManager.update(UIManager.java:809)
    at zombie.GameWindow.logic(GameWindow.java:261)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:764)
    at zombie.GameWindow.run_ez(GameWindow.java:680)
    at zombie.GameWindow.mainThread(GameWindow.java:494)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1665272931167> -----------------------------------------
STACK TRACE
-----------------------------------------
function: onRenameItemClick -- file: ISRenameEverything.lua line # 39 | MOD: Everything Has a Name
function: onClick -- file: ISTextBox.lua line # 142 | Vanilla
function: onMouseUp -- file: ISButton.lua line # 56 | Vanilla

LOG  : General     , 1665272931167> 
#
function ISRenameEverything:onRenameItemClick(button, player, item)
    if button.internal == "OK" then
        --print("GET CLASS:")
        --print(item:getClass())
        --print("----------------------------------")
        --print("NAME")
        --print(item:getName())
        --print("----------------------------------")
        --print("GET SIMPLE NAME")
        --print(item:getSimpleName())
        --print("----------------------------------")
        printR(item, 3)
        printR(getmetatable(item), 3)
        if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
            item:setName(button.parent.entry:getText());
            local pdata = getPlayerData(player:getPlayerNum());
            pdata.playerInventory:refreshBackpacks();
            pdata.lootInventory:refreshBackpacks();
        end
    end
end```
hearty dew
#

Did you add the definition for printR?

hollow current
hearty dew