#mod_development

1 messages ยท Page 386 of 1

glass osprey
#

o7

buoyant violet
#

already did my test in MP grind

#

its working

#

as for the stats, server authorizes any stat modification, same concept as with RAF

bright fog
#

So shooting two guns at once will end up with them fighting for their appropriate stats ?

#

Unless I misunderstood what you did

buoyant violet
#

It's not modying the script sorry

#

The weapon instance

#

It's just doing normal setters and getters

#

(SetReloadTime etc etc..

silent zealot
#

That's why I made Universal Simple Silencers, which lets the silencer from Simple Silencers work on anything (included modded) by editing the attachment stuff at runtime.

#

Would be nice if there were standard ammo types.

#

Actually that is a goodidea for the requests channel.

buoyant violet
#

what I did personally for my mod is that I scan each item that uses ammotype and I change it to mine in case someone puts a weapon outside my mod pack

#

guess to ensure its in some way usable

willow tulip
#

lol

willow tulip
silent zealot
willow tulip
#

Yea

buoyant violet
#

modying script is not recommended honestly

#

as it will affect all new future items

silent zealot
#

You can tell by looking at the getThing() function in java; if it returns this.thing it's per item, if it returns this.getScriptItem().getThing(); it's per script.

willow tulip
#

yea

buoyant violet
#

I normally do all my operations on the instanceitem normallt

silent zealot
#

I wouldn't want to change the script for a feature that wasn't an intended permanent change for every item of that type, but you can do most of what you need for weapons with item-specific changes.

buoyant violet
#

i think that this is when the community should leverag something

#

instead of askign the devs for items that wont be used to be honest

silent zealot
#

If you try to make a "community firearms pack" you'll still end up with it being ignored.

buoyant violet
#

this is the goal of the weapons framework honestly, is to provide useful functions of things almost all gun modder develops

#

not a community firearm pack

#

but I am working on the framework for functionality

#

all the things I have shown in my videos are systems that come from the framework rather than exclusive to my weapon pack

bronze yoke
#

the main reason community frameworks don't get used is because they aren't useful

#

if you create something that actually has the features a modder wants they will usually prefer to use it

#

some people will always prefer to do it themselves but they wouldn't play nice with vanilla ammo either

buoyant violet
#

yeah hence why im trying to make the functionality of the framework optionals, yet they wont break anything if not used

#

as for you know items that people define

#

that has to be the author, nothing we can do about that

bright fog
blissful seal
#

Instead of frameworking, i just add compatibility api to my stuff, if people wanna play nice with my weapon mod, its a 3 line change in nearly every case

#

(i did framework tooltips tho(sorry albion, thats kidna ur thing) but i did it anyway, cuz i was tired of ppl breaking my tooltips

#

it didnt make sense to add a shitton of ISToolTip metatable hacking to my weapon mod specifically so i put it in a framework :p

buoyant violet
#

Features* i feel its important for a mod to show case them

blissful seal
#

thats a good idea, did the same thing for my tooltip library to show how it can be used effectively

#

its only a few weeks old and I found a mod thats actually using it already

buoyant violet
#

can you link me your mod?

#

does it work to hide some tooltips?

buoyant violet
frank lintel
#

where are the attributes listed at need to look up 'Brave' and exactly what it does

thin swan
#

We can only add now I think

buoyant violet
#

oh shit

#

I indeed wanted to see something with tooltips haha

frank lintel
#

No-one? just need be pointed in the right direction to look for a specific trait and what it does exactly

dull moss
small topaz
#

is there any kind of new "special" procedure we need to update our mods?

frank lintel
#

if you suggesting that every trait is listed in its own file...?

#

plus dont matter someone answered what 'grapple' buff was about

bronze yoke
#

traits don't really have 'attributes'

#

the game has hardcoded checks for specific traits across the codebase when calculating things like chances

#

so to find out what a trait does, you need to look for all usages of the trait in the codebase, there isn't a central place where it's defined

small topaz
#

For me when trying to update, I got an "error requesting steam to update item" immediately when I click the in-game "create and update" button. It doesn't even try to load anything.

#

Maybe a known linux issue since one of the most recent game updates?

frank lintel
dull moss
frank lintel
#

because likely its in java... not Lua.. as someone already stated hardcoded. lets just leave it at that.

dull moss
#

Well ye that would be your option after checking Lua

crisp fossil
#

is there an event that can be used when ClothingItemExtra is pressed?

silver atlas
#

hello,
how do I make transmission set to never in .lua ?
SandboxVars.ZombieLore.Transmission = 4
is it ok?

#

I did on AReallyCDDAy.lua
I got bitten, my character has fewer and anxious right now....what did I do wrong?

#

CDDA.OnInitWorld = function()
...
SandboxVars.ZombieLore.Transmission = 4

under these settings

#

I think that doesn't work

blissful seal
blissful seal
#

mmk yeah I looked into DoSpecialToolTip actually will hide the tooltip for us pretty easily....anyhoo happy to add that if you're interested

bronze yoke
#

the problem is moreso hiding specific elements from the vanilla tooltip

#

starlit had api for this but it didn't seem possible to reimplement without reflection

#

you usually don't want to just nuke the whole thing

dry stone
#

how difficult/hacky is it to add a new crafting skill (chemistry)? i know fleshing out recipes and stuff is a mountain of work, I'm just wondering how technically involved it is

bronze yoke
#

if it's literally just the adding of the skill, there's not much to it

#

as you say the complexity is in fleshing it out and justifying it as an entire skill

dry stone
#

I've just been thinking zomboid could use a real tech mod.. tons of ideas and I don't have a clear vision yet

#

but chemistry is something that could support a ton of tech things

blissful seal
#

ya that sounds cool, tech progression/crafting progression stuff is a great mod surface

upbeat turtle
#

real

bronze yoke
#

chemistry sounds like something that would need a lot of original items to work, and probably would want to reach out further than vanilla crafting would allow

dry stone
#

People will love or hate this idea: Gasoline realistically goes bad within 6 months, and works like crap after about 3

#

long term you'd have to do something like biofuel, and there are ways...

blissful seal
bronze yoke
#

i see... starlit was only concerned with item tooltips

upbeat turtle
dry stone
#

Heh I was thinking algae farms

#

would be cool to make a base that generates its own fuel

blissful seal
#

"100 years later" mod

upbeat turtle
#

we need more autoproduction mods fr

blissful seal
#

someone drop Feed the Zed modpack

dry stone
#

If i had magic powers to snap my fingers and make the mod happen.. it would basically be gregtech for zomboid.

blissful seal
#

fuckyeah

upbeat turtle
#

yeah, i think beyond crafting it could potentially need some custom tiles(?) and other mechanics on the side

dry stone
#

and there's no way a mod like that could exist without going deep into both chemistry and electrical.. and most of hte other skills lol

upbeat turtle
#

there's a good handful of vanilla assets for tiles which could totally be repurposed for this type of concept steamhappy

blissful seal
#

now we have crafting stations its feasible, prolly as much design work as actual programming to be comprehensive

dry stone
#

"The world has ended, but Moore's Law did not"

blissful seal
#

where we gon end up rimworld hypertech?

dry stone
#

I mean this is just a daydream right now lol

upbeat turtle
#

cybernetics mod xD

dry stone
#

but man, if only. maybe if I start doing one little thing at a time

blissful seal
#

keep dreaming ponyboy ๐Ÿ™‚

dry stone
#

My favorite mods are stuff like plumbing and solar panels

#

I love the complexity

blissful seal
#

my dream would be something like computercraft

upbeat turtle
dry stone
#

computercraft sounds a lot like the PZDos mod I've been workin on

blissful seal
#

ohhh do tell

dry stone
#

It's a lua+java mod, but it makes dos work within zomboid. You can build computers from retro components, use them, install software on them

#

if its an old dos game you can play it.

blissful seal
#

lmfao youre a savage

dry stone
#

technically you could even install emulators on it and play nintendo games

blissful seal
#

im gonna throw up

blissful seal
#

thats so sick

dry stone
#

Oh yeah, doom works

upbeat turtle
#

helllll yeaah xD

dry stone
#

If it works in dosbox it's basically working in zomboid at this point

blissful seal
#

id love an in-game scriptable computer to do automation stuff

#

Doomzoid

dry stone
#

The hard part of PZDos was multiplayer sync.. it's technically file sharing. Your buddy opens the computer, he needs to see the files and games and stuff you made.

upbeat turtle
#

project factorioboid

blissful seal
#

lmfao exactly

dry stone
#

I don't have any way for the computers to interact with the game world.. Like if zomboid had a redstone equivalent I'd be all over the idea

dry stone
#

I do plan to make em interact with each other so people can play multiplayer dos games

upbeat turtle
dry stone
#

Almost anything is feasible if you hack things enough lol...

upbeat turtle
#

some lua stuff that's already available is like adding/removing tiles for example

bronze yoke
#

all things are feasible with java modding

#

you can rewrite the entire game

dry stone
#

I never figured out how to do much beyond basic reflection ... It would be helpful to replace vanilla zomboid java code

#

so far I've avoided any need to

blissful seal
#

ask claude

bronze yoke
#

the simplest way is to just replace the class entirely, but the maintenance burden will get pretty absurd that way

#

i recommend using something like zombiebuddy

upbeat turtle
dry stone
#

But yeah, PZDos is almost feature complete and in "million little things to fix" mode

blissful seal
#

badass will def try it when its ready

dry stone
#

Theres lots of little pics and a couple early videos I made of it in this channel

#

but today? Friday. Home from work. Sat+Sun = mod days hehe

blissful seal
#

bet

dry stone
#

that's why I'm in here asking about tech mods ๐Ÿ˜„

dry stone
#

that photo is how I feel right now

#

So.. if I go LUA-only for a tech mod... what if I totally want to repurpose generators? No range, actually connect them to a building... whole new power system.

blissful seal
#

u can do dat i think

upbeat turtle
#

could be done in lua steamhappy

bronze yoke
#

power is nightmarish to work with in lua

dry stone
#

Heh, I figured it probably wouldn't be easy.. if it were that mod would exist right

bronze yoke
#

i think there is a mod that does that

blissful seal
#

ive seen one that makes like a generator network

upbeat turtle
#

having a genny connect to a single building is pretty straightforward

bronze yoke
#

you can't manually set a device as powered or connect it to a generator or anything, nor can you change the range of a generator

dry stone
#

Hm maybe its just something I haven't stumbled on yet

#

Its just that a big component of a tech mod would almost have to be wiring of some form

#

so the "magic generator range" mechanic really gets in the way

upbeat turtle
bronze yoke
#

i was working on something like that and it felt increasingly likely that it would be easier to just go around the vanilla power system entirely than try to work with it

upbeat turtle
#

but yah, you might run into some limits with the power-specific api

dry stone
#

I'm already thinking about tiles heh.. pipe + wire = wire conduit

blissful seal
#

if thats the case then it would be fun to come up with some kind of pz-esque lore way to explain an alternate power system

#

i mean there are zombies you can add a lil sci fi

dry stone
blissful seal
#

force world shutoff lmao

dry stone
bronze yoke
#

you can do lights manually, my biggest concern was fridges

#

i think my plan was to also give up on the vanilla fridge system and revert the age of the food manually when it loads or whatever

blissful seal
#

i wrote my own scifi-horror lore for my weapon mod to explain why your weapons can set zombies on fire now

dry stone
#

but burning zeds are even worse tha non-burning ones lol

blissful seal
#

but its fun!

dry stone
#

it takes them about 3 years to finally burn to death and they set everything on fire lol

blissful seal
#

thats just one of the affixes, you could get knockback, or crit damage, or w.e else

#

i havent managed to fully burn down my base with one of the fire affixes yet

#

whats a couple burnt walls between friends

dry stone
#

Make a special super shotgun. on kill, make them ragdoll and apply a backwards force of 9000

blissful seal
#

lmao yea probably will do that

dry stone
#

just imagine them launching off the screen haha

blissful seal
#

i did add a stagger affix

#

forces zombie stagger on hit chance, pretty funny to see when you have a screwdriver

#

is there like a zombie:ragDollEnabled() ๐Ÿ˜‚

dry stone
#

Is it like diablo? "Lord's Screwdriver of Shanking"

blissful seal
#

Exactly

#

weapons gain affixes on kill thresholds

#

guns too

dry stone
#

I'd probably break them too fast haha

blissful seal
#

they repair when they awaken

#

thresholds are also scaled by Condition Lower Chance

#

so u can see a kitchen knife become badass ๐Ÿ˜‚

dry stone
#

Heh, do that and add level-ups that fully heal you (and remove zombie virus)

#

suddenly it's now an action rpg

blissful seal
#

hahah maybe one day shit, it is going very rpg

dry stone
#

Can't wait for the new jetpack armor ^.^

blissful seal
#

Crimson Zomboid

dry stone
#

That's the kinda mod you'd see privatelime make a mini series around

blissful seal
#

for sure

#

the Crazy RP servers basically do that without all the fun game-y rpg stuff

dry stone
#

I think that's the mod that makes generators work for buildings

#

looks like it adds its own unique type of generator rather than change vanilla ones

#

actually looks like a GREAT mod heh

blissful seal
#

mans only updated it 5 times across two days

#

last year

dry stone
#

Yeah, and comments saying its outdated.. Well a proof of concept is good enough for me

blissful seal
#

ya for sure

dry stone
#

Maybe I'll just ignore vanilla generators and do my own thing like he did

bronze yoke
#

the thing is you can't 'just' do your own thing, you can't set a device to be powered

#

i'm not sure how this mod works but if there's vanilla power there is actually a real generator involved somewhere

#

i remember a couple mods that used invisible generators to power larger areas

#

i don't know if that's how they're doing this though, i feel like it'd be really obvious if it ended up powering the next door building too by coincidence

dry stone
#
โฏ ls
drwxr-xr-x    - prog 17 Apr 18:17 ๎—ฟ 42
drwxr-xr-x    - prog 17 Apr 18:17 ๎—ฟ common
drwxr-xr-x    - prog 17 Apr 18:17 ๎—ฟ media
.rwxr-xr-x 2.7k prog 17 Apr 18:17 ๏‡… icon.png
.rwxr-xr-x 1.1k prog 17 Apr 18:17 ๏„ฉ mod.info
.rwxr-xr-x 5.9k prog 17 Apr 18:17 ๏‡… preview.png

~/.local/share/Steam/steamapps/workshop/content/108600/3478628177/mods/UltimateGeneratorOverhaul
โฏ find . -maxdepth 5 -type f | sort
./42/icon.png
./42/mod.info
./42/preview.png
./common/media/light-switches.tiles
./common/media/lua/server/BuildingGenerator.lua
./common/media/lua/server/LightSensor.lua
./common/media/lua/server/ProximitySensor.lua
./common/media/lua/server/UtilsContextMenu.lua
./common/media/scripts/Lightswitch_Items.txt
./common/media/scripts/sounds_base.txt
./common/media/sound/activate-alarm.wav
./common/media/sound/activate-sensor.wav
./icon.png
./media/light-switches.tiles
./media/lua/server/BuildingGenerator.lua
./media/lua/server/LightSensor.lua
./media/lua/server/ProximitySensor.lua
./media/lua/server/TimedActions/GeneratorActivation.lua
./media/lua/server/TimedActions/GeneratorAddFuel.lua
./media/lua/server/TimedActions/GeneratorFix.lua
./media/lua/server/TimedActions/LightSensorToggle.lua
./media/lua/server/TimedActions/ProximitySensorActivation.lua
./media/lua/server/TimedActions/TimedActionExample.lua
./media/lua/server/UtilsContextMenu.lua
./media/scripts/Lightswitch_Items.txt
./media/scripts/sounds_base.txt
./media/sound/activate-alarm.wav
./media/sound/activate-sensor.wav
./mod.info
./preview.png

#

They can't hide how they're doing it from me ๐Ÿ˜„

#

Ok that mod is basically making fake generator source positions in every room of the building

bronze yoke
#

i guess that trick lives on then

dry stone
#

maybe.. last update about a year ago...

gray minnow
#

anyone know of any ios ports i have the game on pc but it would be good on mobile

modest oak
#

when custom animsets for custom animals :D

bright fog
bright fog
modest oak
#

wgat

bright fog
#

Yea

#

People that overwrite existing AnimSets are just stupid ๐Ÿ’€

#

It has always been possible to not overwrite anything

mint wind
#

Sorry this isn't mod development related but I was wondering if anyone can enlighten me on how the foraging system works now? I am looking at the game files and its mentioning forest etc, but in game I see organic forest, farmland forest and other such

willow tulip
#

Anyone here willing to test my Base Saver mod? (Lets you save/load buildings between save games/PZ versions, including container contents and floor items)

silent zealot
#

That info is stored with the map.

#

Then lots of stuff in media/lua/shared/Foraging/ to control what is found where

hexed stirrup
#

does true here means anti cheat on or anti cheat off

#

confused cuz the comment says disables

#

so is that enabled or disabled

silent zealot
#

I thin true means the cheat is off.

#

Is that the default?

hexed stirrup
#

yes

silent zealot
#

I rmemeber being very confused but eventually figuring out the default was all off.

hexed stirrup
#

good thanks

fast laurel
#

Is there any kind of advanced logging mod out there for MP servers? Like if we had someone being sneaky and tossing molotovs into someone's base but weren't there to see it happen that we'd be able to check the logs for that kind of event and see "whodunit"

paper ibex
willow tulip
#

B42 PZ has no anticheat outside of lua checksum

paper ibex
#

no? since b41 when the character gain huge amount of XP in a short time, the game kick that player out of the server. I tot that is a kind of anti cheat.

#

btw many b42 mods suggest server owner to disable lua checksum, this is so bad for server management.

willow tulip
#

there some leftover anticheat code but its... extremely under referenced and not actually used

dull moss
#

My guess

tacit pasture
#

I love this mod by @jagged fulcrum . Is there a way to make something similar where you can build it in the game like you can a hamm radio? Starting out it's a little OP but if you could level your skills it would be a useful tool for the more dangerous areas. Maybe make it so that it ticks up one of your important slots?

buoyant violet
#

ok, shark gave me an idea. basically using muzzle flash fx for the explosion. how this looks?

knotty stone
blissful seal
#

idk shit about guns, if you shoot a grenade launcher does it do a flash or an actual fiery explosion?

#

for me both of those work honestly, the zombies are already ragdolling my brain fills in the rest

buoyant violet
torn igloo
#
function ISToggleGenerator:isValid()
    if self.generator then
        if not self.generator:isConnected() then return false end
        return true
    else
        return false
    end
end

What is so wrong about if not self.generator:isConnected() then return false end that the TimedActions keep saying bugged action??!

buoyant violet
buoyant violet
#

what mod is that ? never seen it

blissful seal
#

ppl love that one, modern firearm systems

#

I'm tryna get homie to add compatibility for my mod cuz ppl ask about it so much

knotty stone
#

yea its that one, but iam using my private version, since that guy just copy pasted my stuff to fix his mod ๐Ÿ˜„

blissful seal
#

i feel like thats gonna happen regardless

buoyant violet
#

wtf

blissful seal
#

all kinds of 3d models in that mf

buoyant violet
#

2.5 gb? miss me with that dawgs

blissful seal
#

i mean its not my kinda mod ๐Ÿ˜‚

#

i feel like if you want that kinda gun experience go play Arma or DayZ lmao

#

still got 40k subs tho ๐Ÿคฃ

buoyant violet
#

maybe im im concern about keeping stuff optimized in line with the game

#

that when I see a 2gb mod its an automatic no for me

#

almost like AI thumbnails lol

blissful seal
#

one day you wont be able to tell the difference ๐Ÿคท

buoyant violet
#

on what

blissful seal
#

ai thumbnails

buoyant violet
#

let me respond with this

blissful seal
#

๐Ÿคท

#

that wasnt an insult to your intelligence, just a comment on technology

buoyant violet
#

if or not they will be like that in the future, there is no workaround that currently, they look like absolute shit without soul

blissful seal
#

its cool to feel strongly about this, i do not

buoyant violet
#

nothing to do with my intelligence, just feel its a overhyped technology

blissful seal
#

people said that about the internet too

#

and cars, and electricity...

#

seems silly in hindsight

mellow frigate
#

Hi, can someone tell me the prerequisites for taking/placing lightswitches in B42 ? I am not able to take them with the moveable take option (lvl 10 electrical).

blissful seal
#

i thought that only took 6 -- could be a mod im using tho

sonic needle
knotty stone
#

Picking up light switches was removed recently

silent zealot
paper ibex
#

not just about :isValid() TimedAction should come with a set of functions

buoyant violet
#

saw the meme opportunity

cinder storm
#

finally getting around to fixing my mod for 42.16

#
require 'recipecode'

function Recipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
    local items = craftRecipeData:getAllConsumedItems();
    local results = craftRecipeData:getAllCreatedItems()
    local box = items:get(0);

    for i = 0, results:size() - 1 do
        local resultItem = results:get(i);
        if box:getModData()["condition" .. i] then
            resultItem:setCondition(box:getModData()["condition" .. i])
        end
    end
end

function Recipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
    local results = craftRecipeData:getAllCreatedItems()
    local items = craftRecipeData:getAllConsumedItems();

    local box = results:get(0);
    for i = 0, items:size() - 1 do
        local item = items:get(i);
        if item:getCondition() ~= item:getConditionMax() then
            box:getModData()["condition" .. i] = item:getCondition();
        end
    end
end```
#

and i look back on this code after getting two exceptions from it

#

im thinking about scrapping it altogether, on one hand im not sure if it even works at all, but removing it could cause more issues with the mod since some craftrecipes rely on it for checking the condition of items from when they were packaged

bright fog
bright fog
cinder storm
#

thats what i was thinking

#

i gotta check to see if theres anything new i can use

bright fog
#

You need to store this in your own global module or in a global function

bright fog
#

The function just needs to be accessible globally

cinder storm
bright fog
#

Yea

#

Make sure it has a unique name

cinder storm
bright fog
#

I don't think so no ?

cinder storm
#

or player

bright fog
#

None of these ?

#

Why do you think that ?

cinder storm
#

i might be looking at the wrong thing

cinder storm
bright fog
#

The Recipe table no longer exists

#

That's it

cinder storm
#

ah crap

bright fog
#

Store it in your own global table or just in a global function

cinder storm
#
require 'recipecode'

global function boxMoreRecipe = {
    
}

function boxMoreRecipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
    local items = craftRecipeData:getAllConsumedItems();
    local results = craftRecipeData:getAllCreatedItems()
    local box = items:get(0);

    for i = 0, results:size() - 1 do
        local resultItem = results:get(i);
        if box:getModData()["condition" .. i] then
            resultItem:setCondition(box:getModData()["condition" .. i])
        end
    end
end

function boxMoreRecipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
    local results = craftRecipeData:getAllCreatedItems()
    local items = craftRecipeData:getAllConsumedItems();

    local box = results:get(0);
    for i = 0, items:size() - 1 do
        local item = items:get(i);
        if item:getCondition() ~= item:getConditionMax() then
            box:getModData()["condition" .. i] = item:getCondition();
        end
    end
end```
cinder storm
cinder storm
#
craftRecipe OpenBoxOfCrowbars
    {
        timedAction = OpenAmmoBox,
        Time = 60,
        Tags = InHandCraft;CanBeDoneInDark,
        category = Packing,
        OnCreate = ConditionInheriter.FromConditionInheriter,
        inputs
        {
            item 1 [Base.BoxOfCrowbars] flags[Prop2],
        }
        outputs
        {
            item 6 Base.Crowbar,
        }
    }

    craftRecipe PackBoxOfCrowbars
    {
        timedAction = PlaceAmmoInBox,
        Time = 60,
        Tags = InHandCraft;CanBeDoneInDark,
        category = Packing,
        OnCreate = ConditionInheriter.ToConditionInheriter,
        inputs
        {
            item 6 [Base.Crowbar;Base.CrowbarForged] flags[Prop2],
        }
        outputs
        {
            item 1 Base.BoxOfCrowbars,
        }
    }```
#

i'm not seeing anything inherently wrong on the craftRecipe side?

bronze yoke
#

your functions are called boxMoreRecipe.OnCreate.FromConditionInheriter etc but you're referencing them as ConditionInheriter.FromConditionInheriter

bright fog
#

That global keyword isn't a thing ?

cinder storm
#

it isnt?

cinder storm
bright fog
#

You just don't put a global keyword

cinder storm
#

i removed the global keyword and added boxMoreRecipe to the craftrecipe oncreate reference

cinder storm
bright fog
#

Bcs you're trying to add the function to a table inside the global table boxMoreRecipe

#

But that sub table doesn't exist

#

You need to read that Lua language wiki page and learn a bit about the language because here you are confusing yourself, wrongly assuming how things work

#

A table can hold key values combination

#

When you do

tbl.var = ...

It stores whatever ... is in the key var of tbl

#

So if you do

tbl.sub.var = ...

You try to store var key with value ... inside a table sub which is inside a table tab

cinder storm
#

should i reference the table as boxMoreRecipe = {} then?

#

so in turn when i run the to/fromconditioninheriter functions it does have a table to reference?

cinder storm
cinder storm
cinder storm
# bright fog wdym ?

in the tables section on the lua language page the example is structured similarly

bright fog
#

You have to show what you did here

cinder storm
#
require 'recipecode'

boxMoreRecipe = {}

function boxMoreRecipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
    local items = craftRecipeData:getAllConsumedItems();
    local results = craftRecipeData:getAllCreatedItems()
    local box = items:get(0);

    for i = 0, results:size() - 1 do
        local resultItem = results:get(i);
        if box:getModData()["condition" .. i] then
            resultItem:setCondition(box:getModData()["condition" .. i])
        end
    end
end

function boxMoreRecipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
    local results = craftRecipeData:getAllCreatedItems()
    local items = craftRecipeData:getAllConsumedItems();

    local box = results:get(0);
    for i = 0, items:size() - 1 do
        local item = items:get(i);
        if item:getCondition() ~= item:getConditionMax() then
            box:getModData()["condition" .. i] = item:getCondition();
        end
    end
end```
#

ive got this at the moment

cinder storm
bright fog
#

You STILL are trying to put shit in OnCreate

#

That doesn't exist

#

Read what I just explained above

#
tbl.sub.var = ...

You can't do that, because sub isn't a thing in that table

cinder storm
#

so replace oncreate with my own subtable?

cinder storm
# cinder storm ```lua require 'recipecode' boxMoreRecipe = {} function boxMoreRecipe.OnCreate...
require 'recipecode'

boxMoreRecipe.bmOnCreate = {}

function boxMoreRecipe.bmOnCreate.FromConditionInheriter(craftRecipeData, player)
    local items = craftRecipeData:getAllConsumedItems();
    local results = craftRecipeData:getAllCreatedItems()
    local box = items:get(0);

    for i = 0, results:size() - 1 do
        local resultItem = results:get(i);
        if box:getModData()["condition" .. i] then
            resultItem:setCondition(box:getModData()["condition" .. i])
        end
    end
end

function boxMoreRecipe.bmOnCreate.ToConditionInheriter(craftRecipeData, player)
    local results = craftRecipeData:getAllCreatedItems()
    local items = craftRecipeData:getAllConsumedItems();

    local box = results:get(0);
    for i = 0, items:size() - 1 do
        local item = items:get(i);
        if item:getCondition() ~= item:getConditionMax() then
            box:getModData()["condition" .. i] = item:getCondition();
        end
    end
end```
bright fog
bright fog
#

Just put that freaking function in the main table ๐Ÿ’€

cinder storm
#

i removed the subtable

cinder storm
bright fog
#

I guess the way you write the functions makes it unclear

#
function tbl.var()
  ...
end

Stores a function in var key of tbl

#

It's the same as

tbl.var = function()
    ...
end
cinder storm
#

ah,

#
require 'recipecode'

boxMoreRecipe = {}

function boxMoreRecipe.FromConditionInheriter(craftRecipeData, player)
    local items = craftRecipeData:getAllConsumedItems();
    local results = craftRecipeData:getAllCreatedItems()
    local box = items:get(0);

    for i = 0, results:size() - 1 do
        local resultItem = results:get(i);
        if box:getModData()["condition" .. i] then
            resultItem:setCondition(box:getModData()["condition" .. i])
        end
    end
end

function boxMoreRecipe.ToConditionInheriter(craftRecipeData, player)
    local results = craftRecipeData:getAllCreatedItems()
    local items = craftRecipeData:getAllConsumedItems();

    local box = results:get(0);
    for i = 0, items:size() - 1 do
        local item = items:get(i);
        if item:getCondition() ~= item:getConditionMax() then
            box:getModData()["condition" .. i] = item:getCondition();
        end
    end
end```
#

so more like this?

cinder storm
#

so bring that back

bright fog
#

Do you understand what boxMoreRecipe is here ?

cinder storm
#

its defined as a table?

bright fog
#

It's a table, so if you don't create that table, it won't create itself

cinder storm
#

ah, alright

#

ill test it again

#

thank you for your help so far especially with my misunderstandings, i really appreciate it

bright fog
#

Sorry I haven't been too patient here

cinder storm
#

no worries, i'd be mad too if i had to explain something over and over

cinder storm
#

alright its working perfectly after the adjustment

#

through some miracle spiffo has spared me from debugging any further

buoyant violet
#

should I make RAF have a spread calculator to make automatic fire more unforgiving?pz_thinking

upbeat turtle
#

cinema

#

๐Ÿ™Œ

cinder storm
#

i know the translation files updated to json, but now im struggling to get craftrecipes to have their proper display names ingame. the regular names of the items are fine, but craftrecipes have no spaces

#

is there something im doing wrong? they're in their proper folders, and its in UTF-8.

bronze yoke
#

should be named Recipes.json

#

there are no language suffixes anymore

bright fog
#

Also recipes need to be referenced with the module no ?

cinder storm
#

i think they removed that aswell based off the game files

bright fog
#

No suffix yea

#

I thought so

cinder storm
#

worked thanks

cinder storm
#

alright, its working great in SP, i tried to run it on a self hosted MP server and none of my items are there

#

is there anything i have to do from a mod-perspective on updating to be MP-compatible?

bright fog
#

Are they in a custom module ?

cinder storm
#

im not sure what you mean by that; the items are stored in scripts under Box more!\Contents\mods\Box more!\42\media\scripts

#

both items and craftrecipes

bright fog
#

Your module

#

Items are in a module

cinder storm
#

oh

#

no they arent in a custom module

#

does this mean i cant have a custom module here

bright fog
#

Wellll, that might just be the other way around idk

#

Try using a custom module if they don't appear

#

I remember some weird ass issues about that

cinder storm
#

so i did that, replaced all base. with BoxMore.

#

problem, now im getting this exception from one of my submods

#
local script = "{ inputs { item 1200 [Base.BlowTorch] mode:destroy flags[Prop2],} }"

    local recipe = getScriptManager():getCraftRecipe("PackBoxOfWeldingTorches")
    recipe:getInputs():clear()
    recipe:Load("PackBoxOfWeldingTorches", script)```
#

this is the script for the submod, its supposed to replace part of a recipe with that script

#

nevermind, i had to specify the module

bright fog
#

Does it appear now ?

cinder storm
#

particularly translation again, its having the same no spaces error

bright fog
#

You always should reference other blocks by their full type

cinder storm
#

and im pretty sure i have to specify the module somewhere

bright fog
#

No spaces ?

cinder storm
bright fog
#

Ok man you're throwing way too many different information that seem unrelated

bright fog
# cinder storm

We told you that translation files need to have a very specific naming, and that the Recipe prefix should not be there on keys

cinder storm
#

and its under the EN folder

bright fog
#

I mean it's clearly not, the file you sent is named p21h4ms

cinder storm
#

i forgot to turn that off

bright fog
#

Also it's Recipes, not recipes

cinder storm
#

its an anonymous file name thing

bright fog
#

Ah bruh

cinder storm
#

here

bright fog
#

Remove the prefix

#

Of keys

cinder storm
#

the Recipe_?

bright fog
#

Yes

cinder storm
#

i removed it for all translate files

#

trying to run it in MP now

cinder storm
#

i got it running in MP after an hour

#

debug mode on, all mods and some dependencies working

#

problem, it works perfectly in SP but in multiplayer, craftrecipes do not output

bright fog
#

One day they'll fix that shit don't worry ๐Ÿ’€

cinder storm
#

oh

#

not the items though, right?

#

alright its MP compatible

willow tulip
#

Does anyone know what IsoObject subclass 'water dispencers' are?

bronze yoke
#

IsoObject

willow tulip
#

.. how is it special from other isoObjects/how do I spawn one?

#

(when I copy a tile containing one, I get a water dispencer I can.. walk through and not interact with)

bronze yoke
#

probably forgetting to serialise components

willow tulip
#

what are those stored in?

#

I see a getGameEntityType() of isoObject.. though no idea how to set that/spawn a certain type...

bronze yoke
#

the isoobject

#

an isoobject is a kind of entity

willow tulip
#

Yea.. Im confused how to create anything but a very generic isoObject like a wall or floor.

#

Currently using IsoObject.new(isoCell, IsoGridSquare, IsoSprite)

#

(Aside from when its a derived class like IsoBarbecue or IsoClothingDryer or whatever)

bronze yoke
#

they aren't using subclasses for new features, it's a fairly outdated way of doing things

#

they're using components instead

#

isoobjects and a couple other things are gameentities which hold components

willow tulip
#

oh, its from GameEntity parent class?

#

I was looking at IsoObject's functions -_-; keep forgeting to use firefox search instead of the top left search bar

#

Now to figure out how to seralize components to text and back..

#

Hu.. tons of things have components...

#

reduces scan area

#

Looks like water dispencers have 5..

bronze yoke
#

most have a few, and the number will continue to increase

#

legacy features will eventually be replaced with components as needed

willow tulip
#

looks at SpriteConfig... absolutely no setters, no constructor...

#

EntityScriptInfo at least has a setter...

#

kinda guessing seralizing the components is the wrong way to go about this...

#

Since I doubt I can use the vanilla load/save functions to save to a file...

#

sigh... depressing.

#

I have literally no idea how to create a non default entity... function ISMoveableSpriteProps:placeMoveableInternal( _square, _item, _spriteName ) that iv been using for other types doesn't seem to mention it at all..

bronze yoke
#

that's kinda pre-entity code

#

i'm not even sure what that is used for

willow tulip
#

oh.. hmm...

#

if obj and not _item:hasComponents() then GameEntityFactory.CreateIsoEntityFromCellLoading(obj) end GameEntityFactory.TransferComponents(_item, obj);

bronze yoke
#

movable isoobject entities just get turned into an item entity with the same components and vice versa

willow tulip
#

GameEntityFactory at least seems useful

bronze yoke
#

yeah

willow tulip
#

local f = ComponentType.FluidContainer:CreateComponent(); f:setCapacity(5.0); f:addFluid(FluidType.Water, 5.0); GameEntityFactory.AddComponent(o, true, f);

bronze yoke
#

i've used that for a couple things but i don't know if it'll help you create components that don't have setters or constructors

willow tulip
#

is something...

willow tulip
bronze yoke
#

no, because lua just transfers the components from the item

willow tulip
#

... doh.

#

Hmmm... GameEntityFactory.CreateIsoObjectEntity(thumpable, script, true) and GameEntityFactory.CreateInventoryItemEntity(item, this, isFirstTimeCreated); seems relevaant...

#

Hu, the 2nd is in public InventoryItem InstanceItem(String param, boolean isFirstTimeCreated) {

bronze yoke
#

all objects and items are entities

willow tulip
#

Yea.. Im wondering if I can create the inventory item and transfer its components over... or if CreateIsoObjectEntity just makes a generic 'as spawned' version.. (I care little about copying the entity data, just creating an valid, usable entity)

#

ie, if you lose your leather on your drying rack, TOUGH. But id like the drying rack to at least accept new leather.

bronze yoke
#

i think i've used CreateIsoEntityFromCellLoading to spawn entities from a sprite

willow tulip
#

Lets try that then.

#

Hey that seems to have given me a functional, random fluid level water dispencer. thanks

#

(I think fluidComponent is the only accessable one anyway lol)

#

Thanks.. that entity stuff was starting to depress me after all the work I put into this -_-

vast pier
#

Wish I knew how to animate, cuz hema/other sword martial arts animations for being higher level long blade skill would be fantastic

willow tulip
#

lol at random function I found: getCloudColorReddish

#

reddish, lol.

#

also, You can safely assume there is a greenish and blueish... but.... getCloudColorPurplish .. wut?

#

since when do we have 4 primary colors?

#

also, wut: setKateBobStormCoords

#

Now to figure out what makes shelfs appear 'full' when you add items to them

#

function ISPaintSignAction:complete() if self.wall:getProperties():has("WallW") then self.sign = self.sign + 8 end self.wall:setOverlaySprite("constructedobjects_signs_01_" .. self.sign, self.r or 1.0, self.g or 1.0, self.b or 1.0, 1)

#

TIL painting signs is a thing?

bronze yoke
#

yeah it's a funny one

#

you can paint the same symbols on walls too

willow tulip
#

Iv literally never tried painting walls because I quickly decided there was far too mainy paint colors for me to find enough paint of the same color -_-

#

plus I didn't want to have to find MORE paint if a zombie ever smashed stuff

#

the whole plaster walls things too was like.. yea im not doing that

#

(didn't help that only time I built my own base was in B41 where there was massive issues with base building/lighting/etc)

vast pier
#

what are GLB files for models

willow tulip
#

(pretty sure it wasn't updated..)

#

Not asa needed anymore with minimap showing symbols but... I still liked it

#

Now just how to figure out if a cell is close enough that it should exist/be loaded...

#

(game doesn't like it when I try to load a base that is far off in neverneverland)

#

Quick google suggests 100 tiles in every direction. good enough for me

#

.. Ok, not 100.. more like... 80 or something. Guess that was B41 or something

silent zealot
#

Easy: try to get a square, if it's nil then it's not loaded.

#
local square = getSquare(x, y, z)
if square then 
  do(stuff) -- the square is available in the active region around the player
#

More reliable than using distance from the player, since you don't have to guess if the loaded area size has been changed or is trying to catch up due to movement etc.

willow tulip
#

but nil cells also show up in mid air

silent zealot
#

true, but like you say just use z=0

#

and that will work until we get actual 3D ground.

willow tulip
#

yea

silent zealot
#

Sim City 2000 did this 33 years ago.

willow tulip
#

lol.

#

PZ actually has 'ramps' though I dunno if they are used anywhere

#

(or work)

bronze yoke
#

they aren't used

#

they do seem to work

willow tulip
#

Shame, I want a bunker with an underground parking lot -_-;

knotty stone
willow tulip
#

LOL at the lighting on them, I can see they haven't tested them in awhile

#

inb4 my basesaver mod explodes trying to save/load them

willow tulip
knotty stone
#

yea the hanging lamps dont seem to work atm in that underground parking

willow tulip
#

that looks so much cooler then the moudrough police station (however you spell that)

willow tulip
#

Neat

shy mantle
#

It is kinda partly the ramp's fault for being at such an angle and not smooth tbf

bright fog
#

The angle is fine

shy mantle
#

It wasn't made clear, but I meant just in general, the approach and exit angle is sharp. It's possible to get a car stuck at the top.

bright fog
#

That's not a problem with ramps, that's just how the ramp is, you wouldn't take a ramp with such speed in real life unless you didn't give a shit about breaking something on your car

shy mantle
#

Basically that, yeah. I'm interested in them fixing vehicle physics and slightly adjusting the ramp angle a little

bright fog
#

No but again the angle is completely fine ๐Ÿ’€

#

Currently those are concept objects in the game and are not utilized at all, so they don't provide other options because those are not used, that's it
Nothing is stopping them from adding ramps with a curved entry

#

Same as nothing is stopping you from doing that too

shy mantle
knotty stone
#

this ramp stuff is also accessible for vehicles, you can use the mesh for vehicle physics boundarys, not rly sure why xD

bright fog
# shy mantle I disagree

Why that ? Have you never seen such ramps on the road lol ? Those are not uncommon in France, but you just don't find them directly on major roads where you are at high speed, those can be present in cities that's a bit vertical, or even worse if you have an underground garage

#

Those ramps are not abnormal, but of course you wouldn't find them on your main roads, that's normal

bright fog
knotty stone
#

yea instead of box or sphere you can use mesh, but only presets from indiestone, havent played around with it much

bright fog
#

Interesting, I wonder how they handle that because from my memory in the code it only handles it as a rectangle ? Unless that's very very new

#

Also I didn't knew your vehicle could be a sphere ?

knotty stone
#

they also kinda sneakily introduced useChassisPhysicsCollision = false, just found it by chance

bright fog
#

Chassis refers to the main vehicle structure I suppose ?

knotty stone
#

you use the physic boxes you have declared for impact and collision and not physicschassisshape you declared

bright fog
#

Aah I see, I'm not too aware of how vehicles are created in the game

#

It's weird that those are different tho no ? The impact/collision in comparison with the physics chassis ?

#

I'll try to add that in the scripts docs

#

There's a huge lack of doc about vehicle scripts rn

knotty stone
#

well the physicschassisshape is just one big box, if you use it, the zombie will react as it had hit a wall, but with a real hood shape it will plant face first on it, so it kinda interacts better

bright fog
#

I see

#

physicschassisshape is a parameter or a block you add to the vehicle ?

knotty stone
#

just a parameter

bright fog
#

Takes an array of width length height ?

knotty stone
#

ah i thought you meant the other physicsChassisShape = 1.9130 1.9826 8.3304,

bright fog
#

I'll add those to the docs

bright fog
# knotty stone

So to sum it up

  • physicsChassisShape is a rectangle hitbox of the vehicle
  • if you set useChassisPhysicsCollision to false, it will no longer use physicsChassisShape and replace it with the impact/collision boxes, which are the rectangles on your image right ?
#

I assume it is

        physicsChassisShape = height width length,
``` ?
knotty stone
#

yea when false it will use the physics box you declared

bright fog
#

physics boxes are blocks in the vehicle script or parameters ?

knotty stone
#
        {
            offset = 0.0000 1.9185 1.6870,
            extents = 1.7826 2.1043 2.7913,
            rotate = 0.0000 0.0000 0.0000,
        }```
bright fog
#

I see, so that id of this block, box, needs to be one of the available geometries ? So a box, or a sphere like you mentioned before, or I guess those ramp objects for some reasons ?

knotty stone
#

yea its box, sphere and mesh

bright fog
#

Ah mesh, so does it take different parameters in that block if you use the id mesh ? Or did you mean "mesh" as in the name of the physics shape ?

#

Is it related to that

    physicsShape ramp20segment4w
    {
        mesh = physics/ramp20|Segment4,
        translate = 3.0 0.0 0.0,
        rotate = 0.0 270.0 0.0,
    }
knotty stone
#

cant say for sure but should be physics mesh { mesh = physics/ramp20|Segment4, translate = 3.0 0.0 0.0, rotate = 0.0 270.0 0.0, }

#

i dont have debug on to test atm XD

bright fog
#

No worries, I'll add those info to the docs, and they can be refined

#

There's no example of mesh being used in the vanilla files so I can't really base myself on what the game provides rn

knotty stone
#

i did reset my pc yesterday, now the stupid windows snippet tool on print is not saving it -.-"

bright fog
#

Join us, move to Linux aPES3_CursedDemon

knotty stone
#
        {
            offset = 0.0000 0.0000 0.0000,
            rotate = 0.0000 0.0000 0.0000,
            physicsShapeScript = Base.ramp10segment1n,
            scale = 0.8772,
        }```
bright fog
#

And yet, it works so much better :3

bright fog
knotty stone
#

btw anyone knows whats up with the Curtains on windows, when pressing shift+e its always intercting twice on the first try

#

super annoying ^^

bright fog
#

shift + E ? What does that do ?

shy mantle
#

I heard that was a bug with windows, double inputs

#

Not windows the OS lol

bright fog
#

Ok lmao bcs I was going to tell you to join Linux again hahalol

knotty stone
#

on vehicles you automaticaly move to driver seat when entering it from any other seat

bright fog
bright fog
#

@knotty stone what's the zombieType parameter of the vehicle scripts? Does that define like a zombie which can spawn next to the vehicle ?

    vehicle VanSpiffo
    {
        zombieType = Waiter_Spiffo,
knotty stone
#

sounds reasonable, no clue ๐Ÿ™‚

bright fog
#

๐Ÿ‘Œ

knotty stone
#

have let ai run to decompile
zombieType is a list of zombie outfit names for the vehicle. It is used to spawn appropriate zombies in specific vehicle scenarios and to determine which zombies are considered legitimate key holders for the vehicle so it rly sounds reasonable

bright fog
knotty stone
#

yea, it was pretty accurate in its findings there ๐Ÿ‘

bright fog
#

Sounds likely

#

@knotty stone have you ever used the frontEndHealth parameter ?

#

Because that parameter can't work, since the parser uses frontEndDurability drunk

#

                } else if ("frontEndDurability".equals(k)) {
                    this.frontEndHealth = Integer.parseInt(v);
knotty stone
#

vanilla vehicles still use frontEndHealth abraxsLUL

#

would explain why changing it never rly mattered

bright fog
#

Yeaa that parameter isn't parsed ๐Ÿ’€

knotty stone
#

but i rly dont know what it rly does since every vehicle part has its own durability

bright fog
#

That idk

knotty stone
bright fog
#

I did not understand what it just said

knotty stone
#

yea its kinda strange

#

its kinda a buffer on how much damage your vehicle parts get

#

or lets say crash resistant the front/rear is

#
                    this.frontEndHealth = Integer.parseInt(v);
                    continue;
                }``` ๐Ÿ™„  isnt that what it said in the first picture about the legacy frontEndDurability still accepted.
bright fog
#

So they were supposed to use frontEndDurability but instead they use frontEndHealth, which does nothing because that parameter isn't parsed and so it uses the default value 100.0

knotty stone
#

ah right

bright fog
#

Here's the doc I just wrote about that

  - name: rearEndDurability
    type: integer
    default: 100
    description: |-
      It is unclear what that parameter does but as of 42.16.3, the game uses `rearEndHealth` which is a mistake.
  - name: rearEndHealth
    deprecated:
      description: While that parameter is present in vanilla scripts as of 42.16.3, it actually does nothing because it is not parsed as `rearEndHealth` but as `rearEndDurability`.
      replacedBy: rearEndDurability
shy mantle
#

That would explain why some people are noticing their trunks taking more damage than expected lol

knotty stone
#

isnt that a multiplayer bug where it multiplies the damage by the people in proximity?

#

iam rly not good at it but when i look at the java it should work as intended?

            this.rearEndDurability = Math.min(this.rearEndDurability, this.script.getRearEndHealth());
            this.currentFrontEndDurability = this.frontEndDurability;```

```   private void addDamageFront(int dmg) {
        if (this.isDriverGodMode()) {
            return;
        }
        this.currentFrontEndDurability -= dmg;
        VehiclePart part = this.getPartById("EngineDoor");
        if (part != null && part.getInventoryItem() != null) {
            part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
        }
        if ((part == null || part.getInventoryItem() == null || part.getCondition() < 25) && (part = this.getPartById("Engine")) != null) {
            part.damage(Rand.Next((int)Math.max(1, dmg - 3), (int)(dmg + 3)));
        }
        if ((part = this.getPartById("Windshield")) != null && part.getInventoryItem() != null) {
            part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
        }
        if (Rand.Next((int)4) == 0) {
            part = this.getPartById("DoorFrontLeft");
            if (part != null && part.getInventoryItem() != null) {
                part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
            }
            if ((part = this.getPartById("WindowFrontLeft")) != null && part.getInventoryItem() != null) {
                part.damage(Rand.Next((int)Math.max(1, dmg - 5), (int)(dmg + 5)));
...```
shy mantle
#

Never heard of that, but there were a few posts on what I said, never looked into it

shy mantle
#

But corpses spawned inside the vehicle are still completely random, unfortunately.

bright fog
shy mantle
#

Usually just in trunks or ambulances as well.

bright fog
willow tulip
#

lol at frontEndDurability

#

isSmallVehicle never knew that was a thing.

#

mass might wanna add something like 'values in excess of 1400 can cause vehicle wheels to start sinking into the ground and be unable to move'

#

(the heavest vanilla cars are 1400 and they already have problems with wheels sinking into the ground when you turn at high speed)

cinder storm
#

lol

willow tulip
#

offRoadEfficiency affects horsepower reduction when offroad (Higher = less horsepower reduction when offroad)

dawn shuttle
#

I'm including ModData to synchronize data server wide. Any tips on how to troubleshoot solo?

willow tulip
#

playerDamageProtection Love how that variable suggests that higher values would be less damage but its actually the opposite (just checked code, your description is correct)

#

steeringClamp is the max angle you can turn the front wheels left/right

#

stoppingMovementForce is a drag factor applied to the vehicle at all times

bright fog
#

You know you can contribute to these docs right ?

willow tulip
bright fog
#

A GitHub account ?

cinder storm
#

i have github i can get on there and add in what he's doing

willow tulip
#

shrugs don't think I have one

#

wheelFriction is 1.2 to 1.9 for all vanilla vehicles and controls turning and stopping (but not acceleration) tire friction limits, with 1.4 being the most common. Values over 1.8 can cause vehicles to flip in sharp turns. (Likely depends somewhat on center of mass)

bright fog
#

Why don't you have a GitHub account ?

willow tulip
#

do I look like a professional developer or something?

bright fog
#

Maybe that's the time to start then, it would make my life so much easier and that's a skill you can learn

#

I'm not a professional dev

willow tulip
#

shrugs

bright fog
#

I started using GitHub for personal projects

willow tulip
#

Oh, 'wheelfriction' for trailers is 4.0. I dunno why, kinda dumb.

#

(also why horsetrailer likes to flip)

cinder storm
#

i forked it, ill send a pull soon

willow tulip
#

Just thought id give some info. Too lazy to do more.

bright fog
cinder storm
bright fog
#

Basically when you add that, you put the text on the line after and you can use newlines in the string

#

If you don't do that, newlines don't work

cinder storm
#

alright, so add |-, enter and then tab

bright fog
#

I suggest downloading red hat's extension for YAML on VSCode

cinder storm
willow tulip
#

Hu, TIL your more likely to get broken glass injuries on impact in a car if your vehicles windows are <15% condition (But not if they are missing entirely(?))

#

(see public void addRandomDamageFromCrash(IsoGameCharacter chr, float damage) in BaseVehicle.java for details)

cinder storm
bright fog
#

I'll check it out a bit later

cinder storm
#

on another note

#

ive been looking at some of my other mods, they still work perfectly item-wise but ive found that a custom foraging category i made doesnt display

#

i was thinking i might need a separate foragecategories.lua file

#

it runs the file, i checked it through console

willow tulip
cinder storm
willow tulip
cinder storm
#

its in \42\media\lua\shared\Foraging

#

i compared it with base game files, the only discrepancy i found is that it doesnt seem like you add both categories and definitions in the same lua script

#

so im thinking of separating them

willow tulip
#

so make sure to test that if your not using base.

cinder storm
willow tulip
#

Im saying for the items in your mod itself.

#

And you can use base., your just not supposed to.

#

(but I always use base. because far too much stuff breaks if you don't)

#

since TIS never tests non base module stuff -_-

cinder storm
#

i had it using base on another mod of mine but its still currently bugged in MP

#

i can see why you used it because theres not as many problems with base

willow tulip
cinder storm
#

thats what i found

cinder storm
#

distributions still work fine afaik

#

because lootzed still showed the items on some corpses

willow tulip
#

(add some item with super high frequency and see if you can find it properly spawning)

#

also add some base item with super high frequency so you can confirm if its base or your code

cinder storm
#

alright it still works fine

#

ill just wait until someone finds a workaround they can sneak in

#

works in mp too

#

we good

bright fog
#

@cinder storm sent a review, don't change all description string entries to multi line

cinder storm
#

got it

bright fog
#

While that isn't anything bad, it adds noise to the reviews

cinder storm
#

question about translations

#

they did remove all the underscore prefixes?

bronze yoke
#

only a couple of them

cinder storm
bronze yoke
#

yes that would not work

cinder storm
#

alr

bronze yoke
#

iirc just recipe names and item names

cinder storm
#

alr

#

thanks

bronze yoke
#

those never get added to the main translation lists in the first place, they're stored separately, so the prefixes were pointless

#

basically if it's something you would use getText() for, the prefix will definitely still be needed

woven bane
#

anyone can help me with this ? im trying to add a custom sword to the game but keep getting that faild Assetpath. B41 btw

#
module MyCustomWeapon {
    imports {
        Base
    }
    
    item CustomSword {
        HitSound = KatanaHit,
        ImpactSound = KatanaHit,
        SwingSound = KatanaSwing,
        AttachmentType = BigWeapon,
        BaseSpeed = 1,
        BreakSound = KatanaBreak,
        Categories = LongBlade,
        ConditionLowerChanceOneIn = 333,
        ConditionMax = 100,
        CritDmgMultiplier = 14,
        CriticalChance = 28,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        DisplayCategory = Weapon,
        DisplayName = Custom Sword,
        DoorDamage = 8,
        DoorHitSound = KatanaHit,
        HitAngleMod = -30,
        HitFloorSound = KatanaHit,
        Icon = CustomSwordIcon,
        KnockBackOnNoDeath = TRUE,
        KnockdownMod = 0,
        MaxDamage = 16,
        MaxHitCount = 3,
        MaxRange = 1.4,
        MinAngle = 0.8,
        MinDamage = 8,
        MinimumSwingTime = 3,
        MinRange = 0.61,
        PushBackMod = 0.5,
        RunAnim = Run_Weapon2,
        SubCategory = Swinging,
        SwingAmountBeforeImpact = 0.02,
        SwingAnim = Bat,
        SwingTime = 3,
        TreeDamage = 1,
        TwoHandWeapon = TRUE,
        Type = Weapon,
        WeaponLength = 0.4,
        WeaponSprite = CustomSword,
        Weight = 1.4,
        Tooltip = Custom Sword...
    }
    
    model CustomSword
    {
        mesh = weapons/2handed/CustomSword,
        texture = weapons/2handed/CustomSword,
    }
bright fog
#

nvm you just sent it

#

Make sure you properly exported the model
Try to load it back into Blender

#

Ah wait

#

The problem is WeaponSprite

#

You need to reference the model by its full type

#

So module.id

woven bane
bright fog
#

WeaponSprite

#

To your model

woven bane
woven bane
#

now the weapon is working but still invisible do u think its a problme with scale ?

#

@bright fog

bright fog
#

Where's your texture located ?

woven bane
bright fog
#

What format is it

woven bane
#

PNG

bright fog
#

Did you fully reload the game after doing your edits ?

#

Place the item on the floor and play with the scale value, both dividing by 10 or multiplying by 10, multiple times

woven bane
woven bane
bright fog
woven bane
buoyant violet
random terrace
#

any reference anywhere on how the loot distribution works for placed items like these?

bronze yoke
#

this is just a hardcoded event

#

there's no modding it, and i think the 42.17 blog post said they're even taking it out in that patch?

random terrace
#

righty, I see now

#

ty

silent zealot
#

What!

#

Unless they are taking it out to rework Random Stories to be lua-available

willow tulip
silent zealot
#

I thought about how it could be done as a lua mod and it's feasible to make a framework for "specific building changes" but a lot harder to do one for random building changes (or at least I could not see any way to do so neatly)

willow tulip
#

But a LUA callthrough for stories would work so much better.

#

and only cost 0.00001% FPS

#

(im sure onCreate callthrough alone costs 50x more)

#

(ie, leave everything in java, but call the java functions through Lua like how onCreate is done now, so that Lua can easily intercept the calls if desired)

vapid acorn
willow tulip
#

I realized recently that attachments are full on items stored in the gun. I always assumed it was just some metadata stored.

silent zealot
#

One step closer to Warhammer: 1993

woven bane
#

anyone can help me with this issue ? was everything good until i got that wrong rotation on the ground

silent zealot
#

You might need to start a new test game after adjusting because I had issues working on a similar problem and it urned out teh save was somehow storing attachment info but only sometimes.

woven bane
#
{
    imports {
        Base
    }
    item CustomSword {
        HitSound = KatanaHit,
        ImpactSound = KatanaHit,
        SwingSound = KatanaSwing,
        AttachmentType = BigWeapon,
        BaseSpeed = 1,
        BreakSound = KatanaBreak,
        Categories = LongBlade,
        ConditionLowerChanceOneIn = 333,
        ConditionMax = 100,
        CritDmgMultiplier = 14,
        CriticalChance = 28,
        DamageCategory = Slash,
        DamageMakeHole = TRUE,
        DisplayCategory = Weapon,
        DisplayName = Custom Sword,
        DoorDamage = 8,
        DoorHitSound = KatanaHit,
        HitAngleMod = -30,
        HitFloorSound = KatanaHit,
               
        Icon = CustomSword,
        
        KnockBackOnNoDeath = TRUE,
        KnockdownMod = 0,
        MaxDamage = 16,
        MaxHitCount = 3,
        MaxRange = 1.4,
        MinAngle = 0.8,
        MinDamage = 8,
        MinimumSwingTime = 3,
        MinRange = 0.61,
        PushBackMod = 0.5,
        RunAnim = Run_Weapon2,
        SubCategory = Swinging,
        SwingAmountBeforeImpact = 0.02,
        SwingAnim = Bat,
        SwingTime = 3,
        TreeDamage = 1,
        TwoHandWeapon = TRUE,
        Type = Weapon,
        WeaponLength = 0.4,
             
        WeaponSprite = CustomWeapon.CustomSword,
        StaticModel = CustomSword,
        WorldStaticModel = CustomSword,
        
        Weight = 1.4,
        Tooltip = Custom Sword...
    }
    model CustomSword
    {
        mesh = weapons/2handed/CustomSword,
        texture = weapons/2handed/CustomSword,
    }
}
silent zealot
#
    model Sword
    {
        mesh = weapons/1handed/Sword_SingleEdge_Hand,
        texture = weapons/1handed/Sword_SingleEdge,
        attachment Bip01_Prop2
        {
            offset = -0.013 0.0001 0.0025,
            rotate = -23.8537 -86.6222 -22.0887,
        }
        attachment world
        {
            offset = -0.0105 0.0002 0.0,
            rotate = 0.0 0.0 -1.0335,
        }
    }

#

note the two attachmentt defs in a vanilla sword

#

One is (I think) when the model is used as a prop, like crafting with things in your hands.

#

And the other for when it's placed in the world.

#

the world stuff here is almost "no change at all" but maybe you need something else for your model, or maybe you didn't have it perfect w/rotation and transforms on export.

#

Two ways to start fixing: add a world attachment and change the world parameters by 90 at random until it works

#

or try add world attachment and try the attachment editor.

#

Or just copypaste the vanilla sword and that might work.

woven bane
#

i'll try this thanks

willow tulip
#

Worst gunsword ever.

woven bane
#

@silent zealot ๐Ÿซก ๐Ÿซก

willow tulip
#

(the sanding lines not being aligned, mainly)

#

.. and looking like it was finished with a 40~60 grit

#

ahh... thats better...

silent zealot
#

Agents of Shield was fun, but not known for their high level of attention to realistic prop details.

#

And that is a badly balanced shotgun with an impossible to hold properly axe.

cinder storm
#

standard issue custom made axe shotgun

#

good for zeds, better at destroying bandits

#

that way you dont have to carry both a hatchet in your belt and your gun on your back

#

implementing it in zomboid though sounds like a pain

little sinew
#

since im a baby who hates injuries, i was wondering if there was a way for me to change settings in the files that would allow me to suture closed lacerations and bites. I have transmission turned off because i have yet to even make it a full week

vast pier
silent zealot
#

I think you could make a mod to do it, but it would not be straightforward; you'd have to redo the medical GUI stuff to allow suturing, probably redo the timed action, then have something running on a timer event to manage healing since vanilla healing won't heal those faster because of suturing...

#

Better option for learning is transmission off (already done!) and disinfect/bandage. And turn down the starting zombie population.

#

I know when I was learning injuries from a fight I survived were never the real problem, it was dying during the fight as zombies tore me apart.

willow tulip
#

java.lang.RuntimeException: attempted index: getAmount of non-table: zombie.entity.components.fluids.FluidInstance@2298d705 at KahluaThread.tableget(KahluaThread.java:1441).
... did.. did they unexpose FluidInstance?

#
local fluidComp = object:getFluidContainer();
if fluidComp then
    local fluidSample = fluidComp:createFluidSample();
    for x = 0, fluidSample:size()-1 do
    local fluid = fluidSample:getFluidInstance(x)
    print("Amount " .. fluid:getAmount());
#

Im sure that used to be exposed...

#

I guess fluidComp:getSpecificFluidAmount(fluid) works.. just annoying.

silent zealot
#

It's private now. At least for FluidContainer.. looks public for FluidSample

willow tulip
#

today, on amazingly cursed looking code:

    for index,value in ipairs(fluidTable) do
        local it = string.gmatch(value,"[^|]+");
        fluidContainer:addFluid(it(),it());
    end
silent zealot
#

My cursed code of the day is logging a change ticket using sed instead of a dozen lines describing what to edit in a file.

sed -i -e 's/\(internalProxies.*\)44\158/' /usr/local/apache-tomcat/conf/server.xml

I'm almost certain I'll get told there is a mistake and it's meant to be 58, not 158.

willow tulip
#

lol.

silent zealot
#

...I also just updated a ticket with

tomcat log rotation is not doing what it should be doing and I am still shouting "YOU HAVE ONE JOB!" at it while pointing at unrotated logs.

...so it's probably time for a break.

willow tulip
#

lol

#

My fav was finding some comments about how good pizza was after a night of drunk coding.

#
object:getFluidContainer():removeFluid();
object:getFluidContainer():addFluid("Water",15);

Anyone have any ideas why this is not adding water to a waterDispencer object?

#

(the removeFluid seems to work fine..)

#

Without removeFluid I get a dispencer with RNG amount of water, with it I get 0 water

#

object:getFluidContainer():addFluid(FluidType.Tea,10); also results in 0 fluids...

#

... grrr obscure wtf thingy silently preventing addfluid from working: object:getFluidContainer():setInputLocked(...)

#

Dunno why that would just break the addFluid API instead of being a UI only thing -_-

upbeat turtle
manic forum
#

Is it possible to hijack the 'heating' mechanic in a feasible way for my own scripts? For example, instead of heat, it's a crafting process bar, and if it turns into 'burned', I can change the item myself. For like Passive Crafing?

cinder light
#

I'm sure that's possible (definitely with Java modding), I'm just wondering why not use the heating mechanic, and set the "burned" version of your item to be replaced by the new item? I mean, I don't specifically understand how you would heat up a players inventory in the first place either? but maybe I'm just misunderstanding your message

buoyant violet
little sinew
willow tulip
#

You can also do ReplaceOnRotten (used for the disabled sugar recipe thing)

#

Combining the two, you can have something like: "Must be cooked, and then it has to 'sit' for some amount of time to become the final thing"

silent zealot
#

Exactly how I remember brewing mods in Rimworld working for some drinks

willow tulip
#

(replaceOnX are part of the itemScripts that let you transform it into a new item, without any code required)

silent zealot
#

Make up some mash, keep it around to "rot" aka age into somethingthat then goes into barrels

willow tulip
#

Yep! using the two you can get a lot of fancy stuff done

#

(theres also ReplaceOnUse (most often used for food to return the container) and ReplaceOnDepleted and ReplaceOnExtinguish (Used for candles and stuff)

manic forum
#

The Dryingrack "Method" doesnt work cuz i need 2 diffrent items as input and it does only support 1:1 itemexcange. My thought was to hijack the "Burned" event to check if the 2nd material is in the same inventory then replace both with the output.

cinder light
#

ah I see, the one problem with this is you would have to create a custom tag as well, and limit your container to only accept that one tag, otherwise people could cook their food in your crafting table

willow tulip
#

But you could try hijacking ReplaceOnCooked and then the replacement could have an onCreate script

#

(the onCreate could MAYBE check for the 2nd item and then revert it if the 2nd item doesn't exist.. Not 100% sure what you can do in the onCreate event of an object)

#

But onCreate at least can call Lua code for you.

#

Also note, leaving a burnt item in the oven causes risk of fire

manic forum
#

good points, i will try it later

vapid acorn
#

I think a bayonet mod is super neat btw.

buoyant violet
#

nah you just mount it, I didnt wanna make it too complicated

silent zealot
#

42.17 is out.

buoyant violet
#

since a bayonet has the little thing for attaching

#

but its part of the framework. I could leave an option to make a material a requirement

vapid acorn
#

But you could MacGyver one with just any knife and some tape, although it might not work anywhere near as well.

buoyant violet
#

in my mod is just some knife you find and can put on weapons. on the framework I will leave a system to make a material requirement

vapid acorn
buoyant violet
#

still a bit before its out ๐Ÿ˜…

#

its a whole ass framework and my weapons mod to showcase it

vapid acorn
#

No problem, take your time. No need to rush.

halcyon river
#

wahhh the physics changes

#

everythings broken tired

knotty stone
#

getCell():getVehicles() <- boom gone Edit: ok still working but output changed xD

halcyon river
#

one step closer to stable build 42 though

mellow frigate
strong quest
#

Hi! With the recent update, one of my mods broke, and the culprit is this method: getVehicles(). Has anyone been able to find its name?

mellow frigate
#

the only use I see of getVehicles in Vanilla B42.17 lua is as broken as my mods (ISVehicleBloodUI:prerender)

shy mantle
#

@knotty stone They removed the patch note that said something like, fixed not being able to place light switches

#

Now it's just, "Fixed being able to pick up light switches"

knotty stone
#

well funny part is that this was something already done in 42.16.3

shy mantle
#

Oh, well then it makes sense

bronze yoke
#

i honestly don't know if you will be able to iterate over a set... can you try ArrayList.new(vehicles) and iterate over that?

halcyon river
# knotty stone

what even is the point of changing the output type lol, does anyone see how they changed their usage of the func

bronze yoke
#

i'd argue this should've been a set in the first place

#

the order is meaningless and there shouldn't be duplicate entries

halcyon river
bronze yoke
#

it wasn't an approriate usage of a list

shy mantle
#

Never used getVehicles (plural index version), but it's good to know now I guess lol

halcyon river
#

i suppose, though for this usage is there any performance difference between a list and a set

strong quest
#

Thank you so much for sharing the change to getVehicles() ๐Ÿ˜„

quartz brook
#

Sorry for asking this, I couldn't find anything in pins. Is there a plugin for blender to work with .x model format for import/export? The method im using gets rid of correct worldscale size

bronze yoke
#

no

#

you can use ZomboidAssetConverter to convert vanilla models to gltf for import, and there's no reason to export to x in the first place (use glb or fbx instead)

quartz brook
#

cries in linux guess ill have to build it

mellow frigate
quartz brook
#

google has become useless for niche findings

mellow frigate
#

look for aoqia pinned message in animation channel of PZ Modding community Discord. (I just got temp banned for linking it..)

quartz brook
#

thanks, im trying to get the weapons .x files but already have them converted to fbx. I found a plugin in that discord for blender that does GLTF, ill see if that works. (It works thx)

exotic junco
#

getisnpc

#

whoops, thanks discord, that definitely is the textbox i wanted to type in

manic swift
#

Hey guys got a question here

#

If I want to allow any and all vegetables in a crafting recipe thats NOT an evolved recipe

Do I do Base:Vegetables ?

exotic junco
#

are the JavaDocs that the pz wiki links to up to date for current unstable versions? trying to hunt down a method returning null but dunno if i gotta decompile the java myself first

bronze yoke
#

yes

bright fog
#

It's written at the top right what version it's for

near vessel
manic swift
#

So how do I format this because there is thing in the files that say Foodtype = Vegetable

#

Do I just put Item 3 as Foodtype=Vegetable and it uses anything with that?

bronze yoke
#

i don't think you can do this

manic swift
#

I really dont want to have to listen to every Base: for every vegetable

#

sigh

near vessel
#

As of right now I think that's the only comprehensive solution

#

A vegetables tag would be nice for items though

manic swift
#

So whats the point of the line

Foodtype=Vegetables

near vessel
#

I'd have to check to be certain but it's probably for evolved recipes or nutrition

manic swift
#

Cucumber for example

near vessel
#

Yeah I'd have to guess it's for evolved or nutrition

bronze yoke
#

it's just used for categorising ingredients for the ui

near vessel
# manic swift

The only relevant line to use as a tag in a craftRecipe is ItemType though

near vessel
manic swift
#

So utterly useless

exotic junco
# bright fog

to confirm - what url are you getting this from? i am looking at https://projectzomboid.com/modding/index.html, which does not have that, i apologize if i'm missing something obvious

manic swift
#

Alright typing every veggie in then manually

exotic junco
near vessel
#

no problem

exotic junco
#

appreciate all the help haha

frank lintel
#

when have they? thought the JD's always been unofficial

frank lintel
#

btw Sim, where are keybinding hiding at if you just happen to know offhand in java...

bright fog
#

You mean the keybinds that you can setup in the option menu ?

frank lintel
#

yep

bright fog
#

Idk sry

#

The UI is Lua, for sure

#

But the keybinds idk what system they use

frank lintel
#

its likely java since its IG, apparently aiming is doing a null check on the first key so when its unbound oh you lose all aim abliity....

#

basically the null check is killing RMB from working

bright fog
frank lintel
#

if you unbind 'aim' from in this case default is left Ctrl.... and set it to 'none' your RMB ability to aim dies with it

manic swift
#

Oh hey I looked into it

Foodtype = vegetable

Is for foraging categories

bright fog
frank lintel
#

oh I plan on it but few people alreadyt reported similiar problems. I was just hoping to find the code to see if my theory was correct and its cuz its not passing beyond the none being considered == null

#

basically if Aim=key:74;altCode:10001 and if Aim=key:0;.... it just stops there and goes okay we not doing anything more :)

#

looks like they know about it too and seems to agree on the cause and also temp solution I suggested (random key on your numpad area out of the way...)

near vessel
#