#mod_development

1 messages ยท Page 548 of 1

random finch
#

Correct, tried at least 4-5 times.

sour island
#

Are you sure you have the right ID set?

#

I've seen people updating onto their other work by accident

#

From copy pasting directories when starting new projects, if you copy the mod.info but forget to change the id number

#

That'd be my best guess

random finch
#

hrmm, could be right. Let me triple check.

#

Bah, thanks Chuck. Your suggestion somehow pointed me in the right direction. However, I was working on it from the mods directory rather than the workshop directory. The ID was correct.

sour island
#

Ah, see I have the opposite issue sometimes - if you're subscribed to your own mod the subscribed version gets loaded rather than your upload directory one

#

I kind of wish every folder was loaded and displayed separately

late hound
subtle sapphire
#

Question for MP server: Does anyone knows if there is cap on the number of zombies with a speedtype different than the default one? I am asking because I am trying to force the speedType of each zombie to Sprinter, it works well until I start to move around with the player, and suddenly stop. All zombies are moving at the default speed of the server. This doesn't happen while playing in SP. Oh, the same apply if I force the speedType to shamblers ๐Ÿ‘€

sour island
#

If you're tapping into zombie update you may have to move the code's location to shared if it's not

sinful iron
#

This is probably a horrifying question but can action groups be used to make zombies access events like climb wall / window the player character has?

mint sphinx
#

How do Is it again to make a sprite not walk through?

deft prism
#

i love this thanks, i dont use any guns but I will download this in forever. Im a huge fan of anything aliens.

mystic hazel
#

Thanks, yea, huge Alien nerd myself

azure rivet
#

hello I need help I want to make the character attack except when the zombie is on the ground and stomp on it as usual. Where are the attack action scripts in the game?

placid hinge
#

There are onhit events that let you have a function call whenever a character hit a zombie/player

azure rivet
thin hornet
midnight mica
#

is there a method that returns the time a player has played on the server? like across all deaths?

placid hinge
azure rivet
true vault
#

I have returned. Again.
Trying to add XP upon completion of recipe. I got the whole OnGiveXP:Recipe.OnGiveXP.Blacksmithing10 (copied/looked at vanilla recipes in recipes.txt), however, it errors out with something along the lines of "<local6> is null" or something very similar to that.

#

Any clue what that's supposed to mean, and/or am I entirely missing something in how to implement XP adding?
My recipe:

recipe Refine Scrap Metal Into Small Metal Sheet
    {
       ScrapMetal=5,
       keep [Recipe.GetItemTypes.Hammer],
       Result:SmallSheetMetal,
       Time:120.0,
       Category:Smithing,
       OnGiveXP:Recipe.OnGiveXP.Blacksmith25,
       NeedToBeLearn:false,
    }

Vanilla recipe:

recipe Make Sheet Metal
    {
       IronIngot=110,
       keep BallPeenHammer,
       keep Tongs,

       NearItem:Anvil,
       Result:SheetMetal,
       Time:190.0,
       Category:Smithing,
       SkillRequired:Blacksmith=4,
       OnGiveXP:Recipe.OnGiveXP.Blacksmith25,
       NeedToBeLearn:true,
    }

The recipe itself "works"; it produces a small metal sheet, removes the ingredients, and keeps the hammer. But it doesn't give the XP.

Relevant Error messages from console:
https://pastebin.com/3pvadeXz

thin hornet
#

might wanna use Recipe.OnGiveXP.MetalWelding25 instead

true vault
#

Alright, I'll try that, thanks. I'll reply back here if it works or not.

#

That did the trick, thank you so much @thin hornet!

thin hornet
#

Np

viral flame
#

I just discovered you can have skeleton enemies lol

thin hornet
#

thats dope

craggy laurel
#

hi, I'm looking to make the drinking animation looong for a beverage mod, around 3 minutes. I was wondering what made the drink animations loop longer than others (e.g. soda can vs pot or milk).

viral flame
#
local function makeSkeleton(body)
    local square = body:getSquare()
    local direction = body:getDir()

    local skeletonTemplate = addZombiesInOutfit(square:getX(), square:getY(), square:getZ(), 1, nil, 0, false, false, false, false, 100)
    skeletonTemplate = skeletonTemplate:get(0)
    skeletonTemplate:setSkeleton(true)
    skeletonTemplate:removeFromWorld()

    skeletonTemplate:setCurrent(square)
    skeletonTemplate:setDir(direction)

    return IsoDeadBody.new(skeletonTemplate, false)
end
#

why is it so ridiculously hacky to make a skeleton dead body?

#

is there an easier way im missing?

mint sphinx
#

I guess not thst anyone know it then xD might just have to look after it after I'm finish at work then

jaunty marten
#

or order box of lubricant

jaunty marten
#

btw what's this? blacksmith was as metalwelding in prev builds?

mint sphinx
jaunty marten
#

gotcha

thin hornet
jaunty marten
#

heh

#

@thin hornet strange question but do u know what exactly IS means?

thin hornet
#

IndieStone

jaunty marten
#

ah

#

thx peepoKeyboard

mint sphinx
# thin hornet IndieStone

by any chance do you know which atributte you need to give a sprite so you can walk through it ? its a 2d sprite and not a 3d object im working on atm.

thin hornet
mint sphinx
jaunty marten
mint sphinx
# jaunty marten

thx i guess just have to make a into my generics lua script ๐Ÿ˜›

#

depend how you packed the skin and where on the sprites

jaunty marten
#

it's game based

mint sphinx
#

but packagename_00 or somehting like that you need to know the name of the sprite you want to select

jaunty marten
#

default green tile from build-mode

#

I know path for it and seems it's extracts from .pack files

#
  • there's strange size of img
#

full height

mint sphinx
#

at the office so cant really find the default green tile from build mode atm ^^ what the img called ?

jaunty marten
#

128x256 roflanEbalo

#

I was confused in first time

#

but now just want ideal size of tile in 128x256 img

jaunty marten
#

sec

#

nope

#

can't find it again

#

forget where I found name of it

#

but it have to be here

#

I tried to google how to extract it but there's nothing

wooden falcon
#

I tried adding a recipe to my mod so that I can craft a custom item and it's not showing up in the crafting menu. Not sure if I'm doing somethign wrong / have a typo / not doing something necessary. All I did was add a file scripts/ModName_recipes.txt that has

module Base
{
    recipe My Item 1
    {
       MyItem2=3,

       Result:MyItem1,
       Sound:PutItemInBag,
       Time:50.0,
       Category:Misc,
    }
}

My Item 1 is the display name for my custom item. MyItem1 (and MyItem2 for the other item) is the name given to the item object in scripts/ModName_item.txt:

module Base
{
    item MyItem1
    {
        -- item attributes
    },
    item MyItem2
    {
        -- item attributes
    }
}

(I probably shouldn't be using the Base module for my mod, but the names are unique enough that I don't think that's the issue.) Any ideas what I'm missing?

I thought that maybe it's because I gave the recipe the same name as the item itself, so I tried changing the recipe name to have "Make" before it, but that didn't have any effect.

#

I looked at the way the recipes are defined in the vanilla files as well as how another mod is doing it. Not sure what I'm missing.

drifting stump
violet shell
jaunty marten
violet shell
#

It's a png file sorry, and here it is in case of.

jaunty marten
mint sphinx
violet shell
#

I also have this @jaunty marten

#

this is a better template to create stuff, the first template I sent is to align your faces in the same png to repack it in a .tiles file

drifting stump
mint sphinx
# violet shell Hi, I managed to exctract all the files from the vanilla texture pack when I was...

you might think about https://github.com/cdaragorn/ProjectZomboidPackManager but i the new version do have a bug with some of the .pack now of days. so i would just use the .pack view in the default mod toll

GitHub

Allows you to unpack and view all of Project Zomboid's textures from the .pack files. - GitHub - cdaragorn/ProjectZomboidPackManager: Allows you to unpack and view all of Project Zomboid&am...

mint sphinx
violet shell
#

I still have all the packed files unpacked as dozens of .png files, I can zip all of it in an archive and upload it somewhere

#

MP me if you want me to do that

drifting stump
mint sphinx
thin hornet
uncut meteor
#

setColor(Color.red) changes the item sprite texture color sort of an overlay, but
does anyone know how to set up Custom colors for display name?

drifting stump
static oyster
dapper pine
#

would it be possible to make the weapon wheel detect weapons in your backpack too? and how difficult would that be? i haven't modded this game before ๐Ÿ˜…

frosty falcon
#

you would edit/replace the wheel and do some inventory checks on the player
you could look into a mod that already changes the wheel if you know any

viral flame
#

But really what I wanted was to add a skeleton dead body which is what that function does

dapper pine
keen frost
#

no, is a WIP commission ๐Ÿ˜†

jaunty marten
dapper pine
#

assuming this is edited, what lua (?) file would i put this in?

jaunty marten
#

into file of ur mod

sour island
#

#732 - local inv = playerObj:getInventory():getItems()

#

You can just change getItems to the other types of checks, I think the devs already have a recursive one

sour island
#

I figured out how it can be done but would require using getAllEvalRecurse() instead of getitems

#

and writing an evaluating function

dapper pine
#

cant really figure it out myself haha

spare burrow
#

Hey people, question: How can i make so an item is provided each X hours survived to a player?

#

i know this function exists, but i would like better to count survived hours : ```local function EveryHours()
-- Your code here
end

Events.EveryHours.Add(EveryHours)```

jaunty marten
#

or u don't know function to get survived hours?

spare burrow
jaunty marten
#

just check code of this part

#

I don't remember function name exactly

viral notch
#

how to make tire with air in ?

#

when spawn vehicle have 4 wheels but all tires are 0/40 air

spare burrow
jaunty marten
#

survived

frosty falcon
frosty falcon
#

good stuff

jaunty marten
#

but poor usage PB_peepo_sad_ok

willow estuary
#

Just as a clarification, the public Java functions can be called in lua, but not the private ones.

But there are a lot of juicy + powerful public java functions in the PZ code.

jaunty marten
willow estuary
#

Do you mean the model? If so, no, but that is something that we are working on making mod-able ๐Ÿ™‚

keen cape
willow estuary
#

You can override the models for weapons, but not other models currently.

jaunty marten
#

fortunately it's object without model just sprite

willow estuary
viral notch
#

how to dam put pressure in tire?
spawned vehicle has wheels without pressure but with random condition...
will be nice to have it with random amount of air in also
someone can help me ?

jaunty marten
jaunty marten
willow estuary
viral notch
jaunty marten
#

literally render

jaunty marten
#

Ik only lua ways

viral notch
sour island
#

Hammer is in a briefcase inside the backbag

frosty falcon
sour island
# jaunty marten I mean dynamically

You have to tap into another function as texture isn't saved. I do this for Named Literature, and use function ISInventoryPane:refreshContainer()

jaunty marten
sour island
#

3D models can't be changed dynamically atm

#

but this function will work on 'floor' containers too

jaunty marten
#

not model but sprite

sour island
#

you could tie into LoadSquare()

#

just make sure you have it only capable of applying once

jaunty marten
#

but it's not optimised

sour island
#

without an added event for items on load this is kind of how you have to do it

#

also not that bad

jaunty marten
#
  • I need to check always if it need to be rendered
sour island
#

you can add the square to a temp global list so it's only ran once

#

same thing with the items, so it's not reapplied

jaunty marten
#

I just want to do obj.render = function() ... end like in gmod Pepe_cry Pepe_cry Pepe_cry

#

seems my mod going into trash bin without this feature

sour island
#

you can try to suggest they add a triggerevent on item load

sour island
#

Yes, but you said sprite

#

which only needs refresh container right now

jaunty marten
#

I think it's same things here

jaunty marten
sour island
#

What is it?

jaunty marten
#

world object that haven't model but sprite

sour island
#

so like broken glass/furniture?

jaunty marten
#

IsoObject.new(square, "media/textures/blablabla.png", item_type)

jaunty marten
sour island
#

if you're calling new() you can just change the texture there? no?

jaunty marten
#

okay just it:
I have mode that can enable/disable and I need to render sprite objects only if mode is on

#

so I need to control render each frame

#

not just once

sour island
#

When/how are they placed? You could create a list in modData of XYZs

jaunty marten
#

I can change textures on mode change

sour island
#

then on world load / whenever you want - can change them based on xyz

jaunty marten
#

but sounds like a shit

jaunty marten
#

don't want PB_peepo_sad_ok

sour island
#

that's kind of how it has to be done unless you have the player directly changing it

#

it's not unoptimized lol

jaunty marten
dapper pine
sour island
#

I don't know exactly what you want to be happening, but if you want objects to change over time or go into different modes you need a way to reference them

#

otherwise you'll be scanning the tiles in the area instead

jaunty marten
#

it's a problem cos I don't want to go through all table

sour island
#

also the game is pretty solidly built - all things considered - I scan the entire cell square by square for EHE and no ones mentioned lag lol

jaunty marten
#

I want just override render of single item type

sour island
#

that's why I said to shorthand using xyz

#

table = {["x-y-z"]=object}

table["x-y-z"] returns object

#

you dont need to for loop it

willow estuary
# jaunty marten blair said they working on it

Ah, my bad in that I though you were talking about inventory items and not world objects?

Currently I don't know very much about modifying world object sprites; it's not in my wheelhouse.

jaunty marten
sour island
#

I wouldn't try saving the object in anyway

jaunty marten
sour island
#

does it inherently save if you create an isobject?

#

I've never tried

#

but if you don't have to worry about manually saving the object - I'd just save the xyz's and grab the objects on boot

jaunty marten
sour island
#

would be alot faster for saves

#

Not sure what your ideal solution would be then

#

How would the game know which object you need to change?

jaunty marten
#

only way is iterate full table on mode switch

jaunty marten
#

it's fine

sour island
#

you can't save objects in modData afaik

#

which is why I suggested the xyz

#

would also avoid save bloat

jaunty marten
sour island
#

okay then what's the issue?

jaunty marten
#

optimised way to render them only if setup-mode is enabled roflanEbalo

#

I'm always work on optimise and if there's no this one then I'm crying

sour island
#

isn't the point of optimizing to avoid overhead costs

#

having a table of coords recorded isn't unoptimized at all

jaunty marten
jaunty marten
sour island
#

it wouldn't go through each square

#

you can just use getsquare on the saved coords

#

then populate a temporary list for direct object calls

#

once, at world load

jaunty marten
#

I can use saved coords or table of coords recorded isn't unoptimized at all

#

wut

sour island
#

Anyway, hope you figure it out

jaunty marten
#

I already done it but anyway shit way

sour island
#

Nice, good job

jaunty marten
keen frost
#

Just a little more testing before releasing this mod to public

shadow geyser
# jaunty marten 1. it's better than iterate each square 2. my table is optimised so it's fine

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

spare burrow
keen cape
#

Dude, that looks amazing!

static oyster
#

But something i want to know is if it's possible to load different models

#

I wish I could load something else other than skeletons

#

Because I wanted to add other type of zombies

#

I know a hacky way to make new type of zombie models to spawn but still

viral flame
#

createZombie(...) lets you define a survivor description

#

could probably use that

viral flame
boreal root
#

question how do i add maps on bisect hosting also hi first time on the server

harsh anvil
#

Has anyone made a refrigerated or frozen large trailer, box truck or semi-trailer mod for mass hauling of perishable goods?

Aside from the refrigerated spiffos can, ice cream truck mod and car ac refrigeration, there does not seem to be any on the steam workshop

Would this kind of mod be difficult to implement in the game while playing nice with other various car mods like filibusters and eggons?

static oyster
#

For example, skeleton = true loads the skeleton.x

#

I wish I could load a custom 3d model just like the skeleton thing does

viral flame
#

in that theres a function

#

setForceModel(Model model)

static oyster
#

You seem to be very experienced, is there Any documentation?

viral flame
#

yes but, I just read through the decompiled code

#

the documentation is pretty bad

#

no descriptions usually

static oyster
#

Yeah its bad especially for someone with very basic c# programming knowledge

viral flame
#

well, C# is basically Java

#

so you would probably be pretty familiar with the decompiled output

#

C# is microsofts response to Javas popularity

static oyster
#

JavaScript or java ?

viral flame
#

lol

#

Java

static oyster
#

Hmm

static oyster
#

Will try it, i tried decompiling with zomboidDoc but it was always giving me error java version no matter which version i had installed

viral flame
#

yeah, I had the same problem

#

I debugged it a little bit, basically zomboid is compiled with latest java

#

and its conflicting with gradle, because if you set java to a version zomboid likes

#

gradle gets upset because it runs on a version that is to new

#

and at that point I said fuck it ๐Ÿคทโ€โ™‚๏ธ

thin hornet
#

use java 17

static oyster
thin hornet
viral flame
#

I tried all of these

#

the only one that was able to execute the getVersion gradle task was 18

#

but gradle itself only supports 17

thin hornet
#

thats weird

viral flame
#

Wish I could help more but I'm much more experienced with maven over Gradle :(

remote cradle
#

I am trying to create an item with the same interface as a cd player but which doesnt use cds or vhs. How can I make an item and associate it with the new player.

#

This is my first mod and I probablt should have started with something simpler but I'm already set on this

thin hornet
#
item GameBoyPlayer {
}

-- if each media is its own item

item GameBoyCassetteMarioWorld {
  mediaId = MarioWorld,
  tags = GameBoyMedia,
}
item GameBoyCassetteLuigiWorld {
  mediaId = LuigiWorld,
  tags = GameBoyMedia,
}

-- if media is a single item

item GameBoyCassette {
  tags = GameBoyMedia,
  OnCreate = MyMod.OnCreateGameBoyCassette, -- assign a random mediaId and change the sprite in that function
}
-- Shared file containing all items data
GameBoyGames = GameBoyGames or {};
GameBoyGames["MarioWorld"] = {
  title = "Mario World",
  year = 1992,
  boredomModifier = 2,
}
-- server/MyModRecipes.lua
MyMod = MyMod or {};
function MyMod.OnCreateGameBoyCassette(item)
  local allIds = {};
  for k, v in pairs(GameBoyGames) do
    table.insert(allIds, k);
  end
  local randomGameIndex = ZombRand(1, #allIds);
  local gameData = GameBoyGames[allIds[randomGameIndex]);
  item:getModData().mediaId = allIds[randomGameIndex];
  item:setName(gameData.title);
  return item;
end
function insertGameBoyMedia(gameBoyPlayerItem, gameBoyMediaItem)
  local gameBoyPlayerModData = gameBoyPlayerItem:getModData();
  if gameBoyPlayerModData.currentMedia then
    print("gameboy player already have a media inside")
    return;    
  end
  if gameBoyMediaItem:hasTag("GameBoyMedia") then
    local gameBoyMediaModData = gameBoyMediaItem:getModData();
    gameBoyPlayerModData.currentMedia = {
      mediaId = gameBoyMediaModData.mediaId
    };
    return true;
  end
end
function ejectGameBoyMedia(gameBoyPlayerItem, inventory)
  local gameBoyPlayerModData = gameBoyPlayerItem:getModData();
  if gameBoyPlayerModData.currentMedia then
    local item = inventory:AddItem("GameBoyCassette");
    item:getModData().mediaId = gameBoyPlayerModData.currentMedia.mediaId;
    local gameData = GameBoyGames[item:getModData().mediaId]; -- get that shared game data
    -- do more stuff to reasign item name, icon etc
    return item;
  end
end
thin hornet
#

Also i hope i see a gameboy mod soon lol

#

if i recall gameboy was huge in 1989+

viral flame
#

Someone made a Lua GB emulator over on Roblox

#

I see no reason (other than you know, setting your computer on fire) it couldn't be ported to kalua

#

The better you are at GB missle commander, the more stress it reduces ๐Ÿคฃ

alpine scroll
#

Cant wait for the printer

undone crag
#

I wonder if a yarr me hearties zomboid copy of that roblox lua would have to be on a russian game mod site because steam workshop would respect copyright.

dapper pine
sour island
#

It would just dump it into your inventory with the default behavior. Do you use SwapIt?

#

I haven't tested it out...

sour island
#

Added something else to it

#
So far:
Hotbar radial menu (holding down the hotbar keys).
Vehicle mechanics window for engine parts/wrenches.

Overwritten Functions:
ISHotbar.onKeyKeepPressed
ISVehicleMechanics:doPartContextMenu
ISVehicleMechanics:doMenuTooltip
dapper pine
#

awesome! thanks for making it, i really couldnt have done it myself

#

love that steam allows us to easily view mod content too, makes it alot better experience to try and figure out how mods work

sour island
#

Normally I wouldn't overwrite functions this way but I don't know of any other way to change the internal behavior of the functions

#

the mod only changes like 1 line per function

viral flame
#

But it would be absurdly hard to get anything playable working ever

#

Lol

sour island
#

I have been denied

#

Time to dig into timed actions again

#

Why does the car lose all velocity when I get out ๐Ÿ˜ฆ

drifting ore
#

RBLX

#

A dude made an accurate flight simulator

#

It uses real world topographic data to generate a 1:1 scale America

#

And dynamically load it

#

And it has real flight models

#

Like raypoint calculations for the aerodynamic forces on a specific point of the wing

#

So your plane can suffer wingpoint stalls accurate to the real world handling of a 178 Cessna

#

Its pretty performance efficient too

#

But yeah you can't actually port Roblox scripts to Kalua

#

Without extensive modification

#

Roblic uses a propriety language

#

Called LuaU

#

And it has like entirely different interpolation variables to normal Lua

gilded crescent
#

does anyone know how to make a vehicle trunk accessible from the interior, like KI5's M998 HMMWV?

#

im just starting to learn lua so im not sure where to even start

viral flame
tacit briar
wooden falcon
# thin hornet try using your own module name with ``` module MyMod { imports { Base }...

Once I unsubscribed from my mod on the workshop, the recipe started working. Which is really odd. It was a single player world and any changes that I make to the local copy (Users/*/Zomboid/Workshop/ rather than steamapps\workshop\content\108600) of my mod get seen. Maybe my single player world somehow took on the workshop version of the mod. Or maybe recipes go with the workshop version for some reason. But as soon as I unsubscribed from my own mod on the workshop then restarted the game, my recipes were available.

thin hornet
gilded crescent
static oyster
#

does anyone here knows how to change the the zombieLore for only one type of zombie?

#

lets say I spawned a skeleton, I know theres a boolean to verify if its a skeleton, is there a way to only give a skeletal zombie specific settings separated from the others?

#

even if I try to getSandboxOptions():set("ZombieLore.Toughness",1) and what not inside the boolean, every zombie is changed

#

only the zombie:setHealth actually works

drifting ore
#

IE Player handler, LocalPlayer, Click detection in engine

#

Part specific definitions

viral flame
#

right, but I guarantee the core of the emulator is done in lua tables

drifting ore
#

Would be easier to just make it from scratch in Kalua

viral flame
#

the display and input could not be reused

#

the emulation engine could

drifting ore
#

Pretty sure Ik what you're talking about and its just pulling from a public GB emulation table

viral flame
#

like _G you mean?

easy enough to change how thats done

brave cloak
#

guys, how do I mod another mod? I'm making a file that fixes a recipe from another mod, but I don't know how to do it properly

cinder nebula
#

Hi all. Is there a way to add more music to the game?

brave cloak
cinder nebula
brave cloak
#

Ah, I see

#

Haven't watched it, though

azure rivet
#

Hello, I found a line of code that is:
player:setAuthorizeShoveStomp(false);
I would like to know if there is a similar one that only affects the Shove or the Stomp?
Try something similar to:
player:setAuthorizeShove(false);
And it gives me errors.

wooden falcon
#

What is the deal with require statements? Specifically, what is the "starting path" for them? And can I require a file from my clients or shared directory if I'm currently in a file within the server directory? (If yes, how?) Thanks.

quasi geode
# wooden falcon What is the deal with `require` statements? Specifically, what is the "starting ...

require syntax is basically without the lua/shared/ (or client / server) prefix on the path. as a general example, assuming your file is in lua/shared/MyFolder/MyFile.lua and you were calling the require from lua/client/ then you would use:

require "MyFolder/MyFile"

or

local MyFile = require("MyFolder/MyFile")

depending on if the file returns a value/table

for requiring files in different shared/client/server structure, its best to understand how the folders are loaded...first shared is loaded, then client files, and lastly server.
stuff in shared shouldnt require stuff in client. (not sure if its possible, doubt it)
stuff in shared or client can not require stuff in server (not possible, server folder doesnt exist on lua path at this point)
stuff in server shouldnt require stuff in client (this will fail in mp, servers dont load client files last i checked)
both client and server can freely require stuff in shared

#

side note: the first version of that require require "MyFolder/MyFile" is generally only useful to ensure a file gets loaded first, using this particular syntax to require a file in shared from client or server is basically redundant (since the file has already been loaded)

wooden falcon
lucid spindle
#

Just wondering about createZombie(), spawnHorde(), createHordeInAreaTo(), createHordeFromTo(), etc.
Do these have a chance of creating the "special" zombies we sometimes see in an area? Like BaseballFan, Bandit, etc? Or can we only spawn them using addZombiesInOutfit() or similar??

copper pumice
#

how do I make something give you the pain thing in your head when you eat it

dawn shuttle
#

Where do you get the world position of every players in a server?

tacit briar
#

how does the getDay() function work in GameTime? Does it tick up at the start of day at 00:00 or?

copper pumice
#

whenevr i put my mod in my mod folder and load up my game and enable the mod it does this

shadow geyser
wooden falcon
#

When I craft my item with materials that have low condition, my crafted item stats with low condition. Is it possible to specify that the crafted item should be full condition no matter what?

copper pumice
#

how would I make it so if I were to right click on the ground, it would give me an option to do something, then when I did that thing I would recieve an item in my inventory

#

like when you dig furrows and it gives you worms sometimes

drifting ore
#

hi guys

thin hornet
thin hornet
tranquil reef
#

Is there a way to make moving items or something lol

copper pumice
#

Is there a way I can make that context menu appear only on certain tiles

thin hornet
# copper pumice Is there a way I can make that context menu appear only on certain tiles

using Events.OnFillWorldObjectContextMenu you will get a couple parameters

local function onFillWorldContext(player, context, worldobjects, test)
  --- context: is used to added menu item to the context menu
  --- worldobjects: is the world objects selected on that click
  --- player: is the player number
  local playerObj = getSpecificPlayer(player);
end
Events.OnFillWorldObjectContextMenu.Add(onFillWorldContext);
wooden falcon
#

How do you check which item is select when in a Events.OnFillInventoryObjectContextMenu function? Does it get passed in as a paramter or something?

thin hornet
copper pumice
thin hornet
#

check at the vanilla functions to learn how to use it, OnFillInventoryObjectContextMenu is special

wooden falcon
thin hornet
#

search the game code

wooden falcon
#

ah okay ya i usually use the lua to find examples, but you dont get the function signatures for events

thin hornet
#

When i answer you guys here, im technically just doing quick search in the game code lol I dont know all that by heart

wooden falcon
#

you have the java disassembled as well, right?

thin hornet
#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua

#

i do yeah

wooden falcon
#

is it helpful?

thin hornet
#

for more deep research

wooden falcon
#

or are all the variable names just like var1 var2 etc

thin hornet
#

it is yeah it show alot of the inner stuff that usually cant be found in the lua

wooden falcon
#

do the java methods show actual names for the parameters?

copper pumice
#

also my item doesnt have an icon

thin hornet
#

variable name var1 is not that much of a problem, the logic is the most important

copper pumice
#

i have tried loads of different things

#

but it just keeps using a question mark as the icon

thin hornet
#

as long as we can see the var1 type etc and function names we can get to understand

wooden falcon
thin hornet
#

all methods and variables are named, just the param are not

copper pumice
#

do i need to put Item_ before the sandblur on the icon section?

#

because thats what it is in game rn

thin hornet
#

not too hard to understand what does what in that code

thin hornet
copper pumice
#

how can I make a custom worldstaticmodel

copper pumice
thin hornet
#

well this seem right

wooden falcon
thin hornet
#

Setup CAPSID > 4) Run Setup Workspace config
is the last step for the decompilation part

the rest of the tuto is for setting up and using intelliJ for making mods

copper pumice
#

how would I make it so my character gets pain in the head after eating the sand

thin hornet
copper pumice
#

Where would I put this code? I am quite new to most of this lol

tight blade
copper pumice
thin hornet
tight blade
thin hornet
#

Its not possible like vanilla does it

#

But there is a hackish way of doing it i think

#

would be nice to have some more modding capabilities on the moodles

tight blade
#

Gonna say, I know defecation has like a way of doing it, but like I'm not trying to add a new mechanic like that, just more "expand" with new moodles both positive and negative.

Otherwise, I'll have to see. Since only like maybe 3 mods at most that come close to "moodle" stuff that isn't a retexture.

And I agree, would be nice for more modding capabilities for moodles, but gotta take what we can I suppose. ^^

thin elm
#

Just wanted to come in here for a bit of clarification before I dig into a project Iโ€™ve been thinking of.

Iโ€™m pretty sure many people, if youโ€™ve played multiplayer, know how annoying PVP is with the stunning and somewhat unfair and random gunplay. Would there be a possibility to change and or modify these effects. If someone has tried to dabble in these, I wouldnโ€™t mind having a chat. Or if it already exists, send a workshop link. ๐Ÿ–ค

frosty falcon
#

best way to reload and test your mod lua is to just quit and reload the save right?
guess I better have it on an ssd

jaunty marten
#

how to get name of sprite of object?

-- first file
local obj = IsoObject.new(square, "sprite.png")
-- another file
obj:getSprite()...?
obj:getSprite():getName() -- doesn't work. returns nil
#

:getSpriteName() doesn't work correctly :(

#

@thin hornet maybe u know (u seems genius in pz java roflanEbalo) but there's chance for IsoObject:getSpriteName() returns cached value and not just gets sprite and after return name of this sprite?

thin hornet
#

hum

#

let me check

#
local sprite = isoObject:getSprite();
if sprite then
  local objectSpriteName = sprite:getName();
end
#

thats how i do it

#

now depend what object you are trying to grab the sprite name

#

maybe it doesnt have a sprite?

jaunty marten
#

my problem is:
isoObject:getSprite():getName() - returns nil
isoObject:getSpriteName() - returns incorrect sprite (sprite render 1 sprite but from this func I got prev set sprite)
isoObject:getModData()["blablabla"] - returns correct sprite
rofl is I set sprite and save it into mod data literally in same time so there have to be same values but :getSpriteName() fked up

thin hornet
#

you create the object ok i see

#

i used to have problem with this, is it from a custom tile pack

jaunty marten
#

currently to solve this problem I saves sprite names in moddata
but for what this info in moddata xp

thin hornet
#

when you reload the save game

#

does the object stay

#

using F2 you can still the sprite info?

jaunty marten
#

after reload it's fine

#

seems :getSpriteName() returns incorrect value after I set sprite a few times in one tick

thin hornet
#

hum why you set the sprite multiple time in a single tick?

jaunty marten
#

exactly 1 or 2 times in one tick to be correct
creating pipes system with automatic-connect ones so neighboring pipes of cross one of main pipe calcs twice to have correct value

jaunty marten
thin hornet
#

neat

#

this will let moving water from A to B?

jaunty marten
#

original idea was auto-irrigation with feature to add fertilizer in barrel to almost fully-automatise farm
but now I have really much ideas for it

polar jetty
#

Does anyone have a mod or know a mod that lets me use blind zombies? I don't know how to create custom mods, I have no programming experience or I would do it myself.

polar jetty
#

Me and a friend are doing a clicker playthrough, clicker sounds and faces.
Just want them blind to fit the experience

#

Or atleast, like blind enough where they can still track you, but not see you from a room away unless you make noise

jaunty marten
#

I have another idea to create wires system to generator works not in range but by wires but I'm not sure if it useful mod
but maybe if create feature to add custom lights/switches in built houses then it can have some impact

livid cave
#

Sorry bud, cant help much on this one.

static oyster
#

Does anyone know how to give one type of zombie a different speed?
I was able to randomly spawn a skeletons instead of making all of the zombies skeletons, i was able to set it's health to very high while every other zombie HP is default, but I'm not able to set it's speed, whenever I do, every zombie in the game has the same speed

#

I know it might be possible since the game has the random feature for speed but somehow a boolean doesn't work

#

Well the boolean does work but the speed just changes for everyone still

#

I'm using getSandboxOptions():set("ZombieLore.Speed",1) .. i don't know which type of codes are there but i tried zombie:setSpeed, zombie:changeSpeed, these just give errors

frosty falcon
static oyster
#

I think i tried it by looking at another mod, let me see

#

There's a speedType, so I wonder if zombie:speedType(number) idk will see once I'm on my computer

frosty falcon
#

it probably relates to shambler, fast shambler, sprinter, etc

#

if you want those, that will probably work

#

speedmod is a float

#

so 0.1 for 10%

#

I guess

static oyster
#

Yeah I just want to make these specific zombies to a specific speed with a specific health. Trying to make a new type of zombie, not really a special zombie but a new type, and since I know no other way to load a custom model I'm gonna replace the skeleton 3d model with something else too.. as along as speed is finally edited to only them

polar jetty
#

Is it possible someone could make a mod, or point me in the right direction to make a mod for zombies to be completely blind, or have enough site to be like a clicker from TLOU?
I have no programming knowledge, and everything I read literally looks like 20 different languages mixed into one for me

little condor
#

there's any object streamer settings?

#

like stream distance, amount etc

reef rose
#

hey ๐Ÿ™‚ maybe here it is the location: it seems, that the game tilts every single texture/tile by a very small degree. a very slightly turn in the angle of the whole grid.
the game itself isn't accurate isometric. its grid is off a little.

#

in the editor it is perfectly lined up.

#

ingame, every single texture, floor, walls, etc.. is slightly tilted and overlaps

#

floor tiles even enlarge itself 1 row of pixels to N and W

#

anybody know why that's the case? a game engine thing, which can't be changed?

#

f.e i have to redraw all pavement tiles seen in pic2 on the right. i must darken the E and S row of pixels, because ingame those get overdrawn from the adjacent tiles and don't show.

fallen inlet
#

i dont know if this is supposed to happen or what

#

i have both brita weapon pack and arsenal26 activated but i can only seem to find guns from arsenal26 and barely any ammo for the guns i do find

#

pls help if anyone knows if this is supposed to happen or just a problem

static oyster
polar jetty
#

poor sight i still get spotted from across the road

static oyster
#

Sadly have no clue but I'm sure it should be possible

frosty falcon
#

I'm not sure if it even is...

#

CDDA zombies has
"Listener Z - Speed: Normal HP: Normal (Poor sight but sensitive ears)"
but it doesn't actually change the sight, it just enhances hearing

do you know any other mods that change zombies sight?

#

I can't see anything in javadoc for it

polar jetty
#

i mean there's 3 sight/sound values so it'd probably be possible to make another

static oyster
#

I think you would need to check something related to zombie to player distance detection

#

and hope that the distance detection is not the same for hearing and sight

frosty falcon
#

how are you going to override what the game does by default though

frosty falcon
#

you could make another, but I don't know how you'd make the game use it

polar jetty
#

and im not smart enough for that

#

im kinda surprised there's no option to make them completely blind though

frosty falcon
#

in IsoZombie:spotted(isomovingobject, boolean)
line 1572

the sandbox sight references

sour island
#

I'm fairly certain if the zombies were to be 100% blind they wouldn't be able to attack (code-wise)

#

You could tie into zombieUpdate() and forcibly erase their spotted object

#

Super Weird Helis does something similar - except it forces the closet player within the cell to be spotted instead

#

You'd have to figure out some heavy workarounds for this to work

#

If you can track how loud a player is you can use OnPlayerUpdate() to add them/remove them from a list of possible targets

#

and use OnZombieUpdate() to validate the target

#

I think that's how the Zombie Camo mod works

#

This so so satisfying lol

#

I need to figure out why the car loses so much more momentum tho

frosty falcon
#

is that the braking speed when you get out?

#

is it initiating the brakes?

sour island
#

most likely yes

#

current reading through the java to see where it triggers it

#

might be able to apply a force equal to what's being lost so it rolls as expected

thin hornet
#

like when he tripped over a fence and fall

sour island
#

Will be looking into that next

#

I'm thinking of copying the logic for fence hopping to begin with as a % to fall

#

or for a more simple approach - each level of nimble = 1mph, if your nimble is higher than the speed than you don't fall

#

and leave it at that

#

also need to change exiting while moving to require helddown

thin hornet
#

yeah if the car is not going too fast should be good

#

thats a dope idea bro

#

๐Ÿ˜„

#

its gonna feel like Project GTA

sour island
#

if it doesn't pan out I'm just leaving it at <= 3 mph

willow estuary
#

Here's some information about new Distribution features and such in these notes regarding build .72 unstable.
This will be temporarily pinned.

sour island
#

alternatively I could try setting it as being towed by something

#

or swap in a ghost driver

#

but I think that may cause more problems lol

thin hornet
#

lol

#

so you talking about the car keeping moving forward?

sour island
#

yeah, if there's no driver, isn't being towed or towing anything it's physics drops off after 3500 miliseconds

#

also don't see a way to force impulse

#

You have to be going max speed to get the same distance as just letting off the brake

split cipher
#

Has anyone made a mod for the van for Dumb and Dumber? pretty sure that film came out around 93/94

sour island
copper pumice
#

what dimensions should my textures be

#

for an item

#

how do I give my item a custom description

#

like how lemon grass has "soothes the bouts of food poisoning"

copper pumice
#

those are for 3d models

#

but it doesnt matter now anyway I have fixed it

drifting stump
#

there are other types of fall you can do

#

this is how i did it for slippery snow

sour island
#
local function stumble(player, speedKmHour)
    local nimbleLvl = player:getPerkLevel(Perks.Nimble)
    local speed = math.abs(speedKmHour)
    player:clearVariable("BumpFallType")
    player:setBumpType("stagger")
    player:setBumpDone(false)
    player:setBumpFall(nimbleLvl < speed)
    player:setBumpFallType("pushedBehind")
end
```Great minds
#

same method I did for EHE

keen cape
#

Is it possible to mod vehicles to lose items from the trunk because a person forgot to close the trunk of a vehicle?

brazen grove
#

Hey all, I've never put custom zombies in the game before but I'm following Peaches guide and when defining the zombie he has:

    <m_items> <!-- White Zed Skin -->
        <itemGUID>9c87b588-b784-4560-bada-fd4cf7e44d48</itemGUID>
    </m_items>    

I was wondering, where do you find the GUID's for the different types of zombies? I know where to find clothes, items etc but I'm having no luck identifying where to find the zombies skin GUID

sour island
#

The skin is a clothing item if I'm not wrong

brazen grove
#

hmmm I'm having no luck finding where they are defined in clothes. I'll have another look

dry stone
#

Hey guys. Are there any guides for making a custom weapon and getting it into the game? I know my way around in Blender already.

spare burrow
# dry stone Hey guys. Are there any guides for making a custom weapon and getting it into t...

I think here you have all you need https://www.youtube.com/watch?v=2M2fWLBLaX8

0:00 Intro
0:29 Video Start
1:00 Start Blender
1:22 Using a background image
2:04 Using photoshop to edit the background image
2:52 Adding the edited background image to blender
3:26 Adding the cube mesh
3:46 Quick start with the cube
4:56 Importing a finished 3d Model from the internet
5:56 Moding the imported model
6:47 ADD NOTE ABOUT MAGAZIN...

โ–ถ Play video
#

Hey people how can i make a script so it gives an item A to all players each X time if they have B item?

dry stone
shadow geyser
spare burrow
#

how would it be? is there an example around i could check?

#

(i'm just not used to zomboid coding, so if there is any example i can reverse engineer to understand would be good >.< )

slim root
#

Is there a QoL mod that helps you loot zombie corpses? Its a bit difficult to check every corpse. I vaguely remember passing by a mod that has that one as one of its features but cant remember the name

#

nevermind...found it

copper pumice
#

i tried making my custom food into a spice but it doesnt work

#

it doesnt let me put it on anything

#

i did spice = TRUE on my item but it dont do nothing

copper pumice
#

because when I get told code and stuff I have no idea where to put that

shadow geyser
#

there is an example mod that shows the structure for the mod folders in the zomboid files

copper pumice
#

ah ok

#

thanks

dawn shuttle
#

Where do you get the world position of every players in a server?

worn sierra
#

CIA-Servers, Washington

#

Joke

brazen grove
#

I'm so ready to give up. I've finally got some custom items of clothing in and working but I've spent the last 4 hours following Peaches guide for getting zombies to spawn in with custom outfits and I cannot get it to work at all.
Has anyone here got any experience with creating custom zombies for map zones?

thorn cipher
# brazen grove I'm so ready to give up. I've finally got some custom items of clothing in and w...

I haven't ever done that, but this video may help? https://youtu.be/bQw6vANZqk0

In this video we go over how to zones so you can spawn specific zombie types in an area.

If you want to support me here is a link to my patreon:
https://www.patreon.com/DaddyDirkieDirk

List of zombietypes as of the 12 of March 2022:
Wedding
TrailerPark
Pharmacist
Bowling
Doctor
Spiffo
Gigamart
PizzaWhirled
Dinner
PileOCrepe
SeaHorse
Restauran...

โ–ถ Play video
brazen grove
thorn cipher
#

Ah ok, sorry not sure I can help. But I hope someone else can ๐Ÿ™‚

ember crane
#

is there a mod to hide the info saying from which mod specific items came?

copper pumice
#

how do i make my custom food into a spice

sour island
viral sierra
#

Any of you know about the mod that adds useless fillers to containers? I really care about something like that because mods like "Ridiculously rare" reduce the number of items in the world by only 75% and someone told me it is limited by the creators of the game, I want something that will make the number of items really minimal, but not zero because exploring the city then makes no sense at all.

I admit that after many hours I would like to play a story where I am almost forced to eat rats and earthworms, but I would like to feel that I am able to find the holy grail in a supermarket or other place ๐Ÿ˜„

sour island
#

Have you played with 6 months later in addition to rare?

#

Most of the food would be rotten

grim rose
#

An improvement to the way in which mod errors are reported. A list of mods has been added to the pause menu, and whenever one is erroring out then itโ€™ll be flagged within the list. This is going in alongside an improved lua error log that shows whether any files reported in call stacks are being overridden by mods. This should help modders and our support teams no end.

sour island
#

any files reported in call stacks are being overridden by mods
No modder should be naming their files exactly as vanilla files to begin with - and for good measure should include the name of their mod in the file name.

#

A more streamlined output would be nice tho

sour island
viral sierra
#

@sour island
Actually, the food on the normal world also rots after a few days, but there are still a lot of cans and other non-perishable food, still too easy ๐Ÿ˜ญ But it's not just about food, I'm playing on a insane amount of zombies and I'm still able to fill the cabinets on my own in about 10 days and be ready for a months of sedentary mode

sour island
#

you've used the 75% less loot mod ontop of very rare settings?

drifting stump
sour island
#

No worries, I'll look harder

fair lion
#

looking for some mods, anyone know of some good mods for new jobs? already got the improved med job but cant find anything else

static oyster
# sour island I'm fairly certain if the zombies were to be 100% blind they wouldn't be able to...

Work around
Reduce the sight to something super small, few centimeters from themselves to almost 0, this way the sound system will do the job, they will always hear something and go to where the source of the sound was.
Then a work around for not attacking the player would be if possible he could detect if the player is crouching, walking or running, depending which one, you can enable and disable the normal sight, mimicking que "follow the sound" and enabling them to attack, then you could also use the zombie memory to the codes advantag, example...
Player is running then zombies detect by sound.
Sight enabled again, zombies follow the player.
Player suddenly crouches, remove sight, lose track of player object, go to where they remember last seeing or hearing the player

#

Something like that

#

Or even using zombie memory alone to achieve the same result.. i assume the "remember last place the player was seen" is a waypoint system

#

You can use the waypoint system to make zombies walk there, then somehow enable their attack behaviour as if the player was there.. this way they would truly be blind attacking the waypoint as if someone was actually there

copper pumice
#

how would I go around making a recipe for something already in the game?

#

i want to make a craft padlocks mod

smoky meadow
#

is there a LUA code for Burst firemod Option for Guns?

static oyster
#

jesus I still could not change speed for a single type of zombie.. if I change it either changes everyones speed or doesnt do anything

copper pumice
#

you know how it says that for carpentry

#

for giving xp

#

what would it be for metalworking

copper pumice
#

i have the format

#

i just want to know how to make it so you have to spend 3 scrap metal

#

and 2 metal sheets on a padlock

cinder nebula
#

Is there a mod that makes it so instead of needing to hold right-click before left-clicking to attack, while aiming with the mouse pointer, we can just left to attack and our character auto-faces/turns to wherever the mouse cursor is? If not, where may we make this suggestion to the devs? Thank you.

heady crystal
#

Anybody know if it's possible to get a vehicle's overall condition in LUA?

copper pumice
#

how can i use custom sounds for recipies

cosmic condor
# copper pumice
module Base
{
    imports
    {
        Base
    }

    recipe Make Padlock
    {
        ScrapMetal = 3,
        SheetMetal = 2,

        Result:Padlock,
        Sound:Padlock,
        Time:100,
        Category:Survivalist,
    }
}
copper pumice
#

thank you so much

keen cape
#

Math can be hard unrelated, just saying, statement

copper pumice
#

you know the time:100 thing? is what does the time go by? is it seconds? minutes?

cosmic condor
copper pumice
#

sweet thank you

thin hornet
copper pumice
#

ah okay

#

is this the correct thing for a combonationpadlock?

#

or is it named by something else

sour island
#

Soon โ„ข

cosmic condor
copper pumice
#

wdym

cosmic condor
#

the combination padlock is your item, right?

copper pumice
#

no

#

i just want people to be able to craft padlocks

#

cus its hard to find em

#

i have made a seperate recipe for combo padlocks

#

but i was wondering if they were just called combinationpadlocks in code

#

like that

#

ok i have explained this confusingly

copper pumice
#

sweet thanks

#

how do I make it so you need a required skill to make it

cosmic condor
copper pumice
#

no no dont worry i was a bit confused lol

#

how do i make the recipies have a seperate category

copper pumice
#

just to know

cosmic condor
copper pumice
#

is blacksmith metalworking?

cosmic condor
#

I have no idea lol
you should try

copper pumice
#

yeah im loading it up rn

cosmic condor
#

learn from the recipe code in ProjectZomboid\media\scripts\recipes.txt

copper pumice
#

oh yeah forgot about that

#

thanks for your help

viral flame
#

this games code base is something to behold sometimes

thin hornet
#

i wish Zombies value 6 would allow for spawning zombies manually.

viral flame
#

this specific code does nothing tho

thin hornet
#

setting zombie pop to 0 prevent zombies completely

copper pumice
#

how do I give a recipie an icon

viral flame
#

literally is just the bottom line, all possible branches get overridden by it

thin hornet
copper pumice
#

actually thing my game is bugging

#

works for one

thin hornet
#

Is your Combination Lock item icon showing correctly when in inventory?

#

when messing with textures sometime restarting the game completely fixes it.

copper pumice
#

yeah ill check

copper pumice
#

i did this

#

but it just lets me craft it with no requirements

thin hornet
#

its MetalWelding

#

as weird is it is

#

SkillRequired:MetalWelding=3,

copper pumice
#

ah okay

#

thank you

copper pumice
#

how do I make it so they will need a propane torch and welder mask to craft it?

acoustic dagger
#

is this channel only for discussing mod creation or can i ask for mod suggestions too

copper pumice
#

or will it auto do it seems as you need the metalworking skill

willow estuary
acoustic dagger
#

ah thank you

copper pumice
#

why wont it let me craft it lol

#

it is being strange

#

once i fix this i can release the mod

#

does any1 know whats wrnog with it

viral spire
#

With mods like the Susceptible Trait, does that mean it's possible to create a fungus mod (The Last of Us) that allows an active fungal infection/spores?

copper pumice
#

does anyone have an idea

#

on why this is being fucky

#

i gotta release this mod in like 10 minutes

#

wait I know why

cosmic condor
#

have you tried clicking DBG: Give ingredients?

jaunty gate
copper pumice
#

thanks

worldly dagger
#

I have been having trouble finding a "easy" to follow/understand/mod-along video/text doc for creating and importing your own models and stats and behavior for unique zombies. I have found that rather lacking in the workshop so I wanted to try my hand and give back to the community. Anyone who could point me in a direction? I have checked the forums and done some googleing but cant say I have found a good place to start.
I also checked the pzwiki but I cant say I found what I was looking for

drifting ore
#

wut

frosty falcon
worldly dagger
shadow geyser
# copper pumice does anyone have an idea

try rereading whatever give that recipe. The recipes are saved on the character, so it can be kinda funky when a existing recipe is modified. usually reading the book that gives the recipe fixes it, but if you get it for free, im not sure how to fix that. but try with a new char

latent orchid
#

Need some help understanding why my item properties are not sticking upon exit and reload. My code is adding an item to the players inventory and then breaks it. But when I reload, the item is no longer broken. Is there a specific step I am missing or is this change not allowed when creating new items on the fly?

    local playerObj = getSpecificPlayer(player)
    local playerInv = playerObj:getInventory()
    local itemName = configInfo.InstalledItem
    local removedItem = playerObj:getInventory():AddItem(itemName)
    if configInfo.IsBrokenItem == true then
        for i = 1,playerInv:getItems():size() do
            local item = playerInv:getItems():get(i-1)
            if item:getFullType() == itemName then
                playerInv:getItems():get(i-1):setBroken(true)
                break
            end
        end
    end

I've tried several ways of editing the item, but all seem to discard the broken flag I set when reloading ๐Ÿ˜ฆ

thin hornet
latent orchid
#

Thanks, that did the trick. So I'm better off setting the condition than the broken flag

sour island
#

Anyone know what file contains controls? Looking for "E" to use vehicles. I found the function for OnUse in Vehicles but it's not called anywhere ๐Ÿค”

#

nvm figured it out - it's called in java

#

hm

#
function VehicleUtils.OnUseVehicle(character, vehicle, pressedNotTapped)
    pressedNotTapped = false;
    if character:getVehicle() == vehicle then
        if pressedNotTapped then
            if vehicle:isDriver(character) and vehicle:isEngineWorking() then
                if vehicle:isEngineRunning() then
                    ISVehicleMenu.onShutOff(character)
                else
                    ISVehicleMenu.onStartEngine(character)
                end
            end
        else
            ISVehicleMenu.onExit(character)
        end
    else
        local part = vehicle:getUseablePart(character)
        if part then
            VehicleUtils.callLua(part:getLuaFunction("use"), vehicle, part, character)
            return
        end
        local seat = vehicle:getBestSeat(character)
        if seat == -1 then return end
        ISVehicleMenu.onEnter(character, vehicle, seat)
    end
end
#

Why is pressedNotTapped set to false?

#

Holding down E to grab the keys/turn off the car would be a nice feature

frosty falcon
#

hmm, with the door closed? would make sense it has to be open first

#

oh you mean inside the car

sour island
#

yes

#

holding down E would also start the car on enter too

frosty falcon
#

hold e to turn off the engine would be nice indeed

#

at the mo its just hitting N iirc?

sour island
#

I just tap W

frosty falcon
#

turn engine off and get out in one

sour island
#

I didn't know that was a thing

frosty falcon
#

that would make me want to hold E

#

yea, good find and ideas

sour island
#

I hate taking the key with me though

frosty falcon
#

I like

#

in MP I always keep it for obvious reasons

sour island
#

tempted to include this in my mod but it's out of scope

#

hm N turns the key if in and off, but pulls out if on

#

kind of wish it was just used for turning

daring zinc
#

Beginner modding question, is it possible to override certain game functions via Lua? (i.e. IsoPlayer::getUsername)

thin hornet
#

what exactly are you trying to achieve?

#
Allow empty bottles to store gasoline```
#

๐Ÿ‘€

daring zinc
#

not sure if there's any particular way to do this other than literally setting their name when they equip a balaclava

#

but that's annoying since you have to save their previous name, etc

sour island
#

You can abuse clientside code for that probably

thin hornet
#

might not hide it for other players tho

daring zinc
thin hornet
#

Yeah well im trying to find a way to display it differently but its all java hardcoded

#

you could use ShowFirstAndLastName and change the forename for the username and set the surname to nothing

#

then you can just change that forename at will

#

also how do you want to display the name in chat if conceal

daring zinc
#

I don't care about the chat

#

more-so just about the name above their head

sour island
#

If you use setusername and make sure it's only on clientside (unless setusername knows to transmit data) this should work

#

also you could turn off usernames can't you?

daring zinc
#

yeah you could turn off usernames but that's not ideal since that changes it for all players

#

I'll have to test the clientside setUsername option though, might be useful

sour island
#

looks like it natievly sends data to the server

#

you could try to replicate the username system instead

#

and just turn off vanilla ones

daring zinc
#

how would I go about doing that?

sour island
#

not sure where the display is handled but you'd basically have to translate the java to lua

thin hornet
#

yeah i cant seem to find where that username is rendered

#

Ah so its in IsoGameCharacter

sour island
#

this is the method (function) in java

daring zinc
#

is this in IsoGameCharacter?

sour island
#

IsoGameCharacter, yes

thin hornet
#

but this doesnt render it

#

its just update its value

sour island
#
   protected void initTextObjects() {
      this.hasInitTextObjects = true;
      if (this instanceof IsoPlayer) {
         this.chatElement.setMaxChatLines(5);
         if (IsoPlayer.getInstance() != null) {
            System.out.println("FirstNAME:" + IsoPlayer.getInstance().username);
         }

         this.isoPlayer = (IsoPlayer)this;
         if (this.isoPlayer.username != null) {
            this.userName = new TextDrawObject();
            this.userName.setAllowAnyImage(true);
            this.userName.setDefaultFont(UIFont.Small);
            this.userName.setDefaultColors(255, 255, 255, 255);
            this.updateUserName();
         }

         if (this.haloNote == null) {
            this.haloNote = new TextDrawObject();
            this.haloNote.setDefaultFont(UIFont.Small);
            this.haloNote.setDefaultColors(0, 255, 0);
            this.haloNote.setDrawBackground(true);
            this.haloNote.setAllowImages(true);
            this.haloNote.setAllowAnyImage(true);
            this.haloNote.setOutlineColors(0.0F, 0.0F, 0.0F, 0.33F);
         }
      }

   }
#

it's just creating a new textdraw object

#

the updating changes it to say what it needs to

thin hornet
#

line 5599

sour island
#

ah there too

#

I think renderlast handles the fact the names disappear sometimes

#

for example mouse over

thin hornet
#

yeah it also render last so it appear over everything else

#

well yeah the only possible way would be to turn off default name rendering

#

and make a UI element to show name over people head but might not be as efficient tho

#

plus you need to calculate the world coordinate to screen position and check if the player is actually visible in line of sigh and also if the cursor is over him or near

sour island
#

you'd have control over it but it would be a wild amount of work

thin hornet
#

would be easier to request a feature on the forum and cross your fingers lol

#

or if you dont need the characters firstname/lastname then you use ShowFirstAndLastName=true and override those forname and surname to what ever you need.

sour island
#

show firstlastname overrides username display?

thin hornet
#

you can have both true and it will show both

#

[Admin] Konijima (Bob Marley)

sour island
#

hm

thin hornet
#

lol

#

Because im working mostly to make a rp server i mostly only use character name everywhere

#

but still use username for identifying in the background cause those first/last name are not uniques

#
--- Using server setting -> ShowFirstAndLastName=true
function ConcealName(player)
  player:getDescriptor():setForename("[Concealed]");
  player:getDescriptor():setSurname("");
end

function UnconcealName(player)
  player:getDescriptor():setForename(player:getUsername());
  player:getDescriptor():setSurname("");
end
#

pretty hackish

willow estuary
thin hornet
#

yeah

#

could even show no name at all if the face is covered

player:getDescriptor():setForename("");
player:getDescriptor():setSurname("");
#

that could actually be a sandbox setting for admin to decide what ever he desire

willow estuary
#

With not displaying a name, I get concerned about players becoming invisible when in vehicles/behind fences? But that's also with the context that I like low-rules PVP MP, so not a universal concern.

sour island
#

anyone use better lockpicking mod before? I assume the v menu has the option to lockpick cars?

daring zinc
#

yeah I think some name should still be displayed ideally

#

just not their actual name

#

question marks/concealed/unknown/etc

#

or at least that was my idea originally

willow estuary
#

Question marks was how I was planning on doing it when we were talking about the same thing for my server a whiles back ๐Ÿ˜„

thin hornet
#

a version where you would want to use the character names

--- Using server setting -> ShowFirstAndLastName=true
function ConcealName(player)
  local modData = player:getModData();
  if not modData.isNameConcealed then
    local descriptor = player:getDescriptor();
    modData.originalNames = {
      first = descriptor:getForename(),
      last = descriptor:getSurname();
    };
    descriptor:setForename("[Concealed]");
    descriptor:setSurname("");
    modData.isNameConcealed = true;
  end
end

function UnconcealName(player)
  local modData = player:getModData();
  if modData.isNameConcealed then
    local descriptor = player:getDescriptor();
    descriptor:setForename(modData.originalNames.first);
    descriptor:setSurname(modData.originalNames.last);
    modData.isNameConcealed = false;
  end
end
daring zinc
#

:getModData() is a thing?! LOL okay this solves so many problems

#

is it persistent?

thin hornet
#

it is yeas

#

its also only visible to that player its non-transmitable

daring zinc
#

Wonderful then

willow estuary
#

This is silly, but it could be fun, where there was an option to disply the name of the mask when a player has their identity obfuscated by one? ie [Clown Mask]

daring zinc
#

Ah, why not

thin hornet
#

yeah thats neat

#

kind of explain why you dont see the name some people could think wtf is going on (is it a bug i dont see its name)

#

now we just need the whole collection of hotline miami masks

sour island
#

Hmmmm... showRadialMenu clears() itself... my mod and another mod overwriting safely are actually clearing in between calls...

willow estuary
#

Or to get even deeper in server-bespoke stuff, faction masks that change the name to something faction-y when wearing the mask, like Raider, or even Raider Officer for specific faction ranks.

thin hornet
#

man that new EmptyPetrol tag feature is a life saver, ill have to update FuelAPI now

#

less hacking

#
Tags = EmptyPetrol,
ReplaceTypes = PetrolSource PetrolPopBottle;WaterSource WaterPopBottle,
#

so clean hehe pretty much what fuel api was doing so i can now go full vanilla instead!!

willow estuary
#

๐Ÿ‘

sour island
#

tags are under utilized

willow estuary
#

Yeah. hopefully ReplaceTypes will make mod liquid stuff more easy all round?

sour island
#

Liquids should eventually become their own object imo

thin hornet
#

is there anything else we can do with ReplaceTypes ?

#

or for now only PetrolSource and WaterSource are valid keywords

willow estuary
#

I think with the vanilla functions you can send, just off the top of my head here, item:getReplaceType(STRING) and it will return whatever item you have defined in the replaceTypes field that matches the string?

#

I didn't make that particular code/parameter; but I think if I have BleachSource SOMETHINGBOTTLE in that parameter + have custom context code that checks for BleachSource it should work?

#

So it should be open season on keywords? Just gotta build the code that uses the new keyword.

thin hornet
#
   public void setReplaceOnUseOn(String var1) {
      this.ReplaceOnUseOn = var1;
   }

   public String getReplaceOnUseOn() {
      return this.ReplaceOnUseOn;
   }

   public String getReplaceOnUseOnString() {
      String var1 = this.getReplaceOnUseOn();
      if (var1.split("-")[0].trim().contains("WaterSource")) {
         var1 = var1.split("-")[1];
         if (!var1.contains(".")) {
            String var10000 = this.getModule();
            var1 = var10000 + "." + var1;
         }
      }

      return var1;
   }

   public String getReplaceTypes() {
      return this.getScriptItem().getReplaceTypes();
   }

   public HashMap getReplaceTypesMap() {
      return this.getScriptItem().getReplaceTypesMap();
   }

   public String getReplaceType(String var1) {
      return this.getScriptItem().getReplaceType(var1);
   }

   public boolean hasReplaceType(String var1) {
      return this.getScriptItem().hasReplaceType(var1);
   }
#

wondering how we handle the replacement tho

#

seems like the bottle of gas has the tag Tags = Petrol,

#

but that tag pretty much used to detect if its a petrol container with petrol inside

willow estuary
#

Tags aren't essential for ReplaceType, but in this instance the code uses the tag to detect a petrol container?
I don't believe ReplaceTypes are hardcoded in any sense.

thin hornet
#
local newType = emptyCan:getReplaceType("PetrolSource") or "Base.PetrolCan"
self.petrolCan = chr:getInventory():AddItem(newType)
#

thats how it work neat!

#

so yeah like you said using getReplaceType we can do alot now

sour island
#

Going to be pushing this out real soon, but any opinions on the new and improved poster?

willow estuary
#

One could also just use getReplaceType to evaluate items, but Tags have better function support in general.

thin hornet
thin hornet
sour island
#

If I did the math right, 100% protection will afford a 90% damage reduction at the cost of the clothes

#

but that will probably still be death over 60mph

thin hornet
#

Just coz i can

sour island
#

Working on lowering the penalty for exiting normally too

#

going to try and allow people to exit while moving safely

thin hornet
#

Could add a sandbox settings dropdown with like 4 options. To choose how much damage its multiplied by (none, low, medium, high)

sour island
#

it already ties in injury severity

#

I meant to look into allow fractures sandbox

#

it's not named the same thing in sandboxvars

#

ty for reminding me

#

Can't actually find bone fractures within sandboxVars

#

hm

#

Takes some getting used to

thin hornet
#

is there someone driving?

willow estuary
#

Although ReplaceOnUse could work for that as well ๐Ÿ˜„

#

Maybe for "clothing lego" where you combine clothing items?

#

Anyways, it definitely has broad potential applicability.

thin hornet
#

Yeah for sure, also maybe something like AlcoholSource, JuiceSource, and stuff for the liquids mainly

#

Real quick i dont get much idea what to do with it but it may come with time

#

For now im very happy that fuel item has been overhauled

sour island
willow estuary
#

Well, really it's just a table of keys and values, so I'm sure imaginative people could think of things with it I never imagined.

thin hornet
sour island
#

yes, it was on cruise at 5mph

thin hornet
#

no way haha

craggy furnace
#

looks like you were late for the bus

thin hornet
#

Gosling go back to the place beyond the pines

craggy furnace
#

i would like to see if i can make some more animations to match gear shifting/driving wheel turning

thin hornet
#

xD

#

maybe a fliiping the bird anim

#

driveby anim

craggy furnace
#

not too sure about shooting animations, i dont like switching between states very much

thin hornet
#

smoking a cig anim

craggy furnace
#

smoking, flipping the bird, and being bored is doable

thin hornet
#

sleeping

craggy furnace
#

yep

thin hornet
#

neat bro neat

craggy furnace
#

yeah, the code is chuck but the anims are mine and the vehicle is cytts

craggy furnace
#

the real work is gonna be twisting back passengers for trucks

#

no idea how i am gonna make that work atm

thin hornet
#

do you think its possible to have multi-interactible anim

#

like two player handshake

craggy furnace
#

yes

#

getting them to do it reliably would be a nightmare

thin hornet
#

thats be dope to add a couple stuff like that, maybe a confirm box to accept the handshake

craggy furnace
#

id do it similiarly how halo CE did it

#

they grabbed the two actors and lined the anims

willow estuary
#

There absolutely needs to be a high 5 emote that provokes a quick time action in the subject that allows them to reciprocate; leave them hanging; or fake them out.

craggy furnace
#

ill be screwing with tag teaming some day when i feel like it

#

id like to grab two players and make them square dance

thin hornet
#

Imagine holding someone on your shoulder

#

carrying

#

but thats an whole different story

craggy furnace
#

something that i know for sure thats doable is players carrying each other

#

lot of work though

thin hornet
#

oh really

craggy furnace
#

yeah

#

i wouldnt be able to do the sync work but yes its doable

#

i dont even wanna think about what carrying another player in MP would be like

thin hornet
#

right

#

well if we can move someone else (to our local client only) then we can just kind of tell player move that one on top of the other one

#

without having to worry about sync

craggy furnace
#

id wager this is something that will come to vanilla eventually

thin hornet
#

so we just say to all clients hey this dude is carrying this dude, so move his character on top of where ever the other is

#

But the vanilla character sync might mess that up

craggy furnace
#

yeah, again i dont even wanna venture down into that as id rather stay in my lane since its such a headache

thin hornet
#

yeah and not that usefull (for now)

#

Maybe something like Blair did with the carry corpse lol generic model for player would look bad tho

craggy furnace
#

it would look awful

thin hornet
#

xD

#

its perfect for corpse but yeah

craggy furnace
#

i applaud the effort but unless you can get a corpse to stay in form i find it a waste

#

its like carrying a mannequin

thin hornet
#

well its carrying a bodybag

#

at least you dont get dirty

craggy furnace
#

i recently revived body bags

#

i pushed them recently too

#

its old stuff from a mod chuck and myself abandoned

thin hornet
#

yo thats dope

#

did you need bodybag in inventory to bag them

#

kind of stuff youd find in a morgue

#

So i supose bagging them also removed the sickness buff from being next to them

craggy furnace
#

the bags are still a WIP

#

just a way to bag them or dead player zombies for later

#

saves the flavor

thin hornet
#

thats not something i would use in a zombie server but in a RP server that would give some depth to the paramedic

craggy furnace
#

yep thats the idea

#

just paramedic loot

sour island
#

they also prevent the sickness you get from exposed dead bodies

copper pumice
#

carpentry is called woodwork in code right?

reef rose
#

the game automatically places street_overlays on the vanilla asphalt tiles and light gravel. if i place floor overlays above those, the cracks are generated, too. when i replace the asphalt with my own, those overlays aren't generated anymore and i can't find the lua, which does that
any ideas?

#

somewhere is a link to those cracks and erosion overlays, which depend on vanilla streets

thin hornet
#

Letsss roll! Literaly

smoky carbon
#

someone should make a gas huffing mod just a suggestion

#

could add some use to gasoline if u don't have a car

tulip valve
#

Drives into a massive horde, tuck and rolls

smoky carbon
#

or roleplay as a junkie i guess

thin hornet
#

roleplay as a roleplayer in pz rp

fiery pecan
#

is there a way to run a snippet of code for a car, and only that car, AND only when it spawns (one time only)?

thin hornet
fiery pecan
#

hmm

thin hornet
#

For getting the car when its loaded in one client Im not sure yet, i dont know if its like other IsoObject.

fiery pecan
#

it's worth a shot?

#

also, I've yet to dabble in ModData.

undone crag
#

Hey how about a mod where you live in attics and travel from roof to roof using a ladder yeah good idea oh no technically impossibru oh ok :<

fiery pecan
#

Aaaand I sounded demanding there. My apologies

undone crag
fiery pecan
smoky carbon
#

just without ladders

versed grail
#

is it possible to look at other mods code? i'm trying to learn some basics and want to see how other mods work

drifting ore
#

hi i want to delete this

#
    id = "LongGunOnBack",
    chance = 30,
    outfit = {"SharkBlackSWAT","SharkBlackSWATRiot","SharkBlackSWATBelt,","SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
    weaponLocation =  {"Rifle On Back"},
    bloodLocations = nil,
    addHoles = false,
    daySurvived = 0,
    weapons = {
        "Base.AssaultRifle",
        "Base.AssaultRifle2",
        "Base.Shotgun",
    },
}```
#

the weapons table

#

can i just do this?

#
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,2); 
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1);```
#

it seems tow rok

jaunty marten
willow estuary
random finch
#

I am attempting to add clothing that makes a character model invisible. I've been experimenting, but can someone please lead me in the right direction?

austere pecan
versed grail
jaunty marten
jaunty marten
#

I need it

halcyon marlin
#

what is the best way to search on the project zomboid modding API (https://projectzomboid.com/modding/). I specifically am looking for a method that can check if a body is a human body instead of a zombie body.

tacit briar
#

How does the code go about changing day when midnight hits? Im using another function in EveryDays event and the days dont progress anymore, I've tried doing zombie.GameTime:setDay((zombie.GameTime:getDay() + 1)); which I know is wrong but not sure how to do it right

halcyon marlin
jaunty marten
drifting ore
#

i want to specifically remove the weapons part

#

not delete the whole table