#mod_development
1 messages · Page 156 of 1
Hmm doesnt it get checked when connected to mp server?
Hmm really? I seem to recall getting denied cause some of my vanilla luas were edited
Hi everyone, I just published my last mod. It is quite a big one this time so I hope those interested will report any bug they find. Here is the big baby: https://steamcommunity.com/sharedfiles/filedetails/?id=2970134188
But i should just call the pathing then with Zomboid/Lua then right?
interesting, yes, I could see issues arise if windows access control becomes an issue if writing to mod folder...
If you're looking into debug tools may I humbly suggest taking a look at my suite of tools @lone nest
https://github.com/Project-Zomboid-Community-Modding/pz-community-modding
This repo automatically uploads to the workshop weekly
The only thing in it atm are debug tools
Feel free to PM and discuss your idea
Hey uh, dumb question here. I'm juuust getting started learning about this stuff so um.
Am I going to need programs to edit XML and Lua...files? And if so which ones would be ideal for an absolute novice who has no idea whatsoever what they're doing?
I googled "xml editor" and "lua editor" respectively and got an overwhelming torrent of various paid services that I'm afraid to go anywhere near. 😰
Would Notepad++ be enough?
OK I'll check that one out too, thank you!
Hopefully what I'm trying to do shouldn't be too exceptionally complicated, so I won't necessarily need a super powerful program... So, probably whichever one is more immediately simple to use would be my preference.
This looks cool af
Vscode
Good evening, is the capacity of an item defined in the sprite? My intention, is to add new contextual menus, with the item crafting, but I can not modify the amount of weight, that can save the same ones, and my consultation was, if it is possible, to modify that capacity. From the .txt, I can modify it, but my problem is that from lua, I don't know how to modify it or I don't know how to access to that txt later.
local zData = zombie:getModData()
local square = zombie:getSquare()
local NoZedSq = isNoZedSquare(square)
if NoZedSq == true then
zombie:removeFromWorld()
zombie:removeFromSquare()
end
end
Events.OnZombieUpdate.Add(onZombieUpdate)```
Removes zombies that are inside a set zone, but ingame it doesnt really work, the zombies are flashing in/out and still exist, chasing the player. Is there a better method?
Goal was to create a safezone where no zombies will spawn
anyone have any idea why lua doesn't like this hook?
it just says that the colon is unexpected
I think I'm learning. I see the files these instructions are telling me to rename, but what does "best mod id" mean? How do I choose that number?
use a full stop to reference functions, not a colon
the colon only has meaning when defining and calling functions
it creates/uses an implicit 'self' parameter
thought that, but it throws the same error
oh, you're doing it backwards too
It is underlined lol
local atoneatperform = iseatfoodaction.perform
also you should be re-defining iseatfoodaction.perform
then call your stored version
bet. now i'm getting intellisense! thank you
i was following @bronze yoke's hook guide here: #mod_development message
further down I call the original and write code to be run after. Is that not correct?
the idea is that you save the original into your variable and then redefine it with a new one that calls the old one stored in your variable
maybe this example would be clearer:```lua
local old_perform = ISEatFoodAction.perform
ISEatFoodAction.perform = function(self)
-- code to run before
old_perform(self)
-- code to run after
end
the arguments should also match the original at least (usually)
doing this you can add additional arguments given you account for calls to the original
how do you add additional arguments and maintain compatibility?
very carefully
but basically you provide a default to the argument within the function if it's not present
arg = arg or X
that way calls made by other mods or other points don't have an impact
That's what I did when I decorated the addXP method
but if two mods both add arguments, won't that clash?
yes but the overlap to that should be minor
it's compatible to uses which share the same arguments as the original atleast
you can just use Keyboard.KEY_A for example
heres a reference https://zomboid-javadoc.com/41.78/org/lwjglx/input/Keyboard.html
heres the source code https://github.com/LWJGL/lwjgl/blob/master/src/java/org/lwjgl/input/Keyboard.java
i think there was a post on the pz wiki with all the number codes, but it's better to use the variables anyway
is it possible to
during daytime
sound FemaleZombieCombined
{
category = Zombie,
clip
{ file = media/sound/sprint_00.wav, }
clip
{ file = media/sound/sprint_01.wav, }
clip
{ file = media/sound/sprint_02.wav, }
}```
during night time
```lua
sound FemaleZombieCombined
{
category = Zombie,
clip
{ file = media/sound/mod_sprint_00.wav, }
clip
{ file = media/sound/mod_sprint_01.wav, }
clip
{ file = media/sound/mod_sprint_02.wav, }
}
trimmed that down*
you mean is it possible to have different zombie sounds at day than at night?
i would try scriptmanager
ayt so you havent tested
What am Iooking at??
right ill test now
not sure if live messing with sound scripts is okay or not
what is the difference between the 2?
https://projectzomboid.com/modding/
and https://zomboid-javadoc.com/41.78/index.html
One has variable names and some documentation, the other doesn't.
one is officially published by tis and the other is from decompiling the game
the official one is generally a lot more useful, but when we start getting updates again it'll probably fall behind again
the official one only has docs for the zombie package
decompiled has docs for all packages
Hm... I see that is where all the Java backend is for all the in-game stuff, I'll probably avoid the Java since I don't want to deal with compiling and decompiling.
I wished LUA stuff would were in JS or TypeScript instead 
oh jab...
https://steamcommunity.com/sharedfiles/filedetails/?id=2968697101
Friend and I developed a new mod for PZ. Having issues getting it to work with Spongies jacket and the item tweakerapi, as well as trying to get the hat working in the hat instead of scarf, I’d anyone would like to help modify that would be awesome!!
We are both very inexperienced in modding PZ :/
Hahahaha
How badly do you want that to be true?
very, especially with TypeScript defined interface to Java backend.
jab currently experiencing pure bliss
how is it incompatible with itemtweaker? that doesn't even seem possible
i will not depart back to the void
... I was looking at this particular project earlier, how does it compare?
https://typescripttolua.github.io/
I’m not sure. Whenever I apply the mod with it. The mod items for only the rick one vanish. As well as Spongies mods
My project literally uses TSTL.
does the player have... a calorie stat....?
even with a decompiled zomboid, I can't find things like that
Hi, is it me or all work from dislaik has disappeared from the workshop ? 😦
If he wishes to remove his work it is his choice, going against his wishes would be up-to him to enforce it or not
I don't know anything about the situation- but if it's 'I don't want to deal with these people' then maybe he won't care
Not sure their intention is to help people if they DMCA'd their guides uploaded in other spaces.
People did this to my guides like crazy and helped a lot of people.
IMHO it should be very frowned upon to do that with something like guides.
https://steamcommunity.com/workshop/filedetails/discussion/2950750587/3821906878988541035/
Hey, I just released an Update to my Voiced Radio and TVs mod, Adding the LBMW programming.
I'm planing to turn it into 2 mods, a framework, and the part that has voicelines and all that to make it compatible with other mods like that (specially @abstract raptor mod, Surviors Radio).
I was wondering if anyone has experience with that.
Also, for my framework, I was wondering if there was a way to get the Filename of the .xml file that generated the text line that appears on the Radio/TV (That way I'll be able to know for instance that line "You are watching woodcraft" belongs to RadioData.xml for instance, meanwhile "You are listening to Custom Radio" belongs to CustomRadio.xml)
I Know that I can get access to the GUID and the text line, and with that I could do a search of all the XML files to get a match of both, but I believe this could be slow (?) (since I would have to open N files at runtime, search for the GUID, and then close them once it's found) and was wondering if there is a more direct aproach.
I believe he chose to remove his work from any public access.
To clarify
Who?
Understandable.
Dislaik apparently
Don't know about that.
Don't tell me this is still about the damn skateboards and bikes

I wont tell you that, but it is. 😦
Rip I guess
@red tiger @bronze yoke I was wondering if you knew how to split a mod in 2 parts (A framework and the mod) where I can update each part independently and it is updated on the workshop.
Also, if there is a way to get the Filename of the .xml file that generated the text line that appears on the Radio/TV (without having to search for it in all the possible .xml files under the radio folder)
for the first part, splitting it is pretty specific to how your mod works, you'd need to make your mod modular if it isn't already
for the latter, i don't think the game keeps track of that and i don't think you're able to mess with any of the xml code to make it keep track, so there isn't really a clean way to do that except parsing the xmls yourself and keeping record i guess?
To be more precise about the splitting part, My mod currently has 4 folders, mostly independent from eachother:
lua: where the magic happens and plays the sounds from script (currently it has to write in the LUA files the sounds of the scripts, I'm planing to change that to an external file)
radio: where the .xml files with scripts are
scripts: Where I generate the sound files to be played in the game
sound: Where the .ogg files are to play the lines
My plan is to split the mod into
Lua
And
radio
scripts
sound
Definitely didnt work
My idea is that with the framework (that only has the Lua that takes care of how the audio should be played) other people can add their own radio, scripts, and sound files without having compatibility issues.
currently, what causes compatibility issues is that I have hardcoded into the LUA script ids of my lines, so no one can add their own, since they would have to change the LUA script to do so
everything else can be avoided just by having a coherente naming convention (for instance, each mod that uses the framework has the files with their names)
you should make your code modular so people can insert their own lines into your tables with lua, otherwise you can use a custom script format but that usually seems like overkill
how can I do that?
if your file returns something, people can get that value using local whatever = require "filename"
the most common usage of this is to put all the functions, variables, tables, etc in your file into a single local table and return it at the end
then other mods can require that file and edit whatever they need to
I'll show you a part of my mod because i dont really understand :v
My lua has this
RadioWavs.files = {}
-- Example
-- RadioWavs.files[1] = "ZenitramJrMuricanaNumber"
-- add RadioWavs.files here
--BEGIN RadioWavs
RadioWavs.files[1] = "aece616a-4883-4e09-bd35-39aed89fe655"
... Code..
End
and a broadcast in the xml file has the following:
<LineEntry ID="d3e99611-97b3-4ac2-bc8a-cf9641b470c8" r="0" g="176" b="80" codes="DRU+1">${t:1.40}Y'all are watching Woodcraft!</LineEntry>
Where the DRU code is what is being used to get the RadioWavs.files
what I was thinking was adding the name of the xml file to the mix, and an external txt file that has the sound names instead of inside the Lua
That way, If someone also uses the DRU+1 tag, it differentiates the file using the xml name, and knows that if its from RadioData.xml, go to RadioData_dru.txt and get the first line, if its from CustomRadio.xml, go to CustomRadio_dru.txt and get the first line.
Hey there, friends! 😊
I've put together a fun and easy-to-follow tutorial to help you create your very own Project Zomboid mods using PZPW.
Get ready to unleash your creativity and take your PZ experience to the next level!
Check it out here: https://github.com/Konijima/pzpw/wiki/Tutorial:-Creating-Project-Zomboid-mods-using-PZPW
Can't wait to see what you come up with!
Happy modding! 🎉
so is the entry in RadioWavs.files the GUID of a sound?
not necessarily. I used the GUID for an easier convention, but since this mod is based on the Survivors Radio Mod, it can have any name you want
I'm trying to make it compatible for them, so I dont want to have to tell them "Hey, you have to change every name in your /script/sound to the guid instead of the names they currently have"
RadioWavs.files is just a list of strings, each string is the name of a sound to be played, defined in /scripts/{mod}.txt
wouldn't it be easier to use a lookup table of line GUIDs to sound names instead of using the drunkenness code?
I didnt make the mod :v but probably yes
oh!
im using it as a base for the one i made, but im trying to add compatibility without making an extreme overhaul
and you have permission and everything right?
drunkeness code was disabled, so i used it to call to a table of strings that match the name based on the value of the drunkeness. might have been easier to use GUID back then too, but i didn't know what i was doin 😛
when was 'back then'? the GUID wasn't actually passed to the event i assume you're using a while back, so it might have been the best way anyway
when did survivor radio add music? i can't remember lol, I had to take the original version down cuz of some dmca thing, that wound up being a whole bunch of dumb bullcrap
cuz true music gets away with it now
but i was the first mod to add music like that so
they had to pick on me : (
ooohh yeah that's unfortunate
if it's older than true music then it probably does predate the change i mentioned
@bronze yoke heres where @abstract raptor allowed me to use the mod, i was searching for this :v
hehe i assumed from her responding to this conversation but not addressing that that everything must be fine
😎
I'd go back and fix everything but it's an assload of thankless work plus if I updated it 60K + people would have broken radio saves XD
suppose that's a bandage that gets ripped off eventually but I just can't think of adding a whole bunch more content it's so time consuming
if we used look up tables instead of changing the names of the sound files, all you would have to do is go to every line, remove the DRU tag and change it for the _guid
if you want, I can make you a pythong script to do that
I been working with that since I started my mod to not have to keep track of all the DRU tags im making :v
lol i did it all by hand ha
lol
I cant imagine what it must have been, I've completely automated the generate script, tags, DRU and LUA process to save time
if not, i would have gone insane
@bronze yoke how could we make the look up tables, such that anyone can add to them from the mod?
as long as they're global (
) or the file returns them or a table containing them (if you decide to go modular)
mmm
here's an example of a module structure:
----------------
myModule.lua
----------------
local myModule = {}
myModule.data = {}
-- probably some code that actually uses this data!
return myModule
----------------
otherFile.lua
----------------
local myModule = require "myModule"
myModule.data[5] = "osodgkjdspgjgspdgj (real uuid btw)"
yes, this would probably work, but i guess i'll have to change some things
because I dont want to have the people insert values by writing like that, they should use an insert function.
yeah, by intentionally not including things in the module you can control how people can access your data
like keeping the data local but putting functions to insert stuff into it for example
so i should make
local myModule.data = {}
public function myModule.data.insert()
?
i dont know Lua sintax that well :p
something like```lua
local data = {}
function myModule.addData(a, b)
data[a] = b
end
of course with whatever checks and stuff you want to put in there
yes, i'll probably have a data structure where i have the _guid that gets called, and the sound that has to be played, both as string values
then, I search for the _guid and then get the sound
tomorrow I'll start work on it. then I'll make a script to translate the DRU tags (and remove them) into an otherFile.lua
Hello! Any modders here open for commissions?
of what?
Why is Recipe.GetItemTypes used? For e.g. [Recipe.GetItemTypes.SourCream] in a recipe.txt, but the ingredients underneath don't use that format and are instead just IDs
Is it because it's not Base module?
I'm building a map on Tiled and when I press "tools>WorldEd" there's nothing on it. any ideas what's going on?
one is a function to call in order to support dynamic recipes and tags, the other is for static items.
thank you!
``
local Scoped = 0;
local hasScope = getPlayer():getPrimaryHandItem():getScope():getType();
if hasScope then
Scoped = 10;
end
``
Okay now I have this and it works, but it gives me some error when the scope is NOT installed or the wepon with scope is not equiped.
You are accessing a member of nil which will give you an error
you'd need to write something like ```lua
local weapon = getPlayer():getPrimaryHandItem()
if weapon and weapon:getScope() then
local scope = weapon:getScope():getType()
Scoped = 10
end
Damn, you guys always make it look so easy. Thank you.
if you start to run into 100 errors you start to pick up on things
is there any mods that modify the global object UI to include a teleport shortcut to the object location?
the default debug includes tp on double click
This is a very minor nit that doesn't matter all that much: I think it's preferable to move calls for checks like that to a variable to avoid double calls (in this case, to getScope). The vanilla code does this repeated call pattern a lot so I can't blame mods for doing so as well, but it's unnecessary. What I mean is:
local weapon = getPlayer():getPrimaryHandItem()
local scope = weapon and weapon:getScope()
if scope then
scope = scope:getType()
Scoped = 10
end
Its similar to
if not getPlayer() then return end
Which is useful for events that might load Early even if there r no players yet
well i have a rule thumb of if i call a thing more than 2 times i make it a local otherwise i just use the function call
sometimes i lose track of what the variable does especially when i start changing it a lot
I think that ought to be just 1—in the case where any of those calls are expensive, that's extra work for the code. To each their own, though
I've the same criticism for examples like this, usually, especially if you end up using the player
i doubt the pay for such calls is that hardfelt
Nice
It depends on the call, but yeah usually getters aren't that expensive (thus, "doesn't matter all that much"). I prefer sticking to patterns that avoid causing issues in the worst case
well to each their own
i have a shitty laptop so performance issues will be mostly dealt with
Wait speaking of getters
We can use our own get function to act as boolean too
If im not mistaken
function getCar(player)
local car = nil
if player:getVehicle() then car = player:getVehicle()
elseif player:getNearVehicle() then car = player:getNearVehicle()
elseif player:getUseableVehicle() then car = player:getUseableVehicle()
end
return car
end
if getCar(getPlayer()) then ...
Yea that would work either way
I would just criticise that you used 4 times getPlayer() instead of making it a local lol
Yeah this is from my debug code
Snippet
I usually do this so i can copy paste a line whenever needed
There fixed it for ya
I mean technically we can even test if a function exists if we declare it as a table member
I dont think you need to even make a table first for that just declare it as a member
I actually like that about lua, almost everything can and will be made a table member
Howdy, im try to reskin a vehicle, KI5s 92' CVPI to be exact. While I managed to get the reskin to work with the texture being 512x512, if I upscale it, the texture doesnt get applied properly. Is there a way to upscale vehicle textures without that happening? Or are vehicles limited to that size
I'm unsure what you mean by this; tables do need to exist before declaring a member. You may be thinking of some vanilla tables that are declared as globals, so you wouldn't have to declare those
Based on this message, #mod_development message, it seems like it's more of a suggestion that they be 512x512 and not a requirement
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Note that this message is from nearly a year ago so the situation may have changed
sound, cheers
How do I randomize nutrition values on food items created with InventoryItemFactory.CreateItem
I only know how to do it when created via recipe
There is probably a getter and a setter for that
``
local animal = "Base.DeadRabbit";
local RandomNut = ZombRand(0.5,1.5);
animal:setCalories(animal:getCalories() * RandomNut);
animal:setLipids(animal:getLipids() * RandomNut);
animal:setCarbohydrates(animal:getCarbohydrates() * RandomNut);
animal:setProteins(animal:getProteins() * RandomNut);
local item = InventoryItemFactory.CreateItem(animal);
``
Tried something like this.
Hello, I wanted to know if anyone is willing to answer a few questions in regards to exercise fatigue? (trying to put together an item mod)
I promise it won't take long.
Sure show where the problem is
its more of a basic question
ZombRandFloat()
my bad that wasnt meant for me
ZombRand()
Is for integers
Ohh.. thanks!
Ah sorry skipped the exercise fatigue question
What are you planning to do? I believe this is stored as time actions
oh no worries, mind if I DM you?
God damn you are a lifesaver Glytch3r!
anyone in the know of editing lootable maps, such as "muldraugh map" and "annotated map"?
was wondering if it is possible to tinker with those in any way
Items can have an OnCreate function
is this about looting, maps or stash maps?
Yeah, I guess they can. I basically had the section ready yesterday but as always I messed around with some random stuff that broke it 😄
all of that can be customised
the whole shabam -- glad to hear!
This guide will teach you how to create Stash Map mods. If you have not already then it is worth checking out this guide on how to add lootable maps to the game world using the new procedural distributions system: Once your lootable map is in game (or if you are wanting to add more using the ones...
there's also in-game debug tools for map edit and stash houses respawn
anyone know why this mod doesn't work? its just supposed to be like a wearable prosthetic robo arm but it doesn't work at all, i load forever whenever i try and open it
I wonder if a button to this link could be added under the tools 🤔
Was thinking of adding a (i) button API for tools tips and stuff to some UI
where can I find the function for installing and uninstalling vehicle parts?
Hi, i need some help here. When im trying to add items to a container, sometimes i cant see them but they are inside, i need to restart server so they appear inside the container. Is there any way to refresh its state or something?
for i = 1, quantity do
local item = InventoryItemFactory.CreateItem(itemName)
print(item)
container:addItem(item)
end
are you adding them from the server side?
you can use sendItemsInContainer(object, container) to send added items to clients
ohhh, that was what i was missing
i was trying now using
requestServerItemsForContainer()
or
requestSync()
is this a method from the container?
i see. thank you!
if it's important to know for your case, sendItemsInContainer won't remove items, only add them
as far as i could tell when i was looking into this there literally isn't any way for the server to synchronise removing items from lua and i ended up implementing it myself
Wow! that had to be so annoying... luckily in my case i only want to add them but its nice to know that
the thing that getting me stuck its trying to spawn an zombie horde from a trigger. They use to be on the floor and then "remove stale zombie 5000" and all of them dissapear until i reset the server
have you guys seen this? https://steamcommunity.com/sharedfiles/filedetails/?id=2811855174&searchtext=mechanic
Looks interesting. Tchernobill makes very interesting mods
Hello, does anyone have experience with adding custom parts to vehicles?
I'm adding seperate parts to my vehicle, they get detected and added to the mechanic screen, but they aren't visible in 3D.
I've tried changing the base mesh of the vehicle to see if it's an issue with the meshes, but after displaying individual objects one after one they appear with no problem as a base mesh, it's just the parts that are being difficult.
can you show the script for one of these parts?
Ye this is bil's mod
huh?
module Base
{
model Wheels1
{
mesh = vehicles/Vehicles_c1|Wheels,
texture = c1,
scale = 1,
shader = vehiclewheel,
}
template vehicle c1
{
part Wheels
{
model Wheels1
{
file = Wheels1,
}
area = Engine,
category = c1Parts,
specificItem = false,
mechanicRequireKey = false,
repairMechanic = false,
}
}
}
try```
model
{
file = Wheels1,
}
iirc naming the model like that is used for when a part has multiple models that can be swapped out, and that might make it start not visible by default..?
Testing
Didn't work
oh also I should note, for my vehicle script I'm simply doing
template = c1/part/Wheels,
if that matters.
yeah, my models have also been stored in a template and worked fine, so that should be okay
Yeah I've been trying to figure out what's wrong with this since yesterday it's been a pain
pretty much went ahead and replicated what I saw on other mods for parts in the same format but no avail
it finds the template since it's visible in the mechanic view, so it's pretty weird.
Any other ideas?
sorry, no idea - your models seem to be done just like mine are
i didn't have any issues with models at all so i don't know any 'common issues' or anything either
Damn, alright. thanks anyways
yes sorry guys
how to read the map that is in the inventory?
Welp... It's been a week since I looked at my vscode extension code..
Thanx mate, I am stuck on this because I am too bad at making animations. If someone wants to do combat animations for it I'll put it back on track
Can anyone teach me how to make custom jobs with special crafts?
Really like your mods. You're a creative person.
I really wanna fiddle with the battle moyale map.
How exactly does it work, like what happens when you use the manhole cover and you goto the safezone, does it tp you somewhere or just take you out of "game mode"?
Can you move the circle to a specific region if you wanted a specific town to be a play zone?
Does it work on non muldraugh, ky maps like daegu or desert_base?
when you use the manhole, nothing special happens. so your player remains on the same position, can die and still play. I have not decided yet what to do. Put winners in a specific place would be nice but it would require to make a map and therefore lose compatibility with other maps.
to move the circle to a specific region you need to mod the mod (it has been designed for this)
to make it work with other maps, you need to mod the mod (it has been designed for this)
When you say die and still play, does it remove the zone and you just play like normal or you can enter the safezone and still die by being outside the zone?
when you exit through the manhole, nothing changes on the world (currently).
the only thing is the star next to the player (and the removal of the manhole)
I gotcha
so you gonna die 🙂
unless you disconnect or get admin invulnerability ..
I'm currently working on making it solo compatible
It's really really creative mod. I thought about pairing it up with a mod that enabled brush tool for people, could be fun. I love mods and maps that completely changed things like this.
thank you.
I did not think of that 🙂
I was more thinking on pairing it with vehicle mods when the zone moves fast
That's also wonderful you made it so it can be modded for other maps. Like I've seen some hunger games arena maps that this would be amazing on or specifically made pvp maps.
Awesome I never diged into maps I did not know there was PvP ones
I want the mod to be used and I cannot adapt it to all maps by myself so the modularity was required
Not a lot but there's definitely a couple I've seen. I think there's at least 2 hunger games ones, a stalker zone one and then some other random ones. Shit there are even island maps it could be fun on.
Or the Elysium map would be pretty fun with it too, really well made peninsula island thingy
🙂 It's all in the hands of server owners now. (well and then it will be on me to maintain it because it is likely to be bugged)
Another interesting variation I thought of would be if the outside zone worked like the toxic fog/anomalous storm where you could go into it with a mask. It's so creative I really hope to see people go crazy with it
the mask is a good idea. can I borrow it ? 😄
Brother it's your mod and your world we're just living in it 😁
hey
how can I dlete an item from a mod? I'm trying to delete the bomber jacket from clothesbox, it conflicts with the spongie's one
I erased most of the lines in the scripts, lua, and .xml but I still have that option shown in the character creation menu
so far the item doesn't load and picking it just get's you to the none option
can you simplify it?
I'm not into coding, I just want a clean modlist
I'm also revamping clothesbox textures, I'll appreciate some guidance
I write code to test your scripts with all PZ libs)
And mock file (with instruction)
If anyone has any ideas for improvement, write
I made a mod that modifies client/TimedActions /ISEatFoodAction.perform. Is there any way to modify the server-side handling of eating to make this mod multiplayer?
what serverside handling of eating?
Is it completely handled client side?
probably?
😓
player stuff usually is
hmmmm. Working in SP but not MP. back to debugging...
btw, it turned out the issue was InventoryItem.getUnhappyChange vs InventoryItem.getUnhappyChangeUnmodified. Anything with a modifier wasn't "resetting" properly, causing the drift. Now that I'm subtracting the two values and inverting it resets properly.
I see a number of people working with ISEatFoodAction.perform, please remember to patch both perform and cancel.
making a pz modding oriented extension?
The unfinished extension is already available for use. Look up ZedScript on the marketplace.
I tried to see if you worked on any other mods but when I clicked your account it was private.. I just searched your name and you have a lot of cool stuff, would your auto mechanics mod be a quick adjustment to just keep attempting to install / uninstall the part you selected until completion ?
I tried to add a new recipe but its not working, any idea?
recipe Make GunPow Test
{
keep [Recipe.GetItemTypes.Hammer],
Sparkles,
Result:GunPowder,
Time:150.0,
CanBeDoneFromFloor:true,
}
Also, I couldn't get this to work either:
recipe Make Glue Test
{
WaterPot;5,
keep Spoon/Fork,
Vinegar=2,
HairGel=2,
Result:Glue=1,
Time:300.0,
Heat:-0.22,
CanBeDoneFromFloor:true,
}
Is there a way to change the player character VOIP distance? Like having whispering and yelling?
I haven't seen much about it, wondering if I can change the distance a player's direct VON can be heard
Hey Coding buddies, funny question:
Ingame my mod is marked as [ERRORS] in red in the active mod list (bottom right).
How ever my mod doesn't actually throw any errors.
And i have 100k+ lovely test subjects that have not come back with anything soo ... Why is my mod getting flagged as having errors ???
check logs 👍
Is there a way to prevent a zombie costume from showing up in it's inventory loot when it dies?
I vaguely remember something about not including the item in an xml or txt, I can't remember
There is an event if im not wrong that fires on zombie death maybe try using that although that would be costly probably
Not "👍 ". like I said, there are no errors in the logs. it has nothing to log about if there are no errors ...
unless its mad about 1 missing translation which I highly doubt. which is not even a "hard" error more a warning.
that's weird, there are always Error logs. You must have messed really hard to not have Error logs.
What about Stack Trace / Severe logs? Do you have some of those?
People keep mentioning mods marked as having errors -- where is this on the UI?
Cause I've had people say one of my mods is marked red -- with no errors either
Also @cunning kestrel if you're playing in MP the clientside errors go to console.txt -- the host side goes to coop-console.txt.
Main Menu, bottom right corner that says Mod List or something. It shows a list of mods that are used currently. It is also available in-game.
No, just marks it in red with an error tag I think.
I could probably rig up errorMag to work inline with that maybe
nope not a single error pop up just marked red
Please check logs, just because it doesn't pop or throw doesn't mean much.
Also, check what I mentioned about MP if that's applicable
Alot of people, especially modding, don't know to check coop-console. Making stuff work right in MP is already hard enough 😅
my mod is marked as FWO feel free to have a look, im lost
coop-console only has "LOG"' 's no error/ warnings ...
When errors occur they're printed as "stack trace"
Or "exception" in some cases
That's also not the co-op console - I'll assume you're on SP then
What is your FWO mod? Cause there's a bunch of errors about salvage cars having messed up recipes
ow thats the wrong one
yeah that mess is not mine 😄 "Fitness & Workout Overhaul" (FWO) is my mod
I don't think translations throw errors.
yeah but thats even just a warning.. idd. so I highly doubt thats flagging it
But failed require or missing sound. might?
Have you tested your mod in isolation?
hmmm oke so in single player its not marked as red
well thats the translation and calling / starting a sound (no idea why/how to preload it), never been an issue ...
I would have to check how that list marks things as red -- including ERROR in a print does do something but I don't think it counts as an exception
Not using proper translations should be a warning, there's no impact. As for sounds you should look into scripting it as it offers more control, but that's also not a big deal.
I'm not sure what's throwing the conversion thing with string and boolean
i believe thats just and "if exercisestared then" call so dont see the big harm
Also translations can take in variables using the %1 macro as an argument to getText()
try hosting with only your mod and see if it makes it red
I've just never seen that kind of message before - unless that's you printing it lol
I'm pretty convinced it's the translation thing
It's thrown pop-up red errors for me in debug mode before
hmm really ???
Way back when I used getText() instead of getTextOrNull() for conditional speech, yes
I did sadly
I abused the translation system to operate independently between languages for cnd speech
So I had something check if the phrase existed or not - would throw an error for each moodle
But in preBoot
I've since changed that- so maybe flagging it as a pop-up was changed(?)
Are you also in debug mode?
my translation error comes from an context menu item thats defined inline instead of with translate var ..
If you use getText("ContextMenu_treadmill", 100)
Where "ContextMenu_treadmill" = "Use Treadmill fitness (%1)" it will replace %n with the given parameter
Try removing getText() and seeing if your mod still turns red
I'm really curious how that modlist feature works now
it does seem like a strange thing to fail on, especially since it knows and marks it as warning and not error..
You said it wasn't marked in SP, was it marked when you tried hosting? And do you have logs from that instance? - console/coop-console
It says ERROR though, I was saying it should be a WARNING for the sake of idk technicalities (?)
yup checked the console one and was clean. did not knew to check the coop one tbh. but besides the sound and translation, no clue
Unfortunately I'm not home, but if it's not the getText idk lol
Actually... I uploaded the Lua to GitHub
Can you screenshot the UI that's red?
i can, say what would be the best way to test this on dedicated server without uploading it ? copy paste to the dir?
Local host is good enough for testing things.
^
Unless you need to test with others 😩
but it would still load the "server dir" files no ?
You can start the game twice?
If the mod turns red in SP you don't need to check MP tbh
it did not
In non-steam mode yes.
Yes but if I set noSteam on then I'll have to juggle my mods out of workshop and into mods/ while also changing their file structure
Yeah, better to not be subscribed to your mod when testing, or change it's id.
I've asked that noSteam still load local Workshop folders for this reason
Sounds like another guide that I'll need to write.
Also one of the things I want to do for comm proj, is display duplicate modIDs in the mods list and if possible let people control which directory is getting enabled
i have mine under user\Zomboid\Workshop\ never been an issue ... atleast in solo
That's fine, were kind of talking about another topic
I usually use mods/ but that's because I'm old.
I only toss into workshop/ to upload.
Found that to be the easiest setup for modding MP.
For MP yeah
I upload from workshop, so they are there. But I also have a symlink to the mods folder in ZomboidDev.
And that's why I need Linux.
._.
So like the sub-directory is "linked" too?
:0
I kind of wish the local mods folder could just accept workshop structured mods too
Would make explaining stuff much easier
- keep the file structures for modding to one thing
They could still support the old method too
@fast galleon the UI is in ISPauseModListUI
Seems like it's just adding to a global list of modIds
The addition to the list isn't in Lua though
So I can't track it further
My best guess is there's something scanning coroutines and prints for the phrases "ERR" or "ERROR"
Would be cool to have one to change it to yellow for warnings 😮
If PauseBuggedModList[modID] then
Yes, but there doesn't seem to be any uses outside of that and the define
Git repo is just the Lua folder for tracking changes
Not home to check if there's java sided stuff
hm, could be in a DLL somewhere?
Could be - but that seems like a waste... Shouldn't the java be able to put onto the table?
Actually it's kind of odd it's a table and not an array 🤔
-_- oh great, its one of those ghost bugs... I saw it being flagged, even had a user report this aswel.
Going to have to revise my layout for linting ZedScript however..
Saying what scope is missing will go away but essentially working on diagnostics.
Actually, modID yellow but name is white is "not found"
But it should display [not found] apparently
Both your mods have the same modID?
@cunning kestrel
no its 1 workshop items with 2 mods/ ids
The yellow portion is meant to be the modID unless my Lua is old or I'm misreading
if you are refering to the sceenshot thats edited highlighter, its just showed up white > no issues
Oh ... Lmao
😄
I was so confused why it was missing stuff too
nah nah all good
nice
The error would have to occur first before it turns red though
hmm.. truue... brb 😛
Hi, I am currently trying to save data in the current game world save folder. For solo game I got the path right, but I am unsure what I should use for writing / reading files in that case. Do you have an exemple of mod that does it ? (I am not talking about Zomboid/Lua folder.) If it is a bad idea can you tell me why ?
You can't write to save folders afaik
Your options are mod installation folders or the cache's Lua folder
Would be nice to be able to write into a directory within the respective save tho
For solo I can use my player mod data to store instead. but for MP how do you save world related data ?
oh KahLua LuaClosure, weird.
Yeah, I don't think I've ever seen a java sided thing handle as Lua lol
In a few of my mods (with Konojimas help) I got globalModata to be one directional
But if all your operations occur on the server-side it should be fine
The issue is clients don't have access to the hosts'
So you'll have to set up update events
I'm good with that. Thanx 🙂
So, Good news is it doesnt give a S@#T about the translation errors, nor anything from the benchpress excercise... its doesnt seem to like the treadmill though... although still no errors ...
I think the next step would be to see whats added to the flagged mods list
it's in the function that returns the string of "function ... | MOD Modname" for the error to print the stack trace.
Well.. then it has to be in the coop-console
Or somebody really wanted to highlight that mod.
Should also be noted the console logs reset when the game is booted up, and obviously errors only get printed once they occur
You could try my mod errorMagnifier
But I didn't write it to work in MP
i ran it on dedicated this time, ill try in SP ..
NOPE SP is fine, unaffected. white.
Check coop-console after the mod turns red
euh so in-game hosted server > no issues ...
didnt even turn red
So the issue is only dedicated?
its looking like it...
The error should be in coop-console
there should be a log with "..." + " | MOD " + modName when it happens. Otherwise somebody else might set it manually.
coop-console doesnt show up for dedicated though right ?
It should appear alongside console.txt
I didn't want to consider that yet lol
SS's second dev added cross mod error reporting and thankfully Nolan removed it
Also if there's no other mods that'd eliminate that
Oke, dont ask me how, but im pretty sure my mod is getting falsely flagged .. xD
Dedicated server, just my mod, no issues , white.
how is that even possible ...
Do you use intelliJ?
You could search your entire Workshop folder for uses of your modID
currently VS
But I can't imagine someone else is adding your mod to that list
aaah thats an idea
no coop, got server log but, nothing usefull
At the end of the day if nothing is getting impacted - does it matter?
You could remove your mod forcibly if you want lmao
From that list
I'm surprised that TIS hasn't merged the mods/ and workshop/ stuff.
Only creates confusion for newcomers.
in the end. no, but now i'm curious :p also what are these false accusation xD
non-steam can get over having to use the workshop packaging for mods.
I agree
workshop for work, mods for installations ? 😛 okey yeah its confusing
last time I had a similar problem was when I had subscribed to one of my mods and it was in my local steam mods container (which is different wrom Zomboid/workshop and Zomboid/mods
Line 1145 buts no errors that i see.
true, ive never even looked at the Zomboid/mods dir TBH. mods go in the steam dir and my stuff in zomb/Workshop easy
I currently work on User-Interface / User-Experience for a living so I'm constantly thinking about how to simplify and remove the wasteful, needless actions to perform tasks.
I see mods/ and workshop/ as needless distinctions.
Technically there're three of these folders.. the third being the workshop folder workshop/108600 in the Steam install folder.
The thing is most people would I assume are downloading workshop mods and having to pull out the internal mods/ folder
So it would be less work for them as well
This is what I mean by needless actions.
Keeping things the same format or folder structure would reduce time having to transform and package mods to upload to the workshop.
This would reduce time working on MP mods moreso since non-steam mode is friendlier for MP modding.
As a Test Engineer I agree.
How do you stop properly a server ? I've always closed their window with the top right cross till now but I need to test the save function.
Any idea about how to spawn a zombie horde from a trigger?
Im trying this but for some reason zombies spawn on the ground, lying around and then the message remove stale zombie 5000 appears and the are gone. If you reset the server they are there.
I have this file on the client folder and i call it from the server side
ServerCommands.SpawnZombies = function(args)
print("RECEIVE SPAWN HORDE")
local coordinates = args.coordinates
local amount = args.amount
local radius = args.radiusw
SendCommandToServer(string.format("/createhorde2 -x %d -y %d -z %d -count %d -radius %d -crawler %s -isFallOnFront %s -isFakeDead %s -knockedDown %s -health %s ",
coordinates.x, coordinates.y, coordinates.z, amount, radius, tostring(false), tostring(false), tostring(false), tostring(false), tostring(100)))
end
for dedicated type "quit" in the server console, ingame hosted just esc > quit i suppose
thx
"for some reason zombies spawn in the floor" raise the Z axis ?
i mean they are lying on the floor, not moving, like knocked
change these: -crawler %s -isFallOnFront %s -isFakeDead %s -knockedDown %s
you can test this. / see the same result with the horde spawner in debug mode.
wdym with the "/"?
Wait ... Even with symlink wouldn't that cause issues as there's a priority for the mods folders(?)
Iirc steam contents > workshop > mods
its a slash ... "and , or, also" no ? just go try it in debug you'll see
you mean add the / instead of the - like /crawler %s /isFallOnFront...?
hmmmm, i believe zomb/workshop overrides the steam/workshop ... atleast for me. I edit my mod and never unsubbed from my workshop published one... always loads my "dev" version
but maybe that's only for self published mods ?
no no no, the command is right i believe. your values are just wrong.
is OnSave event called on a dedicated server ?
is the following error normal when I quit a dedicated server ?
thats fine.
but its just a true or false values, the rest of them are okey because it spawns the number and in the correct coordinates
isn't there a saveall command?
yes but look, this is what your seeing right
Events.OnDisconnect.Add()
Events.OnSave.Add()
not sure about saveall
Command, not event.
so they are not knocked or fallonFront or anything, it looks like the server cant process them and removes them. if i restart the server, they are all ther
No, steam contents overrides workshop upload folder for sure
I wanna believe you but then my pc is just being special. cause its reverse for me xD
I have seen this when copying over an already existing mod though,, but never with my own, lucky me i guess
If you updated often you wouldn't really notice
Or if you reload Lua mid game maybe(?)
I've stopped subbing to my mods cause it's a pain to unsub
sounds more like a server client/server sync issue somehow ? sorry im out of ideas
@sour island no, thats the crazy thing, ive done nothing special. I can just start editing, load up a game and see the change ... while subbed somehow
thanks anyways dude, i appreciate all the ideas 🙂
Does anyone know what happened to the mod Equipment UI - Tarkov Style Interface ?Because the developer said that the update would be released in April and nothing has been released yet, nor have I seen any announcement.
We dev here.
ok
🤷 I glanced at it, haven't tried it yet though. I tried PZ-ClothingUI buts it still clutters your inventory so ...
I am most interested in the grid inventory system. but i talk in #mod_support
Hmm.. I suddenly have two spare towers on my hands.. Going to probably wipe them on my lunch break.
"Recycled" from work.
thats a cool idea, brings me back to starcraft UMS maps
Has anyone so far found a way to use custom fbx for player/zombie model? I seem to be able to define block from model parameters just like for regular world item, and then pass the name of it into
player:getVisual():setForceModelScript("moduleName.modelName")
and it shows up in getModelScript, as well as has correct values in it.. but character model remains the same even after getPlayer():resetModel() ... and player:getVisual():getModel() itself doesn't seem to want to cooperate on anything for some reason
I just wear zed dmg
I use x file
Dang this tempts me to post all my zeds
If they spawn in the floor try adding 1 to the z coord?
I'm not sure what you are referring to tbh.. can you explain in different words? Also the links are broken I think
that does look interesting, how did you achieve it?
ZedDmg is attachable similar to clothing but you dont see it in the inventory
So basically i create clothing
Make em zedDmg
And wear it using lua
ah so it's not a character model replacement but rather a non-item costume model.. I see..
Yes
It does sound great but sadly not for the purpose I am looking at.. the models I want to use won't be that great as costume
yeah 😄 me too hahaha. But its getting hard
im sorry, i miss spell it,. i mean they spawn lying on the ground
How odd
Like i said they are not costume
Its just a workaround
You just have to mask everything
You can be anything u want aslong as the number of joints doesnt change
Is there are documentation on this?
Thats the limitation
I can imagine a last stand (the oldschool flash game) type map. hordes spawn increasingly every round, time before rounds to rebuild and upgrade barricades, vending machine mod to pick up cash and buy weapons and attachments
There's the mod that I've only seen referred to as the "peach body" mod—the one that changes the bodies of female characters. Dunno how that mod achieves it and I don't know what it's actually called
Ugh not really i guess
But you could look for the clothing mod and the clothing mask guides on the threads
Mod resources
Yeah its the same
Thing peach does but his using fbx and its clothing mod
He wears the model
I attach it
Different method same result
He enanles player to collect the skin
wish there was a 3rd option of just replacing the mesh
That will replace everything
Everyone will look like that
Whatever it is youre modeling
Whats your model anyways
Also #modeling
Is a better venue for your needs
I mean not everything, but like specific zombie that I spawn with a specific fbx model
Btw im only using vanilla files
Peach does his own model
Thats what i did on my last mod
Vampiric
Turns the zed into that at night time
And turns em back to normal when its morning
nice banner in code
the commented ascii art on top before links.. in VampHandler
so you are basically using media\models_X\Skinned\MaleBody.X as clothing, masking everything else
Thank you no one ever noticed that
Yes!
Like i said of youre a modeller then the limit is the rig
You cant change anything
But other than that youre good to go
what's m_GUID there in those xmls?
not sure I've seen this id referred anywhere before
You have to provide unique guid for all clothing
It should match the clothing item and the compiled guid.xml
Fieldguid i think the name was
do I generate it somehow or just random as long as it's unique?
i think there is a guid generator online
ah ok
wow!! that will be so amazing hahah
anyone knows an guide to make mods?
anyone knows what each number means?
public static void spawnHorde(float x,
float y,
float x2,
float y2,
float z,
int count)
probably a region from (x,y) to (x2,y2) on z elevation, and count is number of zombies to spawn
it can be anything as long as it is unique
you can google a guid generator
Quick question guys, how would you mark a food item so that its distribution is controlled via the Canned Food rarity setting from Sandbox Options?
For example in this scenario, I have rarity settings **Non-canned = None **and Canned = Rare.
I also marked **TomatoPaste **with CannedFood = TRUE.
But LootZed still says 0% chance.
it should just be cannedfood = true
no idea why that isn't working for you, that's what it's supposed to do
Hmm I see. I'll go through the item script again, probably I missed something there. Thanks for confirming how it is supposed to work.
How are you adding that value?
Surprised that you aren't posting the full file.
Are there any modders willing to do commissions?
Quite a few.
Sweet.
Anywhere I should look specifically for it? Prefer discord since negotiations can occur way quicker.
Here or some market, possibly.
I have my market but it's been inactive for months.
(Too busy writing tools to focus on it)
Feel free to post the commission here too. Other modders may want to bid on it.
Ah you take it
hey @ancient grail did you try pzpw yet?
yellow!
so im trying to make a thing that will use code from inconspicuous trait to function but i cannot find the lua file related to the trait functionality. i found the code that adds traits but it didnt have anything about the functionality
any idea where id find the files
maybe isozombie.class? i would expect attraction logic to be handled there
honestly quite incredible
you'd need to decompile it
im too tired for this rn
i'll warn you that there's basically no way you're going to be able to hook into this stuff with a normal lua mod
I am willing
you can think of LUA as the frontend and Java is the backend.
you'll need a java decompiler... it's been over 10 years since i touched that stuff... but "Eclipse IDE" should still be around.
lua you can mess around with any text editor, it's also absolutely horrifying to work with beyond 10-20 lines of coding
mostly because the syntax doesn't have curly brace brackets (then and end) and needing weird workarounds for most built-in things I have taken for granted in the last 8 years.

where is the zed tripping codes located is it java?
not yet sorry
It may actually be in Lua. Someone made a mod that makes zombies trip randomly
first one
our monkey
his afk atm
but i guess he added the tripping on the mod he did. cuz otherwise he would know cuzs the no trip thing is his current project
im experimenting on something
wonder how dislaik did it with the dog
@ancient grail no worry man, when you feel like it check out my new tutorial https://github.com/Konijima/pzpw/wiki/Tutorial:-Creating-Project-Zomboid-mods-using-PZPW
Been updating pzpw, we are working on improving it alot
the intellisense on this is crazy, cover both java and lua, and allow usage of clean classes structure. I will be starting a video serie soon to show how to use it in live session
Feel free to PM and disucss your idea
:0
Does it handle inherited methods? PzDoc does not
the old one fails on some files too, is that resolved?
Is there anything that could auto encode files for translations based on the directory they're in?
Anytime I touch translations files I seem* to break encodings
I like to take people's translated reupload of my mods 🙂
Hello there, I am trying to understand if it's possible to use an external software for PZ Voip, like they are doing in Red Dead or GTA.
I know SaltyChat works well, but how is it possible to add to Project Zomboid.
Right now I think that I need to get
- the coordinates of players (can be accessed)
- the frequencies and microphone state of talkies (should be accessible too?)
Have anyone tried something similar previously?
New idea: people uploading to the workshop whos "mods" have over 5+ modIDs should at the very least see a pop-up informing them unlisted mods can still be accessed by players.
Hey guys, I'm a random who can't read/write lua to save his own life, but I have a semi-functional mod that can switch voices for different voice reactions via lua (instead of the replace stuff in script method which has some drawbacks).
Right now, it's really primitive, and it'll produce a voice reaction when: a zombie dies (I don't know how to restrict this to specific weapon types); when stomping; when shoving; when attacking with buttstock.
Originally, this was for calling 'hits' when using a firearm, since the script method emits sound from the zombie when they're hit. I have no idea how to proceed from here.
Also, don't know how to make it call hits. RIP
Or should I just wait for Build 42 since there's gonna be voice updates then.
Hey 🙂
For player coordinates:
getPlayer():getX()
getPlayer():getY()
getPlayer():getZ()
and for the frequency of the device:
https://zomboid-javadoc.com/41.78/zombie/radio/devices/PresetEntry.html#getFrequency()
what is PresetEntry? you might want https://projectzomboid.com/modding/zombie/radio/devices/DeviceData.html#getChannel() instead
I believe it can be done yea
I need to check how tools like saltychat access the data from the game
is there a cache file that is written from the game and then read by TS3
i think the most common way is, using a lua mod, just write the data to a file and have an external program handle everything else
somthing like that
Yeah exactly what I was thinking
The question is how the data writing rate is handled?
You would need to have the coordinates of every players updated every server ticks
Apologies to whoever runs the workshop page for PZ. Im in a several hours zoom long meeting, and I reported quite a few mod packs using skill recovery journal.
Anyone know of a way to file DCMAs with out doxxing yourself? Filing for a representative/LLC seems excessive...
generally just threatening to dmca is enough
Some of them are months old with DCMA warnings in the comments by modders who are inactive I assume
The uploads themselves are p inactive
Just seems like a good garbage sweep is needed, and afaik DCMAs take down the content unless it's counterclaimed
scary if true
but being forced to dox yourself to dmca is also scary, so i guess it balances out 😅
I think if they don't care they can put fake info
DCMAs are all about plausible deniability for Steam
"we did the thing 🤷♂️ " -Steam
yeah pretty much
i mean any kind of manual review process would probably be kind of impractical on steam's scale, but i'm kind of surprised we don't see more harrassment through that method
It isn't spoken about, but I know of a recent case where the person didn't want to counter claim for privacy reasons
Harassing through DMCA is a hella big legal problem
I remember that happened in a big stink in Arma 3 modding scene where someone got salty and DMCA'd RHS
and the guys at RHS were nice enough to not press charges so....
It is more serious than people think but at the same time it's also easily avoidable
As far as I know - outside of moderator intervention - the only way to get your mod relisted from a bogus claim is to counter-claim
Not sure if you get the claimants information before counter claiming
Just seems like a big stink to deal with
Hence I just reported the listings for now
And that's just cause of bug reports from people using modpacks while also subbed to the original mod
time to figure out what attachmentNameSelf means as a parameter for weapon attachments. 🤔
Probably what's used to identify the part type?
I feintly recall the term when trying to make spears use attachments instead of tipped spears acting as whole other items
But alas, the hammer spear was not meant to be
maybe. All the other parameters make sense
one thing I've noticed is when placing guns on the the ground with attachments they sometimes don't line up. Is this a me or a zomboid thing?
Might be a zomboid thing
attachments have always been a little iffy
zomboid moment 😔
I don’t know how zomboid uses models but there are WorldStaticModels and StaticModels
So maybe one uses the other
guns don't use a world model, they use their only model
and I know attachments don't suddenly use their world model because one the attachments, because I haven't done it yet, has a totally wrong world model
hello everyone! is there any way to read, create and write files with Kahlua scripts? since Kahlua does not support io library
use getFileWriter()
e.g.```lua
local writer = getFileWriter("test.txt", true, false)
writer:write("test")
The biggest culprit is there isn't an universal way to adjust models when they're rendered
there's a getFileReader too
Even on-ground and in-hand are two separate files when they need not be
I think on world has an attachment that can be modified
But if the model is designed for floor, there's no easy way to make it line up in hand
Would be a good deal of work I imagine to reposition all the floor models for being held
Unless there's a way to reposition the models for in-hand via scripts that I'm not aware of
the vanilla weapons don't even have WorldStaticModels set so i assume there is some workaround for that
aaaaaaaaaaaaaa
it's like the attachment goes from being Z up to Y up. But the choke doesn't do that
I think the vanilla choke has inverted normals too now that I look at it...
eh then I just won't worry about it
thanks for your answer! but how to deal with EOF in java when using getFileReader or getFileInput?
use :close() when you're done with it
here's the documentation for the classes those return
https://projectzomboid.com/modding/zombie/Lua/LuaManager.GlobalObject.LuaFileWriter.html
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/BufferedReader.html
i *think* they always write a valid file regardless of what you do
oh, sorry, i think i misinterpreted your question
ready() on the reader will tell you if it can continue reading, so usually you just loop reading until that returns false
getFileInput isn't usually used so i don't really know how to use it specifically
im trying to make a trait that will spawn players in with weapons from the Vanilla Firearms Expansion mod. Is there any example of how you would go about referencing an item from a mod? Like the item reference can't be "Base.MP5" right?
Do you happen to have an example mod adding a new weapon? A friend of mine has been struggling with his a while ago
it's whatever module that mod defined that item in, you should be able to see a module at the start of their script file
e.g. in vanilla you'd see module Base {
you'd reference it as (for example, i did not check if this is actually their module name) "VFE.MP5"
thanks. also how do you force a mod dependency? like my mod won't be useable without VFE
in mod.info add a line require=modid
if you have multiple required mods separate them with commas but no spaces
VFE's weapons are all in base, so yeah "Base.MP5" will get you it
the getFileInputreturns a DataInputStream object, and it has a available method which returns a java integer. how to transfer it into a lua integer in the while loop?
oh my god I figured it out...
So, when mounted on the weapon it takes its rotation in the scene when it was exported. On the weapon on the ground it uses the mesh's local space
so by applying rotation it started making sense.
I don't think any of my mods add a weapon (at least in the usual way) your friend could look on the workshop. There's plenty.
sup fellas
im gonna cut it short
I want to find out how to correctly take a player model from the game, unfortunately the .X files seem outdated or I'm exporting them wrong
what way have you guys taken the player models in a way that actually works?
by exporting wrong, I mean the mesh will turn out like this
probably the most noobish question if you're used to working with pm's
it seems that getFileReader and getFileInput could only read files under certain directory. is there a way to read files in other directories?
Are you exporting through new or old blender?
new
the file viewer itself is, let me see
DxViewer
New blender doesn’t really support .x well in any the plugins. Old blender has a native .x exporter, and it needs to export Z up. So expert from new blender as FBX, import into old blender then export as .x
It’s a bit headass but it works perfectly for me. At least with weapon models.
I dunno what you’re doing as your screenshot won’t load.
I'm assuming the dress-like effect is normal in DxViewer then?
Ah, it's a screenshot of a file viewer used for .X files
the mesh itself has a dress-like thing for the male mode, instead of it just being two legs.
Oh is it clothing?
That's what I was mainly curious about
Seems like it
but clothing shouldnt be applied as it should be the base model
as in only the base model, yet, like I said has this clothing effect like it's wearing a dress. So I don't know if it's a weird bug or whatever
Did you export only selected?
It might be a turned off visually but still getting exported model.
Ohhh you think I exported it, okay I'll explain this more clearly.
So I'm looking into the Project Zomboid dir, I needed to grab the male model. So I found it and viewed it with a model viewer on my pc.
However, though, the male model in the directory has a dress-like mesh problem to it and I can't figure it out why - which I want to solve before I import (just to make sure it's the right thing)
I guess my struggle is trying to find out why this model straight from the directory has a weird clothing bug
I technically could import it and delete the problematic mesh parts but it'd still be nice to know why this happens
there is getModFileWriter/Reader for the mod directory
but i don't recommend using that one, it'll lead to checksum issues
didn't realize the other two chats existed and just joined, not really a trend just a new user
I mean in the last couple weeks.
I flip around in Discord and read here every so often. Seen it a lot. Noticeable.
I'll be out of everyones hair soon lol
It makes sense if we're looking at Lua code with models not working sure.
alright i'm trying to write a mod which could copy saves in the game
In-order to work with modding playermodels you need to understand modelling them as well, makes sense to me in a way at least someone here would know something
I'm stating an observation, not convicting or attempting to moderate the chat.
Oh yeah I know
I was just stating my perspective when I joined
i don't think you'll be able to read from there
could i somehow use java libraries in the kahlua scripts?
java and lua?
You can't expose Java outside of Java for Kahlua.
You'll need to core-mod PZ to support additional API.
Take a look at zombie.Lua.LuaManager.class
alright. i'm gonna give up.poblems solved.
i also considerd using windows system dll, but it seems too difficult and i wonder whether kahlua support it
From how you're wording this, it sounds like you don't understand or know the environment. You can support DLLs in Java using JNI.
Kahlua is a reverse-engineered pseudo Lua 5.1 runtime library at the end of the day. All it cares about is interfacing with Java and Lua closures.
ok. thank you anyway
frankly, the only difference I saw was that my friend was using a .fbx model while the mods I saw were all .X
But his model just refuses to display in game
have you tried downloading mods off the workshop and comparing their structure vs yours? probably already did this but still that'll help
crowbar is good for decompiling mods
That's a modeling question - I've only repurposed existing models
Is there a way to disable the base game clothing choices for spawns? i am developing a spawn mod and none of the choices are what I have in mind for the new professions
fbx and x should be perfectly interchangeable
Is there an easy way to save mod data beyond a save?
Want to save some settings for a dev tool I made that should persist across all saves.
File writing / parsing it is
Dev tool? @wet sandal
If it helps I have a modified JSON utility that works with PZ.
Makes life easier when you can read/write Lua tables as a string.
Reminds me I need to rewrite easyConfig
Woops. Meant to tag @wet sandal
This could make your IO stuff easier. There's TypeScript code but it shows you the same calls you can do in Lua.
Let me know if you'd like me to write these IO functions in Lua.
hello, I think I asked you about Metatables before... Did I write this code correctly?
local metatable = __classmetatables[SandboxOptions.class].__index
local old_SendToServer = metatable.sendToServer
function metatable.sendToServer(self, item)
old_SendToServer(self, item)
if isServer() then
Daikon.SandboxOptionsSyncing.UpdateGlobalModData()
Daikon.SandboxOptionsSyncing.ForceClientsToUpdate()
end
if isClient() then
Daikon.Commands["RefreshModData"]({})
end
end
that looks correct to me
okay then... Hmm
I got a report that it broke changing the sandbox settings via the admin panel
does it work for you?
For now, just want to add the ability to hotkey reloading favorited lua files
Thank you, this looks much better than the barely functional parser I just wrote
Glad to hear.
for me... It did. Though I tested it with just my mod, and they tested it on a truck-loaded server
SandboxOptions.sendToServer doesn't seem to take an item parameter?
that's probably the issue
Oh, so I just pass the self parameter, then?
yeah
alright... Still, I hope this doesn't create a race condition...
I may want to delay the update of my data by a few seconds
But I don't even know how to approach that
I didn't figure it out then I did.
it was drawing on the correct side and rotation of the shotgun... upsidedown
so in annoyance I scaled the whole thing by -1 on Z axis, applied the transformation, then mirrored the Z axis again and now it's totally correct. Brain hurty
it's finally... correct
and because I'm... built incorrectly I made it so having the shellholders causes the shotgun to be placed shellholder up instead of chamber up
and the fiberglass stock still changes the model
appear as in?
well, all of my and my friend's attempts ended up in the zomboid man doing his mime impression killing zombies
I am working on a automatic-collab project that uses AUDs reloading feature
Has a favorite system and reload all UI
this stuff might be better off in #modeling
the original point was fixing a problem
was just showing off that the solution was found
as attachments being rendered on guns on characters and on the ground the same has been arcane and troubling me for a while
I mean it's fixed now, it was related to local and global transformations
was fine on character, not on ground. I figured out the oddity as to why
yeah the bottom part there
and make sure your ctrl-A-> all transforms before export
weapons are a pain like that.
i need Distributions.lua
vanilla pls
i have it but i have a loot of mod and it's 11k long
so if you can give me one with no mods instaled
The things you do for money.....
kill it with fire?
hello, anyone got a moment to look at some simple lua?
So the opposite of my Spiffo
this is probably trivial to you guys, but I'm trying to appropriate the fall damage module from the old Sandbox+ mod (for my own personal use only)
I've manage to excise it from the rest of the mod, but i'm getting an error on the line that changes zed speed (to slow shamblers)
that's amazing
I might commission you to make Kermit and the Sesame Street gang.
I'd love to be Kermit and the others being zombies and I'm playing the mall challenge.
ohhh man hahaha
you know I expected to be insulted before being outright ignored
thanks for nothing, jerkwads
Hey asshat, if you want us to be kind to you, you just lost that opportunity. You won't be instantly helped. No one is paid here. You could be patient and if need be repost your question.
Otherwise good luck.
the expectations of instant gratification
you waited literally 30 minutes. You think people are paid to sit here and stare at this channel?
... aside from your crappy attitude, it would also help if you provide some context (Ex, a snippet of console.txt) and/or the function you are writing.
Show the code
Chill guys
I'm not sure "chilling" is the thing to do exactly
the more people who expect results instantly and act like jerks if they don't get it AND get away with acting like jerks, the more of them out there we'll have. We need to teach people that is not appropriate behavior
while I don't condone the WAY it was called out, it still needs to be addressed.
lol wtf you want to encourage this? Keep saying this.
Expect some dad energy though if that happens.
if somebody doesn't respond to your question, they probably just don't know the answer
or you know.. have things in their lives taking up their time
this isn't most people's job. this isn't their first priority.
and if they don't respond to a vague plea for help, they probably just don't have time to dedicate to helping with something they might not know anything about
I'm still waiting on a response from Blair Angol from over a week ago, but I didn't flip out like you did
If you go and tell them directly they wont listen anyways im trying to negate the intesity be able to provide the needed assistance and then tell em its better to wait since people will come and answer eventually
I dont want be hostile to a person whos already hostile
And i think theres a reason why they act this way
Just wanted to help people even if they are acting inappropriately
Otherwise no one would maybe
And if thats the case then theres no reason for them to change
Well this is my opinion
Im not tolerating anything . Im just ignoring the thing ..
And Yeah my advice is if you ask for help you should provide more detail
For people to understand the situation cuz what you said doesnt mean anything if we cant see whats under the hood @opaque ore
I mean he popped onto the server, asked 2 quick statements in the middle of an already existing conversation, and when he didn't immediately get addressed, took it as an attack. that's really aggressive behavior
while it'd be nice to help him, it's hard to want to help him when he treats people like that. Especially without apologizing after being called out
would the best way to create custom zombie models be hazmat suits?
This chat has some real Redditor parenting energy right now.
Outfit
I still need to figure out how zomboid outfit creation even works
you know, assuming I ever start modding again -.-

thanks
)