#mod_development
1 messages ยท Page 516 of 1
what do you mean by "dynamically"
you're trying to generate the bytes of a wav file at runtime?
heh, you'd need filesystem access is my bet
Yeah, I figured. Asked about temporary files for that reason but, again, I doubt we can do that
Oh yeah, I remember someone asking about writing files not long ago ๐คฆ๐พโโ๏ธ maybe that is viable then
why would that recipe not work?
Thanks! I'll look into that
a command line and grep are your best friend
@frank elbow the Java code uses a PrintWriter class, give it a try but I bet you're gonna have a bad time
specifically because PrintWriter works on text so I bet it's going to corrupt any binary data you pass in
I searched this channel & people seemed to have had luck with FileWriter, but I'm concerned that when I try to play a sound it will accept only a filename and not a path
Considering mod sound files are expected to be in the sound subfolder
Only one way to find out though
sure, I'm sure it will, which is why you'll need to write it to your mod's media\sound path or whatever it is
that is, if using an arbitrary path doesn't work, anyway
I figured the game would've loaded those in beforehand, huh. If not, that would be the way to do it
I would LOVE to have something similar to the mod "Fear The Sun" where zombies during the day are slow and easy, but during the night, that's when they become hard, sprinters and there's many many more of them
It would make it feel more like Dying Light
sigh
I'll take a look, thanks
is there a easy way to get a single item all its properties?
Hello is there a way to get a list of the players on the server?
okay so recipe is working.... now i need to get it to actually SHOW my sprite
the recipe works and gives me the furniture item. the world sprite does not.
is your .tiles file in the root of media?
Hello, I'm 1 step away from finishing my mod, but I got stuck in a detailer that involves multiplier. Can someone help me?
you can always ask?
double check that your worldobjectsprite name is correct in the .pack viewer in tilezed
i'm not seeing anything obvious that's jumping out at me as a problem
go into tools -> .pack files -> pack viewer
and then see what the spirte name is called
yeah, what tiba said, at least this way you can rule that out
omg. THAT'S WHERE IT SHOWS THE NAME?
thanks a ton. that is SUPER helpful lol.
(was something COMPLETELY different there.
some things that should be easy are obscure, zomboid modding in a nutshell
^^ also there is a way to rename them kind of but yea i spends tons of hours around that tileeditor my self and not lot of the error form that xD
hehe
hmmm it placed it, but it wont rotate.
Please, I'm trying to make a mod I made for single player, also work in MP.
How do I inform the server, and all other players, that a change has been made to an object's parameters, for example door:setIsLocked(true)?
it has all 4 sides. y u no rotate?!
this is a tiledefinitions problem - make sure your four sprites have the same customname and groupname, but change their facing to the correct direction, and then make their item(full name) to something like boxcrapNorth, boxcrapSouth, etc. for each of the four sprites
maybe try this:
door:syncIsoObject(false, 3, nil, nil)```
@drifting ore if not locked with a key you might want to try 4 instead of 3
Hey. Trying to make my first mod, I am looking at other peoples mods to understand how its done and the modding wiki
I have one question so far. Theres a list on the wiki for item variables
but I have not found a list for vehicle item variables
I am looking at this one mod that adds a Buss that you can upgrade. I am trying to figure out how these upgrade items work
for example there is a front armor piece and it has a variable "ataProtection" set for Engine door
is this is a variable made by the mod or is this something that comes with the game?
the 3 main things I want to do that I am not sure is possible so far:
Make armor plating for cars that will get damaged before the car parts its covering
Make a snow plow for a car that will lower the slowdown when hitting zombies and protect the front of the car
Front spikes and side spikes that will deal stab damage (damage would be relative to car speed, would need its own hitbox, at least for the side blades)
can I do these things out of the box or will I need lua scripting for any of this?
As I am studying this mod I noticed the way they do protection is that whenever a car bodypart gets damaged beyond 50% it gets repaired back to 100% and the "armor" gets its condition lowered
thats a very interesting way of doing it but I guess it saves a lot of trouble with hitboxes and stuff
now I just need to figure out how they did that
Just go in media/scripts/vehicules and you will find all variables
Other wise here is the class of vehicule, you should be able to find out when the car takes damage in there
https://zomboid-javadoc.com/41.65/zombie/vehicles/BaseVehicle.html
Javadoc Project Zomboid Modding API declaration: package: zombie.vehicles, class: BaseVehicle
Is there a way to remove certain crafting recipes from a mod? Don't want to reupload it just overwrite what's there a little if possible
thank you
If you are in solo yes, in mp no. You will need a new mod
Right, but I guess I would like to make a mod to tweak the other mod. I have done it for distributions but when I try to do recipes the same way it doesn't seem to work for me
You can just copy paste the mod and remove the recipe in the script folder, just ask the creator or at least subscribe to his mod and put a like
It's not the most elegant solution, but I've resigned myself to using an altered version of the original recipe .txt file for such patches.
You can patch mods using the require field in mod info, it's pretty simple.
Well, you could also modify the recipe script to make it impossible to know/perform ๐
I think thats what i'm missing then so if i require the original then rename the the modified recipee file the same name as the oringinal then it should overwrite
Bingo! Like I say, not always the best solution, but sometimes the only feasible one?
Nice, thanks again Blair and MrBounty
is there an easy way to get an item and see all its properties / settings ?
i mean attributes?
There goes another 2 hours of pure frustration.
I think I completely missed the class on how client/server communication is done...
Other modders make it look so easy that little is found on the subject.
All I need is to communicate to other clients the changes being made to an object.
So that everyone is "synchronized" with the parameters of such
i know what fiiling lina
look at the item code tiba?
i do in few ways
technical speaking im looking into recipes and not items ^^ but almost the same
Does anybody know how to update the sandbox settings while in-game in realtime? I know there's a mod, "Change Sandbox Settings", that lets you change the sandbox settings while in-game, but it doesn't update until the save is reloaded.
@willow estuary do you know if you can give an item a custom attribute? like this
item foo{
foobar = "bar",
}
foo=bar item is foobar always ๐
just easy to use foo and foobar bar as abstract question because all the them ^^
Just havent updated it yet.
Was waiting for Blacksmithing to be fully functional on MP (furnace doesnt update correctly quite yet) before I updated the patch to work with latest Smithing and BRITAs.
can anybody point me toward a tutorial that would help with creating a new need/status? i've found lots of tutorials for new professions and traits, but nothing like what i'm looking for
hmmm getting there... just gotta make it so it can be powered and the be required to be near to craft.
@quasi geode when you here plz pm me got a huge problem
love that texture
okay so i can craft it and place it but i can't pick it up??
add modData moveable = true
did you also have pickupable = true ?
is that in tiles or the script?
i dont see pickable= true :/
blockplacement
yeah that's checked.
this stuff?
good question hmm
i'm willing to hire a modder for a small project. i'm not sure if anyone here is interested, but DM if so
i can stream what i'm seeing.... if you wan to take a look.
Question; What do you guys consider the easiest type of mod to make, and why?
things to eat and drink only few items files with some tags and then add it to a loot table
I'll look into it! I've wanted to contribute to the mod scene, but I've found it difficult to start, and I want to kind of dip my toes into it.
What about recipes? It'd be fun to make a Chicken Nugget recipe using flour, eggs and chicken.
recipes would be pretty easy provided the ingredients are already ingame. you would just need an item icon then.
There is already a Chicken Nugget item, so it'd just be adding the recipe itself.
Might be a good place to start ๐
look y'all idk where i go but im tryna make a true music addon but it literally requires itself
Taking a look through the code, looks like you should be able to replace a recipe with getScriptManager():getRecipe('recipeName'):Load("recipeName", table of key/value strings here)
That table should look something like vals = {"StopOnWalk: true", "AllowDestroyedItem: true"}
How to name context menu string to get access to it in ContextMenu_EN so it will be possible to translate it later?
Trying to get a food item that has a couple of uses per item
Do ya'll know if you have can a type Food with multiple uses. Seems like ol' Bob wants to eat the whole thing rather than the use UseDelta portion. So I'm guessing the UseDelta is not for when you snack on it, or is for a particular type of food.
something is amiss
Nope man its just how its supposed to be
Would it be possible to create a mod that audobans people for a set time from a multiplayer server for a set time?
Yea its called hiring an actual person to do it for ya
Nah just kidding
I think it should be posible to mod the server layout so it counts user play time or inactivity, and a simple ip blocker
Mixed maybe it can do what you expect
Example of my mod:
ContextMenu_EN = {
ContextMenu_Cut_Arm = "Cut arm",
ContextMenu_Operate_Arm = "Operate arm",
}
After that depends if you want to access it from lua or from a script
would it be easer to use an ip blocker or to build a little program that will type the /whitelist command after a set time set but a human
Yea well i mean its a simpler option, but if you mod the server layout you can do more than just unban people
what do you mean by mod the server layout?
From lua. Just trying to rewrite a bit one mod so i could translate it for myself and also get some experience how to create context menu.
no worries, going to try to ask everywhere and see if i can even pay someone to make the mod
Aw man, guess ill have to learn how to mod Project Zomboid in record time
If from lua, I put it in UI_EN.txt. But I think that change nothing
And in lua how's your string looks like for ContextMenu_Cut_Arm, is it just Cut_Arm?
Hmmmmm, ok
ContextMenu_Cut_Arm, but I think Cut_Arm work too
Thank you as always. :)
argh i still can't pick this bastard up.
i can craft it and place it, b ut when i got to pick it back up,,, it does the pickup bar and then nothing happens
youre not getting an error, are you?
nope
Don't drive under influence in West Point kids
oh god that cop taxi.
quiet common
oh i know. it's a popular gimmick.
Hey, I started making my first mod and I added a new item, and script to spawn the item on start, but the item doesn't get added, no errors in console
I checked my code and everything seemed ok
Do you know any reasons why items might not get loaded?
In the game there is a function for searching shelves quickly using shift+scroll wheel with your mouse cursor over your inventory window with shelves to browse. Can I get that function without requiring the mouse over the inventory window? Basically: Shift+scrollwheel=scroll through nearby containers.
The number of times I've wished for this QOL feature is maddening.
Here's an idea. Maybe I could have the server send each client a command, which each client replies to with its own player number, and then the server sends each client a list of player numbers.
that should be good for a new microwave right?
dual fannypacks./
I love the fannypacks, I usually put my cigs in it
but then the lighter has to be redragged in
I code for a living, I should make mods
If I were to modify/make a custom zombie NPC
where would I find some references for it?
guys you know the mods that add bow? like when you shot you see the arrow, i wanted to make a laser pistol, any ideas of how i could do it?
i mean just the projectile thing the weapon is ready
copy the bow an arrow, change the art, make the arrow disappear when it hits.
tht's how i would do it at least.
the bow and arrow of what mod?
https://steamcommunity.com/sharedfiles/filedetails/?id=2208315526 that one seems pretty basic
cool i will check it out thanks
dont
iirc the sprite of the arrow is literally like
50+ different sprites
of the arrow in different orientations
Its so inefficient lol
what you recomend me ?
yeah i saw it, wow any sugestions?
Any idea why tilezed / worlded keep closing randomly with no warning?
odd question: what vibe this giving off? -6 points? -8?
anyone else like to horde jewelry?
all of it.
like a dragon
oh shoot wrong chat sorry
so which coding languages does project zomboid work in?
Javascript or Java, can't remember which one but know that they aren't anything alike
Java and lua
hey kaise you told me not to use that mod as reference, and i agree, but what is the alternative?
woman drives into horde, breaking the car, and possibly all the loot her team mates put into the car.
anyone knows if I can override the player's gender on spawn? or a way to lock the gender option on the character creation
How do I check if a fileExists in lua folder?
Where is the world is the documentation for scripting in PZ with LUA
thx
also where would I look for vision related stuff?
anyone know how to get the defaultModData from an item ?
Does anyone know where the player faction is stored in the IsoPlayer?
I had a idea today, just wanted to share. It would be so cool if there would be a mod that adds a big bunker or something like the nest from resident evil 2. But would that be even technically possible to make something so big underground in the game?
i think someone made a basement/bunker mod onces
someone floated the idea of a basement system
that used a special "hatch" tile that would teleport you to a room off the map
but idk if it got any further then an idea
ohh so that how he did it ^^
but spirit if htey could make it so it could go - y then i might be able to to it esier but just lot of work.
anyone know how to make an fake inventory and then spawn items into for the only reason to be able to call inventoryitem()getmoddate() ? ^^
how hard would it be to change the color of the aiming outline?
do any one know how i can make a IMMAGINARY_PLAYER in zomboid ? i need to have a player obj for 2 like 2 sec in my code but he dont have to be a real person.
whats the difference between min/max range and weapon length on a melee weapon?
Could someone please help me with importing weapons into the game? i have the models, and they are textured (in blender) and I did properly scale them and everything. I have not converted them to an X file yet but I know i have to. What would my next step be? Thank you!
Hey
Would it be somehow possible to spawn static npcs ingame?
Just plain characters that does nothing, just staying
Kinda like superb survivors, but without interacting etc.
Are there somewhere models that u can actually spawn in?
heyya, here's the results of the last few days of hammering at this UI
https://steamcommunity.com/sharedfiles/filedetails/?id=2735294987
if you've ever been annoyed at having to create radio presets for new devices all the time, this might help
honestly basements would be such an amazing thing in game. I've been making houses of people i know in game through tiled so we can live at home in game too and its just weird making the basement as the "bottom/entry" floor
also does anyone know how to go about making a profession/occupation mod?
The best way to do it is to find a mod that already does something similar to what you want, subscribe to it and read how it's done in there
Question here: I'm making a zombie disposal feature for when the player is near a campfire. "Kick nearby zombies into the fire". An alternative to putting each corpse in a trash bin and clicking "delete"
The idea is that the zombie IsoObject is removed from the world at this action.
For this I'm trying to getPlayerLoot() , fetching all inventoryPane.inventoryPage.backpacks and then trying to get the zombie IsoObject from the each backpack:getParent().
But it's not working ๐ญ
Can anyone maybe point me in a better direction?
-- Update: I found similar code on the NecroForge mod. In case anyone's interested, it involves isoDeadBody:removeFromWorld() and isoDeadBody:removeFromSquare() .
Hello
local function getInstanceOf(_type, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10)
local args = {_1, _2, _3, _4, _5, _6, _7, _8, _9, _10};
for _, v in ipairs(args) do
if instanceof(v, _type) or type(v) == _type then
return v;
end;
end;
end
there's a Profession Framework in the workshop
what does it mean
ah thank you!
This may fit better as a bug report forum post, but I'm not certain because it's not really a game bug & more of an unexpected behavior. I'm trying to write arbitrary bytes to a file, and I accomplished this by using string.char with the integer values of those bytes. However, when I actually write them to a file (with the file writer returned by getModFileWriter), the file has extra null bytes. That is, certain strings of characters are copied as expected, but others have a trailing 0x00 byte
This is likely an encoding issue (both Lua and Java strings are not null terminated, so I don't think it would be anything related to that), but it has me perplexed considering it only happens to some substrings in the bytestring. I've already ruled out it being an issue with the bytestring generation by checking its length before writing
Anyway, what I'm really asking is: is anyone familiar with this issue? If so, is there a workaround? It seems like I'm probably just stuck until this is fixed or an extra method to write a byte array directly is added.
I was about to add some extra context from the Java source, but I just remembered you pointed out the likely culprit up here
What about it are you confused
how to get real world time?
where are available skin/clothing colors stored?
That bow and arrow mod changes the model of the arrow item to a different model variant of the same model file for each angle. It uses the same model file for each, but it is used a lot of times. I do not know how efficient this is. I imagine you could do a test to see if loading a high-file size model into the RAM takes up ram proportional to the number of times the model file is references. I think Kaiser was probably just guessing when he said it was inefficient.
You could instead look at how the game renders the items when you are choosing where to place them on a table. You can specify the rotation of the model rendered. One way to get the render function called is to attach it to the UI, but then it moves with the screen slightly which may not be what you want if you want it anchored to the world instead of the UI. You may or may not find something anchored to the world of tiles that has its render called.
i've been looking but i can't imagine there's a guide out there to navigate Profession Framework. i'm trying to add a couple basic professions to my server but this lua can be really daunting.
@drifting ore your github has a repeated link in your FAQ section btw
I think you should be able to use os.time() ...maybe?
fragMOTION can do that.
This is not an answer to your question, it's instead a warning. The item's stats are saved in the saved data between game game sessions, so to see them update you may need to generate a new item instance for each test, or use debug mode which lets you edit the item stats.
On a recent version of the game, yes. On a more recent version, yes but you and the npc go invisible. In the most recent version, not tested by me. You can look at the superb survivor code to see how it creates an NPC and gives it orders. Some advice, you should give it orders in its own update rather than the player's update.
One way is you could get a model for what you want, and then render it like how the hovering items you are placing on a table are rendered.
If you are on multiplayer as a client, isClient() returns true. On singleplayer, both isclient and isserver return false.
This is how I spawn in npcs to test stuff, it does not work for MP or testing MP features, entering test_npc_spawn() into the debug console will spawn a npc test to the player in SP however.
function test_npc_spawn(square, outfit)
if not square then square = getPlayer():getSquare() end
local isFemale = false
if ZombRand(2)==0 then isFemale = true end
local desc = SurvivorFactory.CreateSurvivor(SurvivorType.Neutral, isFemale)
local outfits = getAllOutfits(isFemale)
local nameOutfit = outfits:get(ZombRand(outfits:size()))
desc:dressInNamedOutfit(nameOutfit)
if outfit then desc:dressInNamedOutfit(outfit) end
local npc = IsoPlayer.new(getWorld():getCell(), desc, square:getX()-1, square:getY()-1, square:getZ())
npc:setSceneCulled(false)
npc:setNPC(true)
npc:setGodMod(false)
npc:setInvisible(false)
npc:faceThisObject(getPlayer())
return npc
end
To lock the option, using Lua, you could either overwrite the code generating that whole menu screen, or just let it create the gender button and then hide or delete it.
I could probably try that but its probably not worth the effort
I just wanted to make a Valkyrie profession, figured it would be funny if the profession required a female character
but that would be purely fluff, u know?
(You might also want to hook something on to a random button if it randomises the gender too)
{
sound HeadSmash
{
category = Zombie,
clip
{
file = media/sound/smash2.ogg,
}
}```
will this work?
I'm trying to replace the headsmash sound but also keep the OG one
should I just add other lines with the pz_headsmash one
@hidden estuary
Code like this (plus something for random, plus testing in case initial randomisation happens after this point) might work.
do
local CharacterCreationHeader_create = CharacterCreationHeader.create
function CharacterCreationHeader:create()
CharacterCreationHeader.create(self);
self.genderCombo:setVisible(false);
MainScreen.instance.avatar:setFemale(true);
MainScreen.instance.desc:setFemale(true);
end
end
need it for mp :/
Lua coding for me has a lot of debugging my failed code though so this may not work if some of it is being called at the wrong time :d
Can you help me
I'm new to this modding thing and I'm just trying to figure out where can I find the "module Base"
I just see all sound mods referring to it but I just wanna find out what else I can use it for
do
local CharacterCreationHeader_onOptionMouseDown = CharacterCreationHeader.onOptionMouseDown
function CharacterCreationHeader:onOptionMouseDown(button, x, y)
CharacterCreationHeader_onOptionMouseDown(self, button, x, y)
if button.internal == "RANDOM" then
MainScreen.instance.avatar:setFemale(true)
MainScreen.instance.desc:setFemale(true)
end
end
end
Also this should or may work for the randomise button changing the gender.

Module base is the base game, not a mod.
I figured but then it just means that I'll be replacing base game stuff by calling the base module
module Base
The Lua should have something so that it only does these if you actually have the Valkyrie profession.
Did you accidentally module base?
no no
I was just trying to add new headsmash sounds
but I ended up replacing the OG one
I don't hear it anymore lol
maybe I used a wrong file name
What do you mean by call though? I know what module base is but not what you mean when you say you call it, also what is OG what do you mean eeeeeeee
Oh sounds. I have not looked into the new sound system. :s
yeah no no worries
do you know then if its possible to spawn a imagenary_backpack with an item?
what i have to do in the script is do somehow get a items defaultModData and im so lost in how to get that data in a lua script with out spawning the item
What is defaultModData? o_o
something the java code doing for one ^^
with other words all the attribute the items normal dont have *
Is that always an empty table, like {} in lua?
good question i dont know i only know if i do item foo{ foo = bar, } that this attribute get added to the defaultmoddata but you cant call item:getModData nor getDefaultModData because the item call dont have a get
but it does get generated just trying to find a way to get that data
foo = bar,
}```Is this in a text file in \scripts?
yea
Oh apparently there are these things I did not know of too. void copyConditionModData(InventoryItem other)
void CopyModData(KahluaTable DefaultModData)
copy moddata to the inventory. hint why i ask fot imagenary inventory
Is this for a schizophrenia mod? :O
:o
i'm BRAND NEW to LUA so this is a really basic question BUT i want to create a new variable that causes the player to take damage when it falls outside of a predetermined range. i can figure out the damage part i THINK but the beginning is perplexing me. is it as simple as starting with
NewVariableFunctions = {}
and then going on to create a block WITH the functions?
its for a framework im doing
What do you mean by a variable that causes something?
uuuuh okay maybe i'm not articulating it well? but basically i want to set a value that increases over time and once it passes certain point it begins to damage the player. i'm a total novice so my wording may not be correct, sorry
Oh, when the variable falls outside of the range. I thought you meant when the player falls from too high up. :d
๐ no not quite
Hmm well to avoid increasing the namespace you could do something like this
NewVariableFunctions = {}
local NewVariableFunctions = NewVariableFunctions
NewVariableFunctions.Your_Variable = 1337
NewVariableFunctions.OnPlayerUpdate = function (player)
--some lua code here
end
--Something adding your function to an event
(Farewell)
anyone know how to make a recipe require you to need to be near a movable?
NearItem:ABench_Smelter, that was easier than i thought lol.
Near Item is currently fucked; NearItem requires the object to be "Named" with a java function, and doesn't work for tiles above z-level 0; it's not useful.
function CanFindKeyCuttingMachine(recipe, playerObj)
local KeyCuttingMachine = nil
KeyCuttingMachine = FindAppliance(playerObj, "Duplication Machine")
if KeyCuttingMachine then square = KeyCuttingMachine:getSquare() end
if square and (getGameTime():getNightsSurvived() < getSandboxOptions():getElecShutModifier()) and not square:isOutside() then
power = true
end
if square and square:haveElectricity() then power = true end
if (not KeyCuttingMachine) then power = false end
if power then return true end
return false
end
function FindAppliance(player, Appliance)
local station = nil
local CustomName = nil
local cell = player:getCell()
local x, y, z = player:getX(), player:getY(), player:getZ()
local xx, yy, zz
for xx =-1,1 do
for yy =-1,1 do
local square = cell:getGridSquare(x+xx, y+yy, z)
if square then
local objects = square:getObjects()
for index=0, objects:size()-1 do
local object = objects:get(index)
if object:getProperties():Val("CustomName") then
CustomName = object:getProperties():Val("CustomName")
if CustomName:contains(Appliance) or Appliance:contains(CustomName) then
station = object
return station
end
end
end
end
end
end
return station
end
?
I use the above lua with this script, which uses OnCanPerform which was added as NearItem is broken, to "fake" how NearItem is supposed to work,
recipe Duplicate House Key
{
Sound:Metalwork1,
keep Key1/Key2/Key3/Key4/Key5,
BlankHouseKey,
Result:Key1,
Time:500,
OnCanPerform:CanFindKeyCuttingMachine,
OnCreate:Duplicate_Key,
Tooltip:Requires a Powered Key Duplication Machine.,
Prop1:Source=1,
Category:Welding,
SkillRequired:MetalWelding=1,
}
Sorry, it's disorganized as I was pulling files up and copying the relevant lua.
I'm starting to give up on actual modding because it seems you need to know java too

oh hell.
I don't know java? ๐คท
really?
I learned lua for 2 weeks but when I try to reverse engineer a mod I don't understand anything I'm looking at and I get frustrated lol
Technically, I don't even know lua? ๐
damn
i don't know how to luau?
I just play with the lego pieces until it works the way I want it to really? ๐
if you feel overwhelmed maybe start with smaller mods, i dont think you need java unless you're making some really big gamechanging mod - which you shouldn't so soon
thank you so much! this helps me understand what i'm doing a little better :)
It's true, I'm not trying to give up
It is just so overwhelming at first lol
I'm doing simple stuff like just adding new sounds and stuff
thats normal. sucking at something is the first step to being sorta good at something
it's SO overwhelming but i'm finding a lot of utility in looking at the code for mods from the workshop for help figuring out how code SHOULD look
Good evening fellow modders, I have a question for you: Is there a way easily add a simple checkbox option without relying on a dependency with "ModOptions"?
I know you can easily add keybindings in a few code lines like that:
table.insert(keyBinding, { value = "[MyMod]" } );
table.insert(keyBinding, { value = "Text for Option", key = 24 } );
Events.OnKeyPressed.Add(MyMod.handleKeyPressed);
I was wondering what is the equivalent of this table.insert to add boolean checkboxes?
Why reverse engineer things?
just trying to see what does what
same here, i download lots of mods and try to replicate the code and i still can't figure it out. the modding community is great but the support is bad.
Support is fine, people here are really helpful
it's just that there's not a lot of resources for like "beginners"
correct, i should have clarified that. the tools are there, but not much explanation on using them.
i tried starting my server and it said, workshop version is different from hosts or something like that
What mod are you trying to reverse egineer?
id like to know which mod at least???
it doesnt
Lua is pretty straight forward, unless the person writes everything on one line
regardless, just verify your game files on steam library and/or restart the server to update whichever mod is outdated
if you're the host you need to also delete your ACF file
try that same solution i mentioned above. i use a dedicated server, so that might be the difference here
Are you the host or a connecting player?
host
Do you have any mods youve written yourself?
nah
https://theindiestone.com/forums/index.php?/topic/42925-how-to-fix-updated-mods-in-build-41-multiplayer/
this seems more about using mods than making them tho, you might have better luck in other channels
Hello All! I made this guide to assist the many bug reports that have come in regarding mods that have updated after the release of Build 41 Multiplayer. I have put together all the walkthroughs and guides here so you don't have to fish around for odd ends and bits. More may come as things develo...
and resub to anything that's updated in the last week
if the issue isn't your end, then your server may need to get it's ACF deleted and rebooted
i see
on a dedi server, you still have to verify your game files to push the update that Steam never does appropriately even if you're the host/owner
ill try
resubbing works for players/self-hosts
ill try it
I think dedis would need the ACF deleted
if i resub a mod
and i had something of that mod in the inventory
before
is it gone now?
only if you load the save inbetween
you should not have the game running to update files anyway
same applies for a server
?
or what do u mean
close the game before you resub mods
you shouldn't have the game running while resubbing either way
ah
with regards to the lua discussion earlier, i'm trying to use the profession framework mod to create my own professions, however, the issue with people unfamiliar with lua, even with what is explained in the notepad, it's literally programming gibberish. i have no idea how to tailor it to myself specifically without a coherent guide. that's the biggest hurdle i have every time i want to modify a mod
are there any mods (off the top of your head) that create custom moodles beside immersive medicine??
there's one that spreads zombie infection to nearby players when someone is infected if that's similar
i wouldnt quite call it gibberish, but it's pretty difficult to write ur own code (at least for zomboid) in lua for ME because i often dont know the names for the operations i want to do, or the name for things i want to reference. the library of terms on the wiki really helped me in that regard
CAPI / Aiteron have a moodleAPI
true. i have a tendency to just replicate/modify code from mods that already exist, but even then, i still can't seem to understand what i need to do specifically, unless explained plainly
Also a perk/trait/profession API
might be easier than the framework?
could you link this? ive tried googling it and keep getting some website CALLED moodle :\
It's what I linked above
attemped index: new of non-table: null
The profession stuff hasn't been merged yet: https://github.com/Konijima/PZ-Community-API/pull/56
how do i solve this problem
You're trying to access something that isn't there
X.new() or X:new() - what ever X is, it's not there
oh god i see it now. thank you
does hydrocraft lags the game every 5 seconds due to 55 milions items it adds?
is it possible to feed a variable to a lua function via OnCanPerform ?
Also switch the branch to dev for moodle/latest stuff.
OnCanPerform is ran for context menu and every tick the crafting is being attempted
OnCreate is ran once when completed
fyi
yeah, i'm trying to make a generalized function but i need to know if i can feed a variable to it.
function CanFindWantedMachine(recipe, playerObj, WantedMachine)
i need to be able to feed it the WantedMachine
uh, depends on what the wanted machine is suppoosed to be?
i'm modifying Blair Algol's function to fix the NearItem to be a generalized one.
there's a specific set of parameters for oncanperform - you can't feed it your own without editing the java side of things afaik, but you can search for something in oncanperform
so the lua fuction has to be specific.
wasn't nearItem replaced by something?
only the parameters - once inside the function you can look for what you need
I assume you want recipes to check for nearby objects for crafting?
yeah, basically a z corrected nearitem.
iirc scrap armor/weapons has benches - maybe check out how they do it
so im in the dev branch but i cant figure out how to open the moodle api? im SUPER unfamiliar with github, sorry
so the project isn't released yet - so you'd have to actually just copy the moodle API's functions
no no i get that! i just. can't find it.
well shit. https://steamcommunity.com/sharedfiles/filedetails/?id=2680473910 that's the whole mod i was making ๐ฆ
Yeah, always a good idea to search for your idea first lol
i just wanted to make art. and then make it work :/
in game painting?
made a home sized smelter.
dang
doesnt get any easier then the framework. but you still need to know lua basics: how to call a function and how to define a table...also basic pz modding XD
That's actually a cool idea - I don't think he has a smelter does he?
Well, his mod is a "framework" also - so you could make a submod using his as a requirement?
I haven't used any of the framework mods for professions/skills but I figured if that one was hard Aiteron's might be differently formatted.
his "framework" is pretty much what i was doing lol.
everything is documented in the pinned post
Yeah but if you have a variation for smelters that might be easier / different I'm sure it'd be good
currently extends the base radial menu and the vehicle one will keep extending all the games radial menus
i'm looking through his... and it's actually VERY good.
emote radial probably next
I'm just confused on how people use "GET"
I thought you couldn't
couldn't call a lua function that way
@drifting stump that seems really interesting! I was just the other day wondering why there isn't an removeSlice in ISRadialMenu, does this mean i could get that behavior by using your mod?
depends
i havent added removeSlice yet
thinking about how to make it as efficient as possible with the given vanilla limits
but depending on the behavior you likely can already
ah okay, i saw the "Deleting Slices More Effeciently" disclaimer and assumed there is an inefficient way already ๐
there is
the vanilla way is wiping the whole menu and filling it again with everything
ah, figures
if you wish to disable something permanently the api already allows that
just unregister it
you could also override the slice
man that sucks. why'd he have to make it SO well.
@hollow shadow quit being so damned good.
well in that case. anyone need any art for a project?
Hum so when I run this code:
local function addSheetRopeTop(square)
print('Adding sheet rope!')
local sprite = IsoSprite.new()
sprite:getProperties():Set(IsoFlagType.climbSheetTopW)
square:getProperties():Set(IsoFlagType.climbSheetTopW)
object = IsoObject.new(getCell(), square, sprite)
object:setName('SheetRope')
square:transmitAddObjectToSquare(object, -1)
end``` I can see my object is correctly added and has the properties `climbSheetTopW` set, but it's not set for the square. What I can't figure out is if I run this in the Lua console then the square gets the properties set correctly:
```lua
local cs = getPlayer():getSquare(); local s = getSquare(cs:getX(), cs:getY(), cs:getZ() + 1); s:getProperties():Set(IsoFlagType.climbSheetTopW)``` Any clue what am I missing?
@sour island any clue?
how is it agian i can make the getModData() ?
How can i add animations ? or change animations attacks ?
Is the issue on MP or SP?
whats going on
did i miss something
lol no. was a sideways compliment.
i was working on a simple smelter/ammo bench (all using ingame materials) and you beat me to it and it's very well done.
@sour island do you know any why how you would get the item attribute called defaultModData out? im so stuck with that thing right now ^^
lol thanks
now i have to find a new project and have no ideas.
?
In the cases when the square is not getting the property added is the square confirmed to exist?
have have some custom attributes in my items.txt on my items and i try to find a way to get them out. from the item but keep failing
yes, ok so I made a bit of progress, now I can set the property, but if change floor and come back then it's gone ๐
on the IsoGridSquare you mean?
and on the sprite too?
hum but IsoGridSquare.save() takes a byte buffer
and IsoSprite.save() takes a DataOutputStream
is it possible to get any moddata from an item or on an item in a backpack ?
object:getModata() ?
Ah you can't just called save()?
yea from an object from an item in the backpack?
I mean, you'd have to iterate through their inventory
right now the backpack only have one item in it. but i just know the class Item dont have the :getModData() call on it
you mean without argument ?
I assumed you may be able to but I guess not
When you build furniture/floor is it updating the square sprite?
well I just add an empty sprite, so I don't see it but I can see it's there with chunk debugger
I only mention the furniture/floor to ask if there's something in the lua callin for save()
oh
hmm so is it only on physical objects you can call getModData?
in fact it's when I try to climb that it removes the flag ๐ค
but if I add the flag from Lua console, then it stays ๐ค
what's the story behind "missing" texture files, for example i see in a lua file a reference to a texture "media/ui/vehicles/icon_trunk_light.png" but when i open that folder, common\ProjectZomboid\media\ui\vehicles" in explorer the file isnt there? searching the entire folder doesn't show any files with that name either
but i guess you never tried to getModData from item before ?
can i see you gethub for that?
If your modData isn't saving you should know you have to store simple variables
string, numbers, tables of strings/numbers, etc
atm my item like like this
item foo {
customfoo = helloworld,
}
๐ New player and no experience modding. I have an idea for a hygiene mod that adds a new buff, consumables, and traits. I'm really excited to learn how to make this thing a reality. I'm not sure the best place to get started learning. Any tips would be appreciated!
You might want to chedk the pinned stuff
Almost everyone here is asleep
๐คฆโโ๏ธ lol I shoulda have checked that first. Ty!
K
anyone have a mod idea i could try?
sotherwise i'm gonna make movables out of ALL of the tiles i can find. and make a crazy crafting mod to craft all thier furniture.
theres a big difference between the Item.class and InventoryItem.class that causes confusion sometimes
Item.class (the script item) doesnt have ModData specifically, only a "default mod data" which gets applied to InventoryItems as they're created
unfortunately theres no 'getDefaultModData' method for Item.class, but you can get it from the field value
-- find the specific named field in a java class object
local function findField(object, field)
local count = getNumClassFields(object)
local i = 0
while i < count do
local f = getClassField(object, i)
if tostring(f) == field then return f end
i = i+1
end
end
-- fetch default mod data table for a script item
local function getDefaultModData(fullType)
local scriptItem = getScriptManager():FindItem(fullType)
if not scriptItem then return end
local field = findField(scriptItem, "public se.krka.kahlua.vm.KahluaTable zombie.scripting.objects.Item.DefaultModData")
if not field then return end
return getClassFieldVal(scriptItem, field)
end
is what i was using previously to fetch it
Hell yeah, rocking the classic 808 in PZ. Now add the ability for people to play different instruments in sync ๐ฉ ๐ฏ
so you saying if i my item have a defaultmoddata i get it by
findField(scriptItem, "public se.krka.kahlua.vm.KahluaTable zombie.scripting.objects.Item.DefaultModData")
U will suffer latency
Mwahahah
basically, using that findField function above , though that whole thing was just a hackish code snippit done as a POC
honestly its probably better to just fetch the field index number once though, then iterating through them all each time to find the DefaultModData
so i've written my first bit of code but i don't think i'm actually doing anything correctly.
NewVariableFunctions.firstRunTimer = false
NewVariableFunctions.CalculateSugarValue = function(specificPlayer)
local sugarIncrease = 0.5 + SugarValue
if (SugarValue >= 400) then
setBodyDamage(specificPlayer:getBodyDamage() + (0.5))
end
if (SugarValue < 40)
setBodyDamage(specificPlayer:getBodyDamage() + (0.8))
end
end```
im TRYING to set up a new variable (sugar) that is added to by .5 every 10 minutes (which ignores the very first 10 minutes that pass after a load). i'm trying to have the variable cause damage when it's below 40 or 400 or higher. will this do that? does anyone have any tips about how would i ACTUALLY go about accomplishing that?
@bitter frigate i'd first break it down into smaller parts, see what i actually have to figure out before it works.
- see if the function for tracking and adding/substracing sugar works - probably want to add some debug button to trigger it whenever i want
- find out how timers work and how to get a method to get called every 10 minutes
- probably have to start this timer on some event that kicks off when game starts
- then last, go around doing damage to player
- probably need to keep track of this value between saves too
so i've seen some "anime" faces mods but they always seem to make eyes to big (example:)
so i made my version what do you guys think
I'm not sure, but really hope code from this mode could be helpful.
https://steamcommunity.com/sharedfiles/filedetails/?id=2730158335
It adds context to elevator tiles and then just teleports you by z-axis.
Looks great! I'd actually use that one lol
Take a look at TAOffHandAttack.lua its where I'm triggering custom anims within a timed action.
https://steamcommunity.com/sharedfiles/filedetails/?id=2727440840
And for making the anims, I found it best to start with one of the ones from within the game, and modify it to do what you want with a program called fragMotion
fragMotion?
Yea it's an old ass program lol but it's the only one I've found thats able to open and work with .X files
Well that was fast xD
@cold burrow thanks I've been looking at it, but it's not doing the part I need for my stuff
my problem is really about understanding why the properties I set on the square get lost when I move away to another square
only client side
Final version of my mod, I love that it's only 98kb with all images ๐
https://steamcommunity.com/sharedfiles/filedetails/?id=2733680483&searchtext=
theres someway to save global data for all players?
you can send to the server and the server to all clients
Indeed, fixed thx

thankssss
gz! i gotta take a look at that, im really curious how you managed to hide equipped items from the inventory. i was thinking about doing something similar but instead of a new ui, i'd show the equipped items in a different inventory tab (similar to the keychain for keys)
does anyone know where there's a list of the functions/variables that are created by the game to refer to? for example, I'm trying to find "getClimateManager"
something like this? https://zomboid-javadoc.com/41.65/zombie/iso/IsoWorld.html#getClimateManager()
Javadoc Project Zomboid Modding API declaration: package: zombie.iso, class: IsoWorld
When I tried transmitModData on the player's character, it said it failed, and the modData did not seem to have been transmitted. Maybe there was something forbidden in it like an isoplayer.
Super simple. The inventory UI has a list with all items to display. Before the UI processes them, I remove items that are equipped
No wait I'm talking nonsense, that was my first idea but it never worked. I never put the items in the list by changing the function that retrieves all items from the inventory
But a mod creates problems with this new function so I'm going to change it I think
i tried it a bit and it works really well! if i had one small issue with it it's that the window feels too small for all these buttons, i'd personally prefer it as a separate popup i can resize, but that's just me. other than that it's great, its nice to have the inventory cleaned up finally
You can choose the size in the options. And I can't make it resize as you want like other UI. It takes a lot of extra work. Even if my code is normally done well enough for this to be possible without too much difficulty
And I changed the function to hide the equipped objects, it works as I said in the first message now. Like 3 lines of code
What lua methods to add specific amount of items to current character? Like "Base.ExampleItem".
any lua boys want a REAL challenge?
player:getInventory():AddItems("Base.Matches", 1+ZombRand(7))
Thank you :)
I was thinking about something along those lines last week, more as a new character management window than actually an inventory window
any mods yall recommend for making the game a stealth night time is death kinda vibe. the zombies hate sun mod dosnt seem to work very often so i wanted to see if yall know any good ones to look out for
https://steamcommunity.com/sharedfiles/filedetails/?id=1585858435 (works for me in testing)
thank you
- this maybe https://steamcommunity.com/sharedfiles/filedetails/?id=2715882009
or the batshit crazy insane awesome version https://steamcommunity.com/sharedfiles/filedetails/?id=2705076474
Hello guys! i am working on making a small concealable gun that can be worn on the wrist like a watch without occupying your hands. Technically its a mix between a clothing item and a weapon, does anyone know how would i implement bones with animations into an item that can be worn?
dunno if anyone else here's tried it, but I swapped out Hotspot for OpenJ9 and the game seems to be a lot snappier since then. Could just be imagining it, give it a try though if you find the game is a bit laggy, who knows
it's downloadable here: https://developer.ibm.com/languages/java/semeru-runtimes/downloads
someone saids omething about a map editor so you can save part of the map, and the clear the rest.
does anyone know if steam workshop mods are updated cleanly? for example if you rename a file and publish that update - will the previously-named version continue to exist on a subscriber's machine after they download the update?
Apparently that can be an issue, and is part of why it's recommended to unsubscribe and then resubscribe when a mod updates?
why i generally leave blank files as placeholders for deleted ones (least for lua stuff)
Yeah, I've taken to that practice as well.
oh wow i didn't know this was actually a common situation. seems like a pitfall a lot of new modders will hit if they do a round of refactoring. the suggestion to null out the file is a good one. thanks!
I guess it's even more of an issue on the server side
You can just delete the file after a while
even if users don't delete the old ones- if they're blank there's no real harm
siiiiick
I wonder if there's something I could use for the playable guitars out there
is there a way to change cars horsepower numbers?
hey guys is there any game clothing that makes noises as you walk? if not, anybody think its possible to create noises as you walk with a certain outfit?
how can I draw to the zombie population map?
Wanted to start doing animations in my downtime before work for Project Zomboid, how does one actually get that going?
you mean like 3d animations?
Yeah
been animating in blender for over 13 years - I want to know how to get the Animations that are already made into blender
right now they are XML (X) Fiiles. i have no idea how to import the animations or what program can actually use it
I guess they are like animation files? A set of movement positions?
is it for the humanoid models?
yeah. Bi-pedal
Players and Zombies lmao
not exactly good at 4 leggo creatures lmao
maybe the model and the animations are separate not sure how tho
Havent even considered that. might have to hit up Spiffo to get in touch with the dev team lmao
can you ask him how to draw to the zombiepopulation map? Lol
i can. lets see if we can obtain the info we both need ๐
this might help a little https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
Super Appreciate that!
Reminder that blender has no support for .x file extensions anymore
And that .x is outdated af and idk why PZ uses them
yeah i thought about downgrading to 1.8 for the X File format
but i didnt know PZ uses FBX. Something i found out thanks to An ๐
HERESY!
Is there a bloodlocation that gives protection to both groin and neck without hands and head?
i think they will stop using on the future, .fbx is way better indeed
i accidentally made an entire building system for my admins to spawn in trees and stuff

you know.... if someone added "connection points" to all the vehicles...
it would be easy to attach things like armor and plows and what not.
is there a mod or way to spawn items in the middle of a multiplayer gameplay map in 41.65 IWBUMS? the server has crashed a couple of times and me and my friend have lost car keys and some items each time, we just want to replace them
we've tried necroforge 2.7b, Cheat Menu [Multi-Language], and using the -debug in options on steam feature
car keys should be quite simple in debug or admin
open the mechanics menu and right click anywhere -> get key
as for items there is an item list you can use in admin and debug
the -debug in steam options thing made it so my friend couldn't start the server
how do you do the admin thing?
admin is not a launch option
yea, mistyped
Hi everyone! I'm hunting some mod incompatibility for my new play and had an idea for a checker; would grepping for "function (Name)" and showing mods that override/use same functions work as a rudimentary way to find those conflicts quick and in bulk? I have like ~150 mods by now, so it's a mess to find which ones work together by trial and error... ๐ฆ
in the server terminal type setaccesslevel "player name" admin
what does server terminal mean?
how are they running the server
i think i need an ELI5 
through the ingame host or dedicated
just through the host button on the main page
ingame yea
then he invites me through steam to join
from what i see he needs to type /setaccesslevel "Name" admin in chat
only ever used dedicated server so im not 100% sure
doesn't seem to work for some reason
but he just realized one of the mods he downloaded works from the right click menu so there's that ><
thanks for the help browser 
does the server have the default name?
i don't think so, no
i guess not, no
mhhh not sure if it will run but try running ProjectZomboidServer.bat in the game folder
it should launch that same save as a dedicated server
nice, thank you
and in that terminal type setaccesslevel "player name" admin after its done loading
Not cool, that was my next project. xD
Is it in game or is it just an image?
Otherwise don't you think that the menu at the top deserves a menu just for him? We don't need it every time.
Also the problem with this kind of interface is mods. For the mod I'm doing which add an equipment menu, I could have chosen a similar interface but the problem is that if a mod adds bodylocation (like srap armor which is very popular), it's screwed up everything
- image
- he could yes.
- i had designed it so you mouse over a part and it shows you things connected to it. (helmet and mask for the head for instance)
- do a base version first. then work past that to each mod. release multiples. go insane. eat a pigeon.
Have you ever made UI?
written no, designed, yes.
i actually don't think making an UI like is that that hard, it's basically just a prettier version of PZ-clothingUI.
the inventory grid is also easy to do in a new window, but would probably hard integrating with the existing one. the bigger issue is preserving all the vanilla functionality like drag-select, shift-click-select, item transfers by dragging, etc
Ok how do you explain that. It's super annoying. There are lots of little things to constantly remember otherwise you have lots of little bugs (especially in this game). And your project is far from being the simplest. Honestly it seems like too complex to start.
Not at all. You have to redo the ISInventoryPane, which is infernal. And drag and drop systems are super hard to do, same for other little features
i have not made a pzui no. i design stuff in my head for the situation and take to a coder who can make it happen.
i wouldn't put it in isinventory pane though, i'd create it as a separate component and then integrate the existing inventory pane in it. or just not use the existing inventory pane altogether, but that would be more work
but yeah, all the little things like drag and drop i don't know yet, and they are pretty important
that was more a culmination of ideas. some diablo some dayz some stuff hat i liked.
Or else redo a whole list class so that it is square, that would be the simplest. But it's still complex I think
i've manually built a dynamic list for the radio frequency manager, making it into squares wouldn't be that big of a change. but then the ultimate question is whether the grid system is superior anyway, i kinda like sortable lists
Haha, you need to change ISInventoryPane but keep ISInventoryPage, it's different
Told you it's infernal xD
yeah, if possible i wouldn't use it at all, seems easier to create new components from scratch ๐
You really feel the inventory system has been there since the beginning of the game and they added patch after patch until it was unreadable. It's a real spaghetti dish
a cookie to the first person who sees what's new here
(unrelated to current discussion)
Just hidden items already equipped took me 5 tries and about 1 hour
You out the car with the UI ?
that's a zombie, intentionally added there to mislead you, so no ๐
but it's related to the dashboard, yeah
foglights?
The volume icon ?
dunno if you meant the same thing but yeah! the speaker icon for the radio
here ya go๐ช ๐ฅ
Can I get it to if I try to do something like that ?
huh?
That what I meant
@lusty sierra did it work?
changes color based on whether the radio is on or off and clicking it opens the panel so you dont have to use the radial ui
it did, thank you!
np
My only suggestions is to put the bar in the middle, so that it is centered like the other. Because it stresses me out ๐
yeah i know, i first added it between the fuel and speed indicators as a separate button, trying out different positions now. i can't move the existing elements at all however, otherwise i'd center it
maybe left of the engine would be better but it doesn't fit thematically there
Hey does some1 know if I can make a lua or a command for any mod that would remove a certain item ftom the game & world completely? Not just loottables but also existing stuff? Like arsenal/britas remove shotgun silencers etc?
maybe i add another icon on the right so it balances it out
does anyone have the link to that guide on how to launch and connect to your listen server? as two clients
ahhh nvm i found it
is there any way to modify the z-level of elements besides just creating them in the correct order?
Someone would be available 10-20 min in the hours that follow to test my mod on a server? It would help me a lot
me
this is from a great many hours ago but do you have any advice on where to start for point 1? i WANT to accomplish that quite badly but i don't know where to begin
local function OnKeyPressed(key)
if key == Keyboard.[the key you want] then
print(your variable)
end
end
Events.OnKeyPressed.Add(OnKeyPressed)
Javadoc Project Zomboid Modding API declaration: package: org.lwjglx.input, class: Keyboard
@bitter frigate is this what you needed?
yes that is SUPER helpful thank you so, so much
should mention the print will output to the lua debug console
so make sure youre running the game in debug mode
thank u for telling me i would've run back in here in 5 minutes crying
does anyone know what mod is this
if so please send me a link
oh wait nvm i found the mod
๐ค how to query all items with specific Type and SubCategory? Probably all guns.
how do you tell if any of your mods loaded up because i enabled them and they didnt activate
oh do i have to manually put them all in the mods folder?
is there any way to get your mods in game without submitting them to the workshop?
where do you have the files
i havent yet put my mod folder anywhere. don't wanna put it in the wrong place and break everything. otherwise everything is steam default
you can put it in User/Zomboid/mods
it's not showing up 
how do you have the files setup
inside the mods folder you should have a folder for your mod
inside that a media folder, mod.info and poster.png
inside media a lua folder
and inside lua client, server and/or shared depending on where you want the code to run
for the code i sent it should be client
your .lua files go in there
i followed an old tutorial so the .txt file with my version and stuff was outdated. i'm updating it now and seeing if it'll pop that way
it should not be a .txt
i had it as an .info but switched it when i was checking it against the mod template in the folders orz
i have my mod folder (Diabetes). inside of it is another folder (media) which has a .info and a poster.png, Inside of (media) are two more folders (lua) (scripts). (scripts) is empty. (lua) has a folder (client) inside of it, and inside (client) lives my code (a .txt file named "working")
Diabetes
On the server side, how do I get the isoPlayer of a specific player to use with sendServerCommand ? I try getSpecificPlayer but that not seem to work. I tried with the playerNum and playerIndex
my mod is still not showing up, unfortunately
I have a command that is sent from the client to the server like this:
function Ask(player)
local arg = {}
arg["From"] = getPlayer():getPlayerIndex() --Or getPlayerNum
arg["To"] = player:getPlayerIndex() --Or getPlayerNum
arg["command"] = "SendOriginal"
sendClientCommand(moduleName, "SendServer", arg)
getPlayer():Say("Asked to " .. player:getUsername())
end
But arg["From"] and arg["To"] are the same
Then on the server side:
Commands["SendServer"] = function(player, arg)
print("To: ", arg["To"])
print("From: ", arg["From"])
sendServerCommand(getSpecificPlayer(arg["To"]), "TOC", arg["command"], arg)
end
getPlayer() and player are the same thing
are you trying to ask another player?
normally not precisely, because I call the function only if getPlayer() ~= player
Yes
if self.character ~= self.otherPlayer then
print(self.character:getPlayerIndex())
print(self.otherPlayer:getPlayerIndex())
Ask(self.otherPlayer)
end
are those 2 prints showing different things?
no, both 0
but it's maybe because both game are on the same PC
But it shouldn't, the server must know the difference
try doing the if check with the indexes
i suspect they are 2 different java objects pointing to the same player
Ok and now when I try to call print(self.character:getPlayerIndex()) I get an error
Object tried to call nil
checking again you have User/Zomboid/mods/Diabetes/mod.info right
And otherPlayer and character is well 2 different isoPlayer
im not sure you can get another player as a client unless its a local coop
like the object ?
yes
yup! thats exactly what i've got
and what is inside your mod.info
again im not sure about this havent messed around with it much but as a client unless its local coop i think there only exists on player
other indexes will just return a nil player
I don't think, like in ISMedicalCheckAction otherPlayer is an obj and the use function on it
But I use that otherPlayer variable, I don't need to find it. I have both player obj, that not the issue
id=Diabetes
description=Adds T1 diabetes.
poster=poster.png```
then why is stuff nil or the same
ill have to mess around with it
That my question
i have it showing with that
it's meant to show up in the mods section right? am i just not looking for it correctly?
it did show up in the mod section
C:\Users\[Your User Name]\Zomboid\mods\Diabetes
i mean it's meant to show up in the mod panel within the game right? so i can enable it? or is it automatically enabled because it's in the mod folder?
yes it is meant to show up
When I check the debug, PlayerIndex are the same for both obj, username not (so it's 2 different object) but OnlineID is different so it must be it
i thought so. i tried disabling mod manager since i thought maybe that was hiding it, but no such luck. should i move into tech support?
Hi guys! Can I made a mod that preventing some items (listed) to spawn? Letโs say it is item blacklist.
nah its still modding
but again you have your mod in C:\Users\[Your User Name]\Zomboid\mods\ right
not in the mods folder in the game install folder
........................oh lord
IT IS NOW.
it's working. thank you so much
compatible with better lockpicking?
yes but better lockpicking adds a hotwire minigame
does the mod remove that minigame or keep it?
That not onlineID either because I get 0 and 4, and 4 give an error when use with getSpecificPlayer because we are 2 on the server. God damn it, I will never get my mod work in MP
only thing with that mod is the hotwire action duration setting doesnt do anything because well better lockpicking doesnt have the action
didnt touch anything that conflicts
With what do we need to use getSpecificPlayer ? PlayerNum ?
wich mod is this?
thanks
Are you workin on ladders using some kinda sheetrope trick? (hope ping response was ok) Thats Awesome if so!! Truth be told I'd much prefer this to any teleporting hackery, I took a brief look into attempting that but didn't see a clear avenue without diving deeper than I felt willing to at the time. Great idea, would love to see this functionality added! Not sure if I'd be able to assist but feel free to DM me if you need a second pair of eyes, might be able to help with the square not saving the property. That being said for others in the meantime there is some teleporty hacky ladder use coming with the next elevator update, but actual climbing with animation sounds way cooler
so i have to put the mod from the directory from like steamapps common and then to like the string of numbers etc drag and drop that into the zomboid mod spot right
can you make sheets
hmm, I'm sorry I don't quite understand the question, missing some args
@copper grotto hey, thanks. Yeah I'm still stuck on the square losing its properties :/
can you make the sheets you make into the sheetrope
Oh, you mean like is there a way to craft sheets from something else? or just like can you spawn in sheets, sorry I'm thick I still dont quite understand what you mean. but I suppose the answer is yes?(or it would be easily possible to make a recipe like that)
co` my wife is summoning me to do some shoveling but I'll take a peak at the code you pasted yesterday when I'm back around and hit you up if I have anything helpful
no i was talking bout crafting it
i wish you a hasty shoveling

OK ๐
it took some work but I managed to align the buttons after all, it is better this way like you said MrBounty
https://steamcommunity.com/sharedfiles/filedetails/?id=2736059670
damn, im spending more time playing around with mods than actually playing the game lately. and so many more ideas to do...
Longshot but does anyone know if the lootable map window is capable of being resized & if so, where's the ref to it?
Hello what is the function to tell what player number you are?
local player = getPlayer();
local playerNum = player:getPlayerNum();
if thats what you mean
A few hours late, but this is where the channel loaded in for me so: Lua functions can be defined like that, but can also equivalently be defined as Name = function(...). Just something to look out for if you do that. If it's a function in a table, you may also have to consider the edge case that someone may have assigned the table to their own local variable. So, a grep wouldn't be a perfect approach (the ideal approach would be an analyzer, but I assume that's out of scope), but it would catch most of the common cases
Looking for a mod that makes spawn locations to be able to be safehouses
I am currently working on making some new WorldItems, any idea why the textures are being read like this?
followed https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/ for model creation
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
(model is currently scaled up to show issue better)
yeah, I felt like that might be it
ah just happened to glance and see #mod_support, this definitely should've been there lol.
unless thats support for people who use mods, not make them ๐
anyhow, I am a bit puzzled for sure. The path seems correct, but the problem could lie elsewhere maybe
a fast question is it possible to say this in a list
mylist = { foo or "bar", foo2 or "bar2" } ?
probably, but what do you expect to get in that list afterwards? i think it will just be booleans
sprites
its valid
Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> x = {nil or "ok", "ok2" or nil}
> print(x[1], x[2])
ok ok2
got it
ah nice, so its like a js or, a coalesce
alright so good note to make
even though the mesh = and texture = pulls from two different folders in the game directory
if the fbx & png are named the same
it won't pickup the texture
even though, I believe this is how it's done with Vanilla world models, such as mesh = Book, then texture = Book
ยฏ_(ใ)_/ยฏ
now onto other missing 3D models ๐คฃ
funny enough, rooting around in the PZ directory
there is actually already a mesh/textures for WalkieTalkies, including each variety of them. They are completely different than the sprites used in the Inventory
they're inside the 1handed weapons textures
also found a reference to the mesh for them as well
so at one point the walkies were able to be held as a 3D model, and most likely swung as a makeshift blunt weapon too
here they are in "media\textures\weapons\1handed"
idk if that is common knowledge or not, but I found it interesting
๐
It's for people who use mods hehe
now to turn that pesky NPK Fertilizer bag right-side up ๐คฃ
now someone shall bring them back into game in that form
Silent Hill themed cars time
These are so awesome ๐
thanks
thx for the fast response ๐
omg lol
Hello everyone
Does someone know a place, channel or somewhere I can find a tutorial or even learn how to combine mods and make a modpack for a server?
Tried the whole net, even reddit, but couldn't find.
People dont even want to sell their service
It workiiiiiinnnnnnnnnnggggggggggg !!!!!! My mod finally work in MP. Thx everyone who help me !
do you know if there is a easy way to check for nil before you try to concatenation ?
> print("test " .. (nil or "") .. "done")
test done
i'm assuming you ment with strings
what i wanted is like like this
x = { "hey " .. (str) .. " nice" or "default string", }
not sure what your trying to achieve there, but if you look at the example i show, it hits the nil and replaces it with a empty string "" to concentrate
i did but problem is if the string is nil i would cast it to a whole other string obejct instead... hmm also i use to java where null is = false by default
> print("test " .. (nil and "x" or "y"))
test y
> print("test " .. (true and "x" or "y"))
test x
you should not have to Do anything to combine mods, if they are conflicting with each other post on mod_supoort section so the proper mod owner can make his decisions
mods should work with each other, if they dont, its a mod problem not a server problem, plus you prb need the mod owner 'go ahead' to mess around on his coding anyway
i recomend u test your modpack on SP first
if it works move to MP
No, you didnt get it
I mean, many servers nowadays have all the mods into a single file
so no need to keep restarting the server when a mod gets updated
well again, i dont think this is right, each modder should take care of their own mods not letting other people mess around on their coding
MP is a mess anyway
and its not the modders fault
damn lovely lua god lol
He means a modpack lol
yes i know
i just dont agree with these 1file half-put measures
people are messing around to much MP to 'fix' mods when we all know the real problem is the vanilla game engine on MP
the day they manage to fix cars from teleporting around i will deal with MP
i do agree and disagree at the same time....
the problem with steam workshop collection is that you can not subscript to a special version of a mod but only the newest one.
so for stability i understand why people do the modpacks but im also against it by default
yeah you are right on that
also it his problem if he get a DMCA or not for doing it ^^
Steam is a disgrace, thats the truth; they wont let me make my mod public while i dont spend money with them...
all my steam games are gifts i pay my friends and they send me; i dont like to put my credit card on the internet
because of that i cant even Add Friends on steam
thats how pathetic, greedy and incompetent they are
Steam is Pathetic
'pay me to give free stuff'
dude i cant even post comments on main mod sections
and i spent hundreds on dollars with steam, they just dont know it lol
technically from their perspective, you didn't spend any - the games are gifted
I think the whole "pay to get access" thing is to stop botting
its a valid security measure imo
yeah so if i dont pay i cant give a free mod? thats their 'logic' ?
yeah super valid... to NOT allow u to give a free mod LMAO
Not wanting people to bot their service is pretty valid
well, yeah. otherwise you'd have tons of free accounts posting various crap on the workshop
hmm but a think on the market for 0.20 dollar .. hmm not sure that will stop the botting then :p
The problem with MP is mostly in that Steam Workshop is the modding domain for the game
There's no version control on Steam
^
yes because steam SUCKS
i have plenty of issues with steam's workshop. being a legitimate customer as a requirement to use their cloud storage is not one of them...
So you can't make sure everyone grabs the right version, and steam itself sometimes doesn't even get the right versions
Steams the best platform there is
there is
There is literally no other comparable platform for purchase of games and having a community in 1
i notice you can always as the owner roll back your own version of the mod back ?
steam SUCKS dude you say tahts because the never screwed you yet
just give it a time
and u will change your mind about them
That's not a solution though
I got an account with $500 worth of CSGO items stolen and wasnt able to recover it
Because steam automates the download and update process
@opal wind what if one of your friend make a workshop mod and then give you the owner ship of it ?
I have been screwed, I just recognize the trivial nature of the platform
nah its ok Tiba i will pay those greedy bastards bums, so i can public my mod
i know why i sometime wish i could do actifacts of mods ^^
Regardless they only require a 5 dollar purchase to get full access and you can buy 10 dollar steam giftcards
The author has to make the explicit decision not to update their mods whenever they fix things
yes dude i will give them more money, but i dont have to like it, its not a question of value, its a question of principles
I usually make a copy of my workshop mods every now and then, incase a mod gets deleted for whatever reason or if I hold off on updating the actual game for a patch or two, etc
this look like a good game https://store.steampowered.com/bundle/7398/_Time_Lock_VR1_and_Deployment/ ๐
I mean I'd rather have people pay five dollars to use a platform where you buy video games
If it means stopping botting
you should Not have to PAY to make coments or add friends dude, how come you suport this RAPING of the consumer??
really kaiser
isnt that why you have it on a repo aswell ? ^^
u disapoint me
Not my own mods, but the mods I use
I don't publish any mods I make
You're right, I should be able to bot their website and friend everyone on the platform automatically
That totally wont be used for malicious reasons
why would someone do that?
Because we're human beings??
i see i usually just unlist them so if some one had sub to it they will still download it
@opal wind can you just let it go? this is not the channel for your anti steam rants, nobody cares
If some dude in Russia realizes he can make bank by phish scamming people on Steam he's going to scam people lol
you know what? im 42 yo and i dont want to get into a discussion on a sunday afternoon; if you are a steam lover, thats your problem, i hate them to my guts, and i will keep hating them no matter what excuses you give to them
so dont waste your time arguing with me on that
i despise them. period, its my right.
yeah sure kaiser, blame the russians lol
i think more it might be for security reason. like lets say person never used credit card upload some sceret document so person b which never bough anything either download the "mod " which only they know about steam might be liable for damage or somthing like that ^^
but how do the mod goes btw?
tbh im thinking in uploading it just on curseforge or some other mod plataform, the idea of having it on steam with taht pathetic 'subscribe' button sicks me to no end
they cant even install mods right
'subscribe'... lol
they create numbers (steam ID) for our mods, they wont even keep the darn mods names IDs...
anyway, like i said before its a waste of time to argue
i remember the first time i was trying to find this mod on my computer, its like steam hides them
