#mod_development

1 messages Β· Page 513 of 1

modest junco
#

anyone know the ID for the jeep wrangler to spawn some in the server?

stark flame
#

hello, anybody knows a mod for comparing current equiped gear with what I find? would be help comparing stats for clothes with protection and current durability

brittle jewel
#

Those are known as 'placeables' and (I hear) they're one of the more difficult things to mod in Zomboid. I haven't actually tried creating any. I would suggest you start by looking at one of the (hopefully) more basic ones, the composter. Compost returns quite a few results in the files:

#

And there's a few files with 'Compost' in the filename - it isn't a simple change, unfortunately.

#

For anyone trying this in the future, it doesn't work by default with the 'Host' option in game, but it will work for dedicated servers. Unfortunately, @upbeat wolf isn't telling me how to fix that for some reason.

cedar salmon
drifting ore
short quail
#

can someone help me understand how to edit class files?

drifting ore
short quail
junior flame
#

some things just can't be accessed/done with lua

short quail
#

Okay thanks

hearty swallow
#

o/ newb question, on a whim i decided to try making a mod for PZ, my building shows up in game and im trying to figure out how to get the road to have lines painted on it and I just found a post about using BuildingEd to finish it, but google is not my friend today trying to search "project zomboid BuildingEd" would someone help point me in the right direction?

junior flame
hearty swallow
#

🍻 derp, i see it in that menu now, thx

tranquil reef
#

Does anyone know what program I need to load .X model files? I want to import some as an FBX to blender

abstract raptor
#

how are the puddles rendered?

#

is it possible to change their appearance?

#

Two words: BLOOD OCEAN

#

XD

drifting ore
drifting ore
#

Anyone know how I could ask the player to write something (enter a string)? It's to name a thing

terse urchin
#

any opinions on this? more specifically the Gourmet Revolution mod within it

weary matrix
drifting ore
junior flame
#

woops, forgot i went to .obj first and then to .fbx

tranquil reef
#

So converting to OBJ, then to FBX doesn't screw anything up and works fine?

junior flame
#

seems like it, i converted a .x to a .obj, imported that, and exported as .fbx - i wasn't too specific with checking uv mapping since my purposes were fairly basic, so you might have to tinker a bit

tranquil reef
#

Alright, thanks

mystic ore
#

Is there a mod that adds pausing to multiplayer

errant meteor
terse urchin
terse urchin
errant meteor
drifting ore
#

Can I redo a drawing of Spiffo for the cover of my mod? No copyright issue?

dull obsidian
#

So, I would release this fella right now, if only the damage overlay textures worked(blood)! Correct reference, textures are in the correct folder, UV in two channels, shaders are fine. Any ideas what might be wrong?

worldly olive
worldly olive
#

Btw
I keep with the same problem 😦 I need to run the applyTraits function inside the IsoGameCharacter.lua to see if I can make the game recalculate the XP boost of the perks based on the current traits. So the thing is that it receives an ArrayList<String> (I assume all the traits of the player) but I'm not being able to pass that from Lua, does somebody knows how can I make an ArrayList<String> from lua with the traits a player has to pass it to the function?

terse urchin
#

I assumed it was just finding animal tracks using the foraging system, maxed myself out to test it

#

dunno if it's a mod incompatibility issue or if I'm doing something wrong (really I should've just enabled the mod pack by itself without anything else to test it but oh well)

worldly olive
#

Two ways:
Binoculars + Slingshot + Small rocks = Small animals hunt
Having that in your inventory you go to a forest area and right click a tree and an option of "observe" the tree will be there, click on that and the player will start to observe the tree and an image will appear that may be a simple tree, or an animal image, also two buttons will be available asking about Shooting yes or not, if an animal (unless you want to simply waste rocks) press yes, it you are success with the shot, the animal corpse will appear under the tree

Similar with the Rifle
Rifle equipped with a sight of x8 or more + a silencer (not necessary but recommended due to zombies)
Right click the tree and you will face the same situation of observing the environment until an animal appear. If you decide to shoot and you are success, the animal corpse will be there

#

The Hunting skill affects in the chances of seeing animals while the Shooting skills affects in the chances of making a success shoot.
Also for Rifle hunting the accesories of the weapon helps to do a success shoot and the greater the sight the better the chances of spotting an animal.

drifting ore
#

This is super helpful, thank you!!!!

quasi geode
worldly olive
#

local playerTraits = player:getTraits();
local array = {};
for i=0, playerTraits:size()-1 do
local trait = playerTraits:get(i);
array[i] = trait;
print(array[i]);
end
player:applyTraits(array);

Had something similar but I see you have specifically ArrayList.new(), will try that!!

#

Hope it works 🀞🏻

quasi geode
#

heh ya close but with {} you're just getting stuck with a KahluaTable instead of a ArrayList

hidden estuary
#

how exactly does the number interact with the world

worldly olive
quasi geode
#

ya

worldly olive
#

Makes sense, will try that other code

hidden estuary
#

and 0.03 would be a 3/100 roll, right?

quasi geode
#

cant really say for sure. havent looked at the new procedural distributions roll code

hidden estuary
#

while I'm here tho, anyone know how can I make the "chat overhead"?

#

is it an echo?

#

kinda like how print prints to chat

worldly olive
quasi geode
#

going to have to test that out

worldly olive
#

Tried to remove that part of code, started a new game with the mod but without that code, it initialised, added the code again and ran the game (it worked), but as far as I used debug to level a perk it started to throw tons of errors
I think that the reason why it got stuck at the loading screen is because I have that code inside a function that runs with the Events.LevelPerk.Add and that one runs when a character is created because of the strength and fitness. It simply crashed

ERROR: General , 1642643143002> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: No implementation found at MultiLuaJavaInvoker.call line:112.
ERROR: General , 1642643143002> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: No implementation found

quasi geode
#

ah ya must be when your calling it then

worldly olive
#

Also Chuck helped me with this

player:applyTraits(getWorld():getLuaTraits())

But it also crashes the same way

quasi geode
#
   OnNewGame = function(player, square)
    
        local traits = player:getTraits()
        local array = ArrayList.new()
        for i=0, traits:size()-1 do
            array:add(traits:get(i))
            print("*** Added " .. array:get(i) .. " to ArrayList")
        end
        player:applyTraits(array)
        print("Post apply. all good")
LOG  : General     , 1642643431017> *** Added Clumsy to ArrayList
LOG  : General     , 1642643431018> *** Added FastReader to ArrayList
LOG  : General     , 1642643431018> *** Added Brave to ArrayList
LOG  : General     , 1642643431019> Post apply. all good
#

didnt have any issues calling OnNewGame event

worldly olive
#

Hmm it is maybe related to the event then πŸ€”

fair frost
#

Jefferson County FD Engine

worldly olive
#

Yeap... it is related to the event

#

function testFunction()
for playerIndex = 0, getNumActivePlayers()-1 do
local player = getSpecificPlayer(playerIndex);
local traits = player:getTraits()
local array = ArrayList.new()
for i=0, traits:size()-1 do
array:add(traits:get(i))
print("*** Added " .. array:get(i) .. " to ArrayList")
end
player:applyTraits(array)
print("Post apply. all good")
end
end
Events.EveryHours.Add(testFunction);

#

It worked

#

And it did applied the XP boost (it also applied the perk level damn haha)

#

But I think I can manage it somehow

#

But at least it is running now

#

And recalculating the boost

quasi geode
#

nice

worldly olive
#

Maybe I don't have to pass the whole traits the player current has, maybe I just need to pass the trait which I want to recalculate

#

Whatever, I will work with this!! but this is a lot of progress compared to how I was before haha

#

Thank you so much!

quasi geode
#

huh looks like its only called twice in the java (applyTraits) basically when the player is added to the world, shortly before OnNewGame. never really looked at or used that function before

worldly olive
#

Yeah! but as I'm giving traits during the game, I needed (or wanted to) recalculate the XP boost

quasi geode
#

hrm wonder if theres a cleaner way. though as far as i remember the boost is in a hashmap which can sometimes be a pain dealing with from lua (least if you need to insert values)

stray pagoda
#

i jsut found the true music mod

#

its awesome

#

i love it

thin hornet
#

Yo guys can we reload spawnpoints and spawnregions mid game?

drifting ore
#

Hi guys I got a mod concept to save gears. Gears are sets of clothing to equip automatically. It would look like this, what do you think?

long grove
#

I want to make virtual hordes that move across cells and spawn when in contact with a player. I've looked at VirtualZombieManager.java. Can someone explain roughly how the spawning currently works?

I know that when zombies are cleared of a cell it will spawn more zombies depending on the cells population from the heatmap etc. But I want to know things like what are the "reusable" zombies? I guess the zombies that are spawned are classed as "reusable" meaning I guess they are recorded as part of the population as they have already spawned? Is it possible to load and unload these "reusable" zombies to keep them persistant? I was under the impression that every time you leave a cell and come back, the old zombies are despawned and new ones are spawned in?

Thanks in advance for anyone who reads the wall of text and clarifies some stuff.

#

Also any reason Indie Stone has not implemented this?

peak raven
#

I actually was just messing around with a older mod that did this very same thing and got it working last night. its the Hordes mod from the workshop. While I'm not sure about how "Reusable" Zombies work I know that the hordes from this mod remain wandering even when unloaded from the players area.

#

I think performance is the reason they haven't implemented it into the base game. But its something thats been on the list of todo features for a long time.

drifting ore
#

Check under community API

long grove
#

@drifting ore Thanks.

long grove
drifting ore
#

I think the way it works is by calculating zombies individually as they wander

#

Like, calculating their positions

long grove
#

thats stupid?

#

it should just keep track of where the groups are and spawn them in as required?

drifting ore
#

My suggestion would be calculating a node position and then when a player loads that node generate a hoard based on some factors

long grove
#

yeah but why haven't IndieStone done that?

drifting ore
#

I think its because of how the zombie spawns work

long grove
#

yes that's why I want to know how it works

#

and what "reusable" means

drifting ore
#

In map making it uses a weird grayscale heatmap

long grove
#

yes for spawning

#

please read my post

drifting ore
#

I think reusable in the context of PZ is respawned zombies in a cell

#

But I'm actually not to sure, am not home atm to check how they are classed or what other code references the

long grove
#

Yes I've looekd at some ZombieGroupManager, VirtualZombieManager, and ZombiePopulation<anager

peak raven
#

The mod makes them virtual rather than active "real" zombies. similar or perhaps the same to how the base game will occasionally make zombies wander from far off unloaded cells to other cells. from my experience the zombies spawn for the first time when the player draws close. then roams from there. From my experience it doesn't impact performance until the zombies become real when they get close enough to the player for the game to draw them as 3d models.

long grove
#

it seems that the zombies are spawned individually, and then the groupmanager organizes them into groups

drifting ore
#

Ok so I looked into it rq

#

Reusable zombies are ones that I assume have been created but unloaded?

#

Like created in a cell and then unloaded

long grove
#

yep

#

thats my assumption as well

drifting ore
#

Only way to test Ig would to be loading a zombie in an empty cell

peak raven
#

I can send you my current edited mod files from the hordes mod. but I cant really explain my changes or how the original mod worked other than it spawns zombies based off of a script in locations based off of game cordinates. my edits were all just to make the game not shoot errors and crash anymore.

drifting ore
#

Then running into another one and seeing if its reclassed into Reusable

peak raven
#

I also know that it can form a horde dynamically useing a custom manager that can combine a group of like 25 or more zombies into a temp horde to roam around

long grove
drifting ore
#

Nah

#

I'm just brainstorming

#

I might test it and record my findings next weekend

long grove
#

So basically the mod already works as I intended - with your edits to stop it crashing

lapis mantle
#

Is there a way to get a unique identifier for an InventoryItem or an IsoObject? Something that persists across client restarts

peak raven
#

more or less

#

but zombies get stuck on the new curved roads and do all sorts of weird things around fences

long grove
#

so then the performane issue is from number of loaded zombies only - same as base game

peak raven
#

yeah

long grove
#

what they shouldnt get stuck anywhere

#

as soon as unloaded they should become virtual and not do any collision detecting or even movement

peak raven
#

they use some strange find roads navigate.roads script that I dont understand fully yet

drifting ore
#

I think its a tiledef issue

long grove
#

I literally mean zombies in cell A1, move to your cell A2. So they get spawned on the left of the screen, when they leave the cell they are despawned again etc

peak raven
#

Thats what I was assuming yesterday

drifting ore
#

You dont want to calculate hoards walking across water for example

#

For obvious reasons

peak raven
#

They specifically follow roads rather than wander into the woods or anything. if they get stuck far enough away from the player they tend to dispand into vanilla smaller groups and mill about

drifting ore
#

Yeah idk

#

The documentation on zombie spawns is pretty much non-existent

#

A big issue with it is like

#

In other games an issue like this would be handled in a way different way

#

IE spawn a hoard in an unloaded chunk/cell

#

And run a movement change on it every couple of seconds

#

Instead of tracking them 1:1 live

#

Which is how I would do it in PZ anyways

#

You dont really need them to be tile accurate at all

#

Like

#

If you have a 12x12 tile cell

long grove
#

doesnt the group "leader" kind of do that?

drifting ore
#

Theres no reason to calculate a zombie moving from tile 1:1 to tile 1:2

#

But there is a reason to calculate tile 1:11 to cell 2 tile 1:1

#

Its a weird performance issue to solve for sure

#

I mean you really only need to calculate them moving in unloaded cells, correct

long grove
#

yeah I thought that would be the only logical way

drifting ore
#

So just like "mask" the loaded cell

long grove
#

you just mean the cell boundaries?

drifting ore
#

If a hoard runs into a loaded cell boundary, stop their virtual movement

#

Idk

#

Its 2230 Its late to be talking about hoard logic

long grove
#

no you simply determine if a horde is in an adjacent cell or not

#

otherwise you don't care lol

drifting ore
#

When in doubt, revert to early age comp science solutions

#

I have no doubt PZ uses some equivalent of ant colony simulation lol

long grove
#

I just hate the current respawn mechanics. Zombies don't spread out like water on a heatmap lol.

#

you know I actually thought zomboid would use ya know... BOIDS

drifting ore
#

Wait so

#

If zombies like

#

Group together

#

What if you just set a numerical scale on groupd

#

If there isnt already one

#

As # of Zombies in Group increases, raise its hoard priority

#

Higher priority in a hoard = spawn less zombies overall in the cell that hoard is in

#

if that makes sense

long grove
#

no the point is that no matte where you are, there's a dynamic chance that a horde might just happen to path over you

drifting ore
#

Similar to how BOIDs works

long grove
#

they don't have to affect the spawning of zombies in the heatmap

drifting ore
#

You want to like

#

Generate a hoard

#

From scratch

long grove
#

well you could still use spawned zombies, and the game automatically will subtract from the cell's population as it does already

drifting ore
#

I dont think that the game itself allows for dynamic tracking of groups in a cell

long grove
#

and then maybe instead of just spawning them in, you could spawn them offscreen and have them wander in only when a player enters a low pop area

drifting ore
#

Like I think that zombies are assigned to a group and then the game just checks if they move from cell 1 to cell 2

long grove
#

Yeah the zombies actually seem to be handled individually which is horrible

drifting ore
#

And then another process handles spawning of "hoard" objects

long grove
#

but im not sure because zombie groups have a "leader"

drifting ore
#

iE 5 or more zombies clustered together

long grove
#

I assumed that the "leader" was the only one doing movement and the others just follow it boid style

drifting ore
#

I think they are

#

But I dont think its like

#

Tracking the leaders movement on tiles

long grove
#

actually eventually I want this to remedy the stupid spawning mechanics

drifting ore
#

But rather in cells

long grove
#

i.e no more clearing a cell, leaving for 2 seconds and coming back to a full cell

drifting ore
#

Like if Group A1 wanders into Cell 2 with 5 children

long grove
#

you have to wait for a "horde" to wander in and populate the cell. And if you are there when it happens they will spawn offscreen and wander in

drifting ore
#

Then Cell 2 has 5 zombies subtracted and then generates 5 around a leader

long grove
#

yes

drifting ore
#

And then they "move" into Cell 3

#

And repeat

#

But I dont think it actually tracks them crossing the cell

#

Only transitioning between them

#

And then it just spawns the group randomly in the cell based on its heatmap

#

If I had to guess, thats how it's done

#

It would make sense from a performance perspective

long grove
#

I don't think it works that way currently

#

or are you talking about the mod?

drifting ore
#

The base game

#

I'm fairly sure its just tracking movement between cells and nothing else

#

Works great for performance but it sucks for overall spawning

long grove
#

if (var1.getCurrentState() == ZombieIdleState.instance()) {
int var5;
float var10;
if (var1 == var1.group.getLeader()) {
var10 = (float)GameTime.getInstance().getWorldAgeHours();
var1.group.lastSpreadOutTime = Math.min(var1.group.lastSpreadOutTime, var10);
if (!(var1.group.lastSpreadOutTime + 0.083333336F > var10)) {
var1.group.lastSpreadOutTime = var10;
int var11 = SandboxOptions.instance.zombieConfig.RallyGroupSeparation.getValue();
Vector2 var12 = this.tempVec2.set(0.0F, 0.0F);

                 for(var5 = 0; var5 < this.groups.size(); ++var5) {
                    ZombieGroup var13 = (ZombieGroup)this.groups.get(var5);
                    if (var13.getLeader() != null && var13 != var1.group && (int)var13.getLeader().getZ() == (int)var1.getZ()) {
                       float var7 = var13.getLeader().getX();
                       float var8 = var13.getLeader().getY();
                       float var9 = IsoUtils.DistanceToSquared(var1.x, var1.y, var7, var8);
                       if (!(var9 > (float)(var11 * var11))) {
                          var12.x = var12.x - var7 + var1.x;
                          var12.y = var12.y - var8 + var1.y;
                       }
                    }
                 }
#

no the base game has no hordes I don't think. I think it simply spawns zombies until it reaches the threshold in the heatmap, by subtracting population values from the heatmap until there is a "hole" which then gets filled by adjacent population tiles. i.e it acts like water finding its level which I find stupid.

drifting ore
#

I mean there is a chance for zombies to spawn in "hoards"

#

In the proverbial sense

#

IE 5 - 10 zombies huddled in a group

#

I don't know how thats handled though

abstract raptor
#

guys I'm attempting something incredibly complicated

peak raven
#

dear god, You've made an info sheet

abstract raptor
#

hahah, I mapped the notes of guitar to the keyboard

peak raven
#

you trying to make the guitar in game playable?

abstract raptor
abstract raptor
#

I just need to like figure out how to
1: Make it so pressing home overrides all the other hot keys till it's pressed again
2: Map each of the keys to the relevant sound file
3. After I establish each of the notes in the sound script

peak raven
#

I think thats a great idea. but maybe you could go with how Starbound gave you the option to import midi to control the instrument would be simpler for the player lol.

abstract raptor
#

Yeah, that's not how I want to do it, I want people to play the notes like the keyboard was a midi keyboard, but laid out like the guitar itself

peak raven
#

Thats fair. I've seen that done before and it's always cool

abstract raptor
#

The only problem I think is that keyboard only has room for three strings at a time

#

so

#

like it does restrict a lot in that you'd have to hold shift to access the other 3 strings

#

But I think people who are creative work around limitations and can still achieve a lot with 24 notes at a time

#

But this is only one out of two ways I want guitars to be playable.

#

I was also considering how to do chords

peak raven
#

got it, you have to make it compatible with the RockSmith usb cable so I can plug in my Les Paul and play to people in Zomboid

abstract raptor
#

hahahah

#

that'd be hilarious

#

Nah I think it's gonna be weird cuz the way I'm envisioning it

#

you'll have to hold like the Z key, then press Space to play "E1"

drifting ore
#

So

drifting ore
#

If that makes sense

#

Although I think you're already doing thay

#

So nvm ignore me

abstract raptor
#

Yeah that's the idea, and you can access the top 3 strings by holding shift

peak dust
#

Help! How do I leave Raven creek?

dark solar
#

raven creek is to the west of knox country, so go east

peak dust
#

I've followed the road but there's no exit

dark solar
#

looks like the road is at the north end of the map

peak dust
#

dang

#

Ok thx

#

I didn't know they updated it

dark solar
peak dust
dark solar
peak dust
#

ok thanks again!

dark solar
#

no problem

tranquil reef
#

anyone know what line of code I can use to check if the player is wearing a specific item?

jagged venture
#

How do you edit your access level in a server you're hosting?

drifting ore
zenith smelt
#

Is there a good way to save a variable on the server which persists between server restarts?

hidden compass
#

Please let me know if anyone can help me.
I have prepared own PNG image and when I display it (by drawTexture function), the image is distorted.

Attached image is the example result of displaying vanilla's "FavoriteStar" in two different ways.

  • case 1. display from texture.pack as in vanilla: OK
  • case 2. display from file: NG
drawTexture(getTexture("media/ui/FavoriteStar.png"), x, y, 1, 1, 1, 1)
-- case 2
drawTexture(getTexture("media/ui/FavoriteStarFromFile.png"), x, y, 1, 1, 1, 1)```
Is there a solution to this problem?
drifting ore
lapis mantle
#

Can anyone help suggest a way to uniquely identify an InventoryItem or IsoObject that will persist across client restarts and across multiplayer clients? Do items have anything like a world id?

vagrant trench
#

I tried to follow the "one stop tilezed"-thread. When I'm trying to generate lots i seem to get no result. Any suggestions for what to look for, that could be wrong?

#

I've created a 1x1 where I've placed a building. The three inputs in the dialog window have been correctly filled as far as i know

manic sorrel
#

Question, how do I read into what exactly each moodlet level does? I don't mean off the wiki.

tame veldt
#

Does anyone know how to make a recipe in lua? Or can link to an example

weary matrix
#

Hey there, I need to find out what is calling this function ISWorldMenuElements.ContextDisassemble but I can't find the place. When looking through the whole media/lua folder there's no other reference to it but the declaration. Also tried to check only for ContextDisassemble but same thing. Any clue?

weary matrix
tame veldt
weary matrix
muted lynx
#

Ok, might have asked this in the wrong chat, do not know. I am wondering if someone has the LUA Extension libraries for Project Zomboid, that I can just install onto my IdealC or Visual Code πŸ™‚

mint sphinx
tame veldt
lapis mantle
#

is it possible to read the coordinates/offset and rotation of a placed item? IsoWorldInventoryObject has xoff, yoff, zoff but they don't seem exposed through getters

mint sphinx
tame veldt
mint sphinx
#

scripts\recipes.txt look like the have most of basic recipes there

tame veldt
eternal garnet
#

Anyone making mods that alter the weather?

Removing this morning mist would be great

#

If anyone can do it, hit me up, I'll pay for it it's so annoying

dreamy silo
#

is there a clever way to use 3 different items?
atm my recipe uses:

A/B/C/D/E/F/G
A/B/C/D/E/F/G
A/B/C/D/E/F/G
#

can I use sth like

3x(A/B/C/D/E/F/G)
``` ?
#

because if there are more than 8 items and you use them several times the recipe page is quite long

lapis mantle
lapis mantle
worldly olive
#

Hi! me again. I continue with the damn perk boost.
With @quasi geode help I managed to ran the applyTrait function but it does looot of things so it is not an option anymore.

I'm now tring to run the
addXPBoost from the TraitFactory class.
The thing is that I'm not finding a way to get an specific trait from the player to apply the boost. Right now I do have this

function testFunction() for playerIndex = 0, getNumActivePlayers()-1 do local player = getSpecificPlayer(playerIndex); local traits = player:getTraits(); for i=0, traits:size()-1 do if traits:get(i) == "Formerscout" then print("PreBoost"); local traitString = traits:get(i); local trait = TraitFactory.getTrait(traitString); trait:addXPBoost(Perks.PlantScavenging, 1); print("PostBoost"); end end end end Events.EveryHours.Add(testFunction);

And that "works" but the boost of course is not applied to the player perk because this is not related to the player: local trait = TraitFactory.getTrait(traitString);
As far as I see in the TraitFactory the only function that returns a TraitFactory.Trait (I need this to run the (addXPBoost) is the getTrait, does somebody knows if I can access to that one from the player?
player:getTrait(String) does not work

tulip valve
#

Um you are just trying to add a new trait?

worldly olive
#

No, I'm trying to apply the XP boost during the course of a game. Let's say the player earn a new trait. I want to apply the XP boost that trait is supposed to give (and it does when picked from the start)

tulip valve
#

Oh

#

No idea then sorry xD

#

Ask Fenris maybe? He really knows this stuff

worldly olive
#

I see everywhere that if they use the player they use the getTraits, not the getTrait, that one is always used with TraitFactory, damn

mint sphinx
#

have a qusetion about your testfuctions

#

why would you make the call local traitString = traits:get(i); if you already know its "Formerscout"

worldly olive
#

That's only because I'm testing how to run that and I'm using formerscout to test, then that line won't be there

#

Yeah actually I don't need it

#

Not even for test

mint sphinx
#

i see some do struff like that in the real world and i never understod why a person would first do if statement and after that they would do the same opreations to get the string

#

okay so there was no point because you know it always true in that case ^^

worldly olive
#

function testFunction()
for playerIndex = 0, getNumActivePlayers()-1 do
local player = getSpecificPlayer(playerIndex);
local traits = player:getTraits();
local trait = TraitFactory.getTrait(player:getTraits():get("Formerscout"));
print("PreBoost");
trait:addXPBoost(Perks.PlantScavenging, 1);
print("PostBoost");
end
end
Events.EveryHours.Add(testFunction);

#

Like that

#

The for was there since I tested the arraylist thing xD no more sense to keep it

mint sphinx
#

wait are you doing double loop before

#

also i even guess you could do a local trait = TraitFactory.getTrait(player:getTrais():get("Formerscout)) or nil
if trait ~= nil then
do stuff
end
and cant remmebr if lua make nil object as false as default if so
if trait then
do stuff
end

mint sphinx
worldly olive
#

Yeah but my current problem is the "do stuff", I need a way to do that "addXPBoost" to a trait that BELONGS to the player, so I don't have to call TraitFactory, somehow I need to access to that trait from the player

#

In the applyTrait function inside the IsoGameCharacter.lua there's a line that is

this.getDescriptor().getXPBoostMap().put(var14, Math.min(3, var15));

Where var 14 is the Perk and the other is an int so I'm now thinking that maybe that line is the one that I need πŸ€” to update the xpboost

mint sphinx
worldly olive
#

I tried with this too but I got a lua error from another vanilla function πŸ€”

function testFunction()
for playerIndex = 0, getNumActivePlayers()-1 do
local player = getSpecificPlayer(playerIndex);
print("PreBoost");
player:getDescriptor():getXPBoostMap():put(Perks.PlantScavenging, 1);
print("PostBoost");
end
end
Events.EveryHours.Add(testFunction);

Caused by: java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
at zombie.characters.IsoGameCharacter$XP.getPerkBoost(IsoGameCharacter.java:14531)
... 47 more
LOG : General , 1642689953060> -----------------------------------------
STACK TRACE

Callframe at: getPerkBoost
function: render -- file: ISCharacterInfo.lua line # 118

mint sphinx
#
unction testFunction()
    for playerIndex = 0, getNumActivePlayers()-1 do
        local player = getSpecificPlayer(playerIndex);
        local traits = player:getTraits();
        for i=0, traits:size()-1 do
            if traits:get(i) == "Formerscout" then
                print("PreBoost");
                local traitString = traits:get(i);                              <------ delete this
                local trait = TraitFactory.getTrait(traitString);            <--------- to local trait = TraitfactorygetTrait("Formerscout")

                trait:addXPBoost(Perks.PlantScavenging, 1);
                print("PostBoost");
            end
        end 
    end
end
Events.EveryHours.Add(testFunction);

#

what was i trying to say first time ^^ because you always konw when you inside that call it alwas the "formerScout" so you dont make random noice in the test code like traitString = a whole new call when you know it going to be the same as "Formerscout"

worldly olive
#

Yeah but that local trait = TraitFactory.getTrait(traitString); is no longer related to the player as I'm calling the Factory

#

Even though it doesn't throw a lua error and the trait:addXPBoost is executed, it doesn't affect the player

#

Because the trait is not related to the player

fast fractal
#

Hey friends, is anyone working on a solution to the workshop spam we have with server packs and carbon copied mods with non-unique images nor descriptions? I like to see what kind of cool stuff people are coming up with, but the noise is pretty annoying.

mint sphinx
mystic ore
drifting ore
#

Idk how you'd add pausing

#

To MP

#

Like from a fundamental standpoint

#

Who knows tho it might literally already exist as a disabled function

mystic ore
#

Β―_(ツ)_/Β―

#

20 bucks to whoever can make it work

#

Just dm me

worldly olive
#

For some reason when I run this:

function testFunction()
for playerIndex = 0, getNumActivePlayers()-1 do
local player = getSpecificPlayer(playerIndex);
print("PreBoost");
player:getDescriptor():getXPBoostMap():put(Perks.PlantScavenging, 1);
print("PostBoost");
--[[ local traits = player:getTraits();
local trait = TraitFactory.getTrait(player:getTraits():get("Formerscout"));
print("PreBoost");
trait:addXPBoost(Perks.PlantScavenging, 1);
print("PostBoost"); ]]
end
end
Events.EveryHours.Add(testFunction);

I'm getting lua errors in the Callframe at: getPerkBoost
function: render -- file: ISCharacterInfo.lua line # 118

That line is
local xpBoost = self.char:getXp():getPerkBoost(perk:getType());

Does somebody has a clue? πŸ€”

brittle jewel
#

What does the actual error say and not just the line?

worldly olive
#

Callframe at: getPerkBoost
function: render -- file: ISCharacterInfo.lua line # 118

ERROR: General , 1642695522452> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor385.invoke.
ERROR: General , 1642695522452> DebugLogStream.printException> Stack trace:
java.lang.reflect.InvocationTargetException

#

Caused by: java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
at zombie.characters.IsoGameCharacter$XP.getPerkBoost(IsoGameCharacter.java:14531)

brazen nova
#

any modders that are experienced wanna make some money?

#

need an anti-cheat

quasi geode
# worldly olive Caused by: java.lang.ClassCastException: class java.lang.Double cannot be cast t...

thats resulting from player:getDescriptor():getXPBoostMap():put(Perks.PlantScavenging, 1);

Fenris_Wolf β€” Yesterday at 6:08 PM
hrm wonder if theres a cleaner way. though as far as i remember the boost is in a hashmap which can sometimes be a pain dealing with from lua (least if you need to insert values)

the problem is the boost map specifically is expecting a integer value, but all numbers are doubles in lua making it impossible to directly insert a value, kahlua wont convert them on map insertion
also,

 local trait = TraitFactory.getTrait(player:getTraits():get("Formerscout"));
        trait:addXPBoost(Perks.PlantScavenging, 1);

doing this is going to effect the trait across the board, not just for the player (addXPBoost is called when first defining the trait)

#

honestly i think i ran into this whole issue before when i made the Buyable Traits mod (using skillpoints to buy traits mid-game) but I didnt spend much effort on solving it since i wrote the mod as a joke for a friend (she was complaining about excess skill points and not being able to buy traits with them)

worldly olive
#

Looks like it is not possible to parse it to int then πŸ€”πŸ˜₯

#

Hate this 🀣

#

But the logic is ok? I mean if it was an integer it should have worked πŸ€”

#

I copied it from the applytraits

brittle jewel
#

I think math.floor should return an int. Not sure how that's handled in Zomboid, though.

quasi geode
#

ya i tried half a dozen ways to force it to be a int but kahlua just wouldnt do it. kalua treats all numbers as doubles, even integer values, and a double is a perfectly valid entry for a hashmap so it doesnt convert it on insertion (unlike passing it to functions that expect integers where it will convert)....i even tried specifically casting and converting to a int but theres just no way. as soon as its in lua its a double

brittle jewel
#

Ahh, yep, good ole kahlua issues.

quasi geode
#

math.floor wont. just a double that looks like a int

brittle jewel
#

Ah okay, Zomboid must do something different to that then.

swift nova
#

I remember the old skill system where you earn skill points

worldly olive
#

Damn... Stupid lua πŸ˜₯

drifting ore
quasi geode
#

really whats needed is a setXpBoost wrapper function for inserting into the map 😐

drifting ore
#

Or do I miss something ? That should be enough

quasi geode
#

the event is specifically triggered at the end of the AddXP method call after the xp has been added and transmitted. trying to add more xp while inside the event will trigger the event again (endless recursive loop). It could be done but it would be some pretty hackish dirty code

green venture
#

What check does a server make in order to determine that you have a mod and the mod is the right version?

drifting ore
lime atlas
#

Hey there ! I was wondering, if anyone has an answer ofc, can I remove an Item from the vanilla loot list ? I'm making a mod to replace prisoners clothes. So far I got them to spawn on zombies, but boilersuits are still present in wardrobes in shelves πŸ€”

weary matrix
#

Any clue how to properly check if a player is currently inside its own safehouse?

rough pendant
#

try knocking?

weary matrix
pearl prism
#

Guys, if I delete a file in my "workshop" folder and then update my mod on steam, will this file be deleted from the folder of the user who had already downloaded my mod?

odd notch
marble folio
# odd notch

imagine playing a tabletop RPG game in a ROLEPLAY server inside a RPG game
I want it so much now

odd notch
#

it's live on my server rn, but the pretty dice icon won't be there until,., i mean ill probably wait another day to avoid the angry mob if i update too quickly

#

adding in /pm, whisper, whisperme, etc for ~subtle rp~

marble folio
odd notch
#

i have an entire RP server with dnd rolling features

marble folio
odd notch
#

it's in my shortbio if you click my name lazy

left vault
#

how does one create a mod?

#

like, for example, adding a new type of pickle jar

novel prawn
novel prawn
#

This tutorial video will show you how to make a simple drink in Project Zomboid. I will go into the steps involved from start to finish. Read more below.

0:00 intro
1:08 Start
1:44 Searching for images to use in game
2:30 Searching for the Sound Effect
3:06 Creating mod file directory
3:54 Creating mod.info
4:34 Creating a poster
7:14 Adding ne...

β–Ά Play video
devout rock
#

How do I put the contents of a ISPanel into two columns instead of just 1?

novel prawn
#

Hey everyone, I just started modding and I'm doing the typical babby's first mod (adding a new item that's just a retexture of the wine bottle for an inside joke). I copied everything from the basegame wine bottle, created the item, distribution, texture, world model all working... except that, following some stuff I read here, I tried to use the WorldItems/Wine.fbx for the StaticModel instead of modifying and re-exporting the obsolete Wine.X.

As it happened to @drifting ore last week, when drinking the bottle the model is flipped. How do you go around fixing that? Sure, I could try making a WineFlipped.fbx but that seems crazy inelegant. Looking at e.g. the Teacup Fix mod, they use a single .fbx for the HotDrinkTea's StaticModel and WorldStaticModel and theirs seem to work perfectly.

olive sapphire
#

Anyone use or know of a mod that lets a player combine things easier? 1 click to combine all my thread. Maybe add more things that can combine into itself like salt or pepper?

novel prawn
glass rampart
#

any way to set .xml file load order?

odd notch
#

oh yeah @brittle jewel i saw you made like a whole function for pruning the images from chat

#

were you pruning the [img=] stuff?

#

on your bubbly bubble typer mod thing

alpine jasper
#

Has anyone found a way to reset loaded chunks?

#

like for fire damage etc

odd notch
#

find the chunk via its coordinates in your world save folder

#

usually looks like map_coordx_coordy.bin where coordx and coordy are numbers

alpine jasper
#

ah thank you

#

much obliged

odd notch
#

yea its all stored neatly so you can pretty much delete an entire area by just glancing at its coords

alpine jasper
#

amazing

odd notch
#

id backup the files beforehand for obvious reasons but that'll reset them as if noones visited them

drifting ore
#

Server Owner here, I just had a quick question regarding spawning in objects not in the default admin tools such as chairs, flags, flooring, etc.

How do I go about doing it?

#

Has anyone had success using ISTextEntryBox? I get one in my UI but when I change the text, it changes it in the box but in transparency it remains the original text and when I try to get the text with getInternalText() it always gives the same text, the original one. So it never updates, anyone an idea?

brittle jewel
# odd notch were you pruning the [img=] stuff?

Yeah, I'm getting the message with the OnAddMessage, getting the text with message:getText(), checking if that matches the image texture:[img=media/textures/bubble1.png]. An if/else for 1.png/2.png/3.png is much quicker than string.find to check if the message matches what you want. Then, I'm setting a doDelete variable that is checked in OnPlayerUpdate so it's nearly instant.

#

Feel free to modify/take/whatever code from my mods!

odd notch
#

i jsut did something similar with 1 line of gsub

brittle jewel
#

That won't remove it for other players.

odd notch
#
ISChat.addLineInChat = function(message, tabID)
    local line = message:getTextWithPrefix();
    line = line:gsub("%[img=" .. "(.+)" .. "%]", ""); --prune ugly img= nonsense from chat
#

when it goes to add the line into your chat, it'll scrub it out

#

though i wonder if it'll still remain as a newline

brittle jewel
#

Yes, it'll start doing weird stuff after 250 lines, I think.

#

I set up a loop to output 250 messages in chat, then did testing.

odd notch
#

oooo weird stuff?

brittle jewel
#

Some people said it would scroll up randomly, some said it wouldn't move at all. I got some weird reports in the early stages of chat bubble.

odd notch
#

oh yeah

#

pz's chat is awful;

#

when you reloadchatsettings sometimes itll just- zoooom you up

#

for no reason at all

brittle jewel
#

I gave up trying to remove the chat lines when they toggle the prefixes/timestamps.

#

It's just not worth the hit to performance. And people rarely do that (I think) as I haven't received any complaints.

odd notch
#

yeah very very rarely

#

i have it as a 'show authors' feature since i gsub out multiplayer usernames in my rpchat mod and reloadchatsettings just... does its thing

#

an accidental feature that i've just run with

brittle jewel
#

Lol the best feature!

odd notch
#

praying they release some form of update to the chat system because my god

#

the fonts especially kill me

#

for processsaymessage and the others its nearly as bad as comic sans imo

brittle jewel
#

Yeah, they need to open more of that up to Lua.

odd notch
#

my coauthor scraped the isoplayer.class to replace the 'Q shouting' callout stuff and is currently trying to find a way to rewrite the defaultchatsettings bytebuffer nonsense thats javalocked

#

if she can manage to adjust the defaultchatsettings in some way, we might be able to rewrite it our dang selves

fair frost
bright acorn
#

Anyone have some experience with adding custom animations? I mirrored the 1H attack animation to the opposite hand but I can't get it to play

silver kindle
#

Hey anyone know a mod I can make a safehouse anywhere? I wanna safehouse my huge warehouse

fathom hare
#

I think its a setting in the .ini files u need to edit. ^

#

Hi guys i've just arrived here.

#

I am a big ingame radio enthusiast, so my first question: could it be actually possible to make ingame radios that support the transmission on multiple frequency channels?

#

For now you need to be on the exact same frequency as the other person, but would it be possible to make HAM Radios i.e operate in a wider spectrum in the same time?

#

i.e you tune a spectrum of 117 to 118mhz on the HAM and everyone in that spectrum (117.2, 117.4, 117.6... 118MHz) would hear your transmision.

#

For now in roleplay MP its nearly impossible to find each other with all that frequencies (With military radios ranging from 0-1000MHz), so im just thinking of a way to make it more possible to actually be able to randomly bump on each other transmission on the radio.

#

Especially if u have a HAM

dreamy grotto
#

when you want to code an expanded acumulator in the style of cod zombies but you lack the skils to do it 😦

drifting ore
#

I have a question that might pertain to modding

#

Does anyone know if the corn vegetation stuff gets destroyed when ran over by a car?

#

Or do the cars just phase through it

#

And if they do, is there a reference for where that is handled in the code

surreal coral
#

When working with Tiled, what exactly is the difference between all of the "0_FloorOverlay"s? I don't see a difference when placing stuff down selecting any of the 4.

drifting ore
#

Very slight differences

#

Iirc every single blending tile is on a seperate layer based on its direction

#

Idk why

#

Its weird

#

And confusing

manic sorrel
raw tulip
#

im back
time to make more minecraft mods

manic sorrel
#

Those aren't source files they're already compiled

silver kindle
lucid sparrow
#

does anyone have experience with adding mods to a dedicated server, and can we take it to the dms if you do

weary matrix
manic sorrel
#

And what would you recommend to do that?

#

I'm trying JD Ui but not working at all honestly

#

Online one seems to work

drifting ore
#

Wtf, I'm a survivor know ?

#

I did this quickly tonight, I have almost finished my mod to save sets of clothes, or gears. All that's missing is the button to equip everything and minor change, like the display name instead of item name and the name of part that is buggy

#

Don't hesitate if you have any suggestions or ideas.

#

Btw, it's my birthday! I say it only for praise πŸŽ‚ πŸ˜‰

raw tulip
#

after months of waiting, i have returned from my hiatus

#

time to make crappy mods again

drifting ore
raw tulip
#

hows things? is animZed available yet?

#

i think i recall a lot of things such as character meshes were being restricted by this

#

or has a new system been found?

#

like... i will legit make a minecraft mod for project zomboid if i can get my head around how the character rigging/skinning works

#

heard that AnimZed was the thing, i saw a dancing mod so i should look for that guy

#

hm... maybe i shouldnt ping without a reason so... @elfin bobcat

#

oh... he speaks russian...

drifting ore
raw tulip
#

dang.. im studying his mod right now (2648779556)

#

how the fck did they pull this off, fascinating

dark finch
#

Any experienced weapon scripters, im finishing up some gun models and need help implementing them

#

check modeling to see them

raw tulip
#

oh... the dancing mod uses fbx files. im not too familiar with them

dark finch
#

its for models usually

raw tulip
#

from my experience i think fbx files in this case are just bone position data

dark finch
#

or animations for specific models i use those in ue4

raw tulip
#

yeah thats right

#

oh... its using the default character models pz already has

#

dang so i cant make pz into minecraft yet...

#

unless...

dark finch
#

no herobrine?

raw tulip
#

i can pull skin weight data from the original character models

#

and learn how to apply them to a new mesh, minecraft characters

#

it could be possible... i just need to find a good converter that preserves skin weight data

#

hm maybe this is too big

dark finch
#

the only way id know of doing something like that is putting it in unreal since its also an animation too and exporting the file from it when im done doing that

#

sparingly has some decent covert options

raw tulip
#

but pz is java...? and currently is using dirext.x files for its 3d models

dark finch
#

but its pretty crude i doubt its very efficient

raw tulip
#

hm alright.

dark finch
#

aslong as java is reading .fbx files ue4 should too and whatever u export out of that should be compatible

#

I wouldnt take my advice tho i will find any means necessary to make things work lol

#

id also suggest using a app called "spin 3d" i just used to to convert a .x file to an fbx so i could work on it in maya

raw tulip
dark finch
#

and then i don see why not convert the back into .x when done tinkering with the fbx version

raw tulip
#

mesh, skeleton? is this the rig being used?

#

usually from my experience the rig and mesh are one package, not separate

dark finch
#

yeah that should be the skeletons for both genders, the thats what the mesh is gonna work off of and target too

#

sorry if i aint explaining to well im pretty young and new to this stuff still

raw tulip
#

fair enough, thank you for your input

dark finch
#

np

raw tulip
#

hm... im thinking of doing something risky as hell

#

i might just ask the developers how the heck some of the mesh/bone structures interact

#

probably wont get a response

dark finch
#

Do u have a 3d model software?

raw tulip
#

yes

dark finch
#

which one?

raw tulip
#

blender, formerly maya

#

oh.. well at least i could make mods for more.. saucy poses for the mannequins

#

"Female_Body.X" in the models_X folder is this one above

dark finch
#

Im currently using maya, but id use that spin thing was was talkin about and convert both the β€œfemale body” and the β€œfemale skeleton” and import it into a brand new scene so u can take a closer look at it

#

Convert them to fbx.

manic sorrel
# weary matrix you can decompile .class file

Found what I was looking for but do you have a decompiler suggestion I tried a few and none of them work. Currently this online one does but it doesn't accept multiple files also be nice to read it in VSC

raw tulip
#

maya no longer free, had to abandon it ☹️

dark finch
#

I cant even get the .x files in blender or maya

#

Unless i convert

raw tulip
#

spin thing in maya? im having a hard time understanding

dark finch
#

Spin 3d is its own software

raw tulip
#

oh

dark finch
#

It litteraly just converts 3d files for u

manic sorrel
raw tulip
#

ooh this might be what im looking for

dark finch
#

Thats how i made for exmaple m14.x turn to m14.fbx

raw tulip
#

ive just been using online converters

dark finch
#

Yeah i couldnt even get online converters to work

crude rover
#

I have a question about a mod on a server I am playing on

#

would someone maybe jnow more about it

#

ah maybe this is the wrong channel

manic sorrel
#

Don't ask to ask please

crude rover
#

lol

#

well its the autostar bus tuning mod

#

maybe someone has some experience using it

raw tulip
#

we need a programmer in here

#

us artists cant help with this mate haha

#

@crude rover well ill ask some more questions

#

whats going on?

crude rover
#

basically I have read the magazine you need to read

raw tulip
#

what is this issue related to/doing?

crude rover
#

just no crafting recipes showing up for the items

lunar sedge
#

works beautifully!

crude rover
#

and the discord server of the creators of the mod is locked to patrons and they have no guide on their workshop page

#

kinda dumb

raw tulip
#

im no programmer, so dont quote me

crude rover
#

thats fine

#

im more asking to hopefully find someone that has used the mod

#

and if thats the case maybe they know what I am doing incorrectly

manic sorrel
#

I do have java 64 bit

weary matrix
weary matrix
manic sorrel
#

Well that seemed related seems I'm a bit of an idiot. I still want to know why JD UI wouldn't work

#

I'm not installing all this crap just to datamine a bit

quasi geode
#

jd-gui is outdated. wont decompile newer stuff

manic sorrel
#

And what about procyon

quasi geode
#

no idea

manic sorrel
#

Used bytecode viewer seemed to work pretty well for my needs

#

Now I just gotta added it to a vsc workspace

abstract raptor
raw tulip
safe cedar
# abstract raptor

This reminds me of how I used to sit in my base and play guitar through my interface while reading books to pass the time, usually in a circle with other people. Super comfy

fathom hare
#

Playable instruments is what this game needs exactly

#

kinda little stalker vibe

#

and when all those novel books, comics, and tv magazines someday run out

#

thats your last way to stay at least a little more happy

safe cedar
#

yeah, and listening to someone play music/playing music decreases boredom and increases happiness

dark finch
#

@raw tulip

#

i actually prefer to make animations here then maya atm

surreal coral
#

is the tilezed and worlded you get from steam up to date?

manic sorrel
#

Yeah this decompiler is working well, found out any positive food moodlet increases carry strength by two and it doesn't go up with higher levels.

odd notch
#

is there an event that ticks like, every ten minutes or so?

#

wish there was a list of these events agony

carmine flume
#

There is a list of events. I believe there is such an event. Lemme check real quick

#

Yep, there's an event EveryTenMinutes

odd notch
#

oh thank GOD

carmine flume
#

Also EveryOneMinute if you need it more often, and EveryHours or EveryDays if you need it less often

odd notch
#

you're a blessing

#

i'm making an afk kicker and,, well it works! but i didnt want to be That Shitcoder who has ticking code on the main ticker

#

every hour will be splendid

carmine flume
#

I have a question. I need to store some moddata, so I get it like obj:getModData() which returns a table, but changes to that table don't seem to be remembered later. Is there some particular way in which I can ensure that this data is remembered by the IsoObject?

#

I may just be doing something wrong it it's supposed to be remembered, though. I can try to debug my code further, but I've been tweaking it for hours and I can't seem to get it to work.

#

...actually, I just figured out the problem, I think

#

I accidentally overrode a variable I needed from outside the function scope inside of it.

#

I was using the OnCreatePlayer event and I needed the second argument, so I just named the first unused one id not realising that's also my mod id. So I've been writing my data to 0 instead of my mod field

brittle jewel
#

It's pretty common practice to use _ for unused variables - onCreatePlayer(_, player)

carmine flume
#

Yeah, I renamed it to that now

#

Maybe I should look into a VSCode extension that flags Lua syntax errors and warns about undeclared / duplicate variables and such

brittle jewel
#

It'll save you tons of time, especially if your code is getting lengthy.

autumn torrent
#

I just started getting into modding project zomboid, and I'm trying to add a soda for practice. However, I noticed that the documentation for how to setup an icon is no longer up-to-date. Where do I store the .png for an icon for an item? It says to store them in the media/texturepacks/ui.txt, but all the files in that folder are .pack files, and that doesnt really make sense

tulip valve
#

@autumn torrent a Good idea is to look how other mods have done it

tulip valve
carmine flume
#

Alright, now I have a new problem. Namely, I'm doing some stuff in the OnServerStarted event that alters global moddata:

local function OnServerStarted () 
  ModData.getOrCreate(id)
  -- Do stuff
  ModData.add(id, modData)
end

After this, I want to use it in the client, in the OnAddXP event, but the table I get there is empty. I'm not sure how to sync moddata between the server and client though. I've looked into the getServerModData function but it never triggers any event on the client when used? I've hooked into OnReceiveGlobalModData just to see if it fires, and it doesn't. Neither does onLoadModDataFromServer. And just calling getServerModData doesn't seem to do the trick. SendCustomModData fires just fine on the server's end so calling that function does do something but I'm not sure how to give the client access to moddata edits from the server.

Edit: Looks like I have to call ModData.request.

autumn torrent
#

I'm not entirely sure why my icons aren't showing up ingame. I've tried looking at another mod that adds an item but our file structure and code are the same (at least regarding the icons)

odd notch
#

there any guides for getting started with moddata? something as simple as saving a single variable to the client

carmine flume
#

I've just been working with moddata as well. I don't think there's a tutorial, but there is the following:

#

There's a section about moddata in there, including networking

frank elbow
# manic sorrel Now I just gotta added it to a vsc workspace

IntelliJ works pretty well for me, capsid (or however it's written) has a tool for decompiling but IntelliJ can also just show the decompiled class itself. The benefit of running a tool is that you can use utilities like "view references" a lot easier

carmine flume
#

Basically, how it seems to work is like this: if you have something on the server, you use ModData.request to pull it to the client, or ModData.transmit to push it to all clients. There are then events you can hook into to intercept that data

manic sorrel
#

I'm managing fine for what I'm doing, finally found where health increases are from

#

I hate n1-999

carmine flume
#

e.g.

local id = 'MyModID'
local function OnReceiveGlobalModData (key, modData)
  if key == id then
    ModData.add(id, modData)
  end
end
Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)```
manic sorrel
#

AddGeneralHealth

carmine flume
#

Zomboid does a ton of tiny little things in places you can't access from Lua that you might wanna change. It's really quite a pain sometimes

manic sorrel
#

I'm just datamining

carmine flume
#

Having the Java source is definitely a lifesaver though

manic sorrel
#

Wiki is so bad for figure out specifics

#

I expected strength to increase with each level of being fed well but no not at all

carmine flume
#

Yeah, someone should write a more detailed guide on modding than we currently have. Though I'm just getting started with modding so I'm not really in any position to

manic sorrel
#

Also what it means by strength is so weird

carmine flume
#

Having some specific knowledge about these things collected in one place would be good

manic sorrel
#

Some times they give exact carry weight numbers other times its "Their strength is increased"

#

And when they mean strength I assume more than just healing and carry weight

#

But nooo

#

Thats all there is

elfin hornet
#

Does anyone know where I might commission a mod or does anyone know of anyone accepting commissions?

carmine flume
#

what kind of mod are you wanting to be made? Just curious.

autumn torrent
elfin hornet
#

If the mod is good, maybe make marine armor and the MA5B

bright acorn
#

This is probably a stupid question but does anyone know how to access controller inputs in Lua?

#

I see the input class in the docs but I can't figure out how to access its methods.

carmine flume
#

There are global methods for it, I think

#

isJoypadPressed, isJoypadDown, isJoypadLTPressed, isJoypadRTPressed, etc.

bright acorn
#

oho wow I completely missed that

#

thank you!

carmine flume
#

I'd recommend decompiling the Java source if you haven't. You can look up exactly what they do in the LuaManager class

manic sorrel
#

This is taking a lot of time but I'm getting the facts.

Moodlet Explanation:
Thirst: 
 Slightly Thirsty = Nothing (0.002+ Standard Regen)
 Thirsty = -1 Carry Weight (0.0013+ Regen)
 Parched = -2 Carry Weight (0.0008+ Regen)
 Dying of Thirst = -2 Carry Weight, Slow Death (Regen Set to 0 and -0.0165 Health)
Hunger:
 Satiated: +2 Carry Weight (0.015+ Regen)
 Well Fed: +2 Carry Weight (0.015+ Regen) 
 Stuffed:  +2 Carry Weight (0.015+ Regen)
 Full to Bursting: +2 Carry Weight (0.015+ Regen)
 Peckish = Nothing (0.002 Standard Regen)
 Hungry = -1 Carry Weight (0.0013+ Regen)  | Under 85 Hunger
 Very Hungry = -2 Carry Weight, (0.0008+ Regen)
 Starving -2 Carry Weight, Slowly Die (Regen Set to 0 and -0.0165 Health)
bright acorn
#

I have the decompiled file, I've been looking for controller instead of joypad though 2739bronoway lmao

manic sorrel
#

Woops thirst has a different health loss

#

Come to find out that higher levels of stuffed don't increase regen rate...

#

Even more so running actually attacks those moodlets while they're active.

carmine flume
#

There's also stuff like getControllerAxisValue in the global functions. I think they're meant to be used together? But not sure.

manic sorrel
#

Suddenly can't find if running does eat at it. Ignore what I said there I suppose for now.

junior flame
odd notch
#

thanks!!

dark finch
#

Checking again to see if there is any one experienced in weapon scripting

sonic nebula
#

Does anyone know where the data on watched/read VHS/Books is kept in relation to the ISOPlayer object?

candid imp
#

Hey guys! How to change the volume of the trunk of a car in your fashion?

odd notch
#

@brittle jewel your chatbubble mod is great ❀️

#

a meme i was just sent

manic sorrel
#

@cursive roost

cursive roost
#

?

manic sorrel
#

Virus link was posted

#

Discord scam link

cursive roost
#

ah. taken care of already :)

manic sorrel
#

πŸ˜ƒ

green venture
#

Hello! Can I ask what is the Lua Command Console for and how to use it in DEBUG mode? I tried a few generic commands but it keeps throwing me errors... Could anyone provide me with an example?

brittle jewel
green venture
brittle jewel
#

If you're already in debug, you can just use the item spawner. But yeah, you can get the player's square and then add an item to it.

#

getSpecificPlayer(0):getCurrentSquare():AddWorldInventoryItem("item", 0, 0, 0)

green venture
brittle jewel
#

No worries! The more people that have modding knowledge the better.

green venture
#

ahh there are base ids like Base.Hat_BalaclavaFace i forgot

brittle jewel
#

Exactly!

green venture
#

It worked!

carmine flume
#

Anyone have experience with dynamically adding server options? I just get a vague error about a java.lang.RuntimeException: at MethodArguments.assertValid if I try to create a new ServerOption.

#

e.g. lua DoubleServerOption:new(opts, optName, 0.0, math.huge, 1.0)

brittle jewel
#

Like these settings?

carmine flume
#

Yeah, sort of. Not necessarily the UI part, though I guess that would be helpful, too. I want to have server settings that I can load when the server starts to do some stuff with it. Having them appear in that list too with as little effort as possible would be best.

brittle jewel
#

It's pretty painless!

carmine flume
#

That's not dynamic though

#

I can't do that at runtime from the looks of it, which is what would be ideal for my application

brittle jewel
#

Ah, no you can't define new options at runtime. They would all need to be set up before that. You can get the values of course, and they can be changed whenever.

#

Or, I don't know how, is what I should say.

carmine flume
#

Hmm. Well, I'm just trying to figure out why the DoubleServerOption constructor throws an error for now, but I can at least try to look for another way.

#

Ah, I think I should use . instead of : on the constructor. That would explain why it complains about the method arguments.

#

this should not be the first argument in that call

drifting stump
carmine flume
#

Yes, I know the difference. I just messed up.

drifting stump
#

im just saying you could still use .

carmine flume
#

No, I have to use ..

#

: is incorrect

#

The DoubleServerOption.new function does not take DoubleServerOption as its first argument

#

because a constructor is static

#

I used the shorthand in a situation where I shouldn't have, rather than the long form in a situation where the shorthand is possible

#

It works now. I've succeeded in dynamically adding server options. Only to the ini for now, but the UI is next.

manic sorrel
#

Yeah no : and . are different

#

: passes self implicitly, . calls it without self, or self needing to be passed explicitly

#

If the original method is defined with : then you should call with : as these will both pass self implicitly.
However if its defined with . and called with : , : will try to pass self as the first argument.

peak raven
#

hey, I don't mean to interrupt but is there a way to create and spawn a new entity that isn't a zombie or a survivor.?I was wanting to work on Don't Starve style hallucinations that could appear and disappear depending on the sanity of a player

manic sorrel
#

Theres like 4 different combinations of BS with it. However this is only active in metatables.

manic sorrel
#

You passed the table DoubleServerOption in the first argument leading to that error.

carmine flume
#

Yes, I know how they differ. I just messed up, but I fixed it. I called a Java constructor with : which makes no sense because it passes the class as a first argument.

manic sorrel
#

Wait this was in java?

carmine flume
#

I instantiated a Java class from Lua

manic sorrel
#

mmm I unfortunately don't know how lua works at the interpreter side.

#

I'm not sure if meta tables are in use in connecting the languages

carmine flume
#

Point is, I do know how it works, I just made a mistake and fixed it

manic sorrel
#

Alrighty

carmine flume
#

I can call it with : but that means the function signature doesn't match, leading to an error.

#

And I don't think any Java constructor takes its own class as a first argument. That's kind of silly.

manic sorrel
#

No that doesn't make sense for the type of language java is

carmine flume
#

I can sort of see it if there's some templating going on but it's kind of wacky to put that in a constructor as the first argument

#

It would have to have a function signature like this to be able to call it with :

public SomeClass (final Class<?> c) {
    // Do stuff
}
manic sorrel
#

Mmhmm

radiant marten
#

anyone know how to repair windows with soul filchers building time?

drifting ore
#

Is there a way to know the wind & water resistance and insulation of a bodyPart with current equipment?

molten dove
#

hey guys, does anyone know which file handles loot distribution on top of furniture etc please?.. I dont mean the .lua that handles the loot distribution inside containers. thank you ❀️

weary matrix
drifting ore
#

There is only the health

weary matrix
drifting ore
muted lynx
#

Hi guys, I made a VERY simple mod for PZ, "Pee in a bottle" which basically makes your character able to drink pee and regain a very little amount of hydration, but gain unhappiness. It's meant to be able to push your character those extra miles before dying from dehydration, for example if you're stuck on the highway with no water. Someone explained it to me as "Bear Grylls Simulator", but now comes the question.

I am very bad at LUA coding etc, all the code I got so far are very simple and .txt based. So I am wondering if there is someone who might know a little that would like to collaborate a bit on it? Currently it got around 80 downloads since release 2 days ago, but I have gotten some awesome suggestions which I have tried implement, but just don't know how. Obviously you'll be added as a co-collaborator. PM me if you can help.

weary matrix
mint sphinx
mint sphinx
muted lynx
mint sphinx
#

so look like you want to add a trait and then hook it into eating/drinking actions

weary matrix
muted lynx
weary matrix
muted lynx
#

OK YOU GOT ME! I like drinking pee! OKAY! 😦

drifting ore
weary matrix
drifting ore
carmine flume
#

I'd say the max is the value. I mean, so long as you got something covering a spot, wearing more clothing either over or under it won't decrease the time it takes for you to get wet in real life.

#

The most water resistant garment protecting a part of your body determines how wet it gets

#

So that's not always going to be the one on top necessarily

#

I haven't checked in the code, but that sounds like the most straightforward way

verbal ivy
#

Hi, anyone know where the weapon tooltips in the inventory panel is coded from? I tried looking from ISInventoryPaneContextMenu.lua to ISInventoryPane.lua but no avail, anyone know where is it from?

verbal ivy
#

I have now search all throught the LUA files and can't find any code that resembles the weapon tooltip, guess it's hardcoded in some where else? weird, any other tooltips are in lua files

cold burrow
#

Still looking a way to completely remove item from a game. I tried:

local item = ScriptManager.instance:getItem("Base.ExampleItem")    
if item then
   item:DoParam("OBSOLETE = TRUE")
end

Looks like this method works and prevents item distribution at all. But sadly it's not 100% solve my problem.

I also tried to do this one thing:

module Base
{
  item ExampleItem { }
}

And it's works, like, item completely gone. But i'm getting error while i trying to use item from belt or holster.

I also found this method, but i still don't know how to make it works:
https://projectzomboid.com/modding/zombie/inventory/ItemContainer.html#Remove-zombie.inventory.InventoryItem-
Probably coz this is not lua.

Any help greatly appreciated. <3

drifting ore
#

How can I get the hotbar of the player to know items equip ?

drifting ore
#

It's just a guess

cold burrow
drifting ore
drifting ore
#

Does anyone know how to check if an item is accessible? If the player can grab an it without moving. I look at the craft menu but if someone knows the answer, I take it

drifting ore
#

My new mod that I do in parallel with my other. It allows you to save sets of equipment, check the stats, compare them (not done yet) and equip everything quickly if everything is at hand. I will add another 2-3 things before putting it on the workshop.
I hope it will be useful to other. I did it because I'm tired of taking 5min to change my clothes when I return to base after an expedition.

cold burrow
dry shoal
#

Anyone know of a mod that adds more facial hair options? Ive been lookin for something with a handlebar stache option but no luck.

#

if not question2, is there any resources for skinning in this game so i can do it myself?

drifting ore
#

First release of my third mod

#

It was faster to make than I expected

rapid sparrow
#

No matter what I do I cannot get manage containers to work in multi-player anymore

#

I've tried everything and am prepared to go nuclear

drifting ore
#

What blocking you ?

rapid sparrow
#

I am only loading the server with manage containers and it doesn't work

alpine jasper
#

Day 2 of trying to graft Kingsmouth into my existing map

#

I got half of it, which ain't bad

#

deleted the relevant cells in the server database

#

still won't gen anything where the existing north riverbank of the main map gens

odd notch
#

there a way to clear the debug error log without rebooting?

alpine jasper
#

maybe I have to delete associated isoregiondata files as well as the .bins

drifting ore
autumn torrent
#

what is the type of a dropdown menu option in the sandbox menu? can't seem to find anything on this or an example in the base game files

alpine jasper
#

Reapply Style?

autumn torrent
#

I'm setting up a sandbox-options.txt file for adding options to the Zombie Lore page of the sandbox menu, in this case, I want a dropdown that mimics the Strength dropdown of the base game

drifting ore
#

Ok, I was thinking of something else πŸ˜‚

#

No idea about that

autumn torrent
#

Yah sorry, excuse my ambiguity

devout rock
#

I'm getting an error when opening up the map where my modded UI resides.
It displays normally as intended, but the first time I open it I get a couple of errors once.
The log points to these lines in my code:

self.mapLegendWindow:drawTexture(colorCommunity, self.iconColumn, 10, 1, 1, 1, 1, 1)
self.mapLegendWindow:drawText(getText("UI_legendCommunity"), self.textColumn, 8, 1, 1, 1, 1, UIFont.Small)

Is there some sort of syntax error or something minor like that? Since the UI elements display just fine

drifting ore
#

I know how to do it in a new UI but not on the sandbox menu

odd notch
#

what is the error

devout rock
# odd notch what is the error

STACK TRACE

Callframe at: DrawTextureColor
function: drawTexture -- file: ISUIElement.lua line # 735
function: render -- file: MapLegendUI.lua line # 62.
[21-01-22 21:01:40.997] ERROR: General , 1642791700997> ExceptionLogger.logException> Exception thrown java.lang.IllegalArgumentException at GeneratedMethodAccessor227.invoke..
[21-01-22 21:01:40.997] ERROR: General , 1642791700997> DebugLogStream.printException> Stack trace:.
[21-01-22 21:01:40.998] LOG : General , 1642791700998>

STACK TRACE

Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@cda45b41
function: drawText -- file: ISUIElement.lua line # 916
function: render -- file: MapLegendUI.lua line # 65.
[21-01-22 21:01:40.998] ERROR: General , 1642791700998> ExceptionLogger.logException> Exception thrown java.lang.IllegalArgumentException at GeneratedMethodAccessor200.invoke..
[21-01-22 21:01:40.999] ERROR: General , 1642791700999> DebugLogStream.printException> Stack trace:.

odd notch
#

that doesn't look like the full error

devout rock
#

Ok I'll try to get the full one, give me a minute

#

I only see these two errors in the log

#

I've updated my previous post with the new error log @odd notch

pearl prism
#

Hello, does anyone know any mod or have any tips that make me get the mouse coordinates on the screen?

drifting ore
#

Just that, it's global

pearl prism
odd notch
#

if you aren't in debug mode you should be in debug mode

#

f11 -> errors -> screenshot whats there

#

from what i can see

#

you only have 8 arguments in your drawtexture proc

#

i believe it takes 9

pearl prism
# drifting ore `getMouseX()`

Your tip helped me a lot, do you know the command to get the screen resolution ?if I set it only to mine it will give problems to my mod😦

odd notch
#

try following that syntax

sinful vessel
autumn torrent
#

In media>scripts, on the file that contains your item(s) info

sinful vessel
#

Okay thanks

autumn torrent
#

I'm still stuck on this. Cannot figure out for the life of me what the dropdown menu type is for the sandbox options and I can't find it anywhere. If anybody has any suggestions for words or knows what it's called, please help me lol the dropdown box is what im trying to code and the code is my own that doesnt work because the type isn't correct.

Words I've used so far are: dropdown, choice, table, combo, combobox, options, option, selection, select, tray, menu, list

devout rock
#

I'll try to bruteforce the errors tomorrow, throwing things at the wall and seeing what sticks (the only way I know how to code lmao)

drifting ore
#

I found all of this in lua\client\XpSystem\ISUI

#

These are the health, protection, information panels, ect

surreal coral
pearl prism
sonic nebula
#

Does anyone know what java object handles what RecordedMedia an player has/hasnt watched?

glass rampart
#

does distributions support decimals? like 0.5 or 0.05?

drifting ore
willow estuary
glass rampart
#

and how exactly does it work? like 0.5 = 50% ? or 0.5 is half from 1%?

frank elbow
#

Any number means that number/100

#

So 1 means 1/100, 0.5 means 0.5/100 (1/200), 0.04 means 0.05/100 (1/2000)

glass rampart
#

bcz i have 3 items, one = 1% second = 0.3% and third = 0.1%, after killing 200 zeds i had 0 first items, and around 5 or so third items

frank elbow
#

I believe what I just said is the case, at least, it's either that or /10

glass rampart
#

strange, i also tested with 0.05 value, and they was dropping more often then those that has 1

frank elbow
#

That's strange if so, sledgehammers (for example) usually have values that are around that ballpark

glass rampart
#

well i just had another test it was #1 = 3, #2 = 2, #3 = 1

#

and after killing 500 zeds i got 12 of 1st item 10 of second and only 1 of third

#

while with value of 0.05 after 100 zeds i had 10 or so items

frank elbow
#
willow estuary
#

FYI the spawn chances are not a percentage/%, the math is fairly complicated but that number isn't "X out of 100" odds.

frank elbow
#

Nevermind then, thank you

glass rampart
#

aigth then what is the lowest possible value?

#

1?

willow estuary
#

I use stuff like 0.001 all the time? Dunno what the minimum value is, but there's a lot of factors affecting the calculation, including the amount of zombies in the vicinity inflating the chances, and with that in the equation I believe that there may be a "minimum effective value" of table entries that is higher than really rare spawn chances?

When I test stuff that is supposed to be super rare, it never seems to be as rare as "0.001" should imply?

glass rampart
#

got it, ty, ill also try 0.001 and extr rare loot options

#

need to see if there will be a difference, coz as i said with 0.05, from ~100 zeds it was around 5 items... and that's not so rare

weary matrix
#

Any clue how this could be true in MP? I have debug mode disabled and I don't start the server in debug mode either:

CharacterCreationMain.debug = getDebug() and getDebugOptions():getBoolean("Character.Create.AllOutfits")```
#
        @LuaMethod(name = "getDebug", global = true)
        public static boolean getDebug() {
            return Core.bDebug || GameServer.bServer && GameServer.bDebug;
        }
#

yet I'm getting some error in a code block like:

if CharacterCreationMain.debug then
    -- do something that leads to crash
end```
sonic nebula
#

|| and && are null termininating

#

do you mean it to be Core.bDebug || (GameServer.bServer && GameServer.bDebug);?

drifting ore
#

What is the difference between getPlayerIndex() and getPlayerNum() ?

#

Because getPlayerIndex return a nil

weary matrix
#

but in that case the parenthesis don't change the logic

weary matrix
sonic nebula
#

but you are right parenthesis would not change the end value of the expression

carmine flume
#

Anyone happen to know where the sandbox settings for single player games are stored?

#

Can't find it in the saves folder

weary matrix
#

but only way CharacterCreationMain.debug would be true is if getDebug() returns true

sonic nebula
#

im not too familiar with lua but can you use a boolean operator on an assignment expression?

#

CharacterCreationMain.debug = getDebug() and

opal wind
#

guys i notice my make ups cant be removed; you have to change it for a vanilla make up and then remove option is avalible

#

i put they like this on definitions:

#

local makeup = {};
makeup.name = "Wiz_HarleyQuinnMakeUp";
makeup.category = "FullFace";
makeup.item = "Wiz_HarleyQuinnMakeUp";
makeup.makeuptypes = {};
makeup.makeuptypes["All"] = true;
makeup.makeuptypes["Foundation"] = true;
table.insert(MakeUpDefinitions.makeup, makeup);

makeup = {};
makeup.name = "Wiz_MysticBodyMakeup";
makeup.category = "FullFace";
makeup.item = "Wiz_MysticBodyMakeup";
makeup.makeuptypes = {};
makeup.makeuptypes["All"] = true;
makeup.makeuptypes["Foundation"] = true;
table.insert(MakeUpDefinitions.makeup, makeup);

#

do i need something extra for them to be on the Remove List?

drifting ore
#

How do I check if a KahluaTable is identical to another?
== doesn't work because it's not the same table, they just have the same values. If I can just check if the size of the two is different it would work but I can't do it strangely. I put the two tables for you to better understand

#

The code I tried:

if table1.len ~= table2.len then return nil end
for i,v in ipairs(table2) do
    if not table1[i] == table2[i] then
        return nil
    end
end
return table1
weary matrix
#

first you never return true, but also if not table1[i] == table2[i] is probably not doing what you expect

drifting ore
pine vigil
drifting ore
#

return nil if not the same, othewise return table1

weary matrix
#

@pine vigil the crash occur here function: disableBtn -- file: CharacterCreationMain.lua line # 1277
more specifically the code that crash is:

        if CharacterCreationMain.debug then
            for bodyLocation,combo in pairs(self.clothingCombo) do
                fillCombo(bodyLocation)
            end
        end
#

line 1277 is the one with the for keyword

drifting ore
#

It's two string, I should be able to compare them

weary matrix
drifting ore
#

oooooo

#

so if not (table1[i] == table2[i]) then ?

teal slate
#

that'd be better for sure

#

can try the lua demo or the repl if you have it

weary matrix
pine vigil
drifting ore
weary matrix
teal slate
#

i'm surprised there's no __equals metamethod override done by kahlua πŸ€”

drifting ore
#

I don't know what is the # operator πŸ˜…

weary matrix
#

returns the number of elements in table1 assuming table1 is an array

drifting ore
teal slate
#

also works for strings

weary matrix
#

@quasi geode @teal slate any clue about my problem with getDebug() that returns true even if I have debug mode disabled on both client and server side?

#

unless the stack trace is wrong πŸ€”

quasi geode
#

not offhand

drifting ore
weary matrix
drifting ore
#

So not a kahluaTable ?

weary matrix
#

depends what you put in there

drifting ore
#

string

#

it's a table with int as index

weary matrix
#

if you only do table.insert(table1, value) to add items, then it's an array

#

how do you perform the insert?

drifting ore
#

table.insert

#

So I'm not crazy, it should work it's an array

pine vigil
weary matrix
drifting ore
#

On my first post you have the 2 table, I want to return on of them only if they are identical

pine vigil
drifting ore
#

Ok I'm just fck stupid, I was comparing with the wrong table xD

#

work like a charm

weary matrix
#

hehe

pine vigil
weary matrix
#

also you'd need this in sandbox character page:

pine vigil
#

Ah yes, I'm stupid

drifting ore
#

How do I get all item of a type that is in a container ?
FindAndReturn(type) give only the first one and FindAndReturnStack too

#

Do I need to check all item in the container ?

pine vigil
drifting ore
weary matrix
#

for example in my spear traps mod I do this to get the full list of spears fom player inventory, including from equipped bag:

local items = inventory:getAllEvalRecurse(function(item, player)
        if item:isBroken() then return false end
        if item:getScriptItem():getCategories():contains('Spear') then return true end
        return false
    end, ArrayList.new())
drifting ore
#

Don't get what you code do

weary matrix
teal slate
#

actually, no, hm

#

would still be fine

#

or rather, not return true if it's disabled

weary matrix
#

@teal slate I suspect "Allow Clothing Unlocked" might be enabling debug? πŸ€”

teal slate
#

... weird

#

i can't uh

#

find where it's actually used in gettext

#

wait

#

{ name = "AllClothesUnlocked" },

#

blurgh

drifting ore
#

How do I get an element in a java.util.ArrayList ?

drifting ore
#

Never mind, I found getBestCondition witch is exactly what I need

teal slate
#
public final SandboxOptions.BooleanSandboxOption AllClothesUnlocked = this.newBooleanOption("AllClothesUnlocked", false);
#

odd

#

seems fine

weary matrix
teal slate
#

hmm

#
   private void onTrigger_SetDebugOptions(String var1) {
      try {
         DebugOptionsXml var2 = (DebugOptionsXml)PZXmlUtil.parse(DebugOptionsXml.class, ZomboidFileSystem.instance.getMessagingDirSub("Trigger_SetDebugOptions.xml"));
         Iterator var3 = var2.options.iterator();

         while(var3.hasNext()) {
            DebugOptionsXml.OptionNode var4 = (DebugOptionsXml.OptionNode)var3.next();
            this.setBoolean(var4.name, var4.value);
         }

         if (var2.setDebugMode) {
            DebugLog.General.println("DebugMode: %s", var2.debugMode ? "ON" : "OFF");
            Core.bDebug = var2.debugMode;
         }
      } catch (PZXmlParserException var5) {
         ExceptionLogger.logException(var5, "Exception thrown parsing Trigger_SetDebugOptions.xml");
      }

   }
#

this is all i can think of

#

unaccounted-for core.bdebug setting

weary matrix
#

humm could it be that if a client connects with debug mode enabled, it will enable debug on the server until the server restarts?

teal slate
#

mmmmmaybe

#

would be easy enough to check

#

if it is, it's core.bdebug

#

also just found this gem

#
   public static boolean IsDebugSave() {
      return !Core.bDebug ? false : false;
   }
weary matrix
teal slate
#

some of these could be because of the decompiler

#

like my gripe about this

#
      if (var3 != null && this.isWallTo(var3)) {
         return true;
      } else {
         return false;
      }
#

when it's equivalent to return (var3 != null && this.isWallTo(var3))

drifting ore
#

How do I take an item to put it in an other container ? I tried that but no item:setContainer(self.char:getInventory())

#

I'm looking at the inventory UI but I think someone know the answer

#

It's probably a pretty common thing to do

willow estuary
#
function AM2_TransferBag(cont1, cont2)
    local movedItems = {} 
            cont1Items = cont1:getItems()
            if cont1Items:size() >= 1 then 
                for i = 0, (cont1Items:size()-1) do
                    item = cont1Items:get(i);
                    table.insert(movedItems, item) 
                end
            end
    for i, k in ipairs(movedItems) do
        cont1:Remove(k) 
        cont2:AddItem(k)
    end
    local num = getPlayer():getPlayerNum()
    local pdata = getPlayerData(num)
    pdata.lootInventory:refreshBackpacks();
    pdata.playerInventory:refreshBackpacks();
end
        cont1:Remove(k) 
        cont2:AddItem(k)
drifting ore
#

I was thinking something like that, I just thought there was a vanill function in the game

#

Thx both of you

#

You don't even need to remove, AddItem is enough

drifting ore
#

Found it ISTimedActionQueue.add(ISInventoryTransferAction:new(playerObj, item, item:getContainer(), container)) just in case that interess someone in the futur

carmine flume
#

Man, I really wish there was a way to monkey patch Java functions from Lua.

urban geyser
#

Uhhh, I asked in the wrong place, but anyone good with making clothing mods able to take a comission?

peak raven
#

@urban geyser I could probably put something together for you, What did you have in mind? before I say Yes

urban geyser
#

I wanted to get a simple set of cargo pants done, they’d probably look nearly identically to base game military pants

#

That and have them able to be bloused/tucked in

peak raven
#

Like tucked into the shoes/boots? I can do that, do you want an untucked variation?

urban geyser
#

Yeah, honestly could probably just retexture the pants from sharks military uniforms, with his permission obv

peak raven
#

I think I already have something made close to what you want, give me a minute

drifting ore
#

boots gone wild XD

#

πŸ˜‚

#

tf is going on with it

peak raven
#

Its really more of a boots off look

#

Something like this but just cargo Jean Beige?

drifting ore
#

the right shoe is ok the left one ehhhh

peak raven
#

its probably got weights painted on it from another joint on the body

drifting ore
#

ahh

urban geyser
#

Maybe a dark grey or something, I just want more pants I can tuck into boots tbh

tranquil reef
#

what does specificPlayer:getWornItem() do? Does it grab the specific item name in the parentheses?

#

specificPlayer is also equal to self.character

drifting ore
drifting ore
tranquil reef
#

So, if I put a body location name in the parenthesis, and then do if (bodyLocItem = "InsertClothesName") I can check for a specific item rather than any item within that area?

drifting ore
tranquil reef
#

Alright, thank you

tranquil reef
#

Thank you for that as well lol, I just tried looking for a list