#mod_development

1 messages · Page 5 of 1

sour island
#

hm

#

one of my mods has a "-" in the id

#

can't translate it lol

thin hornet
#

ModID should always be as simple as possible such as no space no special character

sour island
#

oh wait I think I messed up the translation pointer

thin hornet
#

ModName = My sup3r mod-is fr#aking cool 123
ModID = MySuperModIsFreakingCool123

sour island
#

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 -

thin hornet
#

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

sour island
#

Good advice

glad pivot
#

Anyone here knows the creator of the site "map.projectzomboid"???

scarlet fossil
#

i do wonder if someone needs a voice actor for mods

open abyss
#

Fatigue, when high is what causes the character to get tired, right?

open abyss
#

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...

weak sierra
#

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

sweet trail
#

Looking for Modders/Scripters, if you got experience DM me.

open abyss
#

Looking for Devs of PZ: I'd like to say Hello 😛

open abyss
#

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...

rancid tendon
#

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?

thin hornet
#

10617 / 300 = 35~~.39~~
6640 / 300 = 22~~.133333333333333333333333333333~~
0

#

35 * 300 = 10,500 so 10617 - 10,500 = posX

#

xD weird eh?

rancid tendon
#

ha

#

gotcha!

thin hornet
#

😄

rancid tendon
#

and if i just put the 10617 and 6640 into posx and posy, that'll work?

thin hornet
#

nope

rancid tendon
#

oh wait i see

#

i understand now

thin hornet
#

worldX = floor(playerX / 300)
posX = playerX - (worldX * 300)

rancid tendon
#

the posx would be 117 then, yeah?

thin hornet
#

yeah

rancid tendon
#

does the same apply to the y?

#

so it'd be 117, 40

thin hornet
#

Spawnpoint Calculation

worldX = floor(playerX / 300)
posX = playerX - (worldX * 300)

worldY = floor(playerY / 300)
posY = playerY - (worldY * 300)
rancid tendon
#

perfect

#

thank you!

thin hornet
#

np

fiery pecan
#

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?

worldly olive
#

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? 🤔

wraith root
#

most likely not

thin hornet
wraith root
#

or is the wiki out of date for item list IDs

thin hornet
#

so just spawn what ever you need and check the id

wraith root
#

ah neat didn't know that

#

thanks for le tip

thin hornet
#

pas de probleme

wraith root
# sour island 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

sour island
#

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?

wraith root
#

I will have to investigate here, my other peeps are looking into it, it isn't game breaking by any means just odd

sour island
#

Maybe it's related to mapobjects? I don't think injuries are normally items

wraith root
#

hmmm

#

I did recently delete all of the zpop files

#

also likely not related

sour island
#

I don't think I've ever seen injuries as items tbh

wraith root
#

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

worldly olive
#

Thanks

wraith root
#

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?

thin hornet
#

that might be helpfull

wraith root
#

Aha

#

I missed it by two directories up, thank you

thin hornet
#

So weird trying to teleport a player within a timed action perform method doesnt seem to work

wraith root
#

Would be good to find out for minigames and such

burnt ice
#

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

wraith root
#

Also, is there a lua showing items and what they need to be crafted with

wraith root
#

versus exploring the crafting menus or having to learn certain skills, instead find the craftable file

thin hornet
#

getScriptManager():getAllRecipes()

#

but not sure what you will do with this

wraith root
#

I'll have to make a script to make a txt I can reference in the future

sour island
thin hornet
#

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

thin hornet
#

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
thin hornet
#

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)

thin hornet
#
--- 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
random kettle
#

I'm a big dummy when it comes to modding how do I change audio files

fiery pecan
#

ok, so. How does one call a field in a class? As in something like BaseVehicle.addedToWorld??? I'm having trouble with this

untold heron
#

hi

grizzled dawn
#

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?

drifting ore
#

soo i can include mroe than 1 module right?

grizzled dawn
#

these files are stored inside C:\Users\ [USER]\Zomboid\Saves\Multiplayer\ [world folder], if anyone wondering

drifting ore
#

like this?

#

oh rip no icant

#

threw an error lol

wraith root
#

Any reason why when I use

AnimNode:BandageLeftArm,

it makes my character raise his hands as if to surrender?

thin hornet
wraith root
#

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

thin hornet
#

recipe animation node cannot really use special animation such as BandageLeftArm cause the way animation work using condition.

wraith root
#

SHoot

#

Shoot*

#

I wish they were flagged as special lol

thin hornet
#

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

wraith root
#

As for the sounds?

thin hornet
#
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

alpine scroll
#

Is it possible to add a "custom" animation that is a replica of bandageleftarm?

thin hornet
#

Yeah probably is

#

create directory in your mod media\AnimSets\player\actions

wraith root
#

wouldnt that be a more complex way of just setting the variable within the recipe

alpine scroll
#

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?

thin hornet
#

Recipe anim node is basic for now yeah

wraith root
#

hm

thin hornet
#

would need a new field that specify an anim variable

wraith root
#

alrighty I added those directories

thin hornet
#

copy the animation Bandage.xml

#

rename it to RecipeBandage.xml or something

wraith root
#

alrighty got it

#

for the naming

thin hornet
#

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

wraith root
#

indeed

#

Should I use the name or the anim_name

#

<m_Name>RecipeBandageLeftArm</m_Name>
<m_AnimName>Bob_BandageLeftArm</m_AnimName>

thin hornet
#

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

wraith root
#

So for the sake of the node

thin hornet
#

just try using the same name for
m_Name
and
m_Conditions > m_StringValue

#

in this case RecipeBandageLeftArm

wraith root
#

Alrighty

thin hornet
#

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

wraith root
#

ah I see

#

like a type

thin hornet
#

this way they dont copy/repeat bunch of property and can have different/additional m_Conditions

wraith root
#

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?

alpine scroll
#

Didnt you name it Bob_RecipeBandageLeftArm?

wraith root
#

It works as the anim name, I haven't tried the primary name

alpine scroll
thin hornet
#

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>
wraith root
#

hm

thin hornet
#

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());

wraith root
#

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

thin hornet
#

you should be able to use any sound in C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\sounds_item.txt

wraith root
#

ah sweet I was using the actual WAV references

#

no wonder it isn't working haha

thin hornet
#

you could also add your own sound the same way as vanilla does it

wraith root
#

no i c e

thin hornet
#

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, }
    }

}
wraith root
#

what kind of format is .ogg

thin hornet
#

you can use wav, ogg and mp3

#

i use ogg

wraith root
#

ah sweet

#

which one is most optimal?

thin hornet
#

its light

wraith root
#

ah I see

thin hornet
#

i use audacity to convert

wraith root
#

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

alpine scroll
#

Good luck on your endeavors

cosmic condor
toxic walrus
#

Anyone know what ToHitModifier does for guns?

wraith root
#

oh lordy bugs galore

#

Basically all sounds being used are ignored

#

except for two items

wraith root
#

Where do I find all the items that are specifically 3D in game

cosmic condor
#

ProjectZomboid\media\models_X ?

wraith root
#

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

cosmic condor
shadow geyser
#

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

cosmic condor
#

it's where you specified which mesh to use

shadow geyser
#

they look like this

wraith root
#

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
shadow geyser
#

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

wraith root
#
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,
    }
}
cosmic condor
#

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.

wraith root
#

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

sweet trail
#

Looking for modders / Scripters to start a server with.

toxic walrus
#

HALLO. Does Math work in Scripts for parameters in script files? Like weapons

winter bolt
toxic walrus
#

Yeah want to mass tweak weapon values so I think I'll go with that option

#

Thank you Spongie. Im huge fan

wraith root
#

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

shadow geyser
#

what error? i dont see any in your ss

lusty nebula
#

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

opaque vortex
#

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.

thin hornet
#

IsoThumpable is a type of IsoObject that can be destroyed by zombies.
Zombie will not target IsoObject or other type other than IsoThumpable.

opaque vortex
sour island
#

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

thin hornet
#

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.

sour island
#

interesting

wraith root
# sour island 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?

random finch
#

There are 2 textures for shoes. The soles, and the outer surface. Where is the outer surface defined?

sour island
#

The inside of the shoe or the interior outer side?

#

it is probably mirrored

random finch
#

Should say both tbh.

sour island
#

I mean there isnt really a reason to render the actual inside of the shoe

winter bolt
#

shoes are textures on the body mesh so i'm confused

sour island
#

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

random finch
#

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?

sinful vessel
#

Which is how UV layout is done for masking system to work

#

Are you sure you are using correct layout?

winter bolt
#

items can only have 1 texture

random finch
#

What is this used for then?

sinful vessel
#

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

random finch
sinful vessel
#

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

random finch
#

It is! Thank gawd, it briefly crossed my mind that it may have been the reminiscence of someone's work.

shadow geyser
craggy furnace
drifting ore
#

Weird question

#

Is it possible to track how much someone walks in a day in game

random finch
craggy furnace
#

no, ive already done it

#

what you have your hands on is incredibly old

#

those textures no longer exist

#

theyll cycle out next update

random finch
#

Got yuh, anytime soon?

craggy furnace
#

i am aiming at soon yes

#

mods been overhauled so not much hasnt been touched

random finch
#

Very nice, can't wait to hop into the new threads.

shadow geyser
craggy furnace
#

i am glad you brought it up though

#

since i just finished converting this morning

thin hornet
# drifting ore Is it possible to track how much someone walks in a day in game

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);
sour island
#

@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?

thin hornet
#

especially dedicated where you manually add the mods in the config

#

requiring in lua is probably the best way to ensure a load order

sour island
#

Alrighty

thin hornet
#

not sure if that was the question but if not let me know

sour island
#

Writing a patch for a mod, and I'm just trying to ensure it doesn't trip over itself

#

Nah it was

grizzled dawn
#

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```
thin hornet
#

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

grizzled dawn
#

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

grizzled dawn
thin hornet
#
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

grizzled dawn
#

line 82 is also cited

#

but it seems to have failed

grizzled dawn
#

it stopped spamming errors

#

but it still gives some errors now and then

#

now its recalling line 378

thin hornet
#

well you should check why body doesnt always have getObjectID() available

#

check if you get body of the wrong type

grizzled dawn
#

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

thin hornet
#

you know you can do

table.insert(bodies, bodyList:get(i))```
#

to add to a table that act as an array

grizzled dawn
#

have been trying and nothing

#

thing just gets dead with errors and crashes

thin hornet
grizzled dawn
#
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

thin hornet
#

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

glad pivot
#

How i can get all official tiles?

#

I want to make a site to help the community in one specific question

thin hornet
#

using TileZed you can extract all the vanilla tiles

#
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media```
file ending with `.tiles`
mighty breach
#

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???

thin hornet
mighty breach
grizzled dawn
#

here`s the console, if you need i can provide the server log

thin hornet
mighty breach
#

It's the baitfish they're purely Pike and Trash... wanting to make it a general bait

glad pivot
thin hornet
#

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

thin hornet
# glad pivot You can send me the link of tilezed?
glad pivot
# thin hornet if this is not outdate that should be this https://theindiestone.com/forums/inde...
mighty breach
#

Literally just make a lua with just that snippet???

thin hornet
glad pivot
thin hornet
glad pivot
# thin hornet great ill update the wiki with this link
thin hornet
jagged ingot
#

Good evening.

thin hornet
#

Sup mate

thin hornet
# grizzled dawn

Object tried to call nil in LoadGridsquare
PleaseDontFeedTheZombiesServer.lua line # 378

#

againt something trying to call a function but that function is nil

glad pivot
thin hornet
#

TileZed should have an option for tile viewer and or extractor

#

I remember using it but its been a while

glad pivot
thin hornet
#

Try asking your question into #mapping theses guys know alot more about TileZed than me

glad pivot
#

Ok, thanks

mighty breach
#

I've uploaded it to the workshop.

eternal skiff
#

hey my game keeps crashing when i mass mod it

#

And i dont like playing vanilla

thin hornet
eternal skiff
#

ok

#

ill try that sorry for bugging you

thin hornet
#

You dont bug me at all pal

#

😄

flint beacon
#

is there a way to make custom crops?

eternal skiff
#

so even when i play normally it crashes my game

grizzled dawn
thin hornet
# flint beacon is there a way to make custom crops?

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

eternal skiff
#

since my game keeps crashing should i restart my pc

thin hornet
eternal skiff
#

or is there any other way to fix it

grizzled dawn
#

mistyped 308

thin hornet
eternal skiff
#

so sorry but im not very good at this stuff so where do i find that

thin hornet
# grizzled dawn sorry i meant line 378 😭

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
flint beacon
#

@thin hornet Would i need to upload the crops as if im making a custom tile?

thin hornet
grizzled dawn
# thin hornet same problem as previously ```lua local function LoadGridsquare(square) if n...

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

eternal skiff
#

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

nocturne junco
#

So uh... Can I have some modding help? 🥺

thin hornet
#

Probably

#

Send the question first 😄

nocturne junco
#

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?

thin hornet
#

Ahhh thats a #mod_support question but if you need to revert back try to Verify integrity of game files in steam

nocturne junco
#

Oh, sorry. Off I go. And don't worry, Skyrim taught me the power of backups 😉

thin hornet
#

perfect and no problem

strong widget
#

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.

strong widget
#

That's simply a means to view the launch command. It doesn't really show anything when loading a save.

thin hornet
#

mhm

thin hornet
#

set -Djava.awt.headless=false

#

then it will show the stuff in the console

strong widget
#

Ah. Neat.

#

That works. Let me try that out.

grizzled dawn
#

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 ⬆️
toxic walrus
#

For aimingtime on weapons, are lower numbers better ??

opaque vortex
#

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.

sour island
#

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 😮

thin hornet
quasi geode
# toxic walrus For aimingtime on weapons, are lower numbers better ??

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

toxic walrus
#

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

quasi geode
#

ya i havent checked with build 41 at all but i'm assuming the mechanics are probably the same

toxic walrus
#

Yeah they way you explained it makes sense from my testing so I think you are spot on

quasi geode
#

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)

toxic walrus
#

YEAH they do. Im confusing myself.

open abyss
#

are there any mods that allows players to build vehicles chassis? (build a car from scratch)

thin hornet
open abyss
#

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?

thin hornet
#

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.

shadow geyser
thin hornet
#

🤓

shadow geyser
#

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

toxic walrus
#

Anyone know what the % represents next to crit

thin hornet
shadow geyser
#

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

toxic walrus
#

AHHH

thin hornet
#

var9 is the % of critical hit

toxic walrus
#

How is crit damage done

#

I feel like randomly I'll do shit tons of damage

#

with a crit and then other crits dont

thin hornet
#

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);

toxic walrus
#

Ahh okay

#

Just seems a bit wild sometimes

thin hornet
#

have a look into zombie\characters\IsoPlayer.java

#

youll be able to decipher most of it

toxic walrus
#

YE

#

THANK YOU

#

FOR THE QUICK ANSWER

thin hornet
#

about line 3586

grizzled dawn
# thin hornet 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

thin hornet
# grizzled dawn 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

grizzled dawn
#

oops

grizzled dawn
#

i've attached line and error

thin hornet
grizzled dawn
#

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?
thin hornet
#

yeah

grizzled dawn
#

i've also changed line 308

#

not sure if i was supposed to

thin hornet
#

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

grizzled dawn
#

yeah but how would i be able to determine which zombie is causing this

#

or how would i go about fixing this issue

thin hornet
#

no idea

grizzled dawn
#

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

open abyss
#

@thin hornet sent ya a DM, in case ya didn't see...

thin hornet
open abyss
#

np

thin hornet
#

also working on a mod myself

open abyss
#

Is your mod a horse d¤¤¤ dildo weapon? (jk)

thin hornet
#

the IsoGenerator sprite is hardcoded

#

but maybe it could be possible just not sure how

cosmic condor
#

Lots of mod ideas, but start getting lazy now. 😑

wraith root
sweet trail
#

Still looking for people with server managing, Modding, Mapping experience and normal management experience.

dusk saddle
#

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

open abyss
#

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.

random oar
#

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

wraith root
#

With admin cheats I think you can view logs, or there might be some preexisting additional server mods adding to the logging area

random oar
#

wow, i will check it soon

#

tysm

#

i found it in the file, thank you again🥳

wraith root
#

Yep yep squirrel

fierce bluff
#

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?

wraith root
#

Those sound like intermediate variables,

Are you looking for better handling controls/customization

Or like the damage a person / car takes

fierce bluff
#

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

wraith root
#

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)

fierce bluff
#

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 drunk

vast estuary
#

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

wraith root
#

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

vast estuary
#

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

fiery pecan
#

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?

topaz pasture
#

Is there a way to create custom scenarios?

jagged ingot
#

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)

rocky lava
#

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

wraith root
#

Code*

rocky lava
#

Possibly, though I don't know how to even get that far...or where to find it

wraith root
rocky lava
#

Mm, fair, fair

jagged ingot
#

Neat. Lua types are now out for that TypeScript project now to try.

tacit plover
#

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?

shadow geyser
jagged ingot
# wraith root 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.

jagged ingot
#

The modeling tool built to add human information to the generator is also stable but not done yet.

wraith root
#

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

jagged ingot
#

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.

wraith root
#

ah so I get the lua in the end

#

noice

#

Maybe I will try to write my radio mod on there

jagged ingot
#

The documentation will need updating since the model is revised as well as the environment revised to be cleaner.

wraith root
#

I have been trying to find where the Radio ingame logs are kept, for a specific channel

jagged ingot
#

There's some mad stuff going on with the lua files. There's boilerplate to optimize imports.

wraith root
#

Not sure if they are also kept in the chat logs or something

#

noice

jagged ingot
#

Oh and there's the ability to license your compiled code heh.

wraith root
#

Noice

#

well

#

to a point

#

the devs can take it still

jagged ingot
#

I'm not going to start issues here however your code is your own. 🙂

wraith root
#

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

jagged ingot
#

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.

wraith root
#

If I never post what license I want to use it could just default to no distribution / private

jagged ingot
#

Well what about damages & claims? I use MIT as a safety-net.

#

I otherwise wouldn't license most of my free stuff.

wraith root
#

ye

#

all depends CC law can get complex

#

I studied it for a while

jagged ingot
#

Well CC isn't a code license.

wraith root
#

Well no

#

its a public license

#

I meant CR not CC specifically

jagged ingot
#

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.

tacit plover
drifting ore
#

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?

keen frost
#

the game already has that option

wraith root
#

alrighty friends

time to revive the radio fix mod and make it better since the base game radios are broken again

#

:<

wraith root
odd notch
#

ELavenza#7473 made the radio fix mod

#

let me find it

#

obsolete as of 41.66

wraith root
#

Yeah I saw that one, looks like it needs an update

wraith root
#

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

fierce bluff
#

Guys, is it possible to scale wheels from the template?

vivid geyser
#

hi

#

someone knows how can i make 7.62 ammo for my AK-47?

drifting ore
#

does anyone have a link for the mod where you can name your crates

noble pumice
#

How would I replace an Items spawn with one of my items?

teal slate
#

you'll have to look at the decompiled source like i did to see what's causing it now

teal slate
#

just complain until TIS actually fixes the radios themselves

#

don't rely on modders to make core game features actually work

wraith root
teal slate
#

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

wraith root
#

😩

#

Sadge

teal slate
#

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

#

41.71 has - Fixed radio sync in MP; 41.72 has a bunch of vehicle radio fixes

#

ah wel

storm finch
#

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

undone crescent
#

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! 🙂 👍

wraith root
#

Players can't see text if not within radius

teal slate
#

yeah, and it'd be running in softcode

#

it'd suck

wraith root
teal slate
#

good luck

wraith root
#

squirrel that's why Im a software engineer, I like da challenge!

blazing escarp
#

guys can you tag me if you know if there is a mod for locable gate's

glad pivot
#

How can i get Project Zomboid original font?

jagged ingot
glad pivot
jagged ingot
#

I believe that is customized work.

glad pivot
#

I'm making a house planner site

cosmic condor
#

create font effect in illustrator

#

It's not that hard

dusk saddle
#

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?

thin hornet
dusk saddle
#

I was looking at the item stuff, but I'm not sure of where the code for the ice cream would be at

thin hornet
#
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,
    }
dusk saddle
#

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

thin hornet
#
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

dusk saddle
#

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

thin hornet
#

well in other word that java code tells that anything frozen that is not icecream

#

make you unhappy and bored

dusk saddle
#

And I take it that, since it's a Java thing, making a lua file that requires said file wouldn't work

thin hornet
#

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

dusk saddle
#

Yeah, there's a wicked number of flavors, so that's pretty bloaty for sure

thin hornet
#

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

dusk saddle
#

I can certainly say that would be very, very handy. While disappointing, I do very much appreciate your assistance!

thin hornet
#

If you want, go on the forum and post a suggestion with what i just told you.

dusk saddle
#

Groovy, I'll have to get right on that! The Steam forums?

glad pivot
thin hornet
glad pivot
dusk saddle
#

Ah the actual IS forums, that makes significantly more sense

wraith root
#

People are talking about bloat for something that won't even touch the resources in any impactful way

dusk saddle
#

More so bloating my mod's folder. Well, more bloated than the folder already is

gaunt pendant
flint beacon
#

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

undone crescent
#

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! 🙂 👍

sweet trail
#

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.

calm depot
#

@undone crescent yes, that is absolutely possible - you can have a recipe run a lua function on completion rather than producing another item

undone crescent
#

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?

calm depot
#

the first two arguments to that function are X and Y coordinates

undone crescent
#

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?

calm depot
#

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

undone crescent
#

cool many thanks!

smoky meadow
#

Is there a way to disable stunlock in multiplayer pvp fights?

undone crescent
#

i think there is a mod for it, isnt it?

#

search for NoStunlocks PVP

thin hornet
gaunt pendant
#

Yeah ofc, fine as a workaround

drifting ore
#

Yo guys

#

Can i give idea to modding workshop to make people happy and not angry

drifting ore
#

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

spark bison
#

so make a mod to remove errors from other mods?

drifting ore
#

Yes

#

It will remove error if you add other mod

cosmic condor
#

to hide your sins, right?

spark bison
#

as someone who is not a modder that seems not very possible but

drifting ore
#

@Ben_#1269 ?

spark bison
#

ye

#

I am left in constant suspense until you answer

drifting ore
#

If its hard to make / just mod maker needs make script or mod

#

Idk

thin hornet
#

you cannot remove the errors, you need to fix them

ancient grail
#

any links for UI creation. templates and guides

ancient grail
#

also anyway to spawn vehicle via lua

storm finch
#

does anyone know of a mod that lets you make booze and liquor that works with the more perks mod for alcoholism

calm depot
#

@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

drifting ore
calm depot
#

if you fix an error, it's no longer present

#

so you have, in fact, removed it 😏

wraith root
#

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

random finch
#

What does the spawning definition do in recorded_media.lua?

#

Most are set to 0. some 1.

heavy iris
#

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)

thin hornet
#

Subscribe some mods on the workshop and check the code for examples.

heavy iris
#

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

thin hornet
#

You can open the vanilla game files ina text editor and search through the files to find what you need

heavy iris
#

ok

shadow geyser
# heavy iris Hey there, I'm new to modding and I'm looking for nice guides to help me out. I ...

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

heavy iris
#

guys thanks a lot for your help!

thin hornet
#

Im on my phone so my help is limited but i can help more later if you still need

heavy iris
#

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 ^^

heavy iris
#

I guess its a set of global variables added by the mod but thats all ^^

heavy iris
shadow geyser
jagged ingot
#

Hello.

heavy iris
#

Thanks @shadow geyser !

jagged ingot
# heavy iris Hey there, I'm new to modding and I'm looking for nice guides to help me out. I ...

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.

heavy iris
#

@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

jagged ingot
wraith root
jagged ingot
wraith root
#

I'm working on fixing these radios for good by gutting their radio system and making my own

wraith root
#

For .class

jagged ingot
#

raknet doesn't expose to Lua

#

ChatManager isn't exposed but things like ChatTab are.

wraith root
#

Hm, that means I'd have to make a Java mod then

jagged ingot
#

Yeah. Unfortunately it would seem that VOIP is locked into Java.

wraith root
#

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

jagged ingot
#

Wondering if you could make a fake player on the server and then send VOIP data to other players that way.

#

Just a thought.

wraith root
#

I could make a player object

#

Store it as an object off the map or something

jagged ingot
#

I made fake player logins and moved them around with stupid AI a few years ago. I don't know about VOIP though.

wraith root
#

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

wraith root
#

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

weak sierra
#

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?

heavy iris
weak sierra
#

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

heavy iris
#

ok 😄

#

thanks a lot, I'll dig into it ^^

weak sierra
#

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

heavy iris
#

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

wraith root
#

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

weak sierra
#

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

wraith root
#

Time to expose VOIP to Lua ✨

civic vale
#

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

jagged ingot
#

Basically assign a short ID to the player and then send the player login packet to all clients.

wraith root
jagged ingot
#

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. 🙂

wraith root
jagged ingot
wraith root
#

Botting your own server is a pretty wide subject on its own

jagged ingot
#

It overlaps with some uncomfortable hobbies. 🙂

wraith root
#

squirrel no matter if you teach the good stuff the bad stuff will always be present

#

Black box analogy

jagged ingot
#

Anywho yeah that information should get you started.

wraith root
#

Ah

#

You called it a player count

#

You mean the false player ID?

jagged ingot
#

Player packets are associated with short IDs.

wraith root
#

By upper bound is there a value ID limit in the decompile or is it based on int limits

jagged ingot
#

You can see this through the client with zombie.characters.IsoPlayer#getID()

jagged ingot
#

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.

wraith root
#

Lordy lots of fun stuff to get radios working

jagged ingot
#

This is all for learning how to create fake players.

wraith root
#

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

jagged ingot
#

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.

wraith root
#

Likely not exposed to Lua

jagged ingot
#

None of them are. Nothing of the network is exposed.

#

You'll have to do this as a Java mod.

wraith root
#

Could I just make a custom exposure?

#

For my own work

jagged ingot
#

This entire time I've been talking to you knowing that you're looking at making a Java mod.

wraith root
#

Well yes

jagged ingot
wraith root
#

Wonder why no one else has tried doing this

jagged ingot
#

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.

wraith root
#

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

jagged ingot
#

Welcome to what I do.

wraith root
#

I've posted to workshop, amazing to see how much people complain about free content

jagged ingot
#

It's a good thing to work on.

jagged ingot
#

Mod for yourself.

thin hornet
#

Mod for your life!!

#

im super lazy atm i need to wake up

jagged ingot
#

Get coffee.

wraith root
#

True that

#

You can tell someone's age by the use of periods in a non serious conversation through the internet squirrel sax

jagged ingot
#

Good luck with your project.

wraith root
#

Yes indeed, I'll likely be back for more

flint beacon
#

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

random finch
#

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.

thin hornet
flint beacon
#

@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

thin hornet
#

may i ask what the item is?

flint beacon
#

im trying to work on a crafting station

thin hornet
#

okay so you want the crafting station to be part of the recipe

flint beacon
#

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

thin hornet
#

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

flint beacon
#

lets see if that works 🙂

thin hornet
#

for example

recipe Craft Stuff On Crafting Table {
  stuff,
  ....
  OnCanPerform: MyRecipeCodes.OnCanPerform.RequireCraftingTable,
}
#

that or OnCanPerform

flint beacon
#

heres a pic of it lol its a little drug lab table

thin hornet
#

yeah that would be OnCanPerform

agile coral
#

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)

thin hornet
#

cause it gives you the player as a parameter, so you just need to scan the nearby squares depending of the radius you wish

flint beacon
#

thanks for the feedback yall will try this now

flint beacon
thin hornet
#

CanBeDoneFromFloor mean that the recipe items can be on the floor i think

flint beacon
#

ahh

thin hornet
#

but if your items are on the crafting table that can be handy

#

for example Saw Logs recipe use can be done from floor

agile coral
#

For me it's at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Camping\SCampfireGlobalObject.lua

thin hornet
#
local obj = IsoObject.new(square, sprite);
square:AddSpecialObject(obj);
obj:transmitCompleteItemToServer();
#

bunch of example how to build objects in media\lua\server\BuildingObjects

flint beacon
#

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,
      }
thin hornet
#

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
flint beacon
#

holy

#

your an actual god

random finch
#

lol fo real

thin hornet
#

xD

flint beacon
thin hornet
#

I wrote it in discord so didnt test

flint beacon
#

im sure it works XD

jagged ingot
flint beacon
random finch
#

I assume the crafting station implemented in this manner wouldn't show up as a requirement in the recipe window?

thin hornet
#

i wish discord has some auto format stuff lol

thin hornet
#

But you can add it to the name of the recipe to make it clear

random finch
#

A tool-tip informing the player or something may be ideal

flint beacon
#

yeah i was planning on working on a magazine and a whole occupation for this mod to even make this stuff

#

DrugLord XD

thin hornet
#

The cure mod where you need to build a whole lab uses instrument and recipe like that if i recall

random finch
#

Still, I like the idea of having a crafting station that has collision.

jagged ingot
#

Coffee time.

jagged ingot
thin hornet
#

i need to make some cleanup ...

wraith root
jagged ingot
#

Gradle time.

random finch
#

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?

shy radish
#

Is there a way to get the suns current “brightness” value?

cosmic condor
thin hornet
shadow geyser
# flint beacon yeah i was planning on working on a magazine and a whole occupation for this mod...

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

jagged ingot
#

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.

lusty nebula
#

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?

shadow geyser
lusty nebula
#

Many thanks mate I owe you a good beer! 😉

noble pumice
#

How do I stop a vanilla item from spawning?

heavy iris
# noble pumice 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/

#

But you must have much simpler methods, isnt there a "spawn disabled items" on sandbox options?

lusty nebula
#

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 !

heavy iris
jaunty gate
shy radish
heavy iris
#

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)

wraith root
heavy iris
wraith root
#

The workshop mod for the placeable item

#

Or even just looking at generators in the game source code

heavy iris
heavy iris