#mod_development

1 messages Β· Page 520 of 1

proven light
#

maybe free up some ram by closing chrome

drifting stump
#

You can send it to the server

#

Are you using mods or writting one?

#

Are you modding the game

cold burrow
cold burrow
drifting stump
#

Can you show us what you were doing?

proven light
#

gonna grab the entire movie transcript?

#

so my car windshield is culled from the inside, im guessing theres nothing i can do about that?

hardy pollen
#

What export setting do i use with FBX blender for animation? i use Female_Body_14_animBase.fbx as import changed a bit and exported it, it works ingame, but as you can see, it strechtes out

#

i edited the IDLE animation

#

NVM got it working

bronze arch
#

IS there a way to add a trait if you read a skillbook? I see that script for learning recipes

#

but I want to give a character a trait when they read the book

graceful terrace
#

what files should I look into to research the effects of certain moodles?

I want to make an "extended moodle description" mod like traits have, showing what EXACTLY is happening when you are hungry, tired, thirsty etc (how much strength you lose etc)

I know where the tooltips are, but not where to actually find this information in the code. Not even the wiki is clear about this.

#

would like to understand what "heals faster" and "strength is increased" mean, exactly

dapper plover
#

well it means your strength is increased and you heal faster

#

simple, really

meager solstice
#

Does anyone know if the Aquatsar Yacht Club mod REALLY requires Cherbourg?

radiant ginkgo
#

Just reduce scalne in blender

mint sphinx
#

hey sry did someone help you ?

#

also how did you add the attribute ?

hidden compass
mint sphinx
#

also what kind of object are you trying to do ?

rain pumice
#

why is my item letting me equip it instead of using it like a medical item?

hidden compass
# mint sphinx also what kind of object are you trying to do ?

The line object has a "codes" attribute and a "getCodes" method, but calling this method (line:getCodes(), also line.codes) caused an error.

I have not yet solved this problem, but I am on the verge of being able to achieve what I want to do in another way.

mint sphinx
#

wait you have an runtimeeception

hidden compass
#

yap

mint sphinx
#

also just tried to zoom in to read your code

#

and you made an infinity loop its never stops

#

wait might be my missunderstand in lua never mind

#

do you have your project on github or somehting ?

hidden compass
#

local categories = getZomboidRadio():getRecordedMedia():getCategories() for i=1,categories:size() do local category = categories:get(i-1) local mediaType = RecordedMedia.getMediaTypeForCategory(category) local list = getZomboidRadio():getRecordedMedia():getAllMediaForType(mediaType) for j=1,list:size() do local mediaData = list:get(j-1) if mediaData:getCategory() == category then local title = nil local line = mediaData:getLine(0) local codes = line:getCodes() -- <--- error occured debug(codes) -- this is my debugging mehod just output log and speech end end end

hidden compass
hidden compass
# rain pumice what does the error say

Exception thrown java.lang.RuntimeException: attempted index: getCodes of non-table: zombie.radio.media.MediaData$MediaLineData@49c0e5d7 at KahluaThread.tableget line:1689..

#

In a normal case, this Java method call would work, but my guess is that there is a problem on the Lua side that prevents the method from being called properly for Java internal classes.

rain pumice
#

what happens if you print(type(line))

#

in that code

hidden compass
rain pumice
#

I think

#

userdata should be able to be modified right?

hidden compass
mint sphinx
#

how does zomboid normal handle recording ?

hidden compass
#

normal handle recording ?

mint sphinx
#

look like you trying to do some sort of VHS right ?

rain pumice
#

you might be hitting a wall

#

idk if the game allows to modify userdata

hidden compass
#

@mint sphinx @rain pumice
Anyway, I was able to achieve my goal in a different way. I'll put this matter to pendding at this point! Thanks for suggestions πŸ™‚

rain pumice
#

nice

mint sphinx
#

so how did you solve it

cold burrow
hidden compass
# cold burrow Mind to share with us please? :)

I found that the following vanilla source has access to codes.
So I used the same own code on the shared side to access the codes information,
and then cleared it from the client side by referencing this code on the shared side.
\shared\RecordedMedia\ISRecordeMedia

nimble spoke
drifting ore
charred knoll
#

Hey, I don't really understand why this basic distribution isn't working.. Could anyone help me ?

require 'Items/Distributions'

table.insert(distributionTable["all"]["cashregister"].items, "simonRandom.coinItem");
table.insert(distributionTable["all"]["cashregister"].items, 1.0);
willow estuary
#

SuburbsDistributions not distributionTable

require 'Items/Distributions'

table.insert(SuburbsDistributions["all"]["cashregister"].items, "simonRandom.coinItem");
table.insert(SuburbsDistributions["all"]["cashregister"].items, 1.0);
charred knoll
#

Even if cashregister is not considered in that table ? Interesting lemme test it thanks

rain pumice
#

Why is my item not letting me "Use it" as a medical item

#

but instead I can just equip it on primary and secondary

vale parcel
#

vehicle mod like this does this mean bus can take more hits than small vehicles in vanilla? or are they the same but just reskinned

mint sphinx
rain pumice
vale parcel
stray kestrel
#

does anyone know which popular mod would be the one that's preventing players from finding and wearing underwears and bras in multiplayer?

#

they don't have insulation/condition bars

#

but a blank tooltip

rain pumice
rain pumice
#

why is my medical item not working at all...

#

I can just hold it in my hands

#

Literally hitting my head against the desk rn trying to figure out why

meager solstice
#

Thanks!

proven light
proven light
#

I should see how it's done

#

Might be SportsCar_ez

kindred rover
#

Does anyone have any ideas what may cause this?: WorldDictionary: Cannot load world due to WorldDictionary error.

#

Was trying to debug something turning some mods on and off, and now when I try to load my test save, I get an error and am forced to quit to desktop. My console log file says that ^

#

In Single Player.

proven light
#

I think they just don't wanna remake all the car textures lol

#

And models

nimble spoke
kindred rover
nimble spoke
kindred rover
#

Thanks brother

frigid rain
#

Pulling my hair out here with this map mod I've made.
I cannot for the life of me get it to work as an MP mod.

mossy depot
#

I also can't get my mod to work MP. Anyone have any ideas? It works on a hosted server when I load the mod from Zomboid\Workshop (mod I uploaded) but not when I download it from the workshop and it's in workshop\content\108600

frigid rain
#

I love Indiestone, but fuck me, I wonder how they manage to cope with this engine/file system, it's so frustrating.

mossy depot
#

Yeah, every time I update my mod I have to reorganize the folders since the file structure is different between the two locations it's bananas

proven light
#

agreed 😁

nimble spoke
#

keep in mind that having it both in the workshop folder and subscribe to it will activate both at the same time as the ID is the same, leading to possible conflicts

#

so, if you're going to play with the subscribed version you should remove the other one from workshop temporarily and add it back when you resume work

mossy depot
#

I did move it.

nimble spoke
#

Other than that I have no idea what you mean by reorganizing folders

kindred rover
proven light
#

in lua can you access all public methods of a java class?

#

and can you only use java classes that were passed to lua via the event functions

mossy depot
mossy depot
#

I only play single player but people on the workshop say the items aren't spawning in MP.... not sure what else could be going on

frigid rain
#

I got the map mod on my server, but the vanilla cell is still overwriting it. The game is detecting that I'm inside of a building..

nimble spoke
fair frost
proven light
#

lookin good

sacred kernel
#

I was wondering, is there a mod that makes it so you seen a engine under a hood of a car?

agile lily
#

Hello people, are there any guides or information on how to add additional skins for currently existing vehicles and clothing?

frigid rain
#

Yeah we deleted the cell from the server-files and restarted. Seems to still contain the old data. :x

mossy depot
drifting ore
#

i wonder if there is a way to make new masks

#

πŸ€”

nimble spoke
bitter frigate
#

so a couple of my items are breaking the game and i can't figure out why. i thought maybe it was that they lack static models and things like that, but items that are ALSO missing their static models are working fine. they're breaking the game on right click.

bitter frigate
thin hornet
#

in C:\Users\Konijima\Zomboid\console.txt

#

youll find your error with more details

bitter frigate
#

thank u!!

fair frost
bitter frigate
tired hedge
fleet adder
#

i cant find where the lua print function prints too and im not sure if im looking in the right place or if its something else

#

its the console that comes up automatically in debug mode right?

bitter frigate
fleet adder
#

crap

#

i mean yay but also crap that means something else is wrong

drifting stump
#

neat tip you know how steam has 2 launch options? you can configure one to be normal and the other to be debug

bitter frigate
indigo kiln
#

redacted*

fleet adder
chilly beacon
#

Hi, probably been asked before but I cant find it at the moment, how can I make a recipe give experience when completed?

nimble spoke
opal wind
#

is there a way o 'craft' a car and place it on the world? or the only way to get cars in-game is spawning?

bitter frigate
nimble spoke
#

an item without a valid icon works, but a recipe code with that item breaks

bitter frigate
nimble spoke
bitter frigate
chilly beacon
lunar marsh
#

Is there mod, or would it be possible to make a mod; that allows the use of C2 breaching charges on doors to blow them open (Either via remote or timer). To add onto that, a C4 kit for destroying barracades/walls/etc?

drifting stump
#

you can edit the .bat to add the debug flag

proven light
#

oh neat

mossy depot
#

but use it as a base to make your own function

chilly beacon
#

ok, whats the tailoring skill called in the code? just Tailoring?

mossy depot
#

So the OnGiveXP for woodworking5 is

    player:getXp():AddXP(Perks.Woodwork, 5);
end```
#

just make a version of that for tailoring and use Perks.Tailoring instead

#

if you don't want to give a specific xp amount you can use ZombRand(1,3) instead of 5 for example

chilly beacon
#

so just make a file in my mod's lua folder and pop those 3 lines in and call it good?

mossy depot
#

I have my functions in media/lua/client

chilly beacon
#

ok, so zomboid doesnt seem to like my lua file

mossy depot
#

take a look at recipecode.lua, you might need some of the stuff at the top, it sets up some arrays or something (not sure what they're called in lua)

chilly beacon
#

ah yeah, the top has

Recipe.GetItemTypes = {}
Recipe.OnCanPerform = {}
Recipe.OnCreate = {}
Recipe.OnGiveXP = {}
Recipe.OnTest = {}```
#

well the game boots, thats a success

#

ah, but still no exp

mossy depot
#

hmm

#

maybe try this instead self.character:getXp():AddXP(Perks.Tailoring, ZombRand(1, 3));

#

slightly different version I pulled out of ISRepairClothing.lua

#

I'm not sure what the difference between referencing player vs. self.character is though

chilly beacon
mossy depot
#

oh it looks like it's trying to find it in the wrong spot

chilly beacon
#

lovely

mossy depot
#

Let me show you how it works in my mod and then maybe you can figure it out. I'm not doing XP but am calling a custom function from recipe

#

so in my recipe I call
OnCreate:DairyModReturnSaucePan_OnCreate,

#

and here is the lua

function DairyModReturnSaucePan_OnCreate(items, result, player)
    player:getInventory():AddItem("Base.Saucepan");
end```
#

my guess is it's not being called correctly from your recipe

chilly beacon
#

hm

#

it worked!

mossy depot
#

nice!!

chilly beacon
#

sweet πŸ˜„

#

the issue was, as suspected, me not quite doing it right

mossy depot
#

I do that a lot, don't feel bad πŸ˜…

#

You probably didn't need the recipe {} stuff then, huh

chilly beacon
#

indeed

#

i called "GiveTailoring10" in the recipe, and added the Player:AddXP part in there

#

simples

winged lotus
#

Good evening all! Has anyone created a recipe from lua instead of from text files?
I want to create recipes only if another mod is loaded too but can quite manage to find a way to do so πŸ€”

mellow shore
#

To all PZ modders, if you are a mod creator. Please take a moment to read this.
We've just released https://topprojectzomboidservers.com
Like our other ranking sites, we like to sponsor mod creators and help promote their mods. If you're interested, you can open a ticket on the site and provide support your mod ID and some info about it. We provide custom game servers for development, sweet gear we get from our sponsors and custom API endpoints etc.

charred knoll
#

Hey, I am once again coming here to get some help of y'all kind people helping others.
I have published my small little mod but i'd like to make it accessible in other languages. I am sure there a way to modify the lua depending on the language, but I've yet to find an example of someone doing so ! Any help is gladly welcomed

winged lotus
fleet adder
#

anybody know if theres a way to add the libraries from the javadoc to visual studio or if theres a better way than looking back and fourth to find things

safe idol
#

Somebody please make a mod that allows players to choose different options of wearing for clothing. Like choosing to wear a jacket open or closed, tuck a shirt in or out, tuck pants into boots, wear pants rolled up. I feel like this would be super awesome for immersion purposes, as well as opening a bunch of possibilities for RP opportunities and would be awesome for kitting your survivor out in a more personalized aesthetic

#

I know nothing about coding ;-; so I beg you guys XD

wintry stag
#

Hey, I created this Spider-Man (PS1 Version) retexture for the Player/Hazmat Suit, it also works for mods like Leather Suit, if someone wants, upload it to the Workshop or use it for a Modpack.

#

Here's the texture

#

Here's some pics in-game

bitter frigate
#

i'm still having the same right-click crash problem. i right click the item and the game crashes. nothing fancy. i tried adding a static model and an icon to one of the items that was acting up as was suggested, but it's still throwing the same issue. i've got a MUCH better debug log here (https://pastebin.com/WqKi1u9T). i hadn't understood what i was doing that first time around; this time i've managed to isolate the pertinent bit of code.

nimble spoke
safe idol
tranquil reef
#

Can you add custom properties to custom clothing items

#

As in, pressing T will add to an integer in a jetpack clothing item or something, and once that integer hits 4 it gets removed from your inventory?

undone crag
#

ERROR: General , 1644105036291> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getTexture of non-table: null

#

You could look at ISInventoryPaneContextMenu.lua line # 2689.

white quest
#

is it possible to make a sleveless jacket, with no sleeve tailoring slots?

#

and if not, can we add new body locations?

undone crag
#

You can add body locations to the end of the list and I think probably to the beginning of it. If you wanted to be able to answer questions like that you could use notepad++ and its search function to find where certain words are referenced. So the bloodlocation specified in a txt file may be referring to something specified in a Lua file.

white quest
#

Ok

edgy wharf
#

Hey everybody, I have uploaded my mod to the steam workshop. It's in my workshop folder and I can see it has been downloaded. But when I boot the game it does not show up in my mod menu.

#

Any ideas?

hot patrol
#

Anyone know if there is a balenced version of Fashion montage for MP that doesn't allow OP items like bags and armor at start?

#

I want deeper character customization for my server but I don't want people being able to start with end game loot

edgy wharf
#

So I made my first mod, got it uploaded, it's showing in the main menu, but its not showing up in game/

#

I followed Blackbeard's tutorial for making a mod

#

I can't find it in any of the containers i set in the distribution list

mossy depot
#

errors*

edgy wharf
#

Like in a dev console in game?

#

Or outside the game?

toxic pine
#

anyone knows the value for set a new name?

mossy depot
edgy wharf
#
SEVERE: Error found in LUA file: C:/Users/Morgan/Zomboid/Workshop/Bleach Soda/Contents/mods/Bleach Soda/Media/lua/server/items/bleSoda-Distributions.lua
#

I would guess that would be it.

edgy wharf
#

chef kiss

#

Thank you Blair.

willow estuary
#

πŸ‘

edgy wharf
#

No really though actually gold, bless you.

#

I can't imagine how many people haven't read this wondering why their code is so sloppy.

#

I am brand new to LUA though so this will be painful looking up the different roomdefs and stuff to find the places I want it to spawn.

willow estuary
#

Yeah, to be honest I got frustrated with how commonplace it was for mods, popular mods even, to mess up item distribution?
Adding stuff to distro tables is super simple and straightforward when you use the simplest method.
But, when people use that distribution-merge method that's more complicated, well, not only is the extra work involved with that method completely unnecessary, but also, because it's more complicated, there's more opportunities for people to make mistakes.

edgy wharf
#

For reference what would be an easy way using this guide with a drink item?

#

Because that's what my mod is.

willow estuary
#

Just search the vanilla tables for a vanilla drink item, and use the tables they spawn on, and their spawn values, as a starting point?

edgy wharf
#

And I can find the tables in the distro lua file of the base game?

undone crag
#

(deleted, was the guy's username)

edgy wharf
#

Yup that's my name don't wear it out.

willow estuary
#

Yeah, ProjectZomboid/media/lua/server/Items will have Distributions.lua and ProceduralDistributions.lua which are the vanilla item spawn files, aside from ProjectZomboid/med/server/Vehicles/vehicleDistributions.lua which handles the spawning of items in vehicles gloveboxes/trunks.

edgy wharf
#

Perfectly explained, you should be a teacher if you aren't already.

dense fable
wintry stag
#

you also have the skinny version

dense fable
#

looks good though gg

wintry stag
#

ty

edgy wharf
#

Anything I need to add to this?

#

Besides my item name obviously

#

This is for the regular distributions.

bitter frigate
# undone crag You could look at `ISInventoryPaneContextMenu.lua line # 2689`.

ISInventoryPaneContextMenu.lua lua if resultItem:getTexture() and resultItem:getTexture():getName() ~= "Question_On" then tooltip:setTexture(resultItem:getTexture():getName()); end i don't know how if resultItem:getTexture() and resultItem:getTexture():getName() works, or how tooltip:setTexture(resultItem:getTexture():getName)) is applicable - i've never messed with tooltips before, and for good reason! they're spooky

here's the item that's still throwing the error.

    item LancingDevice            {
        DisplayCategory        = FirstAid,
        Weight                = 0.01,
        Type                = Normal,
        DisplayName            = Lancing Device,
        Icon                = BakingTray,
        Medical                = TRUE,
        WorldStaticModel         = BakingTray,
    }

and here's the recipe involving it

    recipe Lance Finger        {
    TeststripsVIAL,
    keep LancingDevice,
    Result: TesttripWET,
    Category: Diabetes,
    Time: 100.0,
    NeedToBeLearn: false,
    }```
burnt current
#

Would it be possible to merge all the mods I have into a pack? I'm tired of mods updating and breaking my server

edgy wharf
#

So in my mod my module is BleachSoda, and I'm importing Base. Do I need to include base.modname or do I need to write BleachSoda.BleachSoda

#

This is in my bSoda_items.txt file defining the two items.

edgy wharf
#

Okay I think I am understanding. But I just need to know what I am pulling the name of my mod from now

#

my items.txt?

#
{
    imports
    {
        Base
    }
    
    item bSoda
    {
        DisplayCategory         = Food,
        HungerChange            =    +10,
        Weight                  =    0.3,
        AlwaysWelcomeGift        =    TRUE,
        ReplaceOnUse            = bSodaEmpty,
        Type                    =    Food,
        UnhappyChange            =    +45,
        ThirstChange            =    -99,
        DisplayName                =    Bleach Soda,
        Icon                    =    BleachSoda,
        CustomContextMenu       = Drink,
        CustomEatSound          = DrinkNoiseMod,
        Carbohydrates           = 0,
        Proteins                = 0,
        Lipids                  = 0,
        Calories                = 140,
        Packaged                = TRUE,
        CantBeFrozen            = TRUE,
        StaticModel             = PopCanFizz,
        EatType                 = popcan,
        WorldStaticModel        = PopCanFizz,
    }


    item bSoda_EMPTY
    {
        IsWaterSource           =   TRUE,
        Weight                  =   0.1,
        CanStoreWater           =   FALSE,
        Type                    =   Drainable,
        UseWhileEquipped        =   FALSE,
        UseDelta                =   0.1,
        DisplayName             =   Empty Bleach Soda,
        ReplaceOnDeplete        =   bSodaEmpty,
        Icon                    =   Bleach_Soda_Empty,
        CustomContextMenu       =   Drink,
        CustomEatSound          =   DrinkNoiseMod,
        StaticModel             = PopCanFizz,
    }   
}
#
table.insert(ProceduralDistributions.list["BinGeneric"].items, 90)```
#

Is this correct?

#

@willow estuary ?

mossy depot
#

BleachSoda.bSoda

edgy wharf
#

Thank you sugarskull!

undone crag
# bitter frigate ``ISInventoryPaneContextMenu.lua`` ```lua if resultItem:getTextu...

attempted index: getTexture of non-table: null means the variable the code tried to do getTexture on was just nil. Your quote does not say which line is #2689. Two different things have getTexture called on them - resultItem and tooltip. One of them is nil. Someone said a failed recipe can make something fail. You can disable a recipe like this

    /*item LancingDevice            {
        DisplayCategory        = FirstAid,
        Weight                = 0.01,
        Type                = Normal,
        DisplayName            = Lancing Device,
        Icon                = BakingTray,
        Medical                = TRUE,
        WorldStaticModel         = BakingTray,
    }*/
edgy wharf
#

I still am not seeing my mod in the game even after updating the tables

#

My console isn't throwing any errors.

willow estuary
# edgy wharf I still am not seeing my mod in the game even after updating the tables

You should be using BleachSoda.bSoda, Base.bSoda as you defined your item as being of the module BleachSoda.

Honestly, IMO, unless there's corner case reasons for doing so, I consider using a module other than Base for adding new mod items/recipes/vehicles to be an unnecessary complication that just causes more headaches than it prevents? At least with people that are new to modding PZ,, but I don't think I use anything other than Base in any of my mods?

edgy wharf
#

So can I just remove the module or do I make the module Base?

#

And then, do I update the name in the tables to Base.bsoda?

#

I'm tearing my hair out lmao I've been at it for 10 hours.

willow estuary
edgy wharf
#

so

willow estuary
edgy wharf
#
module Base
{
    imports
    {
        Base
    }
    
    item bSoda
    {
        DisplayCategory         = Food,
        HungerChange            =    +10,
        Weight                  =    0.3,
        AlwaysWelcomeGift        =    TRUE,
        ReplaceOnUse            = bSodaEmpty,
        Type                    =    Food,
        UnhappyChange            =    +45,
        ThirstChange            =    -99,
        DisplayName                =    Bleach Soda,
        Icon                    =    BleachSoda,
        CustomContextMenu       = Drink,
        CustomEatSound          = DrinkNoiseMod,
        Carbohydrates           = 0,
        Proteins                = 0,
        Lipids                  = 0,
        Calories                = 140,
        Packaged                = TRUE,
        CantBeFrozen            = TRUE,
        StaticModel             = PopCanFizz,
        EatType                 = popcan,
        WorldStaticModel        = PopCanFizz,
    }


    item bSoda_EMPTY
    {
        IsWaterSource           =   TRUE,
        Weight                  =   0.1,
        CanStoreWater           =   FALSE,
        Type                    =   Drainable,
        UseWhileEquipped        =   FALSE,
        UseDelta                =   0.1,
        DisplayName             =   Empty Bleach Soda,
        ReplaceOnDeplete        =   bSodaEmpty,
        Icon                    =   Bleach_Soda_Empty,
        CustomContextMenu       =   Drink,
        CustomEatSound          =   DrinkNoiseMod,
        StaticModel             = PopCanFizz,
    }   
}
willow estuary
#

Remove the import statement. You don't need it, and it will cause console messages that people will report as bugs.

edgy wharf
#

Ohh yes, that makes sense. That's what you were talking about.

willow estuary
#

The only time people need import statements, AFAIK, is if they have recipes using items from other modules, that are included in import, in their recipes.

opal wind
#

guys i cant make my gun attachment to attach to my weapon: (the option is not even appearing now, and it was before)

item Wiz_GunLight_small
{
DisplayCategory = WeaponPart,
Type = WeaponPart,
DisplayName = Robocop Auto 9 Flashlight,
Icon = Wiz_GunLight_small,
Weight = 0.2,
WeightModifier = 0.2,
WorldStaticModel = Wiz_GunLight_small,
AimingTimeModifier = 5,
MountOn = Wiz_RobocopGun,
PartType = Canon,
MetalValue = 1,
}

i set this on my weapon:
ModelWeaponPart = Wiz_GunLight_small,

willow estuary
#

No recipes should mean no import.
Everything is Base? No import.
All the items in the recipes are Base? No import.

Shoot, you can use items from other modules without importing if you just include the module name in the recipes as such as I did with farming.Strewberrie

recipe Make Pink Dye
    {
        keep KitchenKnife/HuntingKnife/MeatCleaver/Hammer/BallPeenHammer/ClubHammer/StoneHammer/WoodenMallet/MortarPestle,
        Sound:AddItemInRecipe,
        farming.Strewberrie;100,
        Salt;10,
        Pot,
        Result:PinkNaturalDye_Raw,
        Time:200.0,
        Prop1:Source=1,
        Prop2:CookingPot,
        AnimNode:Loot,
        SkillRequired:Cooking=1,
        NeedToBeLearn:true,
    }

I swear that 90% of the time I see import statements in mods scripts, they're not necessary?

edgy wharf
#

Now just update the tables and I'm good? Or do I need to update mod info as well?

willow estuary
#

I can't imagine why you'd need to update mod.info?

edgy wharf
#

Because I'm an idiot who is tired and doesn't know anything in the first place?

willow estuary
#

Fair enough, I was just confused there πŸ˜„

edgy wharf
#

πŸ˜†

willow estuary
#

But I'm sure you're picking up how doing thing the simpler way also makes it easier?

edgy wharf
#

Absolutely.

#
require 'Items/SuburbsDistributions'
require "Items/ProceduralDistributions"
require "Vehicles/VehicleDistributions"
 
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "bSoda")
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 90)

table.insert(SuburbsDistributions["Bag_SurvivorBag"].items, "bSoda");
table.insert(SuburbsDistributions["Bag_SurvivorBag"].items, 40);

table.insert(ProceduralDistributions.list["KitchenRandom"].items, "bSoda")
table.insert(ProceduralDistributions.list["KitchenRandom"].items, 90)

table.insert(ProceduralDistributions.list["WardrobeRedneck"].items, "bSoda");
table.insert(ProceduralDistributions.list["WardrobeRedneck"].items, 40);

table.insert(ProceduralDistributions.list["BathroomCabinet"].items, "bSoda")
table.insert(ProceduralDistributions.list["BathroomCabinet"].items, 90)

table.insert(ProceduralDistributions.list["BinGeneric"].items, "bSoda")
table.insert(ProceduralDistributions.list["BinGeneric"].items, 90)
#

Look right?

willow estuary
#

Yeah, looks good to me alright? You;re using debug mode right?

edgy wharf
#

I am not lol.

bitter frigate
edgy wharf
#

Hold left shift on game start for debug right?

willow estuary
# edgy wharf I am not lol.

Okay, so using debug is actually super important for making modding simpler?
Using debug mode you can spawn in items.
Now, that is important for easily evaluating whether you made the scripts for your items properly so that they "can exist"?
If an item can't exist, then it can't spawn.

A lot of times I've seen people flailing over their distro table stuff, but the real issue was that they screwed up their scripts for their items where the item doesn't exist?

opal wind
#

guys the effects from the traits are on lua or java side?

willow estuary
#

Both.

edgy wharf
#

Yeah I read online that you can't spawn in mod items so I went straight to the distro

willow estuary
willow estuary
edgy wharf
#

If the mod is not in the distro, or the distro is messed up can I still spawn it in?

#

As long as it doesn't throw an error?

willow estuary
undone crag
undone crag
edgy wharf
#

Heyoo I can spawn it in.

#

The Icon is bugged, and the sound effect loops forever, and I can drink it unlimited times.

#

But it works!

opal wind
willow estuary
edgy wharf
#

True.

#

Simpler is better!

#

Easy fix would be to just make the sound a second longer or so

willow estuary
#

If nothing else. "start simple, get simple to work, and then get fancy"

edgy wharf
#

Until the animation finishes

#

Oh one last question, can I edit the mod inside the workshop folder or is that a no-no?

#

Having to reupload every time I make a change to test is ridiculous

willow estuary
#

Ah yes. that how you should be doing it πŸ˜„

#

.....you're new, so it's understandable, but yeah, probably not the best state of affairs to be uploading stuff to the workshop before confirming that it all works properly in testing?
You can also set the privacy settings for mods so they're hidden or unlisted, in case you need to test a mod with other people but don't want people downloading it yet.

edgy wharf
#

Amazing, I am done for tonight but thank you so much for your time. I really do appreciate it.

willow estuary
#

Yeah, no problem, despite how it was just one goddamn thing after another πŸ€ͺ (which is pretty normal for "first mods" TBF), you picked up on stuff really well, sol it was pretty low effort on my part?

edgy wharf
#

Tends to be how coding of any sort works lol. Glad I wasn't a complete idiot with it all!

#

Good night!

bitter frigate
hidden compass
#

Thanks to your help, the new petite Mod is now complete πŸ™‚

snow path
#

Hello, I already have a working firearms mod with two shotguns, one pump and one semi auto. I am able to spawn them with item spawners, but they do not spawn in the game world.

Can anyone please help or provide some scripts to make them able to spawn in appropriate locations like armories and the trunks of some cars?

indigo kiln
#

Why is my modded car floating menacingly?
It didnt do that 5 mins ago

proven light
#

you left the helium tap on in ur vehicle

indigo kiln
proven light
#

now its a blimp

indigo kiln
#

Ah it might be a Physics Chassis Shape problem, looking into that.
Fixed.

proven light
#

has anyone made flying objects in a mod yet

indigo kiln
#

Wasn't there a flyable copter?

#

Anyone know how to edit Phys.Chassis Shape in a not mirrored way?
It currently extend all the way underground when i want to cover the roof of the van

#

Which makes the car fly...

proven light
#

u cant

#

u have to use the offset

#

so the car isnt centered

#

oh its centerOfMassOffset

#

means u can move the chassis rect

peak cobalt
#

child labour mod when

indigo kiln
#

Well whatever then. i'll leave the roof as is.

#

now why is this happening... Why is my hitbox OK against walls but completly clips through other cars??

proven light
#

idk about that but apparently a lua script will silently fail to load if you have a syntax error, which is something i wish i knew earlier

indigo kiln
proven light
#

sorry i explained that poorly xd

mint sphinx
#

i dont know if this is here or modeling i have to ask this question in hmm but is it possible to make sprite animation for isoobject ?

what i have to do is turning an object around based on a world attribute ^^

gray mural
#

hi all! how can i increase the frequency of car jams and car wrecks on the roads?

raven eagle
#

How to change metal working recipes? I would like to remove scrap metal from metal roof recipe

raven eagle
#

yes

mint sphinx
#

if so you might be able to overwrite the fuction call at line 258 in blakcmsithmenu. which mean you just have to only overwrite that funciton call in your own mod

#

with other word its a larger function so i wouldnt do it if any other mod extend or doing hooks in

#

its a 246 line functions called "dobuildmenu"

raven eagle
#

did find it, but no idea what is what here... was expecting items required for the recipe called by their names

#

Are these numbers the ones that need to be changed?
local canDo, toolTip = ISBlacksmithMenu.checkMetalWeldingFurnitures(0,1,0,0,1,2,0,playerObj,toolTip);

#

I would assume that 2 is welding rods, and one of the 1 is scrap and one of them is small sheet...

#

okay nvm found it. it seems like they are at line 125, what these numbers mean...

#

removed scrap from all of the recipes. YEET. How are you supposed to build anything with metal when you can hardly find enough scrap for anything?

proven light
#

disassemble some cars

raven eagle
#

I did. cleared a bridge and it only gave me enough to build a metal roof for a tiny shed

proven light
#

eek

raven eagle
#

after that went around looting trash cans for scrap metal, but still far from enough... dismantled a lot of stuff too, all the way to level 6 metalworking but still got nowhere near enough. got nowhere as much as I got for dismantling cars

#

honestly this is just ridiculous

#

so... do I need to do something for the game to replace that old recipe with mine?

#

I tried enabling the mod, loaded just fine but all the recipes are still the same

calm depot
raven eagle
#

How am I supposed to make changes to existing building recipes? did changes in IsBlacksmithMenu.lua, but nothing is changing

#

the mod is enabled

calm depot
#

probably because you're just redefining it without unregistering it

raven eagle
#

without unregistering it?

calm depot
#

look at the bottom of the file

#

if you understand the semantics of lua, you'll understand that redefining it won't actually do anything

raven eagle
#

It did work that way in another game... just change it and it just works

calm depot
#

that would be because that game took a reference to the table containing the function, rather than the function itself directly

#

it passes ISBlacksmithMenu.doBuildMenu, not just ISBlacksmithMenu

#

maybe you should look at the mod I just posted a minute ago, it basically does exactly what you're trying to do

#

namely, it injects a new menu item into Metalworking

raven eagle
#

yeeting scrap metal from all of the metal working recipes, but just the metal roof would be fine too

calm depot
#

this channel is about modding, your question doesn't sound like it's related to modding

#

not really, moreso for you

#

you'll have more success if you post in the right place

#

yes, being obnoxious and spamming will definitely get someone to help you

#

lol

#

that block feature in Discord is so handy, instant spam filter

nimble spoke
drifting ore
#

why would you do that man?

calm depot
#

obvious troll is obvious

calm depot
#

LOL

#

it's like having a 12 year old trying to insult you

drifting ore
calm depot
#

well, I say "like"

drifting ore
#

this is not r/roastme

left plank
#

bye bye

drifting stump
left plank
#

ye np, what a weirdo

calm depot
#

if he's really dedicated, he'll be registering a new Discord account right about now

drifting ore
#

Anyways, this should work right as a custom distro without any other requirements?

#

`require "Items/Distributions"

SuburbsDistributions.officenerd1 = {
metal_shelves =
{
rolls = 1,
items = {
"R2D2_WorldItem", 100,
}
},
}
`

drifting stump
calm depot
#

guaranteed to have one of them? sure, looks fine to me

drifting stump
#

you should append

drifting ore
drifting stump
#

yes

#

SuburbsDistributions.officenerd1 =

#

you are assigning a new table

#

you should append to the existing table

drifting ore
#

argh alright

calm depot
#

ah yes, table.insert(SuburbsDistributions.officenerd1.metal_shelves, {...})

drifting ore
#

Is there a good example of how I should format it?

calm depot
#

just cut and paste the entire {} block for metal_shelves that you have there

drifting ore
#

`require "Items/Distributions"

table.insert(SuburbsDistributions.officenerd1.metal_shelves, {...})
metal_shelves =
{
rolls = 1,
items = {
"R2D2_WorldItem", 100,
}
},
}`

#

like this?

calm depot
#

no

#

{...} was the placeholder

#

table.insert is a function

#

it takes 2 arguments - the first being the table to add to, and the second being whatever object you want to add, which in this case, is your table with the rolls and items

drifting ore
#

I'm not very good at working out this stuff

#

I'll try to understand what you mean

#

and fix it

calm depot
#

table.insert(SuburbsDistributions.officenerd1.metal_shelves, { rolls = 1, items = { blahblah } })

drifting ore
#

do you end between every new table insert?

calm depot
#

end?

#

as in, the end keyword?

drifting ore
#

Example of how i have it right now

#

`require "Items/Distributions"

SuburbsDistributions.officenerd1 = {
metal_shelves =
{
rolls = 1,
items = {
"R2D2_WorldItem", 100,
}
},
}

SuburbsDistributions.astrosuit = {
metal_shelves =
{
rolls = 1,
items = {
"AstroSuit", 100,
"AstroHelmet", 100,
}
},
}`

calm depot
#

if you find it makes your code more readable, you could also do
local r2d2 = {rolls = 1, items = { ... } }
table.insert(SuburbsDistributions.officenerd1.metal_shelves, r2d2)

proven light
#

by chance does anyone know the difference between template and template! ?

calm depot
#

nope, but if you find out I'd love to know too

raven eagle
#

Yea... still don't really see how you're supposed to replace existing building recipe. all these examples just add new recipes. I think I'll just add a recipe for changing metal sheets into scrap metal...

#

far more simple to just add crafting recipes

raven eagle
#

if I want to make a recipe that requires blow torch, but doesn't use any propane, do I just write in keep BlowTorch?

tardy mural
#

I did some modding before but never published it, here's my first mod that I actually release 😁

faint jewel
#

i have a idea fora mod but i think it might be more a modelling thing... but the 2 seater pickups could be 4 seaters if people sat in back.

#

i want a trailer that can carry two small/mid sized cars lol

radiant bear
#

Anyone suggest any cool mods? Just some stuff to check out, idc the topic πŸ‘

full bramble
#

is there a quick guide on what's needed to add a new zombie into the game? I'm looking at Authentic Z, Advanced Zombies, and the vanilla stuff, and it seems that I need at least:
clothing.xml
three files in \NPCs\ for attachedlocations, bodylocations, and zombiezonedefinitions
is that it, or is there more?

#
  1. name zombie
  • 1a. add zombie clothing and name into clothing.xml ( splice into other mod if needed?)
  1. add zombie to ZombiesZoneDefinition.lua
  2. done???
    optional: add attachedlocations.lua info for extra stuff

does that sound right?

indigo zodiac
#

got inspiration from the claim everything code by @quasi geode (sorry for tag)

nimble spoke
nimble spoke
full bramble
#

so if I add in the new zombie I want to the other, it'd work

drifting ore
#

This isn't the first time this has happened to me but I have this problem that I can't seem to solve. It's with combo boxes in UIs. I can't select it. Has anyone ever had the same?

#

The video to see the probleme

nimble spoke
full bramble
#

o

fleet adder
#

cant figure out how to get lighting info from a square, everything on the docs says it should work but no matter how i try and do it it returns nil or errors

#
local function OnZombieUpdate(zombie)
    --print("working!")
    local sq = zombie:getSquare();
    local colour = sq.Lighting;
    if sq then
        print(sq);
        print(colour);
    else
        print("fuck");
    end;
    
end;

Events.OnZombieUpdate.Add(OnZombieUpdate);```
#

anyone know what ive done?

#

i also tried sq.Ilighting :lightinfo() and some others but none of them seem to work

nimble spoke
#

sq:getLightLevel()

fleet adder
#

same error

undone crag
undone crag
#

:o Maybe it's if an icon is specified but it's bad one like wrong format or size or something.

nimble spoke
#

That's the crafting screen, what happens if you right click an item in your inventory that can be used to make those?

frank elbow
#

Is there a way to execute something N seconds (or ticks) later without using the OnTick event?

#

I'm wondering if there's a delay or interval function or something to that effect. I do want it to pause when the game is paused so it seems like OnTick is the way to go, but I'm not certain

cyan cosmos
#

if anyone wants to team up just add me πŸ™‚

edgy wharf
#

I'll post my updates here I suppose since I've spent a few hours trying to fix it by reuploading the mod, editing things, making sure the file structure was correct, etc.


#

mod.info

id=BS
description=Bleach Soda
poster=poster.png```

bSoda_Items.txt

```module Base

    item bSoda
    {
        DisplayCategory         =   Food,
        HungerChange            =    +10,
        Weight                  =    0.3,
        AlwaysWelcomeGift       =    TRUE,
        ReplaceOnUse            =   bSoda_EMPTY,
        Type                    =    Food,
        UnhappyChange           =    +45,
        ThirstChange            =    -99,
        DisplayName             =    Bleach Soda,
        Icon                    =    Bleach_Soda,
        CustomContextMenu       =   Drink,
        CustomEatSound          =   PZ_DrinkingFromBottle,
        Carbohydrates           =   0,
        Proteins                =   0,
        Lipids                  =   0,
        Calories                =   140,
        Packaged                =   TRUE,
        CantBeFrozen            =   TRUE,
        StaticModel             =   PopCanFizz,
        EatType                 =   popcan,
        WorldStaticModel        =   PopCanFizz,
    }


    item bSoda_EMPTY
    {
        IsWaterSource           =   TRUE,
        Weight                  =   0.1,
        CanStoreWater           =   FALSE,
        Type                    =   Drainable,
        UseWhileEquipped        =   FALSE,
        UseDelta                =   0.1,
        DisplayName             =   Empty Bleach Soda,
        ReplaceOnDeplete        =   bSoda_EMPTY,
        Icon                    =   Bleach_Soda_Empty,
        CustomContextMenu       =   Drink,
        CustomEatSound          =   DrinkNoiseMod,
        StaticModel             =   PopCanFizz,
    }   
nimble spoke
#

misssing { after module Base and } at the end

edgy wharf
#

Fml.

#

Thanks.

bronze arch
#

right I want to publish my mod on the workshop, what's the proces

edgy wharf
#

Even with the brackets, the mod is not showing up in game.

#

I have the opening bracket on the next line, and the closing bracket on the line after bSoda_EMPTY's closing bracket.

#

@bronze arch Put the mod into your Workshop folder with the provided example mod's file structure. Launch the game, go to workshop in the main menu and from there it is pretty self explanatory. Then go to Steam and download your mod and make sure you activate it.

#

Which now that I think about it I think I forgot to activate mine lmfao.

#

No it is activated, damn.

solar tinsel
#

do you guys have a favorite mods list to use? since the MP updates i think i have to rearrange mods to work now.

tired hedge
indigo kiln
#

Problem: for some reason the damage overlays are not showing up on a car. Instead parts of it are blacked out when taking damage.
I have my damage1 and damage2 textures, i've had them as a transparent PNG and they didnt work.
I've tried replacing them with repainted damaged textures but they dont show up as well...
Are textureDamage2Shell mandatory?
Any ideas please?

hot patrol
fleet adder
#

anyone know of an easy or the best way to check if there is a wall between two points or squares

edgy wharf
#

So my drink mod appears in game now but when I right click on it, my game crashes with no errors in my console log. Any ideas?

nimble spoke
edgy wharf
#

In my inventory

#

AS if I were going to drink it

#

Same thing happens when I right click the empty version as well

nimble spoke
#

one thing, your empty item points to itself in ReplaceOnDeplete = bSoda_EMPTY, water conatiner usually point to a normal type item for their empty versions

#

your food item points to a drainable item, I don't remember seeing that before so I don't know if that could be the problem, usually it is a normal type

#

you're missing an item there, it is usually food item -> normal item -> drainable item

white quest
#

why kentucky flag and emblem suck so much?

last grove
#

does anyone know of a way to create an unmoveable, indestructable object as the basis of a trading beacon?

lost prairie
#

i need some help i've been trying to get mods for me and my friend to play but it keeps saying something failed to load when i try and start the server with mods and i've checked avary mod and its build 41.61 or 41.65 and its being a pain in the ass anybody know how to fix it?

#

even if somebody could hop in a call with me and help i'd be fine with it i just need help

nimble spoke
drifting ore
#

is there a boilerplate for a mod that adds a custom bandage?

#

i need it for a mod i'm making

shut valley
# drifting ore is there a boilerplate for a mod that adds a custom bandage?
 item Bandaid
{
    DisplayCategory = FirstAid,
    Type                =            Normal,
    DisplayName            =            Adhesive Bandages,
    Icon                =            Bandaid,
    Weight                =            0.1,
    CanBandage    =    true,
    BandagePower    =   1.5,
    Tooltip = Tooltip_UseOnHealthPanel,
    Medical = TRUE,
    WorldStaticModel = BandAid,
}

item Bandage
{
    DisplayCategory = FirstAid,
    Count    =    1,
    Weight    =    0.1,
    AlwaysWelcomeGift    =    true,
    Type    =    Normal,
    DisplayName    =    Bandage,
    ReplaceOnUse    =   BandageDirty,
    Icon    =    Bandage,
    CanBandage    =    true,
    BandagePower    =   4,
    Tooltip = Tooltip_UseOnHealthPanel,
    Medical = TRUE,
    WorldStaticModel = Bandage,
}

item BandageDirty
{
    DisplayCategory = FirstAid,
    Count    =    1,
    Weight    =    0.1,
    AlwaysWelcomeGift    =    true,
    Type    =    Normal,
    DisplayName    =    Dirty Bandage,
    Icon    =    BandageDirty,
    CanBandage    =    true,
    BandagePower    =   0.5,
    Medical = TRUE,
    WorldStaticModel = BandageDirty,
}

item AlcoholBandage
{
    DisplayCategory = FirstAid,
    Count    =    1,
    Weight    =    0.1,
    AlwaysWelcomeGift    =    true,
    Type    =    Normal,
    DisplayName    =    Sterilized Bandage,
    ReplaceOnUse    =   BandageDirty,
    Alcoholic    =    TRUE,
    Icon    =    Bandage,
    CanBandage    =    true,
    BandagePower    =   4,
    Tooltip = Tooltip_AlcoholBandage,
    Medical = TRUE,
    WorldStaticModel = Bandage,
}
drifting ore
#

like a suture

shut valley
#

@drifting ore
That file contains this line that checks for the pain and time modifier of the suture needle holder and needle

local basePain = 20;
if self.doIt then
if self.character:getInventory():contains("SutureNeedleHolder") or self.item:getType() == "SutureNeedle" then
basePain = 10;
end
else
basePain = 5;
end

local baseTime = 200;
-- a suture needle or a suture needle holder make it faster and less painy
if doctor:getInventory():contains("SutureNeedleHolder") or (item and item:getType() == "SutureNeedle") then
    baseTime = 150;
end
drifting ore
#

thanks

shut valley
#

@drifting ore Medical = TRUE is also only used on actual medical stuff. Ripped sheets does not have it, CanBandage and BandagePower are the only ones used there

drifting ore
#

alright

#

thanks

#

Yo. I Tried to Transfer my music

#

with True Music Mod

#

but somehow My Song just doesn't exist in the game

#

eventhough I followed all the instructions

#

to transfer my song

#

Weird.

#

Anyone got a fix or something I really really need help

tardy mural
#

While modding I found this easter egg within the games scripts:

lilac oxide
#

can someone make a chemlight mod

#

I wish we had some glowstick to throw in room that was cleared or to mark rally points. they could be found in camping and hiking stores and come in pack of 5 and last for like 12h ingame

nimble spoke
drifting ore
#

I want a graveyard mod

#

Every city has a graveyard district

stiff venture
#

how do i see the console log ?

#

got it πŸ™‚

edgy wharf
#

Trying to get ideas for a weapon mod. Would something like a riot shield mod work? You could bash with it, and the zeds would not path towards it meaning they would try and get around it?

oak stratus
#

(Originally asked in wrong channel) Am I safe from VAC if I mess about with network traffic between a -nosteam server and a -nosteam client?

opal wind
#

hey guys im trying to make a glove here give +4 strenght while equiped, i came out with this code, but its not working (dont give errors thou):

#
local function PowerGlovesEffect(_player)
    local player = _player;
   
        local strengthlvl = player:getPerkLevel(Perks.Strength);
        
        if WornItem​(java.lang.String string, InventoryItem inventoryItem) = Wiz_BatgirlGloves then
         local modifier = + 4;
      
      strengthlvl = strengthlvl + modifier;
end
end```
#

i dont know lua btw, i could use some help πŸ™‚

edgy wharf
#

How does one get the player's skill in a perk?

#

And how would I do it on a multiplayer server? For reference I want to get all players in a multiplayer server's strength perks

long grove
#

Can anyone tell me how to spawn those metal drums that you can only find at the LV military checkpoint? Whenever I spawn it from the debug menu its just a packed item with weight of 2 which is not correct and it cannot be placed (the drum normally cannot be dropped and must be placed)

weary matrix
#

@long grove looks like there's a bug in the item definition. You could teleport to a place where there is some though

tardy mural
#

But I saw someone else found a The Walking Dead reference

weary matrix
#

@opal wind oh sorry guess you already have this part covered

opal wind
#

i set it up like this now

#

local function PowerGlovesEffect(_player)
    local player = _player;
   
        --local strengthlvl = player:getPerkLevel(Perks.Strength);
        local perk = PerkFactory.getPerkFromName('Strength')
        local perkLevel = player:getPerkLevel(perk)
        
        if WornItem​(java.lang.String string, InventoryItem inventoryItem) = Wiz_BatgirlGloves then
         local modifier = + 4;
      
         strengthlvl = perkLevel + modifier;
        end
end```
#

do i need a local here strengthlvl = perkLevel + modifier;?

#

meh im so noob on lua lol

#
local function PowerGlovesEffect(_player)
    local player = _player;
   
        --local strengthlvl = player:getPerkLevel(Perks.Strength);
        local perk = PerkFactory.getPerkFromName('Strength')
        local perkLevel = player:getPerkLevel(perk)
        
        if player:getWornItem​():getType() == "Wiz_BatgirlGloves" then
            local modifier = + 4;
            strengthlvl = perkLevel + modifier;
        end
end
#

huuuum

#

does this look a bit better?

pine tree
#

So uh, who here knows about power toys?

opal wind
#

perkLevel is the strenght value right?

weary matrix
#

just replace:

local perk = PerkFactory.getPerkFromName('Strength')
local perkLevel = player:getPerkLevel(perk)``` with ```lua
local perkLevel = player:getPerkLevel(Perks.Strength)```
opal wind
#

ah i see, will test now, thanks!

#

ah bummer, nothing.. it gives this error

#

GRAVE: Error found in LUA file: C:/Users/GUSTAVO/Zomboid/Workshop/WizTradeMod/Contents/mods/WizTradeMod/media/lua/client/Wiz_BatgirlGloves.lua
ERROR: General , 1644219576542> ExceptionLogger.logException> Exception thrown java.lang.ArrayIndexOutOfBoundsException: Index 7946 out of bounds for length 31 at LexState.token2str line:251.
ERROR: General , 1644219576542> DebugLogStream.printException> Stack trace:

weary matrix
#

also change this:

local modifier = + 4;``` to ```lua
local modifier = 4```
opal wind
#
local function PowerGlovesEffect(_player)
    local player = _player;
   
        local perkLevel = player:getPerkLevel(Perks.Strength)
        
        if player:getWornItem​():getType() == "Wiz_BatgirlGloves" then
            local modifier = 4;
            for i = 1, modifier do
                player:LevelPerk(Perks.Strength)
            end
        end
end```
#

this line here dont need a ';' on the end?

#

local perkLevel = player:getPerkLevel(Perks.Strength)

#

local perkLevel = player:getPerkLevel(Perks.Strength); <--- ?

weary matrix
#

you never need a ;

opal wind
#

lol ok

weary matrix
#

unless you want to write multiple statements on the same line

opal wind
#

same error, and equip the glove dont change the strengh

#

GRAVE: Error found in LUA file: C:/Users/GUSTAVO/Zomboid/Workshop/WizTradeMod/Contents/mods/WizTradeMod/media/lua/client/Wiz_BatgirlGloves.lua
ERROR: General , 1644220172075> ExceptionLogger.logException> Exception thrown java.lang.ArrayIndexOutOfBoundsException: Index 7946 out of bounds for length 31 at LexState.token2str line:251.
ERROR: General , 1644220172079> DebugLogStream.printException> Stack trace:
java.lang.ArrayIndexOutOfBoundsException: Index 7946 out of bounds for length 31

weary matrix
#

@opal wind try this to see if it gets rid of the error:

local function PowerGlovesEffect(_player)
    local player = _player;
   
        local perkLevel = player:getPerkLevel(Perks.Strength)
        
        --if player:getWornItem​():getType() == "Wiz_BatgirlGloves" then
            local modifier = 4;
            for i = 1, modifier do
                player:LevelPerk(Perks.Strength)
            end
        --end
end```
opal wind
#

yeah that remove the error

#

so the error is here

#

player:getWornItem​():getType() == "Wiz_BatgirlGloves" then

#

maybe just player:getWornItem​() == "Wiz_BatgirlGloves" then instead?

#

because i was giving the Item name there, but i never gave its type anyway

indigo zodiac
#

good morning. can anyone help me with some advice?

mint sphinx
indigo zodiac
pine tree
mint sphinx
opal wind
#

someone know why the attachments work like this on the weapons? like reapeat 4 times the item name?

#

ModelWeaponPart = RedDot RedDot reddot reddot,

indigo zodiac
mint sphinx
proven light
#

what that means idk

opal wind
#

hum

proven light
#

but the last 2 are allowed to be omitted

pine tree
proven light
#

not sure what effects that has though

opal wind
#

its strange how they are arranged, not a ; or , just a name after the other

proven light
#

indeed there is some inconsistency in the separators for values

#

offset or color use a space as well

mint sphinx
#

it says nil at line 82. which more or less always one line ealier

opal wind
#

ModelWeaponPart = WPNMOD.pistolsuppressor WPNMOD.pistolsuppressor suppressor suppressor,

#

but i cant find on his hole mod other mention of this 'suppressor' on the 3rd and 4th places...

#

i wonder if those are vanilla code that they did not implement?

proven light
#

it could just be names to display for players in the UI

#

or for lua

opal wind
#

nah i checked his luas too

#

and he does not have a custom UI or anything

#

hes mod only have 4 files hehe

proven light
#

but theres also a lot of lua you cant see

#

zomboid lua

opal wind
#

on his mod?

proven light
#

not his mod, just on the game

opal wind
#

yeah thats what i said; i think this 'suppressor' on the 3rd and 4th palces must be a vanilla (zomboid) thing

proven light
#

SteamLibrary/steamapps/common/ProjectZomboid/media/lua

opal wind
#

but i never know about PZ having supressors

#

i will test it out tomorrow and let u know if it works somehow

proven light
#

suppressor is just a name

fair frost
proven light
#

zomboid could use it to tell attachments apart

fair frost
proven light
#

does american have police speicifcally for parks

drifting ore
#

Yes

dark solar
#

they have rangers

drifting ore
#

National Parks Service

#

Handles like

#

National park enforcement

proven light
#

urban parks?

drifting ore
#

Typically if the park is in a single county it has just the local sheriffs office enforce it

#

Urban parks fall under the cities they are in

#

So it would be local police

#

But some cities also have like

#

Parks and Recreations departments

#

Which might have their own enforcement departments

#

Its really hit or miss lol

#

And depends on the demand and the size of the parks

#

Like here in Wisconsin we have places like Kettle Moraine

#

Which are HUGE multi-county state parks

#

But are serviced by the state DNR

#

And then local sheriffs office

modern creek
#

Basically if its a small park its just whatever area police govern that region. However, state and national parks have park rangers who are employed by the National Parks Service

modern creek
#

Jan is right yea

#

United States Forest Service also does parks stuff but theyre more forest than park

indigo zodiac
left marsh
#

Im new to the game but is there a super realistic food mod?

#

Like with bmr, bf%, and calories depending on gender, activity, maybe even profession?

smoky jewel
#

is there a way to reset all the vehicle within the map and respawn it without doing a hard reset of the server?
e.g. wipe all of the vehicles within the map and spawn all the vehicles?

mint sphinx
# left marsh Im new to the game but is there a super realistic food mod?

Sound more like #mod_support question I guess but isn't the food already realistic enough? So gain and losses wait base on what you eat ^^ and nutritionist to be able to see what each thing have as fat carbs and so on ^^ also I do think you burning more calories if you move a lot in the game. Base on when I play with a friend who just read vs me running around fell like I have to eat more then he do.

hardy pollen
#

i want to overwrite the vanilla function ISInventoryPaneContextMenu:equipWeapon(weapon, primary, twoHands, player) How would i go about this? i want a check if something is true, if it is true than you cant equip weapon, if it is false do the main function self

smoky jewel
#

oh yeah, that works thanks

hardy pollen
#

can you help me πŸ˜… i am trying to overwrite a function aswel, but cant seem to find a way to get it working.

smoky jewel
#

For posteriority about vehicle spawn, vehicle reset, vehicle generate, vehicle generation, spawn vehicle, reset vehicle, generate vehicle
From my my testing:

  • In every case of an attempt to do a map-wide vehicle spawn/generation, you would have to wipe all of your currently owned vehicle
  • Vehicles.db and map_x_y.bin files would need to be removed in order to allow vehicle to spawn in that (x,y) area
  • Deleting map_x_y.bin will reset state of the area meaning any player crafted assets and items within that area will be removed
  • If you are worry about the progression you made on your safehouse, just delete every map_x_y.bin file except the area where your safehouse is. (to check the (x,y) co-ordinate use any zomboid map site and move the decimal point of x and y to the left e.g. 12222x2770 -> map_1222_277.bin). Though the area of the map_x_y.bin that you didn't delete won't have any vehicles spawned
  • It is possible to use the different vehicles.db seed of another file and apply to your current world provided that you delete map_x_y.bin area that you want the new vehicles.db seed to spawn, and then replace vehicles.db of your choice. (I have tested this by removing vehicles.db and all map_x_y.bin of my current server in order to force the game to generate new vehicles.db with different sets of vehicles)
  • Do this at your own risk / backup beforehand as I am not exert at this. I only wanted to share my findings for posteriority purpose.

please correct me if I'm wrong

mint sphinx
hardy pollen
# mint sphinx Overwrite is usual easy to do. But do not advice to do it. So you sure you want ...

yes i need to overwrite.

so this will do it?

-- Function that equip the selected weapon
function ISInventoryPaneContextMenu:equipWeapon(weapon, primary, twoHands, player)
    getPlayer():setSayLine("Test")

    local playerObj = getSpecificPlayer(player)

    -- Drop corpse or generator
    if isForceDropHeavyItem(playerObj:getPrimaryHandItem()) then
        ISTimedActionQueue.add(ISUnequipAction:new(playerObj, playerObj:getPrimaryHandItem(), 50));
    end

    -- if weapon isn't in main inventory, put it there first.
    ISInventoryPaneContextMenu.transferIfNeeded(playerObj, weapon)

    -- Then equip it.
    ISTimedActionQueue.add(ISEquipWeaponAction:new(playerObj, weapon, 50, primary, twoHands));
end
#

or after reading again ISInventoryPaneContextMenu:equipWeapon = myFunction()?

mint sphinx
#

If you do that you overwrite default function.

unborn radish
#

got the blood for my fiat working

#

only thing i need to figure out and I can't seem to find anywhere is

#

how do i set the schematic that is meant to appear here?

proven light
#

lua/client/ISUI/CarMechanicsOverlay

hardy pollen
mint sphinx
hardy pollen
mint sphinx
#

hahaha

drifting ore
#

did item tweaker api break

#

i cant change anything now

#

TweakItem("filcher.SmithingMag5","TeachedRecipes","Make 22LR Magazine;Make 22LR EXT Magazine;Make 44magnum Magazine;Make 223 Magazine;Make 223 Ext Magazine;Make 556 Magazine;Make 545 magazine;Make 762x39 magazine;Make 308 magazine;Make 308 Ext magazine;Make 9mm magazine;Make 9mm Ext magazine;Make 45 magazine;Make 45 Ext magazine;Make Tongs;Make Sheet Metal;Make Small Sheet Metal;Make Ball Peen Hammer;Make Metal Drum;Make Scrap Metal");```
#

it appears on the book

#

and the recipes are in game

#

but it just doesnt teach the player the recipes

sinful idol
#

Does anyone know of a documented API or does everyone just kind of look at how the game does it?

A good example is DoZombieStats from IsoZombie. I'm using this as a resource and it doesn't really tell me what it does:

https://zomboid-javadoc.com/41.65/zombie/characters/IsoZombie.html#DoZombieStats()

I think I understand that it updates a zombies stats from another mod however.

pine tree
#

in line 5 ACAC.currentWeapon is defined as nil, might that be it?

drifting stump
mint sphinx
drifting stump
#

if another mod tries to do something with it its likely to be incompatible

#

instead you should hook like

drifting ore
#

Is there an easy way to find out if the game is in single player or multiplayer?

nimble spoke
drifting ore
#

thanks

drifting stump
#
local oldISInventoryPaneContextMenu_equipWeapon = ISInventoryPaneContextMenu.equipWeapon
function ISInventoryPaneContextMenu.equipWeapon(weapon, primary, twoHands, player)
    --do thing before
    oldISInventoryPaneContextMenu_equipWeapon(weapon, primary, twoHands, player)
    --do thing after
end
mint sphinx
drifting stump
#

yeah i saw just reiterating and showing how to do it

mint sphinx
drifting stump
#

then you get people coming here or mod support asking why stuff isnt working

hardy pollen
drifting stump
#

then

hardy pollen
drifting stump
#
local oldISInventoryPaneContextMenu_equipWeapon = ISInventoryPaneContextMenu.equipWeapon
function ISInventoryPaneContextMenu.equipWeapon(weapon, primary, twoHands, player)
    if notFeelingLikeIt then
        return
    end
    oldISInventoryPaneContextMenu_equipWeapon(weapon, primary, twoHands, player)
    --do thing after
end
#

see no need for replace

hardy pollen
mint sphinx
#

that what is called a hook in ^^

hardy pollen
drifting stump
#

np

mint sphinx
#

yea only time i feel it okay to "override" is if you optimazi the old code and still support all the cases

drifting stump
#

and you make sure its loaded before other mods

hardy pollen
#

allright, i just needed the notFeelingLikeIt, never intended to rework functions

wooden prairie
#

is there a mod that allows me to activate god mode on main menu before actually loading my save

edgy wharf
#

Hi all, I'm trying to update the SandboxPlus mod, just the alternative combat portion for personal use as a challenge to really learn LUA and the game's API. I'm on a good track so far, I think I understand everything the mod does but I need help updating it to current build, or rewriting the code.

#

For those unfamiliar with SP... I essentially want to change MultiHit to be dependent upon the player's strength and endurance(fatigue) levels, as well as the weapon type held.

#

For example: a player with 10 strength, holding a barbell, with full endurance can hit a maximum of 8 zombies in one swing.

Whereas: a player with 3 strength, holding a butter knife, with low endurance can only hit a maximum of 1 zombie in one swing.

#

Could anyone point me in the right direction in getting started?

#

So far I'm adapting the mod name, and trying to understand all the variables from the mod and finding the methods in the game's API. This is what I have so far. Have to send in two chunks because I don't have Nitro.

#

Any tips or help updating this, or just hinting me in the right direction is GREATLY appreciated on this project.

rain pumice
#

What defines an item being usable?

#

The script or the lua

#

I can only get my item to be equipped in hand but not usable

nimble spoke
edgy wharf
#

@nimble spoke Sorry to ping you, but would you have any insights on what I've posted above?

nimble spoke
edgy wharf
#

10-4 no worries.

#

I can't really explain right now, I'm just sitting and staring at the code like "ok I have the code... What do I need to do with it?"

nimble spoke
#

it is an older mod that you're trying to update, right? What happens when you try to use it? Might want to go fetching errors in console.txt

mortal widget
#

Fuck you, get a curable form of cancer

#

<@&671452400221159444>

#

virus link

lost slate
#

ty

mortal widget
#

smooch

rose leaf
mortal widget
opaque fiber
#

anyone know when animzed's coming?

#

i thought the devs were gonna release it with .41 launch

edgy wharf
#

@nimble spoke


ERROR: General     , 1644253176033> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in OnWeaponSwing at KahluaUtil.fail line:82.```
#

--so basically at line 83, local weaponPerkLvl = ACAC.getPerkLevel(_player, ACAC.currentWeapon)
--I think ACAC.currentWeapon errors out due to calling nil

#

Updated the code with some notes.

nimble spoke
edgy wharf
#

Very well could be. It could be that anything in the mod is updated and these are outdated references to the API in general.

#

That would be a good place to start, thanks. Let me know if you think of anything else.

#

Wait yeah local weaponPerkLvl = ACAC.getPerkLevel(_player, ACAC.currentWeapon)

#

This is telling weaponPerkLvl to store the level of a perk of the player but
A: I don't think that the perk is defined?
and
B: ACAC.currentWeapon would return a value of nil because because the perk level for the weapon doesn't exist right?

winged lotus
#

Good evening all! I am searching for a way to use emote animation as action animation in timed actions.
I tried that self:setActionAnim("CeaseFire"); but it did not work and tells me that it can't find a node for PerformingAction = CeaseFire
Is there a way to achieve that or am I wasting my time and the anim is locked to emote system?

bitter frigate
#

is there a good tutorial anywhere about adding icons to mods? i've tried with two separate items and neither is displaying the icon i made, but the item i used the baking tray icon for IS displaying the baking tray. my icons are saved as .pngs in my texture folder. is that not the appropriate way to save icons?

late hound
bitter frigate
drifting stump
#

iirc they also need to be 32x32? dont quote me on this

opal wind
#

also icons MUST be 32x32 or they will be out of place on the quickbar

#

lol yes browser

winged lotus
bitter frigate
#

they don't quite fit with the game aesthetically but u know what i can fix that later jiwerweporjwe

#

my icons still aren't showing up. do i need to have the recipe file ALSO call for item_<item name>? item_<item name>.png, even?

edgy wharf
#

Update: I cannot find getPerkLevel anywhere in the API. It seems it has been replaced with getLevel()
What parameters should I pass in order to get the strength perk level?

edgy wharf
#

Can anyone confirm for me?

opal wind
#

icons are very simple, they just need to have the Item_ prefix and be 32x32, besides that there is no secret

bitter frigate
#

i failed to capitalize the "i" in "Items" so im hoping that's the issue

opal wind
#

nah

#

u can use item or Item

late hound
opal wind
#

oh he have multiple textures too? might be it then

bitter frigate
opal wind
#

show us your item script

#

ah btw you are putting the icon texture on the /texture main folder right?

bitter frigate
#

yes in /texture on it's own. /texture should be in /media right?

opal wind
#

yes

bitter frigate
#

should it be /texture or /textures?

opal wind
#

show us your script, the item code

edgy wharf
#

texture

opal wind
#

/textureS

#

no vague

#

textures

edgy wharf
#

Oh.

opal wind
#

πŸ™‚

edgy wharf
#

Welp that's me not knowing anything.

#

Literally just made a drink mod yesterday lol.

bitter frigate
# opal wind show us your script, the item code
        DisplayCategory        = FirstAid,
        Weight                = 0.1,
        Type                = Drainable,
        UseDelta            = 0.05,
        DisplayName            = Vial of Test Strips,
        Icon                = VIALStrip,
        StaticModel            = PillBottle,
        Medical                = TRUE,```

is the one being a bit of a dick right now
opal wind
#

on the script it must be like Icon = myicon, and the texture is Item_myicon

#

so your texture is named Item_VIALStrip?

bitter frigate
#

yes indeedy

cold burrow
#

Strips

opal wind
#

yeah lol

bitter frigate
#

GODDAMN IT

cold burrow
#

:D

opal wind
#

hahah

#

computer dont care if its just 1 extra letter πŸ˜›

bitter frigate
#

i feel like a DOOFUS

cold burrow
#

luv this small mistakes, pretty hard to notice and easy to fix. :D

late hound
#

it happens to the best of us

opal wind
#

they are lol, yeah happens all the time to everybody

#

guys im still trying to learn lua and make this basic code here, i really could use some help... i want this glove to give +4 strenght when equiped:

#
local function PowerGlovesEffect(_player)
    local player = _player;
   
        local perkLevel = player:getPerkLevel(Perks.Strength)
        
        if player:getWornItem​() == "Wiz_BatgirlGloves" then
            local modifier = 4;
            for i = 1, modifier do
                player:LevelPerk(Perks.Strength)
            end
        end
end```
cold burrow
nimble spoke
sinful idol
#

Hello, does anyone know if I'm doing a basic mistake here? The lua script errors out in line 4 (getRootLayer) and it doesn't really tell me anything useful (i.e. why it errors out). This is the whole code

  function handleZombieUpdate(zombie)
    advAnim = zombie:getAdvancedAnimator()
    if advAnim then
        rootLayer = advAnim:getRootLayer()
        if rootLayer then
            print("red")
        end
    end
  end
  
  Events.OnZombieUpdate.Add(handleZombieUpdate)
unborn radish
dark finch
#

If i want to add a vehicle mod would i have to wipe all the existing vehicles for them to be in the game or do they spawn in on cell discovery?

dark finch
#

DAMNIT

#

ty

drifting stump
#

they will spawn on cell discovery

dark finch
#

YES

drifting stump
#

just wanted to do an inclusive or

rain pumice
nimble spoke
fair frost
opal wind
opal wind
fair frost
rain pumice
#

I'll hit u up when i get home

opal wind
rain pumice
#

I have the lua I just cant get it to be "used"

opal wind
opal wind
#

no errors, it just dont work

#

no bonus when i equip.. i dont know lua so im trying to learn that

#

starting with that code

cold burrow
# opal wind no errors, it just dont work

Try something like this:

local function PowerGlovesEffect()
  local player = getPlayer()
  local perkLevel = player:getPerkLevel(Perks.Strength)

  if key == Keyboard.KEY_COMMA then
    if player:getWornItem​() == "Wiz_BatgirlGloves" then
      local modifier = 4;
        for i = 1, modifier do
          player:LevelPerk(Perks.Strength)
        end
      end
    end
  end
end

 Events.OnKeyPressed.Add(PowerGlovesEffect)

And then press comma in game.

opal wind
#

lol this will sound so stupid, but witch one is the 'comma' key lol

#

thank you btw i will try it now

cold burrow
opal wind
#

lol ok thanks

cold burrow
#

Any errors now?

opal wind
#

i will check in 1 minute, i got someone on the phone atm

cold burrow
#

Sure. :)

keen flicker
#

is there a mod with multiple cars at once? I have like 10 different car mods

opal wind
#

yeah i saw some mods that add more than 1 car, like apocalipse machines

opal wind
#

GRAVE: Error found in LUA file: C:/Users/GUSTAVO/Zomboid/Workshop/WizTradeMod/Contents/mods/WizTradeMod/media/lua/client/Wiz_BatgirlGloves.lua
ERROR: General , 1644269372720> ExceptionLogger.logException> Exception thrown java.lang.ArrayIndexOutOfBoundsException: Index 7946 out of bounds for length 31 at LexState.token2str line:251.
ERROR: General , 1644269372720> DebugLogStream.printException> Stack trace:
java.lang.ArrayIndexOutOfBoundsException: Index 7946 out of bounds for length 31

#

outofbounds something

#

i know its this line the problem

#

if player:getWornItem​() == "Wiz_BatgirlGloves" then

#

must code this different i guess

quartz badge
#

How would someone make new outfits that zombies can spawn with

#

But with the default clothes

glass rampart
#

@quartz badge from what i know you need to copy vanilla item path and guid to your fileGuidTable and then you would be able to use it in clothing.xml

#
        <path>media/clothing/clothingItems/Shoes_ArmyBoots.xml</path>
        <guid>227cb2d5-05a5-44ed-872d-ac4ca16e80bc</guid>
    </files>```
#

for example army boots

quartz badge
#

Maybe i’m just stupid but i didn’t get a word of that lmao

opal wind
quartz badge
#

oohhh

opal wind
#

authenicZ did that, he prb knows a great deal of it

#

he made clown zombies πŸ™‚ so cool

opal wind
# cold burrow Sure. :)

i removed the key thing it dont give errors anymore, i also used a different getFunction, but still its not working lol

#
local function PowerGlovesEffect()
  local player = getPlayer()
  local perkLevel = player:getPerkLevel(Perks.Strength)

    if player:getClothingItem_Hands() == "Wiz_BatgirlGloves" then
      local modifier = 4;
        for i = 1, modifier do
          player:LevelPerk(Perks.Strength)
        end
      end
  end


 Events.OnKeyPressed.Add(PowerGlovesEffect)```
#

looks like this atm

#

i think that for i =1 part is not doing anything, since there is no errors now

glass rampart
quartz badge
#

No this is like my first dive into stuff like this

#

Im currently making dawn of the dead zombie skins so i'd want to make outfits similar to the ones in the original movie

opal wind
#

you can mess around with the vanilla stuff, specially the ones they dont use, like the bunnysuit lol

#

or u can make custom outfits and add there too

quartz badge
#

Id want to make outfits from clothing thats already in the game, rigging too much for me

#

Although im experienced in blender i dont want to deal with making new models for this game lmao

opal wind
#

i made 150 already πŸ™‚ its fun lol

#

check the clothing list on the wiki, the IDΒ΄s are there

quartz badge
#

I'll inform you of my progress in a minute

#

Thanks for your help guys

opal wind
#

np

quartz badge
#

The old game id use to mod for had people who'd rather spit on you than tell you how to do anything

#

lol

glass rampart
opal wind
#

on workshop? prb never... i will upload on curseforge i think

#

steam makes me sick

#

people will have the 'horrible' ordeal of having to download it and put on one folder lol

quartz badge
#

Heres a few of the skins i did

#

Super rudimentary

opal wind
#

skins for the zombies?

quartz badge
#

Yes

opal wind
#

cool

quartz badge
#

I tried to make them look like the zombies from the original john romero films

opal wind
#

lol

quartz badge
#

They look way more like people than zombies are depicted today

opal wind
#

that woman looks like she got cirrosis πŸ˜„

quartz badge
#

Lmao

#

But since it was in the 70s, everybody wore stuff that people would wear in the 70s

opal wind
#

i like the 80Β΄s outfits a lot, i grow up on the 80s lol so based stuff

quartz badge
#

The shell suit jackets in the game are the best looking clothes imo

#

So colorful, its a shame they provide no protection

glass rampart
opal wind
#

well you can allawys just make a replace file and give them protection, takes like 1 minute

glass rampart
#

also do you only made costumes from comics and anime?

opal wind
#

i might just upload on steam too, i didnt decide yet lol

opal wind
glass rampart
#

tbh even if you dont like steam, you still can do both no? xD

opal wind
#

i got a sims 4 server with hundreds of dragonballs mods, i ported only a few to PZ yet

glass rampart
#

rofl

opal wind
#

you are all welcome there

glass rampart
#

well quite some free time you got there

opal wind
#

lol

#

i got a minecraft server too, but i dont did aything there for the last year, i got this large mod with almost 250k downloads there

#

kids ask me for updates all the time

glass rampart
#

well creating mods is sort of double edge sword

#

we usually do that when we want and most of the times it is bcz we have fun doing it

#

but when ppl then starts to demand updates or fixes or features

#

it becomes quite a chore

#

especially when you even stopped playing the game

opal wind
#

specially when you dont get paid πŸ™‚ u forgot that

#

and bum streamers make thousands with 'reviews' of your mod πŸ™‚

bitter frigate
#

i'm THRILLED to say the crash on left click issue for my t1d mod seems to be resolved. part of the issue was i mistyped an item name in the recipe, and another was a misplaced comma. i added icons to the items that were causing the error and the error seems to have stopped. i'm gonna have to do more intense debugging to make sure it's REALLY gone but i'm so happy things are starting to work correctly.

opal wind
#

cool

glass rampart
bitter frigate
#

that all SAID im having trouble making the player read their SugarValue out loud. i'm sure i'm making a simple mistake. any help would be appreciated!

function Diabetes.OnCreate_TeststripDRY(items, result, player)
    self.character:Say("My blood sugar is " .. tostring(SugarValue))
    -- read blood sugar
end
opal wind
#

i wish i could help u there anger, but im noob on lua too lol, i posted a simple code couple minutes ago too that i need help with πŸ˜„

bitter frigate
undone crag
#

In some functions you can reference a thing called self. This is because a thing is specifically created by a Lua script where it creates something called a metatable and calls something self. If you see a function defined with a : in the name then it means something, usually named self in zomboid, is fed into it.

bitter frigate
#

so it would look like

function Diabetes.OnCreate_TeststripDRY(items, result, player)
    player.character:Say("My blood sugar is " .. tostring(SugarValue))
    -- read blood sugar
end

or do i need to dig deeper and find what player itself can reference?

undone crag
#

player is your isoplayer java object in that context. It can Say things.

bitter frigate
undone crag
#

In timed actions in zomboid the devs have a convention where they name the isoplayer java object character, and the variable referring to it is stored on a thing they name self. So it will say things like self.character and self.item.

bitter frigate
undone crag
#

:o

bitter frigate
#

it's still not triggering :( does :Say work in single player? i assumed it did but now i'm second guessing myself

undone crag
#

Say does work in singleplayer.

#
function Diabetes.OnCreate_TeststripDRY(items, result, player)
    print("My blood sugar is " .. tostring(SugarValue))
    player:Say("My blood sugar is " .. tostring(SugarValue))
    -- read blood sugar
end

How about this?

#

Maybe you made a mistake in the recipe?

#

You seem to be trying for a long time. Are you simply returning to the main menu and reloading the game to test? Restarting the whole game would be slow.

bitter frigate
bitter frigate
# undone crag ```lua function Diabetes.OnCreate_TeststripDRY(items, result, player) print(...

alright so this is neither printing nor Saying, which means OnCreate_TeststripDRY isn't triggering, right? is there something missing from my understanding about how OnCreate works? here's the entry for the item.

        DisplayCategory        = Junk,
        Weight                = 0.01,
        Type                = Normal,
        DisplayName            = Dried Test Strip,
        Icon                = StripDRY,
        OnCreate            = Diabetes.OnCreate_TeststripDRY,
        Medical                = TRUE,
    }
opal wind
#

u can even replace models with the game opened, it refresh, but u still need to quit/reload to replace textures and codes

#

you can use the same savegame thou

willow estuary
bitter frigate
willow estuary
bitter frigate
willow estuary
quartz badge
#

So i made the texture mod, and it works if i enable it, but when i turn it off the reskin doesnt go away

#

Even after restarting the game

edgy wharf
#

@willow estuary May I PM you? I really am stuck and need some help. You can get to it whenever you have time I just don't know what is wrong with this mod.

undone crag
edgy wharf
#

I've scoured over the API and the code and everything looks right to me, but I start my game and go in and it throws this error.

bitter frigate
#

VICTORY

dark solar
#

i too shout my blood sugar on command

bitter frigate
dark solar
#

lmao

bitter frigate
#

i was thinking about randomizing insulin sensitivity factor & carb ratios per character to better capture real diversity in diabetes management, but i worry that won't be "fun". right now ISF & carb ratios are really simple (1:25 & 1:10) and lend themselves to mental math pretty easily. i'm torn between making it simple for easier accessibility or more complicated to stay truer to reality. any thoughts?

drifting ore
#

Btw can a russian make me a translation pls? There really isn't much. The equivalent of 2-3 sentences to translate. (I don't trust google translate for Russian. Am I right ?)

bitter frigate
#

i just got math.floor to work and i feel like a wizard πŸͺ„

opal wind
#

your mod will add the diabetic trait too? thats cool

bitter frigate
# opal wind your mod will add the diabetic trait too? thats cool

yeah! is there a mod out there that already DOES diabetes??? mine's gonna be a whole THING i'm really excited about it. i'm thinking of making the trait itself worth (low thirst + low hunger) as a reward for managing a whole new stat. i haven't learned much about traits yet, but i figure taking the trait will just toggle the functions? i've seen toggle buttons in other mods so i'm hopeful i can figure out how they accomplish it

drifting ore
frank elbow
#

Okay I figured, but thought maybe there was some other "quality of" phrase that I didn't know about

opal wind
opal wind
#

i dont know what is wrong here, i made just like other mods did and the vanilla, but i just cant attach the part to the gun:

#
item WizGunLightsmall
    {
        
        Type                 = WeaponPart,
        DisplayName         = Robocop Auto 9 Flashlight,
        Icon                 = WizGunLightsmall,
        Weight                 = 0.2,
        WeightModifier         = 0.2,
        StaticModel         = WizGunLightsmall,    
        WorldStaticModel     = WizGunLightsmall,
        AimingTimeModifier  = 5,
        MountOn             = WizTradeMod.Wiz_RobocopGun,
        PartType             = Canon,
        MetalValue             = 1,
    }```
#
item Wiz_RobocopGun
    {
        DisplayCategory = Weapon,
        ImpactSound    =    null,
        MaxRange    =    15,
        WeaponSprite    =    Wiz_RobocopGun,
        Icon    =    Wiz_RobocopGun,
        DisplayName    =    Robocop Auto 9 Gun,
        SoundVolume    =    20,
        MinAngle    =    0.95,
        ....................
        ShellFallSound = M1911CartridgeFall,
        RackSound = M1911Rack,
        StopPower = 2,
        MetalValue = 45,
        WorldStaticModel = Wiz_RobocopGun_ground,
        ModelWeaponPart = WizTradeMod.WizGunLightsmall WizTradeMod.WizGunLightsmall reddot reddot,
    }```
#

i tried without my Mod ID prefix too

#

the option to attach dont appear

#

i also set the attachment on the model of the gun, so i dont know what im missing here

#
model Wiz_RobocopGun
    {
        mesh = Weapons/firearm/Wiz_RobocopGun,
        texture = weapons/firearm/Wiz_RobocopGun,

        attachment reddot
        {
            offset = 0.0000 -0.0710 -0.0700,
            rotate = 90.0000 -1.0000 176.0000,
        }        
    }```
river tree
#

Woo I finally figured out how to do this (uses plaster and requires a trowel in hand)

drifting ore
#

hello?

#

can anyone help me

#

item tweaker doesnt seem to work

#
require("ItemTweaker_Core");
else return end

TweakItem("filcher.SmithingMag5","TeachedRecipes", "Make 22LR Magazine;Make 22LR EXT Magazine;Make 44magnum Magazine;Make 223 Magazine;Make 223 Ext Magazine;Make 556 Magazine;Make 545 magazine;Make 762x39 magazine;Make 308 magazine;Make 308 Ext magazine;Make 9mm magazine;Make 9mm Ext magazine;Make 45 magazine;Make 45 Ext magazine;Make Tongs;Make Sheet Metal;Make Small Sheet Metal;Make Ball Peen Hammer;Make Metal Drum;Make Scrap Metal");```
#

the recipes show up on the book

#

but doesnt teach the player

#

not sure whats happening

graceful abyss
#

Is there anyone who knows the basics of how to make a modded hairstyle in PZ (or even a modder willing to be commissioned to make a hairstyle)? I've tried scouring the internet for any information possible about it and I'm really struggling here.

modest yarrow
opal wind
#

just curious here; Did anybody made a mod that add weapons to a vehicle already? like a machine gun from those james bond cars

#

i saw a APC mod the other day, but the turret didnt fire i think

dusk saddle
#

Howdy there folks, does anybody know where the OnCreate function for recipes is in Zomboid's directory? Specifically for the candy package, as I'm trying to get a recipe that gives you candy alongside an empty wrapper, and since I know very little about lua I was hoping to use that as a reference

bitter frigate
#

im so scared to even BEGIN debugging adding this modded treatment

dusk saddle
#

Heh I can imagine that being quite the hassle

bitter frigate
#

if thats what your asking for, i mean! i may be misunderstanding

dusk saddle
#

Ah nah that should be just fine. Thank you very much haha, I'm quite slow when it comes to lua but I've wanted to make food mods on the game for years and have finally decided to take the dreaded plunge!

#

I suppose another thing I must ask for it is for this OnCreate part, do I need anything else other than just linking it with the recipe?
eg. OnCreate:Recipe.OnCreate.OpenPomps, in the item's recipe, while lua is just the information?
eg. function Recipe.OnCreate.OpenPomps(items, result, player) player:getInventory():AddItem("Base.MintCandy"); end

deft peak
#

Hey guys can we create mod suggestions here, or is it just for the techy side of mods

undone crag
undone crag
#

anger, the historical record calls diabetes a wasting thirst or one with sweet urine, a formidable wasting disease. People with diabetes passes a lot of urine, making them thirst for more water. "wasting" was because they wasted away getting thinner.

There is some evidence that type 2 diabetes was not known of or recognised in the past, and that there may be environmental influence making type 2 diabetes known of. Maybe I am not remembering right now any of the arguments against this.

There is evidence that the rate of diabetes has been increasing hugely over many decades and that there may be environmental cause for this. Some would say that people may have instead become better at documenting the cause of death as diabetes as a result of environmental changes.

Diabetes was lethal after a few years. I am thinking maybe in the zomboid context the character would actually be able to live a long time with diabetes (by a long time I mean a few years), without anything else causing end of life, and that failure to inject insulin might be best simulated by effects other than hp loss.

thin hornet
opal wind
#

this is strange, because BritaΒ΄s and the other 2 mods i look for those part scripts dont have them, but i will try anyway lol

slow sparrow
#

Hi, is it possible to get safehouses and factions in Lua on the server side? These don't seem to work:

local s = SafeHouse:getSafehouseList() 
-- s:size() == 0 
local f = Faction:getFactions() 
-- f:size() == 0 
thin hornet
drifting ore
#

Can I save a table to a file to save variable for the user? Like that they still the same even beteween character and save

thin hornet
#

sure

#

@drifting ore i use this script to serialize lua table into json and vice versa

drifting ore
#

I had thought of using json, I was just thinking that there might be a method directly in lua. As for matlab for saving matrices

#

Thx, I will try it

thin hornet
#
local Json = require("Json");

local theTable = {};

local function Save()
    local fileWriterObj = getFileWriter("file_theTable.json", true, false);
    local json = Json.Encode(theTable);
    fileWriterObj:write(json);
    fileWriterObj:close();
end

local function Load()
    local fileReaderObj = getFileReader("file_theTable.json", true);
    local json = "";
    local line = fileReaderObj:readLine();
    while line ~= nil do
        json = json .. line;
        line = fileReaderObj:readLine()
    end
    fileReaderObj:close();

    if json and json ~= "" then
        theTable = Json.Decode(json);
    end
end