#mod_development
1 messages ยท Page 548 of 1
Are you sure you have the right ID set?
I've seen people updating onto their other work by accident
From copy pasting directories when starting new projects, if you copy the mod.info but forget to change the id number
That'd be my best guess
hrmm, could be right. Let me triple check.
Bah, thanks Chuck. Your suggestion somehow pointed me in the right direction. However, I was working on it from the mods directory rather than the workshop directory. The ID was correct.
Ah, see I have the opposite issue sometimes - if you're subscribed to your own mod the subscribed version gets loaded rather than your upload directory one
I kind of wish every folder was loaded and displayed separately
Yep I hate when I realize that during my testing xD
Question for MP server: Does anyone knows if there is cap on the number of zombies with a speedtype different than the default one? I am asking because I am trying to force the speedType of each zombie to Sprinter, it works well until I start to move around with the player, and suddenly stop. All zombies are moving at the default speed of the server. This doesn't happen while playing in SP. Oh, the same apply if I force the speedType to shamblers ๐
If you're tapping into zombie update you may have to move the code's location to shared if it's not
This is probably a horrifying question but can action groups be used to make zombies access events like climb wall / window the player character has?
How do Is it again to make a sprite not walk through?
i love this thanks, i dont use any guns but I will download this in forever. Im a huge fan of anything aliens.
Thanks, yea, huge Alien nerd myself
hello I need help I want to make the character attack except when the zombie is on the ground and stomp on it as usual. Where are the attack action scripts in the game?
There are onhit events that let you have a function call whenever a character hit a zombie/player
But I don't know how to define the event of a zombie on the ground and I don't know where to see them.
local function onZombieUpdate(zombie)
if zombie:isCrawling() then
if getPlayer():getSquare() == zombie:getSquare() then
-- player is on top of this crawler
end
end
end
Events.OnZombieUpdate.Add(onZombieUpdate);
is there a method that returns the time a player has played on the server? like across all deaths?
Yah what @thin hornet put here should help with that lol
Thanks, I try to implement it and achieve the result I want.
I have returned. Again.
Trying to add XP upon completion of recipe. I got the wholeOnGiveXP:Recipe.OnGiveXP.Blacksmithing10(copied/looked at vanilla recipes in recipes.txt), however, it errors out with something along the lines of "<local6> is null" or something very similar to that.
Any clue what that's supposed to mean, and/or am I entirely missing something in how to implement XP adding?
My recipe:
recipe Refine Scrap Metal Into Small Metal Sheet
{
ScrapMetal=5,
keep [Recipe.GetItemTypes.Hammer],
Result:SmallSheetMetal,
Time:120.0,
Category:Smithing,
OnGiveXP:Recipe.OnGiveXP.Blacksmith25,
NeedToBeLearn:false,
}
Vanilla recipe:
recipe Make Sheet Metal
{
IronIngot=110,
keep BallPeenHammer,
keep Tongs,
NearItem:Anvil,
Result:SheetMetal,
Time:190.0,
Category:Smithing,
SkillRequired:Blacksmith=4,
OnGiveXP:Recipe.OnGiveXP.Blacksmith25,
NeedToBeLearn:true,
}
The recipe itself "works"; it produces a small metal sheet, removes the ingredients, and keeps the hammer. But it doesn't give the XP.
Relevant Error messages from console:
https://pastebin.com/3pvadeXz
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I don't think Perks.Blacksmith exist anymore
might wanna use Recipe.OnGiveXP.MetalWelding25 instead
Alright, I'll try that, thanks. I'll reply back here if it works or not.
That did the trick, thank you so much @thin hornet!
Np
thats dope
hi, I'm looking to make the drinking animation looong for a beverage mod, around 3 minutes. I was wondering what made the drink animations loop longer than others (e.g. soda can vs pot or milk).
local function makeSkeleton(body)
local square = body:getSquare()
local direction = body:getDir()
local skeletonTemplate = addZombiesInOutfit(square:getX(), square:getY(), square:getZ(), 1, nil, 0, false, false, false, false, 100)
skeletonTemplate = skeletonTemplate:get(0)
skeletonTemplate:setSkeleton(true)
skeletonTemplate:removeFromWorld()
skeletonTemplate:setCurrent(square)
skeletonTemplate:setDir(direction)
return IsoDeadBody.new(skeletonTemplate, false)
end
why is it so ridiculously hacky to make a skeleton dead body?
is there an easier way im missing?
I guess not thst anyone know it then xD might just have to look after it after I'm finish at work then
don't make mods for pz

or order box of lubricant
still exists 
btw what's this? blacksmith was as metalwelding in prev builds?
if i remember correct you could forge few things in the start of the game but was removed. but might come back in 42
gotcha
it exist but its not active so its throw when trying to give xp to it
IndieStone
by any chance do you know which atributte you need to give a sprite so you can walk through it ? its a 2d sprite and not a 3d object im working on atm.
i dont recall exactly but its something about transparent if my memory is right
hmm okay just i make some kind of vines on sticks which i dont want to be able to just walk through but i will need it to be able to take dmg as well so it can break but that the next step in like 9 hours form now. ๐
do u know how to extract .pack textures from ProjectZomboid\media\texturepacks\? I want to get green tile to have perfect tile size to do sprites
thx i guess just have to make a into my generics lua script ๐
depend how you packed the skin and where on the sprites
it's game based
but packagename_00 or somehting like that you need to know the name of the sprite you want to select
default green tile from build-mode
I know path for it and seems it's extracts from .pack files
- there's strange size of img
full height
at the office so cant really find the default green tile from build mode atm ^^ what the img called ?
128x256 
I was confused in first time
but now just want ideal size of tile in 128x256 img
u won't find it anyway
sec
nope
can't find it again
forget where I found name of it
but it have to be here
I tried to google how to extract it but there's nothing

I tried adding a recipe to my mod so that I can craft a custom item and it's not showing up in the crafting menu. Not sure if I'm doing somethign wrong / have a typo / not doing something necessary. All I did was add a file scripts/ModName_recipes.txt that has
module Base
{
recipe My Item 1
{
MyItem2=3,
Result:MyItem1,
Sound:PutItemInBag,
Time:50.0,
Category:Misc,
}
}
My Item 1 is the display name for my custom item. MyItem1 (and MyItem2 for the other item) is the name given to the item object in scripts/ModName_item.txt:
module Base
{
item MyItem1
{
-- item attributes
},
item MyItem2
{
-- item attributes
}
}
(I probably shouldn't be using the Base module for my mod, but the names are unique enough that I don't think that's the issue.) Any ideas what I'm missing?
I thought that maybe it's because I gave the recipe the same name as the item itself, so I tried changing the recipe name to have "Make" before it, but that didn't have any effect.
I looked at the way the recipes are defined in the vanilla files as well as how another mod is doing it. Not sure what I'm missing.
collideN and collideW are the tile properties that control which side has collision
use tilezed pack viewer
Hi, I managed to exctract all the files from the vanilla texture pack when I was modding in B40. I don't remember exactly how I did that but I made a gimp template with a square as a layer. I can share it if you want it.
thx 
It's a png file sorry, and here it is in case of.
so if it on all sites ? it just so the person can walk through it at all
I also have this @jaunty marten
this is a better template to create stuff, the first template I sent is to align your faces in the same png to repack it in a .tiles file
im not sure how in the tile editor thingy but in lua you set it as not thumpable
you might think about https://github.com/cdaragorn/ProjectZomboidPackManager but i the new version do have a bug with some of the .pack now of days. so i would just use the .pack view in the default mod toll
fair just have to fiddle around in the lua script it what i need to make it not able to go though and it have to read on an atribute anyways form an item
I still have all the packed files unpacked as dozens of .png files, I can zip all of it in an archive and upload it somewhere
MP me if you want me to do that
newObject:setIsThumpable(false)

will pm you later or shout inn this chat right now i have to finish some setting.ktl scripts for my devop task xD
try using your own module name with
module MyMod {
imports {
Base
}
recipe My Recipe {
}
}
setColor(Color.red) changes the item sprite texture color sort of an overlay, but
does anyone know how to set up Custom colors for display name?
not possible without rewriting the ui
were you able to add a skeleton enemy type to the world or just replace all the zombies with skeletons?
would it be possible to make the weapon wheel detect weapons in your backpack too? and how difficult would that be? i haven't modded this game before ๐
you would edit/replace the wheel and do some inventory checks on the player
you could look into a mod that already changes the wheel if you know any
Add a skeleton enemy to the world, I can give you a snippet later today when I'm on PC if u want
But really what I wanted was to add a skeleton dead body which is what that function does
i havent been able to find a mod that does that unfortunately
no, is a WIP commission ๐
local function GetPlayerInventory()
local containers = ArrayList.new()
for _, v in ipairs(getPlayerInventory(getPlayer():getPlayerNum()).inventoryPane.inventoryPage.backpacks) do
containers:add(v.inventory)
end
return containers
end
assuming this is edited, what lua (?) file would i put this in?
into file of ur mod
You can edit the actual function your referring to here: media/lua/client/Hotbar/ISHotbar.lua
ISHotbar.onKeyKeepPressed = function(key)
#732 - local inv = playerObj:getInventory():getItems()
You can just change getItems to the other types of checks, I think the devs already have a recursive one
Would you mind if I write this as a mod?
I figured out how it can be done but would require using getAllEvalRecurse() instead of getitems
and writing an evaluating function
not at all
cant really figure it out myself haha
Hey people, question: How can i make so an item is provided each X hours survived to a player?
i know this function exists, but i would like better to count survived hours : ```local function EveryHours()
-- Your code here
end
Events.EveryHours.Add(EveryHours)```
check here survived hours lul
or u don't know function to get survived hours?
Checked https://pzwiki.net/wiki/Modding:Lua_Events for time, hours, survived, etc at no avail
how to make tire with air in ?
when spawn vehicle have 4 wheels but all tires are 0/40 air
Can't find it, i'm currently too noob on modding zomboid xD thats why i asked
Javadoc Project Zomboid Modding API package index
survived
you can use java functions in lua right?
https://zomboid-javadoc.com/41.65/zombie/characters/IsoPlayer.html#getHoursSurvived()
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoPlayer
yeah
good stuff
but poor usage 
Just as a clarification, the public Java functions can be called in lua, but not the private ones.
But there are a lot of juicy + powerful public java functions in the PZ code.
do u know way to fully override render of object? sadly I didn't find it anywhere
Do you mean the model? If so, no, but that is something that we are working on making mod-able ๐
https://steamcommunity.com/sharedfiles/filedetails/?id=2821231605
Update 16, people like the additions and requests made ๐
You can override the models for weapons, but not other models currently.
fortunately it's object without model just sprite
Just the sprite? Gimme 1 minute
how to dam put pressure in tire?
spawned vehicle has wheels without pressure but with random condition...
will be nice to have it with random amount of air in also
someone can help me ?

check the code of debug mode or cheat menu (mod)
local texture = getTexture("media/textures/NEW_ICON_NAME.png")
item:setTexture(texture)
named "Content Amount"
I mean dynamically
debug sure but where to have look on that pressure ?
and then how to put in vehicle code to set it with air in
literally render
about vehicle code idk absolutely
Ik only lua ways
rn have in tires same as in temple
container
{
capacity = 40,
test = Vehicles.ContainerAccess.Tire,
contentType = Air,
}
This is the behavior you want right?
Hammer is in a briefcase inside the backbag
Ahh good to know thanks for clarifying
You have to tap into another function as texture isn't saved. I do this for Named Literature, and use function ISInventoryPane:refreshContainer()
it's not item but world object
3D models can't be changed dynamically atm
but this function will work on 'floor' containers too
not model but sprite
you could tie into LoadSquare()
just make sure you have it only capable of applying once
without an added event for items on load this is kind of how you have to do it
also not that bad
- I need to check always if it need to be rendered
you can add the square to a temp global list so it's only ran once
same thing with the items, so it's not reapplied
I just want to do obj.render = function() ... end like in gmod

seems my mod going into trash bin without this feature
you can try to suggest they add a triggerevent on item load
blair said they working on it
I think it's same things here
it's not iteeeeem
What is it?
world object that haven't model but sprite
so like broken glass/furniture?
IsoObject.new(square, "media/textures/blablabla.png", item_type)
tbh idk how it's coded
if you're calling new() you can just change the texture there? no?
okay just it:
I have mode that can enable/disable and I need to render sprite objects only if mode is on
so I need to control render each frame
not just once
When/how are they placed? You could create a list in modData of XYZs
I can change textures on mode change
then on world load / whenever you want - can change them based on xyz
but sounds like a shit
sounds trash but seems it's single way to do it currently
don't want 
that's kind of how it has to be done unless you have the player directly changing it
it's not unoptimized lol
not so
yes!! 
I don't know exactly what you want to be happening, but if you want objects to change over time or go into different modes you need a way to reference them
otherwise you'll be scanning the tiles in the area instead
it's a problem cos I don't want to go through all table
also the game is pretty solidly built - all things considered - I scan the entire cell square by square for EHE and no ones mentioned lag lol
I want just override render of single item type
that's why I said to shorthand using xyz
table = {["x-y-z"]=object}
table["x-y-z"] returns object
you dont need to for loop it
Ah, my bad in that I though you were talking about inventory items and not world objects?
Currently I don't know very much about modifying world object sprites; it's not in my wheelhouse.
I have optimised xyz table with meta-args that contains object but anyway it's trash
I wouldn't try saving the object in anyway
sad but anyway thx for feedback
does it inherently save if you create an isobject?
I've never tried
but if you don't have to worry about manually saving the object - I'd just save the xyz's and grab the objects on boot
concatenation and strings - thanks but no xd
would be alot faster for saves
Not sure what your ideal solution would be then
How would the game know which object you need to change?
only way is iterate full table on mode switch
table of objects
it's fine
you can't save objects in modData afaik
which is why I suggested the xyz
would also avoid save bloat
their pos saving in moddata[x][y][z] so it's fine to find them after restart
okay then what's the issue?
optimised way to render them only if setup-mode is enabled 
I'm always work on optimise and if there's no this one then I'm crying
isn't the point of optimizing to avoid overhead costs
having a table of coords recorded isn't unoptimized at all
that's what I want to do
- it's better than iterate each square
- my table is optimised so it's fine
it wouldn't go through each square
you can just use getsquare on the saved coords
then populate a temporary list for direct object calls
once, at world load
Anyway, hope you figure it out
I already done it but anyway shit way
Nice, good job

Just a little more testing before releasing this mod to public
it sounds like the globalObjectSystem would be really suitable for what you are trying to do. I suggest taking a look at how the rain barrels are handled. The rain barrels even has code for dealing with modifying the sprite for the object since they need to display different sprite depending on how full the barrel is. all you would need to do would be to change the everytenminutes event to a every minute one and I think it would be able to ensure the sprite is always the correct one, before your character gets in range to see it.
ty!

Dude, that looks amazing!
I know you can set skeleton to true
But something i want to know is if it's possible to load different models
I wish I could load something else other than skeletons
Because I wanted to add other type of zombies
I know a hacky way to make new type of zombie models to spawn but still
everything with modding this engine is hacky lol
question how do i add maps on bisect hosting also hi first time on the server
Has anyone made a refrigerated or frozen large trailer, box truck or semi-trailer mod for mass hauling of perishable goods?
Aside from the refrigerated spiffos can, ice cream truck mod and car ac refrigeration, there does not seem to be any on the steam workshop
Would this kind of mod be difficult to implement in the game while playing nice with other various car mods like filibusters and eggons?
I meant load a new 3d model
For example, skeleton = true loads the skeleton.x
I wish I could load a custom 3d model just like the skeleton thing does
in the survivor description theres a HumanVisual
in that theres a function
setForceModel(Model model)
You seem to be very experienced, is there Any documentation?
yes but, I just read through the decompiled code
the documentation is pretty bad
no descriptions usually
Yeah its bad especially for someone with very basic c# programming knowledge
well, C# is basically Java
so you would probably be pretty familiar with the decompiled output
C# is microsofts response to Javas popularity
JavaScript or java ?
Hmm
Will try it, i tried decompiling with zomboidDoc but it was always giving me error java version no matter which version i had installed
yeah, I had the same problem
I debugged it a little bit, basically zomboid is compiled with latest java
and its conflicting with gradle, because if you set java to a version zomboid likes
gradle gets upset because it runs on a version that is to new
and at that point I said fuck it ๐คทโโ๏ธ
use java 17
mine was that still gave the same error, will try what internetExplorer said to me
I tried all of these
the only one that was able to execute the getVersion gradle task was 18
but gradle itself only supports 17
thats weird
Wish I could help more but I'm much more experienced with maven over Gradle :(
I am trying to create an item with the same interface as a cd player but which doesnt use cds or vhs. How can I make an item and associate it with the new player.
This is my first mod and I probablt should have started with something simpler but I'm already set on this
You could copy the code for the interface but instead of saving recorded media you save the item into the object moddata.
You create a tag for the item and then you only accept item with that tag to be dragged in.
Ejecting the item from the object you read the mod data and recreate that item back into inventory.
item GameBoyPlayer {
}
-- if each media is its own item
item GameBoyCassetteMarioWorld {
mediaId = MarioWorld,
tags = GameBoyMedia,
}
item GameBoyCassetteLuigiWorld {
mediaId = LuigiWorld,
tags = GameBoyMedia,
}
-- if media is a single item
item GameBoyCassette {
tags = GameBoyMedia,
OnCreate = MyMod.OnCreateGameBoyCassette, -- assign a random mediaId and change the sprite in that function
}
-- Shared file containing all items data
GameBoyGames = GameBoyGames or {};
GameBoyGames["MarioWorld"] = {
title = "Mario World",
year = 1992,
boredomModifier = 2,
}
-- server/MyModRecipes.lua
MyMod = MyMod or {};
function MyMod.OnCreateGameBoyCassette(item)
local allIds = {};
for k, v in pairs(GameBoyGames) do
table.insert(allIds, k);
end
local randomGameIndex = ZombRand(1, #allIds);
local gameData = GameBoyGames[allIds[randomGameIndex]);
item:getModData().mediaId = allIds[randomGameIndex];
item:setName(gameData.title);
return item;
end
function insertGameBoyMedia(gameBoyPlayerItem, gameBoyMediaItem)
local gameBoyPlayerModData = gameBoyPlayerItem:getModData();
if gameBoyPlayerModData.currentMedia then
print("gameboy player already have a media inside")
return;
end
if gameBoyMediaItem:hasTag("GameBoyMedia") then
local gameBoyMediaModData = gameBoyMediaItem:getModData();
gameBoyPlayerModData.currentMedia = {
mediaId = gameBoyMediaModData.mediaId
};
return true;
end
end
function ejectGameBoyMedia(gameBoyPlayerItem, inventory)
local gameBoyPlayerModData = gameBoyPlayerItem:getModData();
if gameBoyPlayerModData.currentMedia then
local item = inventory:AddItem("GameBoyCassette");
item:getModData().mediaId = gameBoyPlayerModData.currentMedia.mediaId;
local gameData = GameBoyGames[item:getModData().mediaId]; -- get that shared game data
-- do more stuff to reasign item name, icon etc
return item;
end
end
Thank you for your help
Someone made a Lua GB emulator over on Roblox
I see no reason (other than you know, setting your computer on fire) it couldn't be ported to kalua
The better you are at GB missle commander, the more stress it reduces ๐คฃ
Cant wait for the printer
I wonder if a yarr me hearties zomboid copy of that roblox lua would have to be on a russian game mod site because steam workshop would respect copyright.
i wonder, when you already have something equipped and swap it with something in your backpack, do the items switch places? i figure they dont since that could become messy with backpack capacity
It would just dump it into your inventory with the default behavior. Do you use SwapIt?
I haven't tested it out...
Added something else to it
So far:
Hotbar radial menu (holding down the hotbar keys).
Vehicle mechanics window for engine parts/wrenches.
Overwritten Functions:
ISHotbar.onKeyKeepPressed
ISVehicleMechanics:doPartContextMenu
ISVehicleMechanics:doMenuTooltip
awesome! thanks for making it, i really couldnt have done it myself
love that steam allows us to easily view mod content too, makes it alot better experience to try and figure out how mods work
Normally I wouldn't overwrite functions this way but I don't know of any other way to change the internal behavior of the functions
the mod only changes like 1 line per function
Doubt it, think the emulator was open source and you could be like every other emulator and make users bring their own ROM
But it would be absurdly hard to get anything playable working ever
Lol
I have been denied
Time to dig into timed actions again
Why does the car lose all velocity when I get out ๐ฆ
Theres some nutty Lua magic on RVLX
RBLX
A dude made an accurate flight simulator
It uses real world topographic data to generate a 1:1 scale America
And dynamically load it
And it has real flight models
Like raypoint calculations for the aerodynamic forces on a specific point of the wing
So your plane can suffer wingpoint stalls accurate to the real world handling of a 178 Cessna
Its pretty performance efficient too
But yeah you can't actually port Roblox scripts to Kalua
Without extensive modification
Roblic uses a propriety language
Called LuaU
And it has like entirely different interpolation variables to normal Lua
does anyone know how to make a vehicle trunk accessible from the interior, like KI5's M998 HMMWV?
im just starting to learn lua so im not sure where to even start
You just have to remove the type annotations and engine specific garbage
LuaU itself is just a restricted superset of Lua 5.1 so without the annotations it should be mostly fine
you could always learn backwards by looking at the code for it
Once I unsubscribed from my mod on the workshop, the recipe started working. Which is really odd. It was a single player world and any changes that I make to the local copy (Users/*/Zomboid/Workshop/ rather than steamapps\workshop\content\108600) of my mod get seen. Maybe my single player world somehow took on the workshop version of the mod. Or maybe recipes go with the workshop version for some reason. But as soon as I unsubscribed from my own mod on the workshop then restarted the game, my recipes were available.
thats wack but good thing you found out why it didnt work
thats what i originally did but im struggling to get it to work and since i dont know much about lua im not even sure im looking at the correct code
does anyone here knows how to change the the zombieLore for only one type of zombie?
lets say I spawned a skeleton, I know theres a boolean to verify if its a skeleton, is there a way to only give a skeletal zombie specific settings separated from the others?
even if I try to getSandboxOptions():set("ZombieLore.Toughness",1) and what not inside the boolean, every zombie is changed
only the zombie:setHealth actually works
Except LuaU uses almost entirely engine specific variables
IE Player handler, LocalPlayer, Click detection in engine
Part specific definitions
right, but I guarantee the core of the emulator is done in lua tables
Would be easier to just make it from scratch in Kalua
Pretty sure Ik what you're talking about and its just pulling from a public GB emulation table
like _G you mean?
easy enough to change how thats done
guys, how do I mod another mod? I'm making a file that fixes a recipe from another mod, but I don't know how to do it properly
Hi all. Is there a way to add more music to the game?
Take a look at True Music mod @ steam workshop
Thank you. I'm not sure that is what I am looking for, though. I was hoping for music that just randomly plays while playing the game, or plays during appropriate times, like battle music when zombies approach.
Ah, I see
Maybe, just maybe this might help you https://www.youtube.com/watch?v=3YXekxvgduk
Important tools:
Audacity: https://www.audacityteam.org/download/
FMOD Bank Tools: https://www.nexusmods.com/rugbyleaguelive3/mods/2?tab=description
BPM Finder: https://tunebat.com/Analyzer
Relevant file locations:
.bank directory: .\ProjectZomboid\media\sound\banks\Desktop
Haven't watched it, though
Hello, I found a line of code that is:
player:setAuthorizeShoveStomp(false);
I would like to know if there is a similar one that only affects the Shove or the Stomp?
Try something similar to:
player:setAuthorizeShove(false);
And it gives me errors.
What is the deal with require statements? Specifically, what is the "starting path" for them? And can I require a file from my clients or shared directory if I'm currently in a file within the server directory? (If yes, how?) Thanks.
require syntax is basically without the lua/shared/ (or client / server) prefix on the path. as a general example, assuming your file is in lua/shared/MyFolder/MyFile.lua and you were calling the require from lua/client/ then you would use:
require "MyFolder/MyFile"
or
local MyFile = require("MyFolder/MyFile")
depending on if the file returns a value/table
for requiring files in different shared/client/server structure, its best to understand how the folders are loaded...first shared is loaded, then client files, and lastly server.
stuff in shared shouldnt require stuff in client. (not sure if its possible, doubt it)
stuff in shared or client can not require stuff in server (not possible, server folder doesnt exist on lua path at this point)
stuff in server shouldnt require stuff in client (this will fail in mp, servers dont load client files last i checked)
both client and server can freely require stuff in shared
side note: the first version of that require require "MyFolder/MyFile" is generally only useful to ensure a file gets loaded first, using this particular syntax to require a file in shared from client or server is basically redundant (since the file has already been loaded)
thanks for the detailed explanation!
Just wondering about createZombie(), spawnHorde(), createHordeInAreaTo(), createHordeFromTo(), etc.
Do these have a chance of creating the "special" zombies we sometimes see in an area? Like BaseballFan, Bandit, etc? Or can we only spawn them using addZombiesInOutfit() or similar??
how do I make something give you the pain thing in your head when you eat it
Where do you get the world position of every players in a server?
how does the getDay() function work in GameTime? Does it tick up at the start of day at 00:00 or?
whenevr i put my mod in my mod folder and load up my game and enable the mod it does this
probably for the mod support channel
When I craft my item with materials that have low condition, my crafted item stats with low condition. Is it possible to specify that the crafted item should be full condition no matter what?
how would I make it so if I were to right click on the ground, it would give me an option to do something, then when I did that thing I would recieve an item in my inventory
like when you dig furrows and it gives you worms sometimes
hi guys
you want to hook into a TimedAction perform method
To add context menu when right clicking you need to use
Events.OnFillWorldObjectContextMenu -> for clicking the world
and
Events.OnFillInventoryObjectContextMenu -> for clicking in inventory pane
Is there a way to make moving items or something lol
Thanks
Is there a way I can make that context menu appear only on certain tiles
using Events.OnFillWorldObjectContextMenu you will get a couple parameters
local function onFillWorldContext(player, context, worldobjects, test)
--- context: is used to added menu item to the context menu
--- worldobjects: is the world objects selected on that click
--- player: is the player number
local playerObj = getSpecificPlayer(player);
end
Events.OnFillWorldObjectContextMenu.Add(onFillWorldContext);
How do you check which item is select when in a Events.OnFillInventoryObjectContextMenu function? Does it get passed in as a paramter or something?
local function onFillInvContext(player, context, items)
end
thanks, basically im making an eat sand mod and I want players to be able to collect sand from the sand ground lmao
check at the vanilla functions to learn how to use it, OnFillInventoryObjectContextMenu is special
where do you get that info from?
search the game code
ah okay ya i usually use the lua to find examples, but you dont get the function signatures for events
When i answer you guys here, im technically just doing quick search in the game code lol I dont know all that by heart
you have the java disassembled as well, right?
is it helpful?
for more deep research
or are all the variable names just like var1 var2 etc
it is yeah it show alot of the inner stuff that usually cant be found in the lua
do the java methods show actual names for the parameters?
also my item doesnt have an icon
variable name var1 is not that much of a problem, the logic is the most important
i have tried loads of different things
but it just keeps using a question mark as the icon
as long as we can see the var1 type etc and function names we can get to understand
oh true explicit types are really nice for that. and having the function names available is clutch
all methods and variables are named, just the param are not
do i need to put Item_ before the sandblur on the icon section?
because thats what it is in game rn
try reloading the game
how can I make a custom worldstaticmodel
i have loads
well this seem right
can you link your guide to disassembling the java?
Setup CAPSID > 4) Run Setup Workspace config
is the last step for the decompilation part
the rest of the tuto is for setting up and using intelliJ for making mods
how would I make it so my character gets pain in the head after eating the sand
something like
local head = playerObj:getBodyDamage():getBodyPart(BodyPartType.Head);
head:setStiffness(head:getStiffness() + 2.0);
Where would I put this code? I am quite new to most of this lol
Is it required to decompile to say possibly add a custom moodle?
Like how Hunger and Stress show as moodles.
Or is the only way to do that to go the defecation mod's route? ๐ค
Would it just be in my sand item text file
decompiling is only for researching how things works internally in the java side
Hmm, so it'd still be a worth while investment to decompile to understand the moodles, which is good since ik I'll need it in near future at one point if friends ask about it.
But, it'd still be possible to add new moodles though? Just, no one done it though, right?
for custom moddle check the workshop i think there might be examples how to do it
Its not possible like vanilla does it
But there is a hackish way of doing it i think
would be nice to have some more modding capabilities on the moodles
Gonna say, I know defecation has like a way of doing it, but like I'm not trying to add a new mechanic like that, just more "expand" with new moodles both positive and negative.
Otherwise, I'll have to see. Since only like maybe 3 mods at most that come close to "moodle" stuff that isn't a retexture.
And I agree, would be nice for more modding capabilities for moodles, but gotta take what we can I suppose. ^^
Just wanted to come in here for a bit of clarification before I dig into a project Iโve been thinking of.
Iโm pretty sure many people, if youโve played multiplayer, know how annoying PVP is with the stunning and somewhat unfair and random gunplay. Would there be a possibility to change and or modify these effects. If someone has tried to dabble in these, I wouldnโt mind having a chat. Or if it already exists, send a workshop link. ๐ค
best way to reload and test your mod lua is to just quit and reload the save right?
guess I better have it on an ssd
how to get name of sprite of object?
-- first file
local obj = IsoObject.new(square, "sprite.png")
-- another file
obj:getSprite()...?
obj:getSprite():getName() -- doesn't work. returns nil
:getSpriteName() doesn't work correctly :(

@thin hornet maybe u know (u seems genius in pz java
) but there's chance for IsoObject:getSpriteName() returns cached value and not just gets sprite and after return name of this sprite?
hum
let me check
local sprite = isoObject:getSprite();
if sprite then
local objectSpriteName = sprite:getName();
end
thats how i do it
now depend what object you are trying to grab the sprite name
maybe it doesnt have a sprite?
my problem is:
isoObject:getSprite():getName() - returns nil
isoObject:getSpriteName() - returns incorrect sprite (sprite render 1 sprite but from this func I got prev set sprite)
isoObject:getModData()["blablabla"] - returns correct sprite
rofl is I set sprite and save it into mod data literally in same time so there have to be same values but :getSpriteName() fked up
you create the object ok i see
i used to have problem with this, is it from a custom tile pack
currently to solve this problem I saves sprite names in moddata
but for what this info in moddata xp
when you reload the save game
does the object stay
using F2 you can still the sprite info?
after reload it's fine
seems :getSpriteName() returns incorrect value after I set sprite a few times in one tick
hum why you set the sprite multiple time in a single tick?
exactly 1 or 2 times in one tick to be correct
creating pipes system with automatic-connect ones so neighboring pipes of cross one of main pipe calcs twice to have correct value
original idea was auto-irrigation with feature to add fertilizer in barrel to almost fully-automatise farm
but now I have really much ideas for it
Does anyone have a mod or know a mod that lets me use blind zombies? I don't know how to create custom mods, I have no programming experience or I would do it myself.
Like to where they ignore you?
I mean, sound would still be dangerous. Just blindness
Me and a friend are doing a clicker playthrough, clicker sounds and faces.
Just want them blind to fit the experience
Or atleast, like blind enough where they can still track you, but not see you from a room away unless you make noise
I have another idea to create wires system to generator works not in range but by wires but I'm not sure if it useful mod
but maybe if create feature to add custom lights/switches in built houses then it can have some impact
Oh.
Sorry bud, cant help much on this one.
Does anyone know how to give one type of zombie a different speed?
I was able to randomly spawn a skeletons instead of making all of the zombies skeletons, i was able to set it's health to very high while every other zombie HP is default, but I'm not able to set it's speed, whenever I do, every zombie in the game has the same speed
I know it might be possible since the game has the random feature for speed but somehow a boolean doesn't work
Well the boolean does work but the speed just changes for everyone still
I'm using getSandboxOptions():set("ZombieLore.Speed",1) .. i don't know which type of codes are there but i tried zombie:setSpeed, zombie:changeSpeed, these just give errors
https://zomboid-javadoc.com/41.65/zombie/characters/IsoZombie.html
speedMod perhaps?
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoZombie
I think i tried it by looking at another mod, let me see
There's a speedType, so I wonder if zombie:speedType(number) idk will see once I'm on my computer
it probably relates to shambler, fast shambler, sprinter, etc
if you want those, that will probably work
speedmod is a float
so 0.1 for 10%
I guess
Yeah I just want to make these specific zombies to a specific speed with a specific health. Trying to make a new type of zombie, not really a special zombie but a new type, and since I know no other way to load a custom model I'm gonna replace the skeleton 3d model with something else too.. as along as speed is finally edited to only them
Is it possible someone could make a mod, or point me in the right direction to make a mod for zombies to be completely blind, or have enough site to be like a clicker from TLOU?
I have no programming knowledge, and everything I read literally looks like 20 different languages mixed into one for me
hey ๐ maybe here it is the location: it seems, that the game tilts every single texture/tile by a very small degree. a very slightly turn in the angle of the whole grid.
the game itself isn't accurate isometric. its grid is off a little.
in the editor it is perfectly lined up.
ingame, every single texture, floor, walls, etc.. is slightly tilted and overlaps
floor tiles even enlarge itself 1 row of pixels to N and W
anybody know why that's the case? a game engine thing, which can't be changed?
f.e i have to redraw all pavement tiles seen in pic2 on the right. i must darken the E and S row of pixels, because ingame those get overdrawn from the adjacent tiles and don't show.
i dont know if this is supposed to happen or what
i have both brita weapon pack and arsenal26 activated but i can only seem to find guns from arsenal26 and barely any ammo for the guns i do find
pls help if anyone knows if this is supposed to happen or just a problem
Is not there a in-game option for sight?
Only for Poor. Not blind
poor sight i still get spotted from across the road
Sadly have no clue but I'm sure it should be possible
I'm not sure if it even is...
CDDA zombies has
"Listener Z - Speed: Normal HP: Normal (Poor sight but sensitive ears)"
but it doesn't actually change the sight, it just enhances hearing
do you know any other mods that change zombies sight?
I can't see anything in javadoc for it
i mean there's 3 sight/sound values so it'd probably be possible to make another
I think you would need to check something related to zombie to player distance detection
and hope that the distance detection is not the same for hearing and sight
how are you going to override what the game does by default though
hardcoded into the games java code I believe
you could make another, but I don't know how you'd make the game use it
and im not smart enough for that
im kinda surprised there's no option to make them completely blind though
in IsoZombie:spotted(isomovingobject, boolean)
line 1572
the sandbox sight references
I'm fairly certain if the zombies were to be 100% blind they wouldn't be able to attack (code-wise)
You could tie into zombieUpdate() and forcibly erase their spotted object
Super Weird Helis does something similar - except it forces the closet player within the cell to be spotted instead
You'd have to figure out some heavy workarounds for this to work
If you can track how loud a player is you can use OnPlayerUpdate() to add them/remove them from a list of possible targets
and use OnZombieUpdate() to validate the target
I think that's how the Zombie Camo mod works
This so so satisfying lol
I need to figure out why the car loses so much more momentum tho
most likely yes
current reading through the java to see where it triggers it
might be able to apply a force equal to what's being lost so it rolls as expected
if you find a way, could you make the character fall
like when he tripped over a fence and fall
Will be looking into that next
I'm thinking of copying the logic for fence hopping to begin with as a % to fall
or for a more simple approach - each level of nimble = 1mph, if your nimble is higher than the speed than you don't fall
and leave it at that
also need to change exiting while moving to require helddown
yeah if the car is not going too fast should be good
thats a dope idea bro
๐
its gonna feel like Project GTA
if it doesn't pan out I'm just leaving it at <= 3 mph
Here's some information about new Distribution features and such in these notes regarding build .72 unstable.
This will be temporarily pinned.
Don't think I can get it working - I figured out the java is setting physics to false, I tried applying it to true using ontick but it's not enough and only rolls a little bit
alternatively I could try setting it as being towed by something
or swap in a ghost driver
but I think that may cause more problems lol
yeah, if there's no driver, isn't being towed or towing anything it's physics drops off after 3500 miliseconds
also don't see a way to force impulse
You have to be going max speed to get the same distance as just letting off the brake
Has anyone made a mod for the van for Dumb and Dumber? pretty sure that film came out around 93/94
what dimensions should my textures be
for an item
how do I give my item a custom description
like how lemon grass has "soothes the bouts of food poisoning"
@sour island
player:clearVariable("BumpFallType")
player:setBumpType("stagger")
player:setBumpDone(false)
player:setBumpFall(true)
player:setBumpFallType("pushedBehind")
there are other types of fall you can do
this is how i did it for slippery snow
local function stumble(player, speedKmHour)
local nimbleLvl = player:getPerkLevel(Perks.Nimble)
local speed = math.abs(speedKmHour)
player:clearVariable("BumpFallType")
player:setBumpType("stagger")
player:setBumpDone(false)
player:setBumpFall(nimbleLvl < speed)
player:setBumpFallType("pushedBehind")
end
```Great minds
same method I did for EHE
Is it possible to mod vehicles to lose items from the trunk because a person forgot to close the trunk of a vehicle?
Hey all, I've never put custom zombies in the game before but I'm following Peaches guide and when defining the zombie he has:
<m_items> <!-- White Zed Skin -->
<itemGUID>9c87b588-b784-4560-bada-fd4cf7e44d48</itemGUID>
</m_items>
I was wondering, where do you find the GUID's for the different types of zombies? I know where to find clothes, items etc but I'm having no luck identifying where to find the zombies skin GUID
The skin is a clothing item if I'm not wrong
hmmm I'm having no luck finding where they are defined in clothes. I'll have another look
thats rad
Hey guys. Are there any guides for making a custom weapon and getting it into the game? I know my way around in Blender already.
I think here you have all you need https://www.youtube.com/watch?v=2M2fWLBLaX8
0:00 Intro
0:29 Video Start
1:00 Start Blender
1:22 Using a background image
2:04 Using photoshop to edit the background image
2:52 Adding the edited background image to blender
3:26 Adding the cube mesh
3:46 Quick start with the cube
4:56 Importing a finished 3d Model from the internet
5:56 Moding the imported model
6:47 ADD NOTE ABOUT MAGAZIN...
Hey people how can i make a script so it gives an item A to all players each X time if they have B item?
Thanks that sounds perfect :) I'll give it a watch soon once I'm back home
just have a script that checks player inventories for said A item, and adds B items in a function and add it to a lua event. youd have to chose the correct one based when you want to trigger this to happen
how would it be? is there an example around i could check?
(i'm just not used to zomboid coding, so if there is any example i can reverse engineer to understand would be good >.< )
Is there a QoL mod that helps you loot zombie corpses? Its a bit difficult to check every corpse. I vaguely remember passing by a mod that has that one as one of its features but cant remember the name
nevermind...found it
i tried making my custom food into a spice but it doesnt work
it doesnt let me put it on anything
i did spice = TRUE on my item but it dont do nothing
can someone teach me how to like format a mod
because when I get told code and stuff I have no idea where to put that
there is an example mod that shows the structure for the mod folders in the zomboid files
Where do you get the world position of every players in a server?
I'm so ready to give up. I've finally got some custom items of clothing in and working but I've spent the last 4 hours following Peaches guide for getting zombies to spawn in with custom outfits and I cannot get it to work at all.
Has anyone here got any experience with creating custom zombies for map zones?
I haven't ever done that, but this video may help? https://youtu.be/bQw6vANZqk0
In this video we go over how to zones so you can spawn specific zombie types in an area.
If you want to support me here is a link to my patreon:
https://www.patreon.com/DaddyDirkieDirk
List of zombietypes as of the 12 of March 2022:
Wedding
TrailerPark
Pharmacist
Bowling
Doctor
Spiffo
Gigamart
PizzaWhirled
Dinner
PileOCrepe
SeaHorse
Restauran...
I appreciate it but I've got Zombies spawning based on the vanilla definitions, it's spawning custom built zombies I'm struggling with.
Ah ok, sorry not sure I can help. But I hope someone else can ๐
is there a mod to hide the info saying from which mod specific items came?
how do i make my custom food into a spice
Are you able to see the outfits in the debug spawner?
Any of you know about the mod that adds useless fillers to containers? I really care about something like that because mods like "Ridiculously rare" reduce the number of items in the world by only 75% and someone told me it is limited by the creators of the game, I want something that will make the number of items really minimal, but not zero because exploring the city then makes no sense at all.
I admit that after many hours I would like to play a story where I am almost forced to eat rats and earthworms, but I would like to feel that I am able to find the holy grail in a supermarket or other place ๐
Have you played with 6 months later in addition to rare?
Most of the food would be rotten
An improvement to the way in which mod errors are reported. A list of mods has been added to the pause menu, and whenever one is erroring out then itโll be flagged within the list. This is going in alongside an improved lua error log that shows whether any files reported in call stacks are being overridden by mods. This should help modders and our support teams no end.

any files reported in call stacks are being overridden by mods
No modder should be naming their files exactly as vanilla files to begin with - and for good measure should include the name of their mod in the file name.
A more streamlined output would be nice tho
You wouldn't happen to know how to trigger the floppy roll animation from sprinting over fences would you?
@sour island
Actually, the food on the normal world also rots after a few days, but there are still a lot of cans and other non-perishable food, still too easy ๐ญ But it's not just about food, I'm playing on a insane amount of zombies and I'm still able to fill the cabinets on my own in about 10 days and be ready for a months of sedentary mode
you've used the 75% less loot mod ontop of very rare settings?
dont remeber the string for it sorry
No worries, I'll look harder
looking for some mods, anyone know of some good mods for new jobs? already got the improved med job but cant find anything else
Work around
Reduce the sight to something super small, few centimeters from themselves to almost 0, this way the sound system will do the job, they will always hear something and go to where the source of the sound was.
Then a work around for not attacking the player would be if possible he could detect if the player is crouching, walking or running, depending which one, you can enable and disable the normal sight, mimicking que "follow the sound" and enabling them to attack, then you could also use the zombie memory to the codes advantag, example...
Player is running then zombies detect by sound.
Sight enabled again, zombies follow the player.
Player suddenly crouches, remove sight, lose track of player object, go to where they remember last seeing or hearing the player
Something like that
Or even using zombie memory alone to achieve the same result.. i assume the "remember last place the player was seen" is a waypoint system
You can use the waypoint system to make zombies walk there, then somehow enable their attack behaviour as if the player was there.. this way they would truly be blind attacking the waypoint as if someone was actually there
how would I go around making a recipe for something already in the game?
i want to make a craft padlocks mod
is there a LUA code for Burst firemod Option for Guns?
jesus I still could not change speed for a single type of zombie.. if I change it either changes everyones speed or doesnt do anything
you know how it says that for carpentry
for giving xp
what would it be for metalworking
this is urgent
i have the format
i just want to know how to make it so you have to spend 3 scrap metal
and 2 metal sheets on a padlock
Is there a mod that makes it so instead of needing to hold right-click before left-clicking to attack, while aiming with the mouse pointer, we can just left to attack and our character auto-faces/turns to wherever the mouse cursor is? If not, where may we make this suggestion to the devs? Thank you.
Anybody know if it's possible to get a vehicle's overall condition in LUA?
how can i use custom sounds for recipies
module Base
{
imports
{
Base
}
recipe Make Padlock
{
ScrapMetal = 3,
SheetMetal = 2,
Result:Padlock,
Sound:Padlock,
Time:100,
Category:Survivalist,
}
}
thank you so much
Math can be hard unrelated, just saying, statement
you know the time:100 thing? is what does the time go by? is it seconds? minutes?
put in media\sound and edit the Sound:Padlock,
sweet thank you
its more like ticks or something like that its also scaled with timescale but its clearly not seconds.
ah okay
is this the correct thing for a combonationpadlock?
or is it named by something else
Soon โข
not vanilla?
wdym
the combination padlock is your item, right?
no
i just want people to be able to craft padlocks
cus its hard to find em
i have made a seperate recipe for combo padlocks
but i was wondering if they were just called combinationpadlocks in code
like that
ok i have explained this confusingly
Sorry, I don't have a chance to play the game much. I have no idea if the item is from the base game or mods.
no no dont worry i was a bit confused lol
how do i make the recipies have a seperate category
not urgent might add it later on in the mod
just to know
recipe Make Pan
{
IronIngot=30,
keep BallPeenHammer,
keep Tongs,
NearItem:Anvil,
Result:Pan,
Time:220.0,
Category:Smithing,
SkillRequired:Blacksmith=2,
OnGiveXP:Recipe.OnGiveXP.Blacksmith20,
OnCreate:BSItem_OnCreate,
NeedToBeLearn:true,
}
is blacksmith metalworking?
I have no idea lol
you should try
yeah im loading it up rn
learn from the recipe code in ProjectZomboid\media\scripts\recipes.txt
i wish Zombies value 6 would allow for spawning zombies manually.
this specific code does nothing tho
setting zombie pop to 0 prevent zombies completely
how do I give a recipie an icon
literally is just the bottom line, all possible branches get overridden by it
recipe do not have icons, they show the items
Is your Combination Lock item icon showing correctly when in inventory?
when messing with textures sometime restarting the game completely fixes it.
yeah ill check
how do i make it so you need metalworking to craft an item?
i did this
but it just lets me craft it with no requirements
how do I make it so they will need a propane torch and welder mask to craft it?
is this channel only for discussing mod creation or can i ask for mod suggestions too
or will it auto do it seems as you need the metalworking skill
#mod_support is intended for any cases where someone who is using a mod needs helps, but otherwise you're welcome to discuss pretty much anything related to mods here? ๐
ah thank you
why wont it let me craft it lol
it is being strange
once i fix this i can release the mod
does any1 know whats wrnog with it
With mods like the Susceptible Trait, does that mean it's possible to create a fungus mod (The Last of Us) that allows an active fungal infection/spores?
its still doing it
does anyone have an idea
on why this is being fucky
i gotta release this mod in like 10 minutes
wait I know why
have you tried clicking DBG: Give ingredients?
"SmallMetalSheet" in your recipe should be "SmallSheetMetal"
yeah thats why it wasnt working
thanks
I have been having trouble finding a "easy" to follow/understand/mod-along video/text doc for creating and importing your own models and stats and behavior for unique zombies. I have found that rather lacking in the workshop so I wanted to try my hand and give back to the community. Anyone who could point me in a direction? I have checked the forums and done some googleing but cant say I have found a good place to start.
I also checked the pzwiki but I cant say I found what I was looking for
Should I just go through https://projectzomboid.com/modding/ and kind of wing it with the reference of the different classes?
wut
download cdda zombies and take a look at the code
or the deaths knell zombies mod too
thank you very much! I'll have a look!
try rereading whatever give that recipe. The recipes are saved on the character, so it can be kinda funky when a existing recipe is modified. usually reading the book that gives the recipe fixes it, but if you get it for free, im not sure how to fix that. but try with a new char
Need some help understanding why my item properties are not sticking upon exit and reload. My code is adding an item to the players inventory and then breaks it. But when I reload, the item is no longer broken. Is there a specific step I am missing or is this change not allowed when creating new items on the fly?
local playerObj = getSpecificPlayer(player)
local playerInv = playerObj:getInventory()
local itemName = configInfo.InstalledItem
local removedItem = playerObj:getInventory():AddItem(itemName)
if configInfo.IsBrokenItem == true then
for i = 1,playerInv:getItems():size() do
local item = playerInv:getItems():get(i-1)
if item:getFullType() == itemName then
playerInv:getItems():get(i-1):setBroken(true)
break
end
end
end
I've tried several ways of editing the item, but all seem to discard the broken flag I set when reloading ๐ฆ
is is possible that you also need to set its condition to zero?
Thanks, that did the trick. So I'm better off setting the condition than the broken flag
Anyone know what file contains controls? Looking for "E" to use vehicles. I found the function for OnUse in Vehicles but it's not called anywhere ๐ค
nvm figured it out - it's called in java
hm
function VehicleUtils.OnUseVehicle(character, vehicle, pressedNotTapped)
pressedNotTapped = false;
if character:getVehicle() == vehicle then
if pressedNotTapped then
if vehicle:isDriver(character) and vehicle:isEngineWorking() then
if vehicle:isEngineRunning() then
ISVehicleMenu.onShutOff(character)
else
ISVehicleMenu.onStartEngine(character)
end
end
else
ISVehicleMenu.onExit(character)
end
else
local part = vehicle:getUseablePart(character)
if part then
VehicleUtils.callLua(part:getLuaFunction("use"), vehicle, part, character)
return
end
local seat = vehicle:getBestSeat(character)
if seat == -1 then return end
ISVehicleMenu.onEnter(character, vehicle, seat)
end
end
Why is pressedNotTapped set to false?
Holding down E to grab the keys/turn off the car would be a nice feature
hmm, with the door closed? would make sense it has to be open first
oh you mean inside the car
hold e to turn off the engine would be nice indeed
at the mo its just hitting N iirc?
I just tap W
turn engine off and get out in one
I didn't know that was a thing
I hate taking the key with me though
tempted to include this in my mod but it's out of scope

hm N turns the key if in and off, but pulls out if on
kind of wish it was just used for turning
Beginner modding question, is it possible to override certain game functions via Lua? (i.e. IsoPlayer::getUsername)
you cannot override a java object cause that object is not a lua table
what exactly are you trying to achieve?
Allow empty bottles to store gasoline```
๐
trying to make it so players show up with the name "Concealed" to other players when wearing a balaclava
not sure if there's any particular way to do this other than literally setting their name when they equip a balaclava
but that's annoying since you have to save their previous name, etc
You can abuse clientside code for that probably
did you try player:setUsername("");
might not hide it for other players tho
I'm specifically saying I don't want to change the username, just display it differently
Yeah well im trying to find a way to display it differently but its all java hardcoded
you could use ShowFirstAndLastName and change the forename for the username and set the surname to nothing
then you can just change that forename at will
also how do you want to display the name in chat if conceal
If you use setusername and make sure it's only on clientside (unless setusername knows to transmit data) this should work
also you could turn off usernames can't you?
yeah you could turn off usernames but that's not ideal since that changes it for all players
I'll have to test the clientside setUsername option though, might be useful
looks like it natievly sends data to the server
you could try to replicate the username system instead
and just turn off vanilla ones
how would I go about doing that?
not sure where the display is handled but you'd basically have to translate the java to lua
yeah i cant seem to find where that username is rendered
Ah so its in IsoGameCharacter
is this in IsoGameCharacter?
IsoGameCharacter, yes
protected void initTextObjects() {
this.hasInitTextObjects = true;
if (this instanceof IsoPlayer) {
this.chatElement.setMaxChatLines(5);
if (IsoPlayer.getInstance() != null) {
System.out.println("FirstNAME:" + IsoPlayer.getInstance().username);
}
this.isoPlayer = (IsoPlayer)this;
if (this.isoPlayer.username != null) {
this.userName = new TextDrawObject();
this.userName.setAllowAnyImage(true);
this.userName.setDefaultFont(UIFont.Small);
this.userName.setDefaultColors(255, 255, 255, 255);
this.updateUserName();
}
if (this.haloNote == null) {
this.haloNote = new TextDrawObject();
this.haloNote.setDefaultFont(UIFont.Small);
this.haloNote.setDefaultColors(0, 255, 0);
this.haloNote.setDrawBackground(true);
this.haloNote.setAllowImages(true);
this.haloNote.setAllowAnyImage(true);
this.haloNote.setOutlineColors(0.0F, 0.0F, 0.0F, 0.33F);
}
}
}
it's just creating a new textdraw object
the updating changes it to say what it needs to
line 5599
ah there too
I think renderlast handles the fact the names disappear sometimes
for example mouse over
yeah it also render last so it appear over everything else
well yeah the only possible way would be to turn off default name rendering
and make a UI element to show name over people head but might not be as efficient tho
plus you need to calculate the world coordinate to screen position and check if the player is actually visible in line of sigh and also if the cursor is over him or near
you'd have control over it but it would be a wild amount of work
would be easier to request a feature on the forum and cross your fingers lol
or if you dont need the characters firstname/lastname then you use ShowFirstAndLastName=true and override those forname and surname to what ever you need.
show firstlastname overrides username display?
hm
lol
Because im working mostly to make a rp server i mostly only use character name everywhere
but still use username for identifying in the background cause those first/last name are not uniques
if you use Buffy's roleplay chat https://steamcommunity.com/sharedfiles/filedetails/?id=2688851521 you can also have the character names show in chat.
--- Using server setting -> ShowFirstAndLastName=true
function ConcealName(player)
player:getDescriptor():setForename("[Concealed]");
player:getDescriptor():setSurname("");
end
function UnconcealName(player)
player:getDescriptor():setForename(player:getUsername());
player:getDescriptor():setSurname("");
end
pretty hackish
Clever solution though.
This is for balaclavas and masks?
yeah
could even show no name at all if the face is covered
player:getDescriptor():setForename("");
player:getDescriptor():setSurname("");
that could actually be a sandbox setting for admin to decide what ever he desire
With not displaying a name, I get concerned about players becoming invisible when in vehicles/behind fences? But that's also with the context that I like low-rules PVP MP, so not a universal concern.
anyone use better lockpicking mod before? I assume the v menu has the option to lockpick cars?
yeah I think some name should still be displayed ideally
just not their actual name
question marks/concealed/unknown/etc
or at least that was my idea originally
Question marks was how I was planning on doing it when we were talking about the same thing for my server a whiles back ๐
a version where you would want to use the character names
--- Using server setting -> ShowFirstAndLastName=true
function ConcealName(player)
local modData = player:getModData();
if not modData.isNameConcealed then
local descriptor = player:getDescriptor();
modData.originalNames = {
first = descriptor:getForename(),
last = descriptor:getSurname();
};
descriptor:setForename("[Concealed]");
descriptor:setSurname("");
modData.isNameConcealed = true;
end
end
function UnconcealName(player)
local modData = player:getModData();
if modData.isNameConcealed then
local descriptor = player:getDescriptor();
descriptor:setForename(modData.originalNames.first);
descriptor:setSurname(modData.originalNames.last);
modData.isNameConcealed = false;
end
end
Wonderful then
This is silly, but it could be fun, where there was an option to disply the name of the mask when a player has their identity obfuscated by one? ie [Clown Mask]
Ah, why not
yeah thats neat
kind of explain why you dont see the name some people could think wtf is going on (is it a bug i dont see its name)
now we just need the whole collection of hotline miami masks
Hmmmm... showRadialMenu clears() itself... my mod and another mod overwriting safely are actually clearing in between calls...
Or to get even deeper in server-bespoke stuff, faction masks that change the name to something faction-y when wearing the mask, like Raider, or even Raider Officer for specific faction ranks.
man that new EmptyPetrol tag feature is a life saver, ill have to update FuelAPI now
less hacking
Tags = EmptyPetrol,
ReplaceTypes = PetrolSource PetrolPopBottle;WaterSource WaterPopBottle,
so clean hehe pretty much what fuel api was doing so i can now go full vanilla instead!!
๐
tags are under utilized
Yeah. hopefully ReplaceTypes will make mod liquid stuff more easy all round?
Liquids should eventually become their own object imo
is there anything else we can do with ReplaceTypes ?
or for now only PetrolSource and WaterSource are valid keywords
I think with the vanilla functions you can send, just off the top of my head here, item:getReplaceType(STRING) and it will return whatever item you have defined in the replaceTypes field that matches the string?
I didn't make that particular code/parameter; but I think if I have BleachSource SOMETHINGBOTTLE in that parameter + have custom context code that checks for BleachSource it should work?
So it should be open season on keywords? Just gotta build the code that uses the new keyword.
public void setReplaceOnUseOn(String var1) {
this.ReplaceOnUseOn = var1;
}
public String getReplaceOnUseOn() {
return this.ReplaceOnUseOn;
}
public String getReplaceOnUseOnString() {
String var1 = this.getReplaceOnUseOn();
if (var1.split("-")[0].trim().contains("WaterSource")) {
var1 = var1.split("-")[1];
if (!var1.contains(".")) {
String var10000 = this.getModule();
var1 = var10000 + "." + var1;
}
}
return var1;
}
public String getReplaceTypes() {
return this.getScriptItem().getReplaceTypes();
}
public HashMap getReplaceTypesMap() {
return this.getScriptItem().getReplaceTypesMap();
}
public String getReplaceType(String var1) {
return this.getScriptItem().getReplaceType(var1);
}
public boolean hasReplaceType(String var1) {
return this.getScriptItem().hasReplaceType(var1);
}
wondering how we handle the replacement tho
seems like the bottle of gas has the tag Tags = Petrol,
but that tag pretty much used to detect if its a petrol container with petrol inside
Tags aren't essential for ReplaceType, but in this instance the code uses the tag to detect a petrol container?
I don't believe ReplaceTypes are hardcoded in any sense.
local newType = emptyCan:getReplaceType("PetrolSource") or "Base.PetrolCan"
self.petrolCan = chr:getInventory():AddItem(newType)
thats how it work neat!
so yeah like you said using getReplaceType we can do alot now
Going to be pushing this out real soon, but any opinions on the new and improved poster?
Yeah, the way it worked out is that for Petrol, and in theory mod stuff, you would use a Tag to find/detect a container, and then use the ReplaceType to determine what container that substance would go into?
One could also just use getReplaceType to evaluate items, but Tags have better function support in general.
Cant wait to test this out man!
I commented like 8 files in FuelAPI cause i dont need to hook into anything from now on!
If I did the math right, 100% protection will afford a 90% damage reduction at the cost of the clothes
but that will probably still be death over 60mph
I will sure throw myself out all the time just for the sake of it.
Just coz i can
Working on lowering the penalty for exiting normally too
going to try and allow people to exit while moving safely
Could add a sandbox settings dropdown with like 4 options. To choose how much damage its multiplied by (none, low, medium, high)
it already ties in injury severity
I meant to look into allow fractures sandbox
it's not named the same thing in sandboxvars
ty for reminding me
Can't actually find bone fractures within sandboxVars
hm
Takes some getting used to
is there someone driving?
I think getReplaceType could have broader applicability than just liquids; in theory one could use it to determine what kind of shell casing a certain ammunition type will cause a gun to eject for a gun mod?
Although ReplaceOnUse could work for that as well ๐
Maybe for "clothing lego" where you combine clothing items?
Anyways, it definitely has broad potential applicability.
Yeah for sure, also maybe something like AlcoholSource, JuiceSource, and stuff for the liquids mainly
Real quick i dont get much idea what to do with it but it may come with time
For now im very happy that fuel item has been overhauled
Was on co-op -- I don't think I can get the car to operate on idle
Well, really it's just a table of keys and values, so I'm sure imaginative people could think of things with it I never imagined.
Can you jump out while on cruise ?
yes, it was on cruise at 5mph
no way haha
looks like you were late for the bus
Gosling go back to the place beyond the pines
i would like to see if i can make some more animations to match gear shifting/driving wheel turning
not too sure about shooting animations, i dont like switching between states very much
smoking a cig anim
smoking, flipping the bird, and being bored is doable
sleeping
yep
neat bro neat
yeah, the code is chuck but the anims are mine and the vehicle is cytts
the real work is gonna be twisting back passengers for trucks
no idea how i am gonna make that work atm
thats be dope to add a couple stuff like that, maybe a confirm box to accept the handshake
id do it similiarly how halo CE did it
they grabbed the two actors and lined the anims
There absolutely needs to be a high 5 emote that provokes a quick time action in the subject that allows them to reciprocate; leave them hanging; or fake them out.
ill be screwing with tag teaming some day when i feel like it
id like to grab two players and make them square dance
Imagine holding someone on your shoulder
carrying
but thats an whole different story
something that i know for sure thats doable is players carrying each other
lot of work though
oh really
yeah
i wouldnt be able to do the sync work but yes its doable
i dont even wanna think about what carrying another player in MP would be like
right
well if we can move someone else (to our local client only) then we can just kind of tell player move that one on top of the other one
without having to worry about sync
id wager this is something that will come to vanilla eventually
so we just say to all clients hey this dude is carrying this dude, so move his character on top of where ever the other is
But the vanilla character sync might mess that up
yeah, again i dont even wanna venture down into that as id rather stay in my lane since its such a headache
yeah and not that usefull (for now)
Maybe something like Blair did with the carry corpse lol generic model for player would look bad tho
it would look awful
i applaud the effort but unless you can get a corpse to stay in form i find it a waste
its like carrying a mannequin
i recently revived body bags
i pushed them recently too
its old stuff from a mod chuck and myself abandoned
yo thats dope
did you need bodybag in inventory to bag them
kind of stuff youd find in a morgue
So i supose bagging them also removed the sickness buff from being next to them
yep
the bags are still a WIP
just a way to bag them or dead player zombies for later
saves the flavor
thats not something i would use in a zombie server but in a RP server that would give some depth to the paramedic
they also prevent the sickness you get from exposed dead bodies
carpentry is called woodwork in code right?
the game automatically places street_overlays on the vanilla asphalt tiles and light gravel. if i place floor overlays above those, the cracks are generated, too. when i replace the asphalt with my own, those overlays aren't generated anymore and i can't find the lua, which does that
any ideas?
somewhere is a link to those cracks and erosion overlays, which depend on vanilla streets
Letsss roll! Literaly
someone should make a gas huffing mod just a suggestion
could add some use to gasoline if u don't have a car
Drives into a massive horde, tuck and rolls
or roleplay as a junkie i guess
roleplay as a roleplayer in pz rp
is there a way to run a snippet of code for a car, and only that car, AND only when it spawns (one time only)?
A vehicle is a child of IsoObject so technically it got a ModData. You can use that ModData to save a variable that will persist for that vehicle.
hmm
For getting the car when its loaded in one client Im not sure yet, i dont know if its like other IsoObject.
Hey how about a mod where you live in attics and travel from roof to roof using a ladder yeah good idea oh no technically impossibru oh ok :<
bruh what
you got any ideas yet fam?
Aaaand I sounded demanding there. My apologies
bruh
after looking at BaseVehicle on the javadocs, I found this.
public boolean addedToWorld Does that help at all?
don't get how that would be imposible can't you do that in the base game
just without ladders
is it possible to look at other mods code? i'm trying to learn some basics and want to see how other mods work
hi i want to delete this
id = "LongGunOnBack",
chance = 30,
outfit = {"SharkBlackSWAT","SharkBlackSWATRiot","SharkBlackSWATBelt,","SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
weaponLocation = {"Rifle On Back"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
weapons = {
"Base.AssaultRifle",
"Base.AssaultRifle2",
"Base.Shotgun",
},
}```
the weapons table
can i just do this?
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,2);
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1);```
it seems tow rok
steamapps\workshop\content\108600\
This should work
AttachedWeaponDefinitions.LongGunOnBack = {}
But if other code references it it may throw errors.
I am attempting to add clothing that makes a character model invisible. I've been experimenting, but can someone please lead me in the right direction?
[ProjectZomboid] But Minecraft tiles
thank you!
will better
AttachedWeaponDefinitions.LongGunOnBack = {}
Masks make parts of the model invisible. #modeling message
what is the best way to search on the project zomboid modding API (https://projectzomboid.com/modding/). I specifically am looking for a method that can check if a body is a human body instead of a zombie body.
How does the code go about changing day when midnight hits? Im using another function in EveryDays event and the days dont progress anymore, I've tried doing zombie.GameTime:setDay((zombie.GameTime:getDay() + 1)); which I know is wrong but not sure how to do it right
adding on to this, I found IsoDeadBody in the API which conveniently has a bool wasCorpseAlready (which im thinking is for bodies that spawned in when the chunk generated) in the constructor but no field that correlates to it?? if I could get this value then it would be fantastic but it doesnt even inherit a field like that
Javadoc Project Zomboid Modding API package index
I'm not sure about that but u can reanimate the corpse so maybe wasCorpseAlready returns true after this action
funnily enough using what i did actually worked too lol
i want to specifically remove the weapons part
not delete the whole table


