#mod_development

1 messages · Page 510 of 1

limpid vine
#

yeah it is

thin hornet
#

I think your code is applied before the connection is completed tho?

willow estuary
#

Yeah, it should be restricted to admins only, but I use debug to test my MP stuff and it works, when locally hosted at least?

thin hornet
thin hornet
#

Alright ill test and tell the result

pine vigil
#

I mean me writing shoddy code would be the least surprising thing. Maybe I accounted for that? Or maybe someone changed it after I left.

#

The block was built as more of stop gap measure at the time

willow estuary
#

Yeah, I do some really funky stuff in MP with global mod data and I couldn't imagine developing it w/o the access to veiwing GMD that debug mode provides?

thin hornet
#

Would be nice if isAdmin gave default access to debug tool

potent root
#

When I register for an even like this Events.OnPlayerDeath.Add(createToken);
The code is running on client side. how can I make the same subscription on server side?

drifting ore
#

@keen temple

analog umbra
nimble spoke
#

Known bug, the dev behind the foraging system told me it will be fixed eventually

drifting ore
thin hornet
# pine vigil It actually might.

using username admin with admin access didnt work, same error in debug mode.

LOG  : Network     , 1642098528777> Delay processing packet of type IsoRegionServerPacket while loading game
LOG  : General     , 1642098528789> ===================================

ERROR: General     , 1642098528790> java.lang.RuntimeException: Cannot override modID. ModID=pz-vanilla
ERROR: General     , 1642098528791>     at zombie.scripting.objects.Item.setModID(Item.java:3223)
ERROR: General     , 1642098528792>     at zombie.world.DictionaryDataClient.parseCurrentItemSet(DictionaryDataClient.java:37)
ERROR: General     , 1642098528792>     at zombie.world.WorldDictionary.init(WorldDictionary.java:213)
ERROR: General     , 1642098528793>     at zombie.iso.IsoWorld.init(IsoWorld.java:2296)
ERROR: General     , 1642098528793>     at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:260)
ERROR: General     , 1642098528797>     at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:217)
ERROR: General     , 1642098528797>     at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1642098528798> WorldDictionary: Warning: error occurred loading dictionary!
ERROR: General     , 1642098528800> ExceptionLogger.logException> Exception thrown zombie.world.WorldDictionaryException: WorldDictionary: Cannot load world due to WorldDictionary error. at WorldDictionary.init line:255.
ERROR: General     , 1642098528801> DebugLogStream.printException> Stack trace:
zombie.world.WorldDictionaryException: WorldDictionary: Cannot load world due to WorldDictionary error.
    at zombie.world.WorldDictionary.init(WorldDictionary.java:255)
    at zombie.iso.IsoWorld.init(IsoWorld.java:2296)
    at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:260)
    at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:217)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1642098528814> LuaEventManager: adding unknown event "OnPreUIDraw"
LOG  : General     , 1642098528815> LuaEventManager: adding unknown event "OnPostUIDraw"
limpid vine
thin hornet
#

i set my client debug mode through the .json file

#

ill try checing the server settings..

pine vigil
thin hornet
#

Dedicated server on linux ubuntu 20

pine vigil
thin hornet
#

Yeah

#

i even disabled my local version to use the "workshop" version

pine vigil
#

Then I'm not sure I'm afraid, sorry.

thin hornet
#

Yeah no worry ill keep reading that source code xD

#

The error actually come from

--- scripting/objects/Item.java
public void setModID(String var1) {
      if (GameClient.bClient) {
         if (this.modID == null) {
            this.modID = var1;
         } else if (!var1.equals(this.modID) && Core.bDebug) {
            WorldDictionary.DebugPrintItem(this);
            throw new RuntimeException("Cannot override modID. ModID=" + (var1 != null ? var1 : "null"));
         }
      }

   }
#

might have to validate files or reinstall maybe an scripts/items.txt has been edited by mistake nope

#

oh well ill have to live without debug mode 😆

stark flame
#

seems the mods are not appearing on my game even tough they are enabled on the main menu, I'm forced to start a new game?

winter bolt
stark flame
#

thank you

potent root
#

When I register for an even like this Events.OnPlayerDeath.Add(createToken);
The code is running on client side.
How can I make the same subscription on server side?

#

does anybody know?

thin hornet
potent root
#

how do I know what events trigger on what side?

thin hornet
#

you browse the source code

potent root
#

the Java?

thin hornet
#

yes you search your event in there and check if it run only one side or if both side are handled
you will see something like GameClient.bClient == true

potent root
#

😄

analog umbra
stark flame
#

are silencers part of vanila game? or just brita?

potent root
#

is the Java code indexed somewhere or do I need to look at my local and decompile the java classes

thin hornet
#

You will have to decompile it, source code is not publicly available

tacit ermine
#

you want OnCharacterDeath

thin hornet
potent root
#

yes or OnPlayerDeath

tacit ermine
#

no, OnPlayerDeath is local only

#

OnCharacterDeath fires on the server

thin hornet
#

only run on client as far as i found

#

nice

tacit ermine
#

click the super.OnDeath()

#

that's where the other one runs

potent root
#

that is very useful

#

thanks a lot guys

thin hornet
#

IsoGameCharacter.java

#

i guess it run client and server in this case

drifting ore
potent root
#

I am gessing Character means more than just the players

tacit ermine
#

also zombies and (eventually) npcs

thin hornet
#

every class that extends from it yes

potent root
#

that us very useful I ned to get the java decompiled

drifting ore
thin hornet
potent root
#

I could not find this info in the javadoc (known which side event fires)

tacit ermine
#

everyone uses fernflower

#

they're just invoking it in a different way

#

a shame storm is abandoned

drifting ore
thin hornet
#

@tacit ermine yeah but @weary matrix is back with some javamod

tacit ermine
#

I already wrote my own framework

thin hornet
#

nice

#

I should make myself a java mod to enable debug mode but thats never that easy.

tacit ermine
#

what do you mean enable debug mode? I just pass -debug on the command line

thin hornet
#

yeah i cant join my server with it, something wrong with items and world dict

lapis scroll
#

How trivial would it be to make certain tiles (i.e. garage doors) invincible to player (or all) damage? (i.e. don't let players break garage doors)

#

is there a function I can hook into when a tile is attacked?

#

(not via Destroy - already figured this out, just via general damage)

tacit ermine
#

can just patch out the mod ID check

thin hornet
#

mhm ill check this out thanks

potent root
#

Is there a method to update client or server data for a player?
I noticed yesterday that If I have a client side code that uses AddExp() for example to give the player exp the client sees that instantly but I was logged it as admin and I did not see the other player change till he relogged

tacit ermine
#

it's sent to the server every time you call AddXp

#

stats aren't usually networked to other players

#

the only time they are is for that admin panel

potent root
#

that is why the Admin player did not see the change

tacit ermine
#

and the admin panel requests the stats from the server for the player you select when you open it

potent root
#

seems it does not do it every time

tacit ermine
#

show your full AddXp call

#

one of the parameters is an option that prevents it being sent

potent root
#

if tostring(i) == "Sprinting" then
player:getXp():AddXP(perk, increaseXP/SandboxVars.XpMultiplier);
elseif tostring(i) == "Fitness" or tostring(i) == "Strength" then
player:getXp():AddXP(perk, increaseXP);
else
player:getXp():AddXPNoMultiplier(perk, increaseXP*4/SandboxVars.XpMultiplier);
end

tacit ermine
#

looks to me like it is always sent in those cases

#

what makes you think it isn't?

potent root
#

seems the server gets it but the admin player does not see it reflected

tacit ermine
#

yes, that's what I said

#

the admin panel has a special call to get stats for another player

potent root
#

is there a way to force it to resend it or refresh the admin player?

#

I see

#

well it is a minor issue

tacit ermine
#

yeah you can probably just call the same thing the admin panel does

#

but it only works for admins

hollow shadow
#

does the conditionmodifier mean that the item gets 20% more durability each time i repair it?

tacit ermine
#

and after applying the skill bonus

hollow shadow
#

also is there a way to assign a custom sound to the fixing?

#

and what determines how much is repaired? is it the Fixer?

#

and what does globalitem do except for being used in all Fixers below

lapis stump
#

is it possible to persist a value in my server script after restart ?

tacit ermine
hollow shadow
#

how does the game know which item is better

#

for repairing

tacit ermine
#

X axis is the number of times repaired, b is the difference in skill levels, c is ConditionModifier

hollow shadow
#

2 scrapmetals should repair less than 1 smallsheetmetal in my recipe

tacit ermine
#

it's order of appearance I think

#
      switch(arg2.getFixers().indexOf(arg3)) {
      case 0:
         var4 = 50.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
         break;
      case 1:
         var4 = 20.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
         break;
      default:
         var4 = 10.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
      }
#

first gets a multiplier of 50, second 20, third 10

hollow shadow
#

very good to know. thx

lapis scroll
river plinth
#

Can someone help me with JDGui? I cant decompile the gamefiles because I get this error: Unsupported class file major version 59

#

I run Fedora 35 with openjdk 17 installed and set as the used java version

#

I think it still uses my also installed openjdk 11, although I've set the 17 as my default version

timid plume
#

Hey modders! I made a backpack that should only be spawned by server admins

Then I just create the item!

But in our server we found a zombie with the backpack... Theres a way to prevent it?

hollow shadow
tacit ermine
#

use Fernflower in IntelliJ IDEA or recaf instead

willow estuary
river plinth
timid plume
brittle jewel
quasi geode
willow estuary
# timid plume

ClothingItme = Bag_BigHikingBag is your problem, see my reply above.

timid plume
#

I just want the same bag, but with a different skin

#

And I want to do it with a lot of itens

#

just another skin

#

but only for admins

#

then I will need to create the xml?

hollow shadow
#

well, if you want it to be visible then yes

timid plume
#

I already see some of theses xmls from others mods

#

but how I can generate thats ids?

#

have some tool?

#

any guide link or something like this?

hollow shadow
timid plume
#

ohh thankyou

willow estuary
willow estuary
#

🤙

timid plume
#

Yeah! I think just the part of the guide about the xml already solve all my problems!

next copper
#

how can i make an item spawn equipped to a zombie

willow estuary
fickle plover
#

Anybody using Filibuster Rhymes' Used Cars? Wanted to ask if there's any good sports car

formal stone
#

Damn I wish people weren’t such gate keepers in this community, completely toxic as hell. @drifting ore bless your heart, people have a lot to learn from you.

eternal bridge
#

Was just messing around with the attechement editor in debug mode, and found there's an attachement point for "knife_belt_back", which when parenting a knife to it, put's it to the back, as if there was a back belt slot. Hints at a future feature? A leftover from a mod? Watcha think?

tulip valve
#

Anyone else getting stuck on "loading scripts" when launching zomboid? Only thing that fixes this is reinstalling zomboid, and everytime I enable my custom modifed mods like GunFighter Custom, Brita's weapon pack Custom, it just gets stuck at "loading scripts" forever again

drifting ore
#

Dead link

drifting ore
winter bolt
drifting ore
winter bolt
#

oh idk

#

theyre the same i think

drifting ore
#

Some dif but rly similar

winter bolt
#

i think the github one is probably more updated

#

i'm not sure

marble folio
#

Default Occupations and Traits updated to work using the Profession Framework.
(I wasn't sure if the Github version was totally updated or missing something, so I did the list myself and checked each one using the Vanilla , the Wiki and the Lua files itself. I Think I didn't miss any. Even added some of the deactivated ones if anyone wants to mess with it)

brazen lantern
#

any good UI mod, like diff icons

quasi geode
ionic galleon
#

Btw this help alot on the server side

tough igloo
#

how would i add custom text so that i can use getText() on it?

nimble spoke
tough igloo
#

appreciations!

drifting ore
#

It's a bunch of info to help modding

weary matrix
lapis stump
#

why is player:getBodyDamage():getBodyParts() giving an err of '_len not defined' ? I can see that bodyParts in object stack has a bunch of values btw.

marble folio
quasi geode
#

ah cool thanks. i suspect it will work fine but havent just tested that part yet

ionic galleon
#

in java and noticed a pattern that some changes are easier done in lua that java

#

since editing class files is not fun with all the errors

#

since on server side steam doesn't do anything, ur changes are safe

#

as an example I added combat logs to a server I'm in

#

in a different file and several new admin commands

#

however when it comes to adding something like a reputation system it would be much nicer to use lua

#

and since your framework can add lua callback that means less changes have to be made on the java side

sour island
#

you're trying to get a size on it?

weary matrix
#

@ionic galleon ah yeah I see. So you've made javamods already?

sour island
#

quick recovery

ionic galleon
#

or rather kinda they are intended for to be used on the server side alone

weary matrix
#

@ionic galleon hmm so for example if you add a global function only on server side, you can still call it from client side or what?

ionic galleon
#

here is an example

#
[13-01-22 21:08:28.072][PVP] MikkiGBreezys attacked Goggarinn and did 0.5 damage.```
weary matrix
#

ah I see

ionic galleon
#

or another example is event boards

#

custom admin commands

#

only need to be added on the server side

weary matrix
#

yeah for custom commands it should work ok

#

haven't really tried it yet though

tacit ermine
#

I do the same to export metrics from the server to Grafana

#

lots of use-cases for server only mods

ionic galleon
#

since they don't use reflection at all

#

for whatever reason

weary matrix
#

@ionic galleon what do you mean manually?

indigo spire
#

Is there a mod to adjust reading time? I checked the usual sources and found nothing. I triple checked the sandbox settings and couldn't find anything there. The trait is laughable and not worth taking.

ionic galleon
#

and add your class to childrenClasses

spiral plover
#

Hmm, so with the new additions of the global ModData in 41.51, does that mean the old ways of things such as local gt = getGameTime(); local modData = gt:getModData(); is obsolete? Do I need to change everything over to using the ModData.get() etc functions?

weary matrix
#

@ionic galleon yeah but you can do it directly from a javamod using a Patch?

#

no need to recompile it yourself I mean

ionic galleon
tacit ermine
#

you can modify classes at runtime before they load

ionic galleon
#

commandBase doesn't check for sub types

weary matrix
#

@ionic galleon just implement getPatches() in your javamods and you won't need to recompile anyting 😛

ionic galleon
tacit ermine
#

function and field pointers?

ionic galleon
#

in dot net u can change methods in runtime

#

at anytime

ionic galleon
#

since it's just a pointer

tacit ermine
#

what

#

no you can't

ionic galleon
#

yes u can

#

however u can't add new fields

weary matrix
ionic galleon
#

however if you interrupt the loading of a dll you can even add fields and enums in runtime

ionic galleon
#

xD

tacit ermine
#

yeah, you can do the exact same thing on the JVM

ionic galleon
#

as I said java is not my thing.

#

hmmm

weary matrix
ionic galleon
#

well, that would make my threats feel empty I would have to find something else to threaten u for

#

smh

#

yeah of course

noble zinc
#

DROPKICK MOD

ionic galleon
#

also after a lot of tuning we managed to hit 128 player server

tacit ermine
#

nice

#

what sort of resource usage were you looking at?

lapis stump
drifting ore
lapis stump
#
local bodyParts = player:getBodyDamage():getBodyParts();
    for i=1,bodyParts:size() do
        local bodyPart = bodyParts:get(i-1)
        if not bodyPart:isBurnt() and player:isOutside() then 
            bodyPart:setBurnTime(10);
        end
    end
#

its pretty much the same thing but i get the len error

#

and in objectstack it shows theres body parts

drifting ore
#

Where do you can that ? Maybe before the player is create

willow estuary
#

You might be applying getBodyDamage() to the wrong "player"?
The code uses player for the player index and player object indiscriminately, so it can be confusing sometimes.

lapis stump
#

I get player with specficiplayer by online id

#

and the obj stack thing shows the right player because I can look at the name

drifting ore
#

Where can I see the IP of my server In game ?

drifting ore
sour island
#

😛

tacit ermine
#

what do you mean pretty much the same thing?

#

if you've wrote #bodyParts, that'd be wrong

sour island
#

So wait size() shouldn't be size()-1?

brittle jewel
#

It's gotta be your player being incorrect.

tempTestFunc = function(key)
    if key == 51 then
        local bodyParts = getSpecificPlayer(0):getBodyDamage():getBodyParts();
        for i=1,bodyParts:size() do
            local bodyPart = bodyParts:get(i-1)
            if not bodyPart:isBurnt() and getSpecificPlayer(0):isOutside() then 
                print("true")
            end
        end
    end
end
Events.OnKeyPressed.Add(tempTestFunc)
sour island
#

[0][1][2]
i=1-1 =0, i=2-1=1, i=3-1=2 - I guess not nvm

#

I got the booster shot yesterday, so the 5G is killing my brain rn

brittle jewel
#

Lmao Chuck. Giving you a ping @lapis stump so you don't bang your head for too long.

drifting ore
#

Has anyone already launched two games, create a server on one and join it on the other?

tacit ermine
#

you need to do it in non-steam mode iirc

drifting ore
sour island
#

I exclusively use i=0, size()-1, just for legibility reasons -- just got confused cause it seems like the code is otherwise fine

#

How are you getting the player tho? cause as others have mentioned that's rather important

lapis stump
#

i have sp and mp functions to get player

brittle jewel
drifting ore
#

Yes I done that

#

But I can't connect my second game to my host game

brittle jewel
#

Hmm, those are the only 2 changes I made. Well, that and making sure I launch the game with ProjectZomboid64.bat

#

Are you manually opening your ports? You will need to increment 1 for each player

drifting ore
brittle jewel
#

I don't think so, I have my firewall and everything on and it functions fine.

lapis stump
#

in debug mode is there a faster way to heal player from injuries ?

brittle jewel
#

Tick god mode on/off

lapis stump
#

i still die from burning/bleeding

brittle jewel
#

Odd, it always heals me.

lapis stump
#

invincible cheat or god mode something else ?

brittle jewel
#

It's under general debuggers:

drifting ore
#

or N

brittle jewel
#

Ahh, yeah it's also the key 'N'. I forget about that, much quicker.

lapis stump
#

yep god mode is working ty

drifting ore
#

@brittle jewel When I connect my second game I get Error: already authenticate. An idea ?

brittle jewel
#

Hmm...do you have the whitelist enabled on your local server? Maybe that's it?

drifting ore
#

Wait no, it didn't save when I did steam = 0

brittle jewel
#

Lol that'll do it!

drifting ore
#

both need to be steam = 0 ?

sour island
drifting ore
sour island
#

I think you literally type localhost or 127.0.0.1 into IP:

#

also host from the menu

drifting ore
#

I tried, the non steam game find the steam server but don't want to connect

sour island
#

oh you need to run both in non-steam

drifting ore
#

and the steam game don't find the non steam server

#

That what I trough

#

Thx

#

Bruh i'm so done with mod uploading to the workshop, current system sucks ass

#

The mod followers must be tired of redownloading small patches

sour island
#

they get wound up if their server's not updating but it's a tiny fraction

#

nothing to lose sleep over

drifting ore
#

Oh yeah, specially with how happy i am with the result ^^

#

Now i can finally do a full cryogenic winter run without issues drunk

drifting ore
#

Pass one? You mean get into the server with the debug client?

drifting ore
brittle jewel
#

When launching with the .bat?

drifting ore
#

Yes

brittle jewel
#

Ahh okay, just add -debug to the end of the line starting with ".\jre64\bin\java.exe"

drifting ore
#

Nice thx

brittle jewel
#

Client only, I don't think you need to/can make a server debug(?)

drifting ore
#

Ok good to know

#

Just make sure you have your user you'll log as with admin access level or the server may not let a -debug client load in

brittle jewel
#

You can always setaccesslevel username admin in the server console to allow them in with debug

drifting ore
#

Ok I will put me admin, I was wondering how

carmine pewter
#

Are there any mods for like... Multi-generator efficiency, or auto-generator-switching? Not being able to leave home for more than 24 hours before your Gen turns off is bunk

drifting ore
#

Can I add code to all isoGenerator ? And trigger it every hour

lapis stump
#

if I wanted to persist a table between server restarts how would I do it?

lapis stump
#

hmm interesting thx

#

is player:getUsername() the account name people register w/ on whitelist servers?

peak raven
#

Is there a way to get the current color of the a players hair and make the worn item that color?

rich wagon
#

I have noticed that if you edit (with debug mode) a revolver or handgun's stats to have minimum recoil time/recoil delay, the rate of fire is basically as fast as you can click.

Is there a way to achieve a similar result with the m16 ? Or is there a way to speed up the fire rate ?

zealous wing
#

I hear people keep saying that ItemTweaker is obsolete. Does Vanilla PZ support a way to nonitrusively change items now?

quasi geode
languid narwhal
#

Is there a staightforward way/guide to mod an existing game trait? I found resources on how to add new traits. I haven't found anything about modding a trait, especially a trait on an existing MP server and character. I just found this message, is that pointing in the right direction?:
#mod_development message

echo leaf
#

@willow estuary I'm sorry, am I an idiot or is this not working?

echo leaf
#

I think I took it one step too far on the MRE Chicken before trying to use the heater?

dim pawn
#

Is plastic pipe a vanilla item? Need it for silencer (which is a modded item)

ebon dagger
#

part of me wants to make a "cowboy" mod that adds dusters and period firearms but another part of me knows that that is foolish

drifting ore
#

I mean there used to be a really cool wild west map

#

So wild west themed items would be cool

boreal stag
#

Trying to call ModData.transmit("myModTableKey") from the server to send to the client, following the instruction:

void ModData.transmit(String key)
- this will attempt to transmit the table with given key, when called on server this is send to all clients, when called on client send to server. (see note on receiving moddata below)

This triggers the OnReceiveGlobalModData event on the client perfectly with the key, but it seems to be missing any modifications I made to the table.
Am I missing a step somewhere?

hollow shadow
#

i had similar issues reported to me and favorited tools was the cause

boreal stag
willow estuary
#

b41 Craft Helper is also half a year behind the changes to the vanilla crafting.
As recipes get more sophisticated and take advantage of the fancy new features that were added, and will continue to be added, to the system, I imagine that craft helper will continue to provide even more inaccurate and confusing misinformation to people that use it.

boreal stag
echo leaf
#

Only booted up craft helper after I was having issues cooking the MRE I'd opened.

viral spire
#

How feasible is a Zombie Starvation mod? Like, over time, zombies eventually just starve to death and die? I'm thinking in the sense of 28 Days Later, where the infected starve to death 4-5 weeks after the initial outbreak, allowing NATO to begin reconstruction efforts.

It would be interesting for those attempting a 28 Days Later style run, surviving long enough for the majority of infected to starve to death, but small pockets of infected will remain here and there to make enough a threat, alongside respawn times if set right. So the peak populations starve, but respawns still give you the threat of infected.

fiery hollow
#

I think it'll make the game too easy

#

You can just gather food, get a van and sit on the wilderness for 4 weeks near some lake

#

Although I barely survived for 1 week

#

Now that I think about it, zombie starvation mod would add a possibility of winning. Just make it no respawn as a new character and that would be pretty interesting.

opal wind
#

anybody knows what this entry is about?

#

item Glue
{
DisplayCategory = Material,
Weight = 0.1,
Type = Drainable,
UseDelta = 0.2, <----------------------------------------------- ????
UseWhileEquipped = FALSE,
DisplayName = Glue,
Icon = Glue,
Tooltip = Tooltip_FixItems,
SurvivalGear = TRUE,
WorldStaticModel = Glue,
}

fiery hollow
willow estuary
opal wind
#

from where did you get that '1' ?

#

or its like allways 1?

junior flame
opal wind
#

so if i want like a large glue i could just make a new item and set the UseDelta to 0.1 then i could use 10 times?

junior flame
#

more or less, yeah

opal wind
#

the weight have nothing to do with it?

fiery hollow
#

no

opal wind
#

but then how come the water bottle change the weight as we drink it?

junior flame
#

well yeah, item weight will decrease with each delta use

opal wind
#

hum

#

i will create a new item later and test it

drifting ore
junior flame
#

it's pretty straight forward. it - like everything else in PZ modding - has it's quirks. the decimals get a little silly sometimes; when setting a usedelta of 0.1, it doesn't use exactly 0.1 of the 1.0, never really figured that out

opal wind
#

on the glue case there would be 0.1 kg for 5 uses so 10 uses would be 0.2kg and delta = 0.1 makes sense i think i saw the glue weight 0.08 once when i used it playing

#

i will test that out and let u guys know later

#

thanks!

fiery hollow
#

that's what wiki says

opal wind
#

lmao

#

nvm dude i will test it myself 😉

#

i let u know later

junior flame
fiery hollow
drifting ore
#

yes

#

new wipe

fiery hollow
#

how many days

#

since wipe

drifting ore
#

idk like 15 maybe

#

we added a shit ton of mods

#

its pretty cool except the fact we have to restart the server for each mod update

#

:((

fiery hollow
#

:MEGADANK:

opal wind
#

NotARealName was right i just test the regular glue in-game and it wont reduce weights with uses

#

the only difference i found betheen water botle and glue is this

#

CanStoreWater = TRUE,

#

i guess only water and gasoline do that

fiery hollow
#

it's probably coded in the engine

opal wind
#

i guess

fiery hollow
#

wtf

#

why

opal wind
#

its not a big problem for me anyway i still can make my large glue lol

#

i just give it more weight i guess

#

PZ give us just this school glue 😄

fathom mauve
#

Finally finished modifying 217 music files in zomboids music bank to create the only working music replacement mod on the workshop for build 41

drifting ore
junior flame
#

hmm, all of my drainable items decrease in weight as they are consumed...not sure why your results are saying otherwise

fiery hollow
fiery hollow
#

and not neccecary to add

junior flame
#

weight is always updated upon use of an item, referenced from zombie/inventory/types/DrainableComboItem.java ... you can have some control over it; you can use WeightEmpty = n when defining your item to have it scale from it's starting weight to that weight instead, when used. so yeah, the change on woodglue with it weighing 0.1 would be negligible

fiery hollow
#

it says DrainableComboItem

#

so do you have make like full glue bottle and empty glue bottle

#

for it work

rigid dock
#

Anybody make a mod that makes zeds just as affected by fog and snow as you are..? This is ridiculous.

junior flame
fiery hollow
#

oh

golden blade
#

If i add a vehicle mod to an already established server will the vehicles spawn in undiscovered areas?

drifting ore
#

Can I add code to all isoGenerator ? And trigger it every hour

fiery hollow
#

I think world generates when you create it

hollow shadow
# drifting ore

you need to add a few more mods, at 150 mods it shows like it has no mods at all xD

spark plank
#

took me long enough, but it was staring me in the face "player.say" is the client side of life, where it doesn't even interact with chat and thus never gets passed on the server. Why did I have to try it even after being warned? because I'm stubborn ^^'

Still have to wait for my mate to connect the server (cos my machine cant handle 2 pz open) but solo testing did gave me the "chat interaction".

My only doubt is: does it trigger the sound? (not shout, just "speak" sound - as that would be neat)

rich wagon
#

does anyone know why, when I edit the "RecoilDelay" of a revolver to be 0, on MP I can shoot a fast as I can click but on single player (with debug mode) it is much slower ?

spark plank
#

the same goes for client mods when you host

rich wagon
spark plank
#

oh, then I'm at loss :)

rich wagon
#

just clicking on "edit item" with the vanilla revolver

#

do you know if there is a way to increase the rate of fire of firearms ? or is there a fix value ?

spark plank
#

I remember having seen a file with revolver on its name, and a couple of others with "reload" on it -- you might find clues there

rich wagon
#

thank you

analog umbra
#

anyone know any good modding tutorials? It doesnt have to be this game I'm just trying to get a good starting point. I'm not all that new to coding in general, just the game side of it

rich wagon
rich wagon
tough igloo
#

is there any easy way to make my own moodles?

analog umbra
tough igloo
#

and from there

#

if u click on any class

#

it takes u to a gigantic list of all classes in the game

#

so i just use that

#

that and i dont think there are a lot of tutorials

analog umbra
#

yeah i kept seeing that PZ documentation is pretty spread out haha. I'll check the events! Thank you!

#

thats why i dont really mind if someone sends me other game tutorials.

rich wagon
analog umbra
fiery hollow
#

How can you make your challanges

gilded hawk
#

Is there a way to call a function after the player has eaten food?
I'm making a trait that makes you not lose happiness when you eat bad food, I'm planning on using profession framework to implement the traits

hidden estuary
#

anyone knows where can I see the red errors that pop up when stuff breaks? is it actually logging it somewhere?

mint sphinx
#

cant remember which file it place them in but if you run zomboid in debug mode it should auto press f11 to see the errors

hidden estuary
#

oh oki

#

ty

mint sphinx
#

just remember you cant join a server with out admin account if you open the game in debug mode

mint sphinx
#

@thin hornet going to be a damn long messenger you going to type

thin hornet
#

@iron salmon Is it possible to remove the debug check that throw and stop the game from running in future patch please.

In: zombie\scripting\objects\Item
Line: 2661 to 2664

    public void setModID(String var1) {
        if (GameClient.bClient) {
            if (this.modID == null) {
                this.modID = var1;
            } else if (!var1.equals(this.modID) && Core.bDebug) {
                WorldDictionary.DebugPrintItem(this);
                throw new RuntimeException("Cannot override modID. ModID=" + (var1 != null ? var1 : "null"));
            }
        }
    }
This check only throw in debug mode on a MP client.
It is useless as it is now, cause it doesn't give info about what exact item is faulty.
Without debug mode you can join the server and the items are working.
With debug mode it just throw for but doesn't help in anyway to fix the "problem".

Error that it throw look like:

java.lang.RuntimeException: Cannot override modID. ModID=MyModWhatEver

When it should:
A) Tell what item is fautly
or
B) Do nothing just like without debug mode on

Thanks TIS if you can fix this.

tacit ermine
#

would it not be better to post a bug report on the forum rather than pinging a single dev on discord

#

that message is gonna be like 20 pages up within the hour

thin hornet
#

This is why i pinged Nasko directly, so he can relay it to the dev team.

#

At least that what i was told to do at some point in the past.

#

But yeah might as well just try it on the forum im just not very active there.

tacit ermine
#

oh fair enough

thin hornet
#

I dont think i have an account

#

lol

tacit ermine
#

this channel moves quite fast, I jsut assume things would get missed

#

you can post without an account on the TIS forum, I think

thin hornet
#

forums are like 1993

#

Discord is the future 😛

mint sphinx
#

yea even the bug forum is more or less useless xD

mint sphinx
tacit ermine
#

sure

#

I'd personally have pings disabled

#

a lot of people do too

thin hornet
#

So guys, im trying to override some Base items in a scripts.
But t with debug mode game wont let me join, without it i can join and the overriding works.

mint sphinx
#

almost no one ping me ^^but i only have eneable direct ping

thin hornet
#

im trying

module Base {
  imports {
    Base,
  }

Wouldnt't that be the proper way of doing it?

mint sphinx
thin hornet
#

Yeah join in debug mode is ok

#

Im allowed

#

The thing is that check i filled in the message to nasko

#

It throw an error just because debug is on

gilded hawk
#

I'm so damn confused where is the code that handles the food unhappines O.o.
media\lua\client\TimedActions\ISEatFoodAction.lua has no reference to UnhappyChange

mint sphinx
#

i think it based on the item and not the action it self ?

gilded hawk
#

Like, inside the action of using the item?

tacit ermine
#
   public float getUnhappyChange() {
      float var1 = this.unhappyChange;
      if (this.isFrozen() && !"Icecream".equals(this.getType())) {
         var1 += 30.0F;
      }

      if (this.Burnt) {
         var1 += 20.0F;
      }

      if (this.Age >= (float)this.OffAge && this.Age < (float)this.OffAgeMax) {
         var1 += 10.0F;
      }

      if (this.Age >= (float)this.OffAgeMax) {
         var1 += 20.0F;
      }

      if (this.isBadCold() && this.IsCookable && this.isCooked() && this.Heat < 1.3F) {
         var1 += 2.0F;
      }

      if (this.isGoodHot() && this.IsCookable && this.isCooked() && this.Heat > 1.3F) {
         var1 -= 2.0F;
      }

      return var1;
   }
gilded hawk
#

pain

#

So, how can I change it on the fly? I can't?

thin hornet
#

item:setUnhappyChange(0)

gilded hawk
#

Well, it's gonna be dirty but should workd

thin hornet
#
// InventoryItem
public void setUnhappyChange(float var1) {
        this.unhappyChange = var1;
}
tacit ermine
#

that won't work

#

that's just the base value used in the calculation of getUnhappyChange

#

you'd need to set it to something that zeroes out after those additions/subtractions

gilded hawk
#

Maybe this? with ofcouse the check for the trait

local function NukeUnhappyfood()
  local player = getPlayer()
  local p_h = player:getStats():getHunger()
  --print("AUTO EAT (onevery10minutes)","hunger:",p_h)
  --if p_h > 0.15 then

    local playerInv = player:getInventory():getItems()
    local mmfood
    --print("HUNGRY")
    for i=0, playerInv:size()-1 do
      local item = playerInv:get(i)
      if item:IsFood() then
        item:setUnhappyChange(0)
      end
    end

  --end
end

Events.OnPlayerUpdate.Add(NukeUnhappyfood)
#

because In my head I was hoping for An even to listen to, or a function hook (like in pd2 modding)

tacit ermine
#

this is gross but this'll do it:

local unhappiness = item:getUnhappyChange()
item:setUnhappyChange(-unhappiness)
thin hornet
#

yep that

gilded hawk
#

Okay I understand

#

Now question is, how do I make this run on the item before eating? I would need to hook to the function of eating

#

Like a prehook Thinkedit, at least that's how I would do it when modding a game like pd2

thin hornet
#
local ISEatFoodAction_perform = ISEatFoodAction.perform;
function ISEatFoodAction:perform()
    if i have the trait yo then
      local unhappiness = self.item:getUnhappyChange()
      self.item:setUnhappyChange(-unhappiness)
    end
    ISEatFoodAction_perform(self);
end
gilded hawk
#

Oh, just like pd2

#

Thanks man

tacit ermine
#

pd2? payday?

gilded hawk
#

yeah

thin hornet
#

you might want to run some check to

#

unless you want this on all food eaten

mint sphinx
#

like unit testing ? ^^

gilded hawk
tacit ermine
#

a simple self.item:isRotten() works if you only want it on rotten

#

oh ok

thin hornet
#

then a check for the trait will do

mint sphinx
gilded hawk
tacit ermine
#

lmfao

#

that's great

gilded hawk
#

Thank you

#

We are trying to roleplay as ourselves in our server lol

#

And I make the mods needed to do it

thin hornet
#

so you eat rotten food irl?

lapis stump
#

is it possible to toggle shader on/off in LUA?

mint sphinx
#

@thin hornet have you tried to make 3D model change 3D model over time ? and if so is it easy or hard? ^^

tacit ermine
#

no

#

you can turn off all world shading with a debug option

#

that's it

gilded hawk
tacit ermine
#

what shader are you trying to toggle?

lapis stump
#

custom shader for water droplet effect

thin hornet
tacit ermine
#

you just want to see how it looks without the shader?

mint sphinx
#

more like 3D model onGround.

lapis stump
#

no i want to toggle it on/off only if its raining and im wearing mask/hazmat suit

thin hornet
#

Not sure you can do that cause changing the model would probably change it for all items

tacit ermine
#

oh

#

look at how rainbarrels work

#

those change sprite as they fill

#

could presumably do the same thing with a model I guess

thin hornet
#

rainbarrel are isoboject/tile tho

mint sphinx
tacit ermine
#

I know

#

an IsoWorldInventoryObject

gilded hawk
thin hornet
#

hope fully you changed the part if i have the trait yo then

#

lol

gilded hawk
#

lmao yes

thin hornet
#

okok

#

xD

gilded hawk
#

I think something else is conflicint

#

im turnig off all the mods

thin hornet
#

can you show error tho ?

gilded hawk
#

Sure

noble zinc
#

DROPKICK MOD PLEASE

gilded hawk
thin hornet
#

easier if you copy paste from C:\Users\YOURUSERNAME\Zomboid\console.txt
my eyes cant read the screenshot atm

gilded hawk
#

Oh okay

#

Ah looks like a missing texture problem]

gilded hawk
mint sphinx
#

@thin hornet btw konijima why dont you use a real barrel valume for the fuel barrel in the fuel API ?

#

or make it like sandbox variable

gilded hawk
#

I can still read logs, yey tada_vuetify

thin hornet
#

But yeah i could make it a sandbox variable thats a good idea.

#

also i could make an option to allow picking it up with liquid in it
ill check this out thanks

mint sphinx
#

i know it dont have the fuel propety by default because was thinking to make another kind of mod and use the same vanilla barrels ^^ which might make conflics for the mods but nothing other then that

thin hornet
#

FuelAPI only check if the custom name is Barrel so technically all isoobject with custom name Barrel will act as fuel container

#

The new barrel from the military outpost in LV is not a barrel its a metal drum so im happy about it cause that would have been a problem

mint sphinx
#

i know already had a look into the cooding to see how you solve the problem ^^ only because i didnt knew how to grab a isoobject

thin hornet
#

Ah cool glad it helped

thin hornet
gilded hawk
#

Now I need to sort out why the code is doing notthing 👀

#

but my lunch break is nearly over

thin hornet
#

Does ItemTweaker allow tweaking base recipes?
If not anyway of tweaking recipes?
I mean, im trying to override them right now, but MP debug mode kill my game Grrrr

ebon elk
#

is it possible like to make a mod that change the inventory hud of pz

mint sphinx
#

I think all GUI and hud is Lua script if so yes it is?

ebon elk
#

Great

mossy spade
#

Would it be possible to mod they zombies so the look different? Maybe so the zombies look like something from a H.P. Lovecraft novel

spark plank
turbid quarry
#

does anyone know where the vehicle damage values are i.e. how much hitting a zombie damages your vehicle
i'd also like to change how much failing to install a part damages it

#

i at least know its in the java code

noble zinc
#

PUNCHING MOD

stray siren
#

probably is possible to change the zombie models

#

definitely the zombie skins

#

adding more I have no idea but it's probably do-able

mossy spade
#

Yea, wasnt thinking to add any, just maybe reskining. Just throw the idea out there. I'm no modder, was just curious if it was possible

low yarrow
#

Does someone know what exactly the "Survivalist" ZoneDefinition is?
I imagine it could mean this "tent camps" in the nature

undone crag
drifting ore
#

If I do something like that:

local function everyTenMinutes()
    local player = getPlayer()
    local modData = player:getModData()
    -- Code
    player:transmitModData()
end

Events.EveryTenMinutes.Add(everyTenMinutes);
#

Is it going to be call for every player in a server ?

stray siren
#

yeah there we go

#

roblox looking motherfuckers

winter bolt
#

yeah but that would replace it for all the zombies

stray siren
#

yeah but there are different zombies

#

each Zombie skin tone could be different

#

and male/female

#

We could probably also add more if we figured out how the game allotted these textures and added more to that table

#

and have a mod that adds more

#

idk if that's too close to the bone though

winter bolt
#

theyre based on skintone though

#

so if a player turned into a zombie theyd have one of them based on their skin colour

stray siren
#

yep

#

If you wanted the zombies not to make people that way you'd probably have to add more skins that only are assigned to zombie gen

hidden estuary
#

is there a better way to kill the player that isn't thirst 500

tacit ermine
hidden estuary
#

wasnt sure if Health was a parameter

#

if it is, then gud

radiant palm
#

One message removed from a suspended account.

jovial veldt
#

Anybody up to making a more interactive discord bot with the game? Just to receive certain info such as how many players in the server, weather conditions, what mods are installed. Just an example of a couple

indigo spire
#

I tried adding MinutesPerPage= to my Sandbox Preset and it didn't work.
Does this only work in the Server.ini?

drifting ore
#

Is there a reason why player:getModData() would return an empty list? player is an isoPlayer

#

I don't get a nil but an empty list, what i find weird because I use onCreatPlayer to init some variable in modData

tacit ermine
#

show the full code and the context it runs in

rich wagon
#

does anyone know what variable/flag/whatever allows shotguns to shoot at multiple things at the same time ? I'm pulling my hair out rn

rich wagon
willow estuary
rich wagon
willow estuary
# rich wagon yeah, put that one too !

Oh shoot, well the approach I would try would be to take the vanilla shotgun item script, copy it and change the name/display name to what you're trying to make.
Then, testing as you go, change this new script into the script for the weapon you want to make?

#

Shotguns work for this, so if you take the shotgun script, and modify it into what you want, then it should have that property?

rich wagon
willow estuary
rich wagon
#

what's the metal value ?

willow estuary
#

Oh, that was used in the disabled former blacksmithing system that was before my time?

rich wagon
willow estuary
#

Yeah, that's what I would guess? Just a shot in the dark given that it references the multiple thing?

rich wagon
#

i suppose

willow estuary
#

Taking a vanilla item, and "swapping" out the values to the item that you want to make is a pretty solid method though; it's my go-to.

rich wagon
#

doing it rn, if this doesn't work i'll sleep for 48 hours straight

willow estuary
#

That sometimes can help as well 😄

rich wagon
#

quick question while we're at it

#

i made a rifle but can't attach anything to it, do I have to make .x files of the rifle with all attachments ?

willow estuary
#

Nah, weapon attachments can be completely separate models, and that how it's generally done?
I don't know of any specific guide to the subject, but something on this might help: https://www.youtube.com/playlist?list=PLwV27NP3RkJl27tveCa9EMMvAdjmGXZsf

I'm familiar with using it, the weapon attachment stuff code wise, but I've never made anything for it model-wise so I don't know the nuts and bolts of that end?
You can also use .fbx files instead of .x files FYI, it can be easier, although they need to be reduced in scale vs the x file format version, seems to be a fair bit too at .01/1% IME?

drifting ore
# tacit ermine show the full code and the context it runs in

Ok, so I want to add an option in the health panel when you right click.
For the moment it works fine in solo or in MP on oneself but in multiplayer on another person, the modData is empty.
The handler of my timed action

function HCutArm:new(panel, bodyPart)
    local o = BaseHandler.new(self, panel, bodyPart)
    o.items.ITEMS = {}
    o.bodyPart_TOC = find_bodyPart_TOC(panel.character:getModData(), bodyPart)
    return o
end

It's at panel.character:getModData() that I get en empty table
I also tried panel:getPatient:getModData() but same
The panel is here media\lua\client\XpSystem\ISUI\ISHealthPanel.lua

tacit ermine
#

I'm not sure if other players mod data is ever sent to you, will have to look

indigo spire
#

I tried adding MinutesPerPage= to my Sandbox Preset and it didn't work.
Does this only work in the Server.ini?

drifting ore
rich wagon
tacit ermine
#

afaict it's only networked for objects

drifting ore
#

Damn, well, there's work to do but I know what to do at least

#

Thx

tacit ermine
#

hm actually

#

yeah only works for objects

drifting ore
#

Is there an event like onPlayerConnect to get the isoplayer of a player that connect to a server ?

weary matrix
#

there's a global function to get the list of connected players IIRC

zenith smelt
#

First make it functional then do it in an event.
Start by having a loop on the server that checks all clients

#

Or just all players

#

Or even use OnPlayerUpdate

spark plank
#

btw -- any way of having code completion for lua on vs code ?

drifting ore
#

Ok I will need to check every x time I guess, that stupid. I just want to init some variable when somebody connect

tacit ermine
#

OnConnected is a client event

spark plank
tacit ermine
#

no, I just looked for where the java code triggers it

drifting ore
#

I should be able to use it. I request the global data, add my data and return it

#

Every thing on client

tacit ermine
#

do you only care about running it on the client?

weary matrix
#

@tacit ermine when the event is triggered from GameClient or GameServer it's easy but otherwise do you have a good way to find out that could get automated?

tacit ermine
#

I've been working on a IntelliJ script that walks the call tree and looks for an if (GameServer.bServer) but it's pretty tricky

river plinth
tacit ermine
#

right now I still just read the code manually

weary matrix
#

yeah ok

drifting ore
weary matrix
#

guess I should just take some time to hardcode this info in my wiki scripts

#

@drifting ore my rule of thumb is unless you know you need it on server side, it should be client side 😛

tacit ermine
#

best I have right now is a script that automates the parameter types of events

drifting ore
tacit ermine
#

as for vscode, no

drifting ore
#

Btw I gonna make a tuto to add an timed action to the health panel when I gonna finish understand, it might help some

spark plank
#

i don't really care for the vscode, as long as I can have code completion for pz functions :P

#

[also, intellij rules.]

#

other thing, surely there's a getKey(keycode) that returns the ascii of that code, right ?

tacit ermine
#

Keyboard.getKeyName(keycode)

spark plank
#

man. I need to read some manual ^^'

tacit ermine
#

well, if you meant text

#

not every keyboard event is representable as ascii

spark plank
tacit ermine
#

if you want the ASCII value you can convert it to a char first

#

oh ok

spark plank
#

and I'd wager there's no way of adding a custom key for a thing, right ? that'd be too good ^^'

wraith kite
#

hey uh sorry to bother you guys

tacit ermine
#

nope

wraith kite
#

how do we turn on mods on a server ?

tacit ermine
#

custom key?

spark plank
tacit ermine
#

uhhh

spark plank
#

keybind! thats the name

tacit ermine
#

all that event is telling you which key is pressed

#

it's not a keybind system

spark plank
#

yeah, it's what I was thinking :)

#

oh well, it's not like the end of the world ^^

tacit ermine
#

maybe you can hook into that though

#

the game options menu is in lua

#

and that does remapping

spark plank
#

(I just thought of that. I'll have to read more on the subject; I'm a complete noob at lua and pz)

tacit ermine
#

actually you should use Input.getKeyName

#

Keyboard.getKeyName doesn't handle shift modifiers the way you'd expect

spark plank
tacit ermine
#

the options code just stores the keycode in GameOptions

drifting ore
#

Anyone know how to create a Vector2 instance? Im having trouble with that

tacit ermine
#

what is it you're trying to do?

#

Vector2.new(x, y) should work I think

drifting ore
#

Ah

quasi geode
drifting ore
#

Haven't tried that, i was trying to create one with Vector2()

quasi geode
#

but ya, as sfix said Vector2.new(x, y) will work once that junk file is dealt with

tacit ermine
#

oh weird, didn't spot that file

#

does kahlua let you specify a fqcn? maybe zombie.iso.Vector2.new(...) works without getting rid of that file

quasi geode
#

not sure i've ever tried? as far as i recall though the Vector2 class isnt used in the lua at all beyond that junk file (least wasnt last time i looked)

tacit ermine
#

yeah I don't see anything besides some uses of a different Vector2f class in the vehicle debugger

quasi geode
#

ya

drowsy cobalt
#

I have a client lua file that will load for one server but not the other. I'm only loading the file on the client. The 2nd server is looking for the file to be on the server also. Anyone have this issue or know how to resolve this?

Both servers are mine. Would settings do this?

opal wind
wet dune
#

Is it possible to make a zombies vision so low that they can't see you?

dark solar
#

dpont click that

#

lol

drifting ore
mellow panther
#

Hey guys, quick questions. Is there any way to affect zombies in dark areas to be sprinters? More of an ~I am Legend vibe~

keen temple
#

There's already a mod for that I believe it's called night sprinters.

mellow panther
#

Well It would work in a different manner, mostly related to zombies inside warehouses or houses without any light source to be effectively sprinters

#

Even at Day time and such

opal wind
#

guys what is your opinion on this; on my mod there is a bunch of cosplay outfits, should i make them all so they cant be ripped? some will be expensive and players wont want to acidentally rip the ones the are not wearing, should i take it off?

mint sphinx
#

you could always just make it repairable ? if it is? isnt it level 7 tailoring there make perfect repair ?

opal wind
#

no thats is another thing, they are repairable like regular clothing, but ripping is another set

mint sphinx
#

ohh i see 🙂

opal wind
#

yeah basicly if you remove this:

#

FabricType = Cotton,

#

you wont be able to rip it for straps

#

i guess i will remove it from all my outfits prb

#

hey i made this new Glue here, its working the model and such, but its not fixing my spear like the regular glue, i prb need to set another thing than just the item itself

#

i copy from the glue item:

#

item Wiz_LargeGlue
{
DisplayCategory = Material,
Weight = 0.4,
Type = Drainable,
UseDelta = 0.05,
UseWhileEquipped = FALSE,
DisplayName = Glue Bottle,
Icon = Wiz_LargeGlue,
Tooltip = Tooltip_FixItems, <-------------i tought this alone would able it as a glue, but i think i need more coding here
SurvivalGear = TRUE,
WorldStaticModel = Wiz_LargeGlue_ground,
}

#

when i click the spear the option to fix with my glue wont appear

mint sphinx
#

cotton 😮 look like you need a havest for that xD lol

mint sphinx
hollow shadow
#

how do i make it so a tool loses condition after being used in a recipe?

opal wind
mint sphinx
#

something with unit

opal wind
#

ah yes thanks man

mint sphinx
hollow shadow
# opal wind item Wiz_LargeGlue { DisplayCategory = Material, Weight =...

fixing Fix Door Welding
{
Require : FrontCarDoor1;FrontCarDoor2;FrontCarDoor3;RearCarDoor1;RearCarDoor2;RearCarDoor3;RearCarDoorDouble1;RearCarDoorDouble2;RearCarDoorDouble3,
GlobalItem : BlowTorch=5,
ConditionModifier : 1.2,

   Fixer : SheetMetal; MetalWelding=3;Mechanics=2,
   Fixer : SmallSheetMetal=2; MetalWelding=3;Mechanics=2,
}
#

I dont think you can make specific items for "fixing"

#

you would have to add them to the existing scripts for fixing items

#

the Tooltip is the description of an item.

opal wind
#

yes i need to add my item like this:

#

fixing Fix Axe
{
Require : Axe,

   Fixer : Woodglue=2; Woodwork=2,
   Fixer : DuctTape=2,
   Fixer : Glue=2,
   Fixer : Scotchtape=4,
   Fixer : Wiz_LargeGlue=2,
}
#

for each thing the glue fixes

hollow shadow
#

yes

#

ubt keep in mind

#

the higher up the fixer is the more durability it will repair

opal wind
#

i wonder if i need to repeat the others or just like set something like this

hollow shadow
#

so right now becouse its at bottom, your glue will fix only 1%

opal wind
#

fixing Fix Axe
{
Require : Axe,

   Fixer : Wiz_LargeGlue=2,
}
hollow shadow
#

this would also make duct tape worse tho

hollow shadow
# opal wind what?
      switch(arg2.getFixers().indexOf(arg3)) {
      case 0:
         var4 = 50.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
         break;
      case 1:
         var4 = 20.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
         break;
      default:
         var4 = 10.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
      }```
hollow shadow
opal wind
#

hum i dont have to change that too do i? where is that file from

opal wind
mint sphinx
hollow shadow
#

hammers

#

saws

#

screwdriver

opal wind
# opal wind what?

i dont understand the order of the fixers say how much they fix? so what is that number 2 and 4 there?

hollow shadow
mint sphinx
#

hmm cant remember damn im sry djvirus

opal wind
#

hum if i set like this, my large glue will fix just like the glue?

#

fixing Fix Axe
{
Require : Axe,

   Fixer : Woodglue=2; Woodwork=2,
   Fixer : DuctTape=2,
   Fixer : Glue=2;Wiz_LargeGlue=2,
   Fixer : Scotchtape=4,
 
}
hollow shadow
#

then you would still need vanilla glue

#

try / instead of ;

#

but idk if it work

opal wind
#

its the same glue just a larger bottle

#

ahhhh

hollow shadow
#

Fixer : Glue=2/Wiz_LargeGlue=2,

#

but idk if it work

#

u need to test

opal wind
#

lol i never seen that on the code

hollow shadow
#

its often used in recipes

opal wind
#

this is so confusing.. i dont even know what those numbers mean now

#

with ducttape is 2 and scotch is 4?

hollow shadow
#

1 duct trape has 4 uses

#

you need a full roll of adhesive tape to fix 5%

opal wind
hollow shadow
#

or you can fix 50% with half a roll of duct tape

opal wind
#

lol i dont know why but this Glue=2/Wiz_LargeGlue=2,made all my custom models disapear

mint sphinx
#

what you trying to do ?

opal wind
#

i set the way you told me

#

fixing Fix Axe
{
Require : Axe,

   Fixer : Woodglue=2; Woodwork=2,
   Fixer : DuctTape=2,
   Fixer : Glue=2/Wiz_LargeGlue=2,
   Fixer : Scotchtape=4,
 
}
#

it make most of my icons and models disapear lol

mint sphinx
#

but what you trying with Glue=2/Wiz_largeGlue=2?

#

what you trying on that line?

opal wind
#

make my glue work like the regular glue

#

since djvirus told me if i stick them on the order i will mess around with the below items fixing power

mint sphinx
#

ohh you want your glue work like normal woodglue ?

opal wind
#

normal glue

#

yes

mint sphinx
#

no normal glue my mistake ^^

#

hmm i would just make an extra line then for now

opal wind
#

this will mess around vanilla mechanixs

#

i think the way they code this is horrible tbh

mint sphinx
#
fixing Fix Axe
    {
       Require : Axe,

       Fixer : Woodglue=2; Woodwork=2,
       Fixer : DuctTape=2,
       Fixer : Glue=2,
       Fixer : Wiz_LargeGlue=2,
       Fixer : Scotchtape=4,

    }``` just do that for now
opal wind
#

that will make scotchtape fix only 1% acording to Djvirus

#

i dont want my mod to change anything on vanilla coding

#

also my glue would be worst than the regular glue

#

tbh this makes absolutly no sense to me

#

why they code it like that...

mint sphinx
#

of the % fixing ?

opal wind
#

off course...this should have a script to give each item fixing power stats separate

#

now make the order determine that is pretty lame imo

mint sphinx
#

still something is from javacode hmm cant remember where the % fix is place if it lua or java code

opal wind
#

strane why they game dont accept a 'and' entry there

hollow shadow
#
      switch(arg2.getFixers().indexOf(arg3)) {
      case 0:
         var4 = 50.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
         break;
      case 1:
         var4 = 20.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
         break;
      default:
         var4 = 10.0D * (1.0D / (double)arg0.getHaveBeenRepaired());
      }```
#

first gets a multiplier of 50, second 20, third 10

#

@mint sphinx

opal wind
#

if they have a 'AND' that is ';' there should be a 'OR' too, and its not '/' aparently

mint sphinx
#

so that the java code ^^

opal wind
#

very frustating this 😦

hollow shadow
#

maybe it doesnt overwrite it, but add it

opal wind
#

i doubt it but i will try

#

like this right

#

fixing Fix Axe
{
Require : Axe,

   Fixer : Wiz_LargeGlue=2,  
 
}
mint sphinx
#

if it not working just change the name abit like fixing fix axe2

#

if it make a conflict

opal wind
#

what lol

#

kk testing now

hollow shadow
#

it checks for the itemname

#

there is no "axe2"

#

thats why you dont need to write translations for fixer

mint sphinx
#

the item name is the Require : axe

hollow shadow
#

true

#

but i think you would need to write a new translation for that

mint sphinx
#

and yea i know translation is a bit annoring sometimes 🙂 but easier then doing them in barothauma

#

you might year sadly

#

what im setting doing right now for my framework try to make all the translation correctly ^^

opal wind
#

but if you change the name of the recipe it wont mess around the links tiba?

mint sphinx
#

like virus say you might need to do a translate files

#

so the translatation link would be missing

opal wind
#

ok guys so this works, but it does override lol

#

fixing Fix Spear
{
Require : SpearCrafted,

   Fixer : Wiz_LargeGlue=2,
   
}
#

i will try to give it a new name like tiba said

mint sphinx
#

dont do mine if that one work

opal wind
#

i also know why my outfit disapear; when you create new recipes you mess around the orders i guess

mint sphinx
#

but look if you get dubble recipe in the recipe book for fixing the spear

opal wind
#

it does not work man, it Overrides vanilla recipes, so my glue works and the vanilla one dont now

#

yea this way it works

#

fixing Fix Spear2 <----- new recipe name
{
Require : SpearCrafted,

   Fixer : Wiz_LargeGlue=2,     <--- new item
   
}
#

where i see the 'fixing spear recipe on the book again?

#

now just need to set that scale lol my glue is not THAT big

#

thank you both for the help!

mint sphinx
#

look like a small bottle of glue you have on that picture xD

opal wind
#

lol

opal wind
mint sphinx
#

i think your glue will just be do as normal so you glue will count as a repair

opal wind
#

i just test it does not look like regular glue lost power

#

yeah i guess this will work 🙂

#

i just delete the items that dont use glue and replace the name of all the recipes, putting a 'wiz' prefix

#

fixing Wiz Fix Spear
{
Require : SpearCrafted,

   Fixer : Wiz_LargeGlue=2,
   
}
#

regular glue have 5 uses mine should give 20

#

but i notice that 2 means it uses 2

#

so to fix a spear it will have 10 uses i guess

#

like the regular glue have like 2-3 uses

mint sphinx
#
item Glue
    {
        DisplayCategory = Material,
        Weight    =    0.1,
        Type    =    Drainable,
        UseDelta    =    0.2,          <------ lower amount more usages the item has 
        UseWhileEquipped    =    FALSE,
        DisplayName    =    Glue,
        Icon    =    Glue,
        Tooltip = Tooltip_FixItems,
        SurvivalGear = TRUE,
        WorldStaticModel = Glue,
    }

opal wind
#

yeah i know i set delta to 0.05

mint sphinx
#

okay ^^ 🙂

opal wind
#

thanks 🙂

mint sphinx
#

i fill some of the code or item usages is like spaghetti code ^^

opal wind
#

what is really pain to do are tiles, i just wanted 1 tile on my mod but i dont know if its worth to make it

#

im using a 3D item for now

mint sphinx
#

uea tiles not that easy ^^

#

what is it ?

opal wind
#

yea.. its a machine, the machine that able the player to trade things of my mod

#

i wanted it as a tile, so it could be solid and clean and all

#

size of a oven more or less

mint sphinx
#

how do you build it ?

opal wind
#

just like the glue, a 3d item

#

it shows ok ingame

mint sphinx
#

a normal recipe ?

opal wind
#

but still its not a tile, so people can walk trough it

opal wind
mint sphinx
#

because you could always try to make it as a building option

#

and then just make a picture of your 3d model to make it to 2d ^^

opal wind
#

like a steel crate?

mint sphinx
#

i guess you could do that then just the propeties you have to transfere to the tile/isoobject

tame veldt
#

When I do getScriptManager():getItem("Base.Bag_Schoolbag"):DoParam("WeightReduction = 95"). It works fine in singeplayer but in multiplayer the value only changes when I spawn the item in using cheat menu. Every time I tested I made a new world and checked spawned items and their value remains the same. The file is in the server folder(but have also tried in client and shared). could someone help me by telling what's wrong?

opal wind
opal wind
#

since its just 1 item i might try to find someone to do it for me

#

and credit the person later

tame veldt
opal wind
#

when i create a server, it works, i play, when i exit the game and enter again, the world simple wont load, this happened to me everytime i made a server

#

no mods

spark plank
#

can I get a list of players around a certain player, by any chance?

#

(I'd think I'd need player xy and then *n that and check if onlineplayer is inside that?)

#

awyeah. getPlayer().BodyLocation :D

#

(wait. reading the docs... it feels like my legs can be on another location than my body ... ... is.. is that a thing?)

rich wagon
#

Hey there ! Somehow, an item i made shows only half of its texture ! The rest is pitch black. The "colormap" looks correct and works fine in blender.

spark plank
#

look on the bright side, at least you see half of it :D

rich wagon
rich wagon
spark plank
#

ooooh! I didn't know that that was a thing ^^'

#

so, I'm assuming players xy = heads xy? :P

rich wagon
#

Wait i was just kidding ! I have no idea

winter bolt
lapis stump
#

nude mod ?

winter bolt
#

what lmao

lapis stump
#

idk just sayin lots of subs prob nsfw

#

my nude mod has only 300 subs though 😦

winter bolt
#

lmao oversaturated market

#

its on my hair mod

lapis stump
#

oh yeah i use that mod and your clothing one

winter bolt
#

😳

golden plover
winter bolt
#

yeah i havent actually seen how many subs some nude mods have

#

what is it called?

frank elbow
# spark plank awyeah. getPlayer().BodyLocation :D

I was curious so I took a look at the docs, as a disclaimer I'm not PZ modder so take what I say with a grain of salt. What you found was an enumeration of main body sections (I say main because it lacks the more specific subdivisions). I think what you want is getX, getY and getZ which are inherited from IsoMovingObject, or maybe getFacingPosition. There are a couple of other things which seem like positions (getLrx, getLx) but those ones seem like the most likely to be basic positions (this doesn't directly answer your question about getting players around a player, but hopefully it helps you get there)

#

Oh actually, there's also DistTo (& DistToProper, dunno the difference) which accepts another IsoMovingObject. That'd probably be easier for comparison

thorny portal
#

Man tress are such a blight in the erosion system, they spawn at such an unreasonably high rate.

#

I want to catch the erosion actions, check for tree spawning and check their tile, see if it's gravel (since we can make gravel paths), and stop them from spawning, but can't figure out where to even start with it.

opal wind
#

you can change erosion settings on sandbox options

#

they do start to fast

worldly olive
#

Hi hi! How do you guys insert an image with a link in the steam description?
I try to use
<a href="URL">
<img src="imageURL">
</a>

But it reads it as a text 🤔

brittle jewel
worldly olive
#

Daaaamn thank you, it worked!

brittle jewel
thorny portal
#

@opal wind yeah, but it does start, it just slows it some, the spawn rate of trees after a couple months is still ridiculous. And I want people to be able to put effort into paving a road to eliminate the issue.

opal wind
#

i agree yeah, kinda hard to do thou, hope you manage!

worldly olive
thorny portal
#

@opal wind I'm confident I could if I knew any events or the like that I could hook into, documentation isn't ideal

deft mountain
#

hi, first time trying to create an MP server with a few assorted mods that i've picked in the workshop and when i start the server, it just gets terminated and idk what's wrong

i've enabled everything in MODS from the main menu and added everything in 'Steam Workshop' and 'Mods' in the Server Settings and i'm not sure where else to look

small topaz
#

hi there! currently working on a mod an need a random number in my lua code. more precisely, i have an array called "colors" and i want to randomly pick an element from it. so i need something like "colors[i]" where i is a random integer between 1 and the size of the array. in vanilla code, the devs often use a construction like "ZombRand(#colors)" in such a situation and i'd like to try to use "ZombRand" too. But how exactly is ZombRand defined? What can it take as arguments and what output does it produces? many thanks!

brittle jewel
brittle jewel
brittle jewel
quasi geode
#

that post on ZombRand is incomplete

     @LuaMethod(
         name = "ZombRand",
         global = true
      )
      public static double ZombRand(double var0) {
         if (var0 == 0.0D) {
            return 0.0D;
         } else {
            return var0 < 0.0D ? (double)(-Rand.Next(-((long)var0), Rand.randlua)) : (double)Rand.Next((long)var0, Rand.randlua);
         }
      }

      @LuaMethod(
         name = "ZombRandBetween",
         global = true
      )
      public static double ZombRandBetween(double var0, double var2) {
         return (double)Rand.Next((long)var0, (long)var2, Rand.randlua);
      }

      @LuaMethod(
         name = "ZombRand",
         global = true
      )
      public static double ZombRand(double var0, double var2) {
         return (double)Rand.Next((int)var0, (int)var2, Rand.randlua);
      }

      @LuaMethod(
         name = "ZombRandFloat",
         global = true
      )
      public static float ZombRandFloat(float var0, float var1) {
         return Rand.Next(var0, var1, Rand.randlua);
      }
#

theres multiple variations on it

spiral plover
#

Looking for some advice here, my dynamic radio channel isn't be initiated in MP despite it following the exact same principles of the vanilla automated ones

#

I was trying to register the dynamic radio to my global mod data, but global mod data is loaded after the radio, so it doesn't exist yet

#

it works ofc in singleplayer, it's purely a MP issue

small topaz
#

so, if my array stores values for i=1,...,5, i need array[ZombRand(array:size())+1] to generate a random entry?

willow estuary
#

Oh, the world doesn't instance until a player is connected?

spiral plover
#
LOG  : General     , 1642213565688> 0> name = Automated Emergency Broadcast System, freq = 103000, cat = Emergency, uuid = EMRG-711984
LOG  : General     , 1642213565689> 0> Found radio channel: Automated Emergency Broadcast System, freq = EMRG-711984, freqcheck = 103000, multi = 1
LOG  : General     , 1642213565690> 0> scriptmanager = zombie.radio.scripting.RadioScriptManager@38caad46, isNewGame = true
LOG  : General     , 1642213565691> 0> Loading Facility-7 Radio
LOG  : General     , 1642213565692> 0> name = Secure Insurgent Frequency, freq = 600000, cat = Military, uuid = INSR-59755
LOG  : General     , 1642213565693> 0> Found radio channel: Secure Insurgent Frequency, freq = INSR-59755, freqcheck = 600000, multi = 1
LOG  : Radio       , 1642213565694> 0> Radio setting new game start times
LOG  : Radio       , 1642213565694> 0> Time since the apocalypse: 1
LOG  : Radio       , 1642213565694> 0> Radio loaded.
LOG  : Radio       , 1642213565694> 0> ################################################
LOG  : Radio       , 1642213565694> 0> 
LOG  : General     , 1642213565694> 0> Facility-7 Mod Data has been initialized!```
#

thats the order it does it in right, as that is sp, but it very possible that it doesn't load properly until a player connects

#

I could attemp to load the radio at the same time that I initialize the mod data

quasi geode
spiral plover
small topaz
spiral plover
quasi geode
#

to explain, the basic usage of zombrand will stop at the number given as a arg (if theres 5 items in your list, it returns 0 to 4, but not 5), #array returns the number of items (ie: 5), lua will index that table list as 1 to 5 so you need to add +1 to the result, (otherwise your trying to fetch items 0-4, not 1-5)

willow estuary
spiral plover
#

Interesting, alright, that explains some of its bizare behaviour

willow estuary
#

Yeah, the "phantom global mod data" may even persist in MP, albeit I think that's just a client side copy, and not any remaining connection to the server?

#

But it complicated developing funky stuff that uses it 😄

spiral plover
#

The issue appears to be a mix of that, combined with the fact that if I don't add the radio during the radio load sequence then it doesn't actually get added..

#

sadly the radio loads before the global mod data, so I can use the global mod data for lots but not the radio..

willow estuary
#

Could you modify your radio station to comply with the mod data record at a later point after the radio load sequence perhaps?

#

...probably not that flexible however.

spiral plover
#

Hmm, I could try to grab the moddata from gametime and assign it to the global one from the server

willow estuary
#

I recall that mod data stored to game time was unreliable in a MP context?
That might be the reason the global mod data system was added in 41.5.

spiral plover
#

thats the issue i'm running into, is it purely unaccessible or just locked behind server or client?

willow estuary
#

My experience was that it wasn't actually persistent? game time mod data that is.
I use global mod data, the system added in 41.5, exclusively on account of that.

And sorry, if you were talking about game time mod data throughout our convo, then the info I told you about when and how it loads was in regard to the global mod data, not game time. My bad.

opal wind
#

i also made a Disinfectant Gallon (x4 times more quantity) its a little bit different from the glue (fixing item), the tooltips to use it are separated (or they will carry the same name ingame)

#

the regular game uses disinfectant to produce 'alcohol' cotton hehe

spiral plover
willow estuary
#

Ah okay, good, was worried there was a miscommunication 😄

spiral plover
#

Aha no no, we're on the same page lol

willow estuary
#

Okay, so I don;t have a handle on the specifics, but you can record and load data to text files on the server instead of using mod data?

spiral plover
#

Oh? perhaps that is what is needed..

willow estuary
#

This is some code that a friend hooked me up as a reference, for some future plans I have in that vein. So I saved it, but have never tried it or anything?

function loadFunFile(filename)
    local file = getFileReader(filename, true) -- goes in the Zomboid/Lua cache directory, true/false to create the file if non-exsistant (i think? cant remember)
    if not file then return end
    local lines = {} -- empty table for now
    while true do
        local line = file:readLine() -- read a line, not sure if BufferedReader class can return the whole file at once.
        if line == nil then -- nothing returned, end of file, close and break from loop
            file:close()
            break
        end
        table.insert(lines, line) -- add the line to the table
    end
    return loadstring(table.concat(lines, "\n")) -- join the lines togeather with "\n" and load the string. not sure if the readLine() strips file endings, so read them just to be sure
end

local someFun = loadFunFile("somefile.lua") -- store it in a variable.

someFun() -- execute the function
#
The loadstring function is similar to loadfile, except that it reads its chunk from a string, not from a file. For instance, after the code

    f = loadstring("i = i + 1")
f will be a function that, when invoked, executes i = i + 1:
    i = 0
    f(); print(i)   --> 1
    f(); print(i)   --> 2

and the link they provided me with https://www.lua.org/pil/8.html

quasi geode
#

thats for executable code though, not quite a mod data replacement

spiral plover
#

Hmmm, alright, well then close but no cigar...

willow estuary
#

Yeah, sorry, I've dabbled with more relevant stuff, data itself that is, being recorded to file and such, but it was a long time ago?

quasi geode
#

well the concept is kinda the same, just need to chop out some code (and add some more for writing the file)

frank elbow
# thorny portal <@!639731325829513237> I'm confident I could if I knew any events or the like th...

Meant to mention this earlier, I looked at the docs when you initially posted your message. The NatureTrees erosion category class might be helpful, but I couldn't find anything about events bc I don't know how zomboid handles them. There was a method that had something to do with validation, but presumably that's called internally & I wouldn't know how you'd override it without recompilation if so

spiral plover
#

Yeah it's all good, I can see that it just reads the file and executes what it reads. I'd need to add the whole writing segment like Fenris said

frank elbow
#

Unsure if it's exposed by pz, but the Lua standard library has utilities for io

#

Which includes file writing

quasi geode
#
writeSettingsFile = function(tbl, filename)
    local file = getFileWriter(filename, true, false)
    if not file then
        return
    end
    for key, value in pairs(tbl) do
        file:write(key .. " = ".. tostring(value) .. "\r\n")
    end
    file:close()
end

readSettingsFile = function(tbl, filename)
    local file = getFileReader(filename, true)
    if not file then return end
    while true do repeat
        local line = file:readLine()
        if line == nil then
            file:close()
            return
        end
        line = string.gsub(line, "^ +(.+) +$", "%1", 1)
        if line == "" then break end
        for key, value in string.gmatch(line, "(%w+) *= *(.+)") do
            tbl[key] = value -- note that value will be a string, you may need to convert to number or w/e
        end
    until true end
    return tbl
end