#mod_development
1 messages · Page 5 of 1
ModID should always be as simple as possible such as no space no special character
oh wait I think I messed up the translation pointer
ModName = My sup3r mod-is fr#aking cool 123
ModID = MySuperModIsFreakingCool123
yeah it was the pointer, I can translate with a -
Yeah I usually dont use spaces and only letters
cnd was started with a github thing so it got saddled with the -
if you really need to change the ModID i suggest just adding a new mod to the package with the new mod ID, and add a check in the old mod that if the new mod id is active to return;
eventually gradually people will switch and you remove it
Good advice
Anyone here knows the creator of the site "map.projectzomboid"???
i do wonder if someone needs a voice actor for mods
Fatigue, when high is what causes the character to get tired, right?
try reload the page and look near the, it tends to show up at the bottom of the page, giving you contact info as well as a github
Fatigue, when high is what causes the character to get tired, right?
IT might seem dumb of me to ask, but we also got an endurance meter... So i'm kind of confused...
endurance is short-term "i need to rest a bit" exhaustion type tired, fatigue is "i need to sleep" type tired
if you go mow the lawn you probably wanna sit for a bit and relax, but you don't need to necessarily sleep 8 hours
Looking for Modders/Scripters, if you got experience DM me.
Looking for Devs of PZ: I'd like to say Hello 😛
I'm so freaking sad... the Keytar, Bass and electric guitar does not make musical notes when it hits zombies... sooo dissapointed!
Here i was hoping to relive some Dead Rising silliness, even a bit, via some fun "weapons" and all i get is a bonk...
I feel sooo let down!
I'm half-way tempted to downvote the game cause of this...
query
i'm working on a spawnpoint mod
but the coords used for spawnpoints and the coords used in game don't seem to quite... line up
{worldX = , worldY = , posX = , posY = }
if i wanted to fill this out to point to 10617,6640,0 in game how would i do that?
to get worldX and worldY you need to divide by 300
10617 / 300 = 35~~.39~~
6640 / 300 = 22~~.133333333333333333333333333333~~
0
35 * 300 = 10,500 so 10617 - 10,500 = posX
xD weird eh?
😄
and if i just put the 10617 and 6640 into posx and posy, that'll work?
nope
worldX = floor(playerX / 300)
posX = playerX - (worldX * 300)
the posx would be 117 then, yeah?
yeah
Spawnpoint Calculation
worldX = floor(playerX / 300)
posX = playerX - (worldX * 300)
worldY = floor(playerY / 300)
posY = playerY - (worldY * 300)
np
welp. I gave up on overriding the cars, and have settled for using the skinIndex. But I have one, HUGE problem.... the textureLights field in the script file. Any idea how to change this in lua?
Hello!
Minor question because I'm not finding it 😂
I found IsRunning, IsSprinting and IsSneaking functions, is there something like IsWalking? Coudln't find it but maybe it has another name? 🤔
@sour island We are looking into it on my server, but was gonna post this https://cdn.discordapp.com/attachments/998315620439445596/1002002490562199623/unknown.png
not sure if it has to do with your updates made today
most likely not
if not running and not sprinting and player:isMoving() then
-- is walking
end
Do you happen to know if Base.Stone is a proper item?
or is the wiki out of date for item list IDs
If you have debug mode enabled, you can right click an item and check its ID
so just spawn what ever you need and check the id
pas de probleme
Updates to?
Chucked and Heli events, however pretty sure it isn't your end, if you go to a dead survivor and right click on them with a grab it shows all of their limbs as the Base.[Limbname].Bitten object
That's cause it's showing you their injuries
Weird that it's in their inventory - the base makes me think it's an item
Can you use edit on it?
yeah that's what it displays as
I will have to investigate here, my other peeps are looking into it, it isn't game breaking by any means just odd
Maybe it's related to mapobjects? I don't think injuries are normally items
I don't think I've ever seen injuries as items tbh
might be a mod messing with it
I don't have limb mods, but we have about 40 or so mods
Ah shoot, where is the lua for listing all ItemTypes?
recipe Craft Chipped Stone With Hammer
{
Stone,
keep [Recipe.GetItemTypes.Hammer],
Result:SharpedStone=3,
Time:40,
Category:Survivalist,
AnimNode:Hammering,
Sound:Hammering,
Prop1:Hammer,
}
Reason I ask is because this was fine til I added the ItemTypes and anim/sound/prop
I'm going to go back through and see which one is the problem
Well... too late to think lol was that easy
Thanks
I am gonna take a stab and say its getting hammer as a type, but I know there are a few types of hammers so I wonder if the var is under the wrong name
huh weird
Well it's fixed
I found some anim lua files but they list about 10 overall, is the full list contained in a .class only or is there a Lua that points to it?
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\AnimSets\player\actions
that might be helpfull
So weird trying to teleport a player within a timed action perform method doesnt seem to work
oof
Would be good to find out for minigames and such
Thanks for this. It took me a couple hours to figure out what I was doing wrong but I finally got it working and I think I did it right
Also, is there a lua showing items and what they need to be crafted with
wdym?
Say for example I want to check if an item already has a recipe for it
versus exploring the crafting menus or having to learn certain skills, instead find the craftable file
I'll have to make a script to make a txt I can reference in the future
np 
I think someone else had this issue - moving in timed action cancels it but you can set the timed action to allow movement
nah it doesnt cancel the timed action, it actually run all the way after the teleportation
somehow my position get reset so it look like i never teleported
Well all i had to do is to delay the call of the function, the perfom function does something weird that prevent teleportation.
--- Delay a function call
---@param func function
---@param delay number
local function delayedFunction(func, delay)
delay = delay or 1;
local ticks = 0;
local function onTick()
if ticks < delay then
ticks = ticks + 1;
return;
end
Events.OnTick.Remove(onTick);
func();
end
Events.OnTick.Add(onTick);
end
Here a function similar to setTimeout() in javascript. But instead of using millisecond it uses ticks.
delayedFunction(function()
print("28 ticks later");
end, 28);
could improve it with a way to cancel it (if not executed yet)
coroutine?
--- Delay a function call
---@param func function
---@param delay number
---@return function cancel function
local function delayedFunction(func, delay)
delay = delay or 1;
local ticks = 0;
local canceled = false;
local function onTick()
if not canceled and ticks < delay then
ticks = ticks + 1;
return;
end
Events.OnTick.Remove(onTick);
if not canceled then func(); end
end
Events.OnTick.Add(onTick);
return function()
canceled = true;
end
end
local cancelFunc = delayedFunction(function()
print("Will this run?");
end, 10)
cancelFunc(); -- cancel it so it doesnt run
I'm a big dummy when it comes to modding how do I change audio files
ok, so. How does one call a field in a class? As in something like BaseVehicle.addedToWorld??? I'm having trouble with this
hi
Hey guys, was wondering which files, inside a save, store the data of the discovered places inside the map(the map that shows once you click "M") by a player
are these files inside my test world folder the ones that store the maps data or the worlds data?
soo i can include mroe than 1 module right?
these files are stored inside C:\Users\ [USER]\Zomboid\Saves\Multiplayer\ [world folder], if anyone wondering
Any reason why when I use
AnimNode:BandageLeftArm,
it makes my character raise his hands as if to surrender?
When an animation is invalid, it default to raise hands animation.
Weird
I pulled the anim from the anim files
Same with sounds, seems the sounds are not playing for my works
(Also some items are not allowing a creation despite showing I have all the ingredients
I am going to post the code here
module RecipeModBatteryJournals {
imports {
Base
}
recipe Fabricate Small Battery
{
Aluminum/SmallSheetMetal,
ElectronicsScrap=4,
keep [Recipe.GetItemTypes.Screwdriver],
Result:Battery=4,
Time:60,
Category:Electrical,
AnimNode:Disassemble,
Prop1:Screwdriver,
OnGiveXP:batteryJournal_Recipe.OnGiveXP.MakeBattery,
}
recipe Bind Paper Journal
{
SheetPaper2=15,
Twine/Thread/Glue/Woodglue/Paperclip,
Result:Journal,
Time:80,
Category:Literature,
AnimNode:BuildLow,
Sound:ClothesRipping,
}
recipe Craft Chipped Stone With Hammer
{
Stone,
keep [Recipe.GetItemTypes.Hammer],
Result:SharpedStone=3,
Time:80,
Category:Survivalist,
AnimNode:Disassemble,
Sound:Hammering,
Prop1:Hammer,
Prop2:Stone,
}
recipe Craft Chipped Stone With Stone
{
Stone=2,
Result:SharpedStone,
Time:200,
Category:Survivalist,
AnimNode:Disassemble,
Sound:BreakWoodItem,
Prop1:Stone,
Prop2:Stone,
}
recipe Craft Twine From Ripped Sheets
{
RippedSheets=5,
TinCanEmpty/TreeBranch,
Result:Twine,
Time:200,
Category:Survivalist,
AnimNode:BandageLeftArm,
Sound:ClothesRipping,
Prop1:RippedSheets,
}
recipe Craft Paper Bag
{
SheetPaper2=20,
Twine/Thread/Glue/Woodglue/Paperclip,
Keep Scissors,
Result:PaperBag,
Time:100,
Category:General,
AnimNode:Craft,
Sound:ClothesRipping,
Prop1:SheetPaper2,
}
recipe Craft Gravel Bag
{
Stone=5,
EmptySandBag,
keep [Recipe.GetItemTypes.Hammer],
Result:Gravelbag,
Time:150,
Category:Construction,
AnimNode:BuildLow,
Sound:Hammer,
Prop1:hammer,
Prop2:Stone,
}
recipe Craft Sand Bag
{
Gravelbag,
keep [Recipe.GetItemTypes.Hammer],
Result:Sandbag,
Time:200,
Category:Construction,
AnimNode:BuildLow,
Sound:Hammer,
Prop1:hammer,
Prop2:Gravelbag,
}
recipe Craft Concrete Powder
{
PaperBag/Paperbag_Jays/Paperbag_Spiffos,
Sandbag,
Gravelbag,
keep HandShovel,
Result:ConcretePowder=4,
Time:150,
OnTest:batteryJournal_Recipe.OnTest.FilledGravelBag,
OnTest:batteryJournal_Recipe.OnTest.FilledSandBag,
OnCreate:batteryJournal_Recipe.OnCreate.ConcretePowder,
Category:Construction,
AnimNode:DigTrowel,
Sound:shoveling,
Prop1:HandShovel,
Prop2:PaperBag,
}
recipe Craft Plaster Powder
{
Sandbag,
RippedSheets=5,
Result:PlasterPowder=4,
Time:150,
OnTest:batteryJournal_Recipe.OnTest.FilledSandBag,
OnCreate:batteryJournal_Recipe.OnCreate.PlasterPowder,
Category:Construction,
AnimNode:DigTrowel,
Sound:shoveling,
Prop1:HandShovel,
Prop2:PaperBag,
}
}
I know it's a lot, but I think there are a lot of similar issues going on
primarily
animations
sound
and props
recipe animation node cannot really use special animation such as BandageLeftArm cause the way animation work using condition.
so like the animation for bandage is Bandage but then BandageLeftArm works if you set setAnimVariable BandageType to LeftArm
So probably AnimNode:Bandage would work, but wouldnt know what body part to play it for
Shame you can't specify it
As for the sounds?
function ISCraftAction:start()
if self.recipe:getSound() then
self.craftSound = self.character:playSound(self.recipe:getSound());
end
self.item:setJobType(self.recipe:getName());
self.item:setJobDelta(0.0);
if self.recipe:getProp1() or self.recipe:getProp2() then
self:setOverrideHandModels(self:getPropItemOrModel(self.recipe:getProp1()), self:getPropItemOrModel(self.recipe:getProp2()))
end
if self.recipe:getAnimNode() then
self:setActionAnim(self.recipe:getAnimNode());
else
self:setActionAnim(CharacterActionAnims.Craft);
end
-- self.character:reportEvent("EventCrafting");
end
self:setActionAnim(self.recipe:getAnimNode());
it set the action anim but not the variable
Is it possible to add a "custom" animation that is a replica of bandageleftarm?
wouldnt that be a more complex way of just setting the variable within the recipe
I think that would be the way if they really wants to use it
I think the point that you cannot do that on the recipe right now
Recipes dont know how to deal with that, right?
Recipe anim node is basic for now yeah
hm
would need a new field that specify an anim variable
alrighty I added those directories
try something like
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>RecipeBandageLeftArm</m_Name>
<m_AnimName>Bob_BandageLeftArm</m_AnimName>
<m_Looped>false</m_Looped>
<m_SyncTrackingEnabled>true</m_SyncTrackingEnabled>
<m_EarlyBlendOut>false</m_EarlyBlendOut>
<m_SpeedScale>0.80</m_SpeedScale>
<m_BlendTime>0.20</m_BlendTime>
<m_Scalar></m_Scalar>
<m_Scalar2></m_Scalar2>
<m_Conditions>
<m_Name>PerformingAction</m_Name>
<m_Type>STRING</m_Type>
<m_StringValue>RecipeBandageLeftArm</m_StringValue>
</m_Conditions>
</animNode>
then use RecipeBandageLeftArm in your recipe anim node
might be worth trying
in the end that wont really be more heavy file wise since it still use the vanilla anim
indeed
Should I use the name or the anim_name
<m_Name>RecipeBandageLeftArm</m_Name>
<m_AnimName>Bob_BandageLeftArm</m_AnimName>
try to make the name and filename unique so that it dont overwrite the vanilla stuff
m_AnimName is the actual animation file to use
So for the sake of the node
just try using the same name for
m_Name
and
m_Conditions > m_StringValue
in this case RecipeBandageLeftArm
Alrighty
so if you look at the animation xml files they have parent and child
Bandage.xml doesnt have an animation itself, but all the other extend it and specify an actual animation
this way they dont copy/repeat bunch of property and can have different/additional m_Conditions
mhm that would be bad
I am testing the anim now, the next issue once this is figured out would be sounds
Ah shoot, the anim didn't work there
hang tight
might need to fix something here
hey it worked
sweet
I guess we can attack the same zone here
recipe Craft Twine From Ripped Sheets
{
RippedSheets=5,
TinCanEmpty/TreeBranch,
Result:Twine,
Time:200,
Category:Survivalist,
AnimNode:RecipeBandageLeftArm,
Sound:ClothesRipping,
Prop1:RippedSheets,
}
Are sounds also filled with similar issues with a category needing specified noise?
Didnt you name it Bob_RecipeBandageLeftArm?
I guess it's supposed to be the anim name not the primary name?
It works as the anim name, I haven't tried the primary name
According to this
Really the only thing that matter is that the anim names doesnt overwrite existing anims xml file.
What make the animation work is the condition.
<m_Conditions>
<m_Name>PerformingAction</m_Name> <----- PerformingAction
<m_Type>STRING</m_Type>
<m_StringValue>Bandage</m_StringValue> <----- Bandage
</m_Conditions>
hm
the AnimNode of a recipe is assigned into the TimedAction ISCraftAction
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\TimedActions\ISCraftAction.lua
self:setActionAnim(self.recipe:getAnimNode());
yeah using the base name Bob_RecipeBandageLeftArm breaks it
gotta use the anim_node name
this sound is confirmed to be a usable sound
not sure why it isn't playing for certain items then hr
you should be able to use any sound in C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\sounds_item.txt
you could also add your own sound the same way as vanilla does it
no i c e
with your sound inside:
media\sound\mysound.ogg
and defined in a script text file:
media\scripts\mymodid_sounds_item.txt
like this:
module Base {
sound MySound
{
category = MySound, loop = false, is3D = true,
clip { file = media/sound/mysound.ogg, distanceMax = 50, volume = 1, }
}
}
what kind of format is .ogg
its light
ah I see
i use audacity to convert
ay nice I use audacity
I guess the final issue I am having atm is some items are not allowing for use despite having all the ingredients
for example
recipe Craft Paper Bag
{
SheetPaper2=20,
Twine/Thread/Glue/Woodglue/Paperclip,
Keep Scissors,
Result:PaperBag,
Time:100,
Category:General,
AnimNode:Craft,
Sound:ClothesRipping,
Prop1:SheetPaper2,
}
I might see the issue
Keep not keep
yep that was the issue
seems I am squared away then
I shall continue onward
Good luck on your endeavors
My audio workflow:
Audacity
export to mp3
loudness normalization
http://mp3gain.sourceforge.net/download.php
convert to .ogg
https://sector-seven.com/software/flicflac
Anyone know what ToHitModifier does for guns?
oh lordy bugs galore
Basically all sounds being used are ignored
except for two items
Where do I find all the items that are specifically 3D in game
ProjectZomboid\media\models_X ?
ah weird
the ID for the item and the fbx name are not equal
when I use Prop: for an item I presume then I need to use it's fbx name and not item ID
no that isn't right either
I use Gravelbag as the item ID but the fbx is GravelBag and that still functions... hm
check out ProjectZomboid\media\scripts\models_items.txt
there is a script file that defines models and gets the mesh and textures for them. you need to use the names in that script file, not the fbx or x file
it's where you specified which mesh to use
ah nice
I will investigate that
as for the other issues while I attend to that file
here they are
Battery Recipe
- No sound
Journal Recipe
- No sound
Stone w/ Hammer Recipe
- No sound
Stone w/ Stone Recipe
- No sound
Twine with Ripped Sheets
- No sound
- Animation too fast [SOLVED]
Make Paper Bag
- No sound
Make Gravel Sack
- No sound
- Cannot craft when all ingredients present
Make Sand Sack
- No sound
Make concrete powder
- No sound
- No props
Make plaster powder
- No sound
- No props
I think the gravelbag probably worked for you because they just happen to share a name in the mesh file name and the actual model name
module RecipeModBatteryJournals {
imports {
Base
}
recipe Fabricate Small Battery
{
Aluminum/SmallSheetMetal,
ElectronicsScrap=4,
keep [Recipe.GetItemTypes.Screwdriver],
Result:Battery=4,
Sound:Dismantle,
Time:60,
Category:Electrical,
AnimNode:Disassemble,
OnGiveXP:batteryJournal_Recipe.OnGiveXP.MakeBattery,
Prop1:Screwdriver,
}
recipe Bind Paper Journal
{
SheetPaper2=15,
Twine/Thread/Glue/Woodglue/Paperclip,
Result:Journal,
Sound:ClothesRipping,
Time:80,
Category:Literature,
AnimNode:Craft,
}
recipe Craft Chipped Stone With Hammer
{
Stone,
keep [Recipe.GetItemTypes.Hammer],
Result:SharpedStone=3,
Sound:Hammering,
Time:80,
Category:Survivalist,
AnimNode:Disassemble,
Prop1:Hammer,
Prop2:Stone,
}
recipe Craft Chipped Stone With Stone
{
Stone=2,
Result:SharpedStone,
Sound:BreakWoodItem,
Time:200,
Category:Survivalist,
AnimNode:Craft,
Prop1:Stone,
Prop2:Stone,
}
recipe Craft Twine From Ripped Sheets
{
RippedSheets=5,
TinCanEmpty/TreeBranch,
Result:Twine,
Sound:ClothesRipping,
Time:200,
Category:Survivalist,
AnimNode:RecipeBandageLeftArm,
Prop1:RippedSheets,
}
recipe Craft Paper Bag
{
SheetPaper2=20,
Twine/Thread/Glue/Woodglue/Paperclip,
keep Scissors,
Result:PaperBag,
Sound:ClothesRipping,
Time:100,
Category:General,
AnimNode:Craft,
}
recipe Craft Gravel Bag
{
Stone=5,
EmptySandbag,
keep [Recipe.GetItemTypes.Hammer],
Result:Gravelbag,
Sound:Hammering,
Time:150,
Category:Construction,
AnimNode:BuildLow,
Prop1:Hammer,
Prop2:Sandbag,
}
recipe Craft Sand Bag
{
Gravelbag,
keep [Recipe.GetItemTypes.Hammer],
Result:Sandbag,
Sound:Hammering,
Time:200,
Category:Construction,
AnimNode:BuildLow,
Prop1:Hammer,
Prop2:Gravelbag,
}
recipe Craft Concrete Powder
{
PaperBag/Paperbag_Jays/Paperbag_Spiffos,
Sandbag,
Gravelbag,
keep HandShovel,
Result:ConcretePowder=1,
Sound:Shoveling,
Time:150,
Category:Construction,
AnimNode:RecipeDigTrowel,
OnTest:batteryJournal_Recipe.OnTest.FilledGravelBag,
OnTest:batteryJournal_Recipe.OnTest.FilledSandBag,
OnCreate:batteryJournal_Recipe.OnCreate.ConcretePowder,
Prop1:HandShovel,
Prop2:PaperBag,
}
recipe Craft Plaster Powder
{
Sandbag,
RippedSheets=3,
Result:PlasterPowder=1,
Time:150,
OnTest:batteryJournal_Recipe.OnTest.FilledSandBag,
OnCreate:batteryJournal_Recipe.OnCreate.PlasterPowder,
Category:Construction,
AnimNode:RecipeDigTrowel,
Sound:shoveling,
Prop1:HandShovel,
Prop2:PaperBag,
}
}
noted
thank ya
Keep doing reverse engineering until you understand how things work
perhaps download a mod with a single item and learn from that. Learning directly from vanilla might be too overwhelming.
yeah I've been doing a bit of both as I go
huh how odd, when you try to pull a sandbag for debug it doesn't produce an item
but when you do it for gravel it works fine
Looking for modders / Scripters to start a server with.
HALLO. Does Math work in Scripts for parameters in script files? Like weapons
i dont think so but you could use a lua file to edit the parameter
Yeah want to mass tweak weapon values so I think I'll go with that option
Thank you Spongie. Im huge fan
Got sounds, models, and actions working
However, for two items with an OnCreate function, they get this error I presume something to do with the sandbag or gravelbag not totally filled
what error? i dont see any in your ss
In the case it could be of help as reference, if needed, I've submitted a lits indicating the cells used by most of the custom maps available in the workshop.
https://steamcommunity.com/app/108600/discussions/0/3459345750020820934/
Many times I've read people asking if a map they intend to use overlaps with another one that they want to use too. Here is some help to understand it. 2 Maps on the same line means that they overlap. They are in numerical order ( from the lowest to the highest). I hope it could help! Legend Cell Number --- Map Name --- Notes/Warnings
hiya! I'm trying to figure out what code tells zombies if a certain tile is made by a player and can tell the zombie to thump on it.
I've been looking through the API and I've been kinda brain dead.
IsoThumpable
IsoThumpable is a type of IsoObject that can be destroyed by zombies.
Zombie will not target IsoObject or other type other than IsoThumpable.
Thank you so much my friend, I don't know how I didn't figure that out. QUQ
are all player built structures isothump?
bugged me a couple versions ago that they'd just bump on anything player built
even if the player wasn't in sight
Yeah
If you create the object using IsoThumpable.new() it will be targetable. If you create it using IsoObject.new it wont
IsoObject do not have health and do not get hit from weapons.
interesting
I think also In an ini file there is a setting where you can tell zombies to thump or not thump when no one is around?
There are 2 textures for shoes. The soles, and the outer surface. Where is the outer surface defined?
Should say both tbh.
I mean there isnt really a reason to render the actual inside of the shoe
shoes are textures on the body mesh so i'm confused
I assume he want's the entire outside of the shoe but only sees half, and I'm assuming that's because it is mirrored
Cant even get the boot to appear at all, but then I am looking at some other mods an they seems to have a texture for the bottom of the shoe and another for the the outside. Does that seem right?
They should be single like these
Which is how UV layout is done for masking system to work
Are you sure you are using correct layout?
items can only have 1 texture
What is this used for then?
That depends on mod, I'd take vanilla textures as example if I were to mod clothes as every modder has different approach to stuff
Modder might have disabled masks to make this work and you could have to do it aswell
They also included a texture in this layout?
This could be for worlditems etc
Lots of possibilities
Thats sharks work right? I remember it we had talks with him when he was working on his boots
Thats WIP
Its a leftover texture thats not utilized within game yet
It is! Thank gawd, it briefly crossed my mind that it may have been the reminiscence of someone's work.
huh, never knew it was like that. I always thought that isoThumpable was anything that had physics that would block the player so including the walls of buildings and the such. Always thought that isoobject was just a generic class. You learn something new everyday.
something that doesnt exist anymore
May I resize the textures in your mod to use in an add-on mod for the sake of optimization in MP?
no, ive already done it
what you have your hands on is incredibly old
those textures no longer exist
theyll cycle out next update
Got yuh, anytime soon?
Very nice, can't wait to hop into the new threads.
I don't think there is an ready function for that in PZ, but it would be fairly easy to make. You would just need an event in EveryTick or EveryMinute which would take the players coods, and count up how far the player has moved.
you can easily achieve that using OnPlayerMove
this would not work with vehicle travel tho
local previousSquare; -- store the previous square
local function onPlayerMove(player)
local currentSquare = player:getSquare(); -- get the current square
if previousSquare ~= currentSquare then -- if the square changed it mean we moved
local modData = player:getModData(); -- grab the player moddata
modData.totalSquareTravelled = modData.totalSquareTravelled or 0; -- initialize the value if not already set
modData.totalSquareTravelled = modData.totalSquareTravelled + 1; -- increment it
previousSquare = currentSquare; -- switch the previousSquare to the new one
end
end
Events.OnPlayerMove.Add(onPlayerMove);
@thin hornet I recall you discussing required modIds before - specifically the difference dedicated makes for mod load order -- does this only apply to require in modInfo or also require "" in Lua files?
the require in mod.info only kind of enable the other mod automatically, I dont think it actually force any load order
especially dedicated where you manually add the mods in the config
requiring in lua is probably the best way to ensure a load order
Alrighty
not sure if that was the question but if not let me know
Writing a patch for a mod, and I'm just trying to ensure it doesn't trip over itself
Nah it was
Hey i'm getting this error when launching my server, but still i can't figure out whats wrong with the code.
-----------------------------------------
function: runDeferedBodyChecks -- file: PleaseDontFeedTheZombiesServer.lua line # 109
function: OnTick -- file: PleaseDontFeedTheZombiesServer.lua line # 267
LOG : General , 1659046415061> 19.627.016> -----------------------------------------
STACK TRACE
-----------------------------------------
function: runDeferedBodyChecks -- file: PleaseDontFeedTheZombiesServer.lua line # 109
function: OnTick -- file: PleaseDontFeedTheZombiesServer.lua line # 267
ERROR: General , 1659046415061> 19.627.017> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in runDeferedBodyChecks at KahluaUtil.fail line:82.
ERROR: General , 1659046415061> 19.627.017> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in runDeferedBodyChecks
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:88)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1650)
at zombie.gameStates.IngameState.update(IngameState.java:1359)
at zombie.network.GameServer.main(GameServer.java:921)
LOG : General , 1659046415062> 19.627.017> -----------------------------------------
STACK TRACE
-----------------------------------------``` Its just straight out spamming it
This is the code ⬇️
```lua
local function runDeferedBodyChecks()
local newChecks = {}
for _, bodyCheckData in pairs(deferedDeadBodyChecks) do
local foundNewBodies = false
if bodyCheckData.attemptsLeft % 100 == 0 then
local squares = bodyCheckData.squares
local bodies = bodyUtils.getDeadBodiesInSquares(squares)
if #bodies > 0 then
for k=1, #bodies do
local body = bodies[k]
if not bodyIds[body:getObjectID()] then
foundNewBodies = true
bodyIds[body:getObjectID()] = {
body = body,
minutesToHoard = ZombRand(MIN_MINUTES_BEFORE_HOARD(), MAX_MINUTES_BEFORE_HOARD)
}
print("Found a new body")
break
end
end
end
end```
idk why but it seems that you are trying to call nil
line 109
if not bodyIds[body:getObjectID()] then
try
if body and not bodyIds[body:getObjectID()] then
or try
if body.getObjectID and ....```
seems like body or the method would not exist when trying to call it
K i`m having issues cuz for some reason i cant find where server files are stored
oops my bad i wasn't looking at my actual hard drive XD
sorry
if body and not bodyIds[body:getObjectID()] then``` gave me the same error
if body.getObjectID and not bodyIds[body:getObjectID()] then
something is null and is getting called
so that mean it expect a method but that method when called is actually null and not a method
idk what or where exactly but based on the error log it seem to be at that line
preatty much solved everything
it stopped spamming errors
but it still gives some errors now and then
now its recalling line 378
well you should check why body doesnt always have getObjectID() available
check if you get body of the wrong type
how would i go about checking that?
sorry for the trouble XD i'm not much of an expert in these things
oh i found it
bodyUtils = {}
function bodyUtils.getSurroundingSquares(square, checkSize, depth)
local cell = square:getCell()
local centerX = square:getX()
local centerY = square:getY()
local centerZ = square:getZ()
local corner1 = {
x = centerX - checkSize,
y = centerY - checkSize,
z = math.max(0, centerZ - depth)
}
local corner2 = {
x = centerX + checkSize,
y = centerY + checkSize,
z = math.min(8, centerZ + depth)
}
local squares = {}
for x=corner1.x, corner2.x do
for y=corner1.y, corner2.y do
for z=corner1.z, corner2.z do
local currentSquare = cell:getGridSquare(x, y, z)
if currentSquare ~= nil then
squares[#squares+1] = currentSquare
end
end
end
end
return squares
end
function bodyUtils.getDeadBodiesInSquares(squares)
local bodies = {}
for i=1, #squares do
local bodyList = squares[i]:getDeadBodys()
if bodyList ~= nil and bodyList:size() > 0 then
for i=0, bodyList:size() -1 do
local body = bodyList:get(i)
if not body:isSkeleton() then
bodies[#bodies+1] = bodyList:get(i)
end
end
end
end
return bodies
end
This is the dead bodies utils used
Labeled as DeadBodyUtils.lua
you know you can do
table.insert(bodies, bodyList:get(i))```
to add to a table that act as an array
bruh i have no idea how to do that
have been trying and nothing
thing just gets dead with errors and crashes
whats the new error log?
bodyUtils = {}
function bodyUtils.getSurroundingSquares(square, checkSize, depth)
local cell = square:getCell()
local centerX = square:getX()
local centerY = square:getY()
local centerZ = square:getZ()
local corner1 = {
x = centerX - checkSize,
y = centerY - checkSize,
z = math.max(0, centerZ - depth)
}
local corner2 = {
x = centerX + checkSize,
y = centerY + checkSize,
z = math.min(8, centerZ + depth)
}
local squares = {}
for x=corner1.x, corner2.x do
for y=corner1.y, corner2.y do
for z=corner1.z, corner2.z do
local currentSquare = cell:getGridSquare(x, y, z)
if currentSquare ~= nil then
squares[#squares+1] = currentSquare
end
end
end
end
return squares
end
function bodyUtils.getDeadBodiesInSquares(squares)
local bodies = {}
table.insert(bodies, bodyList:get(i))
end
end
end
end
return bodies
end
``` This is my code XD
idk dude fr i think i just messed it all up
yeah you removed a lot of code in getDeadBodiesInSquares
bodyUtils = {}
function bodyUtils.getSurroundingSquares(square, checkSize, depth)
local cell = square:getCell()
local centerX = square:getX()
local centerY = square:getY()
local centerZ = square:getZ()
local corner1 = {
x = centerX - checkSize,
y = centerY - checkSize,
z = math.max(0, centerZ - depth)
}
local corner2 = {
x = centerX + checkSize,
y = centerY + checkSize,
z = math.min(8, centerZ + depth)
}
local squares = {}
for x=corner1.x, corner2.x do
for y=corner1.y, corner2.y do
for z=corner1.z, corner2.z do
local currentSquare = cell:getGridSquare(x, y, z)
if currentSquare ~= nil then
table.insert(squares, currentSquare);
end
end
end
end
return squares
end
function bodyUtils.getDeadBodiesInSquares(squares)
local bodies = {}
for i=1, #squares do
local bodyList = squares[i]:getDeadBodys()
if bodyList ~= nil and bodyList:size() > 0 then
for i=0, bodyList:size() -1 do
local body = bodyList:get(i)
if not body:isSkeleton() then
table.insert(bodies, body);
end
end
end
end
return bodies
end
here is what i meant
if you still get error try post the error log again lets pin down what is going on
How i can get all official tiles?
I want to make a site to help the community in one specific question
using TileZed you can extract all the vanilla tiles
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media```
file ending with `.tiles`
Does anyone know which lua file impacts fishing baits?? I wanna switch up baitfish to catch everything instead of just pike and junk. Would someone be willing to lend a hand???
lua\shared\Fishing\fishing_properties.lua
TY I'll try my hand at making it.
here`s the console, if you need i can provide the server log
basically something like
for i, fish in ipairs(Fishing.fishes) do
table.insert(fish.lure, "Worm");
end
should work to add Worm as possible bait to all possible fish
It's the baitfish they're purely Pike and Trash... wanting to make it a general bait
You can send me the link of tilezed?
for i, fish in ipairs(Fishing.fishes) do
local containBaitfish;
for i, lure in ipairs(fish.lure) do
if lure == "BaitFish" then
containBaitfish = true;
break;
end
end
if not containBaitfish then
table.insert(fish.lure, "BaitFish");
end
end
well not actually sure it matter if it was added twice but that code check if its already there and add it only if not
if this is not outdate that should be this
https://theindiestone.com/forums/index.php?/topic/35239-latest-tilezed-worlded-and-tilesets-april-7-2021/
Tiles Tileset images For Windows TileZed + WorldEd 32-bit TileZed + WorldEd 64-bit The 32-bit version of WorldEd seems unable to load all the tilesets due to high memory usage, displaying ??? for some tiles. Linux TileZed + WorldEd 64-bit This was built on Ubuntu 20. TileZed changes: BuildingEd: ...
I found the new version!
Tiles Tileset images These are the same tilesets released on February 16. For Windows TileZed + WorldEd 32-bit TileZed + WorldEd 64-bit The 32-bit version of WorldEd seems unable to load all the tilesets due to high memory usage, displaying ??? for some tiles. Linux TileZed + WorldEd 64-bit This ...
Literally just make a lua with just that snippet???
But thanks to help me ❤️
great ill update the wiki with this link
In the original post the creator update constantly!
yeah since Fishing is a global object that how easy it is to mod it
Create a file in your mod lua/shared/Fishing/addFishBaitToAll.lua
for i, fish in ipairs(Fishing.fishes) do
table.insert(fish.lure, "BaitFish");
end
https://theindiestone.com/forums/index.php?/topic/21951-the-one-stop-tilezed-mapping-shop/
The original post here
1Here you will find a (hopefully) comprehensive guide to map modding using TileZed, from scratch, to uploading to Steam Workshop. Step 1) Installation and setup Spoiler - Download the latest version of TileZed here https://theindiestone.com/forums/index.php?/topic/50425-latest-tilezed-worlded-and...
OK thanks majorly
Good evening.
Sup mate
Object tried to call nil in LoadGridsquare
PleaseDontFeedTheZombiesServer.lua line # 378
againt something trying to call a function but that function is nil
How i extract???
TileZed should have an option for tile viewer and or extractor
I remember using it but its been a while
TileZed accept 4 formats, in the folder has what format?
Try asking your question into #mapping theses guys know alot more about TileZed than me
Ok, thanks
It worked!!! Thank you so much this literally is a game changer for fishing and fish traps.
I've uploaded it to the workshop.
well try adding just a few mods, test, add more, test, more, test, more
is there a way to make custom crops?
so even when i play normally it crashes my game
i`m almost giving up XDDD, could you please take a look in line 308 and why this shit is giving me errors, 😩
yes search for the Farming directories and look at base items script files.
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\client\Farming
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Farming
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\farming.txt
Ty
since my game keeps crashing should i restart my pc
So I think the problem is istype
replace that by instanceof
or is there any other way to fix it
sorry i meant line 378 😭
mistyped 308
Well if it keep crashing make sure you try a new save game, disable all enabled mods from main menu by deleting in C:\Users\<USER>\Zomboid\mods\default.txt
If it still dont work try checking file validity in steam
so sorry but im not very good at this stuff so where do i find that
same problem as previously
local function LoadGridsquare(square)
if not ARE_HORDES_ON() then
return
end
local bodies = square:getDeadBodys()
if bodies == nil or bodies:size() == 0 then
return
end
for i=0, bodies:size() - 1 do
local body = bodies:get(i)
if body.getObjectID and not body:isSkeleton() then
print("Found a new body")
bodyIds[body:getObjectID()] = {
body = body,
minutesToHoard = ZombRand(MIN_MINUTES_BEFORE_HOARD(), MAX_MINUTES_BEFORE_HOARD)
}
end
end
end
add the check at line #375
if body.getObjectID and not body:isSkeleton() then
@thin hornet Would i need to upload the crops as if im making a custom tile?
I'm not specialist with crop but sub this mod and check how it's done it will be more useful
https://steamcommunity.com/sharedfiles/filedetails/?id=2762018937
k i added it ```lua
local function LoadGridsquare(square)
if not ARE_HORDES_ON() then
return
end
local bodies = square:getDeadBodys()
if bodies == nil or bodies:size() == 0 then
return
end
for i=0, bodies:size() - 1 do
local body = bodies:get(i)
if body.getObjectID and not body:isSkeleton() then
print("Found a new body")
bodyIds[body:getObjectID()] = {
body = body,
minutesToHoard = ZombRand(MIN_MINUTES_BEFORE_HOARD(), MAX_MINUTES_BEFORE_HOARD)
}
end
end
end
Hello i need help i deleted all my mods and restarted my pc but for some reason every time i launch the game it crashes
So uh... Can I have some modding help? 🥺
Tsk, so I want to install one of those zombie sound mods but unfortunately they want you to replace whatever sound file the game uses for zombies. When I do that though the game simply doesn't want to start so... No Last of Us zombie sounds for me?
Ahhh thats a #mod_support question but if you need to revert back try to Verify integrity of game files in steam
Oh, sorry. Off I go. And don't worry, Skyrim taught me the power of backups 😉
perfect and no problem
Hi. Quick question. Is there a mod that displays what the game is doing in the backend while loading up a save? Cities Skylines has something similar to this where it shows what assets are loading in and it really helps when trying to gauge why the game might take a while to load in.
That's simply a means to view the launch command. It doesn't really show anything when loading a save.
mhm
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\ProjectZomboid64ShowConsole.bat
Edit this file
set -Djava.awt.headless=false
then it will show the stuff in the console
Hey dude, so sorry for the late response a storm came in and my light went out
but after testing it it seems that its working,
just came across 1 error
-----------------------------------------
Callframe at: istype
function: onAIStateChange -- file: PleaseDontFeedTheZombiesServer.lua line # 309
ERROR: General , 1659071205245> 6.648.846> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor492.invoke.
ERROR: General , 1659071205245> 6.648.846> DebugLogStream.printException> Stack trace:
java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor492.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at se.krka.kahlua.integration.expose.caller.MethodCaller.call(MethodCaller.java:62)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:198)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:188)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:169)
at zombie.ai.StateMachine.changeRootState(StateMachine.java:94)
at zombie.ai.StateMachine.changeState(StateMachine.java:42)
at zombie.ai.StateMachine.changeState(StateMachine.java:31)
at zombie.popman.NetworkZombieSimulator.parseZombie(NetworkZombieSimulator.java:200)
at zombie.popman.NetworkZombieSimulator.receivePacket(NetworkZombieSimulator.java:141)
at zombie.network.GameClient.receiveZombieSimulation(GameClient.java:301)
at zombie.network.PacketTypes$PacketType.onMainLoopHandlePacketInternal(PacketTypes.java:1011)
at zombie.network.GameClient.mainLoopHandlePacketInternal(GameClient.java:644)
at zombie.network.GameClient.mainLoopDealWithNetData(GameClient.java:621)
at zombie.network.GameClient.update(GameClient.java:428)
at zombie.GameWindow.logic(GameWindow.java:223)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:744)
at zombie.GameWindow.run_ez(GameWindow.java:660)
at zombie.GameWindow.mainThread(GameWindow.java:474)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "<parameter1>" is null
at zombie.Lua.LuaManager$GlobalObject.isType(LuaManager.java:1873)
... 31 more
line 309
local function onAIStateChange(character, newState, oldState)
if istype(character, "IsoZombie") then
if oldState ~= nil and (istype(newState, "ZombieIdleState")) and character:getEatBodyTarget() == nil then
local x = character:getX()
local y = character:getY()
local z = character:getZ()
309 is the
if oldState ~= nil and (istype(newState, "ZombieIdleState")) and character:getEatBodyTarget() == nil then
oops seems like spamming again actually
line #251
LOG : General , 1659071528446> 6.972.060> -----------------------------------------
STACK TRACE
-----------------------------------------
function: runDeferedBodyDeletions -- file: PleaseDontFeedTheZombiesServer.lua line # 251
function: OnTick -- file: PleaseDontFeedTheZombiesServer.lua line # 263
ERROR: General , 1659071528446> 6.972.061> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in runDeferedBodyDeletions at KahluaUtil.fail line:82.
ERROR: General , 1659071528447> 6.972.061> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in runDeferedBodyDeletions
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:88)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1650)
at zombie.gameStates.IngameState.update(IngameState.java:1359)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
at zombie.GameWindow.logic(GameWindow.java:289)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:744)
at zombie.GameWindow.run_ez(GameWindow.java:660)
at zombie.GameWindow.mainThread(GameWindow.java:474)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1659071528449> 6.972.064> -----------------------------------------
STACK TRACE
-----------------------------------------
function: runDeferedBodyDeletions -- file: PleaseDontFeedTheZombiesServer.lua line # 251
function: OnTick -- file: PleaseDontFeedTheZombiesServer.lua line # 263
sendDeleteBodyEvent(body:getObjectID())
bodyIds[body:getObjectID()] = nil
body:removeFromWorld()
body:removeFromSquare()
``` line 251 ⬆️
For aimingtime on weapons, are lower numbers better ??
bro thanks for this haha
Hello! So I found out what told zombies what is something they can destroy or not; however I'm having trouble understanding what exactly tells the zombies which certain tiles they can destroy.
Basically I'm wanting to do something that allows zombies to destroy the Wire Fences, Wooden Walls and any wooden walls level 2 and below.
Since I'm new to modding this game, I'm having a really really tough time.
I've been using the API to reference which is which, i.e "IsoThumpable" and "IsoObject" but I'm not seeing TileID's for those specific tiles or I'm unable to find them, if someone can point me into maybe a list of TileID's and where to go; that'd be awesome, but you don't have to if you don't want to.
Anyone know how to add comments to a sandbox vars file? Doesn't seem to be the tooltip
I noticed going through the vanilla vars there's useful notes and instructions
Also, side note if you need to hide an old sandbox var you can set it's page to nothing
Just need to add a --depreciated
noticed a reference to "_help" suffix 😮
right, _help seem to be the same as _tooltip but only used for ZombieConfig
no. (disclaimer: this info maybe outdated. havent checked how AimingTime works in a very long time)
its a very misleading attribute. when the player moves, a aiming penalty is built up (to a point, used to be -90 to hit chance at max if i remember right). when the player stops moving, the penalty decreases until it goes away (takes a few seconds)
AimingTime is a reduction on this penalty. Higher is better, allows guns to be fired while moving around easier
Hi fenris huge fan. I actually was inspired to start modding weapons after seeing your blog post for OGRM.
YEAH I thought higher is better. But I think with Gunfighter, lower is actually better.
wait
HIGHER IS BETTER
okay
ya i havent checked with build 41 at all but i'm assuming the mechanics are probably the same
Yeah they way you explained it makes sense from my testing so I think you are spot on
gunfighter should get that attribute high/low correctly, since arsenal was the one who originally pointed out to me years back the #'s seemed to be backwards (thus making me dig into the attack code logic to confirm the mechanics)
YEAH they do. Im confusing myself.
are there any mods that allows players to build vehicles chassis? (build a car from scratch)
Not as far as I know, but should be doable by spawning a vehicle and removing all its parts.
Hey again Konijima 😛
I know the cheat menu mod has a feature to spawn vehicles.
Maybe a script can be made that has the player build an in-world item and a 10 second count down which then transforms into the frame of the vehicle the player wanted. (Count-down is to give player a chance to move out of the way...
I don't know... to sophisticated i guess. Especially if you add the ability to allow players to chose between 9 colors + what ever texture/variant each vehicle has...
but in that case, why not just make a dedicated mod that allows players to build 3 kind of junker-cars: Solo, 4-seater, cargo.
Cargo would be a 2 seater, the Solo car has option for a 2nd seat, but by default does not come with a 2nd installed seat or something shrugs i don't know... just thinking aloud.
But then again, if people have been wanting something like this, why is it not in the game yet?
I guess it's to difficult and to much work to add to the game.
Maybe someone can at least look into the possibility?
Spawn a vehicle, loop through the parts to remove them, set engine at 0, etc then imagine its a brand new chassis 😛
Check the square you spawn it on to see if its a building, if so check if the room is at least a garage. otherwise prevent it.
isn't the latest tilezed the one that comes in steam? with the modding tools? i've been meaning to dig into that tool to learn it, but haven't done so yet
From memory it wasnt updated as often. So I think the latest was posted on the forum. But might be worth asking the #mapping nerds.
🤓
ah I see, will have to remember to check that when i decide to commit to learning that tool. thanks
i've been kind of avoiding it, because I always hear about how confusing of a tool it is, so I've avoided it whenever I can
Anyone know what the % represents next to crit
DebugLog.Combat.debugln("Hit zombie dist: " + var8 + " crit: " + this.isCriticalHit() + " (" + var9 + "%) from behind: " + this.isAttackFromBehind());
if I had to guess, it was the chances of a crit on that particular shot. From what I understand there are various conditions that affect your crit chance with guns like your distance, and if you are shooting from behind
AHHH
var9 is the % of critical hit
How is crit damage done
I feel like randomly I'll do shit tons of damage
with a crit and then other crits dont
calculate critical hit based on distance
then they add or remove some number to it based on some condition
and they finally check if its a critical hit using some random
this.setCriticalHit(Rand.Next(100) < var9);
have a look into zombie\characters\IsoPlayer.java
youll be able to decipher most of it
about line 3586
Hey dude, not sure if you saw my messages yesterday but i had some issues with energy and all. Aside that, i've tested it and got again new errors in the code, precisely once i joined the server, i got 1 error in what it seemed to be line 309, but once i started walking around a bit ingame, i got the error spam in line #251, i've looked around a bit and again it looks like its trying to call a method but its not being able to
i'm not sure what to do at this point
its not normal that it try to call a method that doesnt exist in the first place.
Adding the check to know if the method exist is one way to fix it but not really the right way.
Something is wrong with the objects if the method is not there.
I dont have the code right now i cant see the lines
this message
i've attached line and error
try use instanceof instead of istype
309 right?
local function onAIStateChange(character, newState, oldState)
if instanceof(character, "IsoZombie") then
if oldState ~= nil and (instanceof(newState, "ZombieIdleState")) and character:getEatBodyTarget() == nil then
local x = character:getX()
local y = character:getY()
local z = character:getZ()
``` like this?
yeah
istype check the class type, instanceof check if its an instance of that class type
the problem is always your zombies
one of them is nil
and create all theses issues we been messing with
i see
yeah but how would i be able to determine which zombie is causing this
or how would i go about fixing this issue
no idea
cuz tbh i've tried almost everything erased it all and re done it, the best i could come up with is what you are seeing rn
@thin hornet sent ya a DM, in case ya didn't see...
i saw, just a bit busy here and there
np
also working on a mod myself
Is your mod a horse d¤¤¤ dildo weapon? (jk)
the IsoGenerator sprite is hardcoded
but maybe it could be possible just not sure how
Lots of mod ideas, but start getting lazy now. 😑

Still looking for people with server managing, Modding, Mapping experience and normal management experience.
Not meaning to cut you off or anything, so apologies in advance.
Do any moddin' folks here know of how to implement a system where specific frozen goods don't grant unhappiness/boredom? There's something in ISCraftAction.lua, though I have no idea how to inherently apply that to the items in question
Oh, and another question, in the same regard, having an item have the same status as its packaging. ie. I use a lot of recipes that use OnCreate, as they give multiple items. Sorta' like how eggs give the status of fresh or rotten if the container says so
Mod idea:
Visual Melee max-range indicator (A circle) when aiming.
May be a bit redundant, but i'd love to have such a mod.
hey guys, is there any mod to keep a eye on players actions
like put something into a container and i can know it from server log
If you check your server files you can actually find logs for everything that happens
With admin cheats I think you can view logs, or there might be some preexisting additional server mods adding to the logging area
Yep yep 
Yo, does anybody know if you can tweak cars bodymass without rewriting the entire game? I'm talking about making cars actually behave like cars in terms of collision and weight transfer, specifically against entities
Has anyone tried it?
What's the result you're looking for?
Those sound like intermediate variables,
Are you looking for better handling controls/customization
Or like the damage a person / car takes
The damage, yeah. But I gave it some thought and sounds kinda pointless because without ragdoll physics (that wont make the damn PC explode) it's impossible.
Maybe the easiest thing is to find whatever controls the way entities and vehicles behave when the collision takes place and modify it.
The idea itself would be to make entities 'lighter' and vehicles sort of heavier
You can kind of do that in server sandbox settings
Make it so players take a lot of damage from being hit, and players inside cars take not a lot of damage, the car itself taking not a lot of damage (or a lot depending on what you want)
Oh god...
I feel so damn stupid right now
Nevermind then
Now I just need to manage whatever is it the variable that controls the speed reduction on collision and I'm done with this 
Haha it's all good
hi, i wanted to know where are the xp gains located? for example, reloading a weapon increases the skill. if i wanted to change it so that other stuff also level the skill up, where should i go?
looked up in documentation but couldn't find it
Good place to look would be the Zomboid/media/Lua/recipes.lua
Or something like that, they contain functions like
onGainXP
Could also be worthwhile looking into other mods that have weapon crafting and model after them
thanks! i'll take a loot at Brita's Weapon Pack or Arsenal Gunfighter since they add guns and i want to tweak the aiming skill
Carried over from #modeling due to being directed here-ish
Say I have a car, right? What if I want multiple textureLights fields for different textures in the skinIndex? Is that possible?
Is there a way to create custom scenarios?
So I found a simple way to work around a limitation with the API call reloadLuaFile(path) where Events.OnEvent.Add(..) doesn't work.
local SyncCallback = function()
local o = {}
o.callbacks = {}
o.add = function(callback) table.insert(o.callbacks, callback) end
o.tick = function()
if #o.callbacks > 0 then
for i = 1, #o.callbacks, 1 do o.callbacks[i]() end
o.callbacks = {}
end
end
Events.OnFETick.Add(o.tick)
Events.OnTickEvenPaused.Add(o.tick)
return o
end
local Exports = {}
Exports.syncCallback = SyncCallback()
return Exports
I wrote this module to push event code from a situation where I reloaded a lua file and the event registers and works.
Thought I'd share this with yall.
All you do is assign the require and call syncCallback.add(function() .. end)
How difficult would a small mod that removes the mutual exclusivity from Agoraphobic and Claustrophobic from each other be? Been wanting to play around with my old silly panic build for some SP fun again, but with one of the recentish updates those traits can no longer be taken together anymore
Could make a new trait mod based on vanilla vode
Code*
Possibly, though I don't know how to even get that far...or where to find it
I'd look at a current mod that adds traits or some other example files related and reverse engineer it
Mm, fair, fair
Neat. Lua types are now out for that TypeScript project now to try.
good night! i've been messing with the evolved recipes thingy, and for some reason my recipe names are showing up like this
any reason why?
could you show the recipe in the code?
All types?
Apparently everything except the oddball code from client/Context and a couple multi-nested tables.
So yeah maybe 1% or less not there.
Ah
The modeling tool built to add human information to the generator is also stable but not done yet.
So how would I run a mod off of it?
or put it in my server as a mod
since you can't distribute it
npm i and npm run dev as a watcher.
It's not a core Java mod though.
You can absolutely distribute your work there. The environment compiles to Lua.
ah so I get the lua in the end
noice
Maybe I will try to write my radio mod on there
The documentation will need updating since the model is revised as well as the environment revised to be cleaner.
I have been trying to find where the Radio ingame logs are kept, for a specific channel
There's some mad stuff going on with the lua files. There's boilerplate to optimize imports.
Oh and there's the ability to license your compiled code heh.
I'm not going to start issues here however your code is your own. 🙂
well no lol
Im not meaning to start issues or anything, just meaning that I probs wouldn't license as it's whatever to me
but to each their own, I know some people that want to CC the mods they make
I licensed some Java code that is an adapter interface as LGPL.
As long as it's clean and not containing IP, all good. 🙂
No copyleft to worry about.
If I never post what license I want to use it could just default to no distribution / private
Well what about damages & claims? I use MIT as a safety-net.
I otherwise wouldn't license most of my free stuff.
Well CC isn't a code license.
Apache, MIT, GPL, LGPL, etc. are based for code licenses. CC can be used but it's very unorthadox, and used for niche reasons with code.
Ah ok.
{
BaseItem:SapphCooking.MRE_Lasagna,
MaxItems:4,
ResultItem:SapphCooking.MRE_Lasagna,
Name:Add Spices,
CanAddSpicesEmpty:true,
}
hey y'all my map is extremely vertical and im going to be using it for my rp pvp server--problem is, in PZ, you cant shoot at anyone in a layer above you. so theoretically people can just camp my map's canyons or hop on a staircase and gun everyone down
do you guys have any suggestions either mapping wise or a possible mod (unlikely!) that would fix that?
the game already has that option
alrighty friends
time to revive the radio fix mod and make it better since the base game radios are broken again
:<

Yeah I saw that one, looks like it needs an update
How do we go about seeing radio logs from normal chat logs
they aren't registered as id = 3
The pictured text is confirmed radio text just not sure how to differentiate it between proximity chat and radio
Guys, is it possible to scale wheels from the template?
does anyone have a link for the mod where you can name your crates
How would I replace an Items spawn with one of my items?
it was for a very particular issue that i believe was fixed. if it's broken again it's going to be something else
you'll have to look at the decompiled source like i did to see what's causing it now
this is a cursed problem
just complain until TIS actually fixes the radios themselves
don't rely on modders to make core game features actually work
We figured out ATM that military radios are completely disfunctional for us
HAM and tactical are reliable, but you have to have HAM actually equipped to speak into it but not to hear it
yeah, it's fucked
and has been for a long time now
TIS has no interest in fixing radio text because the big market is VOIP
the old radio system in 41.65 used a certain variable to poll for text to send over the radio; that was disabled and made obsolete by a new system. all the old radio mod did was set that variable, since vanilla didn't
it's not inherently impossible to write a fix yourself, but it might be impossible. need to know what the issue is, for one
i might have a writeup somewhere about why placed radios don't work
anyone know if this issue's resolved yet? https://theindiestone.com/forums/index.php?/topic/44457-4168-radios-lack-chat-formatting/
Formatting such as [col=255,255,255] or 255,255,255 doesn't work over radios, either in overhead messages or in the chat log. https://cdn.discordapp.com/attachments/136501320340209664/925303767161765918/unknown.png The cause of this is twofold. For the chat log, this appears to be because SayCh...
41.71 has - Fixed radio sync in MP; 41.72 has a bunch of vehicle radio fixes
ah wel
has anyone had any issue with the rv interior mod im trying to use it to use the inside of a bus and when i go to the back it just sits on a black screen
nvm found out that you cant use custom maps with the rv mod
hey guys! can anybody tell me if there is an easy way to make zombies spawn through an OnCreate: in a recipe? for example when Ash ( evil dead) opens the book of the dead (would be made by a recipe from closed to open book) and reads from it and then alot of Z start spawning. would that be possible? thanks in advance! 🙂 👍
Could just design a radial check, if player within radius, take every other radio with same freq ID var, and print same text
Players can't see text if not within radius

I mean performance-wise it isn't technically that taxxing
good luck
that's why Im a software engineer, I like da challenge!
guys can you tag me if you know if there is a mod for locable gate's
How can i get Project Zomboid original font?
The logo?
Yes
I believe that is customized work.
Oh gosh
I'm making a house planner site
Howdy howdy to you modding folks and raccoons, I've been trying to figure out a way to get select frozen goodies from applying their boredom and unhappiness (without increasing said levels higher). I've made some ice pops and don't want them to give an insane boost in happiness, but I don't want you to become instantly depressed because it hasn't thawed out to the right temperature.
I did do some searching here and found the question was discussed as having the solution being in the ISCraftAction lua file, on ye line 96. Though I'm not too sure how to inherently apply that to the items in question. Would any of y'all be able or willing to offer some assistance?
Hey, did you use the ice cream as an example
I was looking at the item stuff, but I'm not sure of where the code for the ice cream would be at
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\items_food.txt
item Icecream
{
DisplayName = Ice Cream,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Icecream,
Packaged = TRUE,
ReplaceOnRotten = IcecreamMelted,
DaysFresh = 1,
DaysTotallyRotten = 1,
HungerChange = -30,
UnhappyChange = -10,
Calories = 1680,
Carbohydrates = 180,
Lipids = 84,
Proteins = 26,
WorldStaticModel = IceCream,
}
item IcecreamMelted
{
DisplayName = Melted Ice Cream,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = IcecreamMelted,
Packaged = TRUE,
HungerChange = -30,
Calories = 1680,
Carbohydrates = 180,
Lipids = 84,
Proteins = 26,
WorldStaticModel = IcecreamMelted,
}
Oh yeah, I've looked at that but to the best of my knowledge it doesn't contain anything about the frozen properties. It helps me with the melted stuff if I were to expand, but unfortunately I didn't see anything about disabling the debuffs from eating frozen stuff
zomboid\zombie\inventory\types\Food.java
public float getUnhappyChange() {
float var1 = this.unhappyChange;
if (this.isFrozen() && !"Icecream".equals(this.getType())) {
var1 += 30.0F;
}
if (this.Burnt) {
var1 += 20.0F;
}
if (this.Age >= (float)this.OffAge && this.Age < (float)this.OffAgeMax) {
var1 += 10.0F;
}
if (this.Age >= (float)this.OffAgeMax) {
var1 += 20.0F;
}
if (this.isBadCold() && this.IsCookable && this.isCooked() && this.Heat < 1.3F) {
var1 += 2.0F;
}
if (this.isGoodHot() && this.IsCookable && this.isCooked() && this.Heat > 1.3F) {
var1 -= 2.0F;
}
return var1;
}
public float getBoredomChange() {
float var1 = this.boredomChange;
if (this.isFrozen() && !"Icecream".equals(this.getType())) {
var1 += 30.0F;
}
if (this.Burnt) {
var1 += 20.0F;
}
if (this.Age >= (float)this.OffAge && this.Age < (float)this.OffAgeMax) {
var1 += 10.0F;
}
if (this.Age >= (float)this.OffAgeMax) {
var1 += 20.0F;
}
return var1;
}
its a bit hardcoded here
so if its not frozen its unhappiness asf
so even cold is not as good
or im reading it wrong
I would never have expected to look into that folder itself, hmm. I very much appreciate it, I'll try looking into that and seein' what I can find. I very much appreciate it
well in other word that java code tells that anything frozen that is not icecream
make you unhappy and bored
And I take it that, since it's a Java thing, making a lua file that requires said file wouldn't work
To keep that effect on your iced stuff i think you would have to call your items MyModule1.Icecream, MyModule2.Icecream
as long as the type is Icecream youll have the effect
but making bunch of module for multiple pop might be a bit too much
Yeah, there's a wicked number of flavors, so that's pretty bloaty for sure
in fact the dev should change that code to use a Tag named "Icecream" and then any item with that tag would act like icecream
I can certainly say that would be very, very handy. While disappointing, I do very much appreciate your assistance!
If you want, go on the forum and post a suggestion with what i just told you.
Groovy, I'll have to get right on that! The Steam forums?
Got things you want to see in PZ? Post here! Tip: search to see if there's already an existing thread.
Actual result
Ah the actual IS forums, that makes significantly more sense
People are talking about bloat for something that won't even touch the resources in any impactful way

More so bloating my mod's folder. Well, more bloated than the folder already is
More like a tag "IsGoodFrozen", or you're doing the same mistake again 😅
is it possible to have an item i made block a placement? Like i wouldnt be able to walk through it?
I still want it to be an item since i want to be able to craft things with that item placed down
hey guys! can anybody tell me if there is an easy way to make zombies spawn through an OnCreate: in a recipe? for example when Ash ( evil dead) opens the book of the dead (would be made by a recipe from closed to open book) and reads from it and then alot of Z start spawning. would that be possible? thanks in advance! 🙂 👍
Hey is there a mod that let's me manage what item should spawn from some mods, for example I want to manage what should spawn and what should not spawn from STALKER clothing mod.
@undone crescent yes, that is absolutely possible - you can have a recipe run a lua function on completion rather than producing another item
cool thanks for the info Olipro! Im trying right now to make them spawn with the addZombiesInOutfit() would i need to get the players position first or can i just go with that line?
the first two arguments to that function are X and Y coordinates
sry im kinda new to this stuff, so far i only managed to make recipes with multiple result in the lua 😅
ah so i would need to get player position first and then go with + x/y, right?
yeah
or, use addZombiesInOutfitArea
you can give it an x/y min and x/y max
and it'll pick a random spot within those bounds each time
cool many thanks!
Is there a way to disable stunlock in multiplayer pvp fights?
Yeah thats a better tag, but using icecream wouldnt be that much of a mistake in a sense it would work too.
Yeah ofc, fine as a workaround
So you make mod called remove error if you put on game and active / it will remove error own self / if you download another mod / put file / it will remove error / if that mod when still active / and it will remove error / when you play any map
Its good idea?
Put emoji like this👍 👎
I AM GENIUS IN WORLD
so make a mod to remove errors from other mods?
to hide your sins, right?
as someone who is not a modder that seems not very possible but
@Ben_#1269 ?
you cannot remove the errors, you need to fix them
any links for UI creation. templates and guides
also anyway to spawn vehicle via lua
does anyone know of a mod that lets you make booze and liquor that works with the more perks mod for alcoholism
@ancient grail best way to learn both of those things is to examine the code in the game that creates UIs and the debug code for spawning vehicles
if you want something relatively trivial, the debug menu code itself is a good example. if you want something more involved; the inventory window
Or add fix
Alrighty gamers, time to fix these radios
I will ask is there any example within PZ of a radius being used?
Actually silly me, VOIP uses it

What does the spawning definition do in recorded_media.lua?
Most are set to 0. some 1.
Hey there, I'm new to modding and I'm looking for nice guides to help me out. I just made, with a friend, a custom map with custom tiles, and now I'd like to eventually write a bit of lua for very simple events; For instance, I'd like to start by spawning a full and powered generator at a precise location on game start. Could find the OnGameStart event on the wiki, but nothing about spawning a full powered generator..
Any hint? Thanks by advance!
(Also, I learned basics of worlded&co& doing the mod folder, but I dont know where to put .lua files in the file folder to make them work)
You would not place the object at a specific location on game start. In fact you would have to place it when the player enter the area using LoadGridSquare event. You could store in the global moddata that your generator was or not spawned yet.
Subscribe some mods on the workshop and check the code for examples.
yeah that's what I started to do, thanks!
I tried to modify one for my mod also but since I dont have an index of lua commands and their effect
well I cant do anything
I know python so I should be ok coding and understanding structures
You can open the vanilla game files ina text editor and search through the files to find what you need
ok
Im not sure if you can fill the generator using worldzed to fill it with gasoline, but im sure you can place the generator like that. If its not possible to do it through that im sure you can still try using lua. Ongamestart however might not work. Thats because unless you spawn in the same cell as where you want to place the generator, the area won't be loaded in so you can't add it in. You might want to try using loadgridsquare to check for the correct tile and from there, the square will be loaded, and you can do the neccessary modifications
oh lol, you sniped me while I was typing
guys thanks a lot for your help!
Im on my phone so my help is limited but i can help more later if you still need
So I was not aware of the problem you are mentionning @shadow geyser , but indeed the concerned cell si the spawning cell. so both methods works, ok
Thanks @thin hornet , might need it later still ^^
I havent found tools allowing me to add items on worldzed but they might exist. I can spawn a generator, yes, but I have to check if its more than a texture, and I surely dont see how to change its initial parameters..
You guys have tutos around these topics? I know nothing about "globalmoddata" for instance ^^
I guess its a set of global variables added by the mod but thats all ^^
It looks very instructive indeed, thanks a lot
this wiki made by konjima is pretty good on alot off topics. https://github.com/Konijima/PZ-BaseMod/wiki. global moddata is basically just the same as other moddata in the game, except rather than being attached to an object somewhere, global moddata is the one attached to the world, so its just a central place to get a table for your mod for any information you need to store and use.
Hello.
Thanks @shadow geyser !
If you want an environment that's different than Lua, you have the option to code mods in TypeScript. The environment I'm linking has its own events API that tells you what events are there to use and what is provided with them with the documentation from the PZ Wiki.
https://github.com/asledgehammer/PipeWrenchTemplate
https://github.com/asledgehammer/PipeWrenchTemplate/blob/81c7ee61c05d556ab22f7518de590450816d277d/typings/PipeWrench-Events/41.71/PipeWrench-Events.d.ts#L298
EmiLua is a good plugin to use to see what you're working with in Lua too.
There are guides mentioned above that helps setup the basic Lua modding environment.
Theses are the JavaDocs you should use: https://zomboid-javadoc.com/41.65/
Here's a list of Lua events on the Wiki: https://pzwiki.net/wiki/Modding:Lua_Events
@jagged ingot Well I thought doing it in lua because I saw .luas everywhere so ^^' but the api looks amazing yes! Gonna check emilua tpp
Don't worry. That project only just recently came around.
Does pipe wrench have access to VOIP and player Chat events?
Does Lua even have access to it?
I'm working on fixing these radios for good by gutting their radio system and making my own
I'm not sure, it's contained in the /chat and /raznet folders for /zombie
For .class
raknet doesn't expose to Lua
ChatManager isn't exposed but things like ChatTab are.
Hm, that means I'd have to make a Java mod then
Yeah. Unfortunately it would seem that VOIP is locked into Java.
Goal is making radios simply radius dependent and if you speak near a radio's radius when it's on, every other radio with the same freq will print
Text first, and the VOIP add on later in java
Wondering if you could make a fake player on the server and then send VOIP data to other players that way.
Just a thought.
Is that even possible without an account?
I could make a player object
Store it as an object off the map or something
I made fake player logins and moved them around with stupid AI a few years ago. I don't know about VOIP though.
Hm...
If that worked I think id have to make a filter or something where the player only listens to VOIP from the entire map of a certain freq
Would you have any pointers on where I would find player objects for making fake ones?
Hm.. actually doesn't the admin player have the ability to listen to everyone?
Not sure if that's going to be a global listen for text or VOIP, or both
anyone know how i can resize a tile
take existing tile, make it a different size (within the same space taken in the game), like scale it down a bit in this case.
i assume i would need to.. extract the tile using something like TileZ
and
change the data with a.. normal image editing process hopefully
and then re-pack it into a pack that just contains the one thing with the same ID so it overrides?
is that possible?
thats a list of usable commands rights? Should I only look zombie.lua for command sI can use in simple lua scripts?
hah.. no
it's a list of both accessible and inaccessible things
and it's hit-or-miss what is accessible or works in my experience so far
im not sure what dictates it, possibly modifiers on the methods in java, which are not documented there

all of the objects are accessible, so far, that i've tried - just not all methods/members
whatever you call them in java
i'm a C# programmer primarily
honestly I'm really new to modding and I was expecting the community had a commonly estblished list of lua methods/commands/etc that worked, but I see its harder 😄 I'm not a programmer mainly but I can relatively dig into it
Nah, it's pretty dirty ATM due to the updates happening
It's hacky

But that's a good thing, means you shouldn't let anyone tell you there is only one way / no way to do something, that just means they haven't done it themselves yet lol
the only thing there's "one way" to do is override a function without breaking other mods 😂
and honestly even that's probably doable in a few ways that achieve the same thing
dats right ! 🙂
Trait Idea:
Paranoia:
You randomly hear noises of groaning zombies and the occasional helicopter. You may even get jump scared when opening a door when nothings there.
+5 points
Packet simulation
Basically assign a short ID to the player and then send the player login packet to all clients.
By player you mean the player object being simulated
Reserve & use an upper limit short ID for your player-count.
Also I'm not sure how comfortable people here are with discussing stuff that gets into the realm of modifying networking so I'll stop if need be.
This can easily be looked at in the same category as what people do to hack & exploit although this case isn't for this purpose. 🙂
Well no lol, but it is to solve an issue with radios
I'm talking about methodology.
Botting your own server is a pretty wide subject on its own
It overlaps with some uncomfortable hobbies. 🙂
no matter if you teach the good stuff the bad stuff will always be present
Black box analogy
I raised this concern because of where this discussion is. 🙂
Anywho yeah that information should get you started.
Player packets are associated with short IDs.
By upper bound is there a value ID limit in the decompile or is it based on int limits
You can see this through the client with zombie.characters.IsoPlayer#getID()
I believe it's clamped to max players count. I think they're reused.
It could be incremental or that.
Walk through zombie.network.GameServer#receiveClientConnect() and replicate the assignments for global player dictionaries and then send the same packets for the login process.
You'll also need to look at zombie.core.raknet.UdpEngine.
Lordy lots of fun stuff to get radios working
This is all for learning how to create fake players.
Indeed
Wouldn't it be easier by this point to just make a custom object or override radios ?
All you'd need is
Object
Frequency ID
radius for player check
And chat/VOIP listener
If you can send VOIP packets without requiring a player reference that resolves to an actual IsoPlayer then yes.
RadioServerData, RadioDeviceDataState, RadioPostSilenceEvent, SyncEquippedRadioFreq, WaveSignal, SyncEquippedRadioFreq, and SyncRadioData are packets I see in the game.
None of them are. Nothing of the network is exposed.
You'll have to do this as a Java mod.
This entire time I've been talking to you knowing that you're looking at making a Java mod.
Well yes
In Java only. Look at zombie.Lua.LuaManager.
No one wants to touch the core of the game since they can't put it on things like the Workshop.
That doesn't bother me and my friends who mod this game.
For sure
The aim is to improve my server and not worry about other servers for a fix like this unless they are also willing to mod java
Welcome to what I do.
I've posted to workshop, amazing to see how much people complain about free content
It's a good thing to work on.
I wouldn't focus or think about that. It's really a waste of productive energy to think about those things when modding.
Mod for yourself.
Get coffee.
True that
You can tell someone's age by the use of periods in a non serious conversation through the internet


Good luck with your project.
is it possible to have an item i made block a placement? Like i wouldnt be able to walk through it?
I still want it to be an item since i want to be able to craft things with that item placed down
I only see one example entry for adding loot to the loot table of zeds with a particular outfit? Where are the rest stored?
I do see generic loot under inventorymale & inventoryfemale but I thought there was specific loot as well.
the only way would be to place a placeholder blocking object on the ground when the item is place/drop on the ground. And remove that placeholder object when picked up. But yeah thats might be a bit complex to do correctly and even then could have problems arise from this. Also if that item is not centered in the square well the blocking object will be
@thin hornet ahh like an invisible tile then make an item that looks like the tile i want to be able to craft things with
may i ask what the item is?
im trying to work on a crafting station
okay so you want the crafting station to be part of the recipe
i just hate the fact that you can walk through it if its an item so i decided to make it into a tile
yeah
i tried but no luck
then you could use a tile only
and add a OnTest to check if the player is near a crafting station to complete the recipe
lets see if that works 🙂
for example
recipe Craft Stuff On Crafting Table {
stuff,
....
OnCanPerform: MyRecipeCodes.OnCanPerform.RequireCraftingTable,
}
that or OnCanPerform
yeah that would be OnCanPerform
You can add world items with code, too. Campfires do it with ```
local isoObject = IsoObject.new(square, "camping_01_6", "Campfire")
isoObject:setOutlineOnMouseover(true)
self:toModData(isoObject:getModData())
square:AddTileObject(isoObject)
cause it gives you the player as a parameter, so you just need to scan the nearby squares depending of the radius you wish
thanks for the feedback yall will try this now
You think i would need?
CanBeDoneFromFloor:true,
CanBeDoneFromFloor mean that the recipe items can be on the floor i think
ahh
but if your items are on the crafting table that can be handy
for example Saw Logs recipe use can be done from floor
where would this be located?
For me it's at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Camping\SCampfireGlobalObject.lua
local obj = IsoObject.new(square, sprite);
square:AddSpecialObject(obj);
obj:transmitCompleteItemToServer();
bunch of example how to build objects in media\lua\server\BuildingObjects
For example would this work if i was next to the lab? or do i need to add keep CocaLab1 aswell
recipe Craft Stuff On Coca Lab {
Spoon,
Bleach,
Result:Fork,
Time:10.0,
OnCanPerform: MyRecipeCodes.OnCanPerform.RequireCocaLab1,
}
Now you need to define the function MyRecipeCodes.OnCanPerform.RequireCocaLab1 in lua
so you would create media\lua\server\DrugLagRecipeCodes.lua
DrugLagRecipeCodes = {}
DrugLagRecipeCodes.GetItemTypes = {}
DrugLagRecipeCodes.OnCanPerform = {}
DrugLagRecipeCodes.OnCreate = {}
DrugLagRecipeCodes.OnGiveXP = {}
DrugLagRecipeCodes.OnTest = {}
--- Find an object around x,y,z
local function findObjOnSquareRange(spriteNames, x, y, z, range)
for xx = x - range, x + range do
for yy = y - range, y + range do
local square = getSquare(xx, yy, z);
if square then
local objects = square:getObjects();
for i = 0, square:getObjects():size() - 1 do
local obj = objects:get(i);
local spriteName = obj:getSpriteName() or obj:getSprite():getName();
if s = 1, #spriteNames do
if spriteName == spriteNames[s] then
return obj;
end
end
end
end
end
end
end
--- Require Coco Lab to perform recipe
function DrugLagRecipeCodes.OnCanPerform.RequireCocaLab1(recipe, playerObj)
local x, y, z = playerObj:getX(), playerObj:getY(), playerObj:getZ();
local sprites = { "coco_lab_0_1", "coco_lab_0_2" };
return findObjOnSquareRange(sprites, x, y, z, 1) ~= nil;
end
lol fo real
xD
Very much appreciated man cant thank you enough!
I wrote it in discord so didnt test
im sure it works XD

I assume the crafting station implemented in this manner wouldn't show up as a requirement in the recipe window?
i wish discord has some auto format stuff lol
Yeah they wouldnt
But you can add it to the name of the recipe to make it clear
A tool-tip informing the player or something may be ideal
yeah i was planning on working on a magazine and a whole occupation for this mod to even make this stuff
DrugLord XD
The cure mod where you need to build a whole lab uses instrument and recipe like that if i recall
Still, I like the idea of having a crafting station that has collision.
Coffee time.
Sophia is legitimately one of the best sitcom characters from that generation of shows.
i need to make some cleanup ...
Gradle time.
Adding loot to zed loot tables via outfit definition file (clothing.xml) spawns these items on the zed when they spawn. Then adding loot to a zed via a distribution file spawns loot upon death?
Is there a way to get the suns current “brightness” value?
I hope it's not drive C
it is 
from experience, I can tell you that doing that kind of thing will get you alot of bug reports and complaints about the recipes not working if you dont make it exceedingly obvious thats needed, as it isn't something people are used to with regards to recipes. You can also inject in text into the recipe in the crafting menu as alot of people won't read descriptions of mods on steam and will still give those "bug reports" even if you try to document it. They only started going away until after I did this. if you want to see an example of how I did it, you can check in the mod "hydrocraft continued" and take a look at the file "HCcrafthelper_fix.lua". you unfortunately need to just add one small line into the vanilla function, and end up needing to redeclare the whole function with one line extra for your function that inserts the new entry for the requirement.
you can also add some compatability with "craft helper continued" its the spiritual successor of the old craft helper mod, and lanceris has put in some support for these kind of recipes using the ontest to make them more obvious
I think I'm going to spend a fair bit of time writing documentation for the new TypeScript environment for PZ.
That thing is developed enough for people to contribute documentation for the game where things are not clearly defined.
Might be good to put my knowledge there to help others if they so choose to go with it.
Again the editor built for the documentation stuff is badass. It has return type documentation now.
When setting up a spawn point ( sample below ):
{ worldX = 46, worldY = 34, posX = 40, posY = 152, posZ = 0 },
posX = 40, posY = 152 = Coordinates on the map
worldX = what it indicates?
worldY = what it indicates?
posZ = what it indicates?
there is an explanation here. posX and worldX combined give you the real coordinates. to my understanding its because PZ map cells are 300x300. so worldX and worldY give you the cell, and pos X and posY give the relative coordinate in that cell. posZ is the height that you are at. to my memory it is 0 indexed. so ground floor is 0, 1st floor up is 1 etc.
#mod_development message
Many thanks mate I owe you a good beer! 😉
How do I stop a vanilla item from spawning?
I dont know but I found that tuto that might help, searching for my stuff.
https://theindiestone.com/forums/index.php?/topic/38329-customizing-loot-4151/
Here is an example of a simple map mod using custom room definitions, custom loot zones and custom procedural distribution lists using the new loot distribution system (41.51+). 3 gas stations have been placed in a cell intended to be added to the vanilla map via a map mod, the Northern most stat...
But you must have much simpler methods, isnt there a "spawn disabled items" on sandbox options?
Thanks
As reference in the case others need it ( At least for Single Player )
worldX = 46, worldY = 34, ---> The Map Grids where the spawn point is located
posX = 40, posY = 152 --> The relative map coords ( You can get easily them from the PZ map project )
posZ = 0 --> The floor ( 0,1,2,etc )
Many thanks for the hint @shadow geyser !
I would add, to be exhaustive, that you also have global coordinates (not used for spawnpoints), in our case :
CoordX = 13 840, CoordY = 10352,
linked to others by
CoordX = 300xWorldX+posX , CoordY = 300xWorlY+posY
(this calculus reflect the two grid decompositions we have : world in cells and cell in 300x300tiles)
getClimateManager():getDayLightStrength() should get it for you.
Ooooo thank you so much!
Any of you know a mod I could dig in that :
-create a (simple) custom item
-associate a custom texture to it compiled in the texturepack
My goal is to create a custom item and to be able to place it in TileZed. (A custom generator).
I started to dig in mods .lua and in vannilla .lua, so I think I read a bunch of useful methods&commands, but mods I found only add a lootable item or a custom tile texture. And Vanilla code has some dark places, but I found some relevant stuff I could use, written for Campfire, using Camping_01 tilesheet as ref (in vanilla/../lua/client/Test/MapObjectsTests.lua)
Could check out The Workshop(scrap items), custom trailers, etc
Thanks, I'm checking! For trailers, seems its considered as a vehicle, as such is it placable in tilezed?
I mean, I could do a custom parkingstall with 100% chance to spawn the trailer, but I can't adapt that in my case.
Custom trailers because there are some trailers that actually count as generators like the printable Light trailer
The workshop mod for the placeable item
Or even just looking at generators in the game source code
This I tried already, but I found more on... campfire than on generators. No key info is in scritps\newitems.txt fo instance, juste basic names, spritename, weight... But will continue surely 🙂
Thanks a lot for these 2 things, checking it out now !



