#mod_development

1 messages · Page 344 of 1

small topaz
#

This could make any mod requiring the function incompatible with your mod and result in game breaking errors!

instead of overwriting, please try using this construction:

function Vanilla.Function(a,b,c,...)

   -- insert new code here  

   vanilla_function(a,b,c,...) -- execute the UNMODIFIED vanilla function

   -- inster new code here...
end```

Other modders will be thankful if you are doing this because mod users will then report less incompatibilities.
bright fog
#

Exactly

#

Just hook to it

#

Also make sure to return the vanilla function into the override return

#

Like in new here it's important

#

Since you return the original instance created

bronze yoke
#

we don't know what his override does

#

overrides are not unambiguously bad

bright fog
#

They do nuke other hooks out of existence that were created before however

#

Especially on a new function of a timed action which I'd say has more chances of being hooked to by modders

bronze yoke
#

decorating functions doesn't actually guarantee compatibility with other mods and overrides are often the only way to do certain things

bright fog
#

Of course

#

But on a new function I highly doubt you have to override anything

#

If you need to modify a key field of the instance, you can hook to it and modify it after ...

small topaz
bright fog
#

It's not like new functions called other weird stuff, they usually just check entry parameters and set different values on the instance itself

small topaz
#

just imaging that every modder will radically overwrite vanilla functions (and not just decorating). would be almost impossible then to play the game with more than a few mods.

bronze yoke
#

i'm just saying that when an override seems necessary, it probably is

bright fog
#

Of course, but imo it needs to be the last option to use

bronze yoke
#

you can go to a lot of work to reverse certain effects of a function to technically use a decoration but in the end it's a waste of time because all of that is still dependent on the original function not changing

queen oasis
#
-- vanilla code ISEquipWeaponAction:complete()
if self.character:isEquippedClothing(self.item) then
  self.character:removeWornItem(self.item)
  triggerEvent("OnClothingUpdated", self.character)
end    
forceDropHeavyItems(self.character)

-- my override
if self.character:isEquippedClothing(self.item) then
  self.character:removeWornItem(self.item, false)
  triggerEvent("OnClothingUpdated", self.character)
end
forceDropHeavyItems(self.character)
#

not sure how else I would accomplish that without more f-ery

bronze yoke
#

depending on what the original function actually looks like, you can decorate removeWornItem instead

small topaz
#

and even two mods overwriting the same function will not work together anymore. but if they only decorate, chances are decent that everything works. that is also the reason why in B41 times (and pbbly also now), people were able to play with 50+ mod lists without breaking the game

slim swan
#

My only mod that overrides the entire file is cleanUI mod, because it seems there’s no other way.

bright fog
queen oasis
#

I think I tried to decorate but it's been awhile. maybe I'll try again when I'm done playing with planks and logs

bronze yoke
#

you guys are really misunderstanding me, i'm not saying 'override every function all of the time' 😭

bright fog
#

We're not misunderstanding you 😅

queen oasis
#

nah I think it's me 🙂

bronze yoke
#

this pattern can be useful for injecting into the middle of a function without overriding it:```lua
local old_foo = foo
function foo()
local old_bar = bar
bar = new_bar

-- bar is decorated only while foo is running
foo()

bar = old_bar

end

#

but this won't help is if there isn't a function near where you want to inject, or the function is too generic, or you need to write to locals

bright fog
#

Hmm in this case you can do it if the method you decorate isn't called multiple times I suppose

bronze yoke
#

yet another reason to hate recursion

small topaz
small topaz
queen oasis
# small topaz don't know the exact context of your code but I'd bet there is a solution witho...
local OG_ISInventoryTransferAction_new = ISInventoryTransferAction.new

function ISInventoryTransferAction:new(character, item, srcContainer, destContainer, time)

  local f = OG_ISInventoryTransferAction_new(self, character, item, srcContainer, destContainer, time)
      
  local function getOverrideType(container)
    return JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[container:getType()]
  end
  
  local overrideType = getOverrideType(destContainer) or getOverrideType(srcContainer)
  if not overrideType or f.maxTime <= 1 then
    return f
  end
  -- change transfer times based on a table lookup and stupid math --
queen oasis
#

it was a stop-gap anyway until I could think of a better solution to the long ass transfer times when you have 5000 things in your backpack (and keep the feel somewhat vanilla)

queen oasis
small topaz
#

but doesn't the bool only tells the vanilla game that it shoud remove items from the player inventory and drop them to ground?

queen oasis
#

I'm pretty sure I can get in to removeWornItem and handle it from there

small topaz
#

you could then manually do this in your OnClothingUdated function. whatever removeWornItem(item) does, undo it in OnClothingUdated. Then manually redo it by using removeWornItem(item, false)

but yeah... there are probably lots of other ways doing this. also ways without using the ClothingUpdate event

young trellis
#
local ALL_TRAIT_IDS  = { "Faithful", "LRRP_Faithful", "lrrp_faithful" } 
local ICON_KEY       = "trait_lrrp_faithful" 
local REQUIRE_TRAIT  = true

Can anyone tell me why I can't see my icon in game, no capitalization errors, its all spelled correctly the picture is in both my common and 42 folders in an 18x18 icon size I have other traits that all work but this one just doesn't get it

true nova
small topaz
#

I just started in this house by manually teleporting to the position.

Is this due to the new B42 randomly looted houses mechanics?

bright fog
#

Sounds like it ?

young trellis
small topaz
#

Is there a known command in the java api to suppress a house from being looted? smth like building:setHasBeenLooted(false)? W

What I can find so far for BuildingDef is setAllExplored(boolean b) and setHasBeenVisited(boolean _hasBeenVisited) but I have no idea what those commands are doing and it is a little hard to find out due to the game's randomness.

bright fog
queen oasis
#

ok, tried the foo() bar = newbar() return foo and I can't get it to not throw an attempted index of non-table on the last line where I set removeWornItem back to the OG. I'm sure it's simple but man I can't see it right now

local OG_ISEquipWeaponAction_complete = ISEquipWeaponAction.complete
function ISEquipWeaponAction:complete()
    local chr = self.character
    local OG_removeWornItem = chr.removeWornItem

    if JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[self.item:getType()] then
        chr.removeWornItem = function(item)
            print("overriding removeWornItems")
            return OG_removeWornItem(item, false)
        end -- errors here if CONTAINERS_TO_OVERRIDE
    end

    OG_ISEquipWeaponAction_complete(self) -- error here if not CONTAINERS_TO_OVERRIDE
    chr.removeWornItem = OG_removeWornItem
end```
true nova
#

it errors if it does nothing? weird

queen oasis
#

if I print both OG_removeWornItem and chr.removeWornItem, they are both functions with the same ... whatever the 0x209... id is called

#

and taking out the "if" gives the same result, attempted index of non-table

#

idk if it's because it's a java function. this all works correctly in my head though

bronze yoke
#

you can't assign functions to a java object

#

userdata often looks like a table but it isn't a table

#

you change the metatable instead, which affects all instances```lua
local IsoPlayer = __classmetatables[IsoPlayer.class].__index

local OG_ISEquipWeaponAction_complete = ISEquipWeaponAction.complete
function ISEquipWeaponAction:complete()
local chr = self.character
local OG_removeWornItem = IsoPlayer.removeWornItem

if JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[self.item:getType()] then
    IsoPlayer.removeWornItem = function(self, item)
        print("overriding removeWornItems")
        return OG_removeWornItem(self, item, false)
    end -- errors here if CONTAINERS_TO_OVERRIDE
end

OG_ISEquipWeaponAction_complete(self) -- error here if not CONTAINERS_TO_OVERRIDE
IsoPlayer.removeWornItem = OG_removeWornItem

end

queen oasis
#

kk, that was my next stop but I hoping to avoid it

humble stratus
bronze yoke
#

does getScriptManager():getAllBuildableRecipes() not work?

humble stratus
#

it wasnt suggested with umbrellas typings but ill try

#

damn, you're right I guess i didn't catch that function because it wasn't suggested

bronze yoke
#

are you using the unstable version of umbrella?

humble stratus
#

yesss

bronze yoke
#

that's strange, oh well

humble stratus
#

yeah its not in there for some reason

#

but yeah thanks for the shortcut haha ^^

bronze yoke
#

ahh, it was added in 42.11.0

#

i didn't bother pushing an update for 42.11 since it didn't make many changes and the tools were a little broken at that time

humble stratus
#

i tried to include the games lua folder to my vs code to get full autocorrect but the lua addon wouldnt stop mass diagnosing all files lol

undone elbow
#

I didn't know that load order of lua files is different in Windows and Linux...

bright fog
true nova
#

<@&671452400221159444>

gaunt marlin
#

Is there a mod that lets you control a gate from inside the car, i.e. open and close it, for Build 42?

true nova
bright fog
#

B42 actually not sure

#

But there is a mod that exists tho I don't remember the version of it

gaunt marlin
small topaz
#

For the other modders here in the channel: do you ever use the new B42 "incompatible mods" feature in the mod.info file, listing mods not written by you?

#

I've not yet seen a lot of example where this is done. Would you recommend using it?

bronze yoke
#

i've never used it - i've heard from others that a lot of these new mod features don't really work very well

small topaz
#

Yes. The incompatibility feature is somewhat buggy . The listed mods are clickable and when you click on them, game throws the red error box (although none of the mods need to be active, so it seems to be a vanilla issue). Apart from that, this specific feature seems to work quite well...

storm thunder
#

Player spawns specifically. I am very late to reply, but had a few things come up.

#

thats very useful info. ty!

bright fog
#

They basically didn't test it ......

cosmic pond
#

Hello, I'm new to PZ modding and I wanted to make a mod that allows me to craft gravel bags and sand bags. Even though my mod shows up in game and all that but the actual recipe does not show up in game. Can anyone help me? I would be very greatful ! spiffo

mellow frigate
bright fog
bright fog
bronze yoke
#

it cannot

drifting ore
#

<@&671452400221159444>

past radish
#

MODSS

drifting ore
#

Maybe it’s real

#

Just this one time

bronze yoke
#

the moderators are trying to keep us poor and dependent on pz

#

mr beast will save us

queen oasis
#

made the 3 sizes of logs a little stubbier so it's a better scale but I think I like the longer versions better. now off to learn uv texturing in blender I guess

queen oasis
#

well, I suck at this

#

may be better, and may be as good as it gets with a 128x128 texture

#

I suppose I can give in to the voices in my head and make different logs depending on which tree you chopped down...

true nova
#

is each size worth a different amount of planks?

queen oasis
willow tulip
#

Log! it rolls down stairs, rolls down in pairs, rolls over your neighbors dog, its log, its log, its big its heavy its wood.

#

Neat mod btw. natural things always look better when they are not all identical

small topaz
#

I constantly have the same problem when I am modding 😅

shy mantle
#

That's why I chose to make a mod where feature creep is the goal. Can a car spawn there? It can now...

subtle cypress
#

(build 41) whats the proper way to use getWorldStaticModel, and getCanHaveHoles? my debug logs always come up saying not found but 51 other properties were found just fine using the get commands

bronze yoke
#

getWorldStaticModel was added in b42

#

getCanHaveHoles only exists for clothing items

subtle cypress
#

lying ass wiki

#

thanks

#

wait so what do you do for accessories with getcanhaveholes, such as this one

bronze yoke
#

the worldstaticmodel exists, there just isn't a getter for it

subtle cypress
bronze yoke
#

don't remember, i don't mod b41 anymore

subtle cypress
#

fair enough

cosmic pond
grim path
#

looking at modding is interesting, since i've got ideas, but... i really don't know how on earth to do it

#

i'm so ass at coding

#

the only thing i want is a throwable spear

bright fog
bright fog
#

Also you're editing those on Note pad ?

#

I highly advise you use a more adapted code editor

cosmic pond
#

I usually use notepad, notepad++ or visual studio code

bright fog
#

They are defined with a timed action script

cosmic pond
#

they aren't? huh

#

well that's good to know then

bright fog
#

Yea ... it's a confusing part because there are scripts timed actions AND Lua timed actions

cosmic pond
#

oooh

cosmic pond
#

that... makes sense

bright fog
cosmic pond
#

yeah

#

but the most confusing thing was when I had a sack in my inventory and I couldn't craft

bright fog
#

<@&671452400221159444>

cosmic pond
bright fog
#

I see your make sand recipe outputs a gravel bag and uses a sandbag ?

cosmic pond
#

it used the id emptysandbag

#

which is ONE of the ids of the "sack" item

#

I used the Base.EmptySandbag because I thought it was the only id for that item

#

it used to be like that in b41 pretty sure

bright fog
#

But it uses Base.Sandbag, not empty sandbag in your make sand recipe

bright fog
# cosmic pond

Also I didn't knew there were literally multiple sandbag items lol that's cursed as shit

cosmic pond
bright fog
#

Eh

#

Those do the same thing no ?

#

Those are the same item ?

cosmic pond
#

yeah, they are all sacks

bright fog
#

Maybe different texture ? You can have an item with texture variations

bright fog
#

Yea

cosmic pond
#

yeah, I guess I messed it up because it was supposed to be the other way around haha

#

I fixed it today though

bright fog
#

👌

#

If you've figured it out that's good ^v^

cosmic pond
#

thats why there are tags for such things

#

ids I mean

bright fog
cosmic pond
#

maybe

#

game development can be complicated, that's all I can say

#

anyways

#

Thanks for the help and info about the two versions of "timedactions" spiffo

thin swan
#

I can help with some animations for free if you still need them when I have time

queen oasis
queen oasis
molten grail
#

Feature creep is the entirety of my mod. It started simply as a way to convert items of the same name from mod A to mod B (and vice versa)

#

Now, the latest feature I added, was adding treasure maps to zombie drops, with semi-randomized locations and loot

queen oasis
#

judging by the way my game crashes to desktop, I'm going to guess that custom timedAction scripts are a no no (the scripts in timedactions.txt)

bronze yoke
#

nope, you did something wrong i guess

topaz lake
#

I love that there’s a GTA: San Andreas True Music mod with all the radio stations and commercials, but I was wondering if it could be fine tuned in such a way to where each tracklist is on a different frequency?

Ex. K-ROSE could be 92.7, Radio Los Santos 95, WCTR, 88 etc.
Sometimes I only wanna listen to a certain station

#

K-ROSE is my favorite btw! ☺️ started my lifelong love and appreciation for Willie Nelson

bright fog
#

Like other scripts

queen oasis
#

ok, I'll give it another try then. I mean, I'm usually perfect so it must have been vscode fault or something

#

yea, it works. it infers base, so module must be specified in craftRecipe
timedAction = JBLogging.JBSawLogs,

#

I knew that, don't know why I blanked on it

queen oasis
subtle cypress
queen oasis
#

I haven't dug too far in to CraftRecipe, but either OnStart doesn't work or I'm using it wrong

queen oasis
#

OnStart not working is really harshing my propensity for laziness

bronze yoke
#

hmm, maybe onstart doesn't do what i assumed it did

#

it might be related more to crafting stations that take time to craft things without the player manually crafting it (e.g. drying racks)

#

the only reference i see to it other than those is *immediately before finishing crafting*, not at the start

queen oasis
#

I see it in CraftRecipeCode. I was hoping that the craftRecipe would call it

#

I might do some tests. anything to avoid making timed action functions

#

yea might just be for entityrecipes and I'm not ready for that yet

bronze yoke
#

it seems it's just for recipes crafted by crafting stations, for hand craft and build craft it's just called immediately before OnCreate

#

i didn't know this stuff was even in yet 😅 all of my questions about the crafting code could be answered easily if i just played the game

queen oasis
#

I haven't played in months

#

besides for testing my mods. once MP is out, I'm sure I'll get back to it

bronze yoke
#

i knew there were crafting stations but i didn't think they were actually able to craft independently from the player

#

yeah, i think that's what most of us are waiting for

queen oasis
#

I'm working up to crafting stations but really, I have no idea how they work yet

#

I wonder if I can force an OnStart from an OnTest = true

#

no, that sounds worse than just making a timed action. OnTest runs a dozen times when you get near the item

bright fog
subtle cypress
#

i can get darkmode on notepad?

#

legit question, i would love that

drifting ore
#

anyone knows a mod that cars have nitro?

queen oasis
#

edit / Font / App theme

bright fog
#

I just realized

#

Like what is he talking about

#

My message was literally not directed to you only the "?" that's it

subtle cypress
#

oh i misread and thought the followup was part of that

subtle cypress
bright fog
queen oasis
bright fog
#

Windows 11

queen oasis
#

yea, don't puke please

bright fog
#

On Windows 10 it's not a thing

queen oasis
#

upgrade now. have you upgraded? you should upgrade now before it's too late. have you upgraded?

bright fog
#

I literally moved to Linux to not upgrade

queen oasis
#

I don't hate it but I miss 10. really, I miss 7

#

and deep down, I miss XP

bright fog
#

yo old ass

subtle cypress
#

vista gang

queen oasis
#

but take it easy, cuz I'm old

queen oasis
subtle cypress
#

running xp

queen oasis
#

man, I miss rent-a-center. they closed the one here down when the manager was busted bringing pills up from Missouri

#

my brother saved and got a 486DX something or other with 95. simpler times

quick leaf
#

Hello me and my buddys are trying to get into modding.
i have some coding background as im studying it and am doing it for work, although im new to lua.
can someone give me some advice on what i am missing. Im trying to add a ModOption and want to add a keybind wich then runs a function.
however when getting myKeybind:getValue() i always get 0. Do i have to manually set the value on apply?


local myExampleOption = PZAPI.ModOptions:create("myExampleOptionID","Example options")
local myKeybind = myExampleOption:addKeyBind("testKeybind", "Keybind", Keyboard.KEY_NONE)

local function helloWorld(key)
    print(myKeybind:getValue())
end
Events.OnKeyPressed.Add(helloWorld)
#

Any help greatly appriciated.
Also regarding the LuaDocs. is it save to assume methods are always : and not . ?
ive also considered the unnofficial modding discord. is that generaly where discussions happens or am i at the right place here?
many thanks in advance

bright fog
bright fog
#

KEY_NONE is 0, so it means it stays key none when you get the keybind value

#

When you change it in the options, you still get 0 ?

#

You don't need to update the value on apply, the way you do it retrieves the current value everytime so no reasons for that being an issue

#

Also I just checked and you're using the addKeyBind wrong

#

Wait no sorry

#

Nvm you're using it right

quick leaf
bright fog
#

My brain looked and saw 4 params, and only 3 in yours and saw a problem bt no tooltip is optional lol

bright fog
#

You made sure to click "apply" when changing the keybind ?

#

I doubt that's the problem but eh

quick leaf
#

i understand the concern, but yes

bright fog
queen oasis
#
local myExampleOption = PZAPI.ModOptions:getOptions("myExampleOptionID")
local myKeyBind = myExampleOption:getOption("testKeybind")
local helloWorld = function(keynum)
  if keynum == myKeyBind then
    print("Pressed the key bind key:" .. keynum)
  end
end
Events.OnKeyPressed.Add(helloWorld)

something like that

quick leaf
#

wierd this is from the ModOptions.ini file...

keybind|myExampleOptionID|testKeybind|45
keybind|myExampleOptionID|testKeybind|0
keybind|myExampleOptionID|testKeybind|0

quick leaf
bright fog
#

As long as he checks the value

queen oasis
#

I was covering bases

bright fog
#

Try deleting the two last entries

quick leaf
#

ive also tried removing the 2 lines with the 0es and that doesnt change it

bright fog
#

Try removing every lines

#

Why is it there's always a problem with mod options that's insane

bronze yoke
#

sorry that's not clearer, the luadocs are built on a documentation generator meant for an entirely different language (none really exist for lua) and i haven't had time to retool the way things are presented yet

quick leaf
bright fog
#

Oh lol I checked if there was the static word that mattered, I randomly picked classes that ONLY had static functions lol

#

So I thought that might not be it

quick leaf
bronze yoke
quick leaf
bright fog
#

There can't be incompatibilities if you don't active the mods

#

In theory skull

bronze yoke
#

unsubscribing should be fine, it is not really possible for a mod to be able to make permanent changes to the game

quick leaf
#

is there a good way of debbuging the game using the ingame debugger, so that i can atleas figure out why its adding more than one line to the ingame file

queen oasis
#
local myExampleOption = PZAPI.ModOptions:create("myExampleOptionID", "Example options")
local myKeybind = myExampleOption:addKeyBind("testKeybind", "Keybind", Keyboard.NONE)

local function helloWorld(key)
    
    if key == myKeybind:getValue() then
        print("pushed the damn key")
    end
end
Events.OnKeyPressed.Add(helloWorld)

this works fine for me but idk

#

maybe I'm missing the question

quick leaf
#

cant confirm on my end lol

queen oasis
bright fog
#

@quick leaf Try reseting your cache folder

quick leaf
#

how do i do that

bright fog
bright fog
#

Are you adding multiple times the option ?

quick leaf
bronze yoke
#
local Config = {
    keys = {
        openDebugMenu = nil
    }
}

if getDebug() then
    local modOptions = PZAPI.ModOptions:create(
        "Starlit",
        getText("UI_StarlitLibrary")
    )

    local openDebugMenu = modOptions:addKeyBind(
        "DebugMenuKey",
        getText("UI_StarlitLibrary_Options_DebugMenuKey"),
        nil,
        getText("UI_StarlitLibrary_Options_DebugMenuKey_tooltip")
    )

    modOptions.apply = function()
        Config.keys.openDebugMenu = openDebugMenu.key
    end

    Events.OnGameStart.Add(modOptions.apply)
end

return Config
```this is how i usually use them, they've worked fine for me
#

do you have any other mods enabled?

quick leaf
#

deleting the folder will let it get reset on next game launch?

bronze yoke
#

i see a possibility that some other mod has a messed up mod option that breaks yours in a chain reaction

bright fog
quick leaf
bright fog
bronze yoke
#

it could be then that it was caused by an earlier version of the code, and the duplicated entries in the file are causing it to persist

bright fog
#

He did delete the entries tho

#

@quick leaf did you close the game when you deleted the duplicated entries ?

quick leaf
#

ive tried restarting at multiple times in the process although im not 100% sure i did that, ive now reset the folder and will try again

#

well what ever was the problem its fixed. probably got messed up somewhere inbetween changing from 41 to 42 and unsubscribing from mods

#

thanks to everyone who helped the troubleshooting anyways.spiffo ☺️
being new to a language/framework always makes it hard to decide if im the one to blame or something is going on unusual under the hood.

bright fog
#

yea no worries

queen oasis
#

my player is trying to chop a log with a saw. time to take a break

#

moar recipes I guess

true nova
#

make it so you can shoot it down with a gun

austere garden
#

Anyone know of any like 'Action' Mods that allow Players to do roleplay actions, like Praying, Saluting, Laughing, etc.?

#

For B42 ideally

molten grail
austere garden
#

Yeah, I already use True Actions, but just looking for something to make my character feel a bit more alive for i m m e r s i o n, like burying a friend and praying for a moment at the sight, before moving on, or saluting a squad of turned Soldiers since I'm rolling Vet

austere garden
#

Ah this might just be what I'm looking for thank you very much!

autumn bluff
#

is there any way to check all menus for a suboption with a specific name?
am doing it in "onWorldObjectContextMenu"
and searching for "ContextMenu_Drink", the drink suboption in most water sources
version is B42

bright fog
#

However it can be limited based on what you're looking for due to options not having IDs and instead you need to ID by name

autumn bluff
#

i can only get it to search top level menus... i need to search submenus

bright fog
#

You could program a recursive search tho none is available in the base game for context menus

#

Check if an option has children or whatever the suboptions are attached to

autumn bluff
#

am lua beginner. any help is appreciated

#

the ultimate goal is to gray out the drink option if a condition is met

bright fog
willow tulip
#

Hope I can find a modeler someday lol

autumn bluff
bright fog
# autumn bluff heck, alright. its bedtime for me anyway.

You can do a thing which is either in debug mode intercept the context menu object and look at the content of it, which I'm not familiar with
Or print k v pairs(menu) to see its content and see how options which have submenus are indicated

#

Submenus are accessible from the main menu, tho the best method to access them I'm not sure

#

You can check if an option has submenus and access it in your recursed function

willow tulip
#

Or you can intercept the call to create submenu and modify options created for drink.

autumn bluff
#

hmm... when would either of you be able to help me write the recursive search?

mint reef
#

is the washer/dryer function timed action?

true nova
true nova
# autumn bluff hmm... when would either of you be able to help me write the recursive search?

if i remember right this is how it works

local function removeSubmenuByName(name,context)
    if #context.options == 0 then return end
    local tmp = context.options
    for i, v in pairs(context.options) do
        if v.name == name then
            table.remove(tmp,i)
        elseif v.subOption then
            local submenu =       context:getSubMenu(v.subOption)
            if submenu then
                removeSubmenuByName(name,submenu)
            end
        end
    end
    context.options = tmp
end
#

should recurse on itself until it doesnt find a suboption

bright fog
rapid pond
#

yo I'm back, and i tried making irritated eyes. what I did is just switch the hue to red but I think it looks kinda good

rapid pond
bronze yoke
#

one of my mods worked on that concept before they changed that 😅

rapid pond
#

decided to tone down the colors a bit and irritate the eyelids too

rapid pond
#

added some more red to the pupils since the last one feels a bit too cheap

rapid pond
#

trying to make a screaming mouth

#

or something

bright fog
bright fog
#

Also do you paint while viewing those in Blender too ?

rapid pond
#

because blender is too laggy for me

#

already looking better

#

planning to add wrinkles to make it a bit more realistic

#

since when you open your mouth when you scream it wrinkles back

#

you know

#

ok what am I blabbering about

bright fog
bright fog
bright fog
rapid pond
#

but i think in the later stages the skin should be paler

#

because

#

i uh

#

kinda got inspired by a zombie eas scenario

#

basically ebola

#

but

#

zombifying

#

wow so original

#

but it's airborne

#

they say it's flu like

#

so i got inspired by the flu

#

and then plan to add bleeding in the later stagesù

#

but I don't wanna mess with the base textures too much since the bodydmg can make some REALLY nasty zombiesù

#

or INfECtED

bright fog
rapid pond
#

besides the eyes took me almost one hour

#

you know

#

in fact i'm kinda proud of the irritated eyes since it's my first retexture

bright fog
#

That's what I meant

#

Depends on if your zombies can have gore like some found in the base game

rapid pond
#

OH

#

well

#

the zombies or should I say InFeCtEd ||ok i'll stop||

#

are still alive

queen oasis
rapid pond
#

better make their health fragile

#

especially because they're sprinters

bright fog
rapid pond
bright fog
rapid pond
#

oh yeah

bright fog
#

Removing those shouldn't be hard

#

You overwrite the textures with pure transparent images

#

At least I think that's how it should be done, like for body textures replacements

rapid pond
#

huh

#

neat

#

actually keeping the gore's good

#

even though it's not realistic

#

thanks for the suggestion though

opal flame
rapid pond
#

I can't decide which looks better (1st one inspired by the zombified moodle)

queen oasis
#

not sure why I thought hitting a tree with something outside the "chop tree" function would fire IsoTree.WeaponHit

#

oooh, OnWeaponHitTree is a thing. very nice

true nova
true nova
# queen oasis it's gonna happen

id overcomplicate this and roll random bullet hole sprites to attach to the tree with offsets and once enough stacked along a line it would break.

queen oasis
#

I should separate this mod out from my auto logging mod Deforestation Simulator too

true nova
#

well bullets do hit trees right? so surely it triggers somewhere. good luck with that. gonna be a big table of x,y positions on trees lol

opal flame
true nova
tranquil kindle
#

is3D means you can tell directions its coming from and it also fades the further you're from sound source. DistanceMax is self explanatory. Volume you have to try diffrent values depending on your sound file. MaxInstances i belive is to limit the amount of same sounds that can be played in certain amound of time. If you have high fire of rate weapon it might be good option?

opal flame
#

I understand what you mean, I found it in the game files, these sound txt files are also needed for the propagation of the sound. If I'm not mistaken, I found the right place.

tranquil kindle
#

The thing is that most vanila sounds are hidden in .bank files, so those scripts may vary. The one i've showed you is for something basic like firing sound for a gun

quick leaf
#

is there a way to create items and recipes programaticaly?

bronze yoke
#

are you trying to create them at runtime or just pre-generate scripts for ease of development?

#

for runtime, no (recipes can be created at runtime in b41 though)

queen oasis
#

I feel bad about this

#

and I'll make it a lookup table before I'm done, so no judging the code yet aight

muted garnet
#

at what distance can zombies notice the player for each zombie vision setting?

bright fog
queen oasis
# bright fog At least you're aware of it lol
local typeDropsInChat = {
    [1] = function(sq)
        local animalTypes = { "hen", "cockerel" }
        local breeds = { "leghorn", "rhodeisland" }

        local animalType = animalTypes[ZombRand(#animalTypes) + 1]
        local breedName = breeds[ZombRand(#breeds) + 1]

        local breed = AnimalDefinitions.getDef(animalType):getBreedByName(breedName)
        local animal = addAnimal(getCell(), sq:getX(), sq:getY(), sq:getZ(), animalType, breed, false)

        animal:addToWorld()
        animal:changeStress(100)
        animal:forceWanderNow()
    end,

    [2] = function(sq) sq:AddWorldInventoryItem("Base.Egg", 0, 0, 0, false) end,
    [3] = function(sq) sq:AddWorldInventoryItem("Base.DeadBird", 0, 0, 0, false) end,
    [4] = function(sq) sq:AddWorldInventoryItem("Base.DeadSquirrel", 0, 0, 0, false) end,
}```
boom. already thinking of a making common, rare and maybe legendary drops
bright fog
queen oasis
#

it's hijacking IsoTree.WeaponHit

bright fog
#

👌

#

Spawning a chicken lol ?

#

That's cool

queen oasis
#

can't remember what to use instead of ZombRand

bright fog
#

Random

queen oasis
#

duh

bright fog
#

Sec

queen oasis
#

if I cache newrandom when the script loads, it will still pick a new seed each time I call it, right?

bright fog
#

Yes

#

If you don't set a seed, it's fully random

bronze yoke
#

when you create a random it starts with a random seed

#

the seed changes every time you generate a number even if you do set a seed

bright fog
#

Does it ?

bronze yoke
#

yeah

bright fog
#

Explains better how it works I guess

bronze yoke
#

the seed change is deterministic based on the calls made, so all that setting the seed does is make it so that you always have the same starting point

queen oasis
#

doing what I need. I'm using random a lot so might as well do it right

bright fog
#

Best to get used to it too since it's overall better

queen oasis
#

I can't figure out how to interrupt tree damage when the player just swings an axe at a tree

#

CombatManager.CheckObjectHit is where that magic happens, but I can't find a way to stop it before it gets there

#

hmm, maybe I can check if the chop chop is from the ISChopTree action

fleet bridge
#

then reset it back to the script value on player attack finished

#

but it will still hit the tree unfortunately

queen oasis
#

that was my take, OnWeaponTreeHit and figure out which tree the player is facing or hitting

#

I thought about onWeaponSwing for a minute but didn't want someone swinging at a zombie near a tree and not doing any damage

fleet bridge
#

you can make it do basically no damage, but it will always hit the tree

#

you'd need to change the script value to not have a TreeDamage parameter iirc

#

if you can somehow make that value nil you might be in business

queen oasis
#

oh, ok yea I didn't know about the TreeDamage thingy

#

that's a good way in

#

never made a weapon and never really looked at the files for them

#

that was easy. thanks!

gaunt jay
#

Hello guys, does anyone know of a trustworthy source or way to get someone to do a mod? tried finding someone through Fiverr but the services I found in there seemed like scams:"(

tight elm
queen oasis
#

idk why the tree damage keeps going down unless getTreeDamage() isn't getting the script value

fleet bridge
#

what's the code look like?

#

are you resetting it back to its original value?

queen oasis
#
local weaponTreeDamage
Events.OnWeaponSwing.Add(function(player, weapon)
    print("Player has timed actions? " .. tostring(player:hasTimedActions()))
    if not player:hasTimedActions() then
        weaponTreeDamage = weapon:getTreeDamage()
        weapon:setTreeDamage(0)
        print("OnWeaponSwing: setting tree damage to 0")
    end
end)

Events.OnPlayerAttackFinished.Add(function(player, weapon)
    weapon:setTreeDamage(weaponTreeDamage)
    print("OnPlayerAttackFinished: setting tree damage to " .. weaponTreeDamage)
end)
fleet bridge
#

b41? b42?

queen oasis
#

42 all day, every day

fleet bridge
#

make an instance item, get the tree damage off of that

#

instead of caching it in a var

quaint sage
#

Is it possible to make a mod that automatically gives a previously set Item loadout and skill levels?

thin swan
small topaz
#

Is there a command to delete a single profession?

queen oasis
#
public void setTreeDamage(int treeDamage) {
  this.treeDamage = treeDamagex;
}```
seems wrong unless I don't know what the x means
#

because treeDamagex isn't declared or used anywhere else that I can tell

#

there's varx everywhere so I probably just don't know what it is

fleet bridge
#

im only familiar with using it on b41, i havent touched b42 since last christmas lol

bronze yoke
queen oasis
#

sounds like me

#

the new version is verbose. I like it

#
public void setTreeDamage(int _treeDamage) {
    this.treeDamage = _treeDamage;
}```
#

cool

#

can't blame the code now

alpine mica
#

How do I make the map bigger, also how would I revamp tiles and stuff to make it look like real life stuff, I was wondering if this was possible I was also trying to figure out how to make more cars spawn, can anyone help

thin swan
alpine mica
#

I was thinking of more areas to explore

thin swan
queen oasis
bright fog
small topaz
#

Can anyone confirm that in B42 vanilla, it is possible to spawn in a looted house? I did several test runs with looted houses on insane and looks like it can happen. Just asking here since the whole thing is randomized. So I want to double check...

tranquil reef
#

aren't item textures stored in tilesets in the vanilla game

true nova
molten grail
small topaz
queen oasis
small topaz
#

B42 has still the ISCraftAction.lua in the shared TimedActions folder and it contains the code

    self:setActionAnim(self.recipe:getAnimNode());
else
    self:setActionAnim(CharacterActionAnims.Craft);
end```
small topaz
#

Does anyone know the correct way to check whether all squares in a building or a room are fully loaded?

#

The problem is that in my modded situation after manually teleporting the player, the command room:getSquares() can return an empty list although the room has more than 0 square. This can happen during the first ticks of the game.

#

During the first ticks, the size of the list increases, so it takes some time until all squares are in the list. Problem is that for an arbitrary room, I don't know for how many squares I should wait...

mild canyon
#

Hello everyone!
I'm new in mode developing, I work in Blender and I would really appreciate some help. Could someone please answer my questions:

  1. Could I use my custom rig with custom bones in the game, if I'm not going to use vanilla animations at all (or should I remake all my custom animations based on PZ_HumanRig bones)? So, I want to load my custom NPC with custom bones and all the animations I made for it into the game and I'm wondering, if it's possible (If yes - the following questions are not relevant.).
  2. If not, could I just delete the model from PZ_HumanRig or Mystery_rig and reparent the def. bones to my custom model?
  3. Is it OK, If I rescale or move the bones to make them fit my model?
  4. Now I can't even load my model into the game, might it be the problem of my custom bones? May be you could help me to import the model at least as an object? I see only question marks on the floor after trying to spawn it. Are there any code tipps?

P.S. I am very new in this branch, so I deeply apologize for all the stupid questions. I would really appreciate your help!

small topaz
true nova
true nova
mild canyon
tranquil kindle
#

In B41 you can't use custom armature

#

I heard you can in 42, but I myself am not sure

bright fog
#

Yes it seems in B42 you can, however to apply it to existing entities you'd have to redo all their animations with the newly added bone

regal umbra
#

Is there a way to get the vehicle zones next to the houses. I.e the driveways

#

Im looking at IsoMetaGrid:getVehicleZoneAt()

#

not sure if it's that or not

#

And if that's it, how would I get the metaGrid from the cell the player spawned at

#

Essentially what I want to do is whenever a player picks for example Rosewood and spawns in one of the houses, my code picks that house driveway and spawns the vehicle there

#

I know there's getMetaGrid() but that is a method only in IsoWorld not IsoCell

bright fog
#

I mean, isn't that enough ?

regal umbra
#

Not sure, that's why I'm asking

bright fog
#

Chuck was using that I think to retrieve every buildings on the map

regal umbra
#

Yeah, but I mean how would I go on about taking the building the player is in and spawning the vehicle in that building's driveway

bright fog
#

You can easily retrieve the player building with getBuilding

true nova
regal umbra
true nova
#

ah my bad my reading comprehension is bad

true nova
regal umbra
regal umbra
#

Ah yes

#

Lovely spawn

bright fog
#

That's a start

pearl prism
tranquil kindle
regal umbra
#

single*

#

Perhaps it spawned too close to the wall

#

But i fixed it (I think) by adding a minDistance check

#

Working with trailers too now!! :D

bright fog
#

Great !

tulip valve
#

Anyone know where the vanilla zomboid welding scrap sword recipes are located? I checked in media/scripts/recipes, but its not there :/

pearl prism
bronze yoke
#

you could use starlit's reflection library to read its fields (exposure doesn't matter for field access)

small topaz
#

Thanks! I'll have a look at it!

mild canyon
#

Hello, guys! Tell me please, how to add my animation .fbx as mode (I've created some animations based on PZ_HumanRig). I've found many guides with NO CODE examples there. Help... I don't want to replace vanilla animations, I want to add my own, it could be possible, yes?..

thin swan
mild canyon
#

Martial art fighting animations:)

thin swan
#

If you don't know how to make the xml file, you can either look at how the vanilla ones are set up, and then just make sure that you add <m_ConditionPriority> to your xml so that your animation takes priority

#

Nice! I was working on a martial arts mod as well, but it's been taking a back seat for other stuff 😅

#

You're gonna have to do a lot of stuff in Lua if you want different types of moves btw, trying to add unarmed combat is pretty tricky. You basically have to use the shove and override it with your own moves

mild canyon
#

So, don't you mind me to add you? Could you help me a bit more in DM?

thin swan
#

You can download my b42 skateboard and check how I replaced the shove animation only while holding the skateboard

#

Sure but I'm gonna be pretty busy for the next couple of days, but I will try to answer when I can

mild canyon
#

Ok, Thanks' a lot! I really appreciate your help!

bright fog
#

Ah I guess the wiki guide doesn't nvm

#

It's kind of something that is a bit unfinished rn and since I'm not very knowledgable about animations it's likely it won't improve until I go deep into it

thin swan
#

Has enough to get you started though

#

I should help fill out the animation section on the wiki tbh, I've learned a lot from making my rideables

#

The next thing I want to tackle is the 2dblends system in the animations, I have a rough idea on how it works but I want to really know exactly how to use it

hearty canopy
#

Hi, I'm having trouble with a mod I just made that tweaks some recipes. I'm ending up with 2 of the same recipes (albeit one with the changed resource cost) even though my mod's recipes have the Override tag

thin swan
small topaz
#

does zomboid's lua allows
local t = { maxX = maxX, minX = minX, maxY = maxY, minY = minY }
so the key is the same as the variable name?

hearty canopy
bronze yoke
#

the key isn't actually a variable reference in that syntax, it is a string

thin swan
hearty canopy
#

thats actually how it was originally, i moved it to after the load order to see if it fixed the duplicating recipe

thin swan
#

Dang okay, I've never tried overriding other recipes and I'm not by my computer right now so I'm afraid I can't help more atm

small topaz
bleak remnant
#

Does someone here knows how to make a zombie wear an item and it not show or be transferable from its inventory?

#

when it dies

#

i am not quite sure how people do it vanilla tho

#

mods like The last of us use zombie forge but that anthro mod somehow is able to do it vanila

#

but the way it is made is weird since it uses "fur" on it's script to apply the item to

#

so i cudn't figure out so well by myself

small topaz
#

what do you mean by "The last of us use zombie forge" ?

bleak remnant
#

zomboid forge, i said it wrong

#

but there are mods there do it vanilla

#

i just don't know how to do it myself

thin swan
# bleak remnant Does someone here knows how to make a zombie wear an item and it not show or be ...

Yeah to make it not visible on the zombie you have to hook into ISInventoryPane:renderdetails and add a condition to stop rendering based on your needs. This is super messy though and ripe for conflict with other mods because there's no clean way to hook into that function and release it for other mods to use after.
Making it non-transferable is easier, you hook into ISInventoryTransferAction:isValid() and add a condition that is met when the src container is the zombie, and the item is what you want to block from being transferred.

#

You can check the files for my bicycle mod, I do both of those things in it for my attachable containers

bleak remnant
#

Dam... So, do you think it is a good idea just make it not transferable? like, keep the item there but untouchable?

thin swan
#

I'd say so yeah

bleak remnant
#

ok, thanks, this will do.

bright fog
#

Just don't put a display name

bleak remnant
#

what do you mean?

bright fog
#

You want to hide a custom item ?

#

Custom clothing I suppose right ?

bleak remnant
#

yes

bright fog
#

Well you simply don't put a display name in your item scripts

#

And it won't be dropped by the zombies

#

OR you remove the item from the corpse inventory, but that's a bit more trickier to do ...

bleak remnant
#

no way it is that simple

bright fog
#

Yea 😅

#

Check the item script for my clicker clothing in TLOU Infected

bleak remnant
#

ok

#

in what line is that?because that thing is kinda big

bright fog
#

I remember I think it was @tranquil kindle that told me that the item actually is inside the zombie inventory but it just doesn't render because there's no name. I have never properly tested and verified that tho

bright fog
#

media/scripts

bleak remnant
#

ok

bright fog
#

Check the item clothing scripts for the clicker

bleak remnant
#

item ClickerBody_01
{
DisplayCategory = Clothing,
Type = Clothing,
ClothingItem = ClickerBody_01,
BodyLocation = UnderwearBottom,
CanHaveHoles = FALSE,
BloodLocation = Trousers;Jumper;FullHelmet;Hands;Neck,
BiteDefense = 100,
BulletDefense = 100,
ScratchDefense = 100,
}
bruhhhhhhhhhhhhhh

#

no way

#

let me test that

bright fog
#

Overall it's usually not a problem unless for some reasons you got something which can output the corpse's inventory somewhere I guess ?

#

Idk if looting all in the container would loot the clothing item too

#

But all of that could be extremely easily patch, like Alex has mentioned to intercept inventory renders and delete items for good there in any inventory I suppose

bleak remnant
#

it woked

#

as expected

#

brh

#

now i am facing other problems but it is not related to that thanks

bright fog
#

Yea but if the item is simply invisible, different systems might still interact with it, even if you're not aware

bleak remnant
#

my zombies have no hair and they are naked

#

gotta figure that out

thin swan
bright fog
bleak remnant
#

would you tae a look at my script?

#

let me send it

bright fog
bright fog
bleak remnant
#

module FZ3 {
imports {
Base
}
item FZ3
{
Type = Clothing,
ClothingItem = FemaleZed3,
BodyLocation = Shoes,
BloodLocation = Head;Neck;Trousers;Jumper;Hands;Shoes,
CanBeRemoved = false
hidden = true
NeckProtectionModifier = 1,
Icon = AB,
StompPower = 3,
CanHaveHoles = false,
ScratchDefense = 15,
BiteDefense = 7,
Insulation = 0.5,
WindResistance = 0.5,
}

}

bright fog
#

What is hidden = true

#

Remove those

#

Any parameters that don't exist in the base game need to be deleted

#

Also missing commas

thin swan
bleak remnant
#

holy disgusting creature i have created

bright fog
#

Indeed

bleak remnant
#

i have a bunc of bproblem with this, they only wear clothes when they die (wtf) and clothes like those that is just a paint on you just don't show up

#

any idea of how to fix?

bright fog
#

I remember having such a problem, but I don't remember the exact fix

#

My mod might have that exact problem in fact

bleak remnant
#

i guess i will have to take a closer look to that furry mod then

#

Furries are so weird, they usually find solution to everything.

icy night
#

Hi all, I want to make an invisible clothing item. How would I write the item/model script to do that?

#

I simply dont have a model/texture and dont need to have one

bleak remnant
#

let me send mine

#

i have one model for now

#

module FZ3 {
imports {
Base
}
item FZ3
{
DisplayCategory = Clothing,
Type = Clothing,
ClothingItem = FemaleZed3,
BodyLocation = Shoes,
BloodLocation = Head;Neck;Trousers;Jumper;Hands;Shoes,
CanHaveHoles = false,
}

}

#

we were just talking about his

#

just don't add the display name in the script

icy night
#

Ah ok

bleak remnant
#

and it won't show in the zombie inventory once it is dead

subtle cypress
#

whats the equivelent for setdisplayname but for the clothing item

bleak remnant
#

by the way

#

yours too

#

once you have that thing equipped

#

you can't take it off

icy night
#

thats fine

#

ty

ancient grail
bleak remnant
#

what?

ancient grail
#

thats one reason why this would happen

or maybe you just broke that file somehow

in anycase this is outfit related

bleak remnant
#

dude

#

it work like that with one mod only or more

#

want me to send you the model?

#

i am new at this

ancient grail
#

no need

#

its not the model
its the outfit

bleak remnant
#

any idea of how i can fix?

ancient grail
#

you have to complete the file checklist for zombie clothing mod

bleak remnant
#

where can i find this checklist?

ancient grail
#

if you already have the item working for character next step is the ~~fileguid ~~ clothing.xml entry

#

its a file inside the media folder itself

bleak remnant
#

nhumm... tell me more

ancient grail
#

you need to make the same file on your mod
with 1 or 2 entries of your outfit
thats how you turn the clothing set into a zombie

the file should be named the same

#

ok hold on

#

ProjectZomboid\media\fileGuidTable.xml

bleak remnant
#

oh, that file

#

that is what is in mine

#

<files>
<path>media/clothing/clothingItems/FemaleZed3.xml</path>
<guid>fa1d2c3b-4e5f-6789-abcd-0123456789ef</guid>
</files>

#

and... that is it

ancient grail
#

i was wrong this is the item entry lol the outfit is somewhere else

#

my bad

bleak remnant
#

no problem

ancient grail
#

ProjectZomboid\media\clothing\clothing.xml

#

thjis is where the outfits are

bleak remnant
#

oh... there is nothing on mine

#

so. what do you recommend me to do?

#

take it from another mod?

#

would this solve those clothes that are just textures?

#

shit... the mod i was looking for don't have it as well

ancient grail
#
<?xml version="1.0" encoding="utf-8"?>
<outfitManager> 
</outfitManager>
#

you have to make your entry within this

#

you would have to look at the file itself and make your own entry

#

you should name your files for both
clothing.xml and
fileGuidTable.xml

the same

#

unlike lua files where you want to name it differently
to not overwrite

bleak remnant
#

yo

#

but like

#

the zomboid one is gigantic

#

so, i have to put basically everthing there?

#

wait, i guess i am just a bit cunfused

#

it list all the clothes in the game and the probability of spawn

small topaz
#

does Zomboid's lua supports
if next(myTable) == nil then
to check whether a table is empty?? get some strange errors here

small topaz
#

no, next() is a lua command, giving the first key of a table (or nil, if no key exists)

bleak remnant
#

i deal with errors like this once in a while, but i usually send the log to chat gpt and it sees and tell me where the error is, i have error because something is nill but it shoudn't be nill and stuff like that.

#

tell me more about what you are trying to do and i may help

queen oasis
subtle cypress
#

what is the equivelent method to set clothing item like setdisplayname does for displaynames, doparam doesnt work i guess it does some earlier loading or something im not sure why as it works fine for alot of other stats

regal umbra
#

But I think if next(myTable) == nil would work too tbf

queen oasis
#

oh good, I couldn't get it to work in the console

bronze yoke
#

you can use ```lua
local isEmpty = true
for _, _ in pairs(myTable) do
isEmpty = false
break
end

regal umbra
queen oasis
#

the 5.1 docs skip right over "n"

regal umbra
#

Well then next() isn't a function in 5.1

#

Clearly is in 5.2

#

5.4*

queen oasis
#

no, it's there hiding. idk anything anymore

regal umbra
#

no actually

#

there's

#

what

bronze yoke
regal umbra
#

ah

#

yah that's fair

bronze yoke
#

kahlua randomly doesn't implement a couple standard library functions of its choice

#

os library omission makes sense but omitting math.random is strange

regal umbra
small topaz
regal umbra
#

whole helper function just to check if the table is empty

regal umbra
#

lua 5.1 has next()

#

kahlua doesn't

ancient grail
small topaz
#

thanks!!! good to know!

bronze yoke
#

i will say that i have almost never needed to do this anyway

#

if you care about the size of a table it's very likely to be arraylike and then you can just do #t == 0

subtle cypress
bronze yoke
#

but the pairs loop is needed to account for key-value tables

regal umbra
small topaz
#

if noticed another strange thing in B42: print commands for the console.txt of the form

print("otherData: ", m)```
sometimes don't print the string "..." in the console. For example, "otherData" might be missing. This seems to be completely random for me (like "data" is still shown). The values and m might still both be printed to the consolte.txt.
regal umbra
#

but still all they had to do was add a single function 😭

bronze yoke
regal umbra
#

sometimes i dont even get prints at all in the console.txt

small topaz
#

that's quite annoying. makes debugging super clunky

bronze yoke
#

i'm not entirely sure when this started happening, i don't think it happened in the earliest versions of b42 but i can't say for sure, i don't use prints as much as most

regal umbra
#

I mean i mostly use them when I cant really see what's causing an issue lol

#

So i just add print to every logic step in the code just to see where it fails

bleak remnant
#

hey @ancient grail i don't think that is the problem. Because for what i see after checking the file, it is responsible for the cloth generation, that is not my problem since the zombies already have my clothes (i force them wear my fbx with lua) but the clothes they have on don't show up, the cloth and hair

#

the cloth only show up when i kill them

#

so, the problem is probably related to my model

#

idk

ancient grail
#

ah i see ok then
gl with reworking the model then

also check texture might be it
or maybe normals

bleak remnant
#

yeah, but the thing is, what should i rework?

#

that is the thing

#

i created my model on a normal zombie body

#

person body i mean

#

everything, the only thing i have changed is the jaw

#

and i still having problem with the clothes and hair

#

anything in mind?

small topaz
#

Are the return values of commands like getX() or getRooms() applied to a buildingDef object correctly initialized even when not all squares from the building are loaded?

#

Also, is getSquare(x,y,z) the correct command to get the GridSquare with coordinates x,y,z?

unreal vale
#

I'm going to make a mod that lets ginger ale help with upset stomachs and such

#

Because that's what happens irl

#

And realism is king

grizzled viper
#

tried launching the true music add on i made, this pops up

#

need help

ancient grail
small topaz
#

thanks!

#

When an IsoGridSquare has been loaded for the first time, how long does it take until a zombie may spawn on? I think it usually doesn't happen at the same time but my take some ticks.

small topaz
#

is now DebugLog.log("some tex", data) the correct way to print smth in the console.txt or in the debug window?

#

... apparently not

    java.lang.RuntimeException: No implementation found for function: log(class java.lang.String IN_REMOVE_ZOMBIES: , class java.lang.Double 0.0)) at MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:134).
    Stack trace:```
#

but seems to work with DebugLog.log("some tex" .. data) instead

bronze yoke
#

i'd just use print

#

you're getting no implementation found because that function only takes one argument

#

it's looking for a two string overload which doesn't exist

bright fog
bright fog
small topaz
bright fog
#

In B42 there is OnZombieCreate you could use

small topaz
#

And for which zombies does it apply? So in what area around the player?

bright fog
#

When a zombie loads in

supple tangle
#

Hi guys!
To make this story short, im currently making a Slipknot mask mod and i have a problem;
Basically when i import the model of the mask it stays attached to the bone of the head like this (photo 1), but when i make it go "up" in blender (photo 2) it TOTALLY bugs tf out (photo3). This is my very first mod so ANY help would be a godsend.

(Sorry for my bad english but im italian)

#

here's the .xml file of the mask

thin swan
tranquil kindle
# supple tangle Hi guys! To make this story short, im currently making a Slipknot mask mod and i...

https://steamcommunity.com/sharedfiles/filedetails/?id=3444877391 The way TIS does it is not reliable if you don't already know what to do as the placement is strange. I'd suggest you use my guide for it and do it with blender

A guide on how to create Basic Clothing mod. If i missed anything, or something requires further explanation, do let me know. Basic Game and Blender Knowledge is Required....

#

You'll be most intrested in this part BUT do just to make sure do read everything

supple tangle
#

tf?

tranquil kindle
#

<@&671452400221159444>

tranquil kindle
#

Bots

supple tangle
finite dune
#

Why do they always come to this channel and the wiki channel?

supple tangle
#

maybe because they can put photos?

tranquil kindle
finite dune
#

oh that could be it

supple tangle
supple tangle
#

i followed some steps from this guidehttps://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/

tranquil kindle
#

Most of hats are made with specific placement of origin bone in blender and not parenting your hat to bones with it, but instead doing so in XML files. Unless you have some kind of template, you'll spend more time than its worth finding that "spot" without it where it would work, while in blender you have preview how its gonna look, aswell as you get rid of parenting with XML file itself

#

You're free to try all sorts of things, i'm simply telling you of a way, that i found efficient and new modder friendly.

grizzled viper
supple tangle
#

yk what? ill just follow the guide u sent

#

thx! @tranquil kindle

fallen willow
#

I wanted baked potatoes, so I added the following to the farming.Potato code.

            IsCookable        =         true,
        MinutesToCook       =         20,
        MinutesToBurn       =         50,

And every time I tried to make a salad, the following error occurred.

Caused by: java.lang.ClassCastException: class zombie.inventory.types.ComboItem cannot be cast to class zombie.inventory.types.Food (zombie.inventory.types.ComboItem and zombie.inventory.types.Food are in unnamed module of loader 'app')
at zombie.scripting.objects.EvolvedRecipe.addItem(EvolvedRecipe.java:259)

function: checkName -- file: ISAddItemInRecipe.lua line # 74 | Vanilla
function: perform -- file: ISAddItemInRecipe.lua line # 47 | Vanilla

Is my approach wrong? How can I make it possible to bake potatoes?

forest herald
#

Hey all, just a quick question, what audio format is supported by the getSoundManager():PlaySound?

#

never mind

#

Found the post ❤️

somber marten
#

Im trying to merge 2 mods so I can use them locally, without posting them on the workshop, and no matter what I do, I always get the same error. I am trying to merge Dynamic Traits and Simple Overhaul Traits and Occupations

#

Idk what to really do to fix this, because everything Ive tried seems to not work, and idk how to explain it without sending over the entire mod Ive made so far

regal umbra
somber marten
#

I am not sure what the error is. I am trying to make it so that when strength is above 3, I lose the weak back trait, and when its above 8, i get the strong back trait. So I open the debug menu, level up strength, and on every level it breaks to an error, for a file thats not in my game at all

#

I could get in a vc and show you but that would take a while because Id need to show the entire work Ive made so far

regal umbra
#

Can you provide the Stack Trace, you can find it in C:\Users\Youruser\Zomboid and normally should be in a text file named console.txt

somber marten
#

Well I would but now Im faced with a different error. Activating the mod makes the game have a permanent black screen no matter what. Cant click anything, cant do anything. I gotta end the task then remove the active mod from the file that saves active mods

regal umbra
somber marten
#

Ill try, but I doubt itll work

#

All I see is the fps counter from steam, rest is black screen

regal umbra
#

But yeah providing the Stack Trace would be the best option here, because otherwise is just guess work

somber marten
#

Would you mind if I sent you a DM for all this, or do you wanna keep it here on the server?

#

Also I tried the f11 thing and it did open the debug screen

regal umbra
somber marten
#

Oh thats interesting

ancient grail
#

anyone knows where i should look when i want to trigger recipe timed action

#

for b42'

forest herald
#

Is there anyway to have getSoundManager():PlaySound(soundToPlay, false, soundVolume) respect the global sound volume?

#

Is there a way to get the 'Sound Volume' option value and use that for example?

#

This local soundVolume = getSoundManager():getSoundVolume() gets the value Im looking for. But the maxGain parameter in PlaySound appears to do nothing?

small topaz
#

Has anyone ever used the IsoBuilding.hasBasement() command and has it worked properly?

bronze yoke
#

nope

#

i remember someone talking about having trouble detecting basements but i don't really know what it was about

#

except that apparently basements are a separate isobuilding

bright fog
#

Why not check if the place you're in at z < 0 ?

#

That will basically do the same thing ? Unless there's already cases of z < 0 not being basements

small topaz
#

Me too. hasBasement() is always false for me, even my player enters the basement and basement is loaded.

queen oasis
#

don't know if it helps, but I grab them like:

undergroundSquare = getSquare(sq:getX(), sq:getY(), sq:getZ() - 1)
if undergroundSquare and undergroundSquare:getRoom() then
    table.insert(buildingSquares, undergroundSquare)
end
small topaz
bronze yoke
#

seems about right

small topaz
queen oasis
#

the building is loaded for sure though

#
local rooms = JB_MoveCorpses.playerObj:getCurrentBuildingDef():getRooms()
for i = 0, rooms:size() - 1 do
    local room = rooms:get(i)
    if room then
        local roomSquares = room:getIsoRoom():getSquares()
        for h = 0, roomSquares:size() - 1 do
            table.insert(buildingSquares, roomSquares:get(h))
        end
    end
end

-- get basement squares if they exist
if JB_MoveCorpses.playerObj:getSquare():getChunk():getMinLevel() < 0 then
    for _, sq in ipairs(buildingSquares) do
        local undergroundSquare = getSquare(sq:getX(), sq:getY(), sq:getZ() - 1)
        if undergroundSquare and undergroundSquare:getRoom() then
            table.insert(buildingSquares, undergroundSquare)
        end
    end
end```
small topaz
# queen oasis I believe so

For me, the problem is that basements squares are not detectable until the player has entered them. But I have not yet tried your specific contruction so I give it try!

small topaz
#

hmmm ... doesn't seem to work for me. Squares with z<0 are not loaded before I enter the basement.

Your code works cause you take the square from the player, so player is actually in the basement when the square is checked.

queen oasis
#

idk if you can get a building def if it isn't loaded. I never tried.

small topaz
#

The buildingdef is always present but in general, the squares are not.

bright fog
bright fog
small topaz
#

you mean the basements are defined as beeing a different building from the one they belong to?

bright fog
#

That's what albion mentioned

#

The reason that's the case I guess is because basements can also just not spawn sometimes and be optional

bronze yoke
#

they're random so they can't share a buildingdef

#

i don't know if fixed spawn basements do this or not

bright fog
#

Yea nvm just read the second message lol

queen oasis
#

too bad there's no way to get a cell that's not current

small topaz
#

not related to the basement stuff: does anyone know exactly what the command RandomizedBuildingBase.isValid(BuildingDef def, boolean force) does? can it be used to prevent a building form becoming randomized (like burnt or a zone story)?

queen oasis
#

now that's a saw horse

true nova
queen oasis
#

sad face

#

might be too much for my smooth brain to understand, anyways

#

someone knew I would be feeling discouraged today

true nova
queen oasis
true nova
# queen oasis ya, i think I f'ed up looking at entity_furnace_iii.txt first

heres a simple one ive done ```
module Base
{
xuiSkin default
{
entity ES_eaDoor
{
LuaWindowClass = ISEntityWindow,
DisplayName = Elevator alt Door,
Icon = elevator_altDoor,
}
}

entity Elevator_altDoor
{
    component UiConfig
    {
        xuiSkin         = default,
        entityStyle     = ES_eaDoor,
        uiEnabled       = true,
    }

    component SpriteConfig
    {
        OnCreate = GE.EntityCreate,
        face E
        {
            layer
            {
                row = openMallDoor_2,
            }
        }
        face N
        {
            layer
            {
                row = openMallDoor_3,
            }

        }
    }

    component CraftRecipe
    {
        timedAction   = BuildMetalStructureMedium,
        time          = 250,
        SkillRequired = MetalWelding:4,
        xpAward       = MetalWelding:10,
        category      = Miscellaneous,
        ToolTip       = Tooltip_MakeButton,
        inputs
        {
            item 4 [Base.WeldingRods],
            item 4 [Base.BlowTorch] flags[Prop1],
            item 1 tags[WeldingMask] mode:keep,
            item 1 [Base.Screwdriver] mode:keep,
            item 6 [Base.SmallSheetMetal],
            item 4 [Base.SheetMetal],
            item 8 [Base.Base.ElectronicsScrap],
            item 20 [Base.Screws],
            item 4 [Base.ElectricWire],
        }
    }
}

}

queen oasis
#

I was ready to punch dry wall and then I see...

#

oh hey, look, my game loads now

bright fog
#

And it seems this is well demanded so I might look into it in the coming days I guess hahalol

queen oasis
#

it wasn't as bad as I thought. I think I just looked at the most dense entity script and it confused my old brain

#

looks like it's working ok now

forest herald
#

The ColorRGB doesn't seem to work for me, I'm getting an error. Anyone has an implementation of this?
HaloTextHelper.addText(player, message, "[br/]", HaloTextHelper.ColorRGB(0, 150, 150, 255))

#

This works just fine HaloTextHelper.addText(player, message, "[br/]", HaloTextHelper.getGoodColor())

#

Nevermind, this worked fine HaloTextHelper.addText(player, message, "[br/]", 0, 150, 255)

queen oasis
#

is it standard to stop crafting a recipe when the entity window is closed?

forest herald
#

Anyone has anyidea why my tickBox option always returns 'true' using getValue? displayCheckBox:getValue()

forest herald
#

Yea

queen oasis
#

getValue(index) so :getValue(1) if it's the only one

forest herald
#

Aha, lol, okey ty 😄

queen oasis
#

let me know if that works because I'm questioning myself

#

I remember fighting it a while back and I think that was my solution

forest herald
queen oasis
#

nice

forest herald
#

I had just moved over to a combobox with 'enabled' 'disabled' instead KEKW

#

Nasty business

#

🤭

rich reef
#

Hello all, I was wondering if someone can help me track down the cause of this error. I don't believe its from any mod that I am working on myself, and haven't really changed any mods lately either on my server. But since August 12th, I have been getting this error spam across the server console every second or so, and its made it impossible to use the console to do any administration.

receiveObjectModData index=-1 is invalid  x= , y= , z=

Does anyone have an idea what may be causing this? It has come out of the blue entirely.

Appreciate anybody's help with this, thank you!

bronze yoke
#

this error happens when you call transmitModData() on a player object

#

it could probably also happen for other objects that don't have normal object indices

rich reef
#

Alright. Any clue why this would spring up out of nowhere? Never had this error before. Haven't updated any of my mods in a month or two, and dont believe I use that anywhere in them. Been checking recent mod updates on the server, and nothing seems to coincide with the beginning of the error occurring on August 12th either. Completely stumped, and not sure how to track this down at all.

bronze yoke
#

nope, i have no idea

rich reef
#

Well damn.. Not sure what to do, my server spams the error so much the console is completely unusable now.

rich reef
#

A little more information on this. It seems trigger by a player specifically, as kicking the player stops the error from spamming. But the coordinates that the error stems from doesn't seem to correlate with where the player has been, but within the vicinity of their location. I've Teleported to the location of the error, and in one case, it was out in an open field, with no objects in sight, and the player hadn't moved over that square at all.

I'm trying to scan all the lua files in all the mods we use for that function, and there are quite a few references to scan through, but it's like looking for a needle in a haystack, especially since our mods really haven't changed lately.

Anyone with some ideas to brainstorm?

shy mantle
#

This is barely related, but when I was looking around Muldraugh on google maps for potential ideas (I dunno what for tbh) I found this bird flying just past the camera near the tornado shelter

#

I wonder why this tornado shelter didn't exist until recently tbh

small topaz
#

In B42, is it possible to detect via lua code whether a building has a randomized story or is burnt?

Edit: corrected question

#

Also, is it possible to prevent a building from having those properties?

bright fog
bright fog
small topaz
vale shadow
#

Does anyone know what pack file format has the first 4 bytes come out to the ASCII characters PZPK? I am reverse engineering the pack file from a mod for build 42

unreal niche
#

Hi do anybody know how to replace a audio pack from .bank folder i tried with

module Base
{
sound GeneratorLoop
{
category = Object,
is3D = true,
clip
{
file = media/sound/generator.ogg,
loop = true,
distanceMin = 2,
distanceMax = 50,
}
}
}

this script and

module base
{
sound GeneratorLoop
{
category = Object,
clip
{
file = media/sound/generator.wav
}
}
}

this script
but it doesnt work, sometimes it removes generator sounds and sometimes it does nothing

#

version is build 42

bright fog
bright fog
#

At least the way I've seen was to replace the sound files in the bank files themselves, which need to be manually installed

bronze yoke
bright fog
#

Also your mod will be incompatible with any mods doing .bank file replacement

unreal niche
#

its sucks in b41 you can replace any audio with scripts

#

its need a rework

unreal niche
#

wym

#

i have a mod about it

bright fog
#

Yea you can't, that system didn't change

unreal niche
#

sounds (fridge) mod is mine

#

look at it

bright fog
#

The sound system is a bit weird overall

#

That's why I said that I wasn't sure

#

Bcs I think some stuff can be changed but from experience you're also limited with a loooot of stuff

bronze yoke
#

there haven't been any major changes to how audio works in b42

bright fog
#

Like for zombie sound replacements, you have no choice but to code a new sound system

#

The main change to sound is on the music side with dynamic adaptative music or whatever it's called

#

If I remember right

bronze yoke
#

most of that was in b41 anyway, they just didn't add half of the music yet

#

the music rework is why b41's soundtrack is so flat 😅 i used to complain about it a lot

bright fog
#

Yea on the technical side it's nothing insanely new

unreal niche
bright fog
unreal niche
#

so what is the bandits mod

bright fog
#

It's not native NPCs

#

They use zombies

#

And mods that use IsoPlayer also have lots of limitations usually

unreal niche
#

you know what i mean

#

im talking about complication

bright fog
bright fog
#

Because I can assure you it was easier for me to add custom zombie sounds than it is to make a NPC mod Depressed

unreal niche
#

even its complicated you can make an npc mod, but you cant replace sounds without changing bank file completely thats what i mean

#

sorry for bad english

bright fog
#

You can

#

I mean

#

Like I said, you can program a whole sound system in Lua

unreal niche
#

i know but isnt it pointless

bright fog
#

Idk if it's viable for every single sounds in the game, probably not and you'll have limitations case per case

bright fog
unreal niche
#

i can change fridge sound with a easy script

#

but for generator sound i have to program a sound system

bright fog
#

Modding is this, sometimes you have limitations and you need to find ways around it. Of course I'm not saying it's good that we can't modify bank files, in fact I was the first to hate on the system when I started modding

bronze yoke
#

i don't really get why you can't overwrite the sound script here anyway

bright fog
#

No idea

bronze yoke
#

i think you need to work out how the generator sound works, if messing with the script doesn't do anything then it doesn't use that script

bright fog
#

Or it uses more than this script

unreal niche
vale shadow
vale shadow
# bright fog Uh, not sure I understood your question

If you look at a pack file in a hex editor, the first 4 bytes show PZPK in ASCII. I now know there are tools that can do what I was wanting to do, but at the time I was asking what format the pack files were… I think it is UI2

small topaz
#

Does anyone know why the game devs put the clothing item "bandeau" to the underwear top body location? In character creation, it is listed under Tshirts but its true location is in fact underwear top.

queen oasis
small topaz
#

oh no! that makes things complicated for me. XD XD

#

although I see that B41 had it on the Tshirt location so maybe I just revert which would solve all my issues...

queen oasis
#

I guess it can be a doo rag too, but I've never heard anyone call those a bandeau

queen oasis
#

might be a big ask but is there a way to reload a texturepack in game or from the menu?

true nova
queen oasis
#

dang

#

went to give my placeholder tiles some properties and man, I suck at this. it should be 4 tiles total tired

jolly goblet
#

Hi everyone, I've been trying to add a Depthmap to my tiles in my mod. I followed this tutorial. However, I'm getting an error.
https://www.youtube.com/watch?v=e0hcX1UWMD8
The geometries are generated, but the depth map, which would be an image of the shadows, is not generated.
The tileGeometry.txt file does show that it is filled with geometries.
Has anyone experienced this? Any suggestions?

00:00 What is a depthmap?
03:00 Project setup
04:20 Into the editor
05:16 Dropdowns
09:00 Tilesets and tile data
13:00 Geometry basics
14:40 Geometry buttons
16:32 Size editors
17:42 Camera views
19:00 Tileset controls
29:00 Creating a basic depthmap
38:10 Copying data to variants
46:08 Properties
54:14 View options
59:55 Advanced ...

▶ Play video
#
STACK TRACE
-----------------------------------------
Callframe at: saveTileset
function: onSave -- file: TileGeometryEditor_EditMode.lua line # 1258 | Vanilla
function: onSave -- file: TileGeometryEditor.lua line # 1217 | Vanilla
function: onMouseUp -- file: ISButton.lua line # 56 | Vanilla

ERROR: General      f:4157, t:1756168252449> ExceptionLogger.logException> Exception thrown
    java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method).
    Stack trace:
        java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        java.base/java.lang.reflect.Method.invoke(Unknown Source)
            ...
    Caused by: javax.imageio.IIOException: Can't create an ImageOutputStream!
        java.desktop/javax.imageio.ImageIO.write(Unknown Source)
        ...
        ... 24 more