#mod_development

1 messages · Page 6 of 1

wraith root
#

spiffo sax

tender epoch
#

how hard would it be to change the texture of a backpack to trasnparent?

wraith root
tender epoch
#

is there any guide on how to make the mods etc? ive never modded anything other than tiny bits of hoi4

wraith root
#

Best thing is to look at a mod you like and look at the files that make it up

Or look through Java source code/ scripts for ideas around what you want to make / change

tender epoch
#

thanks king

wraith root
#

frog

lusty nebula
#

leather

lusty nebula
#

Item_BoonieHatWoodland

#

module EMP
{
item Gloves_GreenGloves
{

DisplayCategory = Clothing,
    Type = Clothing,
    DisplayName = Green US Combat Gloves,
    ClothingItem = Gloves_GreenGloves,
BodyLocation = Hands,
    BloodLocation = Hands,
    Icon = GreenGloves,
ScratchDefense = 50,
BiteDefense = 20,
Weight = 0.03,
Insulation = 0.65,
WindResistance = 0.75,
WorldStaticModel = GlovesLong_Ground,
}
wraith root
#

h m

shy radish
#

Can I post coding questions/issues here or would tech support be more appropriate?

heavy iris
#

I think it's here, Yep :)

shy radish
#

Okay great, ty!

Okay so I'm trying to alter the sandbox settings, specifically the zombie lore.

Here is my code

local function switchSettings(settings)
    getSandboxOptions():set("ZombieLore.Speed", settings["speed"]);
    getSandboxOptions():set("ZombieLore.Strength", settings["strength"]);
    getSandboxOptions():set("ZombieLore.Toughness", settings["thoughness"]);
    getSandboxOptions():set("ZombieLore.Sight", settings["sight"]);
    getSandboxOptions():set("ZombieLore.Hearing", settings["hearing"]);
    getSandboxOptions():set("ZombieLore.Cognition", settings["cognition"]);
    getSandboxOptions():set("ZombieLore.Memory", settings["memory"]);
    getPlayer():Say("Changed settings");
end```

here is the error I'm getting

STACK TRACE

function: switchSettings -- file: AlterZombieLore.lua line # 15
function: changeLore -- file: AlterZombieLore.lua line # 46

ERROR: General , 1659380185177> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getValue of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1659380185177> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getValue of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:65)
at zombie.GameTime.update(GameTime.java:672)
at zombie.gameStates.IngameState.UpdateStuff(IngameState.java:564)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1659)
at zombie.gameStates.IngameState.update(IngameState.java:1369)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
at zombie.GameWindow.logic(GameWindow.java:297)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:764)
at zombie.GameWindow.run_ez(GameWindow.java:666)
at zombie.GameWindow.mainThread(GameWindow.java:494)
at java.base/java.lang.Thread.run(Unknown Source)


Obviously I'm trying to access something incorrectly (I think anyways haha), what am I doing wrong though?
thin hornet
shy radish
thin hornet
#

Well the problem is not in the code snippet you sent it seem to be at the line 46 where you are calling getValue as far as the error message tells me

shy radish
thin hornet
shy radish
thin hornet
#

you can try this to see if the option is valid name cause its seem to try to getValue of an option that is not found

print( getSandboxOptions():getOptionByName("ZombieLore.Speed") )
#

but as far as i can see they all look good

shy radish
#

Well it let me grab the value, but attempting to change the value seems to be causing the issue. Hmm. I'll keep playing around with it.

lusty nebula
#

Brita's mod...Base.9mmClip to get one but is an empty one....what's the code to have a fully loaded one? Maybe Base.9mmClipFull ?

quiet nebula
#

I've been decompiling the past 20 minutes or something, it's been stuck on zombie/characters/action/ActionTransition. Is this class specifically supposed to take this long?

wraith root
#

Decompile one file at a time next time, might help

plucky junco
#

hi guys, i'm trying to make a UI that will show my server rules when i press the key Y, that part is going good, the only problem is that I can't understand how to put the actual text of the rules inside the handler.

#

I know i can use the drawtext("...."...), but i would like to use the gettext, in this way I can put the italian translation for it

#

how should I put it exactly?

#

function MyUI:prerender()
ISCollapsableWindow.prerender(self);
self.chatText.text = getText("UI_Rules")
self.chatText:paginate()
end

#

in this way it is not working

#

if anyone can help me I would appreciate it, thx ☺️

nimble matrix
#

Question: Is there a mod/would it be possible to have it where chatting in text actually made your character do shit with their body language? It would be amazing if when a player typed No in the chatbox they shook there their head or "I don't know" and they shrug. On top of that if there was the little sim style voices as we talked it would be so awesome.

craggy furnace
#

but from what i remember, a system thats similar to the text display from fallout 1/2 was under discussion for NPC's for more nuanced interactions but dont quote me

drifting ore
#

Is there a mod that lets you spawn in the same location as your friends?

median cliff
#

ok this ones active

#

does anyone have a mod where like
theres more hotbar slots
like armor with hotbar slots you can put things on
kinda like belt slots or somthing where you can put gas masks there
but like
on your chest or somthing??

nimble matrix
#

I do find it strange you can't have things hotbarred

midnight mica
#

is there a way/function to know how long a player has played on your server? like all deaths combined

cosmic condor
#

not sure about death counts

midnight mica
quiet nebula
polar gyro
#

What I have to do for add spawning points to custom occupations?

#

Or mod example, maybe YaeThink

heavy iris
polar gyro
heavy iris
#

you can do a mod with just the spawnpoints ints very simple

polar gyro
#

I know. I mean which file i should add/overwrite?

heavy iris
#

its spawnpoints.lua

#

lemme tell the exact location

#

well since you wanna modify the vanilla map i'm not entirely sure where you should place it, but I'd say:
mods/YourModName/media/maps/YourModName/spawnpoints.lua

shadow geyser
#

I suggest you look at any of the mods on the workshop that add spawnpoints to the map. alot easier to learn from an example

polar gyro
#

I tried this, but somehow its does not work. Maybe I need try it more

#

Anyway thanks

heavy iris
#

wait I can make one for you

#

just adding the spawnpoints, and I think you'll understand

heavy iris
#

Hey guys, I have a project for a simple modding tool (in the same spirit as @thin hornet 's wiki to create custom events) that I think is achievable, interesting and a bit involved. I've browsed a few mods and googled a lot, I think its not done yet. But I might be wrong ^^

#

Anyone in for a talk, maybe on another chan?

lusty nebula
#

I need help from some good " Modding Guru Soul " 😄
I need a function for my lua script that, when the character is created, immediately refresh/updates the hotbar ( if feasible )
I've tried myself first but no success so far, so if anyone can help it will be very much appreciated! 😉

quiet nebula
#

Is there someone here with some experience with Gradle, that could help me out with turning off a single Task in the setupWorkspace greater task?

quiet nebula
#

Aha, I have found a way to temporarily disable a task, by removing it from the .idea/runConfigurations/setWorkspace.xml file, it will be added, so the next time you run the setupWorkspace task, it will be run completely, if you don't remove it again. But I was getting stuck halfway through decompileZomboid every time.

#

I was able to complete the rest of the process, so it's only getting stuck on decompiling a single file...

sour island
#

Also, I think Konjima also uploads the results of his guide somewhere - if you're using his guide?

sour island
#

I wonder if favorited items get cleared of their favorited status when you die - could be used as an identifier.

quiet nebula
#

And it doesn't matter how long I keep it running

#

I kept it running overnight and it hadn't gone any further

#

So it's not a matter of resources

#

It just got stuck

sour island
#

strange

quiet nebula
#

No matter how many times I try it, it always gets stuck on the same class file

sour island
#

also I have the same CPU ✋

quiet nebula
#

Haha

sour island
#

let me rerun a decompile

quiet nebula
#

If I run the decompile separately, it works

sour island
#

oh?

quiet nebula
#

But if I run it as part of the setupWorkspace it gets stuck

sour island
#

if you removed decompile from the workflow then you should be fine?

quiet nebula
#

Thing is, how do I properly remove it from the workflow? ^^;

sour island
#

oh I thought you did

quiet nebula
#

I did, but it adds itself after one run

#

So it'll decompile again next time

#

It shouldn't be an issue, you shouldn't need to run this often

#

But I wanted to look for a permanent solution

#

So I don't get into this same issue a few months from now, when a new version is released that I have to decompile

quiet nebula
#

But that doesn't seem like an optimal way to 'fix' this situation

#

I wanted to disable it by adding decompileZomboid.enable = false to the build.gradle file, but I've not managed to get that to work, since it gives errors: Could not get unknown property 'decompileZomboid' for root project 'MyModNameHere' of type org.gradle.api.Project.

sour island
#

I think the gradle project isn't loaded onto your machine but is accessed offsite

quiet nebula
#

So I need some sort of namespace, but I don't know what to add there

sour island
#

so it might be updating from there

quiet nebula
#

Yeah, I think so too

sour island
#

you don't have to add a modName

quiet nebula
#

I thought I might be able to interfere locally, but that might not be possible 😛

sour island
#

that is only if you want to convert the capsid workspace into your mod's workspace

#

which I don't personally do

quiet nebula
#

I don't quite understand what you mean by that. Are you saying that what I'm doing here isn't what I should do to deactivate a step in the workflow?

#

I'm sorry, I don't have any experience with gradle

sour island
#

I'm not sure how to deactivate a step

quiet nebula
#

So I'm probably asking about things that seem obvious to you ^^;

sour island
#

but I'm saying don't worry about not providing a modname

quiet nebula
#

I...

#

I think you're misreading the error message

#

Or I'm terribly misunderstanding the issue

#

Providing a modname where?

sour island
#

Nvm I did misread

quiet nebula
#

It says it doesn't know the property decompileZomboid

#

Ah, okay

sour island
#

When you start the workspace process you enter in the directory for PZ right?

quiet nebula
#

Yeah, in the local.properties file*

#

gameDir=E:/SteamLibrary/steamapps/common/ProjectZomboid

sour island
#

This is what I get right after starting

#

I'll let you know if it can finish

quiet nebula
#

Okay, thank you 🙂

sour island
#

Did you set java SDK to 17+ ?

quiet nebula
#

I set it to 17 as specified in the guide

sour island
#

just checking

quiet nebula
sour island
#

I have it as 17 on one machine, 18 on another, and both worked

quiet nebula
#

Can I check this somewhere*

sour island
#

it would be under

quiet nebula
sour island
#

corretto is amazon's java thing right?

quiet nebula
#

It's the option I was given on creating the project, I'd have to google for the details~

#

Looks like it, yeah

sour island
#

OpenJDK is free

#

and I think corretto is based off it anyway

#

if that doesn't work try reverifying the files through Steam

#

could be the class file is altered in someway

quiet nebula
#

It doesn't matter if I use 17 or 18?

sour island
#

just finished decompiling

quiet nebula
#

Ah, hahaha, okay

sour island
#

so I don't think so

quiet nebula
#

I'll change to openjdk and see what happens

sour island
quiet nebula
#

Thank you for your patience ^^;

sour island
#

np, and good luck

quiet nebula
#

Thank you!

heavy iris
#

Hey I have a question on IsoObject class, anyone?

quiet nebula
#

I was currently trawling through the source code, making a list of useful looking luamethods 😛

sour island
#

ah just check out LuaEventManager.class

#

has all of them there

quiet nebula
#

Ohh

quiet nebula
heavy iris
#

Well I want to add a custom generator in my custom map (so actually I went to isoObject through isoGenerators but we dont care), and the point is I wanna place it with Worlded/Tilezed. For this I think I cannot just create a custom item because it wouldnt be loaded on world creation.
So I think the moment the game add a Generator to Generator textures you add in Tilezed (appliances_misc_01_1) is linked to the isoObject class (or, isoGenerator).
So I'd like to know if you know something about it, and also what is isoObject.addToWorld()

sour island
#

I would probably ask #mapping about the tilezed stuff - but isoObject is like the most basic type of java object that can exist in game. It's the precursor to IsoPlayer/InventoryItem/IsoGridSquare etc

#

reading through add to world on isoobject is looks to add ambient sounds based on the object, as ell as adding "logic" for doors/windows

heavy iris
#

can you tell me where you read this? So I can answer questions by myself ^^ have been through a lot of reading recently hehe

sour island
heavy iris
#

Thanks mate, will ask there also!

#

ok

sour island
#

intelliJ lets me use ctrl+shift+f to search phrases from the entire directory

#

as well as ctrl+shift+n for file names

heavy iris
#

wow ok

#

so I definitely need that, thanks for making it obvious 😄

sour island
quiet nebula
#

It's stuck at the same spot again

INFO:  ... done
INFO:  Decompiling class zombie/iso/areas/IsoArea
INFO:  ... done
INFO:  Decompiling class zombie/iso/areas/BuildingScore
INFO:  ... done
INFO:  Decompiling class zombie/characters/action/IActionStateChanged
INFO:  ... done
INFO:  Decompiling class zombie/characters/action/IActionCondition
INFO:  ... done
INFO:  Decompiling class zombie/characters/action/ActionTransition
#

Maybe I have to restart my IDE or something...

sour island
#

try to reverify steam files for PZ too

quiet nebula
#

Sure

heavy iris
lusty nebula
#

Is there a way to create a function or event that updates/refresh the hotbar soon as a characther is created/spawned?

quiet nebula
#

Otherwise I'll just keep a README file in the root of the project and hope future me remembers about it 😛

lusty nebula
#

In the case is of help for someone here is a small funtion to let the character starting with the rifle displayed on the hotbar and equipped with both hands by the character, plus magazine fully loaded and inserted. ( Just change the name of the lua file according to your ). Remeber to set the ammo count -1 because one normally is chambered already. Number of the slot can be changed accordigly to your needs. Usefull if you don't want to spend 1 hour reloading magazines at the beginning of your gameplay.

    local pl = getPlayer();
    local inv = pl:getInventory();
    local wpn = inv:AddItem("Base.M723");
    wpn:setAttachedSlot(1);
    wpn:setCurrentAmmoCount(29);
    wpn:setContainsClip(true);
    wpn:setRoundChambered(true);
    pl:setPrimaryHandItem(wpn);
    pl:setSecondaryHandItem(wpn);```
sour island
heavy iris
#

Installed EmmyLua, relaunched, and now IntelliJ seems stuck :\

lusty nebula
#

Welcome to the magic world of modding LOOL 😄

heavy iris
#

Maybe I should have kept Java 18?

quiet nebula
#

I got sort of stuck on C1, but I managed to work around it ^^; I'm sure there's a way! 😛

opaque ocean
#

hey brothers, I know I keep asking stupid basic questions about stuff that's probably just unused stuff TIS puts on stuff for "later use" but uh...

anyone know what the SurvivalGear item property does?

it's on stuff like saws and duct tape and whatnot.

heavy iris
quiet nebula
#

Oh, hahaha

#

Nice

#

Guess it's just me ^^;

shy radish
#

So I know it’s possible to add sound effects to the game, but is it possible to add like world sounds that will attract zombies?

polar gyro
#

What i should add to trait for disabling it in multiplayer? YaeThink

pale bramble
#

Hey there. Is this the right channel if i need some help with creating a mod? Especially a map mod?

thorn cipher
#

But there is also the mapping channel further down on the left 🙂

shy radish
#

So I’m pretty new to the modding scene. I’ve been checking out the modding/Java docs, and they seem a tad barren, as far as detailed information on how things work exactly. Are they a WIP, or are they left intentionally barren to not give away too much of the ‘backend’ of the game code?

cosmic condor
#

the info is all out there, but just displaced

shy radish
calm depot
#

I found that Fernflower fails to decompile certain parts of the code

cosmic condor
#

The only thing they keep secret is the anti-cheat protection type

calm depot
#

lol, "secret"

cosmic condor
#

They won't admit it, so it counted as a secret 😆

calm depot
#

I suppose it interferes with scriptkiddies, but with a combination of testing against your own server and decompiled java bytecode, you can figure out what's doing what fairly easily

cosmic condor
#

I am a script kiddie

calm depot
#

most of it's smoke and mirrors and relies on the client self-reporting for "being naughty"

#

but I'm not in the business of helping people cheat so that's all I'll say

unreal needle
#

anyone know some mods for late game to make it a little less boring? cause after you survive and explored everywhere you dont really have anything else to do rather than just die

unreal needle
cosmic condor
unreal needle
#

are there also mods that allow you to make fuel? compatible with KI5 vehicle collection if possible haha

unreal needle
#

bruh

cosmic condor
#

this is modding section you should try making one

cosmic condor
calm depot
#

that's a bit pointless; if you read the console log yourself you can see what type was triggered

#

and, in some cases, it will also print the packet class name

cosmic condor
#

Looking through logs is not easy

calm depot
#

if you can setup a server, you can look through a log file

cosmic condor
#

should be like that

cosmic glen
#

does anybody know what I can do about this

#

I've checked the file and it does exist

cosmic glen
#

sorry, thanks!

drifting ore
#

are the mods for this game made with java or lua????

random finch
#

How do you group multiple items in loot tables? Say I have 3 cars, all 3 are almost the same but with a bit different stats and texture. I want it to choose from one of those 3 instead of each variant taking a loot table spot.

thin hornet
random finch
brazen grove
#

Hey all, I'm making a mask and I've not come across this issue before.
I'm using the code:

<m_HatCategory>nohairnobeard</m_HatCategory>

Which usually makes the beard and hair disappear. The issue I'm having is the beard isn't disappearing. If I change it to

<m_HatCategory>nobeard</m_HatCategory> the beard disappears but the hair stays and if I do "no hair" on it's own it also makes the hair disappear. When I use the nohairnobeard command it seems to be keeping the beard. How can I ensure both disappear?
brazen grove
wraith root
#

Damn, in more modder news for other games, VRChat modders for some fairly large mods just got legal lettering sent to them as a cease and desist

Makes the modding ban resolute for that game

winter bolt
#

its so weird how hard theyre going down on mods considering theres like no gameplay

cosmic condor
wraith root
#

No one can walk into VRC or any game and sue you for allowing mods of your own IP

#

They were sponsored a small loan of $80,000,000+ just last year,

I smell a YouTube vs Google situation so they can put ads in the game and be open to buy outs from companies like Meta, Microsoft, etc

winter bolt
#

yeah i dont see how they could get sued because of people modding the game

cosmic condor
#

They have that 3rd party content integrated directly into the game. Unlike the games that use Steam Workshop service

#

you can just walk in a world and grab 3rd party content

wraith root
#

Modding doesn't entail pulling 3rd party content

#

As a modder, just like with PZ, you forfeit your rights to own the code from the developers as well

cosmic condor
#

I'm not sure about that since there is no example case. It's just to sue or not to sue thing

wraith root
#

That's giving it a very small edge case view and assuming VRC is still an isolated team

#

No one sues for modding when it's allowed

#

Ever

#

It's because they are being sponsored and told to remove modders, and likely NSFW content to clean up for ads, and company absorption

#

It's literally what happened to YouTube and Twitter by Google

polar gyro
#

anyone knows how to rotate item in game?

        {
            offset = 0.0000 0.0000 0.0000,
            rotate = -180.0000 0.0000 -180.0000,
        }``` not working
#

this is kinda book.

polar gyro
#

Nevermind. I just rotate model in blender

wraith root
shy radish
#

math.randomseed(os.time()) is throwing an exception, but I’m not sure why. Someone please help a noob out 🙂

polar gyro
#

I know getregularity is function to get name of exercise and %
How i can set regularity?

#

Like fitness instructor have starting boost in regularity

idle heart
#

who knows the best walking dead mods for project zomboid

wraith root
#

Instead of workshop installation, how would I take my mod from the zomboid/mods/ folder and put it in my server?

wraith root
#

nvm

#

looks like workshop only for servers

#

Got a workshop error=2?

#

now it's error = 9

#

hm

wraith root
#

weird

#

had to delete the entire mod completely for steam to reaccept it

#

hopefully that isn't a trend or there is a solution for error=2 in the future, as it's probs not good to be refreshing the mod like this

#

Alrighty

#

Any reason why I can't make my items for custom recipes while the ingredients are on the ground?

#

CanBeDoneFromFloor:true,

#

found it

shy radish
#

Is there somewhere I can find all the ‘types’ for when you’re making options for the sandbox menu? I know of ones like Boolean and enum, but that’s all that I know of.

surreal brook
#

hello, I would like to know where I could find the shirts/clothes files to add new textures

sinful vessel
surreal brook
#

Thanks!

thin hornet
#

double string enum boolean integer

unreal needle
#

is there a way to change a certain modded vehicle spawn rate for a server? i cant find the military truck i downloaded anywhere in the map

shy radish
#

What version of Lua does Zomboid use?

thin hornet
#

It's kahlua, lua 5.1 if im not mistaking

shy radish
#

Ahhh, that explains why my continue statement is not working haha

thin hornet
#

yeah there is a couple things that might not work

#

i think "next" was one of then

#

There is a new thing called PipeWrench that is still in beta but allows you to code pz mod in typescript.

shy radish
thin hornet
shy radish
thin hornet
#

Don't hesitate to ask question if you need to. Hoping to improve this project alot over time to make modding confortable to those who prefere javascript/typescript oop languages.

#

So from what i remember you can only pickup one corpse and generator cause they are saved into a variable. Near the context scripts in lua.
just saw it has changed

willow estuary
#

Corpses are fussy in that there are multiple code checks for both their type and tags to "force" them as being awkward items to handle.

#
  • hardcoded java stuff forthcoming stressed
#

We're aggressively addressing items not behaving realistically 😄

#

Not that we're trying to "mod-block", but sometimes these initiatives make modding stuff problematic while we sort out new mechanics?

#

Which is also sort of a constant state of affairs 🤪

#

But also corpses in specific have all sorts of exception based code handling, and a lot of it is hard coded java-side?
Not out of any deliberate malfeasance, it's just common good coding practices?

wraith root
#

mhm

willow estuary
#

But decompile IsoCorpse? and you might find a bunch of public functions that allow you to do your corpse modding stuff? 🙂

thin hornet
#

Also i think corpse had a lot of dupe problems at one point so i think that was addressed

willow estuary
#

Corpses are currently messy in multiple ways 😄

thin hornet
#

So you did change

function ISGrabCorpseAction:isValid()
    if self.corpseBody:getStaticMovingObjectIndex() < 0 then
        return false
    end
    return self.character:getInventory():getItemCount("Base.CorpseMale") == 0; <--- this line right?
end
willow estuary
#

Corpses are a special sort of item, and have all sorts of special code interactions; I don't know everything about corpses. but I know enough that I'd say they can be difficult to work with mod-wise?
Not to discourage you, but I'm a dev and I literally have all sorts of corpse mysteries I need to solve? 🤪

#
  • the new dev mind you 😄
wraith root
#

🤝 🤓

thin hornet
#

Try to hook the ISGrabCorpseAction:isValid method and change the line that check if your inventory already contains a corpse

willow estuary
#

Just be prepared for corpse stuff to have more strange issues and such than you may expect? 🙂

thin hornet
#
function ISGrabCorpseAction:isValid()
    if self.corpseBody:getStaticMovingObjectIndex() < 0 then
        return false
    end
    --return self.character:getInventory():getItemCount("Base.CorpseMale") == 0;
    return true;
end
willow estuary
#

But yeah, looking at your stuff, I think the new stuff in unstable may hardcode the corpse handling, relative to your mod, making corpses easy to handle, as being impossible and also when it goes into stable?
But there should be accommodations for modding that will make that possible in the next unstable/stable after this cycle?

#
  • it may be possible to mod a workaround until that modding accommodation is in stable.
willow estuary
#

I do understand what you're trying to do here, and we're already looking into making modding options to enable that 🙂

#

Giving modders the tools so they can do that, among other things, yes.

thin hornet
#

Otherwise Bikini made a tool to automate corpse transportation, not really instant but at least it automate the task for you (keeps the realisms while saving you couple clicks)

willow estuary
#

But I'll be honest with you in that, with vanilla PZ, we are actively looking at making corpse transferring less easy, with the nerf in unstable that hardcodes not allowing them in bags?
And then once, we have that sorted out, then we work on providing means for modders to bypass that?

#

And again, this is something that has already been though of, and we worked out the means for modders to bypass it, but that's a different venue than the unstable build?

#

This is literally one of the scenarios that came up while working out this stuff to be honest 😄

thin hornet
#

can you show me what you did into the perform method?

#

can send here

willow estuary
#

But having said that the above code might bypass the current unstable stuff it it works as intended? That's just a snap judgment, if it's not working it has problems obviously.

cosmic condor
#

what is the reason behind this?

willow estuary
#

Believe me, this is just the beginning.

willow estuary
#

It does need more fine tuning for a handful of items than need exceptions, fair cop.

#

But it eliminates putting garbage cans and plastic lawn chairs into schoolbags.

cosmic condor
#

REALISM

willow estuary
#

You will not be able to put corpses in bags when the Unstable build becomes Stable FYI.
It will be hardcoded in java.
In a later builds you might be able to mod that out?

cosmic condor
#

we're on 41.73 unstable now

willow estuary
#

When unstable becomes stable it will be impossible to put corpses in bags on account of it being hardcoded in java with normal modding.
Either it becomes possible to mod it so corpses can be put in bags, or it will forever be impossible.
I don't make the decisions; I'm not opposed to making it possible to mod out, but again I don't make the decisions?

wraith root
#

Impossible until you do it with java >:)

#

but that's hard :<

#

wat

willow estuary
#

The theoreticals with modding java are co outside my caveman peabrain that I can't address them.

wraith root
#

monkeh brian

cosmic condor
#

so we can no longer put a log in a bag anymore?

willow estuary
wraith root
#

alrighty that's enough gifs lol

#

simply mod a bag to be a 9999 carry capacity, also treat it as a box

#

or make a modded crate that weighs as much as a backpack

#

🧑‍🚀

thin hornet
cosmic condor
#

My 4th dimension pocket will become futile then 🥲

wraith root
#

Tarkov be like

willow estuary
wraith root
#

Bag of Holding mod

#

me when my overweight skinny all thumbs smoker build is no longer the meta

#

there will always be work arounds

#

some silly ones at that

willow estuary
#

Believe me, - Prevent Corpses and other very heavy/large things (Item Weight/Encumberance of 5 and above) from being put in backpacks. is just the tip of the iceberg with the item/container handling stuff?

#
  • And in regards to this, I'm not opposed to allowing the insane loot-goblins to have mod-workarounds on this essential nerf stuff, but I don't get to sign off on what I do?
cosmic condor
#

It will not be the Sims zombie anymore

willow estuary
#

In your case I'd just set corpse decay to a low period in the interim?

drifting ore
#

@willow estuary hey i have idea

drifting ore
#

If you hire someone and make mod or script / that call fix error

#

And it will gone error

#

What you think @willow estuary

drifting ore
#

@willow estuary i mean its pretty idea

drifting ore
#

Screw this

willow estuary
#

I'm sorry but I don't think it's feasible so I used Simpsons gifs to communicate that sentiment?

willow estuary
# drifting ore Screw this

But no, I think what you're proposing is currently impossible without using theoretical quantum AI or such?

drifting ore
#

Idk

#

Just giving idea to mod okay

cosmic condor
#

oh you are the guy who pitched the idea days ago

thin hornet
#

maybe try

--- call fix error
fixError();
willow estuary
#

Come on now, if someone doesn't know any better can we be better than making a punching bag out of them?
Granted I didn't set the best example with the Simpsons gifs.

thin hornet
#

i think what he suggesting is to hide the error red square

willow estuary
#

Oh, well, that's probably not for the best even if it may remove an annoyance, ahahahah?

thin hornet
#

oh it wont fix the issue for sure lol

cosmic condor
#

hide your sins

willow estuary
#

Sorry, I'm like neck deep in all sorts of theoretical AI etc stuff as side interests so I took the suggestion too literally 😄

#

"Well, yes, in theory a AI could solve mod issues but that's not currently a feasible solution as a mod AFAIK...."
I'm not a "smart smart" person, I'm a "dumb smart" person.

#

But no, even if it's an annoyance for users, it would be counterproductive and self-sabotage to allow mods to disable the error counter?

cosmic condor
#

but doing that may create more problems, better not give them options lol

lapis glacier
#

How do sites like battlemetrics track players inside a Zomboid server?

cosmic condor
#

steam servers give away those info

lapis glacier
#

interesting, is there like a public API that I can use to replicate this function?

willow estuary
# cosmic condor maybe for the peace of mind of an average player who knows nothing about server ...

If a server spams errors, and its an issue for the end user:

  • they can talk to the server admins about not using that mod
  • they can instead not play on that server

It's absolutely bananas to suggest "People using a server that uses broken mods should be exempt from error messages" when error messages are a crucial tool for both mod devs and PZ devs to sort out issues?

Don't use mods that produce error messages on your server, don't get error messages. That simple.

cosmic condor
#

I guess he's still using an old mod and refuses to let it go

willow estuary
#

People might not realize this, but enabling any such said requested feature would serve as a huge impedance to both solving vanilla issues and mod issues?

cosmic condor
willow estuary
#

"Hello, my PZ server bricked and every client set their house afire but also we have no error log" to be hyperbolic

cosmic condor
#

I thought he just said it as a joke, but no 😅

willow estuary
#

People on discord can be innocent, or younger than the TOS allows, etc, etc so really we should be charitable?

#

Point being even if we can be "whoah that's a silly suggestion for technical reasons X, Y and Z", we can still afford to try and be nice about it?

heavy iris
#

Heyt here, I have questions on classes. On a partly oudtadet tuto we have this.

#

Can we create new isoObjects subclasses in mods? What are bounds we have when doing mods regarding these classes? I guess we can't change them ofc ^^ but can we dulicate and change? Like isoCustomObject?

thin hornet
#

On the otherhand, IsoObject is the very raw object all other extend of. So it doesn't really have any specific functionality and you can make your own features in lua and use it's modData to store custom information to it.

heavy iris
#

Its not the isoObject class i'm interested in, more the isoGenerator subclass

#

what's particular with it : in isoGenerator.java, the class is tied to appliance_misc_01, a tilesheet, and that allows the game to create effective generators from generator sprites on world generation. That is the behavior I wanna reproduce (spawn custom WorldInventoryItem from tileZed tiles).

#

I think it would be a good possibility to add to modders and I wanna do it for myself.

#

So I'm trying to understand, since I can't deeply change the class, how I could reproduce the desired behavior. Indeed I think, since we cant modify Java parts, we'll have to add events browsing tiles and suqsequently adding objects (to what I've read, that's what the basegame do)

thin hornet
#

Not sure to understand exactly what you want.

#
  • WorldInventoryItem are not tiles.
  • IsoGenerator is hardcoded to use the sprite appliance_misc_01 in the constructor. I think it may be possible to change the sprite after its been created. But the whole generator lua is not coded to use othersprite i believe
heavy iris
#

I want to create a custom generator (a custom item with custom stats, with eventually custom interactions, as we can do with mods), that is added to my custom map when I place its sprite in TileZed.

For most mods I've been through, they either create a fully customized item and add them to loot table somehow, either they give you a custom map with custom tiles that are "decorative" and not functionnal (as a generator is). I want to link these 2.

What makes me think it's possible is that now, if you place appliances_misc_01_0 in tileZed (the generator's sprite), a true generator will pop

thin hornet
#

So you want a custom isogenerator spawned at a specific location

heavy iris
#

yeah, but I'd like that specific location to be computed by the sprites I place in TileZed

thin hornet
#

the texturepack contains the textures right. There is also a file ".tiles" that contains the actual data for that texture

heavy iris
#

(yeah but .tiles is quite poor)(appliances_misc_01 tiles properties are basically nothing)

thin hornet
#

it should have IsoGenerator in it

#

Isn't it set to IsoGenerator, if i recall there was a field for setting IsoStove, etc

heavy iris
#

well for isoGenerator its the other way

#

appliances_misc_01 is explicited in isoGenerator.java

#

and there is nothing about generators in .tiles

#

lemme see about isoStove

#

I could use isoStove for custom items if that's such

thin hornet
#

ah

#

i though there was all the IsoObject type in tiles

#

well if i understand, you want to place a sprite in a map and when its loaded in game to apply some feature to it

heavy iris
#

But you make me think about doing my idea enriching the .tiles format actually 😄

#

exactly

thin hornet
#

LoadGridSquare event

heavy iris
#

I took the generator because it was my base problem, and because its a good exemple to start with

thin hornet
#

scan each object in the square to find one with the sprite you need

#

or if you only need the custom feature on user interaction then just scan objects on the right clicked square using OnFillWorldContextMenu event

heavy iris
#

Yeah actually I should maybe do that you're right

#

I was searching for something that uses more core mechanics of the game rather than reproducing them

thin hornet
#

there is also global object system but i have yet to discover that myself

heavy iris
#

lol what's that about?

heavy iris
# thin hornet Not sure to understand exactly what you want.

Just to make it clearer, for later readers, here is what I wanted reproduce with, everywhere, (iso)Generator replaced by (iso)CustomItem (that might not be possible because we cant touch classes, but we could mimic a class somehow?).

-Create new 1cell map in Worlded with whatever .tmx.
-add a Generator tiles somewhere on the cell with TileZed
-compile map as mod and launch game+mod in debug mod.
-see there is an isoGenerator at the cell you placed the sprite

shy radish
#

So I’m working on a mod that alters character skills/xp and stuff. It works, except for the first character of a new world. Everything gets launched from an OnCreatePlayer inside of an OnGameStart. Anyone one have any ideas why it wouldn’t work on the first one but all characters afterword?

heavy iris
#

you tried in multiplayer?

shy radish
#

Nah not yet. Wanna get it working in single player first

heavy iris
#

because in singleplayer, doesnt the game start OnCreatePlayer? 😄

shy radish
#

I have no idea haha. If so that would certainly explain why it’s not working at first. Let me switch some stuff around and see what happens

heavy iris
#

otherwie you could try putting changes in custom professions and custom traits

shy radish
#

It looks like that works! You’re a genius, thank you!!!

mellow oyster
#

I'm trying to add a png as a readable map to an item, any clue how?

quiet nebula
#

Aww, there's no event for when a zombie spots something/someone?

#

Or are there events triggered in the functions called from within IsoZombie.spotted()

heavy iris
mellow oyster
heavy iris
#

send me mod name, I can look if it's easy using its code

mellow oyster
#

MoreMaps

heavy iris
#

this one won't help for adding picture, but other might

#

I'm not sure what you ask has been done, but i'm rather new so either you have to start digging a bit in the code, either to hope someone else can respond ^^

mellow oyster
heavy iris
#

well other mods I saw add symbols or let you draw on the basic map, which is a very nice step, but if u wanna change entirely the map from the moment you loot it, you have somehow to change the map image background, and it should be doable as I think the image is in the media fodler of the base game.

#

maybe check how annotated maps are implemented in the base game files

mellow oyster
#

i just figure displaying a png as a map ingame would be easiest

heavy iris
mellow oyster
#

Does anyone know how to use the map feature to display a png ingame?

heavy iris
#

I have a question on local variables in lua to understand one of @thin hornet mod tuto, anyone?

quiet nebula
#

I see you can add sounds to the soundbank, do they then still need to be registered, so they have a volume?

#

Oh wow

#

Well, that'll answer my question, possibly 😛

heavy iris
#

you need a sound file and a script

#

the script add the sound file to the game, and doing so you give it a name

#

(and then you can use the name in other files to play it when you want)

quiet nebula
#

I see, so I need to play the sound through an emitter, zombie.getEmitter.playSound and then pCall to play the sound?

heavy iris
#

this part I dont know at all 😄

quiet nebula
#

I'm not entirely sure what pCall does

#

Oh, hahaha

heavy iris
#

depend on when you wanna trigger the sound

quiet nebula
#

Well, I want to trigger it myself in a lua script, not register it as a random sound event, so I won't use this mod, I'll just steal bits of it that I can use to play sounds 😛

heavy iris
#

exactly :p

quiet nebula
#

Ahh, pcall is used to run a callable

mellow oyster
quiet nebula
#

print() should put the given string into the Logs/DebugLog.txt file, right?

#

Ah

#

I needed to add -debug to show the console it prints to

quiet nebula
#

Events.OnZombieUpdate.Add(<Functionnamehere>); can be used to add a function to an event, to be called when this event is triggered, right?

#

Thank you

agile vigil
#

Kinda dumb question, but I just finished my first mod and I'm proud. Where would I promote it and share the goodness with the world?

It's already uploaded to workshop ❤️

heavy iris
#

Gg! I dont know, maybe in chat?

agile vigil
#

Fair 😄

heavy iris
#

whats the mod doin? 🙂

agile vigil
#

It adds Evolved Recipes to the food tooltips. So you know what a Meat Patty can be used for, for example!

heavy iris
#

nice!

agile vigil
#

Should work for all foodstuffs, mod-added or otherwise, even modded Evolved Recipes! (So long as they still use the vanilla Evolved Recipe systems)

heavy iris
#

nicely done then!

agile vigil
#

Thank you 😄

quiet nebula
#

Nice one!

#

That looks very useful

#

I think making the text red if you don't have the recipe for it (or just leaving it out altogether, based on settings) might add some extra utility. But that depends on what you initially made the mod for

#

Either way, that's a very useful mod 😄

agile vigil
#

The plan is to make a mod do the same, but for baits next (e.g. show stuff like "Squirrel (30%)". Then work on adding patches using Item Tweaker API to stuff like Sapph's Cooking.

I definitely want to expand a bit, though, add a sandbox var to control if you need a certain cooking level, a magazine, a trait, or a recipe to see the usefulness.

I think you're right that by default, it should hide/redden unusable recipes! I didn't even know you couldn't do all the evolved recipes from the start!

quiet nebula
#

That sounds like it'll be a fun project to work on 😄

agile vigil
#

Yes! I'm very happy with this, even if it was a pain to get a tooltip mod that'd be compatible with other tooltip mods - or to even extract the evolved recipe data. 🤞 Bait data will be easier.

heavy iris
#

I have a question on local variables in lua. Checking Konijima's code, I see multiple .lua use :
local Server = require 'MyModName/Server';

Will MyModName/Server.lua local variables remain and stay untouched between two require ?

quiet nebula
#

I might be doing something wrong... Something like Events.OnZombieDead.Add(Shrieker_Shriek); Can be done in the 'root' of a file, right? I have a Modname_Events.lua file where I have this and then another file that has:

function Shrieker_Shriek(zombie)
    print("TEST");
    zombie.getEmitter.playSound("Shrieker_Shriek");
end

Does it matter in which order these files are loaded?

#

As in, if the file with the function is loaded later than the _Events file, would it still work?

#

Since the _Events file references the function that is defined in a file loaded later

heavy iris
#

hmm

quiet nebula
#

Otherwise I'll just add these Event functions to their Events in the file that has the functions.

#

Just wanted to make sure I wasn't doing something wrong 😛

heavy iris
#

Hmm you might need something here :
Events.OnZombieDead.Add(something.Shrieker_Shriek);
Or maybe where is that other file with shrieker shriek?

quiet nebula
#

Same folder

#

Folders:
media/lua/shared/ZombieVariety_Events.lua (event registering)
media/lua/shared/ZombieVariety_Shrieker.lua (function for event)

#

But I just changed it to this:

function Shrieker_Shriek(zombie)
    print("TEST");
    zombie.getEmitter.playSound("Shrieker_Shriek");
end

Events.OnZombieDead.Add(Shrieker_Shriek);```

And it still doesn't print TEST in the console 😛
#

That's what I just did

#

^^;

#

Hahaha

heavy iris
#

Hoo

#

ho nvm, "it still diesnt print test"

quiet nebula
#

🦉 ?

heavy iris
#

so with this you kill a Z and nothing happens?

quiet nebula
#

Yup, I use the horde manager to spawn a Z and then kill it, nothing happens, as far as I can see

#

No TEST to be found

heavy iris
#

Ho it should be in the server forlder I think

quiet nebula
#

Hmm

#

Okay, I'll try that

vagrant sapphire
#

I have an odd question

#

Been racking my brain a couple of days now so im going to post it here in case any of you bright sparks might see what I am missing

#

Context:
I'm writing some python scripts which a host of PZ server (either individual with access to a dedicated server, or, a hosting company who run up instances of games) to manage the game server.
In the process, I wanted to attach a familiar web framework to it so that the server could host both the game and the website, using python Django (an extremely popular choice these days).
Thats all going really well, but then I realised that I can use django to interact with the game database. So I set about reverse engineering the data models, and discovered one model which has a field called "data" and this is all of the information about a player, name, skills, perks, traits, you name it, its in there.
Unfortunately I have not been successful in reading this binary field data, despite multiple attempts and even with some help from @tame mulch (thanks very much).

If you are interested in lending a helping hand to fix this issue, I will happily share with you all of my findings and will also share with you the knowledge to use the scripts for your own purposes.

Please note: this is not hacker central, this is a genuine attempt to enrich the gaming experience with Project Zomboid by adding seamless website integration for the game server

#

Disclaimer: this isnt specifically about "modding" in the traditional sense of writing a mod and uploading it to Steam workshop, this is way more complex

quiet nebula
vagrant sapphire
#

If I can unlock it, I can assur you

#

the potential is limitless

#

PlayerDB.java can you expand on what this file is or does without me going to decompile it at all please?

quiet nebula
#

Ah right

#

From a brief analysis, it contains functions to save and load playerdata, including the all-important data field, through byte arrays

vagrant sapphire
#

yes

#

you sir

#

might have earned yourself a gold start

#

😄

#

brb

quiet nebula
#

Woo \o/

vagrant sapphire
#

java.nio.ByteBuffer

#

this is what youre talking about right?

quiet nebula
#

It looks like it. Looking at the PlayerDB.loadPlayer() It has a line with player.load(playerData.m_byteBuffer, playerData.m_WorldVersion);

#

ByteBuffer m_byteBuffer = ByteBuffer.allocate(32768);

#

Which is taken from TL_SliceBuffer, a ByteBuffer.allocate(32768);

#

Sadly my knowledge/experience with Threadlocal buffers is 0

vagrant sapphire
#

hmmm

#

there is such a thing in python

#

i wonder

quiet nebula
#

Have you tried throwing the binary data into cyberchef?

vagrant sapphire
#

nope

#

not heard of it

quiet nebula
#

To see if it can find any patterns

#

See if it's structured in a certain way

#

Might be best to move this over to DMs or another channel, as it's not really about modding

crimson dragon
#

Seeking help trying to build a particular mod for PZ. I want to create a new occupation for personal use, though I'd be willing to upload it to the workshop if others wanted it, but I have no clue how to do any modding. Literally nothing. I assume I'll have to learn some modding to make this but given this will be a very specific mod I don't think I'll need to know everything. Could be wrong though.

Basically I find the Veteran to be lackluster to put it mildly. Being as I'm a Marine I want to create a Marine occupation but I also want it to be balanced for gameplay. Traits would be plus to: Aim, Reload, Nimble, Strength and Fitness. Likely have a high negative value for trait points to help balance. Also want to make it so killing zombies decreases boredom and stress while time spent not killing zombies increases boredom and stress(this would be in addition to any base game values that affect this). I know there's other modifiers that occupations typically affect that traits don't and would like to learn about those to incorporate buffs and debuffs to help balance out this occupation.

I've seen a video on making a mod for pz but it was focusing on making a new item to add and I couldn't figure out if any of that information would even be of use to me for what I'm trying to do so I decided to reach out here and see if anyone could help or point me in the right direction. Please and thank you.

cosmic condor
crimson dragon
#

Is there a way to make a copy of the veteran then modify that?

#

Idk if it's all folders or one big file

quiet nebula
#

I'm so confused. I've been trying to get something to work, then @heavy iris tries it with my exact files and it works for him. Does anyone know how I can troubleshoot something like this?

#

It's a very simple mod, simply only:

function Shrieker_Shriek(zombie)
    print("TEST TEST TEST");
end

Events.OnZombieDead.Add(Shrieker_Shriek);```
But it doesn't show up for me for some reason.
#

In mods/Modname/media/lua/client/Shrieker.lua

zinc mural
#

Forgive me if somebody already asked this but I have a question about the hot fix change where backpacks can't hold a single item > 5 weight

Do we know if this change only applies to the actual backpacks in game (hard-coded somehow?) Or basically all of the container items? Today I know mods like hydrocraft 41 continued and zupercarts add carts/wheelbarrows which are implemented as container items, the exact same as the backpack items but with much bigger capacity.

If this change affects those items they'll be made pretty much useless unless we're given a configurable property for how big of an item may fit or something.

quiet nebula
#

For something like that you'd have to react to the event where an items is put into an inventory and check for its weight and the name of the container it is going into, I think

#

And then either undo it or make so it can't be done.

zinc mural
#

So the devs didn't think of this at all then.

quiet nebula
#

I'm not* sure I understand what you mean

#

The max weight of an item in a backpack is 5 now

#

And you want to know if this can be changed?

zinc mural
#

Basically there are mods that add much bigger containers than backpacks (i know vanilla only has packs & bags). They should be able to hold single items > 5.

#

Yes

#

Or if the change from the devs will affect these containers to begin with

#

Seems really short sighted if they actually hard coded the value to 5. They'll run into issues if they ever want to add bigger containers themselves

quiet nebula
#

Hmm, that's a good one

#

That, I don't know

wraith root
#

I wonder if you could store heavier items as a table value with a key, then store it as an item that is less than 5 lbs

heavy iris
#

I wonder if weight reduction limit is calculated after or before the item is in the container (some have weight reduction, I mean), could play on that too

wraith root
zinc mural
#

Yeah there's some possible hacks like you suggest... I just hope we won't actually need to do them lol

#

Any channel the devs actually monitor where we could ask them about this? I imagine it can't be that hard to expose us an item property that can simply change the max single item weight value

wraith root
#

If you scroll up to last night's Convo there was a discussion about it

zinc mural
#

Wow hard-coded in Java. Argh.

wraith root
#

Yeah

#

There are work arounds

quiet nebula
#

lmao, for real

wraith root
#

Do we know where we can make custom animations for tiles?

#

For example a large wall gate opening

#

Like maze runner

tawny crescent
#

hi guys, do you have any optimization mods?

viral notch
#

need fast help
did taillights and brake lights are interpret by game as same item?

viral notch
#

but if you remove right back bulb then both light wont works or only one of them?

crimson dragon
#

Only the one

viral notch
crimson dragon
#

4 bulbs, 2 for the headlights, 2 for the taillights

#

I see what you meant by your original question. Yes, tail lights and brake lights are the same bulb

quiet nebula
#

Can you continue from this state? Since it breaks on error and allows you to reload a file, does it allow you to continue somehow?

#

Or is this just alt-f4

cosmic condor
#

F11

#

uncheck break on error

quiet nebula
#

Thank you

heavy iris
cosmic condor
#

no idea, but I guess you can try testing it

wraith root
quiet nebula
#

Looking through the stack trace below this, am I correct in assuming you are not allowed to invoke the playSound function on a BaseCharacterSoundEmitter from lua?

#

oops, wrong image

quiet nebula
#

Hahaha

#

Yeah, 1440p monitors eh?

#

I can make bigger images of different parts of the screen

#

But I didn't want to leave information out

cosmic condor
#

activate your windows!

quiet nebula
#

You can't make me! reeee_pdx

quiet nebula
#

Wooo

#

I managed to play sound

#

Next is actually generating noise 😛

cosmic condor
#

post your solution, in case anyone wants to do the same

quiet nebula
#

Yeah, Just cleaning it up

#

Current code, before any sort of cleanup:

function FunctionName(zombie)
    local emitter = zombie:getEmitter();
    if not emitter then
        print("No emitter");
        return;
    end
    if target then
        print(target);
    end
    if not instanceof(emitter, "CharacterSoundEmitter") then
        print(emitter);
        print("Invalid emitter");
        return;
    end
    emitter:playSound("SoundNameHere", zombie)
end

Events.OnZombieDead.Add(FunctionName);
#

I should include providing the soundfiles as well

#

File:
media/scripts/sounds.txt
Contents:

module Base {

    sound SoundNameHere
    {
        category = SoundCategory, loop = false, is3D = true,
        clip { file = filepathtosoundfile, distanceMax = 100, volume = 1, }
    }

}```
quiet nebula
#

This does not currently generate any noise though.

stone flame
#

Every time i try to add mods to my solo and it goes thru the loading lua it gives me a small error at the bottom and then the screen just gets stuck on the background

heavy iris
#

some mods works on new game only, have u tried with a new game?

stone flame
#

thats what im doing im starting a new save

#

its also saying the mods should be in a different profile on my computer than my own

heavy iris
#

Oo

stone flame
#

it seems to only be when i select a mod that requires textures to load

hard mortar
#

is there any way to save GlobalModData to file without saving the entire world?

wraith root
#

Mmmm yes when modders do six updates in an hour

#

squirrel ✨ unsubscribe speed run

#

I'll have to wait til they stabilize their workflow or just hard pull the stable mod

thin hornet
calm depot
#

How often is the table built by ProceduralDistributions evaluated?

hard mortar
#

yeah I've done that, but wanted to look for a native way to do it

heavy iris
#

Hey, anyone already used OnLoadedTileDefinition or OnLoadedGridSquare ? I'd like some help understanding which one I should use

lusty nebula
#

Question: Let's say that in my mod I want that a certain vanilla file ( lua or script I mean ) is overwritten and then it remains empty ( or with some parts of it removed ), do I have to simply delete the contnent of the file of interest or there's something " special " to be written/added/done?

heavy iris
#

have you tried making a mod with only a blank file named the same as a game file?

lusty nebula
#

Not yet..have still to try...but knowing PZ seemed too easy LOOL 😄

heavy iris
#

I wanna add an isoObject to the concerned Tile if there is a certain sprite on it. I want to make a right click interaction out of this object

#

ok thanks ❤️ !

lusty nebula
#

Thanks mate I was guessing something like that...

#

so I think I'll have to report some bugs I've found if the vanilla files can't be overwritten...what's the best place for bugs report?

#

found a small in the character selection menu

heavy iris
#

If you are familiar enough for a quick explanation on how to access LoadGridSquare transmitted argument datas.. I take 🙂

lusty nebula
#

If you, for example, set a character as fully naked and then you save it as preset then when you'll load it again, the character in the game will be spawned naked, but in the selection menu some random clothes are displayed. If you remove one of them, all the others disappear ( so character fully naked as it should be )

quiet nebula
heavy iris
quiet nebula
#

build/generated/sources/zomboid/zombie/iso/IsoChunk.java:3118 : LuaEventManager.triggerEvent("LoadGridsquare", gridSquare);

#

I manually rename variables based off the code 😛

#

Whenever I get into a function I need to analyse

#

It was var19 before, haha

#

I will have to say I don't know what I'm using to decompile, there's a decompiling tutorial I've found to use 😛

lusty nebula
#

by the way...I have disabled Steam sync the saves but it continues to do it when launching the game...any way to let the game stopping syncing the saves?

heavy iris
#

yeah I'm reading IsoGridSquare atm

quiet nebula
#

Yeah

heavy iris
#

idk if I'll just take its position to search for the sprite, and modify relevant values if the IsoGridSquare class

#

or if loaded sprites are stored in here

quiet nebula
#

It has a crapton of information, that's for sure 😛

shy radish
#

TIL Zomboid has a debug mode. This would of made this last few days of my life easier. Rip.

heavy iris
#

no, I mean sprites from tilesheets

#

thats the point ^^

#

I really need to look just for the sprite, because I wanna use custom tilesheets

quiet nebula
#

Also, F11 to 'continue' on a break.

#

You can have it reload the file after a change and then press F11 to run the code again

heavy iris
shy radish
#

I love this community. You guys are always so helpful

quiet nebula
#

Yeah, but it's not clear that that's what you need to do

#

At least, I couldn't find it anywhere

lusty nebula
#

In the main folder of the game there's a JSON file named " ProjectZomboid64 ". Can be the Xmx3072m value increased to, let's say, half of my available RAM safely? ( Something like Xmx8072m )

quiet nebula
#

Yeah, 8192 should be fine

lusty nebula
#

perfect thanks mate

heavy iris
#

I did 8g and I hope it works ^^

#

yeah

lusty nebula
#

I have 16 GB RAM in total so your value should fit well

#

Yeah I've read it but I wasn't unsure if it was yet another bullshit written by some geek LOOL 😄

#

...better ask before burning the PC LOOL 😄

#

ah ok good to know...so I have to edit both 64 and 32? ( I'm running win 64 )

#

ok perfect 😉

#

not, in fact 😄

heavy iris
#

Ho, wasnt expecting that but you are right Oo

#

when I place a custom tile, it create a dummy isoObject with that sprite

lusty nebula
#

today I've tried the game in 4K res but I think I need a new pair of glasses to play at that res LOOL 😄

#

yep but the UI is the last of my problems..in 4K res changes also the distance at which you can zoom toward the character...a little bit too less for my taste ( or maybe I'm too much accustomed to the HD res )

#

I guess that if run the mall map in 4K the PC will take fire LOOL 😄

heavy iris
#

So, say if I change some values of this isoObject that is created, couldnt I just do it only once (OnloadedTileDefinitions), so that the script dont run everytime the square is loaded?

lusty nebula
#

Ok guys many thanks for the help see ya later or the next time! S!

cunning canyon
#

Oh jeez I really need to include that huh

#

It’s been crunch time at work so I’ve been swamped

#

Makes sense, yeah it should just send the keys localization uses

heavy iris
#

Thanks a lot !
If I follow you correctly on the game load part, isoObject's modification I would do are permanent across saves, so I should add this feature to avoir even more loadings right?

#

so I coumd even do it OnGameStart ?

#

ho wait no

#

theoretically, if I had access to information of all the map, without loading all the cells, I could do it OnGameStart, scanning all isoObjects on map and checking their sprite. is that correct?

#

ok

#

yeha, but was thinking all the information I need is in the .lot

#

(and its two friends)

gilded hawk
#

I'm getting this error, does anyone know why? This is supposed to work

ERROR: General     , 1659567532343> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: getTemperature: Expected a method call but got a function call. Correct syntax: float obj:getTemperature()
 at MethodArguments.assertValid line:123.
ERROR: General     , 1659567532343> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: getTemperature: Expected a method call but got a function call. Correct syntax: float obj:getTemperature()

    at se.krka.kahlua.integration.expose.MethodArguments.assertValid(MethodArguments.java:123)
    at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:186)
    at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
    at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)

My code:

local spawnedItem = player:getInventory():AddItem(_itemToUse:getFullName())

    local paramsToCheck = {
        "Temperature",
        "Insulation",
        "ConditionLowerChance",
        "StompPower",
        "RunSpeedModifier",
        "CombatSpeedModifier",
        "RemoveOnBroken",
        "CanHaveHoles",
        "WeightWet",
        "BiteDefense",
        "BulletDefense",
        "NeckProtectionModifier",
        "ScratchDefense",
        "ChanceToFall",
        "Windresistance",
        "WaterResistance",
        "AlarmSound",
        "SoundRadius",
    }

    for _, param in ipairs(paramsToCheck) do
        local getParam = "get"..param;
        local setParam = "set"..param;
        if _itemToUse[getParam] then
            print(tostring(_itemToUse[getParam]()));
        end
    end
heavy iris
#

was hoping to modify the isoObject without loading the chunk, but maybe the isoObject I want is a subSomething of the chunk, is that whas you suggest?

gilded hawk
# gilded hawk I'm getting this error, does anyone know why? This is supposed to work ``` ERRO...

I had to edit it to edit the content of the for to this

-- BloodLocation
    print('--------------paramsToCheck----------------')
    for _, param in ipairs(paramsToCheck) do
        local getParam = "get"..param;
        local setParam = "set"..param;
        if _itemToUse[getParam] then
            -- print(tostring(_itemToUse[getParam]()));
            local itemG = _itemToUse;
            SpawnedItemG = spawnedItem;
            local value = loadstring("return itemG:"..getParam.."()")();
            print(getParam..':'..tostring(value));
            print(tostring(SpawnedItemG))
            loadstring("SpawnedItemG:"..setParam.."(...)")(value);
        end
    end

But for some reason only the get works

#

Wait, so I can do print(tostring(_itemToUse[getParam](_itemToUse))); even if the original function comes from the Java?

#

🤔

#

So, it's the same as when I pass self as a first argument when I write a call back function?

#

Yeah, I get it

#

The getTemperature must be called using the :

#

So by doing _itemToUse[getParam](_itemToUse) I'm doing something like self[getParam](self) right?

#

Okay I finally get it

#

THANK YO SO MUCH loveyou loveyou loveyou

#

I went full overkill by using the loadstring facepalm

#

years of lua and i still make dumb mistakes pain

#

It was a dumb Idea

#

IndieStone devs, I have a question please

#

Why is in Clothing.java used the this.getScriptItem().getBloodClothingType() instead of the this.bloodClothingType for both getCoveredParts and getNbrOfCoveredParts

#

But isn't Clothing child of InventoryItem?

#

Yes it is

#

public class Clothing extends InventoryItem

#

ops, fixed the casing on the message too

#

Yes, but whyyyyyyyyyyyyy

#

I can't make my transmog mod work in MP now 😦

#

And this is something I wish I could do tbh

#

Clothing transmog but synced in MP too

#

I do that, but I can't edit the result of

 public ArrayList<BloodBodyPartType> getCoveredParts() {
public int getNbrOfCoveredParts() {

If these 2 functions used this.getBloodClothingType() instead of this.getScriptItem().getBloodClothingType(); then my mod would work flawlessly

#

ATM I can copy an item stats perfectly, except the BloodClothingType

#

and the BloodClothingType affect which aerea are protected

#

Like, a new script item?

#

🤔 Wouln'd that break everything?

#
TransmogCore.applyTransmogToPlayer = function ()
    local transmogTable = TransmogCore.getTransmogTable()
    local player = getPlayer();

    local inv = player:getInventory();
    for i = 0, inv:getItems():size() - 1 do
        local receiverItem = inv:getItems():get(i);
        local receiverScriptItem = receiverItem:getScriptItem()
        local receiverFullName = receiverScriptItem:getFullName()
        local canBeTransmogged = TransmogCore.canBeTransmogged(receiverItem)
        local donorFullName = transmogTable[receiverFullName]

        if receiverItem ~= nil and canBeTransmogged and donorFullName ~= nil then
            print(receiverFullName..' has to be transmogged into '..donorFullName)
            local receiverClothingAsset = receiverItem:getScriptItem():getClothingItemAsset()
            TransmogCore.addClothingItemAssetsBackup(receiverFullName, receiverClothingAsset)
            local donorScriptItem = ScriptManager.instance:getItem(donorFullName)
            local donorClothingItemAsset = donorScriptItem:getClothingItemAsset()
            receiverScriptItem:setClothingItemAsset(donorClothingItemAsset)
        end
    end

    player:resetModelNextFrame();
end
``` snippet code for refenrence
#

yeah

#

Which is why in singleplayer I can do this, by just swapping the ClothingItemAsset

#

But if making a new script item works, then this becomes way more interesting

#

At the moment, yes

#

As in the screenshot I sent, I was copying the stats of the denim trousers

#

If I can generate on the fly a new ScriptItem, I could deep clone the original ScriptItem, swap it's ClothingItemAsset and this would work 👀

#

So, I need a name,displayname,type and inventoryIcon to use createNewScriptItem

#

what about cloneItemType 🤔

#

Oh the clone might not work tho

#

Because ScriptItemInterface.cloneItemType can be called only server side 😕

#

I just tried, did not work

#
LOG  : General     , 1659571076745> Object tried to call nil in applyTransmogToItem
ERROR: General     , 1659571077348> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in applyTransmogToItem at KahluaUtil.fail line:82.
ERROR: General     , 1659571077348> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in applyTransmogToItem
    at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
    at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
    at zombie.ui.UIElement.onMouseDoubleClick(UIElement.java:1031)
    at zombie.ui.UIElement.onMouseDown(UIElement.java:922)
    at zombie.ui.UIElement.onMouseDown(UIElement.java:959)
    at zombie.ui.UIElement.onMouseDown(UIElement.java:959)
    at zombie.ui.UIElement.onMouseDown(UIElement.java:959)
    at zombie.ui.UIManager.update(UIManager.java:747)
    at zombie.GameWindow.logic(GameWindow.java:261)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:764)
    at zombie.GameWindow.run_ez(GameWindow.java:680)
    at zombie.GameWindow.mainThread(GameWindow.java:494)
    at java.base/java.lang.Thread.run(Unknown Source)

This is the error I got

#
-- createNewScriptItem
    local a = cloneItemType(receiverItem:getScriptItem():getFullName()..'_Transmogged', receiverItem:getScriptItem():getFullName())
    a:setClothingItemAsset(_itemToUse:getScriptItem():getClothingItemAsset())
    spawnedItem:setScriptItem(a)

    player:resetModelNextFrame();
    triggerEvent("OnClothingUpdated", player);
#

spawnedItem:setScratchDefense(99)

#

Yeah

#

And it's not it

#

Mah, I think it's too much coding for the night

#

I'll push this changes on my repo and check tomorrow with a fresh mind

#

IMHO, I would be happy if some of the zomboid devs just added getBloodClothingType and setBloodClothingType to Clothing.java 😅

wraith root
#

How would you normally determine if a function / class is exposed to the lua end?

#

Maybe we have a misunderstanding

#

What I mean is how is a function found to be exposed to Lua from Java

#

All functions are hard coded in Java, but where does the exposure usually make itself known so you know certain classes/functions are Lua accessible

#

Mhm

#

Maybe the global table is what I'm looking for

#

The unofficial javadoc is a bit out of date in that sense

wraith root
#

I mean pure lua is the most accessible out of the lot\

#

not exposed, just there in general;

#

so you would want that as well

#

Just looking for the exposed stuff in general

#

not as specific as the other peeps were earlier

#

semantics friend

#

good to have a reference of the exposed items so when I make some other mods I can look over the list for what I need

#

🧑‍🚀 nah I was more so wondering where in the decompile it would be

#

not overengineering something to pull the list

inland pumice
#

simply out of curiosity, has anybody made a plants vs zombies style mod for pz?

shy radish
#

Is there a way to grab a player characters profession?

#

Gotcha, tytyvm 🙂

heavy iris
#

Hey there! Question, how to know if I should put such a thing in shared or client (or server)?
`local function callback1(object, x, y)
print(object:getSprite():getName())
end

Events.OnObjectRightMouseButtonDown.Add(callback1)`

#

(point will be to do some things instead of print ofc)

thin hornet
#

but really for single player it doesnt matter unless you need to require stuff
also it just depend what you wanna do in that function

#

I usually put my events in client if its a client event, and my logic can be in shared if i need to run it on both side

#

client

local mymod = require("mymod");
mymod.func();

server

local mymod = require("mymod");
mymod.func();

shared

local mymod = {}:
function mymod.func()
  if isServer() then
    print("is mp server")
  else
    print("is client or singleplayer");
  end
end
return mymod;
heavy iris
#

First thanks a lot for that 😄

#

Actually I think I'll use Events.DoSpecialTooltip

#

but that still helps, I wanna add custom options to the UI if the clicked object has some properties

#

I guess UI making is client side, and they can send command to server? Like creating an isoObject somewhere?

thin hornet
#

Yeah

#

you can send commands

heavy iris
#

and you know if creating an isoObject is to be done server side, or we dont care?

thin hornet
#

in singleplayer you can use SendClientCommand() but in singleplayer SendServerCommand() will do nothing

#

you can create the IsoObject on the client

heavy iris
#

is there a general rule of thumb for what's server and client, or I'll have to dig everytime ? ^^

thin hornet
#

client

local newObject = IsoObject.new(square, sprite);
square:AddSpecialObject(newObject);
newObject:transmitCompleteItemToServer(); -- this transmit to server
heavy iris
#

and btw, your basemod took good part of my day today ^^ read about how require works to understand it, thats awesome how you use it thanks for sharing that

#

ok super

#

thanks a lot

thin hornet
#

😄

#

glad it helped

heavy iris
#

transmitCompleteItemToServer();is vannilla or its one of yours? 😄

thin hornet
#

its vanilla

#

part of IsoObject

#

create a new object (nothing special here, its no where to be found in the game yet)

local newObject = IsoObject.new(square, sprite);

now we add it to our square locally

square:AddSpecialObject(newObject);

now we tell everything about it to the server and all client get it after

newObject:transmitCompleteItemToServer();
heavy iris
#

making these first pieces of mods discovering lua was like... digging a biiig hole for, in the end, using very simple methods that I hope to glue with your require server setup

#

this I can read thanks 🙂

#

I'm just not used to

#

functions that can have many arguments and we dont care

#

well functionnal expressions in general

thin hornet
#

The vanilla lua code is mostly globals, which make things simpler to mod, since we do not have to require everything all the time.
But mods should really not use globals and have a require stucture

heavy iris
#

yeah now that I understand how require works, with the loaded.modules thing, I think too

thin hornet
#

its a super simple require structure.
you can even overwrite stuff after requiring it

heavy iris
#

yeah thats what I struggled to understand

#

the first value returned is stored in a mutable object

thin hornet
#

each lua file is loaded and stored in some sort of cache with the "result" last return.

heavy iris
thin hornet
#

each lua, is interpreted independantly

#

when the game reload lua

#

so imagine you have 2 script one set a global and the other one use the global, but the second one run first somehow, then that global not set yet right

#

so instead you have both file return what you want and require it, so if the second file load first well no biggie the require will force it to load the other first

heavy iris
#

but dofile would do it also no?

#

like server = dofile("MyModData\Server")

#

without keeping the result as mutable

thin hornet
#

i honestly never used dofile in pz modding

heavy iris
thin hornet
#

not sure if that is even a thing for the kahlua in pz i dont see any reference to it in the sources

heavy iris
#

one of today's stuff 😄

#

fileA create a class, fileB require it and add 4 to fileA.A (noted x.A here)

#

fileC adds 9..

thin hornet
#

so dofile is like require but it doesnt keep the result in store?

heavy iris
#

(we dont care adding numbers but that helped when I tried to use multiple times requires ("fileA")

#

yes

#

thats what I get

#

you can do dofile(fileA) twice

thin hornet
#

not sure why id use that tho lol

heavy iris
#

it will launch it twice like launched from vanilla

#

well

#

for me that didnt knew require

#

dofile was my basic way of thinking "calling a file"

thin hornet
#

ahhh

heavy iris
#

^^

polar gyro
crimson dragon
#

looking at your google doc and how the points are calculated leads me to think the desensitized trait is worth 2 points. with that being the case, how many points would you say bloodlust would be?

polar gyro
# crimson dragon looking at your google doc and how the points are calculated leads me to think t...

Desensitized very very very strong trait and should cost a lot. In mod its veteran exclusive and cost 8 points for it.
Bloodlust? Its heavily dependents on values. I need to know how it will work in game. If every dead zombie will reduce unhappiness more than 20, its veeeery strong and should cost at least 4.
For begining you need to find maincreationmethod file in media/lua/shared/npcs
Search for Soldier string

#

Just inspect file. Its pretty clean and understandably

crimson dragon
polar gyro
crimson dragon
#

when i make the Marine occupation i plan on adding both desensitized and bloodlust but want to make sure the points are balanced so im trying to figure out how much theyll cost

#

ah

#

so if i want Desensitized, Bloodlust, +3 Aim, +2 Reload, +2 Nimble, +1 Strength and +1 Fitness it should be at -33, yikes

#

maybe ill take out the strength and fitness as that will bring it down to -27, still quite pricey

#

are there other ways to balance an occupation besides trait points?

crimson dragon
#

going back to what you said about bloodlust, i dont plan on changing the values Peppercat has as i have no clue as to how the balance is. this is what the file says

polar gyro
#

You can make your cost for your occupation

#

You don't have to follow any guidelines

crimson dragon
#

ill be using it in mp with friends so i want it to be balanced with the other occupations

polar gyro
# crimson dragon

If you want to grab whole code i think you should ask permission from author at least

crimson dragon
#

they havent explicitly said it needs to be but i think its only right

crimson dragon
crimson dragon
#

at this point im a blind man funbling around for the lightswitch

#

once i turn on the light and figure out what im doing is within my ability, then perms then creation

#

when i say i have no clue how to make a mod, i mean no clue lol

polar gyro
#

Just learn code, try more

#

And you will get it

#

When i start making pz mods i have almost no idea about coding

wraith root
crimson dragon
#

@worldly olive might as well ping you now to ask permission as idk how long it will be until you can see this. i would like to use the bloodlust code from your Dynamic Traits mod to create my own mod for a specific occupation. i dont plan to upload it for public use but that is within the realm of possibility and either way you would get full credit for your source code. same for @polar gyro since the occupation im going to attempt to make will be a modification of their soldier occupation

#

ive never had to ask for perms so if i didnt do it right do let me know

polar gyro
#

I could try to make base for you

crimson dragon
#

frankly, the more i look at this the more im willing to pay for this to be done lol

#

its interesting to figure out but the more i figure out the more i realize how indepth this is likely to be

polar gyro
#

Gimme some time

crimson dragon
#

i thought this would be closer to modifying the names and numbers within one text document then finding my own images to use. now its looking more like 6-9 text documents cross referencing each other

dapper geode
#

Hello, I wanted to ask about scripting but couldn't find the channel, so I think this is the place.
I have a problem where the recipe's onCreate function is not found in my lua script, even though in the media/lua/server folder, I already have a lua file that contains the Recipe.OnCreate function, is there something wrong?

crimson dragon
# polar gyro Gimme some time

no rush, once im done messing with this im off to bed. got work in the morning. just wanted to start looking at things tonight. youll probably get more done in an hour than i would in a week so take your time

polar gyro
#

@crimson dragon bloodlust will make you sad if not killing zombies or just positive side?

crimson dragon
#

both positive and negative

#

sad and stressed

polar gyro
#

That's harder ok

crimson dragon
#

part of it is balance, part of it is to force me to go out more as ive noticed once i start doing stuff around the base i can spend days in game doing nothing but that

#

if im going to choose a combat style character i should go do that lol

shadow geyser
dapper geode
# shadow geyser could you show the code snippets of the function and the recipe? maybe there is ...

This is code from lua/server:

function Recipe.OnCreate.TeleportToNPC(items, result, player)
    print("teleport from s_teleport.lua")
    sendServerCommand(player, "Event_Teleporter", "Teleport_Player", { 12449,3043,1})
end

and here's the recipe scripts

module Base
{    
    recipe Teleport to NPC
    {
        keep TeleporterRed,
        Time:45.0,
        Sound:Teleport,
        Result:CreditCard,

        CanBeDoneFromFloor:true,
        RemoveResultItem:true,
        OnCreate:Recipe.OnCreate.TeleportToNPC,
    }
}
shadow geyser
dapper geode
shadow geyser
#

sure but does the function work in the game?

#

there are alot of erroneous message that show up sometimes, but if it is working in game and in MP, no need to bang you head against the wall about it imo

eternal garnet
#

Looking for a artist who can replicate the PZ style for custom Occupations.

I have my own outlined versions, they just need re-doing

dapper geode
shadow geyser
#

is your mod already on workshop? maybe will be easier if I can see everything

dapper geode
#

I test it on SP

dapper geode
shadow geyser
#

can you show a ss of the file structure for the mod? maybe there is an issue with the folders

dapper geode
#

Makes sense, especially for me just trying scripting in PZ.

dapper geode
#

Now the code is running, but I'm still trying to understand why sendServerCommand didn't run the command on clientsside successfully.

shadow geyser
#

have you already uploaded it into workshop? make sure you aren't also subscribed to it. If you have a copy of the mod from steam, and the one in your workshop folder where you upload it, it may be loading the wrong files

dapper geode
#

oh my god i just realized -_-

shadow geyser
#

the server side stuff still runs. Im not sure what you mean by the server not existing

dapper geode
#

Thanks a lot for the advice, I'm currently downloading a Dedicated Server from steam to do a test run.

shadow geyser
#

hm ive never tried it that way around. most my stuff sends from client to the server.

#

that stuff still works in SP, just assumed that the server was just running locally, and accessible in SP

dapper geode
#

So I just have to restart the server when making changes to the code?

#

And do not have to go in and out of the PZ Client?

dapper geode
#

Okay I've managed to run the server, and logged into it, but still sendServerCommand is not running properly.

#

server:

function Recipe.OnCreate.TeleportToNPC(items, result, player)
    local inv = player:getInventory();
    inv:AddItem("Base.WoodenStick");

    print("teleported from s_teleport.lua")
    sendServerCommand(player, "Event_Teleporter", "Teleport_Player", { 12449, 3043 })
end

client:

if not isClient() then return end
local Commands = {}
Commands.Event_Teleporter = {}

Commands.Event_Teleporter.Teleport_Player = function(arguments)
    print(arguments[0])
    print(arguments[1])
    local pos = arguments[0]
    local cellPosX = pos[1]
    local cellPosY = pos[2]
    print("X", cellPosX, " Y", cellPosY)
    local player = getPlayer()
    player:setX(cellPosX)
    player:setY(cellPosY)
    player:setZ(0)
    player:setLx(cellPosX)
    player:setLy(cellPosY)
    player:setLz(0)
end

local function OnServerCommand(module, command, arguments)
    print("c_teleport.lua => onServerCommand Running 1")
    if Commands[module] and Commands[module][command] then
        Commands[module][command](arguments)
        print("c_teleport.lua => onServerCommand Running 2")
    end
end

Events.OnServerCommand.Add(OnServerCommand)
#

So sendServerCommand doesn't give any output, it should give at least "c_teleport.lua => onServerCommand Running 1" output to tell if the event was successfully triggered

#

So there are no errors in the logs at all, it's just that events on the client don't run at all.

#

Make it like this?
sendServerCommand("Event_Teleporter", "Teleport_Player", { 12449, 3043 })

quiet nebula
#

Is zombie:getModData() no longer a thing? I found this in a mod and thought it seemed very useful for applying mod metadata to an object in the game.

dapper geode
#

Still the same, no output "c_teleport.lua => onServerCommand Running 1" after sendServerCommand

#

Okay, but still no output received on client

#

It's loaded, and printed on my console log

quiet nebula
#

Does anyone know if and how I can access IsoObject.getModData() in lua? Simply zombie:getModData() only results in an error

dapper geode
#

Yes, no error with 'sendServerCommand'

quiet nebula
dapper geode
#

I run the server via host button on main menu, because the server script shutdown by itself

#

So I can see my client log from game, but I've to check the server log from Zomboid folder

#

Okay, now I'm also confused as to why it happened, you are right, the output should not appear in the client.

#

Using recipe onCreate

#

Like this

#

I put the onCreate function on clientside, but now its error

#

When I startup the server, and logged into it, That things showed up and I can't enter the game, looks like OnCreate doesn't suppose to be on clientside, because its running well on serverside, just the sendServerCommand that doesnt run

quiet nebula
#

Something like this should be possible, right?
local specialZombieStats = require("SpecialZombies/Types/" .. type);

#

require with a variable?

#
    stats = {
        health = 2,
        speed = 0.4
    }
};

return Shrieker;```
#

It has one

#

Then again, I'm not sure if the require is the issue...

#

What do you mean a single value?

#

Ohh...

#

Weird

#

Lol

#

Does that return as a table/array?

#

Aha okay

#

Also, do you see anything strange about this function?

    local specialZombieStats = require("SpecialZombies/Types/" .. type);

    zombie:say("HP: " .. specialZombieStats.health, 1.0, 1.0, 1.0, UIFont.Dialogue, 30.0, "default");

    Manager.types[type] = specialZombieStats;
end```
#

It seems to break on the first line (the function name itself)

#

But I'm having a hard time figuring out what might be wrong on that first line

#

Ohh

#

I misread

#

I thought it was breaking there

#

It's not, I'm just a dumbhead ^^;

#

Sorry for wasting your time

#

It was the specialZombieStats.health that was nil/null

#

And I just didn't read properly

lusty nebula
#

yep it's just a placeholder so far

#

LMAO 😄

quiet nebula
#

Does a for loop call a function?

        counter = counter + weight;

        if counter > roll then
            return type;
        end
    end```
lusty nebula
#

Gorilla warfare is dangerous you need Chuck Norris for that LOL 😄

quiet nebula
#

It breaks on the start of the for loop

#

Yeah

#

But I can't seem to get the lua manager to pick up any changes to my code now for some reason...

#

I've returned at the top of the function and it's still giving me the error

#

Ah, yeah, they're not sequential

#

Okay, thank you, I'll add that then 🙂

#

I didn't know about that one!

#

It has worked so far

#

But now it stopped working...

#

Guess I'll have to 😛

#

Ohh

#

It's probably because of the requires, which still have an old instance of the table in their memory

#

I see

#

Yeah, figures

#

Thanks 🙂

#

Hahaha

#

Fair, thanks 🙂

#

Gotta catch em all!

#

What even 😛

#

Is this like missing a closing curly bracket?

lusty nebula
quiet nebula
#

I thought this was a channel for discussing modding, not mods ^^;

lusty nebula
#

@quiet nebula Sure it is but from time to time is also nice to share what we're working on during our modding times LOOL 😄 😉

quiet nebula
#

I see, was just a bit much in terms of image spam, I'm all for sharing work 😛

#

But if it bumps everything out of view, that may be a bit much

#

This is the correct way to check multiple conditions in a if-statement, right?
if modData.ZombieVariety.applySpecial and not modData.ZombieVariety.applied then
I'm trying to find the unterminated scope, but I can't find any if statements or functions that don't have an end 😛

#

I put a return before it, but even then, it has an end on it. I'll remove the returns and try again

#

I'll have to restart ^^;

#
        counter = counter + weight;

        if counter > roll then
            return type;
        end
    end```It has openings and closings for both scopes
#

It's been burned into me 😛

#

I've almost exclusively worked on programming languages that require them

#

So I automatically add them

#

To each their own ^^;

lusty nebula
#

Edited...Now should be better damned picky modders LOOL 😄

quiet nebula
#

lol

#

Fair, I could save on literally tens of bytes ;P

#

I... see

#

So the code becomes less readable with semicolons?

#

lol, okay

icy swan
#

Quick question, how soon are animals like horses coming in? I started working on a horse mod and I dont wanna keep going if its gunna come out on the core game soon

lusty nebula
#

Guys something maybe stupid but...If in my mod I need to add a folder but from the " Users " one do I need to use this folder's structure?
Sample: Zomboid --> mods --> Files of interest
or a different one?

#

Asking because normally the standard folder for mods is " Media " so I'm unsure