#mod_development

1 messages Β· Page 302 of 1

umbral raptor
#

that wont work for some reason

vast pier
#

I think you could use the oncraft function to push some lua in it for randomized loot

sly monolith
#

bruh i have no idea what i'm doing and i'm somehow doing stuff πŸ˜„

vast pier
#

yeah that's almost everyone here

umbral raptor
sharp plinth
umbral raptor
#

best way to learn is to learn from the ancients. see how other B42 modders did items similar to your concept

vast pier
sly monolith
sly monolith
umbral raptor
#

i really need help with a slightly difficult concept if anyone can

#

i want to make an item on the ground be a light source/give out light

#

the closest i found is the lanterns mod

#

but it wont work with me. i think something's broken/different in B42

#

i based it off my heater script which kinda works but i obviously have no idea what im doing

distant inlet
#

looks like self doesnt make sense in your file because there's no class in context

#

try adding ISPortableTVLightObject = {} after your locals in the beginning and return ISPortableTVLightObject at the very end

#

hope that helps a bit

#

also, as a wise someone-in-this-channel once said: be careful about making your classes global

drifting ore
distant inlet
#

I saw a timed action lifecycle diagram online once. Does anyone know where to find that?

vast pier
#

what are the sparklers used for in the aerosol bomb recipe? I'm assuming they're ground up and put in between the aluminum foil and the spray can.
Is this to produce heat? A spark? fire starter?
Asking because I feel it's absurd that the only item that can be used in aerosol bombs is sparklers, and want to expand on the ingredients possible
I'm thinking it's being used as a propellent, to ignite the spray can. So other things I'm adding as usable propellents should work too.
Unsure tho as idk what the thought process was behind making the item
And last time I tried to look up "aerosol bomb" google changed it to "airline bomb"
so I don't wanna google more

bright fog
umbral raptor
#

you could be taking the material that makes sparkles do their thing off the stick?

#

like scraping the red part of a match u know?

#

but im not sure how that works irl

#

cuz sparkler stuff while long-lasting is probably a shitty propellent specially for a bomb

vast pier
#

well the actual propellent part of the bomb would be the aerosol, the sparklers are just to ignite that

#

like bullet primer vs gunpowder

umbral raptor
#

that makes sense

vast pier
#

also can we take note of how funny the firecracker recipe is

#
    {
        timedAction = Making,
        Time = 100,
        NeedToBeLearn = True,
        Tags = AnySurfaceCraft,
        category = Miscellaneous,
        inputs
        {
            item 1 tags[Scissors] mode:keep flags[IsNotDull],
            item 1 tags[Glue;Epoxy],
            item 1 tags[Propellent],
            item 1 [Base.SheetPaper2;Base.GraphPaper;Base.Brochure;Base.Flier;Base.Paperwork;Base.LetterHandwritten;Base.Doodle;Base.DoodleKids;Base.GenericMail],
            item 1 [Base.Twine],
        }
        outputs
        {
            item 1 Base.Firecracker,
        }
    }```
#

why didn't they just make a tag for paper

bright fog
#

tho a little bit confusing lol

sturdy rune
#

hey guys, does anyone know how to check if the player is going through a window or climbing a fence to make them drop an item they have equipped?

#

in build 41.78.16

bright fog
#

Have you checked the java doc if something is related to that ?

sturdy rune
sly monolith
#

what is this referring to? Tooltip = Tooltip_Briefcase,

umbral raptor
#

U know that text that shows up under an item’s name?

#

Usually telling you about its function or how it works

#

Like the sleeping bag

#

Thats a tooltip

mellow frigate
bronze yoke
#

i've been reluctant to document the timed actions changes since it's not really clear what they're for yet

sturdy rune
bronze yoke
#

the intention seems to be that complete runs on the server and perform runs on the client

#

but since we're in singleplayer only it's hard to judge what the actual implications of that are yet

mellow frigate
bronze yoke
#

i think the majority of lua mods will not work in b42 mp without changes, too much stuff has moved to the server for old code to be compatible

sly monolith
#

can someone explain what's the difference between those 2 files, "BodyLocations" and "AttachedLocations", they both have "getOrCreateLocation", what is the difference here

sturdy rune
bright fog
#

And any inherited methods

sturdy rune
#

thank you so much bro!

tranquil kindle
winter bolt
#

attachedlocations is holsters and stuff

outer crypt
#

It looks like when you use addXp(player, perk, amount) the amount received is modified, usually a much lower amount. Does anyone have a breakdown on what affects that? Been poking around and running tests but it doesn't seem consistent.

bronze yoke
#

depends on player's xp multiplier and boost mostly

#

so dependent on starting skill level and books read

outer crypt
#

as I suspected... thank you, I haven't been able to get player:getXP():setXPToLevel(Perks.Cooking, 8) to work so I have been using AddXp to keep adding the difference until the next level is reached.

sly monolith
#

just thinking maybe it'd be better to use something like a weapon instead of a clothing item for the prop cuz it has condition and insulation when you hover over it and it looks kinda stupid

tranquil kindle
small topaz
#

Hi! The vanilla game contains a lua function in the shared folder. In my mod, can I safely access this function in my client folder? Using smth like

function Vanilla.Function(a,b,c)
  vanilla_function(a,b,c) -- execute the vanilla code from shared

 -- do some additional things...

end```

This code is in my mod's client folder while "Vanilla.Function" is in vanilla's shared folder.
bronze yoke
#

yeah

small topaz
#

thanks!

small topaz
#

another question: does anyone know why TIS put some TimedActions in the shared folder and some in the client folder in B42??

fathom dust
#

presumably the difference is whether or not the server would need them

bronze yoke
#

it seems timed actions should be in shared in b42

#

there's a lot of pretty major changes to how timed actions work but not all have been updated, and it doesn't matter in single player

silent zealot
#

I can't wait for the screams of players when any mod using timed actions stops working when multiplayer is released, as they completely forget this is the unstable version.

small topaz
#

In B41 and B42, I think the beard and hair growth is controlled by java files and not by lua. Is there still a way to detect whether hair/beard has grown in lua?

vocal vector
#

i have a q about variable efficiency, i'm playing around with Bandits Week 1 mod and wanted to track which room the player is in and for how long. I've implemented this as a local variable in a script that is run on each NPC. Would a global variable be more efficient?

silent zealot
#

Look in the LUA for the character interface where you can changes your hair/beard

bronze yoke
#

there is overhead for writing/reading global variables, locals are always faster

#

globals are discouraged for many reasons but performance is a major one

silent zealot
#

Maybe getBeardStylesInstance():FindStyle(getPlayer():getHumanVisual():getBeardModel()):getLevel() for beard length

vocal vector
#

thank you

silent zealot
#

And for hair try getHairStylesInstance():FindMaleStyle(getPlayer():getHumanVisual():getHairModel()):getLevel() or if getPlayer():isFemale() go with getHairStylesInstance():FindFemaleStyle(getPlayer():getHumanVisual():getHairModel()):getLevel()

#

Because gender is apparently deeply ingrained in the hair code.

bronze yoke
#

i didn't think they even had different hair styles

plush wraith
#

How difficult is it to add in a keybind for a joypad? I need to add a listener to perform an action from a joypad button/combo for my mod action

small topaz
small topaz
vast pier
#

what makes keyrings psuedo equip themselves?

#

Also can I force items from the player's inventory into a container in their inventory?

#

I wanna make it so the player spawns with a wallet, and then stuff their ID & Badge and anything else into their wallet

fathom dust
#

Is it documented anywhere what info the different levels of Animal Care provide? I'm having trouble finding the animal info window code

small topaz
vast pier
small topaz
# vast pier It acts like any other bag, yeah

Then my code example should basically work.

In case you want to add an item which is in player's inventory, you have to grab the item somehow, write it to a local variable like local item = ... and then use smth like

wallet:getInventory():addItem(item)```

So in this case, you have to make sure the item is removed from player inventory.
vast pier
#

yee

tacit pebble
#

razab is right. find items from inventory, store somewhere in your code, remove from inventroy and add to wallet

#

btw it's a great idea spawing with wallet I must use your mod when it's release πŸ˜„ immersive!

small topaz
fathom dust
#

dear lord they refer to "animal care" as "husbandry" in the code and most of the skills don't match up with their names...that is absolutely terrible for a game designed to be modded.

plush wraith
fathom dust
#

maintenance sprints are a thing people!

bright fog
#

In fact we are lucky most of the stuff is fairly explicit

fathom dust
#

It is because it is not difficult to tidy it up. It's trivial even with modern editors. It's just neglectful not to.

whole bay
#

Has anyone made a mixtape mod? That lets u put multiple VHS or CDs in one to play in a row in a car ect?

winter bolt
#

display names not matching internal names is pretty normal though i dont see what the issue is

#

its not like skills have overlapping names so it doesnt really matter

silent zealot
#

But if you just want to know if it did grow, you could periodically check if the length of the hair/beard model changed. (which will always happen when asleep, which might make it easier for you to find a good trigger for checking)

#

You could stop growth by resetting the growth timer once a day... but actually changing how often it grows is 100% java

small topaz
#

I just wanted to catch the exact moment when beard grows but this is possible via the OnClothingUpdated event

vast pier
#

I had to do some diggin to learn how the player name is applied to ids n' stuff

bronze yoke
#

you can just move the item into the other container instead of deleting it and spawning a new one

vast pier
#

well that would have been helpful to know, this works fine tho

small topaz
vast pier
#

yeah I know why I had to do it

forest herald
#

Is there a way to alter item names in base game via mod? For example atm Base.WinterBerry is just named β€˜Berry’ in game, is there somewhere/someway to change every instance of Base.WinterBerry to β€˜Winterberry? πŸ‘€

vast pier
small topaz
vast pier
#

ah it targets the original item? gotcha

#

yeah I'll change that then

small topaz
vast pier
#

the mod itself currently makes it so you can wear a wallet, spawns you with a wallet, and makes it so some more items can be put on your key ring

small topaz
#

I have a general question concering the lua events:

Consider the following code:


local function myFunction()
   triggerEvent("SomeEvent")
   -- some additional here...
end```

When exactly ist the function "eventFunction" executed? Is it after the function "myFunction()" has been finished?
vast pier
#

same with wallet if I find something and go "why can't I put this in my wallet/keyring 🀨 "

#

anyone else feel like sunday driver should have a chance to spawn with a parking ticket? same way speed demon can spawn with a speeding ticket

tacit pebble
tacit pebble
ancient grail
#

so i might be working on a warewolf mod
and so i did my research in attempts to fetch if its fullmoon
and heres what i figured out

local function isFullmoon()
    return ClimateMoon:getPhaseName() == "Full"
end
print(isFullmoon())

tho i explored a bit more and came up with other stuff and im sharing it here
for anyone working on moon related stuff

-- did not use this for the code below, but you might find some use for it

local MoonPhases = {
    "New", "Waxing crescent",
    "First quarter", "Waxing gibbous",
    "Full",  "Waning gibbous", 
    "Third quarter",  "Waning crescent",
}

LuaEventManager.AddEvent("OnMoonPhaseChange")
local curDay = getGameTime():getDay()
local curPhase = ClimateMoon:getPhaseName()

local function checkMoon()
    if forageSystem.getTimeOfDay() == 'isNight' then
        MOONPHASE = ClimateMoon:getPhaseName()
        local newDay =  getGameTime():getDay()
        if newDay ~= curDay then
            curDay = newDay
            if curPhase ~= MOONPHASE then
                curPhase = MOONPHASE
                if getCore():getDebug() then print(MOONPHASE) end
                -------------------------------
                --place your code if you want to trigger code everymoon phase change
                -------------------------------  
                triggerEvent("OnMoonPhaseChange", MOONPHASE)                
            end
        end
    end
end
Events.EveryHours.Add(checkMoon)

local function OnFullMoon(phase)
    if string.find(string.lower(phase), "full") ~= nil then
        if getCore():getDebug() then
            ISChat.instance.servermsgTimer = 9000
            ISChat.instance.servermsg = tostring(phase)
        end
        -------------------------------
        --maybe place your code here? if you want just the fullmoon same as what i need
        -------------------------------     
    end    
end
Events.OnMoonPhaseChange.Add(OnFullMoon)
vast pier
#

I think the vanilla weight is 0.1 in vanilla, that number is just there in case I wanted to reduce it

#

No need to though, as equipping a wallet makes it 0.03

#

And the reason I'm against increasing the max item size is because it accepts any item from the literature category

#

the player does not need a library of skill books in their wallet

#

If an item comes up that's above 0.2 that I feel would still fit, I'll think about raising it

wicked summit
#

ok im starting to mess with stuff... What have i done here?

tacit pebble
wicked summit
#

yess

#

ive accidently turned it on

tacit pebble
#

go to option, click key bindings tab, look for debug section and animation monitor
or it should be one of f3 - f6 by default

wicked summit
#

oooh ok yea its combined with the speed keys, ok, dont do that hehe, ty

scarlet shore
#

Does anyone know how to get the friendly name of a vehicle? I've only gotten as far as getting "SmallCar" for the Chevalier Dart with
player:getVehicle():getScript():getName()

tacit pebble
wicked summit
tacit pebble
wicked summit
#

invisible?

#

thats off

tacit pebble
#

hmm has multiple functions been bounded in f3 then? idk :/
I use = for animation monitor and 0 for log window and no problem at all

wicked summit
#

F6!!

#

geez

#

haha

tacit pebble
#

good! then f3 must be for invinsible cheat

wicked summit
#

i swear i trried it like 3 times

tacit pebble
#

i didn't know that lol

wicked summit
#

must be

tacit pebble
#

btw i really can't understand why they tied with speed multiple function by defualt lol

wicked summit
#

yea thats crazy lol

whole bay
#

anyone able to help with a mod not showing up when installed locally

tacit pebble
whole bay
#

i believe its all done right

#

in steams directory under mods

wicked summit
#

Ty comrad Coolfish2

whole bay
#

where the example mod is

#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\mods\MixVaultVHS

tacit pebble
whole bay
#

It shown up now for debugging πŸ™ƒ

#

Thanks coolfish

scarlet shore
tacit pebble
bronze yoke
#

just put that translation key into getText()

tacit pebble
#

Question
will save(true) save zombie pop too? it's annoying when my game crashed and all zombies are disappeared. I'm thinking about auto-save mod myself if it's possible

sturdy rune
#

does anyone know how to check if im colliding with a climbable object? got it working for windows but not for low/high fences

scarlet shore
sturdy rune
#

but it doesnt detect fences

tacit pebble
whole bay
#
ERROR: General     , 1739249298871> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: new of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1739249298871> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: new of non-table: null
        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
        at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
        at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:564)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:510)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:342)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:264)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:391)
        at zombie.GameWindow.init(GameWindow.java:1206)
        at zombie.GameWindow.mainThreadInit(GameWindow.java:576)
        at zombie.GameWindow.mainThread(GameWindow.java:489)
        at java.base/java.lang.Thread.run(Unknown Source)

is anyone able to help with if my format is wrong ive looked over a few times and cant see my issue

#

new of non-table: null at KahluaThread.tableget i think its the null issue but i cant seem to fix it

rancid rampart
#

Hello. help please, how to publish the translation of the mod in the steem workshop? What is needed for this?

tacit pebble
tacit pebble
#

Is there any tutorial with UI things? tbh, I have bunch of ideas related UI but it's really something else when I try to implement with lua.
I can draw what I imagine on photoshop but that's only I can do lol

rancid rampart
#

I apologize in advance for this English, I'm in a translator.

tacit pebble
rancid rampart
#

hint, β€œMyExampleMod” is the name of what? I can write anything here yes, what will it affect?
Zomboid/
└── Workshop/
└── MyExampleMod/
β”œβ”€β”€ Contents/
β”‚ └── mods/
β”‚ └── ...
β”œβ”€β”€ workshop.txt
└── preview.png
I thought it was the name of a mod, but mod names should be in β€œMyMod1”, β€œMyMod2” etc? like in this example?
Contents/
└── mods/
β”œβ”€β”€ MyMod1/
β”‚ β”œβ”€β”€ common/ <--- common folder is mandatory, even if empty !
β”‚ β”‚ └── media/
β”‚ β”‚ └── ...
β”‚ β”œβ”€β”€ 42/
β”‚ β”‚ β”œβ”€β”€ media/
β”‚ β”‚ β”‚ └── ...
β”‚ β”‚ β”œβ”€β”€ mod.info
β”‚ β”‚ └── poster.png
β”‚ └── ...
└── MyMod2/ <--- for extra mods, simply add a new mod folder
└── ...

tacit pebble
# rancid rampart hint, β€œMyExampleMod” is the name of what? I can write anything here yes, what wi...

You can write anything in MyExampleMod. this will be exchanged to WorkshopID when player downloads.
However, you will need a unique name for MyMod1 / MyMod2. I usually set this same as ModID. (Idk what will be happened when folder name is conflicted. but that's how I learned at first.)

Also name of both folders do not effect anything visually.

  • if you want to change title of workshop then go to workshop.txt
  • if you want to change title in mod list then go to mod.info
bronze yoke
#

if the folder name conflicts nothing will happen

#

but it's weird for them to not match mod id and those do need to be unique

rancid rampart
#

So it is better to name the MyExampleMod folder as MyMod1 ?

#

and it won't be a big deal because it will change itself when you load it into Steam Workshop

#

yes? xd

#

And how do you create a mod.info folder? Copy it from the original mod I'm translating?

tacit pebble
hidden compass
#

Does anyone know how to output a single SingleTIlesheet.png in TileZed's PackViewer?
I've tried everything, but without any particular error, I end up with nothing output.

coral root
#

I need help converting item data in player inv. to display information on the web

bright fog
silent zealot
silent zealot
ancient grail
silent zealot
#

Doing all my work for me

#

πŸ˜‚

ancient grail
silent zealot
#

Changing a sandbox variabel and having it take effect rigth away (for the variables that can take effect right away)

ancient grail
#

not sure what toLua does but sendToServer is the thing responsible fgor syncing it i believe

bright fog
#

Unless you mean doing it server side

ancient grail
#

but for everyon else nope

silent zealot
#

It didn't when I changed a variable using lua to change night brightness.

ancient grail
bright fog
#

I can assure if the client changes the value he directly has the new one

silent zealot
#

But does the Java know that?

bright fog
silent zealot
#

Adjusting the night brightness sandbox setting was the only way I could work out to adjust light levels at night.

sly monolith
silent zealot
#

I haven't tried changing those, but I did figure out how to tell if the power is on and if a square is inside and if a square is in range of a generator.

#

You might think "surely there is one method call that tells if a tile has power?" but you'd be wrong... you need to piece together if there should be power from multiple bits of information.

#

Which is stupid, but shrugs

sly monolith
frank elbow
silent zealot
#

So it's really toJava()

silent zealot
#

Luckily Zombies are not easily embarrassed.

sly monolith
silent zealot
#

Physics enabled attachments so the handle is linked to the hand bone and the case rotates freely based on movement.

#

Only slightly beyond the capabilities of the zomboid engine.

sly monolith
#

well that's how it is done with the regular briefcase, the handle is linked to the hand bone, but the rest of the briefcase is affected by the prop

#

but zombie doesn't use a prop so that's an issue πŸ˜„

silent zealot
#

Why are chickens 15kg and deer 6kg? How the $#%@#^ did someone come up with those numbers, even as placeholder values?

#

...now a cranky rooster just scratched me. On the head.

quiet glacier
#

Hello all! Has anyone replaced the music tracks in Zomboid? I'm curious about the do's and don't's when replacing the tracks in Zomboid with your own.

silent zealot
#

Glad I have the power of debug mode and mods on my side or this would take forever.

silent zealot
#

You might get realy lucky and just be able to put files with the same name and encoding in the same path in your mod.

#

$#^@#^$ rooster had another go at me and now they are going to die.

quiet glacier
silent zealot
#

Can you find any files with the names of the tracks in them? If you give me a filename I'll do a quick check

quiet glacier
#

I wouldn't be able to check at the moment, I'm not home at the moment, sorry. I'll definitely check later.

slim swan
#

what code can remove a Specific option of default inventorycontexmenu

silent zealot
#

From my notes:

#

Bad copy paste sorry

#

What you want is ISContextMenu:removeOptionByName(optName)

#

So if context is the context menu object, context:removeOptionByName("Option I don't Like")

#

You can add a function to the OnFillInventoryObjectContextMenu to do that, since any function you add will run after all teh vanilal ones have put stuff in the menu so you can use whatever logic you want to choose things by name.

#

Or a postfix to whatever function added the option... depending on what exactly you need to do.

tranquil kindle
slim swan
#

try to remove grab all and make a new one

silent zealot
#

You want a custom right menu?

#

It's very easy to add an extra right click entry to inevntory items or worlditems.

slim swan
#

easy to add but not easy to remove

#

i built that panel , but if click grab all ,always left one item

#

but if i add a custom grab all option, it work fine

silent zealot
#

So the real issue is Grab All does not work?

#

This is for a custom inventory mod?

slim swan
#

it work but,not grab all .it grab all -1

#

is a inventoryitem manager mod

silent zealot
#

If you look at lua\client\ISUI\ISContextMenu.lua you'll see all the stuff the context menu object can do

#

There are a few different add options so you can find where the option you want to remove it, remove it, then put a replacment in the same place.

#

Do you know why the vanilla grab all does not work?

#

Might be easier to make that work that play with a custom function.

slim swan
#

try lots of method but didn't figure why vanilla grab all does not work ,try the track the count number ,its correct

sly monolith
sly monolith
#

btw how can you define which part of the body gets protection from the worn item

sly monolith
grizzled fulcrum
#

Does anyone know if there's any util functions for searching for a specific tile close to the player? I know I could just do this with 2 for loops (excluding Z axis) but I was kinda hoping there would be a java function to offload some of the cost

sly monolith
#

i don't really get how those body locations work, like where is it defined where the body location actually is on the player

#

like i'd want to do something like this BloodLocation = LeftArm;RightArm, but stating more than 1 location is causing errors, and i don't want this cloth piece to be on the hands but rather on arms, but there's no 'both arms' body location, i could add my own location but how do i define where it actually is on the body, does that even matter?

grizzled fulcrum
#

Maybe you could use one of these

#

Oh I see, you dont want it on the hands ;-;

#

idk much about bodylocations so I can't say anything about adding custom ones

umbral raptor
#

You might need to use a : instead of ; but unlikely to work. I think you need an item for each arm variant

silent zealot
#

Here is a list of every BloodLocation used in Vanilla:

#

Apron,
Bag,
ForeArm_L,
ForeArm_R,
FullHelmet,
Groin,
Hand_L,
Hand_R,
Hands,
Head,
Jacket,
Jumper,
JumperNoSleeves,
LongJacket,
LowerLeg_L,
LowerLeg_R,
LowerLegs,
Neck,
Shirt,
ShirtLongSleeves,
ShirtNoSleeves,
Shoes,
ShortsShort,
Trousers,
UpperArm_L,
UpperArm_R,
UpperBody,
UpperLeg_L,
UpperLeg_R,

#

And from the message-of-the-day hidden in the translation files there are a few more that are not used but worked when I tried:
LowerBody,
LowerLegs,
UpperLegs,
LowerArms,
UpperArms

#

So if you want to cover both arms try BloodLocation = UpperArms;LowerArms,

sly monolith
#

there's no UpperArms location tho, only L and R

#

from what you posted

silent zealot
#

see second message

sly monolith
#

oh oh ok

#

can i use this in BodyLocations too? or it's only for blood locations

silent zealot
#

BodyLocations is a seperate list

#

Because of course it is.

sly monolith
#

i just want that damn piece of cloth on upper arms, not hands heh

silent zealot
#

BodyLocations:

AmmoStrap,
AnkleHolster,
Back,
Bandage,
BathRobe,
BellyButton,
Belt,
BeltExtra,
Boilersuit,
Calf_Left,
Calf_Left_Texture,
Calf_Right,
Calf_Right_Texture,
Codpiece,
Codpiece,*/
Cuirass,
Dress,
EarTop,
Ears,
Elbow_Left,
Elbow_Right,
Eyes,
FannyPackBack,
FannyPackFront,
ForeArm_Left,
ForeArm_Right,
FullHat,
FullSuit,
FullSuitHead,
FullTop,
Gorget,
Hands,
HandsLeft,
HandsRight,
Hat,
Jacket,
JacketHat,
JacketHat_Bulky,
JacketSuit,
Jacket_Bulky,
Jacket_Down,
Jersey,
Knee_Left,
Knee_Right,
LeftArm,
LeftEye,
LeftWrist,
Left_MiddleFinger,
Left_RingFinger,
Legs1,
LongDress,
LongSkirt,
MakeUp_Eyes,
MakeUp_EyesShadow,
MakeUp_FullFace,
MakeUp_Lips,
Mask,
MaskEyes,
MaskFull,
Neck,
Necklace,
Necklace_Long,
Nose,
Pants,
PantsExtra,
RightArm,
RightEye,
RightWrist,
Right_MiddleFinger,
Right_RingFinger,
SCBA,
SCBAnotank,
Scarf,
Shirt,
Shoes,
ShortPants,
ShortSleeveShirt,
ShortsShort,
ShoulderHolster,
ShoulderpadLeft,
ShoulderpadRight,
Skirt,
Socks,
SportShoulderpad,
SportShoulderpadOnTop,
Sweater,
SweaterHat,
Tail,
TankTop,
Thigh_Left,
Thigh_Right,
Torso1Legs1,
TorsoExtra,
TorsoExtraVest,
TorsoExtraVestBullet,
Tshirt,
Underwear,
UnderwearBottom,
UnderwearExtra1,
UnderwearExtra2,
UnderwearInner,
UnderwearTop,
VestTexture,
Webbing,
Wound,
ZedDmg,

sly monolith
#

yea and there's no both arms body location here πŸ˜„

silent zealot
#

BloodLocation is "what bits are protected" while BodyLocation is "which slot does it take up when equipped"

sly monolith
#

i can't wrap my head around how all this actually works, shit's defined in 100 places heh

silent zealot
#

So you could make an "amulet of protection" that equips in the neck BodyLocation but has the BloodLocation set to cover the entire body.

sly monolith
#

right, so i can just make my own body location called whatever, but use the bloodlocation for the upperarms, and that's it right

silent zealot
#

And just for fun, a lot of mods add extra body locations as a way of stopping equipmen conflicts.

#

yes, make you own bodyLocation == fine

sly monolith
#

kk great, thanks !

silent zealot
#

Do anything slightly unexpected with BloodLocation and the parser will throw an utter fit and just not load stuff at random and ruin your save.

sly monolith
#

yeah i already ruined a test save with this πŸ˜„

#

it even threw me ouf of the game back to the menu when i spawned a zombie in my outfit

silent zealot
#

I cant remember the lua for making a new body location, but it's easy to do if you just copy a mod like Canteen Slot or Wristwatches & forearm armor etc.

sly monolith
#

yea i have it done already thx

#

there's 1 thing i really don't like about b42, they removed the "add recipe materials" from the debug, so you have to manually add everything in your recipe to craft it

#

is it possible to hide what the output is on a crafted item?

tranquil kindle
#

In b41 there was hide result or remove result, that way it didn't show anything, but then items were given by lua. At least I think how it worked when I seen something like this

sly monolith
small topaz
tranquil kindle
oblique estuary
#

Nevermind, I just saw the list you sent earlier for bloodlocations, I should have scrolled a little more for it

vast pier
#

That way you can also randomize the output

sly monolith
#

@tranquil kindle @vast pier aight thanks i'll look into that

ancient grail
bronze yoke
#

no java object is modified at all

grizzled fulcrum
#

^

#

doesnt it basically just update the SandboxVars global in lua with the java-side stuff?

bronze yoke
#

yeah, that's right

plush wraith
#

Where do mods save their options that are set in B42? Not sandbox options but the new mod options

bronze yoke
#

Zomboid/Lua/ModOptions.ini

bright fog
#

Perhaps I should

finite gazelle
#

hi, I would like to know if I could have a little help on a part of coding that I absolutely do not understand, let me explain I redid the mod which allows the radio to be connected to electricity but I cannot change the fact that the radios already generated on the map continue to use the batteries. I would like to ensure that my mod is compatible in the middle of save and not just on a new one. All the scripts I have tested so far do not work. What basis should I start with to create my script in LUA?

finite gazelle
#

thx a lot will look to that

vast pier
silent zealot
#

I'm trying to find a good spot to make the change that doesn't need you to open and close the radio UI several times to take effect.

finite gazelle
silent zealot
#

How are you doing the check?

jade vine
#

trying to make a mod that focus on player effects and agriculture, any pieces of media that you guys think could help me understand better how to achieve my goals?

plush wraith
jade vine
#

asking me to look at code its the same thing as asking a medieval knight to play minecraft

#

I'm willing to learn tho

#

I'm a bit familiarized with lua

#

trying to learn more about it and such

neon cargo
plush wraith
#

Mods that add in recipes and items don't contain much lua if at all, maybe some distribution logic so it may not be as bad as you're expecting

silent zealot
jade vine
#

making a weed mod 😦

plush wraith
#

haha theres a few of those to reference

bronze yoke
#

is anyone in this chat not making a weed mod??

silent zealot
#

And Start Game on Fire

jade vine
silent zealot
#

hahahahaha

jade vine
#

So i have plenty ideas to go around

silent zealot
#

That mod is literally one line to change one value but I love how much of a reaction it got.

jade vine
#

I'm trying to make a mod that has a more realistic and useful approach to weed

#

and for that to happen i want to have multiple strains

#

some with high cbd some with high thc

#

thinking about integrating some traits into it

silent zealot
#

Different strains just means doing the same thingmultiple times with some slight changes.

plush wraith
#

There were a few mods that did traits and other things in b41 but i dont believe they are updated yet

silent zealot
#

The alternative is you have to build an entire framework to add cbd/thc instead of just saying "this type does this, this type does thie, this type does this"

#

I'd break it down into the seperate things you want to add.

plush wraith
neon cargo
jade vine
#

ill post anything

plush wraith
#

More Smokes for B41 had traits and moodles for weed, it was pretty well done from what I remember

neon cargo
bright fog
neon cargo
#

I can only rgb if I have two strings to input?

silent zealot
#

"" is a string.

#

Also, what is that file you're diffing?

neon cargo
#

That's the B42.2 -> B42.3 changes for the API

bright fog
silent zealot
#

I didn't know B42.3 was out

bright fog
#

I mean

silent zealot
#

starts backups

#

I got up, went straight into a work meeting that is still happening, and havn't caught up on any news yet

#

But I'm on discord whiel doing this stupid "morning standup" that goes for an hour.

neon cargo
#

Yeah I just finished doing a massive refactor for work and now I'm deciding whether I want to work on my mod or just play

bright fog
#

It just released tbf

neon cargo
#

Is there a way to integrate the library files into my IDE so I can use stuff like autocomplete?

winter bolt
#

i woke up to 15 comments telling me the update broke my mod lol

silent zealot
#

hahahahahaa

#

always fun

bronze yoke
#

update got approved very quickly this time so the addon manager should already be up to date

silent zealot
#
  • Updated Make Bowl of Oatmeal and Cereal recipes to require fluid in the bowl instead of a separate container, reduced amount from 0.4L to 0.3L as that's how much a bowl holds.
  • Updated Create Brain Tan recipe to require water in the bowl, reduced amount from 0.5L to 0.3L since that's how much a bowl holds.

Finally, crafting can use an appropriate container with water instead of needing a sperate container

#

Milk is now 100% less stressful.
Good to know.

silent zealot
#

I forgot how ugly the default skin is. Thank you Spongie for saving us from that!

ancient grail
silent zealot
#

Weird, but I guess when you pay money for a mod you can ask for that.

thorn abyss
#

is this gonna fry my cpu?

silent zealot
#

Depends how many zombies there are I guess.

thorn abyss
#

it should only update the ones being active right?

#

as in active cells

bronze yoke
#

next() does not exist in kahlua

silent zealot
#

Yes, zombies outside the active area are not getting updated every tick

thorn abyss
#

grr

bronze yoke
#

use a pairs loop, set a flag and break immediately or use numeric indices so you can check the length of the table

#

that probably wouldn't be cheaper than just not checking if the table is empty though

thorn abyss
#

I'll just remove that check then and thank you <3

#

wait should I use LuaEventManager instead of handling everything on my own?

#

im so confused

bronze yoke
#

that woudl be easier

#

doing it yourself in lua can be faster though i'm not sure if this approach is

#

pairs loops are kinda expensive

bright fog
#

What's your goal with that exactly ?

dusky thistle
# thorn abyss is this gonna fry my cpu?

Use OnAIStateChange, and do an instanceof against the states for PathFindState2 and WalkToward* to determine when a zombie first begins moving, and ends moving... That is, assuming, just an enter/exit movement state is enough to satisfy your needs, and you don't need to constantly call the callbacks while the zombie is moving. Will take a bit of tinkering to get it to work the way you want, as, you'll need to monitor Climb* states, and switches from WalkTowardState to PathFindState2.

If you absolutely need to call those callbacks constantly, due to the way OnZombieUpdate behaves, you may want to use a delay/timer/cooldown so the callbacks aren't called more often than they need to be.

fathom dust
#

Is there a way to draw lines etc from lua? LineDrawer does not seem to be available.

pseudo sleet
#

@winter bolt hey man i've been following your custom voice mod guide and i did it all by instructions and it just doesnt play any lines for some reason. are there any common causes or issues that can make this problem

winter bolt
#

what does the script and the voicestyles.xml look like?>

pseudo sleet
#

in what sense

#

do you want me to send them over? or to post a screenshot

winter bolt
#

screenshot

#

actually i guess just send them

pseudo sleet
winter bolt
#

oh you didnt rename the sounds

pseudo sleet
#

wdym

winter bolt
#

you have to replace all "VoiceMale" with "VoiceJohnCreasman"

pseudo sleet
#

i may be stupid

#

let me see if this works

winter bolt
pseudo sleet
#

way ahead of you jej

pseudo sleet
winter bolt
pseudo sleet
winter bolt
#

that looks like it should work

#

can you send the files?

pseudo sleet
#

yeah

winter bolt
#

yeah i dont see any issues here

pseudo sleet
#

wtf

winter bolt
#

what do the folders look like?

pseudo sleet
dusky thistle
pseudo sleet
#

lua, shared, translate, en, that one file

#

scripts leads directly to the other file

#

sound, voice, johncreasman, all the voicelines

#

voicestyles leads directly to voicestyles

#

i did it like you wrote

winter bolt
#

oh

#

youre right its missing the comma

#

lmfao

#

if you search replace "ogg" with "ogg," it should work

pseudo sleet
#

holy hell

pseudo sleet
#

thank you guys

#

i can finally play road of the dead 3

thorn abyss
dusky thistle
#

OnZombieUpdate won't help you then, either.

#

It's somewhat .. erratic, depending on what the zombie is up to.

#

And, assuming any other mod messes with the zombie position, it could take seconds before your mod would become aware of it while waiting for the OnZombieUpdate.

#

If you need accurate position tracking, you'd have to combine OnZombieUpdate with a custom rolled solution using OnTick that grabs the current position of a handful of zombies per frame. It's important to take note of the handful.

#

You could attempt using a metatable override for setX, setY, etc, to just try and catch mods messing with positions, but, I've had mixed success personally with the metatables overrides.

silent zealot
#

You could also just say "not compatible with <mod that messes with zombie positions>"

#

Depending on if that is likely to be a rare thing where people want both mods or something that will happen often enough you do do need to try and handle it.

thorn abyss
#

wait are some events client side only?

whole bay
#

WARN : Lua , 1739328819314> LuaManager$GlobalObject.require> require("client.MixVaultVHS") failed

anyone able to help with this? i can send the requesting filesif not could be a simple folder structure idk

bronze yoke
#

require paths should be separated with /s and shouldn't include client/shared/server

whole bay
#

local MixVaultVHS = require("client.MixVaultVHS") so i need to remove client for media/lua?

bronze yoke
#

if your file is media/lua/client/MixVaultVHS you should do require("MixVaultVHS")

whole bay
#

ahhh okay ill give that a shot thanks

#

hmm still failed is it an issue the file requesting it is coming from

media/lua/shared/MixVaultVHS_system

tacit pebble
#

How do you use require for the file?

bronze yoke
#

you can't require client from shared

#

folders load shared -> client -> server, require cannot jump ahead in this order

#

there may be an issue with your design if you need client-only code in a non-client-only file

whole bay
#

i want it to work in a server

dusky thistle
#

It's worth mentioning (I don't think it's changed), but, where you actually put your files doesn't matter in regards to shared/client/server, except for load order and requires. Files in server aren't limited to only be used by the server, for example. You specifically need to make sure the code only executes on the server, inside the code, if that's what you're after.

But, albion is right here. If you're trying to access something that's supposed to be client code, outside client code, you're taking the wrong approach. The code you're trying to reference should probably be moved to shared.

whole bay
#

still says require failed ;-; its a small file if someone doesnt mind checking to see where i went wrong

#

its a 1 item mod

bronze yoke
dusky thistle
bronze yoke
#

yeah, i recommend still strictly sticking to as if they do work that way, it's just good design

whole bay
#

so if i want this to work for server i need to but same files from client to server?

#

Exception thrown java.lang.RuntimeException: attempted index: new of non-table: null at KahluaThread.tableget line:1689. i get this now no require fail

dusky thistle
whole bay
#

thats the file being requested

dusky thistle
#

MixVaultVHS_System.lua is missing the require.

bronze yoke
#

MixVaultVHS_System does not require MixVaultVHS, but tries to use it

pseudo sleet
#

hey guys do you know how i can upload a mod to the workshop

dusky thistle
#

It's the workshop option from the main menu in-game

pseudo sleet
#

oh so you do need to put it in there

#

mb

whole bay
pseudo sleet
whole bay
#

i updated the require

pseudo sleet
#

horrific

dusky thistle
pseudo sleet
#

ohhhhhh

#

lemme try and pull that off

pseudo sleet
dusky thistle
#

Loaded regardless of game version, basically the 'shared' folder in regards to media/lua

#

Of course, ignored in B41. It's a B42 thing onwards.

bronze yoke
#

generally it's wise to put any assets in common

pseudo sleet
#

oh isnt that bad

#

as in

#

my voice mod has assets in its' mod folder

#

should i transfer them to common?

dusky thistle
#

It's not strictly necessary to use common, but, if you do end up having to make fixes for specific versions, meaning multiple folders named like 42.0 (42.5, 43, 44...), you'd need to copy the assets again to each one

#

So, common is a great place for things that generally don't break from updates: images, sounds, etc

pseudo sleet
#

noted

#

thanks

pseudo sleet
#

what the hell

dusky thistle
#

Did you restart after making the changes?

#

If so, check your console.txt, could be a hint there.

#

Wait. I just looked at that screenshot.

#

You want to use C:\users\<username>\Zomboid\Workshop (is that the Windows path?)

tacit pebble
#

you have to go here

dusky thistle
#

Yea, that. The Workshop folder in the game folder is used by the server.

#

Although it also uses the Zomboid/Workshop folder, to make it a little awkward.

ebon dagger
#

If a player can learn any recipes from an item with this system, right-clicking on the item will provide a right-click option with a light bulb option to "Research Craft".

Throws away an entire mod he was working on that used this as a main feature

lol

lethal dawn
#

and as it turned out, just missing a comma

dusky thistle
lethal dawn
#

eh, I'm not that talented

#

can't quite justify it yet

dusky thistle
#

Arguably, all the more reason imo. It screams the errors/warnings at you from the get go, so, y'know, there's no real guesswork.

bronze yoke
#

there's nothing to justify, we use the software we do because it makes things the easiest

dusky thistle
#

I use Doom Emacs, but, that one, definitely is not one you should use. That's one you could argue you need to justify.

#

Run VSCode, I think that's what everyone still on Windows replaced NPP/N++ with.

silent zealot
#

VSCode + Umbrella will save you from countless hours of minor issues

#

Also, free and easy to setup.

dusky thistle
#

Gone are the days of coding in assembly in vi/notepad. Long gone.

#

Use an IDE.

pseudo sleet
#

what the hell?

#

it's all here

silent zealot
#

Is preview.png a 256x256 png image?

pseudo sleet
#

yeah

dusky thistle
silent zealot
#

Did you put it there after you started Project Zomboid?

pseudo sleet
#

nope i restarted

silent zealot
#

The game is not great at noticing new files appearing

#

hmm

#

Try using the preview.png from the ModTemplate

#

In case it hates your png for some stupid reason.

tacit pebble
#

I think your png is
preview.png.png

#

since workshop.txt is workshop

silent zealot
#

better than workship.pdf.exe

tacit pebble
#

@pseudo sleet

pseudo sleet
#

there's no way

#

im killing myself its over

#

like 40 minutes of troubleshooting

#

2 iq

#

thank you

#

very veyr much

#

i couldve never figured that out

dusky thistle
velvet ledge
#

I WAS ABLE TO MAKE THE WEBBING VISIBLE WITH BOTH A VEST AND JACKET ON!!!

whole bay
#

imma crash out fr

#

and looks fantastic fishmale

velvet ledge
#

all you have to do, is replace the masksfolders on all 3 alice suspenders ClothingItems files with this in the code

scarlet shore
#

Does anyone know how to programmatically obtain all filenames in one of my mod's folders?

tacit pebble
#

I heard there's a bug when player have thirst, and they filled a bottle with water, then calories are nil
I'm figuring out why it's happened, and i just found this code

    local hookAutoDrink
    hookAutoDrink = function(character)
        if not ISTimedActionQueue.hasActionType(character, "ISTransferWaterAction") then
            Hook.AutoDrink.Remove(hookAutoDrink)
        end
    end
    if getCore():getOptionAutoDrink() then
        Hook.AutoDrink.Add(hookAutoDrink)
    end

any thoughts about this code? why this code removes/adds itself instead of Hook.AutoDrink.Remove(autoDrink) or local hookAutoDrink = character.autoDrink?

#

I'm not sure I think it's weird because of lack of my knowledge or it's really a weird thing.

whole bay
#

both MixVaultVHS_Items and MixVaultVHS_System call for MixVaultVHS

#

well require

#

actually i heard before i can require from shared to client does system need to move?

dusky thistle
# tacit pebble I heard there's a bug when player have thirst, and they filled a bottle with wat...

autoDrink belongs to IsoGameCharacter, which is called by updateThirst, which is called by calculateStats. That's how the auto drinking functions.

Per the comment just above that section of code, it stops the character from auto drinking water during transfer:
autoDrink attempts to trigger the function passed into Hook.AutoDrink.Add, and, if it does, it doesn't drink. The function then removes itself after the transfer is complete, so auto drinking can operate as normal.

tacit pebble
dusky thistle
#

They don't remove the drinking function. The existence of that function prevents autoDrink from happening.. sec

tacit pebble
dusky thistle
tacit pebble
#

oh so just disturbing the action instead disabling it?

bronze yoke
#

hooks basically run instead of some vanilla code, if there's a hook added then the vanilla code won't run

#

they're barely used and the ones that do exist are basically just not useful so they're not well known

visual creek
#

Hello, which of these commands is responsible for the frequency of item drop renewal on a dedicated server?
LootRespawn = 1
HoursForLootRespawn=576

tacit pebble
#

okay so let me sort.

    local hookAutoDrink
    if getCore():getOptionAutoDrink() then
        Hook.AutoDrink.Add(hookAutoDrink)
    end
  • so they override autoDrink() by this(with empty code) before transferring
    function hookAutoDrink(character)
        if not ISTimedActionQueue.hasActionType(character, "ISTransferWaterAction") then
            Hook.AutoDrink.Remove(hookAutoDrink)
        end
    end
  • after overrode, they removes empty code by this (so bring autoDrink() back)

did I understand correctly? I didn't know hook will override the vanilla code instead adding

dusky thistle
#

Basically, yes.

#

Not that autoDrink is ever really overridden

#

Just a specific part of it is .. intercepted.

tacit pebble
#

yeah i think this part

#

thanks to both πŸ™‚ I leveled up 🀣

dusky thistle
#

Although, you did get that backwards: That function is added to the hook when transfer is happening, and removed when it's finished.

#

The new function is responsible for cleaning up.

tacit pebble
#

oh yeah they defined earlier. i was talking with what i edited

dusky thistle
#

I mean, it's really just a round about 'while' loop.

#

You could summarise it as while [ transferring water ]: do nothing

slim swan
#

how to refresh texture cache without close the game

dusky thistle
#

If anyone wants to test that to make a mod to fix it, go ahead.

#

Override that file and add the Calories properties to those three fluids.

tacit pebble
#

but wasn't it okay until 42.2?

dusky thistle
#

Tap water was still using the B41 water system before 42.3.

finite gazelle
# silent zealot You need to change the deviceData for the radio; if you look in the RadioAction....

local function UpdateRadiosPower()
for i=0, getWorld():getCell():getObjectList():size()-1 do
local object = getWorld():getCell():getObjectList():get(i)
if object and object:getDeviceData() then
local deviceData = object:getDeviceData()
deviceData:setHasBattery(false)
deviceData:setUseBattery(false)
if not object:getSquare():isPowerOn() then
deviceData:setIsTurnedOn(false)
end
end
end
end

Events.OnLoadMapZones.Add(UpdateRadiosPower)

I got something Like that dont know if its shoulb be in this format

tacit pebble
#

I've never used auto-drink ever, I always drank a bottle of water manually. or only auto-drink function is broken with calories?

#

odd..

#

like- when calories is nil, manual drinking does not pass nil but auto drink passes nil?

#

sorry if i'm bothering you :p i always have bunch of curiosity when encountered something like this.

bronze yoke
#

they rewrote a lot of the code to do with actually drinking fluids and i guess this slipped through

dusky thistle
bronze yoke
#

no, the taps do still use that moddata

#

see IsoObject#setReserveWaterAmount and its reference in IsoObject#setWaterAmount

dusky thistle
#

Oh I see, it's in a weird hybrid state.

silent zealot
#

The way I'm approaching it is to only make a change when the player uses a radio, and to swap back and forth between plugged in and powered based on the situation

#

Which is more complicated than I originally thought because a lot of the radios work both when placed and when held in the hand

dusky thistle
#

Regardless, the items being filled are FluidContainers, and Water has no calories property ._.'

silent zealot
#

If it lacks one, does that cause issues or just get treated like zero?

dusky thistle
#

Nope, it should be fine.

#

Calories is defaulted in the properties to 0.

tacit pebble
silent zealot
#

I saw they changed autodrink to use the same function as drinking, which would fix the bug about autodrink curing thirst far more efficiently

#

More importantly it should allow a mod to autodrink whiskey.

bright fog
#

I think the autodrink feature should be removed tbf

dusky thistle
#

Is it nil, or NaN? It'd have to be NaN, surely, it's a float.

bright fog
bright fog
#

Tho not sure I understood your question right

finite gazelle
dusky thistle
#

Okay, what is it people are seeing that's making this visible?

tacit pebble
#
autoDrink()

float var2 = this.stats.thirst * 2.0F;
float var3 = Math.min(var1.getFluidContainer().getAmount(), var2);
float var4 = var3 / var1.getFluidContainer().getAmount();
((IsoPlayer)this).DrinkFluid(var1, var4, false);
DrinkFluid(InventoryItem var1, float var2, boolean var3)

var6.setCalories(var6.getCalories() + var4.getProperties().getCalories() * var2);

what will be happened if we do * nil for * var2

bronze yoke
#

NaN

dusky thistle
#

.. is it a division by zero? Wouldn't java throw an error?

bronze yoke
#

no, it'd result in NaN

dusky thistle
#

It's a division by zero

bronze yoke
#

NaN is returned whenever floating point operations are invalid

silent zealot
tacit pebble
# bronze yoke NaN

So... if they drink empty bottle which have no fluid types then it will be Nan?

dusky thistle
#

Maybe, hold on, does autodrink check?

#

I'm too sick with COVID to be fooling around with this

tacit pebble
#

oh hard to explain in English but anyways the puzzle fits together.

silent zealot
#

Like I mentioned, I'm going for a very different approach so I don't need to hit each existing radio... The npcs left them on battery because they used the power cords to tie generator manuals to their sledgehammers before throwing them in the river. Only you, the player, has the power to plug a radio in now.

bronze yoke
#

i'm not actually sure if this should ever be null

#

it looks like it defaults to zero if not set

silent zealot
#

So I can trigger the code based on the player using a radio.

#

Which works great, except for when a radio breaks so none is the buttons work anymore which I'm trying to figure out the cause of.

tacit pebble
#

so basically if var1.getFluidContainer().getAmount(); is nil or 0 then it will be Nan
and nan goes to DrinkFluid()

bronze yoke
#

i tried throwing some of the stuff i've been saying into a java compiler and it doesn't actually result in NaN

dusky thistle
#

Yea, it checks in getWaterSource for empty

bronze yoke
#

the result of dividing by 0 is Infinity instead

dusky thistle
#

So it can't be division by zero

tacit pebble
dusky thistle
#

Wait, what, LOL

silent zealot
#

Imagine checking the nutritional information on your bottle of drink and seeing Calories per Serving: NaN

dusky thistle
#

Java versions ftw?

bronze yoke
#

yeah probably language version specific, i did look up what i was saying and seemed correct before asserting it so potentially there are three different behaviours that can happen 😭

finite gazelle
true nova
#

north facing elevators are a go. you wouldn't climb 26 floors would you?

tacit pebble
#

my friend said

// if var1.getFluidContainer().getAmount() is nan or 0 then
float var3 = math.min(var1.getFluidContainer().getAmount(), 1) // -> nan or 0
float var4 = var3 / var1.getFluidContainer().getAmount() // -> always nan
.
.
.

var6.setCalories(var6.getCalories() + var4.getProperties().getCalories() * nan); // -> nan is here because var4 was nan
// and will run without any error thrown
silent rose
#

i'm a beginner modder, im trying to make these bank safes into containers. But in tilezed I can't find the safes or ATMs in location_business_bank_01 it's missing these 6 tiles. Where can I find them? All are in the brush tool though

bronze yoke
true nova
tacit pebble
true nova
# silent rose i'm a beginner modder, im trying to make these bank safes into containers. But i...

something like this should do that tile ```lua
local vals = IsoWorld.PropertyValueMap:get("container") or ArrayList.new()
local vals2 = IsoWorld.PropertyValueMap:get("ContainerCapacity") or ArrayList.new()
if not vals:contains("Safe") then vals2:add("Safe") end
for i = 1,20 do
local val = tostring(i)
if not vals2:contains(val) then vals2:add(val) end
end

Events.OnLoadedTileDefinitions.Add(function(manager)
local sprites = {
"Location_business_bank_01_69",
}

for _, sprite in ipairs(sprites) do
    local props = manager:getSprite(sprite):getProperties();
    props:Set(IsoFlagType.container);
    props:Set("ContainerCapacity", "20", false);
    props:Set("container", "Safe", false);
    props:CreateKeySet();
end

end)

silent zealot
# finite gazelle You mean its will update when a player place it ? Or maybe i can try to make a ...

What I'm doing (and this isn't the only way, and probably isn't the best way) is using the Radio GUI as the trigger - the first try was to add code to the function behind the on/off button. Turns out the function behind that gets called 4 times every time you press teh button, and by that time the whole interface is already rendered and doesn't want to change. I'm working to change that to happen when the radio gui first reads in the radio data instead; I sneak in just before it reads the data and change the properties.

#

So I sneak my code in here:

#

And the code currently looks like this:

dusky thistle
#

Found the division by zero.

#

getWaterSource allows empty FluidContainers to pass through if they're being filled

#

ISTakeWaterAction flags the item as being filled, and .. tada. autoDrink can now use an empty FluidContainer.

whole bay
#

anyone got any example folder structures it has to be that causing my require error

dusky thistle
#

If anyone wants to verify that, please do.

tacit pebble
#

I have to rest i guess

finite gazelle
silent zealot
#

That is definitely a simpler way, make a withPlug version of each radio and then one recipe to convert to plug/one recipe to convert back, with input mapping for the different radio types.

finite gazelle
silent zealot
#

I'll get the radiomenu/lua thing to work one day, to give a different option for pluged in radios

finite gazelle
ancient grail
#

adding world context menu for b42 is different now? i cant seem to add mine

whole bay
#

could it be my tape line being wrong

#

not vhs

true nova
ancient grail
whole bay
#

function MixVaultVHS:addTape(tape)
table.insert(self.tapes, tape)
end

would this not work because tapes should be Base.VHS

#

tapes comes up as nil

whole bay
#

so i got it to load i overlooked it simply had a unneccesary file now ingame trying to use item list to spawn it in debug i get a error and item lists shows 0 items any ideas?

ERROR: General , 1739358762036> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: missing argument #1 to 'lower' at KahluaUtil.getArg line:380. ERROR: General , 1739358762036> DebugLogStream.printException> Stack trace: java.lang.RuntimeException: missing argument #1 to 'lower'

severe tundra
#

Hey there smart people,I have a question with the new animals in b42 can you make a dog?

bright fog
slim swan
#

What type of item is a backpack in the code?

#

Inventory containers not work for backpack

dusky thistle
#

@tacit pebble Assuming you're N0wh3re:

The best way to do it, in my opinion, would've been to actually use the AutoDrink hook that you were confused about before to prevent autoDrink from triggering during ISTakeWaterAction, and auto cleaning itself up once it was finished.

tacit pebble
ancient grail
dusky thistle
tacit pebble
#

All I did until now is changed my codes from DrinkFluids timedAction to FillWater timedAction to move the start point of storing data.

dusky thistle
#

@drifting ore Oh, you deleted your message. I guess you found your solution before I could reply.
If not, just incase: instanceItem is what you're after to create a new item.

tacit pebble
# dusky thistle And I don't want to start drama here or anything, I just want to point out: when...

im just saying because I'm worried if you didn't mean about what I said:
Please feel free to tell me if you think my behavior is something wrong.(and with my weird English)

I'm not kind of smart person so I sometimes goes wrong 🀣
don't worry about my mood when you think I did something wrong.
also I will tell you if I don't think something right. I guess this is how humans conversation. πŸ˜‰

dusky thistle
dusky thistle
#

Generally speaking: modding is free game, anyone can do anything they want with it all. It basically falls under the 'beerware' licence. The only real exception to this is if someone explicitly states otherwise, or, you're dealing with assets. Legally it's kind of a mess, modding itself sort of falls under 'reverse engineering', and, in some countries in the world, that's illegal (except under very strict terms).

That said, wouldn't you want to be thanked for your contributions, when you're putting in time to help someone out, etc? The golden rule: do unto others as you would have them do unto you.

#

Modders have to deal with quite a bit of abuse (among other things..), so, it's always nice to let 'em know you appreciate them.

thorn abyss
#

is there a way to get a table of zombies in loaded/active chunks on the server side?

sharp plinth
sharp plinth
#

Just updating up for what I showed there

thorn abyss
#
getWorld():getCell():getZombieList()
#

is this how to get all active zombies?

#

I mean the server stats thingy makes use of it so ig?

grizzled fulcrum
#

yea

#

though you dont need the getWorld() call I believe, just getCell():getZombieList()

thorn abyss
#

ty <3

fleet bridge
#

If called on server it's very zombie in the virtual manager

grizzled fulcrum
#

good point I didn't even think about that, @thorn abyss do getWorld www

ancient grail
thorn abyss
#

the client and server stats gathering uses the same approach

ancient grail
fleet bridge
#

How belette does it on random zombies

#

Syncing zombie states, or health

ancient grail
#

not sure what that does but seems like a good way to sync stuff cuz ive been doing it by ping pong ive always wanted to just do it server side but didnt know if it was possible an was too lazy to test back then

#

can i do behavior commands from server using onzombieupdate and it will sync?

fleet bridge
#

A few modders use persistent id for sync of special zombies

ancient grail
#

ive got my own way of doing it and i may have figured out another way

#

2 ways actually
1 is the walkspeed custom walk speed , since that syncs
2 different outfit but same appearance sorta like a boolean

fleet bridge
#

Onzombieupdate is client side only afaik

ancient grail
fleet bridge
#

You just want to use ontick or something from server side. Can get really heavy though

vast pier
#

Is there a zombie version of climbThroughWindow that I can force them to use?
Really don't want psychic powered zombies going around busting windows for no reason
Is there maybe a way to check if the zombie is actively tracking a player's position?
having it only activate when directly involving a player, that would cut down on broken windows
Or even check if a player is in front of them and close by
I think it would be a nice touch if they just banged on your window like normal but if you got close to the window they bust through to try to get you

grizzled fulcrum
grizzled fulcrum
#

I am confused if you're supposed to use it or not, I was under the assumption that getCell():getZombieList() would give the same result

wide grove
#

i've looked around in the channel to see if anyone asked the same questions as me, and it seems like they have but have never gotten a solid answer, is it possible to code my own stories into the game? like the randomized survivor stories you can find in buildings, like the skeleton psycho or the dead drunk story?

thorn abyss
#

im guessing its just a shorthand for getWorld():getCell()

#

is there a way to show fps or frametime in debug mode?

grizzled fulcrum
grizzled fulcrum
thorn abyss
#

thank you

bright fog
bright fog
bright fog
#

With pID not all zombies will share persistent data

fleet bridge
bright fog
#

Non visible ones tick only every 2 ticks or so, and also zombies that weren't seen yet are not set visually

thorn abyss
#

I hope one day we get access to the CombatManager or AnimationPlayer

severe tundra
#

Welp moving on I guess sadly but does anyone know how to make a custom trait I have looked and I can’t find a super dexterous trait that’s not instant but just faster

bronze yoke
#

IsoCell is a singleton, no matter what path you take to get to it you will get the same one

grizzled fulcrum
# bronze yoke it's completely unnecessary

I thought so, but I was just confused. I initially told them to not call it but then lect replied, and I mistakenly thought he was saying you shouldn't do that, so I retracted what I said, and then he provides example code without using getWorld() so I was then confused ww

bronze yoke
#

the IsoCell one is particularly annoying since there's methods all over the place that imply that there's more than one cell and that objects belong to specific cells

#

i haven't checked older versions but it seems undeniable that it wasn't a singleton in the past, there's way way too much code that makes no sense if it was always like this

#

i disapprove of the heavy usage of singletons but i suppose that's just the cpp programmer in me πŸ˜…

grizzled fulcrum
#

Well it sort of makes sense for IsoCell to be one because there is only one that is "owned" by the player, but then if every player loads a cell, you shouldnt have it as a singleton, but like you said the code is definitely wonky with cells

bronze yoke
#

it's weirder than that, the cell can in splitscreen represent multiple separate areas

#

i dislike singletons because they're global state which makes testing difficult, and anything belonging to one is arguably also global state (and in this case that'd be nearly everything in the game)

#

in game development it's admittedly not something that matters much

#

and they do make more sense in java than they do in languages i'm used to using

#

but i try to avoid them as much as possible

grizzled fulcrum
#

I think I've only used singletons a handful of times. Most times you dont even need it.

#

Doesn't this also mean that by design a singleton cant be garbage collected like at all? That wouldn't be the brightest idea for a game imo

bronze yoke
#

that's why it makes the most sense in games actually, because its lifetime is as long as the game anyway

#

singletons in things like libraries are bad because it lives forever even if whatever is linking to the library hasn't used it for ten hours

#

imagine a library your program only uses for initialisation, if it uses any singletons those are in memory until your program closes

#

that'd probably be the case either way in a game which is why it's not as big of a deal

#

the other reason i don't like them even in games is they have really unclear/vague order of creation and destruction (especially if you're using the lazy singleton pattern, it can be initialised literally whenever), but the first one doesn't always matter and the second one literally does not matter in java

grizzled fulcrum
#

good point

fringe bridge
#

Does anyone know if there is a mod that enables you to get bricks out of the in-game tile "Pallet with bricks"?

magic star
#

idk if this is the right place for this question, but is there a .bmp file of the base map located somewhere? I'd like to use some of the vanilla fields in my own map, since I'm having a little trouble making my own look nice

#

and if that's allowed

grizzled fulcrum
#

under the tmx folder lies the vanilla map

gilded hawk
#

Does anyone know if B42.3 broke keybinds? I'm getting a lot of bug reports for ProxInv, but I don't have time to check mysel πŸ˜… πŸ™ˆ

fathom dust
#

is there a way to draw or do effects? The LineDrawer class doesn't seem to be availble from LUA =(

maiden thistle
#

what am i doing wrong because there is no spawn to choose and the building aint even there?

#

ig to explain what im doing i am putting a building in west point and with the mod enabled it seems to do nothing

onyx valve
#

Hi, this question may sound silly but is it possible to add zombies with custom models, animations and properties? Or is that too far away right now?

#

Or can I try with the IsoZombie parameters?

whole bay
#

Any ideas as to how youd go to implement being able to put my vhs box into a tv as its a container property not β€œnormal” like other vhs’ would you modify the tv itself or make a ui to allow adding tapes and make it a β€œnormal” item

#

Its all working now no errors just cant get it to go inside the tv player

vast pier
whole bay
#

Its a VHS mixtape idea u can add vhs tapes to it and itll play all tapes in order or shuffle if toggled useful for music without having to keep swapping tapes

whole bay
vast pier
#

Oh do you have all of that programmed for lua or?

#

I think you would need to add storage to the tv itself

#

and then you would probably need to have it access the box one at a time and play them, detect once it's done playing, and then take it out and put in the next one

#

idk if the tape deck UI has any functionality for removing/adding items the way containers do

maiden thistle
#

so why is the lots 45 25 when i had 38 22 selected?

#

i want 38 22 but its doing something else why?

whole bay
mental copper
#

Is this a correct distribuition file? If so how can I make my item spawn there?

Distributions = Distributions or {};

local distributionTable = {

    toystore = {
        isShop = true,
        counter = {
            procedural = true,
            procList = {
                {name="GigamartToys", min=0, max=99, weightChance=100},
                {name="StoreCounterCleaning", min=0, max=99, forceForTiles="location_shop_accessories_01_0;location_shop_accessories_01_1;location_shop_accessories_01_2;location_shop_accessories_01_3;location_shop_accessories_01_20;location_shop_accessories_01_21;location_shop_accessories_01_22;location_shop_accessories_01_23;fixtures_sinks_01_0;fixtures_sinks_01_1;fixtures_sinks_01_2;fixtures_sinks_01_3;fixtures_sinks_01_4;fixtures_sinks_01_5;fixtures_sinks_01_6;fixtures_sinks_01_7;fixtures_sinks_01_8;fixtures_sinks_01_9;fixtures_sinks_01_10;fixtures_sinks_01_11;fixtures_sinks_01_16;fixtures_sinks_01_17;fixtures_sinks_01_18;fixtures_sinks_01_19"},
                {name="StoreCounterBagsFancy", min=0, max=1, weightChance=100},
            }
        },
        shelves = {
            procedural = true,
            procList = {
                {name="GigamartToys", min=0, max=99},
                {name="StoreShelfCombo", min=0, max=99, forceForTiles="location_shop_generic_01_0;location_shop_generic_01_1"},
            }
        },
    },

    toystorestorage = {
        isShop = true,
        shelves = {
            procedural = true,
            procList = {
                {name="GigamartToys", min=0, max=99},
            }
        },
        crate = {
            procedural = true,
            procList = {
                {name="GigamartToys", min=0, max=99},
            }
        }
    },    
    }

    

table.insert(Distributions, 1, distributionTable);

--for mod compat:
SuburbsDistributions = distributionTable;
dusky thistle
#

@bronze yoke Happen to read Game Programming Patterns in regards to singletons? πŸ˜›

jagged fulcrum
bronze yoke
dusky thistle
#

Could've fooled me, it's basically 1:1, haha.

bronze yoke
#

sounds like an interesting read either way, i may look into it

dusky thistle
#

The singleton issue your seeing these days really comes from working with Unity, and Unity like engines: the .. 'component' design sort of makes people feel like they need singletons for everything, and, everywhere they look, they're told to use 'em. They never consider other options.

#

"Managers" running rampant.

bronze yoke
#

absolutely, i come off very harsh about them, but like most 'bad' design patterns there are situations where they are genuinely useful - just not most of the ones i see

silent zealot
silent zealot
#

Just wait for my AI-powered blockchain mod for Zomboid!

dusky thistle
silent zealot
#

I saw they got rid of add-supported games, I didn't even realize they were becoming a thing on PC. They are already a cancer on mobile.

dusky thistle
#

Happen to remember the Facebook/meta thing about pushing ads in VR? ._.'

#

Free space in in-game virtual billboards, so, why not profit on it >.>

maiden thistle
jagged fulcrum
maiden thistle
#

oh im dumb i get it now

bronze yoke
maiden thistle
#

ok so now why is it not loading it shows up in the mod menu but the building nor the spawn choice is there

dusky thistle
#

... as long as you're not doing cursed cast chains and pointer black magic when you really, really don't need to be.

bronze yoke
#

best practice should be something that you build from your own experiences

jagged fulcrum
dusky thistle
#

I do feel there's things some people definitely need to be taught, but, it really only matters for large projects, just so they could avoid the future refactors and spaghetti code.

maiden thistle
#

oh it changed a lot then from b41 then i didnt know

dusky thistle
#

Learning that by experience kinda sucks, ngl.

jagged fulcrum
bronze yoke
#

yeah that's true, i just stress that you shouldn't stick strictly to 'rules' because most rules aren't entirely true anyway - this will inevitably cause you problems but solving those problems is the only way to really understand the rule

dusky thistle
#

Well, is it that the rules aren't true, or, they're only true from project to project, company to company? πŸ˜‰

whole bay
#

Would it be possible to make tv’s automatically cycle vhs tapes from a container? I understand as suggested before i may need to make a container slot to allow it to be placed in the tv itself

#

Id either need a timer per vhs or maybe a end function is already in vhs for when it finishes

bronze yoke
#

well when it comes to things like project style rules you should strictly stick to them since a project being consistent is the most important thing for maintainability

maiden thistle
dusky thistle
#

That's just it: it's all circumstantial .. even when the circumstance makes absolutely zero sense. "Because the manager likes the code that way."

jagged fulcrum
maiden thistle
#

yuh i see that now

#

i dont know why but my brain is working slow today

whole bay
maiden thistle
#

5am to 1pm so prob not

fathom dust
#

sounds like my sleep schedule

#

i really need 26 hour days

whole bay
jagged trellis
#

If I wanted to make a mod that removes zombies from a specific location, is there an easy layman's tutorial I can look into?

finite gazelle
scarlet shore
# jagged trellis If I wanted to make a mod that removes zombies from a specific location, is ther...

I don't know about a tutorial, but for example, this is my function to get all zombies within a certain distance from a given character into a table:

function GetNearbyZombies(character, radius)
    local zombies = {}
    local x = character:getX()
    local y = character:getY()
    local z = character:getZ()
    for _x = x - radius, x + radius do
        for _y = y - radius, y + radius do
            local sq = getCell():getGridSquare(_x, _y, z);
            if sq then
                for i = sq:getMovingObjects():size(), 1, -1 do
                    local movingObject = sq:getMovingObjects():get(i - 1);
                    if instanceof(movingObject , "IsoZombie") then
                        table.insert(zombies, movingObject)
                    end
                end
            end
        end
    end

    return zombies
end

Then you can do:

local nearZombies = GetNearbyZombies(getSpecificPlayer(0), 15)

for _, zombie in ipairs(nearZombies)
   zombie:removeFromWorld()
end

I have absolutely no idea if removeFromWorld() does what I think it does (I've never tried to remove characters), but if anything, this should hopefully point you in the general direction and someone can correct me.

You can find the LUA documentation in https://projectzomboid.com/modding/index.html , in case you didn't know. "Documentation" might be an overstatement, though.

jagged trellis
#

Thank you!

#

In all honestest - it's mostly laziness that pushes me to look into this - there's a specific cabin I want them removed from so I can just "move in"

scarlet shore
#

In that case, I think just firing up PZ in debug mode and removing all zombies in the area should do the trick.

plush wraith
#

Anyone have advice on how to add a custom keybind for a controller?

whole bay
#

for a mod

plush wraith
#

Ya

#

Like a key listener but for a controller

whole bay
#

oh not sure about that but u should be able to find the controller binds in
C:\Users%user%\Zomboid\joypadBinding.config

#

might be able to do a r3+ x sorta thing potentially

plush wraith
south bear
#

I was doing some reading and saw some discussion about player:getCell()

Can anyone confirm? Is player:getCell() a predetermined area of a map or is it a sort of floating cell/amount of tiles relative to the player's position?

Is it possible that the player function for getCell is floating/relative to the player, whereas the IsoGridSquare function is fixed?

(My concern is functions utilized by the return of player:getCell() will not grab data needed from very close, neighboring cells - ie. closeby zombies near the player, but just over the cell border)

bright fog
#

getCell standalone too does that

#

getCell():getZombieList() gives zombies loaded by the player cell

#

Player cell which is the area surronding the player based on render distance which varies from MP and SP

vast pier
#

optimizing the function of this to make it so it checks if the zombie currently has a target to prevent random window exploding, and also adding in the option to include fast and slow shamblers instead of only sprinters

vast pier
vast pier
#

Is there a way to target a zombie's strength the same way as speedType ?

        local strength = character:strength()
        print(strength)```
doesn't seem to work
mellow frigate
#

Hello there, with B42.3.1, I got: WARN : Mod f:0, t:1739471105456> ChooseGameInfo.readModInfoAux > can't find "..\MoodleFramework\common\mod.info" My mod.info is under ```"..\MoodleFramework\42.0\mod.info"

bronze yoke
#

if the mod is working i'd just ignore it

bright fog
#

We already didn't have enough of the 2000 lines of "workshop ID not found" or whatever this shit is

bronze yoke
#

weird, i don't have any warnings like this in my log

mellow frigate
queen oasis
# vast pier Is there a way to target a zombie's strength the same way as speedType ? ``` ...

this is what I used. idk if it works in 42 but I don't see why it wouldn't. pass it an IsoZombie and a string like "strength." This is a pretty slow way to do it, btw

local function getZombieJavaField(daZamby, whatUWant)  -- (IsoZombie, "strength")
    local offset = string.len(whatUWant)
    for i = 0, getNumClassFields(daZamby) - 1 do
        local m = getClassField(daZamby, i)
        local mval = getClassFieldVal(daZamby, m)
        if string.sub(tostring(m), -offset) == whatUWant then
            return mval
        end
    end
    return nil -- you ain't livin right, son
end```
#

could maybe store the index because I don't think they change

bright fog
queen oasis
#

You can just use Starlit library to have easier access

queen oasis
#

Starlit is awesome, I didn't think about it but it's a bit more than what they asked I think

bright fog
#

They already know about Starlit, they already used it, I already helped him with that

queen oasis
#

ok Sir, I'll be on my way

bright fog
#

Why are you having such an attitude lol ?

queen oasis
#

didn't know I had an attitude. I agree with you that Starlit is easy, I didn't know you had helped them, but really I still think based on the info I saw, it's a bit heavy for what they asked. Maybe they need more than I know about. It's all cool

#

just reading and learning new things

bright fog
#

Just copy pasting a message like that is often kind of insulting, meaning you just didn't give a shit and if you did there's just no need

bright fog
queen oasis
queen oasis
bright fog
#

That's fine we're cool, missunderstanding happens

bright fog
#

So it's fine if they use to access other stuff on the zombies

#

And tbf it makes life way way easier to just use Starlit and not bother with the massive code needed just to access a field

queen oasis
bright fog
queen oasis
#

you know way more than I do about modding this game. I would believe you over me any day

#

ok, I thought you meant the age

bright fog
#

No lol dw

bright fog
#

In fact accessing fields I'm grateful you shared a clean example because I've been wanting to add the method of accessing fields in the wiki

queen oasis
#

I would rename the args. I write stupid ish in my functions

bright fog
#

No worries your example is fairly clean but I'll clean it up a bit out of respect to not just copy pasta the whole thing/give a more general example than just zombies

queen oasis
#

ya rewrite it like a normal person. I do a lot of checks before I get to that func is called

bright fog
#

πŸ‘Œ

finite gazelle
#

LOG : General f:0, t:1739480255586> [craftRecipe] removing script due to load error = CraftHamRadioMakeShiftToAC
ERROR: General f:0, t:1739480255594> ExceptionLogger.logException> Exception thrown
java.lang.Exception: CraftRecipe error in CraftHamRadioMakeShiftToAC at CraftRecipe.Load(CraftRecipe.java:409).
Stack trace:
zombie.scripting.entity.components.crafting.CraftRecipe.Load(CraftRecipe.java:409)
zombie.scripting.entity.components.crafting.CraftRecipe.Load(CraftRecipe.java:263)
zombie.scripting.ScriptBucket.LoadScripts(ScriptBucket.java:265)
zombie.scripting.ScriptBucketCollection.LoadScripts(ScriptBucketCollection.java:122)
zombie.scripting.ScriptManager.loadScripts(ScriptManager.java:1643)
zombie.scripting.ScriptManager.Load(ScriptManager.java:1566)
zombie.GameWindow.initShared(GameWindow.java:161)
zombie.GameWindow.init(GameWindow.java:1437)
zombie.GameWindow.mainThreadInit(GameWindow.java:694)
zombie.GameWindow.mainThread(GameWindow.java:589)
java.base/java.lang.Thread.run(Unknown Source)

#

hey can someone help me with this error type im trying to make my recipe but something went wrong and idk what i try to change my recipe.txt nothing is working ...

#

if its can help you this is my recipe.txt for the HamRadioMakeshift

#

recipe Craft HamRadioMakeShiftToAC
{
PowerBar,
ElectronicsScrap=3,
ElectricWire=1,
[Recipe.GetItemTypes.Aluminum]=4,
HamRadioMakeShift,
keep [Recipe.GetItemTypes.Screwdriver],

    NoBrokenItems:true,
    Result:HamRadioMakeShiftToAC,
    SkillRequired:Electricity=1,
    NeedToBeLearn:false,
    Time:100.0,
    OnCreate:Recipe.OnCreate.RadioCraft,
    OnGiveXP:Recipe.OnGiveXP.RadioCraft,
    Category:Electrical,
}

craftRecipe CraftHamRadioMakeShiftToAC
{
    timedAction = DismantleElectrical,
    Time = 100,
    needToBeLearned = false,
    SkillRequired = Electricity:3,
    Tags = AnySurfaceCraft,
    category = Electrical,
    AutoLearn = Electricity:9,
    xpAward = Electricity:20,

    inputs
    {
        item 1 Base.PowerBar,
        item 1 Base.ElectronicsScrap,
        item 1 Base.ElectricWire flags[NoBrokenItems],
        item 4 tags[Aluminum] flags[NoBrokenItems],
        item 1 Base.HamRadioMakeShift flags[NoBrokenItems],
        item 1 tags[Screwdriver] mode:keep flags[MayDegradeLight;NoBrokenItems],
    }

    outputs
    {
        item 1 PoweredRadio.HamRadioMakeShiftToAC,
    }
}

}

umbral raptor
finite gazelle
#

b42

umbral raptor
#

recipe Craft HamRadioMakeShiftToAC
{
PowerBar,
ElectronicsScrap=3,
ElectricWire=1,
[Recipe.GetItemTypes.Aluminum]=4,
HamRadioMakeShift,
keep [Recipe.GetItemTypes.Screwdriver],

    NoBrokenItems:true,
    Result:HamRadioMakeShiftToAC,
    SkillRequired:Electricity=1,
    NeedToBeLearn:false,
    Time:100.0,
    OnCreate:Recipe.OnCreate.RadioCraft,
    OnGiveXP:Recipe.OnGiveXP.RadioCraft,
    Category:Electrical,
}
#

this is a B41 recipe

#

it'll cause crashing if its in there

#

unless u were just giving it as an example

finite gazelle
umbral raptor
#

yeah the second one should work properly. but the first one is from B41 and would break the game since recipes are no longer coded this way

#

item 1 Base.HamRadioMakeShift

#

also

#

is this from ur mod?

#

if it is, you need to replace Base. with your module name

#

you should find it at the top of ur item scripts
module SupportCorps
{

#

for example

finite gazelle
#

i was thinking its was the base name of the item according to the items.txt i search in

#

its got another name ?

umbral raptor
#

nah, base refers to base-game.

#

you're telling the script to spawn an object from base game files that doesn't exist.

#

unless u chose ur module name while modding to be base.

#

then it might work.

#

but if its another module name you should change it to that (if its an item from ur mod)

umbral raptor
finite gazelle
#

module PoweredRadio
{
item HamRadio1ToAC
{
DisplayName = Premium Technologies Ham Radio To AC,
DisplayCategory = Communications,
Type = Radio,
Weight = 15.0,
Icon = HamRadioCivilian,
BaseVolumeRange = 10,
ConditionMax = 100,
DisappearOnUse = FALSE,
IsHighTier = FALSE,
IsPortable = FALSE,
IsTelevision = FALSE,
MaxChannel = 500000,
MicRange = 5,
MinChannel = 10000,
Tooltip = Tooltip_item_Radio,
TransmitRange = 7500,
TwoWay = TRUE,
UseDelta = 0.010,
UseWhileEquipped = FALSE,
UsesBattery = FALSE,
CanBePowered=TRUE,
WorldObjectSprite = appliances_com_01_0,
}

#

so this is my item script , only one in the example but i got the 3 ham radio in it

#

and the thing is , i want both radio , the AC one comming from my module (PoweredRadio) and the base one comming from items_radio.txt from the game file , from where i found the name of the radio... how can i do it ?

finite gazelle
#

i want to made a recipe that convert a radio to use electricity and one to revert it back to battery

umbral raptor
umbral raptor
finite gazelle
#

I must have misunderstood something somewhere then πŸ˜„

umbral raptor
#

i essentially added three lanterns, one that uses candles, one that uses batteries, and one that can be placed on the ground

#

this is similar to what u wanna do with radio converting

#

u just have to program the radio items have them switch through a recipe

finite gazelle
#

can i pm u ? i late from here and my brain dont want to understand πŸ€¦β€β™‚οΈ but I think I have the idea I just don't have the formatting

finite gazelle
umbral raptor
#

u might need to make some patches tho

finite gazelle
#

I'll start from the basics πŸ˜„

umbral raptor
#

recipes go into their own file

#

you should have a file called script that contains a file for items and one for recipes

#

models should be in scripts

finite gazelle
#

to be sure its 42/media/scripts/ and my .txt item and recipe ? sorry brain go in vacation zombie

umbral raptor
#

like this

#

models go outside, items in items, recipes in recipes, moveables in moveables, and etc.

#

evolved recipes may go outside i think im not sure

#

i have like 20 model files haha

#

but u can put them all in one

#

i think

finite gazelle
#

remove a doubt from me? what exactly do the models do