#mod_development
1 messages · Page 83 of 1
I just love minimalist huds whether I feel subjectively immersed or not
I don't really love seeing stuff I don't feel I need, generally.
same
Would rather take in the scenery
but it also depends on the game
but i do agree, keep it to the minimum needed and dont flood the screen with to much crap
Fair... I have played several games hudless that most people probably wouldn't play hudless, but I loved them for letting me
Odyssey e.g.
Sekiro
yup, rather have the choice to and not use it than not having a choice at all. not everyone enjoys things the same way
sekiro no hud?
Just feels different in a good way to have everything off
crazy dude 😄
And yes ESPECIALLY Sekiro no hud
God that game was so much more fun without a hud
I also did not let myself rez
I save scum reloaded to avoid using the I-didn't-really-die mechanic
Killed every boss with 1 life
It was definitely among the hardest things I've tried in gaming lol
But worth it
It just made me appreciate the rhythm of that game so much
They really do give you the ability to never get hit and apply constant pressure if you move right
It really is the secret to every boss
well its kinda my aproach with pz... if my char dies... new save
So I would just... do that.
My health was not relevant if they couldn't hit me very often.
dont enjoy just making a new char and have all setup by the char who died
if i die, new game
plus the fun in pz for me at least its the initial struggle to get the things you need to survive
after that... meh
Totally fair. I do not have a respawn mod for PZ lol but I do ❤️ Skill Recovery Journal
I haven't gotten far in the game tbh (got so sucked into modding I barely play lmao)
But if I did, I would not want to reread 400 books
i have around 5k hours
i reckon 1k were spent just modding
I'd rather just... find my old zombified self and read his journal
well from that point of view, yeah
I have over 1k since buying game and almost all of them are modding.
it makes some sense... someone survived a while then died, another survivor finds his journal and learns from it
Exactly I like that mechanic a lot
Some people wouldn't
They want to truly "start over"
In the game's sense of working through the grind again
No thanks
but i will still know where my weapons are, car etc... but maybe if used along with pillows random spawn mod
I don't mind getting a new safehouse, getting new gear etc.
hmmm
But the skill grind is such tedium to me
I prefer when games focus on making your skills the important grind
yeah... i mostly grind combat skills and the minimum for every other skill
I mean like... yours... as a human being
just enough to be able to make what i need
Not your character's
I prefer when my personal knowledge and ability is the only limit on my play tbh. And physical resources are okay.
i think i never got carpentry higher then 6
But RPG mechanics can just go die afaic
lmao and I grew up loving RPGs but now I just hate how their mechanics have invaded every other gametype and made them imo worse for it
its hard to find a decent rpg
i still find myself playing some of the old school 2d rpg
mostly jrpg's
An RPG needs a good story to justify its pacing and such. A VERY good story.
A game with virtually no story does not need gd RPG mechanic pacing
lmao
any game needs a good story... and in the present most of the games focus more on graphics and less on story
I realize these are just my opinions but damn it I have them lol
opinions are just that, your personal point of view... it doesnt matter it others agree or not, as long as it trully your opinion
That's fair. I don't necessarily need every game to have a story. Stories always add value to a game, but not what I would call necessary value. Battlers and shooters and such I often play for years with no concern for story. The fun of the gameplay loop is all.
yeah but those "fast food" games
like grab the controller, have some fun and move on
come back later and play it again some more fun move on
True, but some fast food games are fun for longer than any story game with the right friends in my experience.
The best story is over in 200 hours tops afaik
fast food doesnt mean it has to be bad food
A great multiplayer that your people never stop playing can last countless hours
lol fair enough, I think bad when I think fast food.
I should get back into that. That was fun for awhile but I got pulled into something else
i have 3 games that make me lose track of time when playing them: pz, dead cells and rimworld
Quick question about vanilla... player A trades with B using context... A cancels trade... does the trade window offering trade remain for B?
@ anyone
From what I messed with the window gets blocked on their end.
'player A cancelled trade'
Ah let me see
A tinted screen is drawn - the window becomes disabled
@sour island sorry about bothering with the dm, just giving you a heads up that an idiot was messing with your mod
and it actually works... so far....
Hm?
Hmm I must have messed something up
Working on adding gamepad support to it XD
Have cancel trade working for offerer
lol
I hate discords new DM handling
i sent you a dm b4 going to sleep... was thing about using your functions like i told you to call the events, but ended up just messing with the table
I didn't even see it lol
I haven't had a chance to mess with EHE yet
There's a way to schedule events and there's a way to launch them
That's fine as long as the entries make sense
someting event(id)
or the get free heli something?
i think modifying the table is better... dunno might be wrong so far it works fine
i can call them from my twitch chat rewards
You can use H = eHelicopter:new()
H:launch()
no error
Can anyone clarify how to add an admin user on a server while hosting in -nosteam specifically?
yeah ... it can mess things up... my previous mod used the debug commands..
not a very good idea...
In chat window -- '/setaccesslevel "characterUsernameWithQuotes" admin'
Ah in the chat window interesting... does it save their admin status by username for future connections?
No for some reason
I think it involves the debug mode not saving perhaps
Hm weird
Hosts have some admin powers by default
Idk why it's not just given entirely
You can try to set access outside of debug to see if it works
debug mode is sluggish sometimes... at least for me
There shouldn't have been any issues using those except for the fact it requires debug probably
You can just rip what is inside of them either way
i think ill go with the table modify from my mod... makes things a lot easier for me since i can just send the presets from the app
👍
and send everything to my mod in on json string
one
so most of the logic is done outside the game
I'll have to put in some checks - I added that error you got to the GitHub
that error was me doing something stupid in the lua interpreter ingame
dont remember what i exactly did
Currently trying to solve why connected clients don't hear my specially handled loops
but i was messing around with event ids or something
Hmmm doesn't seem to work for allowing people to connect with -debug
i think i triggered a non existing event
Seems like you passed a nil as presetID or the presetID didn't have a matching sandbox option
now that i think about it... typed the wrong number or something
You can't connect with debug unless you're admin or the host
Alas, I set the connector to be an Admin by the username with which they are trying to connect, but that doesn't seem to work on Nosteam
Connector's name: "Pete"
Command: /setaccesslevel "Pete" admin
I also did it to myself, and that worked in-game
Using debug host to set self as admin
yup i was triggering an event manually
But setting Pete admin and then trying to join as debug was no good.
called event id 20, and i wanted to call 2...
The server just doesn't see Pete like that.
never messed around in server on debug mode.
i usually use my renteded vm for testing stuff in server
rented
You don't need a separate machine to test server, you can run it locally
You also don't need to install the dedicated server files, the regular game has everything included
i know, but i have the resources to do so, so why not use them?
plus i get to mess around in linux a bit
Local server is as convenient as it gets for me
@sour island It's cool I'll just copy a local copy of ModOptions and use that to do what I wanted.
Thanks though.
im not always at home so that way even if i have my shitty laptop i can still mess around with the server
ok, everything works...
time to clean up the code and make the github public
What could cause getRadioText to fail on a dedicated server?
Adding my own lines to AEBS channel. Works fine on SP. On dedi it just shows the raw translation string.
Workaround: if getCore():isDedicated() is true. Bypass translations and just send the english text instead of calling getRadioText.
Was just doing the same today 🤣
Somehow made it broken then had to fix it again lmao
So you can see the line on your end when it gets added and sent but if you're on a dedicated server what does it show exactly?
I'm just throwing shit and seeing if it sticks but if it's an issue between it working on sp and not on multiplayer could it be that some of that is client based and some is server based?
On the dedicated server it doesn't convert to the actual translation string. It just shows the AEBS_MyModTranslationString.
hey what is separtor for modules ?
Ola, friends! Can you please help me? I am having troubles to find anything that can open .pack file from one of the PZ mods. I want to slightly tune mod textures, but can't unpack .pack file. Tried everything i could find: TileZed, UnPacker.jar and etc. no success. I'm kindly asking for your help
Have you tried renaming as .zip and unzipping with 7zip? Google suggests that may work.
Yes, sir. With no success
3 votes and 6 comments so far on Reddit
Have you explored that post?
Seems p recent
Covers unpacking and repacking
Yeah, thank you. Nothing from that post is working for me, TileZed including. For some reason an attempt to open the file just freezes the program solid
Hmm yeah I've never done it so I'm not sure about details of troubleshooting
Good morning.
HI question when 42 coming out? me nd a freind are wondering for chickens
Is there a way to make a clothing item be wearable but not have a world model on your player?
I think you can just delete the ClothingItem property on the script entry and it won't have an effect on your character's visual appearance.
You know what makes an item „wearable“, what parameter does that in the .txt file?
Type = Clothing
and
BodyLocation = [Something]
Morning
Not CanBeEquiped?
That's for bags
Ok but when i just put CanBeEquipped without anything else it wont render a model right?
@sour island sir
Shops and trade mod converts stuff with random values
Nvm im mistaken i got confused with what the client was telling me
I mean ots randomized right?
how can i add receipt of item what request items from other mod ?
due that
recipe Make Bomb of Watermelon
{
keep MeatCleaver,
Watermelon_from_mod,
Dynamite,
Result:WatermelonBomb,
Time:50.0,
...
...
}
make that
Hello, should a context menu close after its function is run, correct?
I mean, automatically
That's what happens to mine upon being clicked
Just add the module
Ye unless its something like walkto
It will never disapear
module Base
imports
{
mod1
}
{
``` well that have on top
mhh strange, doesn't happen in my case
even with nested context menus?
Thats import but yeh it does the same thing
If you imported it then you dont nees to add the module everytime u mention the item
But if its base then u wont have a problem
All good, appreciate the testing 👍
Lyoi are missing an opening bracket
😅 i didnt. Anyways you know that shop mod with green atm?
Its giving random money
Ill check who the author is
Trying to figure out what decides where the sound location is being put in game and its radius. It's in a lua file right? Something like playSound(x, y, sound, radius) etc
query: is there a guide on creating zombies with custom outfits and inventories?
problem is mods not add to BASE but to own modules that items
so it looks like
module Base
imports
{
Mod1
Mod2
}
{
but problem starts happen when mod is loaded before those mods and upper errors show that + also TABS for those mod not showing
but if move mod on button after those
they works normal but that mod is not working due nothing show
module YouModile {
imports {
Base
Mod1
Mod2
}
}
Its not formatted in using mobile but check out the brackets
@viral notch do you see the bracket that im telling u
you can also just use Module.Item when referencing the item instead of importing the module wholesale
you added twice } after import and that close Main module
tried and failed
recipe Make Bomb of Watermelon
{
keep MeatCleaver,
Mod1.Watermelon_from_mod,
Mod2.Dynamite,
Result:WatermelonBomb,
Time:50.0,
...
...
}
I do this
module Base {
sound{}
recipe{}
model{}
}
module MyMod { imports { Base Mod1 Mod2 }
item{}
item{}
}
Yep if u dont import u do that
Import is sorta the require but script txt version
well but that is recipe and you have that before imports ...
In such a way but not totally similar
yeah i need that in txt file
U can move the tecipe
It really doesnt matter
Im just showing an example
If you are only using 1 itrm of a mod then dont import it
Do what albion said
It will work
that make errors
If it doesnt work
Then fix the brackets or your syntax
U can post here your script after you are done so we can advice u further if u need
module MyMod
{
imports
{
Base,
Mod1,
Mod2,
}
recipe Make Bomb of Watermelon
{
keep MeatCleaver,
Mod1.Watermelon_from_mod,
Mod2.Dynamite,
Result:WatermelonBomb,
Time:50.0,
Category:Weapon,
}
}
Put the commas in the imports after the modules named, that works for me
Thats not required but sure
U imported so u dont need to add the module on the recipe but u can leave it . Cuz its not gona cause errors
Of you are using drainables you should
Put =1 or whatver amt after
Or
destroy
These are a few things that confused me before
Random money? Like base.money?
Nah i think
Im really confused with what he ment
``the ATM mod allows jewelry to be exchanged for the vanilla money item.
Shops and traders changes the vanilla money item though.
That creates a problem where the value of the money item is always different when exchanging them at the ATM.
so one time I will get 7$ for a diamond ring and then 23$ for the same item
thats all I want. A version where the value you get back is always the same and you only get base.money and not the penny item that the ATM mod also adds``
Thats what he said
like here it is 9.65$. But the next time you exchange something it might be 16$ or 2$
So im having the current problem on a server: i set up a var in an isoThumpable‘s moddata and based on it i either lock it with a padlock or remove the lock. But it has occurred that the variable is set to lock but its not locked with a lock. Is it a problem with syncing the object?
Use chucks container api
Hmm how do i use it?
@sour island imight build another atm mod but make it compat with your shops moddata
Mind sharing what i should name the vars
Uh - I have a WIP faction banking thing for it - no ATM UI tho - just a simple input window
The code for it is on GitHub
I use 2-3 global modData lists
Just listed it
where can found source file with OnGiveXP:Recipe.OnGiveXP
Whats the difference with shops compare to this.? My client specifically mentioned your mod and the atm mod
Doesnt your ide allow you to search all the files?
my what?
windows expoler ... nope
Ide
IDE = Integrated Development Enviroment.. Like what do you use for coding? Visual Studio, Visual Code, some sort of text editor with IDE capabilities like Notepad++, Sublime, etc....
im using notepad++
it request to open whole fodelr with media to found it and that can hang my pc
yeah i dont have so much ram xD
I would suggest a proper IDE, or at least a better text editor. I use Visual Studio for heavier stuff, and Sublime Text for small stuff. Even sublime can open a folder as a project, and search within it rather fast..
To answer that question though, it's in the recipecode lua file
Loook for konijimas guides
#mod_development message
Which it looks like the d00der above me just said as well lolz
is not that file
The faction banking creates a separate account faction members can use
I got commissioned to make it
With the intention of supporting the shops mod
It is; I've done modifications to literally that exact function before, for several mods I made.
TFU it is that file (my bad) but without that what i need...
thx for that but not sure how can i add for farming...
But yeah. Like i said their server specifically wants your first shop mod
Which is perfect . Its just that the atm he uses has a problem so he wanted me to make one and while this doesnt require me to make it compat with your
Mod
I still prefer to do so cuz why the hell not
Do you just want to add additional XP for farming tasks that already have XP given, or you want to add XP to things that don't already give it
second one
Yep ill check tommorow
Just asking cuz u might remember
So does it store individual money on the player via moddata?
You don't need to import mods for recipes as long as the server is also running the required mod. You also don't need to put the module in it either.
Right... So when do you need to out them?
The repo should be open now
It saves it on a new global modData list
Tied to factions directly
Ye but this is the faction repo tho
That's wicked easy then; you create a new function to do so; I generally follow the same format the vanilla files do, and simply make a copy of the function I want to replicate, change the name, change the Perk type it targets, and change the amount of XP it gives for that perk. Then in the recipe, you call that function on the OnGiveXP event.
Is it the same mod as the first mod? I thought they are diffrent
Ah so faction banking requires the shop and trades mod
Im not sure if they will include that
🤷♂️
I thought that's what you were asking for
Banking that works with the shops mod
thx
Hey gang 2 super basic questions that I'm just not understanding from examples. If I want to get the local client's player, how do I do that without hooking into an event that returns the player? Similar problem with the context menu, I want to get the context menu without hooking into an event. Right now I'm getting them through events but, as I only need access one time, that makes for a lot of unnecessary calls over time. Any tips?
you can use getPlayer() to grab the player
Hi. Can anyone give me a link reference to a latest modding guide/tutorial ?
I'm a bit blind with lua, is that an extension of anything or can I just call it out of nowhere like that?
you can just call it out of nowhere
It's a global command
it's part of the global object
amazing, thank you!
https://github.com/FWolfe/Zomboid-Modding-Guide
Is this guide/code structure upto latest?
So i added new lua file to dynamic traits mod and i'm getting this message while trying to load server i'm hosting by myself, is disabling anticheat solution for that?
it's server hosted by "host" in main menu, not by dedicated server
As for the other portion, which context menu? There's multiple.
And I don't think you can access it outside of an event because it doesn't exist until its built by the functions that eventually call the events that you are probably hooking into, like OnFillInventoryObjectContextMenu.
You could decorate the ContextMenu functions... but that'd pretty much be the same effect as using the events in most cases.
Whoops good point, I'm adding an option to every context menu to open a ui panel if it's closed. But if the menu doesn't exist until the event is called anyways, suppose I'll just leave it! Thanks
it technically does always exist, but yeah, the events are intended for that very kind of use
I guess it just keeps the last instance around then as hidden stale data until it gets reset on the next call?
i'm not sure of the exact specifics, but the context menu is created when the player is
What are the advantages of using either moddata or saving a file to save data?
I've learnt how to save a json file (mostly) to save data, looking to learn how to use moddata as well
Sounds like since you're not using the complexities of encoding decoding a json file it would be easier to store variables into moddata
moddata is way easier
Hi, what function i can create a confirmation box ?
I just read something online, it's basically storing variables into a lua table with keys in the mod itself, so if you get the player, you can get the variables you saved for him?
the only times i've used json were because i specifically wanted a json file (to be used externally), and one very niche case where i needed some data before global mod data loads
Yeah that's why I wanted to learn to use it, to read and modify it irl
But I assume not everyone will want to modify a json file in the server files to change something so it will be easier to learn to use moddata for admins to change values
Like a UI confirmation box?
the syntax is (any IsoObject derivative, and probably some others):getModData()
Yes UI Confirmation box
beginners always seem scared of it and make a lot of assumptions about weirdly strict syntax, but it literally just returns a normal lua table
To my knowledge you will create a function to call the UI, add an event handler that calls that function, create a lua file with the UI and done
same with ModData.getOrCreate('ModName') , which is for mod data that doesn't belong to any specific object
But I think the hard part will be making the UI if you're not familiar with it
what specific package/function to call the ui
local showMoney = showMoney:new()
showMoney:initialise();
showMoney:addToUIManager();
This is an example of how to call it to open. showMoney:new, in there showMoney is the name of the UI found in your UI file
I'll copy an excerpt from the UI file as well as an examlle
showMoney = ISPanel:derive("showMoney");
The beginning of your UI file for example
If you want to see a full example of the UI file I can send you one of my own or a guide I was following
I've tried to steer well clear of UI as much as I can so I don't have much UI know-how, but couldn't they use ISModalDialog as is?
It's a Yes/No dialog box already created by the game.
Can you send me the simple ui file ?
No clue, I only learnt to do it this way for now, I'd defer to you for that
Sounds better tbh
Here's a guide I followed how to make it
Check out the mod library "simple ui," it can do this really easily and even has premade examples you can adapt to your purposes
Thank you for the link!
Did you delete the message? lol
anxiety, dont mind me 😦
I'm about to ask if it's better than testing on Dedicated Server?
Do you mean like paying for one or? I only learnt of this method for now
Oh yeah I thought you read my thing already, no it's that. Just downloading the server tools, launching the ded server and logging in with two clients at the same time
@drifting ore thank you for sharing and reminding me that there are these guides available on GitHub. I need to refresh my memory since I haven't been active for 4 months 😹
no worries, 🙂 love to help 😄
🌲🌲🌲
🌲🌲🌲
Hi. is this a bug ? im on the scenario,testing my simple mod, but then pressing ESC does not open the menu (QUIT, QUIT TO DESKTOP etc.)
try F11
or open MAP
and close it
then hit esc
where can found icons for clouts ?
Does anyone know how to assign an icon to an item via lua coding? I tried the setIcon command from here https://zomboid-javadoc.com/41.65/zombie/scripting/objects/Item.html#setIcon(java.lang.String) but didn't work for me so far.
Javadoc Project Zomboid Modding API declaration: package: zombie.scripting.objects, class: Item
I tried the following variants: item:setIcon("myIcon") and item:setIcon("Item_myIcon.png") but without success. Console shows the error "Object tried to call nil".
https://projectzomboid.com/modding/zombie/inventory/types/HandWeapon.html
which one i can check weapon if its a gun or not ? maybe the type ?
declaration: package: zombie.inventory.types, class: HandWeapon
i thought you used the script file to do that
after having the icons in textures directory
Are you getting the item properly? Via ScriptManager.Instance:FindItem ?
you could try
item:DoParam("Icon=...")
*yeah I only read top part
yeah sounds like the item script is the problem, not the argument
if you are using the right heirarchy it should be pretty straight forward
Afaik, I already have the item in the correct InventoryItem form (can also use stuff like item:getFullType() and so on)
thx. I try!
oh, are you trying to set it on the InventoryItem? this is for Item, the script object
oh myb if so
you could try item:isRanged()
ah ok. yeah, I would like to change the icon for a particular inventory item while game is running
i think it's probably InventoryItem:setTexture(Texture texture) in that case
how do I make my icon png into a texture type object? can I simply use setTexture("Item_myIcon.png") or smth? "Item_myIcon.png" is just the name of the icon
getTexture("file path, starting with media/")
e.g. from one of my mods getTexture("media/ui/Traits/trait_Prisoner.png")
ok! great!!
Hi, im still starting, how can i access mainCategory value ?
local testOnly = player:getUseHandWeapon()
print(testOnly.mainCategory)
use getCategory()
ah so getCategory is getting the mainCategory value, i thought they were not the same
so I tried item:setTexture("media/textures/Item_myIcon.png") and this still produced an error for me
game does this to get the texture Texture.trygetTexture("Item_".."iconNeme")
setTexture takes a texture for argument
do you test in-game?
you can try to capture the texture from console to get it right faster
currently I don't want to get the texture but I want to set it (also retrieving it might be important later...)
you use string instead of a texture
yes, that's the problem
but I think I now got what you tried to explained to me! 😅 misunderstood some parts of @bronze yoke comments
hey does anyone know what could be preventing me from turning a spot into my safehouse?
how can i refresh the lua files ingame? i added new .lua file but i cannot find it, do i really need to exit the game ?
going to the main menu is enough
Does this count for a server as well? I figure it'll need to be restarted, afaik there's no restart command for it
I keep closing the ded server and launching it again 🤣
i tried but it didnt update
If you're in debug mode, bottom right there's a button called Reload Lua
In the main menu
I do all my server testing from the host menu, so yes
obviously a dedicated server would need to be restarted
Hey guys, is there a list of itemProperties somewhere?
You need to give it a model, if you look in the script files, there is a file called models_items.txt that shows this. Basically you need a 3d model and texture to reference, and then you designate that in a script file
If it already has a model, you just add WorldStaticModel = Name_Of_Your_Model_Here,
to the item script
hook whichever function that uses
smort
Anyone know why the game is kicking back "no such function"
My function 100% exists in the files lol
probably because there's no such function! you'll need to give more information than that
where is the class that tripped the user? like when runnig with low health
I am triggering my function on the OnEat trigger in the item block, it worked before- But was breaking. So I made some edits, but only inside of the function itself. So I dont really know why it doesnt register it as real anymore :(
or like the player is jumping over fence
you might have errors in the function that are causing the file to stop executing
word
is it possible to do the climb wall animation without a wall or fence etc.
Blacksmith:addXPBoost(Perks.MetalWorking, 3);
is this correct
Perks.MetalWelding
Hi. Where do i get the txt files and models/sounds etc. of the current item in game? Lets say the m14, because i want to use, the model and i want to know what are the details of the .txt m14.l
thx your the best
Hi all, any ideas why this code doesn't work in-game?
local function TraitMinorSunlightSensitivity()
local player = getPlayer();
local timeOfDay = getGameTime():getTimeOfDay();
if DAYORNIGHT(timeOfDay) then
if player:IsOutside() then
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPart = allBodyParts:get(ZombRand(allBodyParts:size()))
bodyPart:AddDamage(2.5)
if player:IsOutside() and player:IsSeatedInVehicle(); then
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPart = allBodyParts:get(ZombRand(allBodyParts:size()))
bodyPart:AddDamage(1.5)
this one works
local function TraitSunlightSensitive()
local player = getPlayer();
local timeOfDay = getGameTime():getTimeOfDay();
if DAYORNIGHT(timeOfDay) and player:isOutside() then
local allBodyParts = player:getBodyDamage():getBodyParts()
local bodyPart = allBodyParts:get(ZombRand(allBodyParts:size()))
bodyPart:AddDamage(5)
```lua
I mean its going to be to do with the the first if and the vehicle bits but I don't know why
Basically trying to get it to identify if the player is in a vehicle or not, and then do X
Some of your functions usage has incorrect capitalization.
player:IsOutside() shoud be player:isOutside()
player:IsSeatedInVehicle() should be player:isSeatedInVehicle()
Recommend: https://zomboid-javadoc.com/41.78/zombie/characters/IsoPlayer.html
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoPlayer
In most cases functions are lowercase Uppercase
There are a few cases where this isn't the case but I'm sure there's a good reason
Thank you, I've not had issues with the uppercase IsOutside, but I'll make sure I do it from now on to avoid issues 🙂
Hmm that doesn't give me errors now but nothing happens, I'll have to go back and have another look
no issues you noticed. It absolutely would not work

glances at player:HasTrait()

@calm depot opened up your radio fix... is that really it . _ .
I laughed outloud
would it be safe to add into EHE as is? would reloading the translator break anything?
also, if you ever find a bug - EHE is on git, and I ofc don't mind PRs
I do not envy you Chuck, doing the right thing for the sake of balance and everyone in the mod comments beating you up about it 🙄
not to mention half the features you just put in can be toggled.
ah about the journal?
comments don't really bother me - I try to reply to more innocent ones, otherwise I just ignore them lol
also, anyone getting overwhelmed by the comments - just unsubscribe
would say to not disable them outright without an alternative way to collect info
but no need to be on call either
i'm still baffled that was the problem and that this is the one line code fix
@sour island does the container api have the ablity to make contaoner invulnerable to sledge and dismantle?
nope
Ahhh ok..
Anyone knows how to make containers invulnerable?
safe zone?
No... Something that the container itself should have the immunity
Like a property i think theres a vanilla thing abt it but but am not sure if it works
if getPlayer():getVehicle() then return true end ```
Just the animation? Or interaction to an obj?
If you want the player to interact to a thing then you can set an obj to do make that object climbable
Alternatively you can make a transparent tile with that property
But if you want the animation without interaction
Then you need to create an animation xml
media/scripts
Show the code
One of the links is about items
I think I love you.
you can find them all in the source for DoParam, i don't know if that guide is actually outdated or not but it is very old
Ye its missing iirc clothing related
DoParam can be used as getter?
huh? no
Ow ok. I misunderstood what you ment
Is it possible to iterate every porperty of an isoobj?
you could loop through the metatable if you have some method of recognising getters (probably just using the string start util for the key would be enough)
hardcoding them probably wouldn't be that bad either
Ow ok.. sounds like a drag 😂 thnx tho
pz-libraries would show getters
hi everyone, i was wondering how hard coding a behavior mod for zombies would be. due to the recent obsoletion of pillow's Fear The Sun, ive been looking for a similar mod to no avail. any ideas where to start or what to do in order to simulate zombies that dont go outside at daytime? thanks in advance
hi , is there a way so i can check current player speed and set it to 0 if he is holding or equiping lets say an item with alot of weight?
For timed actions, does the perform function run on animation complete?
it runs when the action is complete
start() starts the action and then perform() runs after o.maxTime, right?
yeah

stop() is used when cancelling the action early
Yea, I figured that, just wanted to know the order of operations, the animation is just going to play and then on finish it'll send a client command to run a function.
oh wonderful, just had a full JRE crash on our server.
anything to do with zombie ai is annoying and often just near impossible, but if there was previously a mod that did what you want to do it is at least doable
You mean between different related timed actions? If so, this is managed by the TimedActionQueue class
if the original mod's license allows you or you can get the author's permission, fixing whatever caused that mod to stop working is probably the simplest option available to you
Then you should think about a dev or staging server 🙂
https://steamcommunity.com/sharedfiles/filedetails/?id=2182855819 this is it. it was definitely doable but i have no idea if the latest updates broke something that cant be reversed. it says he used code from another mod that basically does the same thing except the zombies hide from rain, not the sun.
Guess not, at least for Sledge there is no direct flag afaik. But you could introduce a custom flag and overload the functions to prevent it. But the concrete solution also depends on whether you want to change existing tiles or only apply invulnerability to tiles which comes with your mod
The most trivial solution would be of course sth like
context:removeOptionByName(getText('ContextMenu_Destroy'))
It's a pity that the corresponding predicateSledgehammer function is local, otherwise you could simply overload it. But maybe you'll find a better solution
I am currently setting an icon for an inventory item via the command item:setTexture(myIcon) which happens while in game. However, when I quite the game and load again, the item will not have the icon anymore. Anyone an idea why that happens and whether there is a way to solve this?
What I want to achieve is that one type of item defined via one script.txt entry can have several different icons ingame. Not sure if that's possible at all.
i can see you have thought of this too
hey wasn't there some problem on MP with having setstress, setunhappiness and setpanic? getting report that those dont work
I've been told that "The issue is with Floating point accuracy. You can set these values, but beyond around three decimal places, it just stops working."
Anyone knows something about that?
anyone know of a guide for implementing custom zombie outfits/inventories?
I haven't heard anything about it yet. But do you really need such small values? These are percentage values, i.e. an interval of 0-100. With three decimal places, that would still be an accuracy of +-0.001%
they are not %
one of them is
i decrease them by 4%
4% is not 0.001%
Unhappiness:35.91999816894531->35.87999725341797, stress: 0.15254822373390198->0.11254822462797165, panic: 7.570008754730225->7.170008659362793
Unhappiness:35.87999725341797->35.839996337890625, stress: 0.07881207764148712->0.03881207853555679, panic: 2.289999008178711->1.8899990320205688
Unhappiness:35.839996337890625->35.79999542236328, stress: 0.007868108339607716->0, panic: 39.12001419067383->38.72001266479492
Unhappiness:35.79999542236328->35.75999450683594, stress: 0->0, panic: 34.910133361816406->34.5101318359375
Unhappiness:35.75999450683594->35.719993591308594, stress: 0->0, panic: 36.83024597167969->36.43024444580078```
well, panic and unhappinesss by 0.4%
still
i'm doing my best google-fu and cannot for the life of me find any information on adding custom zombies to the game
even taking a look at other mods that do it and trying to figure out where it actually defines the outfit/zombie types has yielded nothing, s'all greek to me i guess
ok, so sandbox screen is 'easy' to add group box e.g. ProperZombies for all the options but if you want more than that you should probably recreate the whole panel (your sandbox page).
Which means you can customize it anyway you want, if you're familiar with UI.
You know how to make a group?
yeah
it needs more changes to work properly, but I just added to In-game map page.
Huh?
just for test, because it errors atm if you use other types that are not combobox or tickbox 😅
if v42 makes no changes, we could make a community api for it, it has been asked here a few times 🤷♂️
The only way I can think to achieve that is a bit messy, but you can also save your alternate icon to the item's moddata and then decorate whatever renders the inventory menu to check your moddata entry and swap the icon if that entry is not nil.
I've just checked the options again, because I'll also need it soon anyway. Seems like this is actually the most viable solution, otherwise you'd have to overload/overwrite the entire doMenu function or do it for each IsoObject class manually. In addition, I'd recommend to implement an onDestroy function as a fallback, which in case of doubt clones the container and its content and re-places it if someone somehow manages to demolish the container
First you create an outfit in clothing.xml using the clothes' guid. The guid's you use are defined in the xmls found in /media/clothing/clothingItems. Every guid you use also needs to be in a fileGuidTable.xml in your mod in /media.
Then you create a HairOutfit lua file to associate specific hair/hair colors with your zombie outfits. Can skip this if you don't particularly care what hair/hair color your zombies have.
And a ZombieZoneDefinitions lua to tell the game to spawn zombies in your outfits in certain locations.
I just want to have a function that if a thing has moddata isUnbreakable
The only way to delete is by admin
Shouldn't the icons be rendered lua-side as well? Maybe overloading that part with a callback function could work as well
Dont want it to chang stuff thats already spawned or about to spawn. I only want a function that can be applied manually or something like that
My own mod, Gunshop Kendo, has a submod called S.T.A.R.S. solely dedicated to creating custom zombies, so you could look at what is needed on the most minimal level (shameless plug).
https://steamcommunity.com/sharedfiles/filedetails/?id=2917274631
Right click setIsUnbreakable()
first off, wow what a kickass mod
second off, thank you for the information, that's super helpful! :)
i'll sniff around that, thank you! i'm working on a feature for my lil (enormous) music mod to add survivor zombies that are carrying cassettes
I think you can just add the item right
I need to do some fancy item distribution stuff with STARS to make it so they always only drop 1 item in a set of options.
But you can more easily add items to their loot table with something like
table.insert(ProceduralDistributions["outfit_YOUROUTFITNAME"].items, dropChance);``` or something like that.
and i thought i'd have some fun dressing them up tbh. i have a trailer for my mod that has a bunch of different survivors with different outfits in it and i might put them in if players have all the required mods enabled
oh yeah i mean
i also want to do full custom outfits
just the main purpose in the mod is as a vehicle for dropping a bunch of cassettes as well as a bit of interesting loot
yeah cosmicb gave me most of the information i should need!
Whatever you do in Zomboid, do it with your own soundtrack. [VIEW DESCRIPTION FOR A LINK, AS WELL AS WHAT SONGS ARE IN THE VIDEO AND WHAT MODS I'M USING.]
Music for the End of the World is a mod based on the "True Music" framework, providing 1,000 tracks of real-world music to be listened to in-game. The mod is split into three packs which can ...
ok if you prefer lua way.. cuz whaat i suggested was xml way
no i mean--he gave me that information here
anyway, that's the trailer--i thought it'd be cute if, if you have all the mods required, each of the survivors depicted in this video could show up as very rare zombies carrying a bunch of music items personalized to the character
so that's why i was asking :)
Thank you.
I make mods for myself and my playgroup mostly but I'm fortunate that other people like them.
i think that's the best way to do it :)
i've only made one mod, but i really poured my heart and soul into it and it was honestly mostly for me--i'd seen true music give the people i played with on servers a ton of awesome memories that would never have been quite as cool without it, so i was super inspired
yeah its been a long time since i ever made anything for myself... ive been doing commission after commission
i think secret stash is the only mod ive ever done for myself
Good song selection in that trailer.
Idea: you could make your dressed up zombies hold a boombbox playing the cassette. Not only does it make them really stand out, it'll draw all the nearby zombies on to them, making them a boss encounter. 😂
see i actually had that idea but that sounds way more complicated than i know how to do haha
if i could do that i'd totally give them all a boombox playing the song associated with their bit of the trailer
you hear beach boys - kokomo menacingly in the distance as beach man and his entourage lurch towards you
It sounds like he has that figured out, he's just having issues keeping the lua-altered icon persisting between play sessions.
Ah, I see. Well yea then I'd also suggest to use moddata or the player database
on the traits mod im working on im left with 2 tasks
believer traits shouldnt have context menu on cigarettes and alcohol
then 2 other traits can eat raw food without getting sick..any advice?
im looking to overwrite thios function but its a very long one
ISInventoryPaneContextMenu.createMenu = function(player, isInPlayerInventory, items, x, y, origin)
its almost the whole lua file
any way to extract just a part of it
hii, just curious about how to disable grabbing/taking item from specific container on specific area
Overload the Event listener which gets fired when the context menu is rendered an remove the options
Oww thats harder than what im trying to achieve
Im sorry i dont quite understand..
So you are saying i should let it render then just remove it right
How do i get the specific menu ?
Yeah, I was think it just easy as disable take generator, but it's much harder
... so question actually
it's possible for zombies to have something equipped in their hand, right?
or at least attached to their hand?
We are doing the exact same thing but on diffrent situation and yours is onfillworld mine is inventory
Yes
Like i mentioned check out the xml file
Its inside the clothing folder
right that's just a preliminary question to a more complicated question
is it possible to equip a device to a zombie's hand that has a defined state? i.e. would it be possible to equip a boombox on a zombie that has a loaded, playing cassette
Oh, just noted that this isn't done by Events like in WorldObjects but with "CustomContextMenu" script entries. Give me another sec to check for a solution
I kinda threw this together, but this is sort of what you want I think as an example for your traits.
ISBelieverTraitsContextMenu.removeSmokingOption = function(player, context, items)
local playerObj = getSpecificPlayer(player)
items = ISInventoryPane.getActualItems(items)
for _, item in ipairs(items) do
if item:getFullType() == "Base.Cigarettes" and playerObj:HasTrait("NoSmokes") then
local smokeOption = context:getOptionFromName(getText("ContextMenu_Smoke"));
if smokeOption then
local toolTip = smokeOption.toolTip or ISInventoryPaneContextMenu.addToolTip();
toolTip.description = getText("Don't give in to peer pressure, kids");
smokeOption.toolTip = toolTip;
smokeOption.notAvailable = true
end
break;
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(ISBelieverTraitsContextMenu.removeSmokingOption);```
Yeh its not an easy thing . Also if i overwrite the entire thing then mods that did the same thing would conflict
You could outright remove the option with removeByName or something, but I figure it's better to communicate why the option is not available rather than just have it not be there.
Ur like chatGpt thank you!
Idont understand it yet but ill try it out
The trait is actually called believer
Pretty much this is adding a function to the render context menu stuff that checks if its a cigarette and the player has a NoSmokes trait, sees if there is a "Smoke" option that has already been created, and if so, sets it to unavailable (unclickable red text).
Then for alcohol ill just check for drink right and if its an alcoholic drink i think i have that on a note. Im currently afk
I think you'd want to check if its a food item and if it is, check if IsAlcoholic is true.
To catch all alcoholic drinks without have to stipulate specific ones.
hey cosmicb! do you think this would be possible? :0 you seem to know quite a bit, sorry to swamp ya
Have u seen the xml file im refering to?
Maybe she blocked me and so she cant read my msgs hehe
yes i have
Ow yey
the one i'm looking at does not tell me any of that info
You can use onzombieupdate
No problem.
You'd want to look at the AttachedWeaponDefinitions lua. Either the one in STARS or the one in the base game code.
Same idea for a boombox, but instead of using a "impaled in the zombie" location, you'd get their hands or something. (though unfortunately there does not seem to be a way to force it to ALWAYS spawn your zombie with the item. There's a global hardcoded chance of 6%)
As for how to actually give it a battery, a casette, and then turn it on when a zombie does spawn with one... I haven't a clue.
hah, that's the sticking point
Then add a random thing to add to its inventory and equip it on his primary
Like how u would a player
it's really the question of how to get the cassette into the boombox
and turn it on
Doesn't OnZombieUpdate run ridiculously fast though?
It does but i dont have any other alternative ideas
I just consider all the update events dangerous territory for performance, OnPlayerUpdate, OnZombieUpdate, OnTick, etc.. 😅
I really wish there was a OnZombieSpawn or something. 😮💨
Just goes back to how there's some annoying gaps in events.
Like, there isn't an event that triggers when a zombie hits a player... in a zombie game. You can only catch the bleed damage that follows afterwards with OnPlayerGetDamage.
Yeah that seem to be a must have
is there a way to restart server via rcon
the update events are a little overly feared
the advice to stay away from them is mostly so beginners don't write crappy code that lags out the game, if you're responsible about it it's fine
please though... onzombiespawn...
guys, how do i effectively spawn tapes in my inventory? When i do AddItem(tape) it does spawn them, but they cant be inserted in the tvs
you need to use setRecordedMediaData(mediaData) on the item
by default it's just a blank tape that doesn't do anything
No, but there's a way to quit so this would be possible using the RCON command + some additional code on your end (on the machine running the game). Not with RCON alone as far as I know
and how do i get the mediaData from the tape? I tied through setRecordedMediaData(getMediaData) but now it lets me put it in but the char doesnt put it in actually
getZomboidRadio():getRecordedMedia():getMediaData(id)
and i can get the id of the tape in question right?
if you've just spawned it it's blank, it doesn't have any media data
it's basically just a template item
yea i spawn a tape through the items list but i set it to an actual tape through the dbg option
it does let me put it in the tv before i do my stuff
item Beer2
{
DisplayName = Poured in a Glass,
DisplayCategory = Food,
Type = Food,
Weight = 0.3,
Icon = PlasticCup,
EatType = Can,
ReplaceOnUse = PlasticCup,
CustomEatSound = DrinkingFromCan,
WorldStaticModel = PlasticCup_Ground,
CustomContextMenu = Drink,
EvolvedRecipeName = Beer,
Tags = LowAlcohol,
}
how do i check for tags again
wait i think i know nvm
if getScriptManager():getItemsTag("Liquor") or getScriptManager():getItemsTag("LowAlcohol") then
why not HasTag()?
anyone knows why my Additem gives me back a comboitem?
whats a combo item
Ive no idea but its called liked that in the debug window
it's a subclass of inventoryitem
ok how can i ensure that it wont turn into the comboitem?
your item needs to be one for some reason
i don't know why you wouldn't want it to be
cause it messes up the tapes they turn into something which the game cannot recognize
they cannot be dropped or deleted from the inventory
I need to deep dive into the PZ modding code to make one where you can craft your own graffiti overlays from the base game
it's such a cool decor piece that's not craftable
😭
If not exactly what you are wanting, it should at least work as an idea on where to start on your own mod
Oh I know about Aza's one, I just like the overlay tiles from base PZ, and would like them to be buildable (think More Builds Mod having the Well, fuel tanks and so on)
Or having a way to 'build' the grime overlay as well
Wow looks like u are typing a long one bro @thick karma
Alright y'all, wondering if anyone can help me slot a piece of another puzzle. I am working on cleaning up the character creation panel (yes, I know there are other mods that rework it entirely, but they aren't gamepad compatible and I don't feel like adding that support for them)... One of my goals in doing so was to sort the clothing categories alphabetically. So I did (4x font for testing to demonstrate attached).
UNFORTUNATELY, there was a twist. The game's AvatarPanel somehow uses the order of the list to determine which items get drawn on top of which other items, so when I reordered that list, it resulted in my poncho being drawn partially under my shirt.
Can anyone help me identify where exactly the game decides to use the order of the items to draw the clothes on your sprite in the character preview ("Avatar Panel")? Hoping I can split that function and tell it to use a different table for drawing when I've sorted the categories in the menu.
(I am not yet sure if the menu consequences would carry forward into the game.)
Fell asleep trying to solve this for a couple hours last night so I figure it's time to run it by the people.
Hmmm maybe I need to do something with updateSelectedClothingCombo
aren't they set according to the order in shared/Definitions/ClothingSelectionDefinitions
actually, no, they can't be because it's iterating using pairs() so the order wouldn't be guaranteed
are you sure that the items you're applying are actually compatible and not something the game would treat as a slot confict if you were trying to put them on in-game?
I'd start a game up, give yourself the same clothing items then try to put them on from your inventory
Yes
It's a saved outfit I wear all the time. I already isolated the sort function as the issue
If I sort the items, bug. No sort, no bug.
Even with mod running
well, by "no sort" you must really mean "sorted in a different way"
The avatar panel uses the stuff I sort somewhere, in something created immediately after the sort process perhaps.
so, how do they need to be sorted in order to display correctly?
I mean I did not sort them and it is not clear how the game sorts them, but yeah clearly the game may be aware that their order matters.
By no sort I mean no sort from me
yes, I get that, but clearly the game has a correct order that they must be applied, therefore they must be sorted
so, based on what you've observed, what does that sort order seem to be?
In their original way they seem to put stuff that has to appear on top below the stuff that it might cover
E.g., my poncho is in the Jacket category. When Jacket is moved above Pants, Pants appear over your jacket.
That's how I noticed in the first place
but when you're in-game, you end up looking the same regardless of whether you put on the pants or jacket first, right?
I actually haven't tested that... I suppose it could help solve the problem but last night I was only focused on reading the code that creates the menu that is causing me problems
given the limited clothing options in the creation screen, and from looking at the code, it looks to me like they don't need to care about order there because they only support a few types
I reckon the better place to look is going to be the in-game code that handles clothing
Hmmm yeah I am not sure where exactly the game loops through selections to dress your character... But I feel I need to revert that list of selections to its original order somehow. No idea what file to check if it's not in this menu somewhere tbh.
can you show the issue?
Yeah gimme a sec I'll screenshot it
I'll also go ahead and start and see if the visual error persists into real game world.
if it does, I'd be curious to see if it also persists after quitting and reloading the save
Sure enough, persists into the gameworld.
I sort it in CharacterCreationMain:doClothingCombo(definition, erasePrevious) FYI:
if LM.alphabetizeClothingCategories then definition = LM.snailsort(definition) end
so, what if you quit and load it back up?
if it still does, that would imply the order of item application is also stored
Well you mean if I disable the mod and restart? I mean with the mod enabled I would expect to produce the same issue as soon as character creation was initialized.
Alright I will test that for giggles
the fact it's bugged in-game may not be notable as it might simply be "recycling" the model from the creation screen
Not like I'm making much progress e.g. lmao
if it's still bugged after a re-load, now we know something
I'll let you know.
(more specifically, it means it's worth looking at the code that applies your outfit when you load a game)
when in-game, does changing your equipment in an unrelated way (such as putting on glasses) fix it?
Just got back to restart so I tested this first; no, changing equipment did not fix it.
I hope it's not something weird like trying to see why you can't add sheet rope, only to discover it's a duplicate item a mod adds for whatever reason that doesn't work.
NOT bugged on reload until player dies and respawns. That's when the character creation panel gets initialized, runs my code, and (temporarily) reorders how the game apparently equips everything.
right, so there's some logic somewhere that knows the correct order to apply clothing when you load the game
makes sense that it breaks again when you respawn since, presumably, your code is executing again
ofc
I have the suspicion this is living in javaland
Well even so I should be able to reorder things after Lua draws the menu right? If they get put out of order in Lua, they should be orderable via Lua...
Just gotta work out the timing and the how which sort of needs the why
yeah of course, you can intercept the call
I was/am hoping there's a function that either returns the right order, or applies it
what's the table called
in that context it's just called definition @bronze yoke... Idk if it has a better name. P sure it just shows up as a table in debug console.
I wonder if this could be a relevant chunk.
self.clothingCombo = self.clothingCombo or {}
self.clothingColorBtn = self.clothingColorBtn or {}
self.clothingTextureCombo = self.clothingTextureCombo or {}
self.clothingComboLabel = self.clothingComboLabel or {}
self.clothingCombo[bodyLocation] = combo
self.clothingColorBtn[bodyLocation] = button
self.clothingTextureCombo[bodyLocation] = comboTexture
self.clothingComboLabel[bodyLocation] = label;
table.insert(self.clothingWidgets, { combo, button, comboTexture })```
That insert should be putting each new item at position 1 in clothingWidgets, yeah?
What if they just... naively loop through clothingWidgets somewhere? (Maybe Java side) when equipping stuff?
Hi. is it possible to create a player in debugging mode? because i want to test something for multiplayer
No dice on this, I just tried inserting the widgets according to their original order, did nothing for me.
Yes
How
Wait do you mean create a character normally, or add another player object to the game in addition to yourself?
Ah, I've seen people create NPCs for certain mods but idk how. Maybe they call the IsoPlayer constructor from Lua to create an object and give it a position? Unsure, sorry. 😦
However, you can launch 2 instances of the game for MP testing.
That's what most of us do afaik.
You need to run in -nosteam mode.
i created a shortcut desktop with -debug
Before you do it, I recommend backing up Zomboid, because switching to -nosteam resets all the mod sandbox options that aren't available in -nosteam mode (which will usually be most of your mods during testing)
-debug is not enough. You will need to run one game in -nosteam -debug (the host), and run a client as -nosteam.
The client cannot be debug afaik. I do not know of a nosteam-friendly way to give them admin powers before they join the server, and non-admins cannot connect as debug.
Is this the user file where i put my mods ?
It's the folder where you find mods, and mods is where you put local only mods.
That's where your mod needs to be to test with -nosteam.
But you should back up Zomboid entirely because it's just easier
I just duplicate Zomboid and name it Zomboid Steam
And rename Zomboid Steam when finished
ill need to create 2 desktop shortcuts right ?
I have a guide on this
If you want
Could use feedback if it's good enough
I just run it from my terminal
Its at the bottom "how to test mods mp"
thanks
@dull moss so uh, what does Bloodlust actually do?
the spreadsheet tells you everything except that
Can i add a unique indicator/tag for item ?
tags are arbitrary strings
You can look for tags with hasTag(..)
There is no tag
Its in your item definition
In the .txt file that you make you just write Tags = … and the your tags for it
tags are per item script, not per instance, if that matters
https://pzwiki.net/wiki/Modding:Lua_Events/OnHitZombie
Do this applies in pvp ? hitting a player?
https://projectzomboid.com/modding/zombie/characters/IsoPlayer.html
Can i find here the function to check the player i hit ?
declaration: package: zombie.characters, class: IsoPlayer
Why does it feel like when I mess with server / client stuff, nothing works as expected 🤔
Didn't have these issues with pzShops or whatnot - maybe I'm just rusty with EHE and how many part there are
I have code in /server/ that when I'm hosting returns isServer false and isClient true
I am trying to move all the system parts to run off the server and just send the clients updates for syncing
The only way I got it to update accordingly is to send a command from /server/ to client to server
Which is what I was doing before - as I had all of the code in /client/
im focusing on sp for now just because of that 😄
got the zombies to work with mp, all the client does is ask the server to do X
did the same for everything else... nothing works... back to zero
😄
so sp... when sp is done ill worry about mp
just having some problems in unrelated stuff that i want to add in the future ( flat tire and stall engine )
but i have time to figure it out, so not a issue at least for now
btw having no issues with EHE
client and server side
Server
D:\SteamLibrary\steamapps\common\ProjectZomboid\ProjectZomboid64.exe -nosteam -debug
Client
D:\SteamLibrary\steamapps\common\ProjectZomboid\ProjectZomboid64.exe -nosteam
My client cannot conect to server. Any idea?
Okay in CharacterCreationMain:loadOutfit(box) they have self:onClothingComboSelected(self.clothingCombo[bodyLocation], bodyLocation);... Chunk:
elseif self.clothingCombo[location[1]] then
-- print("dress on ", location[1], "with", options[1])
local bodyLocation = location[1];
local itemType = options[1];
self.clothingCombo[bodyLocation].selected = 1;
self.clothingCombo[bodyLocation]:selectData(itemType);
self:onClothingComboSelected(self.clothingCombo[bodyLocation], bodyLocation);
if options[2] then
local comboTexture = self.clothingTextureCombo[bodyLocation]
local color = luautils.split(options[2], ",");
-- is it a color or a texture choice
if (#color == 3) and self.clothingColorBtn[bodyLocation] then -- it's a color
local colorRGB = {};
colorRGB.r = tonumber(color[1]);
colorRGB.g = tonumber(color[2]);
colorRGB.b = tonumber(color[3]);
self:onClothingColorPicked(colorRGB, true, bodyLocation);
elseif comboTexture and comboTexture.options[tonumber(color[1])] then -- texture
comboTexture.selected = tonumber(color[1]);
self:onClothingTextureComboSelected(comboTexture, bodyLocation);
end
end
end
where location and options come from this:
local saved_builds = CharacterCreationMain.readSavedOutfitFile();
local build = saved_builds[name];
if build == nil then return end;
desc:getWornItems():clear();
local items = luautils.split(build, ";");
for i,v in pairs(items) do
local location = luautils.split(v, "=");
local options = nil;
if location[2] then
options = luautils.split(location[2], "|");
end
. . . . .
end
So when I load clothes, game seems to use use self.clothingCombo to call self:onClothingComboSelected which in turn sets the worn item like so:
function CharacterCreationMain:onClothingComboSelected(combo, bodyLocation)
local desc = MainScreen.instance.desc
desc:setWornItem(bodyLocation, nil)
local itemType = combo:getOptionData(combo.selected)
if itemType then
local item = InventoryItemFactory.CreateItem(itemType)
if item then
desc:setWornItem(bodyLocation, item)
end
end
self:updateSelectedClothingCombo();
CharacterCreationHeader.instance.avatarPanel:setSurvivorDesc(desc)
self:disableBtn()
end
Still not seeing why the order determines the layering of clothes but I am just sharing info hoping someone sees what I don't at this point lol...
greetings. i'm attempting to make a mod that spawns ALL zombies with a hat. is there any easy way to accomplish this? i've tried using underweardistributions as a base to insert and add stuff, which DOES work and doesn't conflict with anything... except there's one slight problem - the base chance of anything spawning is 70%, as per the underweardistributions file... not very ideal
so, is there any workaround? or perhaps an alternative method i could use? this is my first time dabbling with zombie outfits and what not, any help would be greatly appreciated
dunno if im right, but i kinda recall someone saying that in debug you cant connect to a server
@thick karma i would like to help but i know nothing about that type of modding... to much for my small brain 😄
My client has no -debug
spawnzombiesinoutfit or something like that... lemme check my notes
Javadoc Project Zomboid Modding API declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject
dont know how to set the outfit though
I don't think that's what he wants.
That function is for spawning a zombie in a specific place with a specific outfit.
Pretty sure he just wants all zombies that are spawned everywhere to have a hat.
for that he has to set the default outfit for the zombie population
i know there was a wway to do it with outfitmanager or something
but not my area of modding thats all the help i can give
i think he has to create a named outfit and then assign it to the zombie population
how... no idea
i see
thank you kindly
no worries, sorry i couldnt be more of a help... but i dont have much knowledge about that part of the game code...
How do i display print() in multiplayer ?
On your server console
Ugh I just want to sort the list without borking clothes 😭 lol I hate having the sort working and not being able to use it because of this weird behavior I can't solve.
Oof
this is to be expected when the server folder runs on the client as well as the server, right?
they're totally separate, so you'll need to check the coop-console.txt to see what's actually going on on the server side
Launch debug then type on the console
print('hello world')
any link reference on getting started with global mod data ?
Btw the clone thing i also thought of that would be applicable to other stuff but vanilla containers that spawns stuff. If you cant protect it then the clone wont really do anything
I dont think you can make the clone spawn loot
What if you make the sledge action extra long and then OnPerform do nothing 😂
Like reading skillbook where player keeps saying things like "Too complicated".
I guess my issue would be I need to make something occur on the definite server without prompting from the client - I have stuff running off OnTick/OnHour in /server/ and was trying to sendServerCommands to update clients
but I guess the issue could also be related to me being the host too
I just downloaded the superior survivors mod from steam and after turning it on, my cursor glitches out and becomes invisible but I can still click options. Anyone else getting this glitch?
no, I do not develop that mod, do you?
No, I found it on YouTube and I thought that I could get some help here
i think the joke they're making is that this probably belongs in #mod_support
try #pz_b42_chat or #mod_support
alright does anyone know how to change the burglar alarm sound? trying to change "HouseAlarm" from sounds_world.txt doesn't do anything
if you figure that out please let me know. Im having issues with that as well
well mostly everything is sorted for now... time to make a test run and rage because i know some error will show after cleaning the code... it always does... something missing our out of place.
Whats the diffrence of onperform with ontest
Rage is part of the routine
OnTest is ran before the recipe is activated. If it comes back false, the recipe isn't clickable and doesn't appear in the context menu.
OnCreate is ran after the recipe is completed so you can make adjustments to the results or what not.
Edit: Whoops. That's OnCreate. Is OnPerform even a thing?
oops, *on perform. When the action completes. OnTest? Are you talking about recipes?
raging already... was working fine... i try to make the code pretty... i get errors... at least i know how to fix it it could be worse 😄
Yep i know ontest but perform thats what i thought
So i got confused
Yes i thought u wre saying recipe but i guess it was just on the context or ur literally saying on perform as after the thing
PZ hates pretty
I mean instead of removing the context for destroy action, adjust the action to not destroy the object. Just mentioned this as an alternative.
I thought changing nicknames wasnt allowed on this server. Said anonymous but you manage to change yours poltergeist
Yep o got that. Now. Hmmm
uh, change account nick it's that simple
Or maybe your able to click it but as you character do the action he will stop cuz theres poop on the sledge so he doesnt want to continue
Idk anonymous wanted to change his .
iirc When i accidentally tagged a diffrent person?
it's not a server nickname
i haven't done pz in a bit, i've been learning barotrauma modding instead
i do have a couple commissions coming up later and i'm always thinking about pz but no specific work on anything recently
is anyone familiar enough with creating custom zombies that they can tutorialize me as to:
- forcing a specific zombie outfit to spawn with a specific hairstyle and hair color
- whether or not it's possible to force colors outside the range of those available in normal character creation?
i tried looking around at the hairstyles xmls and stuff and it might be my sleep deprivation but
just couldn't wrap my head around em
definitely worth a try. thx for the suggestion.
How would you go about using multiple UIs in one mod, separate files for each UI or all in one?
Not familiar if you can actually just make multiple panels and just use that
Sounds simpler lol
I would do it separately
Hey btw can you add folders inside the client folder? Like to categorise the lua files
You can choose to make it as a single file but a ui already has alot of lines
So it would be harder to scroll up and down compare to just switch tab or if youre using multiple tab view then it would be easier
You can
Yeah that's why I did it separately for now
Ohhhh damn that's gonna be a fucking gamechanger
Do I need special requires at the top or will it work normally
You know how you put require at the top if you need a variable from a file
Yeah aight gotcha, thanks man ❤️❤️❤️
Sample u have 2 files on the ISUI
Folder
Then u should still require "ISUI/some.lua"
you should definitely do that, so long as your mod takes more than one file having folders means you can have way more boring filenames so long as your folder name is unique
On one of them
Which made me wonder
If they can require eachother
What are u building @drifting ore
modname/file1.lua, modname/file2.lua is way nicer than modname_file1.lua, modname_file2.lua
circular requires just break out
Like cause error?
otherwise it's just an infinite loop of load file 1 -> load file 2 -> load file 1 -> load file 2
they don't cause an error but the require fails
Ahh ok
or they do cause an error but it doesn't stop execution of the file, and it's not a pz red box error
My biggest undertaking yet, gonna make like a police compute archive for RP servers to use. Add warrants, bolo's, fines, criminal history et cetera
That's why I need lots of UIs
probably! i never tried it
it'll either break out or crash the game so like
just don't do it lol
On the server me and albion do mod stuff
We have a co modder there that did the exact same thing u want but i think its unlisted or maybe its just way too specifc for the server
why does everything happen in this chat at 4am on a saturday 😩
yeah he's been working on that for months
i could use some help 
OnZombieUpdate
If im to do this lol
Check of theres a hat if it doesnt then spawn then equip
Its 4am sunday here
Wtf
24hrs difference lol
Is that possible
nope
I dont know
haha its not 4am here anymore, but it was when people started talking a lot
I dont think so
Lmao
Ahhh ok
Can you tell why I never went for programming (bad at numbers / math)
Whew i thought you lived on a diffrent planet or something
gave up trying to read everything that happened since 4am, hopefully I didn't miss any good tips or resources
Same but we should get used to it
I lurk on here all day at work and no one says anything, go to bed at night and come back to hundreds of posts
everytime i clean up the code something stupid happens like...
ExceptionLogger.logException> Exception thrown se.krka.kahlua.vm.KahluaException: TWEVENTSmain.lua:79: 'then' expected near eHeliEvent_new at LexState.lexerror line:278..
oops...
😄
forgot the then...
😄
Lol
I rarely skip reading
I always start reading after my last msg
Then scroll down
Happens to me alot
last error was ) missing
Thats admirable I only come here to ask a question get an answer and dont respond back 🤓
im gonna start leaving me code in mode frankenstein
it works... uggly to look at but works...
😄
Well u should prefer the working one
i do... but i write a lot of --notes
so mostly my mod file is like... 40 lines of code
100 lines with notes 😄
but this should be good enough... just need to remove the prints when im done testing
and i think all is well now... time to try it
man i love mod manager, whoever made this whenever they come to portugal has a dinner or lunch on me
Modmanager ? So you test on sp?
last i heard that guy has been mia for months
So thats why you are able to reply to some of the questions that are a but outdated but wasnt really resolved
working on the sp of the mod 1st... then ill worry about mp
i try to read everything i miss but sometimes there's several hundred messages
having some issues with the exchange of commands from client to server, but this mod was made mainly for single player to begin with, so.... not that worries about not working in mp
but i know where i went wrong... prolly im doing something stupid as usual and sending the module name wrong like... a wrong case somewhere on the modules name... thats usually what happens with me...
twitch when it should be Twitch or the other way around... have to be more carefull with the names and take notes so that i dont do the same mistakes over and over again.
Can I get a W for this, in my first mod I put in a comment line within crediting the author of the timed action or UI whatever it was, "Robert Johnson" thanking him for his great coding skills (I assumed the author of the mod was that), until I now opened a file in the OG game files and found the same name and style at the top.
The timed action /UI I used in my mod, with my own changes ofc, also had that text at the top lmfao
From what I understand isClient return true whenever you host a game
thats part of it, ya
a lot of the timed actions are prefaced like that, i think whichever mod you copied that from just copied that from vanilla
doesnt it return true when connected to a server as well?
if it doesnt then i know why my damn code isnt working on mp and it does on sp 😄
Hmm no then I would expect isServer to return true
because im using a check if isclient and isadmin execute
so i guess ill have to rethink the code... later on... sp comes first
isClient returns true on the client, isServer returns true on the server, both return false in singleplayer
and here we go again...
forgot to convert the table value to number
so nothing triggers...
thats 7 stupid mistakes in less than 20m
a new personal record
Hell of a lot of good that that scope does
😄
Has something happened to the SuburbsDistributions in the recent patches?
A mod pack we run has errors with it, and all of them point towards loot table distributions inserting to it from across several mods
not in like the past year that i can tell
most likely one mod broke something and it causes all of them to have issues
A mod that removes some of the tables?
Oh, no...
It was renamed, but there is some mod compat for it
They still exist..?
When I use the event OnGameStart to execute a particular function and put the code in the server folder, will the function then always be executed when a player enters a multiplayer game or will it only be executed when the admin starts the server?
usually on gamestart is when the game starts
not when a player connects
but that me guessing
thats
...
haha! I hope so too. 😉
There's an event for connecting
Saw it in LuaNet
Wouldn't have thought of the name 'onGameLoad'
After the player initializes entirely
As far as I know, OnGameStart fires whenever the game starts ( i.e. after the loading screen when joining/loading) for any user, client or server.
i think the events for connecting are for the client
This would be specific to connections of clients
Yeah
If you need to differentiate
So what I want to do: Whenever a server is started, a certain function should trigger but it should not trigger when a player enters the server. Critical stuff for me is only multiplayer here. (Singleplayer is not a problem since here, the function should always trigger when game is started or loaded and this could easily be done on OnGameStart afaik.)
Correct me if I'm wrong, but I believe this achieves that
if not isServer() and isClient() then return end
-- Code stuff
end
Events.OnGameStart.Add(MyFunc)```
Ok. Looks promising!
Will this also trigger the function when playing single player? Or does this need an extra treatment?
There's an OnServerStarted Event aswell
The client will still call MyFunc but immediately exit without doing anything else in there.
Probably better to reverse the if statement and put it around the Events.OnGameStart.Add. 🤷♂️
-- Code stuff
end
if isServer() and not isClient() then
Events.OnGameStart.Add(MyFunc)
end```
The client will never call MyFunc, so almost unnoticeably better in performance since the client isn't wasting time.
the not isClient() is redundant but yeah, this is the best way of doing it

comment writer