#mod_development

1 messages · Page 522 of 1

faint jewel
#

that is amazing. i love it

quartz badge
#

How do you add attachments to custom guns

winged lotus
#

Good evening all, I have a complex challenge for you if someone can help 😅

I am trying to trigger a condition depending on the player standing on a defined square. The following code allows me to get a IsoPlayer ⤵️

    for i=0,square:getMovingObjects():size()-1 do
        local moving = square:getMovingObjects():get(i);
        if moving and instanceof(moving , "IsoGameCharacter") then
            player = moving;
        end
    end

But now comes the tricky part, in multiplayer if the IsoPlayer retrieved is the played character, then it's all good I can use functions like hasTraits() or HasItem() and other IsoGameCharacter functions on it. But if the IsoPlayer is another player in MP, it looks like I can't use those functions!

So here is are my questions :

  • How can two instances of IsoPlayer can have different functions?
  • If I have an instance of an other IsoPlayer in MP, how can I get the character corresponding to it in order to query its functions?
idle onyx
#

should probably change the name of the magazine rounds to 7.62

quartz badge
#

The game calls 5.56 .556

#

Thought i'd stick with their misspelling lmao

nimble spoke
idle onyx
weary crypt
idle onyx
#

Ah

quartz badge
#

I fixed it

winged lotus
#

I will try using other data that does not desync then, but I can confirm that player A sees player B with less traits than they actually have 🤷

undone crag
#

By either adding to the attachments' lists of weapons with doParam, or adding the options to the context menu yourself.

quasi geode
undone crag
quasi geode
#

⤴️

winged lotus
#

Still can't retrieve things like Survivredesck

winged lotus
#

So I will try to use this sendServerCommand but I would have liked to avoid it, I mean, the trade context action is done in client so I hopped to be able to run it without doing that

#

But I'll try with that anyway

#

Arf but in server I can no longer do the things I want to do when inside a onClientCommand, it's client code that needs to be executed right after the check stressed

undone crag
#

sendServerCommand is means either "send a command to the server" or "send a command from the server". Maybe it is the second one. I think the on recieve server command is client side code.

winged lotus
#

Yes but you see, I am currently trying to check if a fitness instructor is nearby to increase regularity of current exercise

if otherPlayer and otherPlayer:getDescriptor():getProfession() == "fitnessInstructor" then
    print("FOUND A fitnessInstructor!")
    for _,v in pairs(aerobics) do
        if v == self.exercise then
        self.fitness:incRegularity();
        self.fitness:incRegularity();
        self.fitness:incRegularity();
        self.fitness:incRegularity();
        break
        end
    end
end
#

But I don't see how I could do that while doing back and forth with the server

#

Especially considering that this code above is triggered for each rep of a fitness exercise 🤔

fiery pecan
winged lotus
#

When searching "sendServerCommand" this channel (field up right of discord) you can find a handfull of good examples 😉

fiery pecan
#

seems to not run, like, at all

#

aaand I forgot to turn off the ping from the reply... Sorry...

#

Here's the full snippet, called every in-game minute (potentially lag-worthy, I know. Considering switching to every ten in-game minutes).

            GetZed:dressInPersistentOutfit("EMSMeade");
            GetZed:reloadOutfit();
            if isServer() or STR_IsSinglePlayer() then
                if isClient() or STR_IsSinglePlayer then
                    triggerEvent("OnServerCommand", "STR", "GetZed:sendObjectChange('GetZedOutfit', {})", {});
                    print("deez");
                elseif STR_IsSinglePlayer() then
                    GetZed:sendObjectChange('GetZedOutfit', {});
                    print("cheese");
                elseif isServer() or isCoopHost() then
                    sendServerCommand("STR", "GetZed:sendObjectChange(GetZedOutfit, {})", {});
                    print("nuts");
                end
            end
        end```
undone crag
fiery pecan
#

I've been metaphorically slamming my head against a rock for 5 days now trying to get the outfit changes to save on the server

undone crag
#

:o

#

Hmm what happens if you pass a string like "GetZed:sendObjectChange(GetZedOutfit, {})" into sendServerCommand? I would expect it to just be a string?

fiery pecan
#

sooo, like this?

undone crag
#

I think there are no sorts of sendServerCommand that take only one parameter.

fiery pecan
#

ah

#

sorry for being a noob here, this is the first time I have ever dabbled in anything Multiplayer code

undone crag
#

If I am correcly guessing what you are trying to do, this may fail in a different way.

sendClientCommand("STR", "object change thing", {GetZed, GetZedOutfit});

I just remembered you can't pass a zombie as a parameter into those commands though, which is what I mean by this failing in a different way.

#

You may need the code which picks the zombie to be running on the server from the start.

undone crag
#

something like

if isServer() then
fiery pecan
#

I see

undone crag
#

And whatever else is needed in the context.
...assuming it is possible!

fiery pecan
#

yes

#

gonna try

``` Real quick
#

it's returning with "sendClientCommand: can't save key,value=1.0,zombie.characters.IsoZombie@55335632."

modest yarrow
#

Do you know if it's possible to add a button here ?

modest yarrow
drifting ore
#

AddTo_ISEquippedItem.lua

#

It's code added to ISEquippedItem.lua ofc

thin hornet
#

also looking at client\ISUI\PlayerStats\ISPlayerStatsUI.lua might help you find out

undone crag
#

sendClientCommand: can't save key,value=1.0,zombie.characters.IsoZombie@55335632
so key is 1.0, the first entery in the kahlua table. Its value is zombie.characters.IsoZombie@55335632. It is failing to send the zombie over the network. Maybe the game can not send zombie references like that over the network.

drifting ore
#

I get that error and I can't get where it's come from. Hard to describe what I'm doing but if you have an idea:

LOG  : General     , 1644536115820> STATE: enter zombie.gameStates.IngameState
LOG  : General     , 1644536115820> [11-02-22 00:35:15.820] ================================================================================.
LOG  : General     , 1644536116159> Init ISContextManager
ERROR: General     , 1644536116304> ExceptionLogger.logException> Exception thrown java.lang.IllegalStateException at UIManager.update line:677.
ERROR: General     , 1644536116304> DebugLogStream.printException> Stack trace:
java.lang.IllegalStateException
    at zombie.ui.UIManager.update(UIManager.java:677)
    at zombie.GameWindow.logic(GameWindow.java:253)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:745)
    at zombie.GameWindow.run_ez(GameWindow.java:661)
    at zombie.GameWindow.mainThread(GameWindow.java:475)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1644536116360> FirstNAME:VirginiaCheung
undone crag
#

ree

quasi geode
#

mostly basic values anyways. InventoryItems and IsoDirections are valid

fiery pecan
#

what about zombie outfits???

#

Because that's what I'm trying to save to the server

quasi geode
#

unlesss its the string name of the outfit, no

fiery pecan
#

if I print "GetZedOutfit", it returns the string value/readable name

#
local GetZedOutfit = GetZedList:get(i):getOutfitName();
#
                GetZed:dressInPersistentOutfit("EMSMeade");
                GetZed:reloadOutfit();
                sendClientCommand("STR", "sendObjectChange", {GetZed, GetZedOutfit});
                    print("nuts");
            end```
thin hornet
#

@winged lotus

ClientSide:


local function requestPlayerStats(username)
  sendClientCommand("MyModule", "requestPlayerStats", { username = username });
end

local function onReceivePlayerStats(username, stats)
  -- do your stuff here
end

local function onServerCommand(module, command, args)
    if module == "MyModule" then
        if command == "receivePlayerStats" then
            onReceivePlayerStats(args.username, args.stats)
        end
    end
end
Events.OnServerCommand.Add(onServerCommand);

ServerSide:

local function onClientCommand(module, command, playerObj, args)
    if module == "MyModule" then
        if command == "requestPlayerStats" then
            local otherPlayer = getPlayerFromUsername(args.username);
            if otherPlayer then
                local data = {
                    username = args.username,
                    stats = {},
                };
                -- get otherPlayer stats
                sendServerCommand(playerObj, "MyModule", "receivePlayerStats", data); -- send the stats the the same player who requested it.
            end
        end
    end
end
Events.OnClientCommand.Add(onClientCommand);
quasi geode
fiery pecan
#

ahhh

#

so removing "GetZed" should, in theory fix it?

#

aka
"sendObjectChange", {GetZedOutfit});

next glacier
#

anyone know what timedaction is used for opening car menu

thin hornet
next glacier
#

run into a problem

#

i set it to 1000

#

and *200 instead of divide 20

#

to test out if its working

#

it doesnt slow down at all

thin hornet
#

this.item

next glacier
#

oh

#

water is working great

thin hornet
#

when testing hooks like this make sure to go back to main menu, reloadin the script will only add the hook a second time

next glacier
#

i QTD tho

#

doesnt work

thin hornet
#

what doesnt work, any error?

next glacier
#

setting this to ridiculous number

#

it should take forever to wash

#

but hes washing fast

thin hornet
#

what is item? its not defined anywhere.
you forgot to add this.

#

look at the original method to know what is accessible and returned

next glacier
#

so I should add these?

thin hornet
#

no

#

they here inside this

#

we call the original and store it into a variable this and we return it at the end like the original do

next glacier
#

so even if
local function CalculateItemFilth(item)
is local, we can call it here
and it doesnt need to be the same with (item)

#

so i can use (this.item)

#

?

#

btw "item" here is a "parameter"? is that what you call it

thin hornet
#

yes its a param, and yes the method CalculateItemFilth is local to this file.

#

so its usable in that file.

#

add a print

next glacier
#

i thought local was per block

thin hornet
#

print(this.maxTime)

#

well its per file and per block, depend how its nested

#

a file is a block/object itself

#

FileA

local stuff = {};
function stuff.test()
  print("test");
end
return stuff;

FileB

local stuff = require("FileA")
stuff.test();
next glacier
#

what does callstack mean

#

am I right into thinking these are warning/errors

#

line 146

#

line 38

#

wait

#

is there even a

#

getDirtyness

cinder crow
#

Callstack refers to the "function stack" of your program, if you call A() - the computer puts "A" on the "call stack"
If you call B() inside A(), your callstack would be like

function: B()
function: A()
function: originalCallsite
#

the bottom frame is the place where you call A(), the middle is the function where you call B()

#

When a function ends/returns, the stack frame is "popped" and the program goes to the next function down the stack, just after you called that function

next glacier
#

woops

signal frost
#

0 + true

next glacier
#

why is dirtAmount true

signal frost
#

I dunno fam, it's your code

#

Presumably some function is returning in different datatype to the one you expect

next glacier
#

i set it to 0

signal frost
#

What does item:getDirtyness() do? Could be a boolean. Notice how to get the actual value for blood it's item:getBloodLevel()? Perhaps there is a corresponding method for getDirtyLevel

next glacier
#

the corresponding method for getBloodLevel() is getDirtyness()

signal frost
#

Love that for us

#

This is why naming conventions are important

#

Let me check the docs

next glacier
#

idk how to lua

#

I think I need soapList

#

soapList has bloodlevel and dirtyness

signal frost
#

Is there lua documentation? I'm looking at the pz java docs but don't see anything related

next glacier
#

cant tell, new at lua

signal frost
#

Is that your file

next glacier
#

clothes.lua is my mod

signal frost
#

What are you trying to do here? I might be misunderstanding

next glacier
#

trying to make a mod where water usage is based on dirt and blood level

#

scaling based on a max i set

signal frost
#

Ahhh

#

That's a good utility

next glacier
#

lets say I want max of 10 water at 100%blood and 100% dirt

#

for now, scaling linearly to 10

signal frost
#

Yeah, I get you

#

So time currently scales.. but water use does not

#

is water use a hardcoded variable somewhere?

#
    return 10
end```
#

Line 70

next glacier
#

I managed to change water

#

but its not getting the bloodlevel and dirtyness right

#

so water right now is always 1/1

#

i have here one with 74 bloodyness

signal frost
#

You did an overload of GetRequiredWater? What does that look like

next glacier
#

according to math should be 3.65 water

#

and then filth is calculated by

#

bloodLevel + dirtyness

#

because I'm thinking max of bloodlevel and dirtyness is 100 each so total of 200
with a divisor of 20 we have 10 = 10 water

#

so 74/20 = should be 3.7 water

#

but since math.floor converts it to integer

#

it should be 3 water

#

right now its 1/1 water

signal frost
#

Okay I think I get where you're coming from..

next glacier
#

screenshot of locals. i dont know for sure whether to follow this

signal frost
#

So, this is a bit hacky BUT

next glacier
#

oh the washing speed is also not working

#

because filth calculation is wrong

signal frost
#

o has a variable called maxTime

next glacier
signal frost
#

and maxTime is calculated as ((bloodAmount + dirtAmount) * 15);

#

Why not just do your math based on maxTime?

#

Oh they change maxTime based on itself

#

That's really annoying

#

Also arguably just bad code

frank elbow
#

The intention is to clamp maxTime between 1 and 1000

signal frost
#

Oh I understand the intention, it just could have been a different variable

next glacier
#

the issue is 'filth' calculation

#

my theory is

#

getBloodLevel and getDirtyness are not working

signal frost
#

did you write CalculateItemFilth?

next glacier
#

double-clicking soapList in game

#

shows that it ?containts bloodlevel and dirtyness?

next glacier
signal frost
#

Because it seems like dirtAmount/bloodAmount are local to the function

#

so if it's not getting logged in the function, those values don't represent what it is

next glacier
#

debug menu

#

how do I log them

#

this only affects ISWashingClothing.lua

signal frost
next glacier
#

would I be able to find out

#

where dirtyness is logged using a program

signal frost
#

ctrl f?

frank elbow
#

The overwritten function, I mean. So some other parameter that's a boolean is being passed as the value for dirtAmount

#

Should be self, character, ...

next glacier
#

oh, but I thought . . . already called for character

frank elbow
#

Nah, ... is varargs, which means the remaining argument values

signal frost
#

... is the parameters you pass into the constructor

frank elbow
#

So it's everything after character

#

Since you precede it with character, you're capturing the first arg but not forwarding it

signal frost
#

I considered that, but I thought that self was character, what is self?

frank elbow
#

self is a special value in Lua which refers to the object that the function is being called on (usually a table)

#

The colon is syntactic sugar which defines self as the object before the colon (i.e., you can use self without the colon, but it has to be explicitly defined if you do so)

#

So self in this context is ISWashClothing

#

It's passed into the original one so that the original also has the correct reference for "itself", since it's not being called with colon syntax

signal frost
#

so self is kinda like this in other languages?

frank elbow
#

Mhm, exactly

signal frost
frank elbow
#

Sure

signal frost
#

Which line are you referring to?

frank elbow
#

In that image, line 37

viscid elbow
#

Anyone know how to modify one param of a vehicle script without needing to copy and redefine the entire thing in a script?

frank elbow
#
local Container = {}

function Container:someFunc(...)
  print(self == Container) -- true
end
next glacier
#

this is the original

signal frost
#

So you're calling the someFunc on Container?

#

Oooh you're feeding container into someFunc as the context for it

frank elbow
#

That defines someFunc on container, which can then be called as Container:someFunc() or Container.someFunc(Container)

signal frost
#

So you can do shit like self.valueOfContainer?

frank elbow
#

Mhm

signal frost
#

Nice, okay cool

next glacier
signal frost
#

Why would you do that rather than feeding Container in as a param into someFunc? access to private variables?

frank elbow
#

Just syntactic sugar, they mean the same thing so the only real reason is for convenience

frank elbow
# next glacier

This is with character added? Can you send the whole script

next glacier
#
local function CalculateItemFilth(item)
    local bloodAmount = 0;
    local dirtAmount = 0;
    if instanceof(item, "Clothing") then
        if BloodClothingType.getCoveredParts(item:getBloodClothingType()) then
            local coveredParts = BloodClothingType.getCoveredParts(item:getBloodClothingType())
            for j=0, coveredParts:size()-1 do
                local thisPart = coveredParts:get(j)
                bloodAmount = bloodAmount + item:getBlood(thisPart)
            end
        end
        if item:getDirtyness() > 0 then
            dirtAmount = dirtAmount + item:getDirtyness()
        end
    else
        bloodAmount = bloodAmount + item:getBloodLevel()
    end
    
    return bloodAmount + dirtAmount;
end

function ISWashClothing.GetRequiredWater(item)
    local filth = CalculateItemFilth(item);
    if filth > 10 then
        return 10
    elseif math.floor(filth/20) < 1 then
        return 1
    else
        return math.floor(filth/20)
    end
end


local ISWashClothing_new = ISWashClothing.new;
function ISWashClothing:new(character,...)
    local this = ISWashClothing_new(character,self,...);
    local filth = CalculateItemfilth(this.item);
    this.maxTime = filth *5;
    if this.maxTime > 1000 then
        this.maxTime = 1000
    elseif this.maxTime < 1 then
        this.maxTime = 1
    end
    
    if this.character:isTimedActionInstant() then
        this.maxTime = 1;
    end
    
    return this;
end

print("filth")```
frank elbow
#

self has to be before character

#

self, character, ...

next glacier
#

nc

frank elbow
#

I feel that it's necessary to clarify above that all self really refers to in colon syntax is the first argument that was passed to the function; you just don't really have to think abt it if you also use the function call syntax with the colon, which in most cases you would if you're defining a function like that

next glacier
#

now theres 1 left

frank elbow
#

Seems like that should be a number at that point, weird

#

Unless the line that the error occurred on is wrong, which it has been for me before. Can you check console.txt?

signal frost
#

Does lua do the js thing where it automatically converts data types into other types?

frank elbow
#

Nah, it would've thrown an error if the + was a problem bc numbers only have + defined for other numbers

#

Pretty sure it doesn't even like it when you try to concatenate a number with a string without converting Nevermind, quickly tested it and that is not the case

signal frost
#

Okay, good, I actually like that

#

Damn it

frank elbow
#

Lol

#

Tbf though concatenation is done with .. so I guess in Lua it makes sense, hard to accidentally do it when you mean to add (but easy to accidentally add when you meant to concatenate)

signal frost
#

Oh, you can't add strings together? it has a specific concat symbol?

#

I kinda like that tbh

frank elbow
#

You can if you modify the string metatable (so no by default), but I also think having a separate symbol is nice

signal frost
#

Yeah I agree

next glacier
signal frost
#

Can you please crop the whole thing

next glacier
#

this is from game debug screen

#

local function CalculateItemFilth(item)
    local bloodAmount = 0;
    local dirtAmount = 0;
    if instanceof(item, "Clothing") then
        if BloodClothingType.getCoveredParts(item:getBloodClothingType()) then
            local coveredParts = BloodClothingType.getCoveredParts(item:getBloodClothingType())
            for j=0, coveredParts:size()-1 do
                local thisPart = coveredParts:get(j)
                bloodAmount = bloodAmount + item:getBlood(thisPart)
            end
        end
        if item:getDirtyness() > 0 then
            dirtAmount = dirtAmount + item:getDirtyness()
        end
    else
        bloodAmount = bloodAmount + item:getBloodLevel()
    end
    
    return bloodAmount + dirtAmount;
end

function ISWashClothing.GetRequiredWater(item)
    local filth = CalculateItemFilth(item);
    if filth > 10 then
        return 10
    elseif math.floor(filth/20) < 1 then
        return 1
    else
        return math.floor(filth/20)
    end
end


local ISWashClothing_new = ISWashClothing.new;
function ISWashClothing:new(character,...)
    local this = ISWashClothing_new(self,character,...);
    local filth = CalculateItemfilth(this.item);
    this.maxTime = filth * 5;
    if this.maxTime > 1000 then
        this.maxTime = 1000
    elseif this.maxTime < 1 then
        this.maxTime = 1
    end
    
    if this.character:isTimedActionInstant() then
        this.maxTime = 1;
    end
    
    return this;
end

print("filth")```
#

this is code

frank elbow
#

Are you calling ISWashClothing:new somewhere in your own code? I think it's the same issue you were having before, looking at the line referenced by the error

#

Line 146 of the original one is o.maxTime = ((bloodAmount + dirtAmount) * 15);, so presumably one of bloodAmount or dirtAmount is not a number

#

Asking if you're calling it somewhere else to check if the argument values are correct

next glacier
#

how do I call it somewhere in my code

#

doesnt lua local ISWashClothing_new = ISWashClothing.new; already call it

frank elbow
#

Is this the only file in your mod?

#

That doesn't call it, but it creates a reference to the original function. It's okay if you aren't calling it, just wanted to check

next glacier
#

I have another file for wash self but that uses another file ISWashYourself

frank elbow
#

Is clothes.lua yours?

next glacier
#

yes

frank elbow
#

Can you show that one, or at least part of it? In particular, the area around line 37

next glacier
frank elbow
#

Ohh

#

The rest of the stack trace is right there, idk how I didn't see that lol. In that case I'm not too sure abt why that's happening

next glacier
#

original ISWashingClothing can getBloodLevel fine

#

i dont think its using anything other than (item)

#

but i am using (item) but it cant find bloodlevel?

#

brain small, D stuck in ceiling fan

frank elbow
#

Since noSoap is a boolean I think the params are somehow shifted by one, but I've no idea why

next glacier
#

that reminds me i forgot

#

if noSoap then
this.maxTime= this.maxTime*{insert multiplier}

next glacier
#

btw it keeps outputting an error
unexpected symbol near '10' for the longest time

frank elbow
#

I wouldn't assume so, the actual parameter values are unmodified at that point

next glacier
#

if I modify maxtime

#

modifying water alone, removing maxtime code = no error

#

the only thing that has 10 is
the original return 10 water

drifting ore
frank elbow
next glacier
#

how may I do that

frank elbow
#

Replace the ... with sink, soapList, item, bloodAmount, dirtAmount, noSoap

#

And in the debugger if you click a line of code I believe it should make a breakpoint (i.e. tells it to open the debugger at that point), have only used it a little bit

next glacier
frank elbow
#

Mhm, then in the debugger click that line before testing

next glacier
frank elbow
#

What in the world

drifting ore
frank elbow
#

Should be self, character; passing in a reference to ISWashClothing

drifting ore
#

Ok mb

#

Put a space, it's disturbing xD

drifting ore
next glacier
drifting ore
#

seems like bloodAmount or dirtAmount is a nil

frank elbow
#

Can you add print(type(bloodAmount), ' ', type(dirtAmount))?

#

Seems like it's an int and a float in the debugger

drifting ore
#

But lua can add int to float

frank elbow
#

At least it looks like a float from here, on my phone so I can't see very well

#

Lua can add an int to a Lua number, and I assume there's automatic conversion with Java floats

drifting ore
#

I think I know

next glacier
#

i had print(filth)

#

but where do i find such

drifting ore
#

Try don't put self in ISWashClothing_new

#

Like that local this = ISWashClothing_new(character, sink, soapList, item, bloodAmount, dirtAmount, noSoap);

next glacier
#

if i remove self

drifting ore
#

Give the full error

next glacier
#

wrong error

#
    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.UIManager.update(UIManager.java:808)
    at zombie.GameWindow.logic(GameWindow.java:253)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:745)
    at zombie.GameWindow.run_ez(GameWindow.java:661)
    at zombie.GameWindow.mainThread(GameWindow.java:475)
    at java.base/java.lang.Thread.run(Unknown Source)```
drifting ore
#

Do you have the line of code where the error comes from? It is the most important

next glacier
#

i have idea

#

gonna check another mod

frank elbow
next glacier
#

how do i print

#

where do i see output

frank elbow
#

Just add that line to your override, before the call to the overriden

#

console.txt, in your project zomboid folder

#

Sorry, your user* zomboid folder

#

For me it's C:\Users\Name\Zomboid, should be smth like that

next glacier
#

override?

#

my code? or is that a file in zomboid folder

frank elbow
#

Add the print to the new function, before you call the original one

#

The console.txt file should be in a Zomboid folder in your user directory

next glacier
#

sorry I dont know where exactly do I insert

frank elbow
#

If you're on windows, it should be accessible as %APPDATA%/../../Zomboid, if you put that in the explorer window

#

Above the line that begins with local this

frank elbow
# next glacier

Does the error still occur with the variables explicitly declared, btw? Seems like with those values it should be fine

#

Dunno why it'd be any different from ... though

next glacier
#

wait

#

does print need an end?

#

or type

#

oh ok

#

failed to copy the last )

frank elbow
#

Did you find console.txt?

next glacier
frank elbow
# next glacier

Did you run the code that should print? Not seeing anything that looks like it

#

I see the strange error you mentioned with the 10

next glacier
#

with the simplest change to it

#

it outputs that trange thing '10'

frank elbow
#

The print I was asking if you could add

#

Yeah, did you run it?

next glacier
#

does this run by itself?

frank elbow
#

You have to wash something

next glacier
#

i did try to wash a cloth

frank elbow
hidden dragon
#

How would I go about spawning military hunvees and modded military vehicles when I zone?

next glacier
#

just like copy paste

frank elbow
#

?

frank elbow
#

Oh, that's from another mod which overwrites it?

#

Oh I see, it's yours

next glacier
#

first version of code

#

already outputs that error

#

changed it to this code, still errors

#

Not Sure if that code worked

#

now that i changed code

#

I mean not sure if imagination or washing was faster

frank elbow
#

Yeah looking at the old code that wouldn't have run, so imagination is correct

#

As for the current version, though: can you run it without the old file & get the output from that print?

next glacier
#

i dont have the old files anymore

#

i dont know why im not getting the print

#

ill just put it in every function

frank elbow
#

What files are included right now? clothes.lua and you said one other?

frank elbow
next glacier
#

ah

#

might be this

#

ill turn it off for now

frank elbow
#

I don't see anything wrong there but I could be missing it. What happens when you try to wash something with the latest code, though? If the debugger didn't pop up then there wasn't an error (assuming you're still in debug mode)

next glacier
#

when i try to wash

#

doesnt wash, debugger shows

frank elbow
#

Can you show what shows up?

next glacier
#

because of the stupid unexpected symbol

#

harder to find the actual problem

frank elbow
#

That means the old file is still active

#

Do you have the existing mod enabled in the save?

next glacier
#

am so sleepy xd

#

ill get back to this later

frank elbow
#

Okeydoke, good luck w it whenever you get to it

thin hornet
# next glacier ill get back to this later

---@param item InventoryItem
local function CalculateItemFilth(item)
    local bloodAmount = 0;
    local dirtAmount = 0;
    if instanceof(item, "Clothing") then
        if BloodClothingType.getCoveredParts(item:getBloodClothingType()) then
            local coveredParts = BloodClothingType.getCoveredParts(item:getBloodClothingType())
            for j=0, coveredParts:size()-1 do
                local thisPart = coveredParts:get(j)
                bloodAmount = bloodAmount + item:getBlood(thisPart)
            end
        end
        if item:getDirtyness() > 0 then
            dirtAmount = dirtAmount + item:getDirtyness()
        end
    else
        bloodAmount = bloodAmount + item:getBloodLevel()
    end
    return bloodAmount + dirtAmount
end

local ISWashClothing_GetRequiredWater = ISWashClothing.GetRequiredWater;
function ISWashClothing.GetRequiredWater(item)
    local vanillaWaterAmount = ISWashClothing_GetRequiredWater(item);
    local filth = CalculateItemFilth(item);
    
    if filth > vanillaWaterAmount then
        return vanillaWaterAmount
    else
        return filth
    end
end

local ISWashClothing_new = ISWashClothing.new;
function ISWashClothing:new(...)
    local this = ISWashClothing_new(self, ...);
    local filth = CalculateItemFilth(this.item);
    this.maxTime = filth * 50;

    if this.maxTime > 1000 then
        this.maxTime = 1000
    elseif this.maxTime < 100 then
        this.maxTime = 100
    end

    print("Washing Information")
    print("filth: " .. filth)
    print("maxTime: " .. this.maxTime)

    if this.character:isTimedActionInstant() then
        this.maxTime = 1
    end
    return this;
end

Here a working code, there was a typo in your function name.

next glacier
#

I shoulda worn glasses

#

Thank you so much 🙏

#

I will work on it later, am taking a break rn

round zenith
next glacier
#

how do I round this to

#

no decimal places

pine tree
#

So I spent 5 hours troubleshooting a mod I had worked on, found out it was just a single apostrophe out of 8000 lines of code that broke it

#

ffs

drifting ore
next glacier
#

i dont get

#

cannot use '...' outside vararg function

#

researching says to "wrap the varargs in a table outside of the nested closure:"

#

code 1 working

#

code2 not

#

confused now

#

okay

cold burrow
#

try tostring for both.

next glacier
#

line 18 unexpected symbol near "."

cold burrow
next glacier
#

aaa

#

i see the picture

#

thanks

cold burrow
#

Or i could be wrong, not sure.

next glacier
#

unexpected symbol looks like

#

syntax error or idk

cold burrow
#

it is

small topaz
#

I am currently trying to execute a lua function I've written 50 ticks after a certain custom event occured. My current way of doing this can be found in the attached screenshot and this works fine. Problem is that the function myCustomFunction is called on every tick which is in fact not necessary (although relevant code is only executed 50 ticks after the event). I am afraid that this might not be an optimal usage of the OnTick event from a performance point of view. Any ideas how this could be done better? Or would you consider my approach as a somewhat acceptable way?

#

The myCustomFunction does on every tick at least two checks. Not much but I am not sure about how this might affect game performance on the long run...

next glacier
#

character returns nil

#

how do I call a class

sour nova
#
--add monies
    if (sellValue > 0) then
        for i=1, sellValue do
            --print("adding money #" .. i);
            local moneyItem = instanceItem("Base.Money");
            oc:AddItem(moneyItem)
            oc:addItemOnServer(moneyItem)
        end
    end    

to create multiple monies, should I be using a loop like this? or can i create one money item instance and then edit quantity

#

also how do i paste a code block with formatting wth

fallow bridge
#

ok so i'm trying to make a edited version of VFE (was given permission too) and for SOME reason, when i try to launch a MP server with it it makes the server not launch right, instead of giving me an error it just says "normal termination". the thing that's puzzling me is i essentially just took the entire mod folder for the VFE mod and made it into one of my own so i could edit it properly. so it really shouldn't have issues here. as the VFE mod itself works fine anybody got any ideas?

#

cause i'm completely stumped

#

the only thing i'm changing is like 2 lines of script for 2 guns so i really don't understand how it's causing a server to not permit a launch

willow estuary
next glacier
#
---@param character IHumanVisual
local ISWashYourself_GetRequiredWater = ISWashYourself.GetRequiredWater;
function ISWashYourself.GetRequiredWater(character)
    local charafilth = ISWashYourself_GetRequiredWater(character);
    local units = 0;
    local vis = charafilth:getHumanVisual()
    for i=1, BloodBodyPartType.MAX:index() do
        local partt = BloodBodyPartType.FromIndex(i-1)
        if vis:getBlood(partt) + vis:getDirt(partt) > 0 then
            units = units + 1
        end
    end
    return units
end

local ISWashYourself_new = ISWashYourself.new;
function ISWashYourself:new(...)
    local reqwater = ISWashYourself_GetRequiredWater(character);
    local washing = ISWashYourself_new(self, ...);
    local waterUnits = math.min(reqwater, sink:getWaterAmount())
        washing.maxTime = waterUnits * 0.1;
        
    if washing.character:isTimedActionInstant() then 
        washing.maxTime = 1; 
    end
    
    print("Bathing information")
    print("Washing time: " .. washing.maxTime)
    print("selfwater: " .. ISWashYourself.GetRequiredWater(character))
    
    return washing;
end
#

can somebody point out what's wrong

#

completely lost

#

i thought i could do it

small topaz
sour nova
#

Dunno I adopted this mod off someone else, haven't gotten to MP testing not sure if thats necessary or not

small topaz
#

ok... not suggesting it might be unnecessary... just asking to learn 😉

next glacier
#

any pro modders here

#

i think konijima out for today

next glacier
#

doesnt work

#

something wrong with

#

getHumanVisual()

#

attempted index: getBlood of non-table: null

frank elbow
#

Depending on how often the custom event runs, that could offer some savings

small topaz
next glacier
#

found this site

frank elbow
#

Since you'll want to do it within the same function, you'll need to change the declaration to

local myCustomFunction
myCustomFunction = function(currentTick)
   -- code
end
#

The forward reference so that you can access the function within its own block

next glacier
#
ERROR: General, 1644574691060> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getHumanVisual of non-table: null at KahluaThread.tableget line:1689.```
frank elbow
#

Can you include the stack trace of the error?

next glacier
#
java.lang.RuntimeException: attempted index: getHumanVisual of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:169)
    at zombie.ui.UIManager.update(UIManager.java:930)
    at zombie.GameWindow.logic(GameWindow.java:253)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:745)
    at zombie.GameWindow.run_ez(GameWindow.java:661)
    at zombie.GameWindow.mainThread(GameWindow.java:475)
    at java.base/java.lang.Thread.run(Unknown Source)```
frank elbow
next glacier
frank elbow
#

I was jast abt to ask for the Lua stack trace

#

So that means character is nil in that first function

next glacier
#

yea

frank elbow
#

Charafilth* I mean

next glacier
#

no clue why its getting nil

#

i tried setting a local to see if it would change things

#

or fix it, it didnt

frank elbow
#

Seems like charafilth should be an integer at that point

frank elbow
#

You're trying to call getHumanVisual on the return value of the original GetRequiredWater, which is an integer

next glacier
#

original is
character:getHumanVisual

frank elbow
#

I'm assuming you meant character? If your intention is to override that function completely, maybe you don't need to call the original at all

next glacier
#

so trying to character table from getHumanVisual

frank elbow
#

It's not the same as the new function in that a table is not returned, it'll just be a number, so if you change the calculation as long as you return a number it should function

frank elbow
next glacier
#

character contains HumanVisual
and HumanVisual contains BloodBodyPartType and
Blood and Dirt

small topaz
next glacier
#

that was a test, I reverted them back for simplicity purposes. unnecessary code

frank elbow
next glacier
#
local ISWashYourself_GetRequiredWater = ISWashYourself.GetRequiredWater;
function ISWashYourself.GetRequiredWater(character)
    local units = 0;
    local vis = character:getHumanVisual()
    for i=1, BloodBodyPartType.MAX:index() do
        local part = BloodBodyPartType.FromIndex(i-1)
        if vis:getBlood(part) + vis:getDirt(part) > 0 then
            units = units + 1
        end
    end
    return units
end```
frank elbow
small topaz
#

many thanks! think i got it then. 🙂

next glacier
#

both codes same error

frank elbow
next glacier
#

because getHumanVisual() is the issue

next glacier
# next glacier ```lua java.lang.RuntimeException: attempted index: getHumanVisual of non-table:...
    at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:169)
    at zombie.ui.UIManager.update(UIManager.java:930)
    at zombie.GameWindow.logic(GameWindow.java:253)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:745)
    at zombie.GameWindow.run_ez(GameWindow.java:661)
    at zombie.GameWindow.mainThread(GameWindow.java:475)
    at java.base/java.lang.Thread.run(Unknown Source)```
#

am confused now

frank elbow
next glacier
#

let me restart game for a fresh console.txt

small topaz
next glacier
#

this is

errant gale
#

I assume world static model refers to the model when placed. Does anyone know what the static model is for?

next glacier
#

100% same code from ISWashYourself.lua

#

except the local override

#

local ISWashYourself_GetRequiredWater = ISWashYourself.GetRequiredWater;

#

I just want to modify units

frank elbow
#

self.lua line 17 is the code you showed above?

next glacier
#

line 17 is

frank elbow
#

Oh, character is not defined

next glacier
#

what does that mean

frank elbow
#

It should be the first parameter in new

next glacier
#

i thought character was a global

frank elbow
#

Nah, check out the original code

#

function ISWashYourself:new(character, ...) should do it

next glacier
frank elbow
#

Mhm, see how it's listed on the function declaration line

#

Before sink, soapList

next glacier
#

I think im using varags wrong

#

i thought ... would do everything inside

frank elbow
#

May be best to avoid them until you understand what they're doing (which is the case for many concepts!)

#

I can try to offer an explanation of what varargs are for, if you'd like

small topaz
# next glacier

i guess better is even function ISWashYourself:new(character, sink,..) since sink is also used in your code

frank elbow
#

Oh yeah, good call

#

Another thing to note that I meant to note earlier: your current code won't call your overwrite* of GetRequiredWater

#

Which I assume is the intention

next glacier
#

yeah I want to call my override

frank elbow
#

You're calling the original function which you've saved to the variable; if you want to use yours you should call it as usual, with ISWashYourself.GetRequiredWater(character)

next glacier
#

right i should use ISWashYourself.getrequiredwater

frank elbow
#

Yep

next glacier
#

yeah but i think the issue still is

#

getHumanVisual

#

since that errors, then everything else errors? unsure

frank elbow
#

What's the current code?

next glacier
frank elbow
#

The full error gives you the issue; the entire thing says you're attempting to index on "non-table: null", which means you're trying to index into nil, which is not a table (which means character is the problem)

#

Is it still running the old code? Did you reload it from the debugger or restart? According to the stack trace it's still calling the original function

#

Which implies that it's not running the current code

next glacier
#

quitting to main menu is enough right?

#

i might have reloaded this from debugger

frank elbow
#

I'm fairly certain that would be fine, but I'm not 100% sure

#

If it was reloaded from the debugger that should be fine

#

Can you try running it fresh, either with a restarted game or reloaded from the debugger?

next glacier
#

ill restart

#

no way to tell error window if frozen or updated

frank elbow
#

What's the error?

#

Same thing?

next glacier
#

sometimes it only outputs the stack trace

#

is this an issue with the debugger

frank elbow
#

I think so yeah, the full error is in console.txt though

next glacier
#

yea it also froze until i clicked something.

#

it also just now updated in console.txt

#
java.lang.RuntimeException: Object tried to call nil in GetRequiredWater
    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.UIManager.update(UIManager.java:808)
    at zombie.GameWindow.logic(GameWindow.java:253)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:745)
    at zombie.GameWindow.run_ez(GameWindow.java:661)
    at zombie.GameWindow.mainThread(GameWindow.java:475)
    at java.base/java.lang.Thread.run(Unknown Source)```
frank elbow
#

Oh, on line 18 you're not passing in character and sink to the original one

#

So essentially soapList is being passed as the value of character

#

I think removing the varargs so it doesn't cause further confusion would be good 😅

stiff venture
#

TAYZEHH's House Rules

next glacier
stiff venture
#

This is a Mod pack containing TaYzehh's mod list.
MOSTLY QUALITY OF LIFE MODS, SOME MAPS, WEAPONS AND ARMOUR AND VEHICLES.
Painstakingly perfected to have the best effect and immersion in game whilst still being fun and reliable.
❤️
For this mod pack to work properly, WARNING! Disable Paw Low Loot Fantasy Pack!!!!!

next glacier
#

right i still need soaplist

#

if you're not too busy

#

would you have a go

#
---@param character IHumanVisual
local ISWashYourself_GetRequiredWater = ISWashYourself.GetRequiredWater;
function ISWashYourself.GetRequiredWater(character)
    local units = 0;
    local vision = character:getHumanVisual()
    for i=1, BloodBodyPartType.MAX:index() do
        local part = BloodBodyPartType.FromIndex(i-1)
        if vision:getBlood(part) + vision:getDirt(part) > 0 then
            units = units + 1
        end
    end
    return units
end

local ISWashYourself_new = ISWashYourself.new;
function ISWashYourself:new(character, sink, ...)
    local reqwater = ISWashYourself.GetRequiredWater(character);
    local washing = ISWashYourself_new(self, character, sink, soapList);
    local waterUnits = math.min(reqwater, sink:getWaterAmount())
        washing.maxTime = waterUnits * 0.1;
        
    if washing.character:isTimedActionInstant() then 
        washing.maxTime = 1; 
    end
    
    print("Bathing information")
    print("Washing time: " .. washing.maxTime)
    print("selfwater: " .. ISWashYourself.GetRequiredWater(character))
    
    return washing;
end
#

if i load up this

#

character shows up in locals fine

#

and when i return units

#

its 17

#

should work

#

but why

#

probably some index thing

#

i dont get indexing

#

sadly I have only made half of mod

#

im tired

thin hornet
#

that function is used in many other vanilla scripts

#

and they all pass item as first param

#

not much you can do about it

next glacier
#

even specific to

#

ISWashYourself?

#

Want to change amount of water taking a bath does

#

cant do it?

thin hornet
#

ah sorry didnt realise it was ISWashYourself

next glacier
#
---@param character IHumanVisual
local ISWashYourself_GetRequiredWater = ISWashYourself.GetRequiredWater;
function ISWashYourself.GetRequiredWater(character)
    local units = 0;
    local vision = character:getHumanVisual()
    for i=1, BloodBodyPartType.MAX:index() do
        local part = BloodBodyPartType.FromIndex(i-1)
        if vision:getBlood(part) + vision:getDirt(part) > 0 then
            units = units + 1
        end
    end
    return units
end

local ISWashYourself_new = ISWashYourself.new;
function ISWashYourself:new(character, sink, ...)
    local reqwater = ISWashYourself.GetRequiredWater(character);
    local washing = ISWashYourself_new(self, character, sink, soapList);
    local waterUnits = math.min(reqwater, sink:getWaterAmount())
        washing.maxTime = waterUnits * 0.1;
        
    if washing.character:isTimedActionInstant() then 
        washing.maxTime = 1; 
    end
    
    print("Bathing information")
    print("Washing time: " .. washing.maxTime)
    print("selfwater: " .. ISWashYourself.GetRequiredWater(character))
    
    return washing;
end```
#

le code

next glacier
#

the irony. making mod to save time

#

takes time to make mod

#

havent played yet

thin hornet
#

yep

#

havent played in weeks now

#

by the way dont pass the param again

#
local ISWashYourself_new = ISWashYourself.new;
function ISWashYourself:new(...)
    local washing = ISWashYourself_new(self, ...);
    local reqwater = ISWashYourself.GetRequiredWater(washing.character);
    local waterUnits = math.min(reqwater, washing.sink:getWaterAmount())
        washing.maxTime = waterUnits * 0.1;
        
    if washing.character:isTimedActionInstant() then 
        washing.maxTime = 1; 
    end
    
    print("Bathing information")
    print("Washing time: " .. washing.maxTime)
    print("selfwater: " .. reqwater)
    
    return washing;
end
#

you already have access to those variable when running the original one

#

for the error i have no idea where it come from

#

when posting errors always post the callstack

#

or we cannot see enough info

next glacier
#

roger

#
ERROR: General     , 1644588346648> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: 1.0 of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1644588346649> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: 1.0 of non-table: null
    at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1243)
    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.UIManager.update(UIManager.java:808)
    at zombie.GameWindow.logic(GameWindow.java:253)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:745)
    at zombie.GameWindow.run_ez(GameWindow.java:661)
    at zombie.GameWindow.mainThread(GameWindow.java:475)
    at java.base/java.lang.Thread.run(Unknown Source)```
#

callstack

#
local ISWashYourself_GetRequiredWater = ISWashYourself.GetRequiredWater;
function ISWashYourself.GetRequiredWater(character)
    local units = 0;
    local vision = character:getHumanVisual()
    for i=1, BloodBodyPartType.MAX:index() do
        local part = BloodBodyPartType.FromIndex(i-1)
        if vision:getBlood(part) + vision:getDirt(part) > 0 then
            units = units + 1
        end
    end
    return units
end```
#

only this has indexing

#

... i think

#

yeah

#

part is nil

#

nvm

#

changed code to this same error

#

omg

#

wat

#

i removed all the print()

#

and no error

#

yea it works

#

thank you so much guys @frank elbow and @thin hornet. couldn't have done it without you

#

I now present my 1st mod

#

mod options is a bigger mountain that I do not have to corss 😅

#

other mod. not optimized code (probably), but works

#

could have been cool mod

#

sadly not work

#

finally i can play

drifting ore
#

I get that rly weird error:

ERROR: General     , 1644592682027> ExceptionLogger.logException> Exception thrown org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked) at DB.newSQLException line:941.
ERROR: General     , 1644592682028> DebugLogStream.printException> Stack trace:
org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked)
    at org.sqlite.core.DB.newSQLException(DB.java:941)
    at org.sqlite.core.DB.newSQLException(DB.java:953)
    at org.sqlite.core.DB.throwex(DB.java:918)
    at org.sqlite.core.DB.exec(DB.java:178)
    at org.sqlite.SQLiteConnection.commit(SQLiteConnection.java:404)
    at zombie.vehicles.VehiclesDB2$SQLStore.updateDB(VehiclesDB2.java:313)
    at zombie.vehicles.VehiclesDB2$SQLStore.updateVehicle(VehiclesDB2.java:249)
    at zombie.vehicles.VehiclesDB2$WorldStreamerThread.unloadChunk(VehiclesDB2.java:637)
    at zombie.vehicles.VehiclesDB2.unloadChunk(VehiclesDB2.java:946)
    at zombie.iso.IsoChunk.Save(IsoChunk.java:3724)
    at zombie.iso.IsoChunk.Save(IsoChunk.java:3551)
    at zombie.iso.ChunkSaveWorker.Update(ChunkSaveWorker.java:71)
    at zombie.iso.WorldStreamer.threadLoop(WorldStreamer.java:494)
    at zombie.iso.WorldStreamer.lambda$create$0(WorldStreamer.java:567)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1644592686293> EXITDEBUG: ToggleEscapeMenu 1
LOG  : General     , 1644592686294> EXITDEBUG: ToggleEscapeMenu 3

#

I do stuff with the game UI, but sqlite? This is for SQL databases.
I don't see what this has to do with my thing

#

a lot of things

#

Lets me think what was the last thing I added

#

Maybe it's just that I forgot one line somewhere when I tried to add dragging item

#

Nop, not that

drifting ore
#

Mmmmm, do you have any idea of a function that does this?

#

Ok I get where it's come from

#

Thx @jagged fulcrum

dark finch
#

Cant text in #old_techsupport so im askin here. If i change the zombie settings on my server before a restart will the changes take effect

#

Like zombie start pop and multiplier really

#

So ur saying itll only change for unexplored areas?

dark finch
#

Would i have to soft reset?

thin hornet
#

Anyone added custom perks and professions and realized that when dieing and clicking on new character in MP the new profession is not available? But the custom trait are still available.

#

Need to logoff and login again

keen beacon
#

I've searched the workshop but can't find anything, does anyone know of a mod where you can claim Spawn Buildings.

I saw a video on good base locations and it mentioned a bar, my friend spawned in that bar so i suspect we won't be able to make it a safehouse. Which is kinda weird.

#

Are all spawn location buildings predetermined or does it vary from server to server?

drifting ore
#

Does anyone out there use CommunityAPI ?

thin hornet
keen beacon
#

ok but can i do that after someone has spawned in, lets say, that bar?

#

oki

#

so spawnpoints are server specific, got it.

quasi geode
thin hornet
#

oh man ty

fiery pecan
#

welp. Update on my issue.... Apparently sendObjectChange won't work for IsoZombie, instead sendZombie seems more reasonable... Only issue? Everytime I try to use sendZombie, it blasts about "trying to call nil"

calm depot
#

that's usually when you're indexing a table and the field doesn't exist

#

e.g. myTable.doFunc() and doFunc doesn't actually exist in it, possibly because you typo'd it

small topaz
fiery pecan
#
local GetZed = GetZedList:get(i);

GetZed:sendZombie();
calm depot
#

did you client the "Error Log" button and examine the stack trace?

fiery pecan
#

the debug log?

calm depot
#

that'll tell you which exact line caused the error

fiery pecan
#

yes, it points to the line with sendZombie

calm depot
#

no, when you get an error, it brings up the debug window (F11), there's a button at the top to view the error log

fiery pecan
#

mhm

calm depot
#

how are you iterating it?

fiery pecan
#

iterating sendZombie???

calm depot
#

no, getZombieList

fiery pecan
#

oh

calm depot
#

it's a list and I see you have a variable called i

fiery pecan
#

my bad. Here's the chunk specifying that

#
        for i=0, GetZedList:size()-1 do```
calm depot
#

I don't see any function in IsoZombie called sendZombie

fiery pecan
#

iirc it's in GameClient

#

But I have 0 idea on how to call that

calm depot
#

well, I don't know why you expected that to work

fiery pecan
#

public static void sendZombie​(IsoZombie zombie) It's in GameServer, my bad... How does one call "gameServer"?

calm depot
#

you're writing this as a server side mod yeah? what are you trying to do

fiery pecan
#

I've been metaphorically slamming my head against a rock for about a week now to get my changes to zombie outfits to save server side

#

basically

calm depot
#

is your lua code for the outfits in lua/server or lua/client ?

fiery pecan
#

I have the mod scan for zombies wearing outfitA, right? It replaces them with a persistent outfitB, but it won't save attachedItems on SP, and MP just refuses to save...
It's in shared

calm depot
#

ah OK

fiery pecan
#

doesn't work in server either, last time I checked...

calm depot
#

what doesn't work?

fiery pecan
#

saving the outfit on MP

calm depot
#

AFAIK you shouldn't need to do anything special to make the items save once you've mutated them, providing that mutation is happening on the server side

#

if you're just doing it client side, then the server never sees it and, consequently, there's nothing for it to save

fiery pecan
#

I see

#

how on earth do I get the server to run it, then?

calm depot
#

well, it should just run, unless you've wrapped the code in some isClient check that prevents the server doing it

fiery pecan
#

there's no isClient check at all

calm depot
#

I believe you should be able to run your lua only on the server as it'll sync it to clients, but give it a shot

fiery pecan
#

so chuck it into the server folder?

calm depot
#

yeah

#

it'd be easier to investigate if you chucked the code on GitHub or a pastebin or something

fiery pecan
#

sure

unique badge
#

Hello all. Im gonna feel dumb asking this but figured i would give it a shot vs being dumb.
Can i use a UI mod for myself on a multiplayer server? Or would it not work because server doesnt have it?

calm depot
#

it won't work

#

specifically, PZ won't even enable it

unique badge
#

Wow. :/

calm depot
#

all lua gets checksummed as it's loaded as well

#

now, obviously it's not impossible, if you want to go wild with patching the Java classes, have at it

unique badge
#

Shame It doesn't function like some other games where client to servers can have some differences. I.e UI/Graphics etc.

fiery pecan
calm depot
#

since everything executes in a single lua state, that's impossible to do safely

#

maybe if they refactor each mod to run in its own little sandbox, that might become an option

unique badge
#

Guess I got to try harder to sell the mod to the Admins. They dont want "ui changes that can break things" even tho the mod makes things easier to use

calm depot
#

and by safely I mean "without making it trivial to cheat"

#

@fiery pecan yeah, you can chuck that in the server folder. You can still test it on Solo because there's still a kind of server running

fiery pecan
#

that's just it. It saves fine on solo

#

just tested it in the server folder, on a server

#

no saving

calm depot
#

have you verified that your server instance is definitely loading the mod?

fiery pecan
#

yep

#

the outfit replaces

calm depot
#

well, that could just be your client doing it

fiery pecan
#

just doesn't persist beyond a reload

calm depot
#

I'd move it to server and see if you can still see it on the client

fiery pecan
#

I already moved it to the server folder?

calm depot
#

ah, I see, so it's now just in the server folder, but still not saving?

fiery pecan
#

yes

calm depot
#

hm, where in your code is the setAttachedItem call?

fiery pecan
#

nowhere.

#

is setAttachedItem needed?

calm depot
#

well, you said that the outfits save but attached items don't, not?

#

but I don't see anywhere in the code where you're setting any attached items

fiery pecan
#

I'm trying to tackle the outfits themselves first

#

i.e. Zombie spawns with a hat and glasses. Loses hat and glasses, and has a completely different skin color on reload

calm depot
#

ok, so attachments aren't a factor

fiery pecan
#

for now, right

calm depot
#

hm, I don't see anything special in the java code for persistent outfits

#

it's all on WornItem

#

uhhhhh, one thing

#

you're calling Reset() straight after you apply the outfit

#

from what I see here that's basically undoing what you just did

#

remove the Reset calls.

#

oh wait, that's not in your code

#

ah sorry, yes it is, indirectly through reloadOutfit

#

what happens if you remove reloadOutfit ?

fiery pecan
#

let's find out

fiery pecan
faint jewel
#

is there any kind of a quest api?

calm depot
#

no, but there's a GUI, you can write one

fiery pecan
faint jewel
#

a gui you say?

calm depot
#

ok, let's try this as a shitty hack: right after reloadOutfit, immediately call dressInPersistentOutfit again

fiery pecan
#

okie

#

Thanks for helping out

calm depot
#

@faint jewel yeah, as in, the windows you see in the game

#

inventory, character health, etc

faint jewel
#

i know what a gui is.

#

have a screen shot?

calm depot
#

you don't own the game?

#

I'm literally talking about the in-game GUI

faint jewel
#

i... but... wow.

calm depot
#

everything you need to do can be done in lua, take a look at the ISUI/<stuff> files in the game sources

#

if you were hoping for some simple addQuest style function, no, that doesn't exist

faint jewel
#

that is what an API is.

calm depot
#

and that's why I said "no"

#

the materials and tools for building the house are there, but it hasn't been prebuilt for you

frank elbow
#

"there is a gui" = there is an ability to write code which utilizes the GUI. I think that is where the confusion happened (that is, I think it was misunderstood as "there exists a quest gui")

calm depot
#

I mean, I literally said "no, but"

frank elbow
#

🤷🏾‍♂️

calm depot
#

if it wasn't clear, I was stating that the primitives exist for you to build it

faint jewel
#

agreed. "there is a gui" tells me there is part of a system i can use. "you can see menus ingame" is nowhere near that.

frank elbow
#

Just seemed like a misunderstanding, thought I'd pop in to clear that up to try to avoid any argument

calm depot
#

👍

frank elbow
#

I'm not saying I agree w that interpretation, just miscommunication. Happens

calm depot
#

aye

calm depot
#

bugger, and the mod code is still running server-side only right?

fiery pecan
#

I'm pretty sure

#

it's in the server folder

calm depot
#

no lingering copies in other folders right?

fiery pecan
#

right

calm depot
#

also, why are you writing it so that it replaces what they're wearing? why not make it so they spawn with those clothes in the first place?

fiery pecan
#

well

#

mainly for the random zone stories, like police blockades

#

I'm open to an alternative that removes said zombies, and replaces them with mine?

sinful beacon
#

can anyone aid me with brita's?

calm depot
#

@fiery pecan you mean the randomised vehicle stories?

sinful beacon
#

it seems to be working but its only spawning ammo

sinful idol
#

Quick question - does getModData get synced in multiplayer?

calm depot
#

right, another attempt at a hack - after the second call to setpersistentoutfit, add DoCorpseInventory

#

as in GetZed:DoCorpseInventory()

#

looks to me like the Java code doesn't bother to update the inventory of the zombie without that getting called so it doesn't persist

fiery pecan
#

I see

calm depot
#

also, you might find it cleaner to structure your code via a table - e.g.

end }```

Then you can just do `lookup[GetZedOutfitName](GetZed)`
#

to handle the case where the outfit isn't one you care about, just set a metatable on it so that __index returns a function that does nothing

#

eliminates your tree of if/else statements

fiery pecan
#

hmmm

calm depot
#

but first, let's see what happens with this DoCorpseInventory call

fiery pecan
#

yeah

fading frost
#

question, there was mod to allow you to auto-generate a list of items in a container, what mod was that? i can't find it

calm depot
#

auto-generate?

#

you mean like, dump a file containing a list of the items?

fading frost
#

it makes a list of stuff in a piece of paper, or a notepad, or something like that. at least, you need to have one of those in order to generate it - i only saw it in passing before my power went out and i lost the tab, so i can't remember specifics

#

oh i guess i should have asked in #mod_support (my apologies)

fair frost
fiery pecan
calm depot
#

no dice as in it didn't work or as in, you got some sort of error

fiery pecan
#

didn't work

calm depot
#

can you pastebin the code as it currently stands

fiery pecan
#

sure

calm depot
#

oh, no, DoCorpseInventory() needs to be the very last thing

fiery pecan
#

it is?

calm depot
#
                GetZed:dressInPersistentOutfit("PoliceRosewood");
                --Refresh Zombie For Visual Purposes
                GetZed:reloadOutfit();
                GetZed:dressInPersistentOutfit("PoliceRosewood");
                GetZed:DoCorpseInventory();
                --Save The Zombie
--                GetZedVisual:setOutfit("PoliceRosewood");
--                GetZed:setAttachedItems(GetZedItems);```
#

oh they're commented out

fiery pecan
#

yeah

calm depot
#

sorry, you should have chosen Lua syntax highlighting 😛

fiery pecan
#

oh?

#

you can do that?

calm depot
#

yeah, Pastebin can do that

fiery pecan
#

I just found the option

#

oops

calm depot
#

ah, one thing, is this still on the server only?

fiery pecan
#

yeah

calm depot
#

move it back to shared and see what happens

fiery pecan
#

ok

#

why on earth aren't they saving?

calm depot
#

so, when you say they don't save - the zombie itself saves right?

#

but it loads back in with random attire?

fiery pecan
#

yeah. The outfit and skin color/hair are randomized

calm depot
#

and you're testing this by having your player near them, quitting and then reloading it?

fiery pecan
#

yes

#

after spawning them with the debug menu

calm depot
#

with the random vehicle story option?

fiery pecan
#

with the horde manager

calm depot
#

ah, hmm, that may not be a valid test

#

go to a road and use the random vehicle story menu

#

I'm not entirely sure you'll be able to get any zombie to persist

#

I suspect it needs to be initialised in a certain way, which is how it does them for stories

fiery pecan
#

I see

#

welp

#

there's the issue I keep having with spawning vehicle zones on servers

#

they disappear on reload

calm depot
#

are you admin?

fiery pecan
#

yes?

#

it's hosted from the main menu?

calm depot
#

as in, you see the "Admin" menu button on the left hand side

#

I never saw that shit automatically give you admin

#

always had to grant it in config separately

fiery pecan
#

ah

#

How would I do that tho?

calm depot
#

if you don't see the "Admin" button and white text, you don't have it

fiery pecan
calm depot
#

no idea - I just run the server separately and do it from the console window

fiery pecan
#

k

calm depot
#

I guess you could try running /help from the chat box and see if it lets you do stuff

fiery pecan
#

k

winged lotus
#

Evening all, I am having trouble transmitting mod data to client from server side, I have this following code ⤵️

ModData.getOrCreate('myModMD')[playerObj:getUsername()] = false
ModData.transmit('myModMD')

But the clients does not receive the ModData (I check it with Debug menu > GlobalModData & prints, the data does not get there)
I even tried to add

ModData.request('myModMD')
local modData = ModData.get('myModMD')

on the client and it does not get retrieved...
Any idea of what I may be doing wrong here?

Ps: I works in singleplayer, but never in MP

harsh prairie
#

When I click on mods in the main menu and select my mod the image for it doesn’t show up - it’s just black. How do I fix this?

calm depot
#

you should save a .png file in the same folder as the mod.info file and then also have a line in the mod.info that references it

#

if I recall, it's poster=blah.png

#

look at any decent workshop mod's mod.info to see how it's done

#

it's separate from the image used by Steam Workshop

harsh prairie
#

Thanks @calm depot!

calm depot
#

@winged lotus are you sure that the .request call is actually executing?

#

chuck in a print line before and after it and see if they appear in the console

drifting ore
#

anyone has the mod that lets you equip more weapons on your back , i think its a belt mod but idk which one

drifting stump
#
local function OnReceiveGlobalModData(key, modData)
    --do something
end

Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)
winged lotus
#

So this would mean if I want it to sync I have to do this on the client ⤵️

local function OnReceiveGlobalModData(key, modData)
    ModData.getOrCreate('myModMD') = modData(key)
end

Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)
faint jewel
#

can anyone think of a mod where you press a button and a ui comes up?

#

i wanna look at some stuff.

drifting stump
#
local function OnReceiveGlobalModData(key, modData)
    if key == "myModMD" then
        ModData.add(key, modData)
    end
end

Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)
thin hornet
#

anyone found the part of the code that open doors automatically in MP? Been searching trough lua and java and for now haven't found where that "Desync?" come from

winged lotus
harsh prairie
#

Do

tough blaze
#

is there a mod to remove sleep from solo, like MP?

winged lotus
#

Ah! Right 👍

nimble spoke
sinful idol
#

does anyone know if getModData syncs with multiplayer?

keen beacon
#

I'm having trouble with one of those claim safehouse mods, does anyone know if i need to restart a world after having it installed?

grizzled grove
faint jewel
#

I wanna do a "job board" of sorts.

winged lotus
#

Thanks @drifting stump and @nimble spoke it worked! ❤️ 🙏

stiff venture
#

Anybody knows how long it takes for a mod pack to be uploaded?

#

Like a steam pack uploaded in game

fiery pecan
#

@calm depot guess who did a dumb and forgot they copied their files from the workshop folder to the mods folder?

modest yarrow
#

Hello. Is there any good tutorials / resources that talk about Client/Server logic ?

golden plover
#

Is it possible to add more than 6 seats to a vehicle?

nimble spoke
stiff venture
#

i think im messing it up

#

Failed 9

#

i'm getting there 😄

steady gazelle
#

Hello people. I'm trying to make a mod that overrides the zombies distribution so that there is only one available zombie. Every zombie that spawns will look exactly the same, clothing, hairs, etc. I did add a MY_HairOutfitDefinitions and MY_ZombieZoneDefinitions to try to empty the original "lua/shared/NPCs/NPCs/ZombiesZoneDefinition" and then table.insert my own zombie into. I did a clothing.xml to create its outfit too. But there seems to be something missing since i dont see any zombies in game looking like my custom zombie. I also tried simply having a ZombieZoneDefinition.lua which has the same name as the Zomboid one so it would replace it, but it didn't change the spawn neither. Hope i can fin help. Thx !

tired hedge
sinful idol
#

How do you guys test multiplayer stuff when modding?

#

are there ways to simulate a 2nd client or do you just test out with another pc?

knotty creek
#

Has anyone had any luck getting Brita's weapons to work on MP?

round zenith
#

@stiff venture why didnt you just make a collection so that your pack doesnt become useless once any of those mods update?

stiff venture
#

how would i do that?>

round zenith
#

see link i sent you

weary matrix
#

@stiff venture Also you have one of my mod in there for which I strictly forbid the use in a modpack

round zenith
#

ya that too... @stiff venture you probably didnt ask every person that has a mod in you pack

willow estuary
#

Not trying to make you feel bad or anything, but you might just have covered yourself with barbeque sauce and thrown yourself into the lions den here.
You need to get permission for using other's people's mod in your steam workshop uploads, or other such usages, aside from situations where permissions is already granted on the workshop page and such.
A lot of modders, including a fair amount of people who's mods you have are in that modpack, post here. And you're probably going to receive a criticism from them, and others, for not getting permissions.
As well, your modpack may well get removed from steam if people make complaints about you using their property without your permission.

stiff venture
#

oopppps my bad

willow estuary
#

Well, at least I'm offended that you didn't use any of my mods, instead of being offended that you used any of my mods without permission 😄

stiff venture
#

kinda just deleted the whole thing

abstract raptor
#

would it be possible to make a *Quantum Crate IE an item that shared the same inventory with other versions of it placed everywhere?

thin hornet
#

Usually people will make a mod pack for themself and not for the public. Imagine, you don't want to be responsible to updating all the mods and keeping your mod pack up to date and releasing update randomly that prevent server user to login.

willow estuary
stiff venture
#

MY BAD GUYS D:

thin hornet
#

I swear you would go nuts if you needed to maintain that amount of mods xD

#

the more subs the nuttier

drifting ore
stiff venture
#

so is it acceptable to put mods into a collection instead?#

#

I wont be promoting it or anything just figured that i need a modded save for my mates

drifting ore
stiff venture
#

Ok, just wanted to be sure, I understand now that collections are linked to their profile. damn guy cheers for the heads up

#

copyright n that smh

#

saved my skin haha

drifting ore
#

It's not copyright issue, you gonna get nothing. It's just that modder do for the community so the last to do is give them the credit of they work

thin hornet
# stiff venture saved my skin haha

Imagine you have 50 mods in the pack, now imagine you get 15,000 subscriber activly using the pack. Now 20 mods updates. You have to find out what mods updated. you have the update your pack. Now all server using the pack have to restart. 15,000 user have to unsub the pack to allow to join back. Now you get bunch of conflict between mods and cant fix em. Just a pain in the ass for you to take on a big pack like that. But if you make the pack unlisted and use it for yourself. I dont see no problem is it for your personal use. Other than that i know some modder want to be asked for permission so thats an other thing to keep in mind.

stiff venture
#

I messed up pretty bad, this is supposed to be a mod pack for me n my mates however not looking for workshop fame or whatever

#

I've turned it into a collection

thin hornet
stiff venture
#

yeah man 🙂

sinful idol
abstract raptor
#

lemme know how it goes I'm rootin for ya

round zenith
#

Hey Azakaela its been a min

abstract raptor
#

Hiya

#

uwu

round zenith
#

uwu

abstract raptor
#

whats up

round zenith
abstract raptor
#

tons

#

XD

round zenith
#

did you make any leveraging that bunker trick we discovered for vaults?

#

I noticed someone release the elevator mod as an extension of that tech

abstract raptor
#

Yeah 😄

#

I mean I could but its a lot of work to build subterranean areas

#

I used it for Echo Station

frank rivet
#

If i wanted say a vehicle to roll a little bit before coming to a stop. Which line of code would i be looking at for the vehicle script. rollInfluence, or wheelFriction. Or both?

royal ridge
#

Is there a way to run a function every 10 minutes on the server side rather then the player

frank rivet
river tree
drifting ore
#

And next just use the every10minutes event

calm depot
#

@fiery pecan LOL, oh jesus man, that sucks. So what ended up being the correct code? What you originally had?

harsh prairie
#

I am trying to upload to the workshop and it is saying that there is not a preview.png file even though there is one. How do I fix this?

frank rivet
#

not sure if it would make a difference. But here is the dimension of a poster for a mod ive been messing around with from the steamwork shop. the dimensions are 512x512 32depth. maybe try changing the dimensions of the image to see if that would work. But im not 100% sure.

glass gorge
#

@modders make jumper cables that let me jump start vehicles from other vehicles and i'll give you ten real dollars

#

also valid is allowing a method to recharge car batteries using other methods than running the engine

#

wall outlets, generator, a generator bike, whatever

willow estuary
glass gorge
#

i did not, actually!

#

jumper cables offer still stands tho

abstract raptor
drifting ore
#

Looks cool

little vessel
#

Anyone knows if removing item from distributions changed on the stable branch? I have code that used to work before IWBUMS went stable and now it doesnt and I'm stumped as to why. The code looks like this:

local function postDistributionMerge()

    RemoveItemFromDistribution(SuburbsDistributions, "CustomModule.Itemname");
    RemoveItemFromDistribution(ProceduralDistributions, "CustomModule.Itemname");
    print("ZDebug: Removed CustomModule.Itemname")
end

Events.OnPostDistributionMerge.Add(postDistributionMerge)

The print message is printed but the item still shows up in shelves. Tried disabling every other mod, problem still stands. The code is located in lua/server/Items

Alternatively, is there any way to remove an item completely from the game, not just loot tables? If I remove lets say a skill book from the loot tables it still shows up under the character's tab potential learning material that you can find.

#

And on an unrelated note, code to remove vehicles from spawning need an event to work - just putting VehicleZoneDistribution.medium.vehicles["Base.car"] = nil; in lua/shared won't work. Coincidentally none of the workshop mods that have this purpose do this. Since they need to be removed before the world is generated, I'm wondering if using Events.OnInitWorld.Add or Events.OnGameStart.Add is better. I had success with both IIRC.

willow estuary
#

This will remove a recipe book from the learning material tab

ISLiteratureUI.SetItemHidden("EngineerMagazine2", true)
little vessel
willow estuary
#

Right on, good luck! 🙂

little vessel
#

Using

ScriptManager.instance:getItem("Base.Spiffo"):DoParam("OBSOLETE = TRUE")

Should work, right? Since I'm doing multiple items, setting a local variable for each of them just to shorten each line seems a bit cumbersome.

willow estuary
#

I don't set a unique local variable for every item either, I just reuse item as such

local item = ScriptManager.instance:getItem("Base.Spiffo")    
if item then 
    item:DoParam("OBSOLETE = TRUE")
end
item = ScriptManager.instance:getItem("Base.SpiffoSuit") -- Both of these will work, in that item has already been defined as local above
local item = ScriptManager.instance:getItem("Base.SpiffoSuit") -- But I still define it as local as a "safety measure" + I just spam cut and paste
if item then 
    item:DoParam("OBSOLETE = TRUE")
end
little vessel
willow estuary
#

👍

royal ridge
#

any good guides or mods that use globalmoddata between client and server?

little vessel
# little vessel Thanks Algol, as always you are a lifesaver. I will try these and see if I can g...

Yep, Algol's solution works perfectly. The items do not spawn (no idea if they are still "rolled" to spawn though) and the literature vanishes from the learning tab.

Still curious why the old code stopped working - especially since a few mods still use it (like Snake mods) and also because it made it easy to clean the logs from stuff like

ItemPickerJava.ExtractContainersFromLua> ignoring invalid ItemPicker item type "BallpeenHammer"

So I could hunt for spawning errors.

drifting ore
#

textures fucky, please help

#

ive been trying to follow daddy dirks newest tutorials, but I could not open Worded without setting a path to my tiles which I did

#

I originally set my patn to ../tiles/2x but corrected it to ../tiles but its still messed up

#

ok I deleted my old project and closed the programm and it seems to be normal now

#

seems like it just didnt update the path change

willow estuary
drifting ore
#

Alrwady helped myself

small topaz
#

Hi! Does anyone knows what the jave class "HumanVisual" does and how I can call one of it's methods during game? What I need is probably the method getSkinTextureIndex() but I don't know to call it. In my setting, I have the "player" object to work with.

#

A related question: On the client side, can I just use "MainScreen.instance.desc" while in game to get data about the current player? This MainScreen stuff definitely works in the pre-game menus (e.g. during Character Customisation) and contains a lot of data about the player but I am not sure whether it can be called while in game.

frank elbow
#

Assuming player is a reference to a player obtained by calling getPlayer or getSpecificPlayer (or anything else returning IsoPlayer), it'd be called like player:getHumanVisual()

small topaz
#

other question: is current vanilla game, is it true that certain underwear items like the various underpants cannot get dirty/bloody?

frank elbow
#

I'm not sure, hopefully someone else who knows the answer will come along

thin hornet
small topaz
#

i think the script txts for clothing have a field called BloodLocation but the underwear don't seem to have that field...

thin hornet
#

Gotta check how other clothing item works about dirty and bloody

#

My electricity is down i cant code 🤬

little vessel
small topaz
#

maybe adding BloodLocation = Pants may work for blood but no idea how to allow them to get dirty

little vessel
#

Yep, they do not get dirty at all.

thin hornet
#

TIS please we want dirty underwear ty PepeLmfaoooo

small topaz
#

does anyone knows how the "BloodLocation" in the script file work somehow? if i just add it to the script txt of new clothing items (given only by textures) i get errors

#

what is strange is that when i search the whole project zomboid installation folder for the phrase "BloodLocation", all matches I have are in the ones in the script txts. shouldn't there be some other files accessing the "BloodLocation" data somehow???

#

makes no sense...

willow estuary
#

It's handled in the java side code then.

small topaz
#

is the java code somehow encrypted? cause I use a special search function which should search all text files including the java ones (except they are encrypted somehow...)

willow estuary
small topaz
#

thanks... but anyway... even if it would work, i'll better not touch it and try to find another solution...

#

maybe i ask the people from the modelling section how they add blood to clothing stuff.

weary crypt
#

I know it's a feature coming Soon™ but is there currently a way to figure out which mod an item comes from?

drifting ore
#

How can I check the java code of the game ? I never done that before

#

I want to know what the line 677 of UIManager.update do