#mod_development

1 messages · Page 326 of 1

past radish
#

The right to modify another person’s content depends on their country/copyright on it

bronze yoke
#

a texture is a texture, it just happens to match up with their model

past radish
#

Maybe in America, not how it works in the EU

reef portal
#

what are the basic things I need for a mod to appear in the UI? I can't get it to show up

bronze yoke
solar rover
#

too fast this morning albion

reef portal
#

The mod.info should be /modname/b42/mod.info eh?

bronze yoke
#

modname/42/mod.info

#

also for b42 you need a modname/common folder for no reason (it can be empty)

reef portal
#

right okay sorry, 42 is what I had mb

#

hmm

#

It still doesn't show up. Wierd.

#

I must have misconfigured smth but idk what

bronze yoke
#

is your mod folder in %UserProfile%/Zomboid/mods/?

#

the one in steamapps/common/ProjectZomboid/ doesn't work, it exists for no reason

reef portal
#

ah really? that would be it then

#

thanks albion 🙂

red tiger
#

Would be nice if a Lua API is added to check if ANSI is supported in the terminal of the game server. It's literally the most background and non-priority item of suggestion but gosh darnit I need this.

bright fog
reef portal
#

I would add a note that you have to use the userprofile/zomboid/... folder for things, as the installation directory is a red herring

bronze yoke
#

yeah i can't even count how many people i've had to correct on that

bright fog
#

Alright I'll see to add that then

bronze yoke
#

it's natural to just open up the game files when you're looking to start modding, it's the first thing i'd do

#

and then you see a mods/ folder with a mod template in it and everything, obviously you'd assume you can put mods there

bright fog
#

Ah that

#

But I'm refering to Workshop not mods

bronze yoke
#

workshop is there too

bright fog
#

Yikes

#

I'll try to fix that a bit later then I can't really now

scenic ledge
#

hi, i started dabling into creating my first mini mod, just making the sitting action bindable to a key. I managed to fix the new b42 mod structure and vibe coded the lua with chatgpt but for some reason it isnt working :p

#

anyone care to have a look?

bronze yoke
#

it doesn't work because chatgpt is useless for modding

#

vibe coding will not work for pz

scenic ledge
#

:p

#

it worked great in browser games for javascript

#

and i just wanted to have one tiny feature

#

binding the sit / stand action

bronze yoke
#

the ai has a better understanding of those things because they're more general, it doesn't know how to do anything in pz's environment

reef portal
#

setting up a keybind is pretty simple

#

smth like this

#
  1. func to setup the key handler
  2. event to hook in
  3. func to call when key is pressed
#

but yeah chatgpt probably doesn't have the api info needed to provide the code

#

its too obscure

scenic ledge
#

i actually understood most of the words you used :p

#

so basicly LUA has been around for ages but it changes depending on the api used by the game?

#

hence the AI doesnt know what to do with it?

reef portal
#

yeah, the devs of the game change their code every so often to provide new features, but it breaks old mod content (and makes AI knowledge of the code outdated)

#

and the documentation isn't very good as they are a small team with limited resources

#

its kind of a battle to understand things/learn to mod this game

scenic ledge
#

i just need to find a mod which already binds something to a key

#

and find the name of the sit action

reef portal
#

yeah

#

probably the easiest route

scenic ledge
#

not even sure why nobody has ever made such a mod, right clicking to sit is ... too much work

#

doing a cryogenic run, its pretty rough living in the wilderniss

bronze yoke
#

they did

scenic ledge
#

need to sit a lot at the campfire to stay alive

scenic ledge
#

aw, i love you

reef portal
#

nice

scenic ledge
#

aw this is so much better

reef portal
#

is there an NPC mod that works in b42? Im curious, for reference

sturdy salmon
#

Hello, good afternoon. Would it be possible for a player to have more than one safehouse? I've been making some modifications with a mod, but I'm getting anticheat 19. Checking the information, I saw it's related to the number of safehouses. I don't know if anyone has ever reviewed any of that. I'll leave the repository, although I'm still working on changes... even if I'm not finished, but just in case, if anyone sees something I haven't seen yet...
https://github.com/pangolp/safetogether/
Just to clarify, I'm on build 41.78.16

#

To summarize, what I did was use the code the administrator has to add secure areas. I set up some points and used the code at those points. If the owner changes, there's no problem; the person can have more than two, and the anti-cheat won't be triggered. But if they want to claim one, having another one previously, or being part of one, then the anti-cheat will be triggered.

sturdy salmon
#

In the end, I solved it by creating a fake owner and then deleting the safehouse. Later, I updated the repository and added the missing translations, in case anyone wants to see or use it later. Although I mix two themes in that mod—on the one hand, the safehouse together, and on the other, taking over empty land—I'll have to split it up or make a modpack.

#

In the first one, I had commented on the deletion, to see if it was added, then, as I saw that it was added, I ended up deleting it.

tired glen
#

I’ve been fiddling with worlded and tiled and I’m having a bit of difficulty understanding what exactly worlded is for
If I was trying to replace a single cell on the map, would I even need a world?

sturdy salmon
#

The idea is to "reclaim a plot of land that has no houses." So people can build without having to, and even if the house is torn down, they'll still have shade.

#

The red area is calculated from the point where I specify that the script can be used.
I also ask for money or an item in return, because in reality, it can be customized.

#

Within that area, everyone builds their house as they wish.

#

It's part of another mod, of plots that I made.

#

The idea is that they can claim those plots of land, instead of the houses in the game.
They have more space, they don't depend on the admin for expansions, they're independent, in short... many factors.

#

I'll try to explain it, in the repository anyway.

#

That's the mod for the old plots.

#

The only downside is that what a player builds will never be a room, so it will never have a light switch.
They'll have to put in nightstands to illuminate the area.

tired glen
#

i like how you just eat cigarettes

#

taking a break from mapping because i am getting nowhere and need to watch tutorials or something

#

yum yum eat up

tired glen
#

i made a pack file yay

sturdy salmon
#

With practice, things work out, not always at first, but little by little they do. There are some very good tutorials on the internet.

tired glen
#

I am incredibly stubborn
I sort of just learn by messing with stuff ngl

#

but thank you for the encouragement

tired glen
#

kinda goofy but retextured the pack
good enough of a spoof for me

tired glen
#

i must be doing something wrong though cause my mod doesn't appear in the stupid list no matter how much i sit here and try to reconfigure the directory

#

either the wiki post about b42 mods is wrong or i'm missing something

sturdy salmon
#

Not all of us are "good" at the same things. In fact, I'm a total disaster at design. I prefer coding a thousand times over to design, but sometimes, you have to design too. You can always improve, you can always do something better. I watched design videos, and at first, I didn't understand anything, but one day, things start to come together, and then you get the hang of it. Although, later, you might encounter mistakes. So if you keep practicing, you'll probably get it.

#

Regarding your particular error, I don't know the structure of b42, at the moment, I'm still on 41.

burnt quartz
tired glen
#

you can't have just one or the other, it seems

#

yeah that just fully works other than the assets themselves not having loaded, i might've referenced the names wrong

#

I wonder if the assets that are graphical need to be in common with the scripting portion inside the 42 folder

tired glen
#

closer! It loads a model file now but it's a garbled mess with the incorrect texture, probably incorrect export settings

tired glen
#

50,000 cigarettes

tired glen
#

eat up yum yum

craggy nacelle
#

Can someone point me pls to where the game handles voice over ip for ham radios? As always, im blindly poking in the dark and not finding what im looking for... XD

craggy nacelle
#

Huh? No interaction then? Thx, i guess i could have looked then forever. I thought because there was a 'mute microphone' there it was handled at least in partly by lua. XD

#

Thanks for saving me from hours of combing through the code for nothing. 🙂

#

Oh boy, jup, handled in java all right. Now thats a bummer.

bronze yoke
#

that's not the kind of thing you can handle in a scripting language

craggy nacelle
#

I guess thats true, but i thought there would be some interaction you might be able to play around with.

#

Like mixing some gun fire into a transmission or stuff. ^^ Eh, guess that would have been asking for to much.

elfin stump
#

Hey everyone, hope you are all well! I had an idea for a mod recently while playing that is pretty simple. I would like to add a hotkey that can be set in the options menu. When that key is pressed, it would toggle the "Pan While Driving" setting. - I haven't modded any existing interface windows - any idea where to get started here? I would really just need to know how to add a variable to the options menu, and then access that existing bool. Any pointers to get me started are appreciated. gnome

tired glen
#

is there a way to change the boredom bar to just be a number

#

on an item tooltip

elfin stump
heavy hull
#

how are people releasing map mods for B42? i thought we were still waiting for tilezed n all that

bronze yoke
#

there's forked tools that work for b42

heavy hull
#

can you send me a link?

bright fog
#

Annoying to link bcs I don't think we can send server invites

#

And it's not linked anywhere properly around here I think

tired glen
#

i found it via google

#

i'm trying to add an item to the procedural distribution table, and it's iterating over them all properly in the logfile, or at least seems to be, but the distribution tables don't have the new entries when i look in lootzed

tired glen
#

figured it out, i was not referencing the global table properly c:

mild moss
#

I'm looking for some direction of existing mods that add functionality to an existing item without replacing the base functionality. Some possible examples, making non-weapons usable as weapons (hitting zombie with a bucket), making a water container work as a normal container as well if there is no water (empty water barrel being able to store items).

Any existing mods or references are appreciated. Thanks!

tired glen
silent zealot
tired glen
lavish zenith
#

I saw a comment a while back that mentioned a debug tool to hot reload Zomboid and apply changes to scripts and code but I can't find it again. Is there such a tool or am I hallucinating?

tired glen
#

if you get an error and it brings up a stack trace you can actually edit the file and reload it right then and there before continuing too, which is just such an icing feature i can hardly believe they bothered

lavish zenith
#

I didn't realize that actually works. Thanks for the info.

tired glen
icy night
#

Does Events.OnThunderEvent trigger every time the thunder and lightning effects happen or does it just trigger when the storm begins?

ancient grail
silent zealot
silent zealot
#

The new fluid system is an exception; it's nice and modular so you can add a FluidContainer to anything.

#

So if you want to make it possible to carry water in your hat, that can work.

#

And of course you can add a new, identical looking item that is a different type and let the player convert back & forth with a recipe (convert barrel to item storage, convert barrel to liquid stroage)

bright fog
#

Like those beer hat

silent zealot
#

Quite possible.

#

It would be very easy to do in B42.

small osprey
#

Interesting. Whats the jist of your mod goals?

manic forum
#

Does any1 know if there is a way to "overwrite" or redefine a building recipe

#

for example the Door.

thin swan
# manic forum Does any1 know if there is a way to "overwrite" or redefine a building recipe

Yes in B42 at least, I haven't checked the building structures for B41, but in B42 the building recipes are in their respective entity scripts. So for doors you have ..\ProjectZomboid\media\scripts\entities\walls\ entity_woodendoorlvl1.txt, entity_woodendoorlvl2.txt, entity_woodendoorlvl3.txt and the craft recipe for each is found at the bottom of their file:

module Base
{
    ... all other stuff

    component CraftRecipe
        {
            OnAddToMenu   = woodenDoorLvl1Test,
            timedAction   = BuildWallHammer,
            time          = 200,
            category      = Carpentry,
            SkillRequired = Woodwork:3,
            xpAward       = Woodwork:30,
            ToolTip       = Tooltip_craft_woodenDoorDesc,
            inputs
            {
                item 1 tags[Hammer] mode:keep flags[Prop1;MayDegradeLight],
                item 4 [Base.Plank],
                item 4 [Base.Nails],
                item 2 [Base.Hinge],
                item 1 [Base.Doorknob],
            }
        }
    }
}

So to make a new recipe you just make a new entity file where you change the CraftRecipe stuff around

#

Hmm just realized these have an OnAddToMenu function, is there maybe something similar for items/weapons when being added to inventory UI 🤔

#

I doubt it honestly

bronze yoke
#

no

thin swan
#

Would have been too easy

#

I want to change how I remove my bike containers from rendering in the inventory UI, it's causing a few compatibility with UI mods because I gotta add a check to the ISInventoryPane:renderdetails

severe maple
#

Does anyone know where the Melee Aim Outline is located in the game's files? Build 42 changed the outline from green to red and I would like to change it back to green in my mod

manic forum
#

My last try was replacing my item with the vanilla one when opening the build menu, but that only works semi good

silent zealot
#

I expect that either one of those has the color in the shader definition, or the color is provided by java when it invokes the shader.

severe maple
#

Alright thanks 👍

thin swan
manic forum
thin swan
manic forum
#

Wow, Thank you ! i was under the impression i need to inject me in somehow

#

works like a charm.

manic forum
#

@thin swan Do you know if i can do something like : item 1 [Base.Nail;tags[Nail]] . - to make it base works and all with nail tag

#

item 1 [Base.Item] tags[ItemTag], works

mild moss
#

This has probably been asked before but Discord search sucks and I can't find the info I need.

I'm trying to load a mod for testing. I'm using B42 and have configured launch options as "-debug -cachedir="C:/Users/User/ZomboidDebug" -modfolders mods,workshop".
I've followed the new folder structure for B42 but have no luck no matter which folder the mods are put in (mods or Workshop).
I'm sure I'm missing something simple but just failing to find it. I've been using the ModTemplate as a base and just adding a simple script to see if it works but no luck.
logs have seemed unhelpful as I don't see anything related to even attempting to load mods.

Any guidance or suggestions appreciated.

tired glen
thin swan
mild moss
#

Appreciate the feedback, in order,
ModTemplate is in Workshop folder of cache dir.
Yep, duplicate the mod.info in into 42 folder.
I've reviewed the structure and I believe I've recreated it correctly.
I've also tried just manually installing a known working B42 mod from the workshop but no luck

flat bluff
#

For Build 42 can we still write Recipe.OnCreate functions ? I've noticed that the recipes that employ that call to OnCreate have "NOTES: FIX IN PROGRES" comment. Does that mean that I should avoid using that?

bronze yoke
#

yes, their signature is a little different though

flat bluff
#

the parameters change?

flat bluff
#

I might have found examples

#

Thanks a lot Albion!

tired glen
#

Is there any mods that add in gun parts?
I had an idea but I want to see if anyone has done it before, I kind of figured it would just involve some convoluted evolved recipes

#

The game code isn’t too complicated I might actually be able to copy the vanilla implementation

daring bough
#

Check this vehicle pack that i made. For now it’s only for b41, and under testing & development. I’m planning make b42 version and then upload to workshop. It’s not animated, but brings good variety of accurate time period cars to the game✌🏻

flat bluff
#

Would it happend to be that the guy creating Project AVA is around here ?

icy night
bright fog
#

Bcs they aren't used in vanilla most likely

#

Also you started documenting every script entry types ?

bronze yoke
#

another reason it's easier to just read the recipe code than try to guess based on recipes 😅

bronze yoke
bright fog
#

Bruh

#

Also, someone contacted me about parsing the game files to create a Lua doc, and possibly a script doc later

#

They didn't contact you yet tho ?

bronze yoke
#

i think they did

#

i didn't really have much to say about it though, would be a cool idea but not the first time i've heard it and then seen nothing happen 😅

bright fog
#

Told them they should contact you, because you're currently managing most auto docs and so working together would be best

bronze yoke
#

parsed script docs are impossible, the game just doesn't define script parameters, it's all hardcoded: you can do some very basic extraction with regex but it won't give you any useful information

#

lua docs are something i want to do eventually, 99% of the work is actually building a website though and that's not really my favourite thing

#

if that guy actually does do it i'll be happy

bright fog
#

Yea, I discussed with them to have a singular website to host all the java, lua and possibly script docs in the future

#

I myself don't know jaxkshit about websites so can't do much on that part

bright fog
#

We might have already discussed that anyway

bronze yoke
#

yeah, i don't have that finished, lost a lot of steam halfway

#

it's a brutal amount of data to collect

#

i think i got to around half item parameters documented after a few days of multiple hours a day working at it

tired glen
#

Who is jason and why is he in my files

bright fog
#

Can you send me the link of the file ? I'll note it to go and document it

#

Also one issue I mentioned with that person who's parsing the Lua, is that documenting some parameters can't really be done with a simple description thing. The reason being that some parameters have specific details, like I did for craftRecipe

#

And so we might need to find a uniform method to document them in a file to automatically use

bronze yoke
#

yeah, that's what i was working on

#

this was meant to be used for a language server so it needed all the information necessary to error check a script

bright fog
#

For a language server sure

bronze yoke
#

some descriptions are fairly long

bright fog
#

Tho they don't use sectioning do they ?

#

I'd have to get familiar with the documenting format on the potential script doc to know what's possible I guess

#

Tho it's probably just html I guess

#

Like adding code blocks and shit is problematic if you see what I mean, bcs that can't be used in the same way in a language server

#

Unless it does accept html ?

bronze yoke
#

it actually can, at least vscode will render quite a lot of things

bright fog
#

Idk, that's what I mean by a uniform way of documenting these

#

So we're not limiting the usage to just the website doc possibly

bronze yoke
#

i didn't settle on anything like that because i didn't need it but i'd imagine it'd use markdown tags since that's what vscode prefers

#

generally markdown is pretty universally supported these days

#

at worst it's not that hard to parse and convert to a different format

bright fog
bright fog
flat bluff
solar rover
#

Is there a proper format for trailer attachments? I'm trying to set another type similar to trailerTruck

solar rover
#

I thought as long as the lead and towed car had matching names it worked but that doesnt seem to be the case tonight.

thin swan
thin swan
tired glen
#

Glad to know it should work, thanks

thin swan
# tired glen Yeah the idea was to basically break down the three different gun types into the...

That's a great idea for a mod, go for it!
If you're making/using custom models I'd suggest you check out this guide by Nik https://steamcommunity.com/sharedfiles/filedetails/?id=3060255898

Your first time trying to create your own gun mod, or struggling with making it work? I've been there. I've spend days figuring out why my gun model does not show / is semi transparent / is upside dow

solar rover
#

No help on the trailer issues eh? frustrating that trailerTruck works and I cant get anything else to do so

tired glen
tired glen
#

Does anybody happen to know how the recipe Mappers work?

#

I haven't seen a reference to this anywhere thus far

#

Effectively, what I'm attempting to do is take the base game weapons, (The desert eagle in this case) and create an instance of that item using the recipe, but each item in the recipe can be one of three tiers, and the tier of the item contributes to the weight of the weapon and applies a modifier to the base stats depending on the category (military grade is lighter, enthusiast gives a durability boost but is normal weight)
I'm assuming I don't need to map the item out like this, but applying modifiers to specific instances of items doesn't seem like something that's really intended, unless I attach invisible attachments to the gun that aren't removable in nonexistent slots that give a stat boost, which could work

#

evolved recipes handle this really elegantly because the resulting item takes into account the stats of all the components, but i want the resulting item to be entirely compatible with anything that modifies guns, so it should only multiply base stats

#

It seems like the mapper does not do this, I may have to hook the craft function?

silent zealot
#

Some item properties are saved with each individual item, while others will always use the value in the item script.

#

Luckily most of the weapon parametrs get saved with the item.

tired glen
#

i figured, because of the existing attachment system

silent zealot
#

For what you're decribing could you use the existing attachments system? Attach a military grade barrel, it modifies weapon weight and range.

tired glen
#

theoretically i could, i think
the idea was to make the guns craftable using some amount of input parts

#

but i suppose i could find a way to attach each part to the end result gun

silent zealot
#

you can still make guns craftable, but you'll need a lua script

#

so recipe is [oneof: heavy barrel, light barrel, normal barrel,] lower reciver, upper reciever
and then the lua script will modify the result as needed.

tired glen
#

so it's possible to run a function right after a craft? what hook is it that does that? can I specify which recipe I want it to hook?

silent zealot
#

And the recipe has OnCreate = Niko_OnCreate_M4

tired glen
#

ah nice

#

oooh there's a lot of OnCreate functions to reference in the base code

#

thank you

#

this should be easy

silent zealot
#

There is an example, showing how to get the list of consumed and created items

#

plenty more in media/lua/server/recipecode.lua

#

The recipe mapper is good if you have a simple relationshop using one input, e.g. open box of 100 things, map [Box of Nails -> Nails], [Box of screws -> screws], [Box of paperclips -> paperclips]

tired glen
#

catnod i see
i am learning

glacial flicker
#

There should be a mod that puts you into a little basement when you enter a tent in b42

#

Like more immersive

#

Like RV interiors but cooler!

#

Call it Tent Interiors

ashen coral
untold turtle
thin swan
# tired glen Effectively, what I'm attempting to do is take the base game weapons, (The deser...

Unfortunately, at least for B42, weapon weights can not be dynamically adjusted during runtime. There's a setter for it and everything, but it just doesn't do anything. I peeked at the Java code for it, and from what I can tell it will take the weight from the item script and that's it, nothing else will affect it. Adding weapon parts doesn't contribute to total weight either I'm afraid.

red tiger
#

If any of you modders are as insane as I am, you'd probably be interested in a translation and improvement of the LWJGL vector math library I translated to Lua. I even added swizzle notation support + dynamic constructors that fill just like GLSL vec and mat objects.

#

Swizzle notation from GLSL + power of LWJGL transformation and calculation methods.

#

🧮

red tiger
#

I'm preparing the necessary tools for writing a new UI system in the game using shaders.

#

=)

#

Tech demos prior to writing a full framework.

thin swan
#

Hell yeah, can't wait for your framework!

#

Been following your progress, you're doing great work and I have so many ideas for how to use it

red tiger
#

This is the magic vector library I translated from the game's 3rd party OpenGL library + additional helper code for making it easier to use:

#

The UI library I am planning to write will apply transformations using this library when calculating things like position on the screen, scale, rotation, etc.

#

margin spacing, padding, borders, etc.

pseudo hemlock
#

Hi, I have decided to create a mod for PZ. This is my first steps, so I'm just learning so far. I would like to make a menu in the left button UI. Who knows how to do it?

small osprey
silent zealot
#

No, only weapons support attachments.

#

And I guess vehicle parts, but that's not helpful if you don't want a vehicle.

small osprey
crystal sigil
#

is there a way to fetch all the skill books i have already read?
my current code:
local inventory = player:getInventory()
local items = inventory:getItems()
local readBooks = {}

        for i = 0, items:size() - 1 do
            local item = items:get(i)
            if item:getCategory() == "Literature" then
                local modData = item:getModData()
                if modData and modData.read then
                    table.insert(readBooks, item:getDisplayName())
                end
            end
        end

local bookName = "lorem";
if #readBooks > 0 then
print("has been already read:")
for _, bookName in ipairs(readBooks) do
print("- " .. bookName)
end
else
print("nothing read yet.")
end

small osprey
small osprey
# pseudo hemlock Hi, I have decided to create a mod for PZ. This is my first steps, so I'm just l...

Hey there Snow, The.

"in the left button UI". What UI is that? People here are quite familiar with all the ISUI-Stuff.

Me I am just a learner myself but here is the example of a single button on the lower left corner of the regular ingame view. Ignore the namespacing:

require "ISUI/ISButton"

StoryModeMod = StoryModeMod or {}
StoryModeMod.UI = StoryModeMod.UI or {}
StoryModeMod.UI.activeBottomPanel = nil
StoryModeMod.UI.BottomPanel = ISPanel:derive("BottomPanel")

function StoryModeMod.UI.BottomPanel:new()

    if StoryModeMod.UI.activeBottomPanel and StoryModeMod.UI.activeBottomPanel:isVisible() then
        return -- Already exists and shown
    end

    local screenH = getCore():getScreenHeight()
    local panelW, panelH = 300, 60
    local panelX, panelY = 0, screenH - panelH

    local o = ISPanel.new(self, panelX, panelY, panelW, panelH)
    o:setAnchorLeft(true)
    o:setAnchorBottom(true)
    o:setAnchorRight(false)
    o:setAnchorTop(false)
    o.background = false
    o.border = false 
    return o
end

function StoryModeMod.UI.BottomPanel:initialisePanel()
    self:initialise()
    self:addToUIManager()
    self:setVisible(true)
    StoryModeMod.UI.activeBottomPanel = self
end

function StoryModeMod.UI.BottomPanel:createChildren()
    ISPanel.createChildren(self)

    local buttonW, buttonH = 240, 40
    local buttonX, buttonY = 10, 10

    self.toggleButton = ISButton:new(
        buttonX, buttonY, buttonW, buttonH,
        "Story Mode Mod",
        self,
        someCallbackFunction
    )
    self.toggleButton.backgroundColor = { r = 0.2, g = 0, b = 0.2, a = 1.0 }
    self.toggleButton:initialise()
    self.toggleButton:instantiate()
    self:addChild(self.toggleButton)
end

To make it appear you need to somewhere call new and then call initialisePanel. You can probably bind that to the game start, or a player action.

thin swan
silent zealot
#

Probably a legacy of pre-B42 "guns are melee weapons with a long range" design.

bright fog
#

The mod would just need updating

small osprey
crystal sigil
#

hi guys, when i have timedaction with a book, can i get the itemname of the book?

limpid marten
#

Anyone know how creating a submod works? Tried but it doesnt seem to be working

small osprey
limpid marten
#

A mod inside of a mod basically, I want to have two options when it comes to enabling it on a server (Basically I want to give server owners an option on a modern music option or an old music option)

small osprey
bright fog
bright fog
bright fog
#

If the mod involves modifying the gameplay specifics of your mod, you need to use sandbox options !

#

I guess I need to add a massive huge note on that wiki page so people understand it

#

They should be used for USER SPECIFIC STUFF like UI options for example

small osprey
#

Fair point. I have a quite single-player-focus-mindset in my modding. By choice 😄

bright fog
bronze yoke
#

build 42 doesn't have multiplayer so there's no difference 🤔

small osprey
bronze yoke
#

it's not really a strict rule that it shouldn't affect the world/gameplay, it moreso depends on what you think server admins would want to enforce

#

what is part of the 'rules' of the game depends on the mod

small osprey
#

So, if server admins want players to select their private sound stuff -> mod-options
If server admins want to enforce player-base-wide stuff -> sandbox
?

silent zealot
limpid marten
#

Ye!

silent zealot
#

Super easy

#

you just put two (or more) mods in the Zomboid\workshop<anme\Contents\mods\ folder

#

Optional: set up the mod.info file so they are mutually exclusive and you can only subscribe to one of them.

limpid marten
#

Weird, mine wasn't showing up in the mods section

silent zealot
#

Make sure they have different modids in mod.info

limpid marten
#

Ahhhh that was it!

#

Thank you so much!

silent zealot
#

😃

thin swan
#

Hmm... Can you trigger vanilla keybindings, like for example if I want to simulate holding W (or whatever the user has set as their walk button) with just Lua, is it possible?

bright fog
# small osprey How so? If there is a thing that "affects the world" and there is only one playe...

Bcs players associated mod options to user options, and sandbox options to gameplay options. Yes you should teach the right usage of the options and I will stand firmly on this that YOU SHOULD FOLLOW THAT. "Multiplayer is not out", ok and when it comes out, even simple mods that could be by default compatible with MP will not be, and you end up with every modders having to relearn everything regarding modding options

#

I will not teach bad usage of modding tools in a wiki which should teach the best ways to handle stuff to reduce modding mistakes, I will defend this to my death, bcs that's the goal of the modding wiki, to get modders properly into modding, and not teach wrong doings

bright fog
small osprey
#

hush my dear. Not asking you to reduce standards. In-fact I applaud it. I learned something Today.

thin swan
#

Anyone know how to make your character walk as if you're pressing WASD? Seems trickier than I thought, or I'm missing something

bright fog
#

The timed action of walk to

thin swan
# bright fog Check walk to

Yeah I tried looking at that to see how they do it, but it doesn't seem to do what I need. I'm basically trying to make an auto-walk mod where you press a key to toggle walk and then use mouse for direction, and I have it working fairly well using setIgnoreMovement but I want to be able to go from idle to walk when pressing my auto-walk key, but I need to trigger the regular movement for it to work

frank elbow
#

Although it looks like that's a press & not a hold

thin swan
thin swan
thin swan
#

Doesn't seem to work :/ tried calling it in a few different ways but no luck. Since it seems only to be used in the context of joypad, maybe it needs gamepad to be enabled for it to work or something?

thin swan
#

I love seeing stuff like this in the vanilla files 😄 Makes me feel better when I resort to hacky solutions

bright fog
#

Can't they literally just use some system variables or some shit ?

tired glen
tranquil kindle
#

Then modify said attachment's weight reduction to achieve something similar

bronze yoke
#

pinging @true plinth as this was your suggestion initially

manic forum
#

Does any1 know how i can edit a zombie.scripting.entity.components.crafting.InputScript@26cf08d9 class, i wanna add tags

tired glen
tranquil kindle
#

I mean, thats exacly what Sling does in B41. Though why vanila B42 does no longer have Sling is strange, all the things that made it work do work. Unles by making it reduce more that its weapons weight so it goes in negative is your goal, im not sure if it will work like that

tired glen
tranquil kindle
#

So yeah, weight is easy, about durability thing at least for b41 was easy enough with some lua, but im not sure if b42 changed it much.

tired glen
#

Hopefully not, it sounded like the weapon itself would just not allow you to change the durability at all so I’m glad I misunderstood what they were saying

#

When I get home from work I’ll try to put some stuff together and see if it works :D

#

I think what would’ve been the coolest way to implement this is if the frame part was actually just the gun, and you made it functional by attaching additional parts, but that seems a bit out of the realm of possibility with this implementation of weapons

flat bluff
#

May I ask you folks how the hell do you tag your mods propperly ? When i go to upload them on Steam the available mod tags do not include B42 and other useful tags.

bronze yoke
#

are you in build 41...? build 42's uploader should have all the tags

flat bluff
#

Ohh.. right.

#

Damn. Thanks again Albion. You are the MVP

thin swan
tired glen
thin swan
thin swan
tired glen
#

Noted! I will take a look at it if I run into any road blocks happysmile

tired glen
#

Been thinking about it while I was changing oil and possibly a solution using that is to change the model reference for the deagle to be an incomplete version (frame), then make the slide and barrel both attachments
Vanilla spawns I’ll replace the deagle with one complete with parts, and the other two versions can be found as incomplete only
Individual part durability could also be cool but first i think this is enough for a complete game mechanic

manic forum
bright fog
#

And add your own item to the ArrayList

#

If I remember right

#

I might need to make a wiki page about that

manic forum
#

so you get a pointer back in lua

bright fog
#

It's a direct reference to the ArrayList Java side

#

That's how almost every single Lua-Java interfaces work

#

In PZ at least

bronze yoke
#

yeah, everything acts more or less like a pointer in java

#

other than some primitive types

#

a getter generally returns the original object, it *can* deliberately make and return a copy to stop you from accessing the original but that's very rarely done

#

the new craftrecipes don't support that much runtime modification though so mileage may vary

#

recipes were much easier to mess with through code, with the drawback of being a far crappier system in general 😅

tired glen
#

I forget pointers are a thing in Java cause you kind of just expect everything to return a reference unless you specifically want a memory copy

burnt quartz
#

It seems like this can only be achieved via Java modding

tired glen
#

The only way I know to hook into existing game code atm besides at load time is via the Events global

thin swan
# burnt quartz It seems like this can only be achieved via Java modding

No it can be done with just Lua, you can check squares for doors and all doors open on the square they are on, so just hook into ISOpenCloseDoor:isValid() and add a check to see if the square that the door is on also has a body, and if it does, return false and you won't be able to open the door.

thin swan
tired glen
#

Interesting, this is sort of an equivalent for calling base in C#, good to know woohappyyay

#

Kind of crazy that any mods can work together at all, if two mods both hooked the same function I feel like there would be some confliction

#

Well maybe that depends, actually. Hmm

bright fog
bright fog
#

Like a hook that doesn't call the original one

red tiger
#
-- normal call.
instance:instanceMethod();

-- same call result.
clazz.instanceMethod(self);
#

Use this method of passing self or instance

#

if you store the original function and then assign a new function to the Lua class, you can effectively invoke the original method using this.

#

This means that (provided all mods do this) you can chain-call multiple mods overriding the same function.

sour island
tired glen
#

Really cool idea though, that makes sense

#

I thought order might’ve been an issue but the way you explained it that seems irrelevant so good to know

bronze yoke
tired glen
#

Oh good so it works exactly like I thought it would after that explanation

#

Terrifying

#

…I love it

frank elbow
sour island
#

and thanks- this was supposed to be a quickie week-long project but I got wrapped up in it lol

frank elbow
#

How those often go lol, looking forward to checking it out & playing with it

sour island
#

There is some limitations- due to it being technically running ontick-- but I use timestamps for the note timeline

#

also going over 100 concurrent notes borked FMOD's channel limit so I have something killing earlier sounds -- overall it sounds great if you write the music yourself or find abc songs online-- but midi to abc conversions can sound weird

frank elbow
sour island
#

Is this using a 3rd party program?

#

Or just playing the sound files

#

And yeah-- pushing the tempo of the song seems to help sort of

#

I'm not sure how it could be improved outside of implementing a separate thread using os time, perhaps?

frank elbow
tired glen
#

I like how everything breaks if you try to refresh a lua script with a function override in it

#

is it causing a recursion by referencing itself cause that's the only conclusion i could draw

bright fog
#

It's not a recurse, this would mean it would call itself

tired glen
#

if i don't call the initial script from the game before i called mine it was just telling me it was corrupt and stopping the function entirely

#

dunno why
i stopped messing with it for now

#

probably try something simpler to get the hang of lua and the docs

bright fog
silent zealot
#

It doesn't clean up any existing modifications to functions or things getting added to Events

#

You could code you lua scripts to do that cleanup when they are re-run, but that's a lot more work than just quitting to the menu and running reload lua

bright fog
silent zealot
#

That's helpful, I was sure it didn't last time I checked but I can't remember how long ago that was

bright fog
#

Haven't been able to check myself tbh

#

Especially as I never hot reload my events because they in separate files

manic forum
#

What event is the closest to "You can play now", i mean in like joining a world and you cant controll your char, and the first event that i can trigger my Script.

OnLoad, OnGameBoot, OnGameStart, OnInitGlobalModData triggers at some wired time

bright fog
#

If I remember right

#

It seems to be the usual go to at the very least

manic forum
#

i will try

bright fog
#

I need to make that timegraph showing the triggers lol

manic forum
#

Yeah i mean the names are good but in what order comes what is confusing

bright fog
#

Yea that's fair

#

I had done some tests regarding that, and I need to write them down on a time graph

#

Which was my goal

manic forum
#

sounds nice

jade loom
#

https://steamcommunity.com/sharedfiles/filedetails/?id=3412682512 (Bandits Extra Options)

https://steamcommunity.com/sharedfiles/filedetails/?id=3268487204 (Bandits V2)

Why is it, when changing Bandits Extra Options mod.info file from

poster=poster.png
id=BanditsAddOptions
description=Add new sandbox options to manage your Bandits experience
require=\Bandits```
 to 
```name=Bandits Extra Options
poster=poster.png
id=BanditsAddOptions
description=Add new sandbox options to manage your Bandits experience
require=\Bandits2```
 it recognizes and accepts the dependency, but at the same time says, that it cannot be enabled at the same time as the very mod, which it is listed as being dependent on?
#

Just found out, that disabling Bandits V2, then enabling Bandits Extra Options, it also enables Bandits V2 at the same time, while Bandits V2 doesn't have any dependency on Bandits Extra Options. xd

bright fog
jade loom
#

I cannot enable the bandits extra options after the bandits v2, thats the problem, I know its a dependency

jade loom
#

after enabling bandits v2

craggy nacelle
#

Have't done much with mod data and attachments till now, so i am a bit confused. I put a 'message' on a knife (in my inventory since i read a comment from chuck that it wont save mod date if not in my inventory), then attached the knife at a zombie. But when i put multiple knifes out there and do a reload of the game, it doesnt remember which zombie 'carried' which message with them. I thought i had read the costume was persistent, so is the attachment not part of the costume or is the problem that the knifes cant 'remember' which mod data belonged to them?

bronze yoke
#

i wouldn't expect that to work with zombies unfortunately, i'm surprised there was anything still there at all

#

zombies (especially in b41) have persistence issues since they save as little data as possible to avoid save file bloat

craggy nacelle
#

Hi albion. Yes it seems the mod data is saved when i move it to the inventory and put the message there. Then i use attach item for zombies. After reload i checked for the 'knife in the back' and it looks like it can still find mod data for the knife, but the knifes seem to be shuffled among the zombies with knifes in the back. Welp, there goes my sticky note at the back idea. ^^

Guess i could see if i can use the costume id in relation to the note? Also i heard if head gear falls of it changes... does that also happens when the cloth get damaged? Like having holes or stuff?

bronze yoke
#

no, it only changes if the hat falls off

craggy nacelle
#

Remove the hat before trying to attach a note, gotcha. Thx albion, will try if i can link it somehow. 🙂

sturdy salmon
#

Good morning. Does anyone know if it's possible to define rooms within the open world? I've managed to change their IDs, but when I change chunks, that information doesn't persist. I'd like to be able to save that information. My idea is for players to be able to build in the open world and then define rooms once they're closed. Without having to use the map editor, because otherwise, each player would have to give me the house they want.

bronze yoke
#

the region manager will create a new room when you build one, you don't need to create it manually

sturdy salmon
#

But it is created with -1

#

When created with -1, light switches cannot be used for example.

#

My question is, when I add an object to the world, for example, a floor or a wall, is it saved? Because if I step away long enough to exit the chunk or log out, the building is still there when I come back. So, if I can save that room ID change, I could generate a room as if it were an in-game building, with shadows and lighting.

bronze yoke
#

i know for a fact you can't create a functioning isoroom from lua, you may have some luck manipulating the ones created by the region manager though

sturdy salmon
#

Thank you.

bronze yoke
#

if the changes you're already making are enough for it to work but you just can't get it to save, you could save the position of the room + the id to change to in global mod data

#

then you can just make the change again when it's loaded

sturdy salmon
#

It would have to save and load the chunk as the player exits it.

#

If there is no other option, I will have to do it.

#

But in the long run, if there are too many rooms, that might be a problem.

#

I don't know if this works, I'll try it.
public void addSpawnedRoom(int roomID)

sturdy salmon
#

From what I'm seeing, in build 42 there is the LoadChunk event, but in 41, that doesn't exist, so I would have to see when it loads it, and ultimately, create a custom event. And even then, I would be overwriting the information every time the player leaves and enters the chunk, which doesn't seem like a good idea to me, but if there's no other way, I'll have to try it that way.

craggy nacelle
#

@bronze yoke Sorry, looked like i talked utter nonsense. Turned out i overlooked that i somehow attached new knifes at the game start so ofc there would be mod data... if i dont do that, there are no knifes. 😅

craggy nacelle
#

Wouw thx. Seems i can always find stuff on the wiki i cant remember having seen before. XD

bronze yoke
#

just noticed they added a new parameter to OnWeaponHitXP

#

its value is always 1. always. it's not even a variable

#

?????

thin swan
#

Yeah they make some weird decisions sometimes 😂

bronze yoke
#

i can see how you might need to keep something like that for compatibility reasons, but they specifically added this some time after i collected my data

silent zealot
small osprey
#

actually it calls for an addition: CorpsesHinderPlayer -> Slow down, stumble etc.

bronze yoke
#

tripping over corpses would be so funny actually

small osprey
#

Someone posted a way to make-player-trip earlier, right?

burnt quartz
#

good idea actualy

#

I feel like I've seen a mod like that

small osprey
#

And regarding the blocked door: Also stops the door from opening? oooh the fire safety inspector is gonna be mad. But should make for great emergent gameplay. Gotta hack through that security door 😄

burnt quartz
#

yes

small osprey
#

Cool! maybe could add a strength check, at least for opening ... depending how many zombies lie there.

#

I have to try out your mod later. So good to see small effective things like this vs. mamoth-do-it-all mods.

burnt quartz
#

ı will try to add

small osprey
#

maybe make it a sandbox setting for people to try 🙂

burnt quartz
#

yes

small osprey
#

Hilarious idea and probably weird to implement but hear me out .. b42 added "ramps", right? .. You know where I am going with this ....

bright fog
#

There's a mod

brave bone
small osprey
#

Also new (disgusting) building material unlocked. Think 300

brave bone
#

Sorry I @bright fog lol. Fat finger..

small osprey
#

TIL: Starlit has exactly the event system I was fearing does not exist. omg. 🫶

slim moat
#

I have recently seen that Project Zomboid is actually written in Java of all things. Considering the huge success of Minecraft modding / plugin development, is there any chance the team would ever consider a Java-side modding solution?

I selfishly ask as Java is my bread and butter, and Lua gives me a headache 😭 😂

bronze yoke
#

no, they've always been strongly against it

#

using lua makes it easy to ensure mods can't do anything dangerous

#

they don't really care if you make java mods anyway but there'll likely never be any official support for it

slim moat
#

Damn, that's a real shame. Something I, albeit annecdotally, have seen is several "numerical bugs" in a lot of mods and, with the way Lua is syntax / form wise, it does track 😅

bright fog
#

Called Leaf

slim moat
bright fog
#

Unknown, but knowing the person I doubt it won't get open source at some point if it isn't already

#

You can find it on the modding Discord

slim moat
slim moat
#

Yeah that didn't work ahha

bright fog
#

Click it

#

It's a fork of one of the Minecraft loader, I always forget the name of it shit

slim moat
#

Oh wait jesus its a fork of fabric rather than from scratch

#

God damnit 🤣 😭

bright fog
#

that one lol

bright fog
#

From my understanding of it, the use of it seems properly adapted, especially because this allows mods to be downloaded directly from the Workshop

#

It just requires users to download Leaf manually, and then download mods from the Workshop

#

Tho currently it loads every downloaded mods instead of the activated ones which imo it should only load activated ones

#

But that's something to improve in the future

slim moat
bright fog
slim moat
#

Aye already moved to the other discord

bright fog
#

Yea

bronze yoke
#

nobody's really been able to use it yet so we'd have to see if those issues carry over

bright fog
bright fog
red tiger
#

Playing with Suno, trying to generate music that's sort-of PZ-esque in energy and sound.

#

Tried to make it sound more like STALKER but it went hella hard into that banjo / violin motif.

#

Could be one way to shift the mood of the game through ambient works if one doesn't have thousands of dollars' worth of sound equipment / software lying around and wants to make a mod.

red tiger
#

Is there a mod framework that True Music or others use that I could use to make a Whiskey Blues music mod?

neat wave
#

i have an idea for a mod.

#

racist zombies...

#

any takers?

red tiger
#

<@&671452400221159444>

neat wave
#

aww

#

care to hear me out or am i just posting in the wrong place?

neat wave
#

thats the basic idea, but radomized skin color for all players and more specifically which color attracts the dead. thats it in a nut shell. i think it could be fun in muliplayer.

silent zealot
#

Oblivion Remastered makes Zomboid mods look sane; there are Unreal .pak modes, Bethesda .esp mods, unreal script extender mods, oblivion script extender mods, magic loader mods, and .ini files in My Documents mods. All of which get installed to different places.

silent zealot
bright fog
#

Thank god you don't make games

quartz kindle
#

Looking for a dev to help develop a quest line using the Soul Quest System framework (paid)

fallen merlin
thin swan
#

YOOOO!!!
-Introducing ragdoll physics.

#
  • Added "cyclicRateMultiplier" property to HandWeapon scripts and instances.
    Hmm, I wonder what this does
#

Oh there's some goodies in this one, lots of power related stuff, making a mod to restore power to specific areas should be a breeze now

#
  • Fixed M16 full-auto rate of fire being way too high.
    Sick
#

Oh the ragdoll is fuuuuun, guns are so back

silent zealot
#

Looks like a good patch

#

I'm too tired to look at it now so I'll sleep and wake up to people asking stupid questions in mod comments tomorrow.

mellow frigate
thin swan
#

There's an issue with the ISRichTextPanel.lua if you have VideoEffects set to off, it will cause main menu loading to fail.
Fix is:

  1. Go to C:\Users\[YourUsername]\Zomboid
  2. Open options.ini
  3. Find doVideoEffects and change it from false to true
drifting ore
storm trench
#

Any major mod breaking issues with the update?

terse wyvern
#

For me it seems to be mainly mods that have to do with the map--

"...\lua\client\ISUI\Maps\ISWorldMap.lua" and the like. Seems like they added a lot of stuff!

function WorldMapOptions:onDarkModeChanged(value, slider) getCore():setOptionWorldMapBrightness(value / 100) local alpha = PZMath.lerp(20, 100, value / 100) self.darkModeLabel:setName(tostring(math.ceil(alpha))) end
MapUtils.renderDarkModeOverlay(self)

etc. dark mode functions added? can't seem to find them on the map tho

thin swan
bright fog
slow pendant
bright fog
#

:|

winter bolt
bright fog
#

But don't touch my racism, how dare woke PZ players touch my racism >:(

slow pendant
#

the idea itself came from a skit, a satrical skit, that has a LOT OF SCENARIOS PERTAINING TO RACISM, and making it into something funny and enjoyable (they made one with aliens that looked like humans, but didn't really understand racism hence they didnt blend in well)

#

nothing wrong with a new idea, you can not like it, but why immediately put it down and say "you should never make a game" because of ONE IDEA, which a few people might find funny

bronze yoke
#

man you're really mad about this huh

slow pendant
#

and so what if they disagree with it, just because you disagree with a person doesnt mean everybody will (though I understand in this case, some will, some may not)

solar rover
#

Gonna slip this back in here.. lol

The texture on my new melee weapon freaks out when it has blood on it. Where/how do I correct this?

solar rover
#

When it fits it fits

bright fog
#

Show your item script

solar rover
#
    
    imports{
        Base
    }
        
item MegaWrench
{
    DisplayName = Mega Wrench,
    DisplayCategory = ToolWeapon,
    MaxRange = 1.25, 
    WeaponSprite = Gearhead.MegaWrench,  
    MinAngle = 0.67,
    Type = Weapon,
    MinimumSwingTime = 4,
    KnockBackOnNoDeath = TRUE,
    SwingAmountBeforeImpact = 0.02,
    Categories = Blunt,
    ConditionLowerChanceOneIn = 70,
    Weight = 4, 
    SplatNumber = 1,
    PushBackMod = 0.8,
    SubCategory = Swinging,
    ConditionMax = 12,
    MaxHitCount = 3,
    DoorDamage = 15,
    SwingAnim = Bat,
    MinRange = 0.7,
    SwingTime = 4,
    KnockdownMod = 2.5,
    SplatBloodOnNoDeath = FALSE,
    Icon = MegaWrench, 
    BreakSound = WrenchBreak,
    DoorHitSound = WrenchHit,
    HitSound = WrenchHit,
    HitFloorSound = WrenchHit,
    SwingSound = WrenchSwing,
    TwoHandWeapon = TRUE,    
    TreeDamage = 0,
    CriticalChance = 30,
    CritDmgMultiplier = 1.5,
    MinDamage = 0.8, 
    MaxDamage = 1.3, 
    BaseSpeed = 1,
    WeaponLength = 0.5,
    AttachmentType = BigWeapon,
}


}

its a big ugly gold wrench with a black striped handle so the players can see it on the zed but when used by a player the first time it gets dirty...

bright fog
#

Uuuh, where is the model defined for weapon items ?

solar rover
#

oh sorry

#
module Gearhead
{
    imports{
          Base
      }
    model MegaWrench
    {
        mesh = weapons/MegaWrench,
        texture = weapons/MegaWrench,
    }
}    

I have a few more items going into this zeds drops so its all in a models file

bright fog
#

If I had to guess, I would say a UV that doesn't allow for blood to be well set on the item ?

#

Does that reuses the in-game wrench model ?

solar rover
#

yeah I was trying to be lazy

#

I just needed something on a zed's back so the players could pick him out of a crowd and it turned into a whole thing and I figured I could use a wrench and let them have a % chance at the drop

bright fog
#

Why did you make a new model actually

#

You can just simply copy pasta the wrench model script, rename the ID

#

And then if the item in hand is an issue, use the attachment system

#

This would stop making copies of models that already exist in the game files

#

Same for textures

solar rover
#

Its been a week or two, I think I saw the .x file and said well crap and made it an fbx instead

bright fog
#

Idk if that would fix your blood issue tho, most likely unrelated

bright fog
solar rover
#

its a fair point, adjust the scale and target texture and Im good

bright fog
#

You can just use the same model, you won't even need the model in your mod files

#

It'll the vanilla model file

bright fog
#

No need to change it

#

Like literally just copy the model script, rename the ID, scale it, set attachment points coordinates and orientations etc

solar rover
#

Mostly I wanted it to stand out vs the grey base texture

#

why its striped and ugly lol

bright fog
#

Ah I mean if you really want to change the texture you can do that sure

#

You kept the same texture size ?

#

Or did you resize it ?

solar rover
#

its the same, just tossed it into PS and adjusted hue and threw some ugly stripes

bright fog
#

Hmm

#

Perhaps it's the default UV being just dogshit lol

bronze yoke
#

i don't really understand how it could be the uv

#

it's not the blood that's messed up, it's the original texture, which is obviously mapped fine before you add blood

bright fog
#

No idea how blood is applied to weapons, but I would have guessed an extra texture added on top of the original texture

#

And if your UV is all over the place, it add the blood in a natural way, like if it's stretched and shit

solar rover
#

I assumed overlay but couldnt find any setting

bright fog
#

But I don't know the details tbf, trying to throw some ideas here and there

bronze yoke
#

i mean the blood looks okayish, it's the actual base texture that gets messed up

#

how does the normal wrench look when you get blood on it?

bright fog
#

Ah nvm you're right

solar rover
#

It's all appreciated, anything I can test or workshop helps. Adjusting the base vanilla will be my next step

#

retains the image

#

so I'll see if I can just point to vanilla with a swapped texture target

#

interesting... the UV for base wrench is not aligned with the texture?

#

might be a directx import thing though..

bronze yoke
#

something like that could be the cause yeah

solar rover
#

I'll keep poking around, if I need to just have a big yellow wrench so be it lol. Thanks y'all!

#

It's still like that on my fbx though... I'm going to move it up into the proper area and see how it turns out.

solar rover
#

Thanks for the troubleshoot!

silent zealot
#

Hooray! VehiclePart was not updated so I don't need to update my Java mod!

#

...probably. I'll have to test anyway.

azure rivet
#

Hi, Im using "IconsForTexture" for 3 variants of an item, is there a way in Lua to choose the first icon item to spawn?
shrug

silent zealot
#

There might be a better way when you create the item, but if not an OnCreate function can do whatever you want to the item

tranquil kindle
silent zealot
#
icy night
#

In relation to the update of biomes, how can I get the players current square and check what biome they're in?

bright fog
#

Check in the java doc

thin swan
#

Did something wild today

#

started PZ and actually played the game

bright fog
silent zealot
dull moss
#

did they change something about herbs

dull moss
#

did they do something to forage defs?

---Generates a list of herb types based on valid categories
local function generateHerbsList()
    local validCategories = { WildHerbs = true, WildPlants = true, MedicinalPlants = true };
    local filteredTypes = {};
    print(forageDefs)
    for key, value in pairs(forageDefs or {}) do
        if type(value) == "table" and value.type and value.categories then
            for _, category in ipairs(value.categories) do
                if validCategories[category] then
                    table.insert(filteredTypes, value.type);
                    break
                end
            end
        end
    end
    local filteredTypesMap = {}
    for _, herbType in ipairs(filteredTypes) do
        filteredTypesMap[herbType] = true;
    end
    if detailedDebug() then
        print("ETW Logger | Filtered Types Map:")
        for herbType, _ in pairs(filteredTypesMap) do
            print(herbType)
        end
    end
    filteredForageHashMap = filteredTypesMap;
end


Events.onAddForageDefs.Remove(generateHerbsList)
Events.onAddForageDefs.Add(generateHerbsList)
#

im getting forageDefs = nil

#

shit used to work before last update waaaa

bronze yoke
#

i see no vanilla variable called forageDefs

dull moss
#

now i gotta figure what they did DESPAIR

#

k i just gotta parse forageSystems forageDefinitions and filter out things that fit my categories

#

there used to be forageDefs table before

dull moss
#

if somebody wanna screw with foraging later, you can fish out items of categories you need like this:

local filteredForageHashMap;

---Generates a list of herb types based on valid categories
local function generateHerbsList()
    local validCategories = { WildHerbs = true, WildPlants = true, MedicinalPlants = true };
    local filteredTypesMap = {}

    for itemName, defTable in pairs(forageSystem.forageDefinitions or {}) do
        if type(defTable) == "table" and defTable.type and defTable.categories then
            for _, category in ipairs(defTable.categories) do
                if validCategories[category] then
                    filteredTypesMap[defTable.type] = true
                    break
                end
            end
        end
    end

    if detailedDebug() then
        print("ETW Logger | Filtered Types Map:")
        for herbType, _ in pairs(filteredTypesMap) do
            print(herbType)
        end
    end

    filteredForageHashMap = filteredTypesMap
end


Events.onAddForageDefs.Remove(generateHerbsList)
Events.onAddForageDefs.Add(generateHerbsList)
azure rivet
azure rivet
icy night
mossy steeple
#

is there a proper guide on how to update true music addons to b42 anywhere? i know there's a couple of spawn locations you have to remove, gendered wardrobes or something, but it is a pain to dig through endless messages and comments to try to figure out exactly what needs to change

silent zealot
#

Just start in debug mode, see which lines throw errors Decatur a take did not exist, fix those

#

WardrobeWomen and WardrobeMen -> WardrobeGeneric is one, at least one other category changed the case of words

mossy steeple
#

i'm seeing that BedroomSideTable might be one as well- for spawn rate issues i figure i just pump the numbers up in general?

tired glen
#

Increasing the numbers fucks with the weight of everything else may not have the desired result

unreal pewter
#

Hey all, I'm trying to make a mod that will make zombies pathfind indoors during rain or storms, is there any way of:

  1. checking the current weather condition
  2. making zombies pathfind somewhere "indoors"?
    idk how to really do either of these things so if anyone could point me in the direction of any documentation on the topic thatd be very helpful
#

I'm looking at the rain barrel code in particular to try to figure out how that does it, and i'll look at another mod to determine how it can tell that the player is in rain and see if I can work backwards from there, but could someone help me decipher this?

function SRainBarrelSystem:checkRain()
    if not RainManager.isRaining() then return end
    for i=1,self:getLuaObjectCount() do
        local luaObject = self:getLuaObjectByIndex(i)
        if luaObject.waterAmount < luaObject.waterMax then
            local square = luaObject:getSquare()
            if square then
                luaObject.exterior = square:isOutside()
            end
            if luaObject.exterior then
                luaObject.waterAmount = math.min(luaObject.waterMax, luaObject.waterAmount + 1 * RainCollectorBarrel.waterScale)
                luaObject.taintedWater = true
                local isoObject = luaObject:getIsoObject()
                if isoObject then -- object might have been destroyed
                    self:noise('added rain to barrel at '..luaObject.x..","..luaObject.y..","..luaObject.z..' waterAmount='..luaObject.waterAmount)
                    isoObject:setTaintedWater(true)
                    isoObject:setWaterAmount(luaObject.waterAmount)
                    isoObject:transmitModData()
                end
            end
        end
    end
end```
#

i cant find a RainManager in the game files or anything so I'm a bit confused

#

in season.lua i found a bunch of scripts related to rainmanager but like everything is commented out?

tired glen
#

it's in the decomp

#

with the brand new patch you'll have to decomp yourself if you want the most up to date code

unreal pewter
#

rn im making this for my b41 so ill do it for that for now

tired glen
#

ah yeah use the other javadoc then

unreal pewter
#

thank you

tired glen
#

all the fields should be accessible on the lua side, functions i think mostly
there's guides on the wiki for how to read these if you aren't familiar with them

tired glen
#

So what all generator changes are there code wise I’m curious
Maybe power grid stuff is gonna be easier to mod

rich turret
#

is there a way to make a mod that features a new zombie type that makes no sound when he's behind you and only starts to make sound when you can see him?

silent zealot
thin swan
#

I wanna explore the "Added code support for mapper-defined "NoPower", "NoWater" and "NoPowerOrWater" zones"

#

I'm happy they added dumpContentsInSquare() for ItemContainers, I can now add an option to empty the saddlebags on a bike before detaching it

drifting ore
#

(Pls Help) Hello everyone, I have a problem I’d like to ask about.
When I right-click and try to use the item, I get an error.
Does anyone know what might be causing this, or how to fix it? I’m making a mod for a custom item — maybe that’s what’s causing the issue.

thin swan
silent zealot
drifting ore
#

Like this?

silent zealot
#

Your OnFillInventoryObjectContextMenu looks overly complicated; not to say it won't work but I'm not debugging item.items then item = item.items[1].

For reference, this is the context menu function I used:

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)
thin swan
#

It's throwing the error on a line that is only used in b41, so my initial thought is that the item script is set up for b42, but I don't know the differences in item scripts between b41 and b42

silent zealot
#

That's a good question to ask - B41 or B42?

bronze yoke
#

do you have any recipes in your mod?

#

i'm pretty sure this is one of the errors you get when you have a messed up recipe

drifting ore
woven bane
#

Is there any video that explain how can i make a gun mod ?

tranquil kindle
woven bane
solar willow
#

Does anyone know how to detect burn on player body parts. Working on a simple mod to make the player shout when they get wounded but can't figure out how to check if burned. Naming conventions for the other wound types are all over the place. Any help would be welcome

bright fog
#

Or some shit like that

small osprey
#

Q: Why would a mod running on b42 ever want or need to put a mod.info (and poster.png) into the mods root folder and not into common or b42?

small osprey
# solar willow Does anyone know how to detect burn on player body parts. Working on a simple mo...

You can probably track and periodically compare player:getBodyDamage():getOverallBodyHealth()
That one gets recomputed from various "primary damage sources" each tick it seems. It might also do something with blood level. I didn't test.

When 2 body parts have 100% damage (or 0 health respecively) the OverallBodyHealth() gets low enough to die 😬 it seems
player:getBodyDamage():getBodyPart(BodyPartType.Head)

wary tinsel
#

guys what am i doing wrong here

#

the descriptions are not showing

#

the way i used to do descriptions was a single paragraph

#

and with two paragraphs i can't do it like i used to

#

so i copied how the vanilla maps does the descriptions

#

and then the descriptions disappeared

small osprey
#

This is a map description? You could ask in the "PZ Modding Community" Discord "mapping" channel (I cannot post the link)

wary tinsel
#

oh, alright

hidden estuary
#

are there any up to date tutorials on new radio channels?

#

for b41 but if there's one for 42 thats grand as well

#

I used to maintain a radio mod but it was terrible to make those even with tutorials and it kept consistently breaking with each new b41 update

manic forum
#

What tool do you guys recommend to make a Custom "Crafting Station" i mean like the model

small osprey
manic forum
#

More Like a Industry Rice Cooker looking thing

thin swan
woven bane
#

Should i know about coding to make a gun mod ? Cuz i have no idea

silent zealot
#

If you're on B42 the weapon script will look different, but that's not a big deal since you just look at the vanilla weapon scripts.

#

Technically adding the weapon to loot tables involves code, but that's an easy things to do.

woven bane
silent zealot
#

media/scripts/items/items_weapons_firearms.txt

#

item Pistol

woven bane
#

My bad i was watching an old. Video everything different there

#

Thanks bro

silent zealot
#

that path is from my B42 install, it's probably the same in B41... if not look for "item Pistol" in a .txt file

bronze yoke
#

b41 has way worse script organisation

#

almost all of the items are in the same couple files

silent zealot
#

Useful tip for all modders: install VSCode, open the game's media folder, and use the search feature to quickly search for stuff. I keep a copy of VSCode open as my "reference VScode" seperate to the VScode I'm using to actually write stuff.

#

As you get better knowing what to search for this makes it very quick to find thing in the various .txt, .lua and .xml files.

simple helm
#

anyone know how or what the spawn location would be for lvinternationalairport trying too add a spawn location for a vehicle to spawn there

silent zealot
#

You mean co-ordinates?

#

right click on ground in debug mode for co-ordinates, or use B42map.com (note: that site seems to have slightly offset co-ordinates)

#

What stats should a 570mm handgun have?

ancient grail
silent zealot
#

Literally lit.

unreal pewter
#

anyone know a way i could make a zombie pathfind indoors? im having trouble figuring out how i could figure out what's "indoors" to make a zombie pathfind to it
if anyone could point me to a script that might know how to handle this itd be nice

#

by script i mean like, if any base game or mod scripts do a similar thing, so i could reference how they do it

brave bone
# ancient grail

Whao!!! this is so cool.. I would like a Star Trek Theme PZ :D, the spawn point is a crashed spaceship :3

ancient grail
unreal pewter
#

could i have a link to the mod?

ancient grail
#

this is such a weird error.
i isolated the skatepark mod (with the required tilemods)
and tested it it didnt produce this error

ancient grail
#

if thats not it on the description it links to the 2 other vampire mods

unreal pewter
#

random guess, i barely know how this game's code works

ancient grail
#

you can only use onzombieupdate client side

#

atleast thats what ive heard

small osprey
# silent zealot What stats should a 570mm handgun have?

I think you mean a 5.7mm ? 😄
IMHO:

  • increased magazine capacity (up to 25 rounds)
  • ~30% less recoil
  • less damage to unarmored targets than 9mm or .45 ACP
  • more "penetration" and maybe even damage to armored targets (bullet tumble chance inside flesh after armor slowed it down)
  • louder than 9mm
  • could use .22LR / .223 silencers if you really want to (we don't have .22 native ammo and guns eh?)
  • In theory any larger suppressor doesn't "hurt" but would be less effective
small osprey
silent zealot
ancient grail
bronze yoke
silent zealot
#

It's mainly interesting because the PR57 is a lightweight 20+1 pistol that can use the revolver load type to load rounds 1 by 1

#

And when you say 'clip' instead of 'magazine' you're actually correct.

#

(pretty sure adding support for stripper clips will be a pain though)

ancient grail
#

the complex part is the reload system
1 battery = 10 attack charges (not ammo so i used moddata)
max of 2 batteries which is 20 charges

hooked vanilla reload , rack and shoot

had problems with context menu reload
got stuck with the player animations etc
damn took me 3 days

oh and i wrote a function that prevents the player from being able to shoot on the square if its not being aimed at
since the explosion is triggered on the mouse pointer
(with range limiter so it will explode closer than the max range)

#

if the mouse is too far away

silent zealot
#

Is there minimum range?

#

Or just a warning on the barrel "this is how you died"

ancient grail
#

i imagine its cuz of the length of the weapon maybe

manic forum
#

i love the pointblank mod :D, with it min_range is just a other name for 100%crit_range

manic forum
ancient grail
#

yea like its impossible for you to shoot from a gun then the bullet would comeout behind the barrel(not unless its made that way i guess)

manic forum
#

Maybe i am Blind but In this Doc. i cant find a method that returns something like "Base.Plank"

bronze yoke
#

getFullType()

thin swan
#

Anyone know an easy way to force aiming?
I've tried player:setIsAiming(true) and player:setForceAim(true) coupled with player:changeState(PlayerAimState.instance()) and it does change the GameState to PlayerAimState, and I get the cursor as if I'm aiming and the camera pans, but the anim node stays on idle and the character doesn't turn when moving the mouse. I can get the character to face the mouse by doing

    local vec = player:getAimVector(Vector2.new())
    player:faceLocationF(
      player:getX() + vec:getX(),
      player:getY() + vec:getY()
    )

But it doesn't trigger the 2DBlends in the animset.
It seems I have to somehow also change the ActionState, but I just can't find a way to do it.
Am I running into a limitation with the Lua API, or am I missing something?

bronze yoke
#

action state transitions are based on animation variables

#
<?xml version="1.0" encoding="utf-8"?>
<transition>
    <transitionTo>aim</transitionTo>
    <conditions>
        <isFalse>IsPerformingAnAction</isFalse>
        <isTrue>aim</isTrue>
    </conditions>
</transition>
#

so player:setVariable("IsPerformingAnAction", false) player:setVariable("aim", true) should trigger the transition

#

other states might have slightly different transition conditions, this is just from idle

thin swan
#

Do you happen to know if the 2DBlends stuff is based on the animAngle? Because I got it to track the changes in just angle, but it wasn't doing anything to trigger the 2DBlends changes

bronze yoke
#

i have no idea about that, sorry

thin swan
#

All good, you put me on the right track! Adding my own variable to the actiongroups files seems to properly change state. Just gotta see if I can add custom ones to trigger my stuff without fucking up vanilla behaviour

ancient grail
#

i tried this and failed

#

maybe set it ontick lol

thin swan
thin swan
#

So the blends stuff seems to be fully tied to actually holding down the aim button.
I was able to make it so aim variable is true and state is set to PlayerStrafeState and it faces the direction of the mouse, but when I try to walk it doesn't move and it stops following the mouse

#

I'm just gonna rethink the implementation I think

ancient grail
thin swan
ancient grail
silent zealot
#

is there a secret to making getMountOn() work? It's in the javadocs, it's in the javacode, I can see discussions about it calling it for an item, but it refuses to work for me.

Both of these fail:

myItem = InventoryItemFactory.CreateItem("Base.GunLight")
print(myItem:getMountOn())

myScript = ScriptManager.instance:getItem("Base.GunLight")
print(myScript:getMountOn())

The script one I expect to fail, but the item one should work.

#

I want to add my gun to existing attachments without having to overwrite the entire weaponpart definition.

manic forum
silent zealot
#

That's reasonable, because getType() will return "handweapon", "container" etc, and getName() will return "Pistol", "Plank" etc so it makes no sense for getFullType() to return "Base.Pistol", "Base.Plank" etc.

bronze yoke
#

depends on the object 🙃

#

the script's Name is the InventoryItem's type

#

all script objects everywhere else refer to that part of the script as 'name' so it's inventoryitem's fault for being different

#

of course they also have a different definition of type 😅

#

and of course in the parser the name is called the id... because nothing can ever be simple

ancient grail
# silent zealot is there a secret to making getMountOn() work? It's in the javadocs, it's in th...

DurableFirearms = DurableFirearms or {}

function DurableFirearms.isWeaponPart(part)
    return tostring(part:getCategory()) == "WeaponPart"
end

function DurableFirearms.isAlreadyListed(part, fType)
    if not (part and fType) then return false end
    return string.find(tostring(part:getMountOn()), tostring(fType)) ~= nil
end


function DurableFirearms.getMountList(part)
    local arr = {}
    if type(part) == "string" then
        part = instanceItem(part)
    end
    if not part then return arr end

    local items = part:getMountOn()
    if items then
        for item in tostring(items):sub(2, -2):gmatch("([^,]+)") do
            local acc = item:match("^%s*(.-)%s*$")
            table.insert(arr, acc)
        end
    end

    return arr
end

-----------------------            ---------------------------

function DurableFirearms.insertMount(part, wpnFType)
    if not (part and wpnFType) then return end

    if DurableFirearms.isAlreadyListed(part, wpnFType) then
        if getCore():getDebug() and isAdmin() then
            print("Already listed: ", tostring(part:getFullType()), " --> ", tostring(wpnFType))
        end
        return
    end

    local arr = DurableFirearms.getMountList(part)
    table.insert(arr, tostring(wpnFType))

    local res = "MountOn = "
    for _, mount in ipairs(arr) do
        res = res .. tostring(mount) .. ";"
    end
    res = res:sub(1, -2)

    local scr = ScriptManager.instance:getItem(part:getFullType())
    if scr then
        scr:DoParam(res)
        if getCore():getDebug() and isAdmin() then
            print("Updated MountOn for: ", tostring(part:getFullType()), "->", tostring(res))
        end
    end
end

function DurableFirearms.addMountToPart(tab)
    local items = getScriptManager():getAllItems()
    for i = 1, items:size() do
        local item = items:get(i - 1)
        local part = instanceItem(item)
        if part and DurableFirearms.isWeaponPart(part) then
            local fType = tab["item"]
            if fType and tab[tostring(part:getFullType())] then
                DurableFirearms.insertMount(part, fType)
            end
        end
    end
end

#

thats what i did

silent zealot
#

Thanks, I'll give that go tomorrow

#

I didn't try instanceItem(), so hopefully that is the bit I need to change

bronze yoke
#

if you're in b42 that's replaced inventoryitemfactory

#

btw, with field access you can just add it to the list on the script

#
local item = ScriptManager.instance:getItem("Base.MyPart")
item.mountOn:add("Base.MyWeapon")
silent zealot
#

It's 2am, I'm in bed and I feel like I'm going to give up on sleeping at some point and do some 4am coding just to try this. 😂😴

silent zealot
bronze yoke
#

yeah

silent zealot
#

I might do that, starlit is a nice library

bronze yoke
#

you can access fields without it obviously but it's a whole mess

silent zealot
#

The point here is to avoid mess lol

#

I might make starlit a soft requirement, people without it can live without weapon attachments.

#

(honestly, no attachments is the best way to use the PR57, it's a 400 gram backup weapon with decent stopping power in the Zomboid world... attachments are just extra weight to lug around)

bronze yoke
#

'decent' stopping power? i guess it's not 570mm anymore 😔

tranquil kindle
silent zealot
#

If I use starlit field access to do things the easy way then the code won't work without starlit

silent zealot
tranquil kindle
#

Okay, but what exacly is what you want to do? If i remember correctly starlit allowed you to easly modify vanila attachments, for them to "work" on modded guns, without conflicts or requiring to override itemscript of that attachment itself?

silent zealot
#

Yes, or I have to do a convoluted workaround. Which I have most of the code for already, if the instanceItem thing works

#

The issue is poor support for programmatically changing the list of guns in a WeaponPart script.

tranquil kindle
#

I feel like thats the only thing stopping me from doing more guns for PZ. Making vanila attachments work on them is really annoying.

silent zealot
#

Doparam will let you set it, but getting the existing list is... aaargh

silent zealot
#

Then it's just a matter of using the attachment editor and hoping it actually cooperates instead of deciding to randomly flip things between what it shows and what it actually does.

#

For me, the bigger challenge is thinking of a gun to add that actually adds something a bit different to the game.

tranquil kindle
#

At least it was in b41, though as far as i know it still works in b42.

agile nacelle
#

Event OnObjectCollide only fires when Object collides with windows/doors... or a few more but it doesnt fire when Object collides with a wall or a fence, are they not supposed to fire when an object collides with walls and fences? and if so is there a way around it such as using raycasts? if pz has raycasts in the first place

bright fog
#

And regarding ray casting, I personally developed a script for it

agile nacelle
#

or just... damaging them atleast if thats possible

bronze yoke
#

there's a couple mods that accomplish this by tracing a little ahead of the object and destroying objects before it hits them

bright fog
#

Yea there's a mod that does that

bronze yoke
#

someone was posting about one here or maybe in the modding discord, but i don't know if that was released or not

agile nacelle
#

i see

bright fog
#

It was released, I don't remember the mod name tho

agile nacelle
#

okay but... are raycasts possible?

agile nacelle
#

Nvm

bright fog
bright fog
#

You could easily adapt it to your own usage

agile nacelle
#

Ill see what i can do, thanks!

bright fog
#

Currently the ray casting retrieves squares that weren't blocked, but it identifies types of objects to check for blocking so you could use it to easily adapt the object blocking or not, to make a list of tile types that should be affected

agile nacelle
#

Noted

delicate solar
bright fog
#

👀

tranquil reef
#

Am I allowed to say that anyone who makes an addon of my mod agrees to let me use their code?

#

Like if someone makes a mod that builds on mine to fix bugs, would I have the right to copy that code (so far I've been asking for permission and everything out of principle) regardless of what they say, or are there any problems with that

sour island
tranquil reef
#

Don't know how much license freedom I have since this is already a mod for Project Zomboid though

sour island
#

Doesn't matter- you wrote it (assuming), then it's yours

#

There's a lot of willing misinformation about how mods work legally, unfortunately- anything you've heard saying mods aren't yours and belong to steam or the devs is incorrect

manic forum
#

4.2. As mentioned in 1.1.2, if you put any third-party property into your mod, then it’s your responsibility to make sure it’s all done in an appropriate, legal fashion, including offering credit within the Workshop description of your mod.

(1.1.2 Modders are solely responsible for obtaining the necessary consents or licences for any third-party materials in the mod. )

silent zealot
sour island
#

Yeah, there's a few licenses that stipulate any derivative works have to follow your work's licensing too, as in everything is 'open source'.

#

and all you have to do is include a text file with the license

icy night
#

If I wanted to make the majority of grass tiles be replaced with burnt versions, how would I do it? Through TileZed overlays?

#

Dont ask why.. I have very sinister plans

#

Another photo for reference

silent zealot
#

lua\server\Worldgen\biomes\map\clay_shore.lua

#

that gives the four listed tiles (4 variations of dirt) a chance to be replaced with clay.

#

the attachment editor works so much better once you realise that the object positions in it have zero relation to the way they show up in game and it's just a bit of trial and error to figure out which arrow moves the attachment in which direction

silent zealot
#

42.8.1 is out, changing approximately nothing.

winter bolt
sour island
#

smh people whined that hard about the welcome messages lol

coarse sinew
silent zealot
#

I disable the welcome message with a mod, it never occurred to me I could complain about it instead.

scarlet halo
#

Complain about it and then disable it with a mod anyway.

silent zealot
#

Speaking of complaining... are there any mod framework or helpful template for procedural distribution tables? Instead of coming up with dozens of locations and values I'd like to do something like "put this handgun in places to find handguns, make it 25% as common as an M9"

bright fog
#

You could just make a key table of key being the item to use as a reference, and the value being a table of items that should follow the same distribution

#

Then parse the entire distribution

#

And add your item whenever the ref item is found, and add the same chance

silent zealot
#

I was thinking of giving that a go and seeing how long it takes for the parsing.

#

If it takes too long to do on every game boot, the solution would be to pre-calculate the tabeles for the reference items you want to use.

bright fog
#

You underestimate the power of computers my friend lol

#

And you can easily optimize a bunch of things

silent zealot
#

I've added E-Z distribution API to my project list.

#

And I need to make that before I upload the PR-57 since I want to use the API in my own mod.

bright fog
silent zealot
#

The working name for an API mod to make adding a new item to distribution lists.

bright fog
#

I never heard about such an API

silent zealot
#

Yes, because I have not made it yet

#

Its in my list of projects to do

#

Which was not really that clear with the way I phrases things

bronze yoke
#

i remember the old old community repo had something called distributions api but i wasn't sure what it even did

silent zealot
agile nacelle
frank elbow
silent zealot
#

Security is important so it will require use of a Application API Interface Personal PIN Number

mellow frigate
#

My eyes are bleeding now.

silent zealot
#

So the good news is the first draft is putting the item into the loot tables...

bright fog
#

You'd need to access the squares in a different way

#

Also are you on B41 or B42 ?

agile nacelle
#

B41

silent zealot
#

@dawn what is your goal? Making a vehicle do something when it runs into world objects?

agile nacelle
#

well... in that case, ill try casting X amount of rays tied to how wide the vehicle is starting from the center of the vehicle towards the direction the vehicile is going

agile nacelle
#

So yea

bright fog
#

Like I said there's a mod that does that

#

That does it EXTREMELY well already

bright fog
#

Yes that one !

silent zealot
#

AFAIK that adds "this thing can be damaged" info/world objects and uses the existing "car drives into something" vanilla code.

#

Super Bulldozer continually checks tiles and destroys any trees it finds.

#

No need for raycasting, just a bit of math based on vehicle location, size and facing.

bright fog
#

Bcs first off idk if there's a way to get objects vehicles collide with (at least you can't for colliding with zombies), but the vehicle would stop on collide

bronze yoke
#

yeah there isn't any vehicle collision event or anything

silent zealot
silent zealot
#

Look at the lua for the mod.

bright fog
#

It might also change the tile properties tbf

silent zealot
#

I looked at it long time ago so can't recall the exact details but it wasn't complicated.

maiden belfry
#

Heya guys so I put in "xmx25g" or something to change the ram limit but it is stuck below 3gb of ram usage, anyone that can help me with it?

bright fog
#

It might actually do something like setting the tiles to follow the same format as traffic cones yea

agile nacelle
bright fog
#

Just check IsoGridSquare

agile nacelle
#

kk

bright fog
#

There's methods to retrieving the tile informations

silent zealot
maiden belfry
#

normally when I put that in on my old pc it used all of it

#
  • I have about 40 mods enabled
silent zealot
#

Xms is STARTING ram.

#

Maybe you used that previously.

#

40 is low, but also not all mods are equal in terms in load.

#

My 300+ modlist is probably less resource intensive than installing AuthenticZ and Britas weapons/armor.

maiden belfry
#

Dang

silent zealot
#

Good enough for tonight - tomorrow I get to make it work with multiple entries for an item in one table and add some safeguards.

#

NepDistro.AddLoot("Base.NepPR57","Base.Pistol",1) is so much easier than dealing with the loot tables directly.

silent zealot
#

multiplier, so 1 (or leave it out) and it will use the same probabilities as the reference item

bright fog
#

I'd suggest making it optional, so it sets by default to 1 if it's nil

silent zealot
#

NepDistro.AddLoot("Base.NepPR57","Base.Pistol",4) would make it four times as common, NepDistro.AddLoot("Base.NepPR57","Base.Pistol",0.25) a quarter etc

#

it does,

bright fog
#

That way NepDistro.AddLoot("Base.NepPR57","Base.Pistol") is the same as NepDistro.AddLoot("Base.NepPR57","Base.Pistol",1)

bright fog
#

Also

#

You can just do lootMult = lootMult or 1

silent zealot
#

true, I do that sytax all the time for tables that might not exist yet

bright fog
#

Also using 1 or 1.0 does nothing ShibaNom

#

But yea I tend to like this syntax since it makes it shorter than using a whole if statement

silent zealot
#

Untyped languages are a pile of junk and using 1.0 is easier than remembering where I'll have issues with 1 being treated as an integer

bronze yoke
#

you never will, lua doesn't have more than one number type

tired glen
#

Java does though

silent zealot
#

And we have Lua <-> Java magic happening...

bronze yoke
#

when you pass a number to a java function that expects an integer it will be converted regardless of whether it can be represented exactly as one or not

silent zealot
#

At least in java you get to choose the type, never any doubt.

bronze yoke
#

a number stored in lua is always internally a double, no matter what

tired glen
#

Yeah so if you’re expecting it to be converted to an integer omit the .0 and if it’ll be passed as a float then add .0
ez syntax preference

silent zealot
#

Just consider using 1.0 a habit I picked up that isn't worth training myself out of.

bronze yoke
#

i don't disagree here