#mod_development

1 messages Ā· Page 330 of 1

bright fog
#

Even models reload automatically

#

AnimSets, animations

#

Scripts we can hot reload them now apparently tho I haven't looked at it

#

Sounds I think you need to restart

frank elbow
#

I have no idea whether it actually works because I've never used it, but you can right click object fields & there's a context menu

bronze yoke
#

oh man, i never tried that šŸ˜…

#

that's super useful if it works

bright fog
#

What does that do ?

frank elbow
#

In theory, adds fields to a window that displays the value

lost chasm
#

the fact that the debug configuration is the same interface as the context menu ingame is hilarious

#

Can't be the only one who thinkgs that, can I? xD

bronze yoke
#

presumably you can see the value of that field no matter what part of the code you're in, and get breakpoints when that field is written to/read from

bronze yoke
lost chasm
#

amazing

#

it had to be hilarious then, there was no other option

bright fog
#

Explains the shitiness of it I guess

bronze yoke
#

you really have to git it a chance šŸ˜…

bright fog
#

I DID !

#

THAT'S WHAT I KEEP TELLING YOU

#

I keep trying to use it !

#

I keep trying it !

#

And I just cannot figure out how to navigate it !

lost chasm
#

is it updated or maintained still? or has it been untouched for 10 years? xD

frank elbow
#

Step into, step over, continue

bright fog
#

None of the windows placement makes sense or it's completely unclear what these even show and they don't even show what I expect them to see

bronze yoke
bright fog
frank elbow
#

Heck if I know lol

bronze yoke
#

sometimes trying to inspect objects throws errors but it's not like everything crashes when that happens

bright fog
#

You want me to start using this piece of shit and praising it ? Make a guide for it!

lost chasm
#

oh, are there no guides for it?

frank elbow
#

From a very quick check it seems the watch window is not all that reliable, but that's from testing exiting and re-entering the debugger

#

Maybe it works better when actually stepping through code

bright fog
lost chasm
#

but the debugger has 10 years! Far more than enough time for someone to make a guide for it

#

x_D

frank elbow
#

I don't know that it warrants a guide beyond labeling the things that are in it (& maybe how to get to it since people probably don't think to hit F11), but things are already labeled

#

If you have prior experience with a debugger it's pretty much just a barebones version of a normal one

bronze yoke
lost chasm
#

a guide makes everything easier and helps lots of people. Obviously most experienced people wont need it but, its always a good thing to bring to the world

bright fog
#

Exactly, I'd love to tell about it, I'd love to manage to use it, trust me

#

But I just cannot figure out, and in 2 months I'll try again, realize that anything that I expect to be right clickable actually isn't and that none of the windows can be moved around, adding to my confusion of navigating this shit, there's no going back button or idk what, there's nothing to allows me to properly navigate the whole UI

#

And I'm just completely lost

#

So until someone shows me in real time a complete usage example and how to navigate this crap, I just can't write anything about it

bronze yoke
#

if somebody sends a screenshot of the debugger i can point out the basic usage

lost chasm
#

@swift loom and @frank elbow , you make this sound easy. Why dont you show him in a short discord call? sounds like a good evening time xD

bright fog
#

Yea that's what I don't get, that it looks easy to them and I just can't figure it out lol

frank elbow
#

I'll send a screenshot in a moment, but letting you know it'll be from b41 in case anything has changed (I don't remember there being changes, but pointing that out regardless)

lost chasm
#

oh man, my spacebar is starting to show signs of death. This is not what I was expecting the day I convinced myself to learn this xD

frank elbow
bronze yoke
bright fog
#

jesus

#

Tho most of these I kind of knew, I just have issues navigating the whole UI overall

#

But I'll note it down and next time I end up with a potential usage of the debugger I'll try AGAIN

tranquil reef
#

Anyone know the max item displayname length

bright fog
#

Good question

bright fog
spring ice
#

Hi, I wanted to know if there is a script or some kind of database were all the "FootstepMaterial" values are located

#

Is a Property of IsoGridSquare

knotty path
#

does anyone know how to change the text that displays when you right click? For example, if you want to change the text about dismantling a cabinet from "dismantle" to "destroy"?

vital sedge
#

any way in lua to get what procedural list was used when filling container ie. container is crate and then what proc list was chosen like CrateFitnessWeights, CrateTools or CrateCanning?

supple briar
#

so, question, can we make new vehicle scenes in B42, and how does spawning work for those?

#

The fear is setting in that I might actually need to learn useful coding skills like Lua to make what I want work

steady fable
#

@silent zealot HEY!

I think one of the updates you did to the easydistro mod broke alot of my subscribers saves.

silent zealot
steady fable
#

The one yesterday at 5 AM EST.

#

I've had complaints since then, though I directed them to subscribe to your mod. It looks fine on my end.

steady fable
#

I do, yes

#

Its a critical dependancy of box more now

bronze yoke
#

it's because you added a dependency

#

the game won't load a mod without its dependencies, and nothing makes them automatically get the dependency mod/enable it on that save

steady fable
#

yeah that is problematic

#

I'll have to add a warning on the mod.info then.

bright fog
#

Just a straight up require

#

So activating your mods requires the dependency mods

#

Also when adding a new dependency in your mods, make sure to announce it everywhere on your modpage

#

Comments, patch note + description

bronze yoke
#

the require is the problem

#

because it's required the mod no longer loads for anyone who doesn't already have it, which is probably everyone

#

i also don't think it'll load for people who do have it unless they already had it enabled on that save

#

you don't really want to add requirements after a mod's release if you can avoid it

balmy ore
#

Anyone know if there’s a timeline for Brita’s?

bright fog
#

Timeline ?

#

Like when it releases for B42 ?

#

No idea

bronze yoke
#

most even

#

it'll stop the mod from loading, which will permanently remove every item, tile, etc from your mod from their save

bright fog
#

So if you properly announce it you won't get any issues

#

I've done that multiple times already without any problems

#

I've never gotten a single comment saying they got issues, bcs I wrote a big ass comment in header format saying there's a ndw dependency

bronze yoke
#

because your mods don't add very many items or tiles right?

bright fog
bronze yoke
#

the mod doesn't load whatsoever if the dependency is not enabled

#

it will be as if the mod isn't even enabled

bright fog
#

Tbf, I wouldn't give a shit anyway

bronze yoke
#

they just have to reenable the mod and it's fine, but for item + tile mods it permanently damages the save file of more or less everyone who uses the mod, to the extent that they might want to start over their save entirely - people will be really pissed in this case, and it's kind of justifiable

bright fog
#

Embrace the chaos 8)

bronze yoke
#

if you remember the kind of harrassment honesty received a few months ago for a way less serious issue it's really not worth it

bright fog
#

He caused it actually, he meant to do that

bronze yoke
#

that's not what he said

#

he came into the modding discord and said that he hadn't meant to make people's saves unplayable (and it is kind of unintuitive that it does that)

bright fog
#

I talked with him in vc, and he stated multiple times that he decided to nuke them

#

He was proud of it at least

bronze yoke
#

he wanted to remove the map permanently but did he really say that he intended to brick every save file using the map?

bright fog
#

Maybe a change of state of mind ?

bright fog
bronze yoke
#

not that the sheer level of harrassment he received was justifiable either way

bright fog
#

Idk tbf, I get the desire to give a lesson to mod users

#

Kind of extreme, but I get it

#

That's why he stated he meant it, because he was annoyed at mod users complaining

bronze yoke
#

if it really was intentional then i think it was really stupid of him but it didn't sound like it was when he spoke about it

bright fog
#

Guess we got two different story šŸ˜…

#

Stupid ? Perhaps. Kind of feels nice to show them you don't owe them anything tho

bronze yoke
#

it didn't sound like he came out of the situation 'feeling nice' though šŸ˜…

bright fog
#

That can definitely be understandable at the time with the amount of hate you receive

supple briar
#

I think purposely bricking people's saves to "teach them a lesson" is well beyond the level of stupid

silent zealot
#

People will still complain though. Because they are people.

silent zealot
#

Personally I think they should cut back on the bloated feature list in their framework, and just start with "here are all the guns in B42 with vanilla-style features"

balmy ore
silent zealot
#

I never used any of it other than the different magazine sizes, and that wouldn't be hard to do (having looked around while letting the survival rifle use two calibres automatically)

#

Their armour pack would be easy but time consuming to port to B42.

#

So many items, lots of tweaks to better work on B42 (tags, discomfort, etc) and all recipes need to be redone.

bronze yoke
#

it was a map mod

#

he removed it from the workshop, but you can't remove maps from a save, nor can you launch the save without them, so it bricked every save using the mod

#

it was a really major drama, he received a crazy amount of harrassment over it

supple briar
silent zealot
bronze yoke
#

well yeah, you can do anything, but it's not something the game just lets you do

silent zealot
#

With the new fluid system it's finally possible to make a vickers water-cooled machine gun.

supple briar
bleak mortar
#

im trying to make a trap give me a dead deer, whats the name for a dead deer types?

silent zealot
#

Looking through the britas weapon list, so many redundant weapons in there.

silent zealot
#

I'm not sure if you can get it to do dead ones anymore

bleak mortar
silent zealot
#

(without coding your own variation)

bleak mortar
#

i think i might be able to depending on if i can find the name of the deer corpse

supple briar
bleak mortar
#

just dont know where i would find it in the items list

silent zealot
#

A better option would probably to be to hook the "check trap" function and kill the deer after it is spawned in the world

#

dead animals are weird not-quite-items

bleak mortar
#

i aint that good at coding lol but i can try

silent zealot
#

When I had a look a while ago I couldn't see an easy "dead animal item" to spawn

bleak mortar
#

yeah me neither, where would i look to find the check trap ui interaction

silent zealot
#

One approach: you know it says "check trap" on the context menu so you search for that knowing it will be in the translation files: ContextMenu_Check_Trap = "Check Trap",

#

then search for ContextMenu_Check_Trap which has one hit in a fish net thing and one in ISTrapMenu.doTrapMenu() in media\lua\server\Traps\ISUI\ISTrapMenu.lua

#

that leads you to ISTrapMenu.onCheckTrap, which leads you to the timed action ISCheckTrapAction

#

and the timed action will do somethingin the :complete() step

bleak mortar
#

i will put this together, you have been a great help, i greatly appretiate that.

tranquil reef
#

Is there a way to see if my distributions script is working without teleporting around and checking crates

silent zealot
#

yes

#

cheats -> enable lootzed

#

right click a container in the inventory view, LootZed

#

You can see what can spawn in it.

tranquil reef
#

Ah, thank you.

silent zealot
#

Note: this tool reads the lua distribution table, if you change that the normal way (i.e. when the lua script is loaded) this is fine but if you do something fancy later on you need to re-sync the lua and java loot tables.

#

the cheats -> item picker will also indicate if an item is in any loot tables (one of the columsn on the right side, at least in B42)

silent zealot
#

May need to make a DeadDeer item, like the existing Deadrabbit etc items

bleak mortar
#

yeah thats what i was trying to find out what the item was called for a deer corpse

silent zealot
#

Wait, that was meant for @bleak mortar

tranquil reef
silent zealot
#

Sorry!

#

I blame flu

bleak mortar
#

if i can find it i can code it easily

silent zealot
#

I use VSCode, open the games media directory

#

makes searching very quick

bleak mortar
#

theres a search function?

silent zealot
#

A really fast one!

#

I keep a VSCode open with media and zombie (decompiled java) as a reference.

#

Can add other mods in if I want to include them too:

bleak mortar
#

ill have to come back to this later but i appretiate all your help man, incredibly thoughtful and kind, but right now my freind is wanting to play with me so ill have to put my mod on hold.

supple briar
#

So it turns out PZ already has a Racecar spawn zone at Irvington, it's just unused due to the game lacking Racecars

silent zealot
#

If only someone was making a mod to add racecars....

supple briar
#

gotta figure out how to use them now

#

So here's what I can see, racecar/parkingstall, but I can't find a racecar zone in the vehicle zone defs

#

got em working now

#

So the only issue is that it covers every parking stall in the race track, which while not much, does cause some issues

#

not many though

opal temple
#

I want to let guns be dismantled into Base.Reinforcement_Points. The number of Reinforcement Points received should be based on the gun’s metalValue : you get 1 Reinforcement Point for every 5 metalValue, with remainders of 2 rounded down and 3 rounded up. But I keep getting errors. I’ve even asked ChatGPT and still can’t fix it—where am I going wrong? @@

#
Events.OnFillInventoryObjectContextMenu.Add(function(player, context, items)
    for _, item in ipairs(items) do
        local actualItem = item
        if instanceof(item, "InventoryItem") then
            actualItem = item
        elseif item.items then
            actualItem = item.items[1]
        end

        if actualItem and actualItem:getSubCategory() == "Firearm" then
            context:addOption("IGUI_GetReinforcementPoints", actualItem, function()
                local metalValue = actualItem:getMetalValue() or 0
                local points = math.floor((metalValue + 2) / 5)
                local inv = player:getInventory();
                if points > 0 then
                    inv:AddItem("Base.Reinforcement_Points", points)
                    player:getInventory():Remove(actualItem)
                    player:Say("IGUI_Get" .. points .. "IGUI_Points")
                else
                    player:Say("IGUI_CantBreakDown")
                end
            end)
        end
    end
end)
red tiger
#

Been deep in the wells of GLSL shaders. I am working on making a UI framework around them. Here is my progress from the past week of free time:

#

3D transforms with parent-child UI elements, borders, rounded-border settings, colors, and a rewrite of the game's font renderer so that they can be transformed in 3D space.

#

HTML / CSS-like rendering is possible in PZ UI using GLSL shaders.

#

This next week I'll work on getting a functioning layout tree where things like z-index CSS rules and width / height rules will be taken into account.

#

If that's done I'll work on pagination for things like <textarea> or <p> elements.

silent zealot
#

I hate embedding function definitions in a function call like that, I find it makes it a lot harder to troubleshoot (it is a valid thing to do, I just hate it!)

#

Also, what errors are you getting?

silent zealot
#

I'm not sure if that is completely outside the scope of shaders or not

#

They seem to do almost everything, instead of just shading as the name implies

opal temple
#
LOG  : Lua          f:8351, t:1748919026151> addAttachment
LOG  : General      f:8526, t:1748919029065> -----------------------------------------
STACK TRACE
-----------------------------------------
function: actualItem -- file: CA_Reinforcement_Points.lua line # 14 | MOD: CA Firearm
function: onMouseUp -- file: ISContextMenu.lua line # 92 | Vanilla

LOG  : General      f:8526, t:1748919029065> Object tried to call nil in actualItem
ERROR: General      f:8526, t:1748919032567> ExceptionLogger.logException> Exception thrown
    java.lang.RuntimeException: Object tried to call nil in actualItem at KahluaUtil.fail(KahluaUtil.java:100).
    Stack trace:
        se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:100)
        se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
        se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
        se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
        se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1902)
        se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
        zombie.ui.UIElement.onMouseUp(UIElement.java:1633)
        zombie.ui.UIElement.onConsumeMouseButtonUp(UIElement.java:1695)
        zombie.ui.UIManager.updateMouseButtons(UIManager.java:855)
        zombie.ui.UIManager.update(UIManager.java:715)
        zombie.GameWindow.logic(GameWindow.java:328)
        zombie.GameWindow.frameStep(GameWindow.java:917)
        zombie.GameWindow.mainThreadStep(GameWindow.java:643)
        zombie.MainThread.mainLoop(MainThread.java:76)
        java.base/java.lang.Thread.run(Unknown Source)
LOG  : General      f:8526, t:1748919032567> -----------------------------------------
STACK TRACE
-----------------------------------------
function: actualItem -- file: CA_Reinforcement_Points.lua line # 14 | MOD: CA Firearm
function: onMouseUp -- file: ISContextMenu.lua line # 92 | Vanilla

LOG  : General      f:8526, t:1748919032567> 
#

When I click IGUI_GetReinforcementPoints in the context menu, an error pops up. The same happens when I right-click other items.

silent zealot
#

My response to a previous "fix this AI code" request

#

Look at line 14, look at what function of actualitem you're calling, think about why it is nil interest of a valid function

#

Most likely actualitem is nil or the AI made up a function call that does not exist. Because AI does that. A lot.

#

Remember large language models are for text, not code. And with text it's fine to use a slightly different word or phrase things a little differently, but in code it is not.

lost chasm
vital sedge
silent zealot
#

I don't use that,. so I don't know how long it takes.

#

Searching feels near-instant

opal temple
silent zealot
#

example of adding something to right click context menu:

local doDIYContextMenu = function(playerNum, context, items)
    print("##### doDIYContextMenu()")
    local primaryItem = items[1]
    if not instanceof(primaryItem, "InventoryItem") then
        primaryItem = primaryItem.items[1]
    end

    if primaryItem:hasTag("DIYSchematic") then
        print("##### It's a DIY Scematic")
        local playerObj = getSpecificPlayer(playerNum)
        readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
    end
end

Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
#

Then the function DIYonLiteratureItems is what gets called by the context menu option that was added

#

I'm not sure what you're trying to do with adding CharcoalPowder and Rubber to the player inventory before an end statement that doesn't match up to anything, or why that is relevant.

silent zealot
#

Rip Anything is a problem because if you can't programmaticly add tags then they are ignored by the recipe system, which has already decided which recipes affect which items and it doesn't re-check. Might be away to force it to refresh, but I've not looked hard for that.

vital sedge
#

@silent zealot i see you know a lot about code, especially java one, am i right that you can't get information about chosen procList for the container, from any lua function?

opal temple
# silent zealot example of adding something to right click context menu: ```lua local doDIYConte...

I tried changing it to this, and there are no errors. It feels really interesting—thank you so much.

local GetReinforcementPoints = function(playerNum, context, items)
    print("##### GetReinforcementPoints()")
    local primaryItem = items[1]
    if not instanceof(primaryItem, "InventoryItem") then
        primaryItem = primaryItem.items[1]
    end

    if primaryItem:hasTag("Firearm") then
        print("##### It's a DIY Schematic")
        local playerObj = getSpecificPlayer(playerNum)
        readOption = context:addOption(getText("ContextMenu_GetReinforcementPoints"), items, DIYonLiteratureItems, playerObj);
    else
        print("##### It's not a DIY Schematic")
    end
end

Events.OnFillInventoryObjectContextMenu.Add(GetReinforcementPoints)

Next, I’ll try to add functionality to the menu…

silent zealot
#

That is going to call DIYonLiteratureItems() which will fail

#

That code is just for adding the contect menu option. Then it calls a function when that option is selected.

#

Instead of DIYonLiteratureItems, you need it to be calling a function that turns guns into your reincforcement items.

#

Speaking of which , you need to make the item definitions for those if you have not already done so.

opal temple
#

I’ve been thinking for a long time and still don’t know where to start. I’ve been awake for nearly 24 hours and feel a bit dizzy. Could you please help me once more and give me a few more hints? Oh, the items are already defined.

red tiger
#

I'm more concerned right now with getting the maths right first.

#

It'll be interesting getting anti-aliasing working for this:

#

It's nice to be able to take all the normal operations for these sorts of things and then apply it in a 3D space as well.

silent zealot
#

But you havn't told it what to do when you select that entry.

red tiger
#

@silent zealot Sorry wrong reply.

#

@slim swan Above was for you on the modding discord.

silent zealot
#

Also, get some sleep. šŸ˜›

silent zealot
red tiger
#

I'm simply happy to have a solution where I can use proper matrix transforms to augment what is traditionally painted in 2D space in 3D.

silent zealot
#

That is helpful

red tiger
#

Computational Anti-Aliasing was for Rocco.

#

And it's not nonsensical. It's actual practice.

silent zealot
#

yes, but probably not for what I asked about.

red tiger
#

Render-Shader passes are for more proper anti-aliasing techniques. Because I'm doing more hackish ways to get shading working, I don't have this option.

silent zealot
#

TurboEncabulator.ReticulateSplines()

#

I wonder if we can repeat that often enough that AI starts to pick it up 🤣

slim swan
red tiger
slim swan
#

For example, when I’m near a campfire or fireplace, it could directly display the remaining time or fuel amount.

red tiger
#

It's building up a proper API and framework to get that to be streamlined in a mod production sense.

#

Imagine having menus like floating cards that can "fall away" when disabled.

#

There's a lot of potential here.

silent zealot
#

If people can look at the 3d models that closely they are going to realize how terrible they are lol

red tiger
#

Like a good example would be say a card-game mod.

silent zealot
#

But it is a great dvelopment in potential UI uses

red tiger
#

Dynamic and modular shaders takes time and testing / adjustments to make unfortunately but I think it's worth the time.

#

I could quickly make hardcoded UI for my own needs but I don't think this community has many rendering programmers. =)

silent zealot
#

I suspect this community has one, and it's you.

red tiger
#

There's a few for sure.

#

Might tickle them into talking when seeing this stuff.

silent zealot
#

We do have lots of people that coudl learn if motivated.

red tiger
#

I think it'd be fun to write a shader UI + mod that emulates old MsDOS computers from the 90's.

opal temple
# silent zealot You've told the game "add an entry to the context menu when I right click on the...

I tried writing a block of code, but it still throws an error. I think the problem is with getTag("MetalValue").
I can't stay up any longer — I'll continue trying after I wake up.
Good night, fellow survivors...fate_afo_sleep

function DIYonLiteratureItems(playerObj, items)
    local MetalValue = getTag("MetalValue")
    local points = (MetalValue / 5)
    local inv = player:getInventory();
            if points > 0 then
                inv:AddItem("Base.Reinforcement_Points", points);
                player:getInventory():Remove(primaryItem)
                player:Say("IGUI_Get" .. points .. "IGUI_Points")
            else
                player:Say("IGUI_CantBreakDown")
            end
        
    
end
silent zealot
#

You should really give the function a more appropriate name instead of copying the example name from DIY literature code

#

Also, that looks like AI generated code.

#

It makes no sense.

neon palm
#

Hey guys wrong chat but what should I do by this errors? ERROR: General , 1748895359701> 134,561,989,223> LuaManager.getFunctionObject> no such function "Recipe.OnGiveXP.MetalWelding50"
ERROR: General , 1748895359702> 134,561,989,223> RecipeManager.LoadedAfterLua> no such function LuaGiveXP = "Recipe.OnGiveXP.MetalWelding50" in recipe "Craft Silencer"
ERROR: General , 1748895359704> 134,561,989,226> LuaManager.getFunctionObject> no such function "Recipe.OnGiveXP.Reloading3"
ERROR: General , 1748895359704> 134,561,989,226> RecipeManager.LoadedAfterLua> no such function LuaGiveXP = "Recipe.OnGiveXP.Reloading3" in recipe "Make 5.7x28mm [VFE]"
ERROR: General , 1748895359704> 134,561,989,226> LuaManager.getFunctionObject> no such function "Recipe.OnGiveXP.Reloading3"
ERROR: General , 1748895359704> 134,561,989,226> RecipeManager.LoadedAfterLua> no such function LuaGiveXP = "Recipe.OnGiveXP.Reloading3" in recipe "Make 4.6x30mm [VFE]"

silent zealot
#

It's made up a whole new way of using metalValue that doesn't work

silent zealot
neon palm
#

Like I don’t know which mod that is

silent zealot
#

[VFE] is a pretty big hint

neon palm
#

Ok

silent zealot
#

As are references to "craft silencer" and "make 5.7x28mm"

opal temple
silent zealot
#

Vanilla firearms expanded probably, if not it's something else to do with firearms

silent zealot
#

Lookup "Zomboid javadocs" and see what functions exist when you search for "metalValue"

#

There is probably a function for InventoryItem objects to get the metal value as a number

bright fog
silent zealot
bright fog
silent zealot
#

I'm not even sure if there is a getTag. There is getTags and hasTag

bright fog
#

@opal temple @neon palm both of you check this link

bright fog
#

Tho no idea, I'd have to check the java doc

frank elbow
#

@neon palm may be looking for #mod_support given the message before the errors

#

(I see now that they have a message there already)

opal temple
opal temple
bright fog
#

Then no that's not it

frank elbow
# neon palm Where?

If you're asking which message I'm referring to, I mean the text in your message prior to the error text

#

i.e., it implied you were not developing a mod but were instead having mod problems

bright fog
opal temple
bright fog
#

I remember it just being for metal or 0 for non metalic or some shit like that

#

Did you check if it's different for different firearms ?

opal temple
#

I saw that the Firearm mod gives guns this attribute, so I used it accordingly.

bright fog
#

You can't base yourself on mods for codes unless you're making an addon for one, which I would guess in your case you're not ?

opal temple
#

It also has it.
item AssaultRifle2

#

local MetalValue = primaryItem:getMetalValue()

bright fog
opal temple
#

I'm not sure about that, but I can set it on my firearms and then disassemble them based on that value.

silent zealot
# bright fog What about vanilla weapons ?

Rifles are 45, pistols are 30 and when you cut down the barrel of a JS-2000 you remove 10 units of metal. But cutting down the barrels on a double barreled shotgun doesn't remove any metal at all.

#

So, typical zomboid accuracy. šŸ˜›

tranquil reef
#

Anyone know if vomiting was planned and scrapped, or if its still planned

#

There's an animation for it, but I've never heard anything else about it

frank elbow
tranquil reef
#

2016, damn

#

holy shit, 9 years ago

#

well, guess I don't have to worry about them releasing the mechanic a day after I release my mod lol

silent zealot
#

I guess it's there if someone wants to mod in vomiting

silent zealot
#

Instant max discomfort meter

mossy steeple
#

howdy- has anyone here happened to look into how the new jog-bumping mechanics work? i've been looking to revert it back to the previous b42.7 behaviour but unfortunately i'm quite a novice modder and haven't been able to figure it out myself.

#

not totally sure where that is in the game files, or if it's even easily modifiable

mossy steeple
#

the random turn your character does when you bump into zombies- it feels really bad because it doesn't just shunt you to the side, it actively changes your direction which then forces you into the turn-around animation to move in the direction you were already holding

#

also it doesn't turn you if you do it while using the walk-to command

bright fog
#

Ooooh is that the shit that's happening with zombie lunges pushing you in random directions ?

mossy steeple
#

i think it's different but it feels very similar to that, imo

bright fog
#

No someone was talking about the game randomly changing your direction

#

It's not the thing where if you aim your character can end up rotating around and being terribly placed

mossy steeple
#
  • getting knocked back, even falling over from a lunge? cool, that's fine, makes it risky if you're ill-prepared
  • getting knocked back and randomly turning a full 180 degrees somehow? there's the problem
bright fog
#

I think they explained it's something where the character will end up in the wrong orientation

tranquil reef
#

that's actually really helpful lol, I probably would've thought about it somewhere along the way, but I wouldn't have realized the CanEat tag would held me detect it. I probably would've made a table and tried to manually add each mask

mossy steeple
#

not familiar with what you're mentioning myself, unfortunately

#

the random turns i mean, not the caneat tag stuff

bleak mortar
#

something here is bugging out and i have no idea why

red tiger
#

Looking smooth.

#

Doing pixel-padding on quad render so there's room for the AA code to breathe.

solar rover
#

SoundGain and NPCSoundBoost, what the heck are they? all I get from the wiki is DEPRECATED yet people keep adding them to the weapon mods. Any help?

bronze yoke
#

they don't do anything, people just guess when they add them to their mods

solar rover
#

(╯°▔°)╯︵ ┻━┻

bronze yoke
#

don't trust other mods, most modders genuinely have no idea what's going on šŸ˜…

solar rover
#

Yeah, I'm running through CJ's firearms mod. He did a ton of work and I respect that but a lot of it looks copy/paste. VSS with subsonic rounds and built in suppressor with 130 SoundRadius 😦

#

Going to edit his 40-50 guns for my server before I start throwing my own stuff in.

#

Can I generally ignore anything listed as depreciated on the pz wiki?

bronze yoke
#

yeah, when we say 'deprecated' we actually mean 'removed' lol

solar rover
#

heheh figured

#

Appreciated albion

ancient grail
solar rover
#

Yeah I figured I could test the setting I messaged you about but these two I wasnt sure how to figure out

bronze yoke
#

if they aren't recognised by the game at all they won't be on the wiki

#

when they're marked as deprecated that means the game does recognise and handle them, but that they just don't actually do anything

#

so they won't go to moddata

untold turtle
#

I need modding assistance with making custom vehicles (blood/damage overlay textures)

solar rover
untold turtle
solar rover
#

Does your script look something like this

        textureLights = Vehicles/vehicle_dodgeram_lights,
        textureDamage1Overlay = Vehicles/fr_Veh_Blood_Mask,
        textureDamage2Overlay = Vehicles/fr_Veh_Blood_Hvy,
        textureDamage1Shell = Vehicles/fr_Veh_Damage1,
        textureDamage2Shell = Vehicles/fr_Veh_Damage2,
        textureRust = Vehicles/fr_Veh_Mud,
silent zealot
#

Which isn't something that normally happens, because the deer woudl be generated as a live animal not a corpse item with food values assigned in that function.

untold turtle
# solar rover Does your script look something like this ``` textureMask = Vehicles/veh...

My scripts look like that yea

        textureMask = Vehicles/vehicle_Humvee_Vehicle_Mask,
        textureLights = Vehicles/vehicle_Humvee_Base_Lights,
        textureDamage1Shell = Vehicles/vehicle_Humvee_Base_Damage_Mask1,
        textureDamage2Shell = Vehicles/vehicle_Humvee_Base_Damage_Mask2,
        textureDamage1Overlay = Vehicles/vehicle_Humvee_Base_Blood1,
        textureDamage2Overlay = Vehicles/vehicle_Humvee_Base_Blood2,
        textureRust = Vehicles/vehicle_Humvee_Base_Rust-Dirt,
sonic needle
#

Beat ya jord >:D

#

perfect 0.1ms timing noice.

untold turtle
#

Shush you Ash xD

mellow frigate
#

what should I do to ensure a custom variable added to my IsoPlayer is correctly synchronized in MP ? I use playerObj:setVariable("myFancyVariableName", true)

opal temple
#

@silent zealot
Could you please take another look and see what’s wrong?šŸ™
I want to show a confirmation dialog when the menu option is clicked, and only perform the dismantle action after confirming.
But right now the right‐click menu option doesn’t even appear.
I referenced the Split Items mod’s UI creation code.

local GetReinforcementPoints = function(playerNum, context, items)
    print("##### GetReinforcementPoints()")
    local firearms = {}

    for _, item in ipairs(items) do
        local actualItem = item
        if not instanceof(actualItem, "InventoryItem") then
            actualItem = actualItem.items[1]
        end
        if actualItem and actualItem:hasTag("Firearm") then
            table.insert(firearms, actualItem)
        end
    end

    if #firearms > 0 then
        local playerObj = getSpecificPlayer(playerNum)
        context:addOption(
            getText("ContextMenu_GetReinforcementPoints"),items,useConfirmUI,playerObj,firearms)
    else
        print("##### No Firearm selected")
    end
end


useConfirmUI = ISCollapsableWindow:derive("ReinforcementPointsConfirmUI") --建立UIēš„å…ØåŸŸå‘¼å«

function useConfirmUI:new(x, y, width, height, player, firearms, totalPoints) -- 建立UI Building UI
    local o = {}
    o = ISCollapsableWindow:new(x, y, width, height)
    setmetatable(o, self)
    self.__index = self
    o:setResizable(false)
    o.pin = true
    o.title = getText("UI_BreakDown_Title", items[1]:getDisplayName())
    o.player = player
    o.items = items
    o.firearms = firearms
    o.totalPoints = totalPoints

    return o
end


function useConfirmUI:initialise() --在UIäø­åŠ å…„ē¢ŗčŖčˆ‡å–ę¶ˆęŒ‰éˆ• Add confirm and cancel buttons to the UI
    ISCollapsableWindow.initialise(self)

    self.splitButton = ISButton:new(10, 140, 135, 30, getText("UI_CA_BreakItems_Confirm"), self, useConfirmUI.onMouseDown)
    self.splitButton.internal = "CONFIRM"
    self.splitButton:initialise()
    self.splitButton:instantiate()
    self:addChild(self.splitButton)

    self.closeButton = ISButton:new(155, 140, 135, 30, getText("UI_CA_BreakItems_Cancel"), self, useConfirmUI.onMouseDown)
    self.closeButton.internal = "CLOSE"
    self.closeButton:initialise()
    self.closeButton:instantiate()
    self:addChild(self.closeButton)
end

function useConfirmUI:onMouseDown(button) --ęŖ¢ęŸ„ēŽ©å®¶ęŒ‰ēš„ę˜Æå“Ŗå€‹ęŒ‰éˆ• äø¦åšå‡ŗęŒ‰äø‹å¾Œēš„å‹•ä½œ Check which button the player pressed and perform the action after pressing it
    if (button.internal == "CONFIRM") then

        local inv = playerObj:getInventory()
        local totalPoints = 0

        for _, primaryItem in ipairs(firearms) do
            local MetalValue = primaryItem:getMetalValue() or 0
            local points = math.floor((MetalValue / 5) + 0.5)
            if points > 5 then
                totalPoints = totalPoints + points
                while points >= 0.5 do
                    inv:AddItem("CrisisAction.Reinforcement_Points")
                    playerObj:getInventory():Remove(primaryItem)
                    points = points - 1
                end
            else
                playerObj:Say("IGUI_CantBreakDown")
            end
        end

        if totalPoints > 0 then
            playerObj:Say("IGUI_Get" .. totalPoints .. "IGUI_Points")
        end
        self:close()

    elseif (button.internal == "CLOSE") then
        self:close()
    else
        ISCollapsableWindow.onMouseDown(self, button)
    end
end
silent zealot
#

Also, rename your functions so it is easier to tell what things do. GetReinforcementPoints should be called something like DisassembleFirearmContextMenu or some such

solar rover
silent zealot
opal temple
silent zealot
#

I'm not sure if setVariables is client-only though, that seems to mainly be how they are used and I've not played with them before.

#

Is using player:modData an option?

coarse flame
#

Does anyone know of any mod that adds something along the lines of high tech equipment? I've always wondered if its possible to have a sort of shoulder-mounted turret or something along the lines of that.

silent zealot
#

I've seen power armor, but mechanically that's just armor with high protection stats.

#

Also: rayguns, electromagnetic rifles, electric weapons, automated fixed turrets...

drifting ore
#

Are we allowed to make total conversion mods

bright fog
#

Like to completely overhaul the game ?

drifting ore
#

Like Turn the game into something else

#

Like how Counterstrike is a Total Conversion of Half Life

#

Or Fallout London is a Total Conversion of Fallout 4

#

Or Starwind, which is a mod that converts Morrowind into Star Wars

bright fog
drifting ore
#

Probably gonna be both extremely hard and possibly hopeless but imma try

silent zealot
#

It's very much built around survivor vs: horde of zombies

drifting ore
#

Really? I honestly saw it more as just a Survival Sandbox in general, with realism foundations

silent zealot
#

And lots of game logic is in the java side, which while not impossible to mod... you want to think very carefully before modding any java.

silent zealot
#

If you want to go full-on mundane survival, there's definitely an audience for hardcore survival stuff. (not me!)

drifting ore
#

I think it’s worth a shot, If I did a total conversion there’d probably be only one aspect of it that’s wildly apart from the game

#

But everything else at least from what I’ve observed is entirely possible within the game

silent zealot
#

Do you have a plan for your total conversion?

#

Or just "chaneg all the things!" lol

drifting ore
#

Yeah, we have a plan on what we need to do, and we want to do a basis of whatever that is before actually building something cohesive

#

Make bricks before building with them

silent zealot
#

We can probably help you identify likely stumbling blocks so you can investigate those early on/plan around them.

silent zealot
drifting ore
#

That’s a metaphor

silent zealot
#

Also, be aware B42 crafting is still getting worked on, so you might end up duplicating the official changes

silent zealot
drifting ore
#

An RPG, basically.

silent zealot
#

When I said we'd help you identify stumbling blocks?

#

Monsters

#

NPCS

#

two big ones right there

drifting ore
#

Monsters can’t be that difficult

#

I assume it’s mostly behaviors that need work, otherwise it’s animations & health & damage

#

Modeling as well

untold turtle
silent zealot
#

Have you noticed teh lack of new animal mods for B42?

frank elbow
#

You have animals to work with in b42, but since we don't have NPCs monsters in mods have pretty much always just been repurposed zombies (same with NPCs)

drifting ore
#

Then again, I have limited experience modding in the first place

silent zealot
#

AFAIK the animation stuff for animals is broken in a way that stops you adding anything new.

frank elbow
#

I guess you don't have animals to work with then lol

silent zealot
#

And overriding zombies selectively is... a challenge.

#

Because it's all built for one type of enemy only

frank elbow
drifting ore
#

True, I’m probably gonna be coming in the help channels often asking for help or advice

drifting ore
#

The idea itself requires a bit of innovation. People have done NPC’s, they’ve done a few things like that, but never to this scale.

silent zealot
#

NPCs... you can have a loot at Bandits/Week One/etc. Those mods are 1) a horrible janky mess and 2) absolutely amazing that so much was done as mods with the current base

bronze yoke
#

we've already added a new animal, there's no significant hurdle, the people saying it's impossible are just making it up for some reason (as with most things people say are impossible i've noticed???)

drifting ore
#

I thought about dming Slayer ab it

silent zealot
drifting ore
#

Other than the NPC’s, Monster, Dialogue, and… I guess aspects like quests or whatever that are expected in an RPG, Everything else should be standard. New Tiles, new armor, new items, new guns. Lots of modeling but I’m willing to endure

#

New Cars

#

These are all things people have done before iirc

bronze yoke
#

it's a LOT of asset work

#

but there isn't any specific technical reason why you can't, you just do it

silent zealot
drifting ore
#

I honestly would like to know if what I’m proposing, if any of it is even possible?

silent zealot
#

A lot of it can be done yes, just a matter of time and effort

drifting ore
#

Then I guess I should try and just do it then.

silent zealot
#

Monsters & NPCs are the only two I see as potential big issues.

#

I suggest break it up in scope and choose what to focus on to start with.

drifting ore
#

I mentioned dialogue, quests, and things like that too

drifting ore
silent zealot
#

If you have NPCs I don't think dialogue will be a huge problem to implement

drifting ore
#

Think old RPG’s

#

Dialogue box

#

Depending on what is said will influence certain behavior/actions of the world or NPC’s

silent zealot
#

Yes, you can just track whatever stats you want with the NPC data

drifting ore
#

We’d have to probably add a new skill

#

Again, also possible

#

But something speech related

#

I guess(?)

silent zealot
#

Not essential, but probably something you want.

drifting ore
#

All of this while keeping most of the core mechanics of Zomboid

#

Sounds like a party tbh

silent zealot
#

I don't know if you can add a new skill as a "this is a skill" but if you can't, you can definitely just track XP/level in player modData to get the same result.

drifting ore
#

I know some mods have added skills

#

Like that one brewing mod

#

My hope is we can get a good enough framework with everything to where we can finally get into the design aspect of it. Basically, design the LEGO pieces, and then build something out of it.

silent zealot
#

Yeah, not something I'd worry about; just something to code when you get to it.

drifting ore
#

But thank you, I appreciate your wisdom

#

I can’t say for sure this will become a thing, but we’ll see. It simply has to leave the ā€œPipe-Dreamā€ Phase

#

Methinks

silent zealot
#

It's a lot of work!

#

Ideally you'd find a group keen on the idea

drifting ore
#

It’s just me and a buddy

silent zealot
#

but that has it's own challenges dealing with people lol

drifting ore
#

2 people can’t possibly do it by themselves, it could take much longer than a group doing it

#

But we’re both insane and thuggish enough

#

We will probably get more people if we need to

silent zealot
#

Not on the workshop yet?

bronze yoke
#

it's not finished

uncut pewter
#

does anyone know where can i ask a commsion for a map someone can make me ?

fresh river
#

If i hypothetically want to make a map based on my home city, what should I know?

silent zealot
silent zealot
#

If you're on B42 there is a fan-made tool update; check the sticky posts in the mapping channel.

fresh river
#

Thanks! Is there a limit to map size?

uncut pewter
#

can you send me the discord channel @silent zealot please

silent zealot
#

Apparently not.

#

google "PZ Modding Discord" I guess

tawdry gale
#

Hello, I'm currently creating a mod for fun.

But I'm encountering an error:

ERROR: General     , 1749044677211> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in checkForInfections
    at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:92)
    at zombie.gameStates.IngameState.updateInternal(IngameState.java:1624)
    at zombie.gameStates.IngameState.update(IngameState.java:1333)
    at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
    at zombie.GameWindow.logic(GameWindow.java:298)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:765)
    at zombie.GameWindow.run_ez(GameWindow.java:681)
    at zombie.GameWindow.mainThread(GameWindow.java:495)
    at java.base/java.lang.Thread.run(Unknown Source)

I have no idea how to fix it, and I don't really understand it.

Do you have any solutions?

Here is the GitHub link:

[github link]

GitHub

Adds configurable bite immunity system to Project Zomboid. Players can have a chance to be immune to zombie bites, scratches, and lacerations based on configurable percentage. - ToRaNek/BiteMunity-PZ

silent zealot
#

The error should tell you which line has the issue

#

"tried to call nil" normally means you're trying to call a methoid that does not exist, either because of a typo or because the object with the method isn't the right thing (e.g.: it's nil instead of something useful)

tawdry gale
# silent zealot "tried to call nil" normally means you're trying to call a methoid that does not...

Ahh okay, but the method exists in biteMunityClient

function BiteMunityClient.checkForInfections()
    
    if not player then return end
    
    -- VƩrification de sƩcuritƩ pour getGameTime()
    local gameTime = getGameTime()
    if not gameTime then return end
    
    -- Alternative plus sƻre pour calculer le temps
    local currentFrame = gameTime:getWorldAgeHours()
    if not currentFrame then
        -- Fallback vers un compteur simple si getWorldAgeHours() Ʃchoue
        currentFrame = lastInfectionCheck + 1
    else
        currentFrame = currentFrame * 3600 + (gameTime:getTimeOfDay() or 0)
    end
    
    if currentFrame - lastInfectionCheck < CHECK_INTERVAL then
        return
    end
    [...]
end
silent zealot
#

Which call is triggering the error?

#

it's something in the checkForInfections function

#

the full error should give a line number

tawdry gale
#

yeah line 82 but its all function ahah

I'll add a few debug print and get back to you

normal galleon
#

@sweet cipher happy birthday

tawdry gale
tranquil reef
#

Do scripts need to use case sensitivity when running on Linux? I have file path references in my clothing files and stuff, some all lowercase which doesn't seem to matter on windows, but will thst break the mod in Linux or does zomboid automatically handle it

bronze yoke
#

sometimes šŸ™ƒ

#

be cautious and assume everything is case sensitive

sturdy salmon
#

Good afternoon. Is there a way to edit the UI and see the results? Because sometimes, when you reload from Lua, some features don't work. I don't know if there's a way to edit and see how the interface looks before entering the game.

agile nacelle
#

Isn't there a difference between reloading and restarting lua

#

Debug mode features restart Lua button

silent zealot
# agile nacelle Isn't there a difference between reloading and restarting lua

yes - reload from the debug interface re-runs a lua script, but it doesn't cleanup anything it has already done... so that means if the script changed other things or added functions to events it won't be a clean restart. "reload lua" throws everything out and starts over for all lua (and I think all script files too)

bronze yoke
silent zealot
#

Nice!

#

Is that B41 or B42?

bronze yoke
#

b42

#

i don't really do anything with b41 anymore, too much of a pain to go back

silent zealot
#

Agreed, even for mods that woudl be easy to backport it's time to set things up, test, then re-assemble in the workshop folder and upload

#

And then people will want support on B41.

bronze yoke
#

i'll be honest that my disk space situation is so dire that just having both versions installed is problematic for me šŸ˜…

red tiger
#

Wanted to make that but my older projects got me tied down.

bronze yoke
#

it's pretty basic as of yet, a better solution could definitely come in the future

#

it only took an hour of development (and 4 hours of fucking about with github workflows šŸ˜…)

red tiger
#

I'm an oldie so I'll do it manually. x)

bronze yoke
#

i'd been planning to as well but when publishing from github pages, it takes an absurd amount of time to push a full website to git (and because of bizarre things doxygen does behind the scenes presumably for performance, every push is a full website push)

#

the workflow basically just uploads a zip to github instead and that trims off literally ten minutes šŸ˜…

#

might look into doing something similar for the javadocs (they have a similar issue since they store the time of generation inside every file, every file has to be updated every time) but i probably can't generate them from a workflow like i can the lua docs because i actually need a copy of the game to do it

#

the lua docs generate purely from rosetta data so there's no issues with that there

frank elbow
#

Is it just because it's a whole lot of pages? I've not experienced slow uploads with gh pages but mine have always been like 20~30 files (incl. css and js)

bronze yoke
#

i assume it's mostly file count yeah, i think the javadocs have a few thousand for example

silent zealot
crisp dew
#

Grrr, is there any docs for B42 for the new craftRecipe, specifically why recipes seem to be empty in the Craft Recipe Debugger with an unfortunately less than useful error 'ISStringListView -> parsing error. out of bounds'?

tranquil reef
#

Do timed actions have to be in a TimedActions folder, or can I put them anywhere

#

I've always seen them in that folder, but my mod's getting bigger and some fit better in different places

bronze yoke
#

they can be anywhere

#

other than client/shared/server, folder never matters

#

(and even those rarely matter)

tranquil reef
#

Thanks

silent zealot
#

As for the issue, check console.txt for any mention of the recipe name.

#

But it might be something that gets past the parser but then breaks things that try to display the recipe.

signal meadow
#

Hello good evening, does anyone here know how to create mods for the game?

bright fog
#

Perhaps the arrows should be the other way around ?

#

What do you think ?

silent zealot
#

Multiple modders hang out here.

supple briar
#

Has anything regarding clothes modding changed between b41 and b42?

silent zealot
#

Some new tags, discomfort...

#

But the process of making a model/texture/etc is all the same. At least I had no isses using B41 intsructions on B42.

supple briar
#

I'm starting to want to move onto new projects so I need to force myself to finish the stuff I don't find as fun as modelling and texturing

bright fog
#

Also I'll make a wiki page about this later today

silent zealot
#

Combine them into Jluva docs

dull moss
pliant cypress
#

Hello I am new Making custom mods is there anyway somebody can help me make a gun from models i have for b42

#

i got custom weapon models but i need help with it to make them work

signal meadow
# silent zealot Yes.

I would really like to meet someone to see if we could meet up so they can make some united mods for my server.

bright fog
pliant cypress
#

boop

bright fog
#

I'm just not a huge fan of their current lack of transparency but they have stated everything will be open source

pliant cypress
#

I'm actually so excited just got done with the model; but idk how to add the paint to it

bright fog
#

Also

pliant cypress
#

Then I have to see how to import it into pz

bright fog
bright fog
#

And check that Steam guide I sent anyway

#

It has some directives to getting gun models in the game

bright fog
# pliant cypress the thing is right I already have a model But I'm trying to figure out how to ad...

#handpainted #blender3d #modelling
UPDATE - BLENDER 4.3 - https://youtu.be/_-zAhCOUpog
Learn how to use the texture painting tools within blender by painting this hammer model

Want to learn take this learning further then take my hand painting course only $13 (plus local
https://bit.ly/blenderTexturePaint

Hammer Model: https://gdev.tv/gr...

ā–¶ Play video
pliant cypress
#

like guns with no mag

#

Just so I know if I'm gonna combine the two models together like the magazine and the weapon or keep them separate

bright fog
#

I think so

#

But I'm not too knowledgable on guns

pliant cypress
#

Do you think somebody can join vc and help me out a little bit

bright fog
#

I doubt it

pliant cypress
#

wanna give it a try hahaha

bright fog
#

Depends if someone's available but it's unlikely you'll manage to post your message at the same time as someone who's available

#

I believe the Steam guide is really decent to do most of what you need

#

Besides maybe some modeling and texturing

pliant cypress
#

I already text the model

#

It's just getting it zomboid compatible

#

I'm not going to lie the guns that I'm doing right now I can already tell it's going to be a banger haahhhaha

silent zealot
pliant cypress
silent zealot
#

That's how I did my gun mods. I made the texture image up in krita, then used UV mapping to map the faces of the model to areas on the texture

pliant cypress
#

The only thing I'm trying to like understand is how to get this ready because I'm reading how to do it but like my brain is not braining

silent zealot
#

How did you do the texture in blender

silent zealot
#

Specifically, what is the base colour for the material?

#

Ok, so grip1_diff is already an image file

pliant cypress
#

Like I'm looking at it right now and it's fully finished it just needs to become compatible and like work for Zomboid

silent zealot
#

Did you use only one image file for the model?

pliant cypress
silent zealot
#

What resolution is the image

pliant cypress
#

wait im dumb

#

umm

silent zealot
#

Not file type, resolution. It needs to be in powers of 2 to work in Zomboid

pliant cypress
#

all 3

silent zealot
#

I used 512x512, but you could go list because of how tiny the models are in game

silent zealot
pliant cypress
#

do you want to join vc

silent zealot
#

No, I'm not up for voice chat

pliant cypress
#

hmm ok

silent zealot
pliant cypress
#

one for the base one for the grip one for the clip

silent zealot
#

Did you use different image files for different parts of the gun?

silent zealot
#

One model to one texture in Zomboid

#

Now the clip should be an attachment so it is it's own model

pliant cypress
#

I mean if you want to join vc and we can both mute and I can screen share I can show you what I mean

#

if thats ok

silent zealot
#

I'm tired and sick and warm in bed, I'm not committing to a screen share troubleshooting session

pliant cypress
#

So basically these are the files of the photos

silent zealot
#

The grip, assuming that is part of the gun and not an optional grip attachment, needs to use the same texture image

pliant cypress
#

No like it's part of the model it's not like an optional attachment

silent zealot
#

Basically for a single model you want one material in blender for every part of it

#

Also, you can drop the resolution way down... you wont see that level of detail in game

#

You can probably do something fancy in blender to map everything into one texture image, but that's beyond my blender knowledge. Maye texture baking, but that's meant for lighting effects.

pliant cypress
silent zealot
#

Or you can open up your favourite image editor, make a 512x512 image that has all the textures you need by combining the images, then redo the UV maps

#

A detachable mag is a seperate model and can have its own texture file. But it doesn't need to have a seperate texture, and can probably fit into the same image as the rest of the gun used.

#

The grip cannot have a seperate texture image. You will export the gun body and grip as one .FBX model, and in the model definition for Zomboid you will specify one texture image

silent zealot
#

Like I said, I don't know of an easy way to get there from where you are now; you'll either have to learn some blender tricks or make a single image with the gun body and stock (and may as well add the magazine too) and redo the UV mapping.

hidden compass
#

If I add an attachment slot to a Female/MaleBody model like Authentic Z, is there a problem with the Attachment Editor that causes an error when I select the Player Model in the Editor? Or is it because of the way the attachment is added (to Female/MaleBody)?

I too would like to add a Slot and implement the coordinate settings on the Player Model side, but I am having trouble because the Attachment Editor stops working, although usually play is not a problem.

module Base
{
    model FemaleBody
    {
        mesh = Skinned/FemaleBody,
        static = false,
        animationsMesh = Human,
        
        attachment Canteen_L
        {
            offset = -0.1410 -0.0890 0.0700,
            rotate = -180.0000 -105.0000 154.0000,
            bone = Bip01_Spine1,
        }
#

The error is below.

[05-06-25 20:42:59.059] ERROR: General      f:476, t:1749123779059> ExceptionLogger.logException> Exception thrown
    java.lang.RuntimeException: attempted index: getName of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).
    Stack trace:
        se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667)
        se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:624)
        se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
        se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
        se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1805)
        se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:38)
        zombie.ui.UIElement.render(UIElement.java:1985)
        zombie.ui.UIElement.render(UIElement.java:1995)
        zombie.ui.UIElement.render(UIElement.java:1995)
        zombie.ui.UIManager.render(UIManager.java:409)
        zombie.gameStates.AttachmentEditorState.renderUI(AttachmentEditorState.java:186)
        zombie.gameStates.AttachmentEditorState.render(AttachmentEditorState.java:106)
        zombie.gameStates.GameStateMachine.render(GameStateMachine.java:28)
        zombie.GameWindow.renderInternal(GameWindow.java:469)
        zombie.GameWindow.frameStep(GameWindow.java:941)
        zombie.GameWindow.mainThreadStep(GameWindow.java:643)
        zombie.MainThread.mainLoop(MainThread.java:76)
        java.base/java.lang.Thread.run(Unknown Source)
silent zealot
#

I keep forgetting to try with all mods disabled

hidden compass
silent zealot
#

That's probably what kills it for me then, I have a "shove a gun or canteen on back of belt" thingy in my personal tweaks mod.

bright fog
hidden compass
#

I also added expansion slots in my own mod, but ended up using vanilla slots (e.g. back, backpack_left) and setting the coordinates on the item side model. However, this is not scalable, so I would like to add my own slots to Player Model if possible.

silent zealot
#

You can probably answer this then; what is the secret to making a weapon model line up properly in attachment editor? I've had no trouble getting weapons to work correctly when help/used/etc, but in attachment editor they always seem to display with the wrong rotation so moving attachment points to match is guesswork.

#

Except for the latest gun, which was perfect.

#

So it seems to be something like "you need to have the wepon at this orientation in blender, but you need to have it that away with a specific unapplied rotation transformation."

#

Or, might be because the latest one was a rifle not a handgun.

bright fog
silent zealot
#

ah that makesa lot more sense lol

bright fog
#

Yea indeed I'm not a dev šŸ˜‚

tranquil kindle
#

I had same issue, but I know I did it the same way as in b41.

pliant cypress
#

ok so my custum gun doesnt show in my hand

#

like its Invisible

#

anyone know a fix

tranquil kindle
pliant cypress
pliant cypress
bright fog
#

Reduces the sources of potential issues

tranquil kindle
placid yoke
#

Does anyone know how to make a sprite with an inventory container lockable using the padlock system?

According to ISPadlockAction.lua, I understand that it should be enough to define the sprite in question as an IsoThumpable, but how do I define it?
I've already tried mimicking the tiledefs of wooden crates in the .tiles file and even creating the item and defining it as thumpable, but it doesn't work.

Does anyone have any idea how I can do it?

pliant cypress
#

I went through the subject probably three times triple chacking

#

I don't know if I'm dumb tbh

#

i might be to brain dead

tranquil kindle
#

From the top of my head:
-exported empty model (you have file, but there is no actual model in there),

  • You have more than 1 material assigned to it
pliant cypress
#

it is thats the thing

tranquil kindle
#

-Its too big/small to be visible
-You put your model/texture in wrong folders,
-a typo in script.txt or model.txt

#

A gun, which is 1,5 mb fbx file. Something seems fishy by just that to be fair

tranquil kindle
#

Just show it in blender aswell as show us your txt files

pliant cypress
tranquil kindle
#

This discord and those channles here are made to Help modders, why should we use DM's for this?

pliant cypress
tranquil kindle
#

Someone else might have same issue and it might just help them

pliant cypress
tranquil kindle
#

Okay, but this doesn't tell me much apart from how its supposed to look like. Just show whole screen, could also use material tabs and still waiting to see your script files where you gun model and gun itself are

silent zealot
#

Press N

#

Show us the info box that pops up, especially the scale

#

Actually no need it's on the right

#

The scale is wrong

#

It's stupid but... You need to have the scale set to 0.01

#

So when your model is the correct size in blender (you can compare to existing gun models) you need to make it 100 times bigger, Ctrl-A apply scale transform, then put 0.01 in the scale fields

tranquil kindle
#

Its only for firearms, or any weapon model you want to use with "attachment system"

#

You could export a machete with 1x1x1 and it would work, but the models that appear on top of you models in case of attachments do require for base model of weapon to be in that scale

#

Or they .... get messy

silent zealot
#

Rotation matters too; you need it to both look like the model in the example and have the rotation set to same vales as the example

silent zealot
#

Less important than scale though

silent zealot
#

Other less likely reasons a model might be invisible: texture fails to load (wrong path/ filename, etc... the will be an error in the logs)

terse delta
#

What should I learn in Lua to start modding?

tranquil kindle
silent zealot
#

Or for partial missing textures: polygons with more than 4 vertexes (fix with triangulize) or flipped normals (fix by inverting normals where they are wrong)

silent zealot
#

If you know the common stuff like variables, functions, objects, conditionals, arrays/tables, then you can muddle your way through changing Lua by googling "Lua how to do X" a bunch

terse delta
#

I understand basic things like this

silent zealot
#

Good enough, just jump in and learn as you go is my suggestion

terse delta
#

There's some kind of zomboid API for lua, isn't it?

silent zealot
#

And don't trust AI. You can ask it general Lua questions and it can be helpful, but if you ask for project Zomboid specific stuff it will lie so much

terse delta
silent zealot
#

That's the API for interacting with all the java objects in the core game

terse delta
#

Oh, there's some links in pinned

bronze yoke
silent zealot
#

I suggest getting VSCode and opening up the games media folder so you can easily search all the vanilla .Lua and .txt files

terse delta
#

A good practice for me to learn Java was dissemination of other mods' source code. This is also a good option here, right?

silent zealot
#

And you can use Zomboid decompiler to easily make a local city of the java code which is great for seeing how things work in the hidden java side

silent zealot
#

Don't straight up copy/paste code, but write your own after seeing how to do it

terse delta
#

I wanted to start from basic, new medicine items

#

That would require item itself, distribution and function tied to item

bronze yoke
#

believe me nothing related to the health system is basic šŸ˜…

silent zealot
#

A lot of that won't even need Lua, other than the distribution.

terse delta
#

What's the markup language for project zomboid? XML?

silent zealot
#

And you can use Easy Distribution mod if you want to make the distribution tables just one line to copy an existing item

silent zealot
#

Some actual XML, like animation sets and some clothing related stuff

#

Some stuff that looks like Lua but isn't really

#

Lots of txt files with a custom script design

terse delta
#

file that defines properties of item

#

It's also on wiki for each item

silent zealot
#

Some things are hard coded in java, like the various random "stories" that can appear

bronze yoke
#

the txt format is called zedscript and it's basically just the result of refusing to ever give up on having their own format

bronze yoke
#

in the earliest versions of the game it was supposed to actually be a scripting language (hence the name) but they worked out that lua was just way better for that

#

so now it's just used for defining things, instead of something reasonable like json, yaml or xml

terse delta
#

thanks god it is not json

#

It has kilometer-long marking files.

silent zealot
#

I'd take json over zedscript

#

Plenty of tools to help with with it

bronze yoke
#

zedscript has really inconsistent syntax and being a unique format there's nothing at all to help with it

#

i've gotta get back to that language server when i get bored of my current projects šŸ˜…

silent zealot
#

Xml would be nice, especial with inheritance and xpath patching

silent zealot
terse delta
#

I wish someone told me algorithm behind sprite style, to me this looks like mess of pixels and i'm unsure how to replicate it

silent zealot
#

Look up pixel art tutorial?

#

The inventory icons don't have to be high quality because they are so tiny in game

terse delta
#

I mean, i'm used to algorithmes and sequences, and there's no strict way to replicate this

#

Always had problems with art

silent zealot
#

Better to be distinctive really to help identify things

#

I hate how many guns are basically a bit of very dark grey and black on a black background

#

I made the survival rifle icon a lot lighter than the actual gun, so you can actually see the shape

#

And my other guns were already lighter by design

#

What do you need to make an icon for?

#

Sometimes you can save effort by just editing an existing icon

terse delta
silent zealot
#

You can also look for icons online with a free licensee, or use ai to generate an image that you clean up

terse delta
tribal vale
#

is the "Player Spawn Area" on sandbox setting broken atm? for spawning zombies inside the safe zone
I can't seem to make it work with custom spawn points

mellow coral
#

hey, does anybody know how to add tags to zomboid mods on steam workshop? Ive just made my first one and the only tag i have is B42

slim swan
mellow coral
bright fog
#

There's literally dozen others

slim swan
#

Sometimes when I’m drawing icons, it feels like I’m just scribbling randomly ,but the result actually looks not too badšŸ˜†

mellow coral
#

okay let me check

bright fog
#

So idk bro but you need to send a screenshot if you don't see others šŸ˜…

mellow coral
#

ohh my bad, i see it now. Idk why it didnt let me scroll then. Or maybe it just lagged for a while. Can i edit it from there after upload?

bright fog
#

Hmm no I don't think you can actually

mellow coral
#

well i'll try

bright fog
#

Wait

#

Did you mean from the workshop ?

#

Or change the tags

#

You can modify the tags after the first upload of course

#

But you need to do it from the in-game uploader

mellow coral
#

okay it worked

pliant cypress
tranquil reef
#

Is it possible to force a sneeze

#

It's not a timed action right? I vaguely remember looking into it and it being hardcoded, but I'm not sure

true nova
placid yoke
thin swan
#

Well shit, looks like I'm making a sidecar, for adventures

proven ibex
#

I made a bowl of pea soup feel free to use it šŸ‡³šŸ‡±

crisp dew
#

I'm clearly late to the B42 party, (at least in terms of actually working on it). sigh, this damned hardcoded weight system...

#

Did they announce why this was implemented? I'm working on a system that can hold exactly 12 of something, and 12x15kg exceeds that hardcoded value.

bright fog
#

Someone has made a fix actually

crisp dew
#

Other than the Java replacement fix?

bright fog
#

Yes

#

Lua sided

#

Just I need to find it, I think I know where

crisp dew
#

TYVM! Best I could find was Zuper which was less than elegant.

bright fog
#

Yea the zupper dev kind of went insane since then lol

crisp dew
#

oh?... (not even going to ask)

bright fog
#

Was a joke don't worry hahalol

#

But I remember talking to the guy that forked the original mod to update to B42

#

And oh boy he was going crazy over this singular issue if I remember right lol

bronze yoke
#

yeah it was a real struggle

#

i think they quit

crisp dew
#

With this I was contemplating swapping it with number of items instead, but I felt that live-patching items as they're placed into the container to weight '1' would cause more issues.

bright fog
#

Yea I think they did

bright fog
crisp dew
#

All-in-all for B42 though, I am enjoying the work they did to the crafting / build system; managed to tap into the new build interface to allow the user to immediately place the crafted item in the world.

bright fog
#

I haven't looked at it in depth

#

But it's a whole UI so it's fully Lua sided, which makes it very easy to customize

#

Something not many people did before B42 actually

crisp dew
#
module Base {

    xuiSkin default {
        entity ES_TireRackUnpainted {
            LuaWindowClass = ISEntityWindow,
            DisplayName = Unpainted Tire Rack,
            Icon = Item_TireRackUnpainted,
            ToolTip = Tooltip_craft_TireRackUnpainted,
        }
    }

    entity VNGarage.TireRackUnpainted {
...
#

Threw me off for a bit as they seem to need to run in the base/default namespace, but once I got that namespacing figured out, seems to perform quite nicely.

proven ibex
#

I cant code, how I import this

bright fog
#

No need for code

proven ibex
#

Feel free to use it

proven ibex
#

Would be cool make a dutch foods mod#

bright fog
#

Then make it ;)

proven ibex
#

Ohh nicee

#

I'll check

#

šŸ˜„

bright fog
#

Item mods usually don't require too much, tho a whole food mod can require some more bits, like crafts and shit

proven ibex
#

Hmm, I could ask here maybe then

#

Or check documtation

#

Thankyou!

bright fog
#

For sure

proven ibex
#

You like the design?

bright fog
#

Check out also the modding community

bright fog
#

Wait sry

#

I read that wrong that was so mean 😭

#

It's nice !

proven ibex
#

I almost cried :c

#

Hahaha

#

Thanks!

bright fog
#

Sorry I thought you asked if I like to design, I'm too tired lol

proven ibex
#

I feel you lol

#

Going make bitterballen next lol

crisp dew
#

OOOH, ok, JB's max weight is still overriding the method at the definition level, so it applies to everything in the application; I was hoping to not have to do that, but at least having that functionality in a shared common library will help minimize performance issues.

bright fog
crisp dew
#

yup; it overrides the definition, so every container in the game will run the overridden code. That's generally not the best way to do it, but with limited low-level access, is probably the best we can hope for.

bright fog
#

I've seen enough people break their head on the problem to see this as one of the best solution šŸ˜…

crisp dew
#

Someone doesn't like combo stacks. šŸ˜›

bright fog
silent zealot
crisp dew
#

Yeah, right now working on integrating JB's fix, though getting the ever-fun attempted index: addContainer of non-table: null on game boot.

silent zealot
# bright fog I've seen enough people break their head on the problem to see this as one of th...

I agree, the alternative is you have to override a dozen lua functions from all over the place some of which need to be replaced instead of prefix patched. So buggy, hard to catch every use-case, prone to breaking with updates or not playing nice with other mods that want to do the same for their containers.

Or you hook in to the lua -> java call, decide if you will override or just pass through to the origianl function, and have none of those issues.

crisp dew
#

ah, JB's code needs to go in client and not shared. That makes sense

supple briar
#

Is fileGuidTable still needed in b42?

crisp dew
#

w00t! it can hold 12 tires again! (and the 1-12 item sprite still works even)

#

(now just to see if I can get that container icon correct...)

crisp dew
#
ContainerButtonIcons = ContainerButtonIcons or {}
ContainerButtonIcons.TireRack = getTexture("media/textures/Item_TireRackUnpainted.png")

Well that was easier than I thought... I'm just an idiot.

supple briar
#

I've given up on the clothes for now, i don't understand them at all and trying to figure it out is making me mad, just gonna finish the cars and come back the clothes later.

true nova
supple briar
silent zealot
#

We can help; when you're ready to revisit that

#

if you're just doing new textures for existing clothing models it's easy to do

#

fiddly, but easy.

supple briar
#

I'll finish up the other stuff then come back to it, still gotta do schemes and distributions

#

that way If I get annoyed again I can just release what I have and add clothes later

silent zealot
#

scope creep hits even solo developer mods. šŸ˜›

#

releasing clothing later seems sensible.

red tiger
silent zealot
# red tiger Nothing truer than this on my behalf.

Now that the unreal engine can manage hundreds of NPCs doing stuff at once on consumer console hardware I expect your shader mod to make Zomboid look like this: https://youtu.be/FJtF3wzPSrY?t=500

IGN

Check out this Unreal Engine 5.6 tech demo for The Witcher 4, running on PlayStation 5 with raytracing. This Witcher 4 tech demo shows off the new Fast Geometry Streaming Plugin to load open-worlds faster, and we see how UE 5.6 handles busy scenes full for high-fidelity character models and visual effects like ML Deformer. Additionally, we see N...

ā–¶ Play video
red tiger
#

I have a functioning box-shadow now

silent zealot
#

In some ways doing that in Zomboid is a lot more impressive than 300 NPCs active in Unreal 5.

red tiger
#

All I want for Christmas is full access to the OpenGL API.

#

Since the render code is locked in a single-threaded loop with the logic thread of the game, TIS could expose this for the render-thread invocation via their internal API.

#

Writing a separate layer like SpriteRenderer is another way but ehh

#

I get why they did that.

#

I'm honestly surprised that their SpriteRenderer is exposed with shader commands.

tranquil kindle
# pliant cypress Still being a pain

As far as I see I'm one of few that are actually trying to help you. If that's being a "pain in the ass" then I can just simply not. I've seen your model, but I ask for Item Script (your custom item you made with stats and such) as well as model script (assigning mesh and texture) to model ID which is used in item script

pliant cypress
bright fog
pliant cypress
#

Ohhhhh

tranquil kindle
silent zealot
#

🤣

crisp dew
#

ok, now that I managed to get my mod working in B42 (at least as a suitable proof of concept), time to go back to B41 and un-break my directory structure so folks back on stable don't get upset.

abstract summit
#

can someone create very underweight mod?

#

for b42

bright fog
#

A trait ?

abstract summit
#

yes

#

its removed in b42

#

and i used to play with that trait in b41

bright fog
#

That's interesting

#

It might be doable but it depends how the game gives the underweight trait I guess

crisp dew
#

am I tripping Sir Doggy, or did you username just change colors?

bright fog
#

yea don't worry about it, it's to be able to pin and use discord markdown for wiki stuff

mellow coral
#

which files in build 42 are responsible in rendering vehicle hud? I have 2 mods that disable car hud and im trying to fix it

crisp dew
bright fog
crisp dew
#

Yeah, I read up on that too, but was confused because I kept trying to implement it inside mods vs Workshop. (My mod for B41 used an automation script to upload to Steam, but it didn't support tags for some reason)

terse delta
#

What kind of IDE you use for lua coding?

tawdry gale
#

Hello, a friend and I would like to test a mod in debug modem, but when I try to connect it tells me I'm not an admin, but it puts me as admin when I connect without debug. Do you have any solutions?

crisp dew
mellow frigate
tight elm
tranquil reef
#

Do I need a mod.info in my mod's root folder if I have one in the b42 one? it's b42 only, not b41 compatible

bright fog
#

Modding wiki

https://pzwiki.net/wiki/Modding
https://pzwiki.net/wiki/Getting_started

Getting started

Unofficial Modding/Mapping Discord

These communities exist with different modding/mapping guides:

Modding projects

Various pages which list projects related to modding in Project Zomboid, notably custom tools, API or external projects linked to the game. These do not and should not include individual feature mods that simply add new content to the game but to projects that provide something to modders themselves and not users.
https://pzwiki.net/wiki/Category:Modding_projects
-# Want to document a modding tool on the Wiki ? DM me or ping me asking about it ! You are also free to create a wiki account to create a new page regarding it, by following existing pages format !

Settings up a code environment

Visual Studio Code is the norm for programming Project Zomboid mods thanks to many extensions made by the community. See the wiki page about Visual Studio Code to get started.

Lua API

Scripts

Regarding AI modding

Wiki section on the subject

tranquil reef
bright fog
# red tiger You can pin in here?

I asked for an access to use Discord markdown to share wiki stuff, and got the Workshop Mechanic role which gives me access to pinning yes

bright fog
bright fog
# red tiger Alright.

I'm reorganizing some major bits in the modding channels pinned messages to lead to updated modding resources. This should help new users to start on modding and have access to resources

#

I need to rework a tiny bit the bottom of the modding page tho

#

Lots of random links that I need to check out and organize

#

Also the scripts page I want to rework a tiny bit

red tiger
#

Thanks for keeping that up to par.

#

Working on box-shadow: inset ..

red tiger
#

Absolutely happy.

red tiger
bright fog
signal meadow
#

Hello, who knows how to make cars with exclusive designs?

#

I would like to see if anyone knows how to make unique mods for my server.

bright fog
#

You can send commission requests on the modding Discord, however note that vehicles are not modded by many people

#

Directly contacting people that created vehicle mods might be better overall

#

Of course, do it with patience and respect when contacting the modders because they might not appreciate the direct contacting

tranquil reef
bright fog
#

Umbrella is the norm

#

Mostly everyone who programs Lua mods use it

tranquil reef
bright fog
#

Yea

tranquil reef
#

Weird, I could've sworn I clicked that and it was already pre-filling different zomboid functions. I guess it just didn't register and was only referencing functions I've already used before or something

#

Either way thanks

silent zealot
#

Look for errors in console.txt to give you an idea what is going on, and if you know which mods cause the issue you can also look to see what they are changing

tranquil reef
#

If I make a mod overwriting models in my other mod, should that be above or below the base mod in the load order

ancient grail
tranquil reef
#

Models with the same folder structure and names

bronze yoke
#

it should be below, but yeah requires should force it to be below anyway

ancient grail
#

i have no idea then

silent zealot
silent zealot
#

And doublecheck the path is exactly the same because I have lost hours to weapon vs weapons in the directory structure.

bronze yoke
silent zealot
#

I've enabled a mod with a dependency and had them added to my mod load order as
existing mods
mod I enabled
the dependency needed for the mod I just enabled

#

easy to fix, but the game should have added them in the proper order

hidden compass
#

Any good ideas for hooking ā€œRight click on each menu (Option)ā€ in the context menu?

I tried hooking ISContextMenu.onMouseUp, but this one only executes if left clicked.

silent zealot
#

You mean if you bring up the context menu then right click on an option?

#

Does anything in the game work that way - right click to bring up menu/left click on menu is the standard behavior for that sort of UI

hidden compass
silent zealot
#

There's a seperate set of events for the right mouse button

#

OnRightMouseUp

#

try making a IsCOntextMenu:OnRightMouseUp(x,y) function

#

I'm not sure if it will get automatically attached to the event or if you will have to manually attach it

#

ISCOntextMenu:onRightMouseUp(x,y) will be inherited from ISUIElement via ISPanel; it's just an empty function, but you can hook onto it and add your code.

hidden compass
#

Thanks, it will probably work! I should have looked properly until the succession. Thanks again!

#

It is now possible to toggle ON/OFF by right-clicking on the context menu, which is very convenient in terms of UI. Thank you so much!

silent zealot
#

No damage to clothes, the retrieved arrow are always full condition, a few more hit locations could be added, but the core logic works.

sonic needle
#

hell yeah dude šŸ˜„

crisp dew
#

Hey SirDoggy, found some notes for CraftRecipe OnCreate; that only works for items. For the new building craft (component CraftRecipe within an entity), it appears that the OnCreate should be within component SpriteConfig. (Refer to media/scripts/entities/furniture/entity_wood_windowglass.txt)

bright fog
#

Tho note that I haven't dug in the crafting stations

#

I should tbf

crisp dew
#

The parameters are a bit different too; only one param is sent and it's a Thumpable.

bright fog
#

That's a different OnCreate then probably

#

The OnCreate which is documented on the wiki should be for the CraftRecipe

#

Or for items

crisp dew
#

So it's confusing, because buildings also have a CraftRecipe

bright fog
#

The component things are crafting stations tho right ?

crisp dew
#

but it's slightly different...

module Base {

    xuiSkin default {
        entity ES_TireRackUnpainted {
            ...
        }
    }

    entity VNGarage.TireRackUnpainted {
        component UiConfig {
            ...
        }

        component SpriteConfig {
            canBePadlocked = false,
            OnCreate = VNTireRackCommon.OnCreateRecipe,
            ...
        }

        component CraftRecipe {
            timedAction   = BuildMetalStructureMedium,
            time          = 300,
            needToBeLearn = false,
            SkillRequired = MetalWelding:2,
            xpAward       = MetalWelding:20,
            category      = Welding,
            tags          = Welding;Furniture,
            ToolTip       = Tooltip_craft_TireRackUnpainted,
            ...
        }
    }
}
bright fog
#

Yea that's a different OnCreate

crisp dew
#

yeah, just confusing that they're named the same thing

bright fog
#

I guess

crisp dew
#

Currently working on getting my code finished, took me a few to get the debugger to stop, because I didn't realize it went in component SpriteConfig. šŸ˜›

bright fog
#

Or is that also for adding a buildable to the build menu ?