#mod_development

1 messages ยท Page 110 of 1

sour island
#

I try not to jump into a big project - it eats up too much time

#

It's better if you're only working on 1 thing tbh

worldly olive
#

๐Ÿ˜‚

sour island
#

I have a few ideas, but I'm worried about starting them cause I can't stop ๐Ÿ˜…

worldly olive
#

There are way too many hidden/background mechanics added that is just to time consuming to even create documentation for them

sour island
#

Alot of documentation can come from how you name stuff

#

You don't have to comment everything

worldly olive
#

I mean yeah. But people won't read the files xD

cosmic condor
#

they don't even read the descriptions lol

sour island
#

Do you want people to make submods? Documentation is mostly for me

red tiger
worldly olive
#

That's why I stopped. I once did a documentation that had EVERYTHING, literally even the internal values of the variables, moddata, etc

#

And people kept asking "Is this trait dynamic"

sour island
#

Some people argued with me that the helicopter only comes on day 7

#

Even if they are presented with information they'll choose to ignore it

cosmic condor
#

I avoid putting multiple mods in one workshop because it can cause confusion and lead to people enabling all of them

worldly olive
#

How many years does the EHE already has? I'm still teaching people how to configure your mod in the Spanish community

sour island
#

I started it with Shark in 2020 I believe

worldly olive
#

Well, 2023 and I still teach people about sandbox options from EHE...

sour island
#

Like how they work? Or how to enable?

worldly olive
#

How they work.

#

Like if they want to have helipcopters for X time and so on

#

People just don't get it

sour island
#

I changed how they work and what they were called for that reason

ancient grail
#

Ow so you the original author of dynanic traits?

sour island
#

It used to be start day and cut off day

ancient grail
#

Genesis

cosmic condor
#

having multiple versions of the mod is a better option in case they cause conflicts

worldly olive
sour island
#

Technically it should be possible to deactivate mods if you try to toggle two on

weak sierra
#

it'd make server management hurt less

#

esp for maps

ancient grail
#

How do i use doparam and not affect everything?

weak sierra
#

but just being able to schedule updates to once a week or something

#

jesus

#

i run 500 mods on my server

worldly olive
sour island
#

That too, but also specific to skill recovery journal -- people refused to let go of a character or lose a single XP point

ancient grail
#

Is there an alternative that only alplies to an instance

weak sierra
#

can't put them in a modpack w/o violating rights or getting permission - plus it's annoying to manually maintain

worldly olive
#

Oh, only one instance

ancient grail
#

Ah so instance

#

Thnx

weak sierra
#

i'd LOVE if i could go "just continue using old version until i hit button:"

ancient grail
#

How do i capture the variable of what is currently set? If it has no getter or setter?

#

Wlso that was a quick answer btw impressively fast

sour island
#

Technically hosts could send files to players but it'd be a big strain not to mention security issue

cosmic condor
worldly olive
#

I had Intellij casually opened ๐Ÿ˜‚

sour island
#

IntelliJ is great for documenting -- if you use emmyLua - comments above functions show up when you hover over them and you can type and list arguments/parameters

worldly olive
#

I think I don't have it but will use it

#

Moved to Intellij a while ago, I used to use VSCode

ancient grail
#

I actually wrote ChuckGPT on the credits for the atmv2 mod

sour island
#

lol

sour island
hollow shadow
worldly olive
#

Btw do you guys knows if it is possible (not necessarily how, I can research that) to add new types of injuries and also comfreys?

hollow shadow
#

i think aiteron tried before

sour island
#

I've been thinking of adding more injury types ๐Ÿ˜…

worldly olive
sour island
#

More variety of injuries is one of my big projects I'm avoiding

worldly olive
#

I also want to add possibilities of scratch, burn, etc by doing daily stuff with low level but is another thing that I need to research

#

hahahaha don't avoid it!

cosmic condor
#

tooth fracture ๐Ÿฆท

#

can't eat

sour island
#

The way Id want to do it is disabled the vanilla systems and implement my own for stability and scalability

#

Something like that would have alot of depth - and it gets messy if you're juggling vanilla stuff

hollow shadow
sour island
#
  • the vanilla injuries are not objects unto themselves but fields on the class -- so it's pretty rigid
#

Same with medicine

#

That's why eating burned food is the same as eating poison

hollow shadow
weak sierra
#

they made it very clear that that's in fact not ok :P

sour island
#

It's not officially allowed, but people are going to do it and it's very hard to tell otherwise

hollow shadow
#

prolly better that way, would suck to get bug reports from outdated versions

sour island
#

Would be nice if they still included the originals as required on steam but not enabled in game

weak sierra
#

the only time i do anything like that is when a mod is pulled that had no issues and my server depends upon, and it's happened only once.

#

i try to contact the original author if i can

#

but i feel uncomfortable about the whole thing

#

tbh

hollow shadow
#

nothing wrong with asking tbh

weak sierra
#

the game loads based on mod id not workshop id

#

so if you put both workshop IDs in

#

it'll try to load both

#

override one with the other

#

etc

sour island
#

Ah true

weak sierra
#

and then if it's a map or tileset

#

it can just randomly try to load the tiles even if a totally diff id

sour island
#

They'd have to change more stuff

cosmic condor
#

many authors have released great mods and then disappeared ded

weak sierra
#

game will load tiles even if u have no copy of the mod anywhere enabled

sour island
#

lmao

weak sierra
#

i dont blame them

#

sometimes i wanna walk away too

hollow shadow
#

waiting for the "crafting menu" update

sour island
#

They're adding workbenches - I hope they made adding more in easy

worldly olive
#

Same

#

That's going to entirely change PZ and I love it

hollow shadow
#

i hope it doesnt require those tiling tools cuz they dont work on my pc

worldly olive
#

Hope most of those workbenches are spread across the factories of the map and that to use them you need to go there. That's going to motivate people to move across the map and not have an improvised factory in their bases

hollow shadow
worldly olive
#

But you can't have all the workbenches in the same base

hollow shadow
#

I like the idea of some buildings having unique crafting recipes to them but there would need to be alot of variety

worldly olive
#

I mean, not all of them to be unique to that building, but would be cool to have some unique that you can't have in your base

#

Smaller workbenches of course would make sense in your base

fast galleon
worldly olive
#

The "More X thing" is always a thing for EVERY game and it always works ๐Ÿ˜‚

hollow shadow
#

devs give us the tools and we customise it how we like lol

left path
#

Does anyone know if it's possible to allow a player to build an object that's 2x2 (or more) tiles? I looked at ISBuildingObject and ISDoubleTileFurniture but I can't quite understand a lot of the functions around squares and positions specifically

hollow shadow
fast galleon
hollow shadow
#

some double beds are 2x2 but they consist of 4 items

left path
left path
#

glad to know it's at least possible

hollow shadow
fast galleon
left path
#

ooohh, I see

hollow shadow
#

I think theres only 1 craftable bed in vanilla and its 1x2

#

wait i think theres a furniture mod that allows you to build 2x2 beds

#

nvm

#

it doesnt hav ebeds

left path
hollow shadow
#

i never messed with that stuff since it doesnt work on my pc so ur kinda on ur own

left path
#

No worries, I figured I'd put the question out there in case it had been done before

drifting ore
#

You assign each piece of the tile offset itโ€™s own item

left path
#

For context, I want to use the code for two ideas: One is bigger farming plots for things larger than vegetables, and the other is bigger graves

drifting ore
#

In tile properties

#

Craft each piece. When you have all together you should be able to place as long as the tile properties are setup to know how the tile is oriented in game

#

Via tile offsets

#

If itโ€™s 2x2 and you have all 4 items. You will be able to place the 2x2 in world if tiles are setup correctly

#

Important to define the item itโ€™s tied to in tile properties though

#

Not sure whatโ€™s all possible with code but tilezed can get you most of the way there

left path
#

I appreciate the advice, thanks!

ancient grail
#

@worldly olive unfortunatly it altered the other stuff too

#

i changed the icon

cosmic condor
#

replace the tilesheet?

ancient grail
#

imean use doparam but only apply to the current instance and not all

#

sorta like setDisplayName()

#

it only applies to that thing and not the whole for the whole world's future spawned items

worldly olive
#

So you need to change it to a single item but no the defined item itself?

red tiger
#

You can add an override image asset in the same relative path as the asset in the tileset / package.

#

(IIRC)

worldly olive
#

Not sure if the doParam works over an specific inventory item in the client code, you could try to change only that instance and not the entire item

tulip wolf
#

It may sound funny or not, but is it possible to increase the frequency of jumpscares?

ancient grail
#

not all the paramaters have getters and setters which is why doparam exist but the problem is theres no similar function to alter an instance only

#
  getPlayer():getPrimaryHandItem():setName('test')
#

but its limited to that

cosmic condor
#

not sure if there are any better method lol

ancient grail
#

getPlayer():getPrimaryHandItem():setSplatNumber(2)

#

for example

#

wont work

#

ow wait it worked

#

lol

#

bad example

fast galleon
#

lol

#

oh I got a katana

tulip wolf
fast galleon
#

now I can help people with less rank than katana

faint jewel
#

look up the tourettes guy mod.

#

it's hilarious

ancient grail
#

getPlayer():getPrimaryHandItem():setTags('CutPlant')

#

this is an example of thelimit

#

it doesnt have a set for the tags i know theres anotehr way for it but thats beside the point

#

that not all the params have set and get ๐Ÿ˜ฆ

cosmic condor
#

@faint jewel has the dupe item bug been fixed?

faint jewel
#

?

cosmic condor
#

I've seen someone post a report on your mod discussion page

faint jewel
#

it should be... I can't reproduce it.

cosmic condor
#

it happens on my friend's server too

cosmic condor
faint jewel
#

are they using controllers?

cosmic condor
#

nope

ancient grail
#
if isClient() then 
item:getContainer():removeItemOnServer(item);
end
item:getContainer():DoRemoveItem(item)
tardy wren
#

Uhh, so... How would I get all the inventories the player has access to?

sour island
tardy wren
#

I know that there's getBagsWorn, which gives me all the bags the player wears, and getInventory for the main inventory, but how do I access all the surrounding inventories the player can access?

sour island
#

There's a debug remove tool that has a lot of processes to use and cases checked for

red tiger
#

Lunch in 5 minutes. Time to get some work done.

tulip wolf
#

"EatType" would it be the animation of the drink?

tame mulch
faint jewel
#

any reason my noodle pots are inedible?

#
    item PastaPot
    {
        DisplayName = Pasta,
        DisplayCategory = Food,
        Type = Food,
        Weight = 3,
        Icon = PotFull,
        BadCold = true,
        BadInMicrowave = true,
        CookingSound = BoilingFood,
        GoodHot = true,
        IsCookable = true,
        ReplaceOnUse = Pot,
        MinutesToCook = 20,
        MinutesToBurn = 50,
        DaysFresh = 4,
        DaysTotallyRotten = 7,
        UnhappyChange = 20,
        Calories = 560,
        Carbohydrates = 109.3,
        Lipids = 2.66,
        Proteins = 18.66,
        WorldStaticModel = CookingPotPasta_Ground,
        Tags = HasMetal,
        /* added by skiz */
        RequiresEquippedBothHands = true,
        StaticModel = PA_CookingPotPasta,
        primaryAnimMask = HoldingCarryMidRight,    
        /* secondaryAnimMask = HoldingUmbrellaLeft, */            
    }```
#

the soup one can be drank. noodle cannot be eaten.

tame mulch
faint jewel
#

well then... what do i do? i should be in both hands it's a big ass pot of soup.

tame mulch
faint jewel
#

it's not the eat type that matters.

#

it's the carry mod.

tame mulch
# faint jewel

Try remove param "RequiresEquippedBothHands" and set "EatType = Pot,"

faint jewel
#

okay sure thing, AND THEN IT WILL BREAK THE CARRY MOD.

#

issa my point.

faint jewel
#

needs to be carry, and needs to be eaten.

tulip wolf
faint jewel
#

food

tulip wolf
#

soup you have to drink, not eat... i think

faint jewel
#

it's a pot of cooked noodle!

tulip wolf
faint jewel
#

๐Ÿ˜

#

it's the DEFAULT pot.

#

i just added the anim mask

tame mulch
#

Very strange

#

@faint jewel I added to this item param RequiresEquippedBothHands = true, and Eat option worked

#

I think you changed something else

faint jewel
zinc pilot
#

hey, if I wanted to propagate someone to every player on the server, is there a better way other than looping through the getOnlinePlayers list and send them stuff from there?

tame mulch
#
item PastaPot
    {
        DisplayName = Pasta,
        DisplayCategory = Food,
        Type = Food,
        Weight = 3,
        Icon = PotFull,
        BadCold = true,
        BadInMicrowave = true,
        CookingSound = BoilingFood,
        EatType = Pot,
        GoodHot = true,
        IsCookable = true,
        ReplaceOnUse = Pot,
        MinutesToCook = 20,
        MinutesToBurn = 50,
        DaysFresh = 4,
        DaysTotallyRotten = 7,
        UnhappyChange = 20,
        Calories = 560,
        Carbohydrates = 109.3,
        Lipids = 2.66,
        Proteins = 18.66,
        RequiresEquippedBothHands = true,
        StaticModel = CookingPotPasta_Ground,
        WorldStaticModel = CookingPotPasta_Ground,
        Tags = HasMetal,
        HungerChange = -10,
    }
zinc pilot
#

for example, stopping some kind of looping sound that started from a player

sour island
ancient grail
red tiger
#
      /**
       * @noSelf
       *
       * Method Parameters: 
       *  - (String arg0, String arg1, KahluaTable arg2): void
       *  - (IsoPlayer arg0, String arg1, String arg2, KahluaTable arg3): void
       */
      static sendServerCommand(arg0: string | zombie.characters.IsoPlayer, arg1: string, arg2: se.krka.kahlua.vm.KahluaTable | string, arg3?: se.krka.kahlua.vm.KahluaTable): void;
faint jewel
tame mulch
red tiger
#

How's the progress on Script Item stuff? D:

#

I can't wait to sink my teeth into that when completed.

#

=)

ancient grail
#

Is it possible to apply clothingmask via lua on an instance

tame mulch
red tiger
ancient grail
zinc pilot
#

thanks

red tiger
#

This one has generated documentation on each method signature.

red tiger
#

This is every exposed global API call. (Apart from exposed classes)

zinc pilot
#

another dumb question

#

what's the differente between sendClientCommand with player as a parameter and the one with no isoPlayer parameter?

red tiger
#

If it's split-screen is where I think you'd need to pass the player.

zinc pilot
#

oh alright, makes more sense

inner blade
#

Okay, so for some reason the mod I'm trying to make just makes pants disappear for some reason.

sour island
#

Hot

inner blade
#

Is it because I have a script named clothing_pants?

sour island
#

If you're overriding a vanilla file perhaps

inner blade
#

Well I'm trying to add more colors so would I just need to change the script name for it to work?

weak sierra
#

eat -> change values -> perform eat

sour island
#

I'm not familiar with the TINT system, but generally if you name the script the same it will replace the vanilla one

inner blade
#

Well it's not a tint, I'm manually adding different colors.

#

Like how the lumberjack has only 4 colors.

tulip wolf
#
item Heineken
    {
        HungerChange    =    -20,
        Weight            =    0.3,
        Type            =    Food,
        
    
        ThirstChange    =    -20,
        UnhappyChange    =    -20,
        DisplayName        =    Heineken,
        Alcoholic        =    TRUE,
        UnhappyChange    =    -10,
        ReplaceOnUse    =    Heineken_Empty,
        
        Icon            =    Heineken,
        CustomContextMenu = Drink,
        CustomEatSound     = Hkbottle,
        
        AlcoholPower     = 2,
        Carbohydrates     = 0,
        Proteins         = 0,
        Lipids             = 0,
        Calories         = 1500,
        Packaged         = TRUE,
        CantBeFrozen     = TRUE,
        StaticModel     = Heineken,
        EatType         = WhiteWineBottle,
    }
    
    item Heineken_Empty
    {
        Weight                =    0.1,
        CanStoreWater        =    TRUE,
        Type                =    Normal,
        DisplayName            =    Garrafa Heineken Vazia,
        ReplaceOnUseOn        =    WaterSource-WaterPopBottle,
        Icon                =    Heineken_Empty,
        MetalValue             =     5,
    }
}```
#
{
    model Heineken
    {
        mesh = Heineken,
        texture = Heineken,
    }
}```
tame mulch
tulip wolf
tulip wolf
tame mulch
#

CustomEatSound = DrinkingFromBottle,

#

item Heineken in module PWp?

tulip wolf
tame mulch
#

About model - try place model script above item script in same file

tulip wolf
fast galleon
#

do you have a "not going.x"

tulip wolf
weak sierra
#

hey now that getOnlinePlayers is useless how do we get an IsoPlayer for an online player from the client by username?

#

do i need to implement a server command to achieve that?

fast galleon
#
module PWp
{
    model Heineken
    {
        mesh = Heineken,
        texture = Heineken,
    }
}

can you test this with module Base for a moment, and say what the item modules are

tulip wolf
#

So, if the item is customized it would be from the mod, but if not, it is a vanilla Base item, correct?

#

Blender still breaks me

#

Now my model file is useless as the texture already exists in Base.

#

I believe I have to craft this item in the blender:

fast galleon
#

usually the logic is: for same module you don't need to state the module or import it, if it's a different module though then you need either to use PWp.Heineken or add

module ???
{
    imports
    {
        PWn
    }
    ...
}
#

if it fails, make everything base until you figure it out

tulip wolf
fast galleon
#

also you can put them all into the same file

tulip wolf
worldly olive
wet sandal
#

Running into a slight problem with my inventory mod, nothing too serious, but definitely annoying.
It seems that mod items are always blurry.

weak sierra
#

always?

#

that's real weird

wet sandal
#

The built in alice backpack looks nice and crisp, but the modded backpack is clearly filtered

#

That jacket is another mod item

#

on the bottom right

weak sierra
#

that mod excites me so much but i hope you put something that automatically guesses sizes based on the type of item rather than it all being configured by hand

wet sandal
#

It do

weak sierra
#

yay

#

:)

bronze yoke
#

i remember having to change some code to get the game to even render modded icons when vanilla icons were working fine, so there's definitely some internal difference

weak sierra
#

i await it eagerly then

weak sierra
#

like moodles, etc.

#

maybe everything?

#

not sure why that'd cause that issue tho

bronze yoke
#

that's true, modded items are rarely in resource packs

worldly olive
#

That inventory mod combined with the old and outdated Worse Search mod from Blair would probably be the better combination of all items lol

wet sandal
#

In Unity engine, this would simply need me to change the textures filter mode to point, but I don't see that exposed in the API

wet sandal
weak sierra
#

I don't see that exposed in the API

#

the story of PZ

wet sandal
#

Won't launch with it though, want to ship this year lol

worldly olive
tame mulch
weak sierra
#

opens from context menu so should be compat

#

assuming u keep context menus

#

xD

ancient grail
#
inviBagFuncs = {}
function inviBagFuncs.transferBagData(oldBag, newBag) 
    newBag:getModData()['isInviBag'] = true
    newBag:getModData()['prevType'] = oldBag:getFullType()
    newBag:setName(oldBag:getName())
    newBag:setWeightReduction(oldBag:getWeightReduction())
    newBag:setWeight(oldBag:getWeight())
    newBag:setCapacity(oldBag:getCapacity())
    newBag:setTexture(oldBag:getTexture())
    newBag:setFavorite(oldBag:isFavorite());
    ISInventoryPage.renderDirty = true
end

function inviBagFuncs.toggleInviBag(playerIndex, context, items)
    items = ISInventoryPane.getActualItems(items)
    local player = getSpecificPlayer(playerIndex)
    local inv = player:getInventory()
    local wearOption = context:getOptionFromName(getText("ContextMenu_Equip_on_your_Back"))
    if not wearOption then return end
    --local subMenuWear = context:getSubMenu(wearOption.subOption) 
    local oldBag = player:getClothingItem_Back()

    for _, item in ipairs(items) do
        if wearOption and item:canBeEquipped()  then
            if oldBag:getModData()['isInviBag'] then 
                wearOption:addOption("Unhide Bag", item, function()
                    local newBag = inv:AddItem(tostring(oldBag:getModData()['prevType']))
                    inviBagFuncs.transferBagData(oldBag, newBag) 
                    inv:DoRemoveItem(oldBag)
                    player:setClothingItem_Back(newBag);
                    ISInventoryPage.renderDirty = true
                end)
            else
                wearOption:addOption("Hide Bag", item, function()
                    local newBag = inv:AddItem('Base.Bag_invi')
                    inviBagFuncs.transferBagData(oldBag, newBag) 
                    inv:DoRemoveItem(oldBag)
                    player:setClothingItem_Back(newBag);
                    ISInventoryPage.renderDirty = true
                end)
            end
        end
    end
end
Events.OnFillInventoryObjectContextMenu.Add(inviBagFuncs.toggleInviBag);

wet sandal
sour island
#

I also have issues with drawn textures

ancient grail
#

havent tested it yet but if it works im just missing the function to transfer inventory

sour island
#

Compresses the crap out of them

tulip wolf
wet sandal
#

Here they are rendered at a scale of 1.0

weak sierra
sour island
#

Seems to be anything brought in from the media folder - textures from the UI.packs are fine

weak sierra
#

i have code for transferring inv

wet sandal
#

Like @sour island noted, you can see artifacting around the modded texture

#

But its defnitely not in the raw file

ancient grail
#

may i ask for it ๐Ÿ™‚ pretty pls @weak sierra

wet sandal
#

Added the background to help see any errant pixels

tame mulch
ancient grail
#

from bag to bag btw

weak sierra
wet sandal
#

I'll give them a shot

sour island
#

It's even present in vanilla textures that are from the media/ui folders

wet sandal
#

This contains the texture options

#

texture:getTextureId()

#

I'll play with this too

weak sierra
#

not rocket science

#

xd

ancient grail
#

I already know that mam. But i couldnt find the syntax of the contents like how i iterate it

#

Thats the only thing missing

#

Then in off to to test the code and pray it works

weak sierra
#

oh wait i found it

#

it's somethin blair posted once for use with upgrading bags but it applies here

#
--function to use for the OnCreate recipe paramater when upgrading bags
function Transfer_Bag(item, resultItem, player) 
    local player_Inventory = player:getInventory();
    local transferred_Items = {}; 
    local dItem;
    local texture    
    for i = 0, (item:size()-1) do 
        dItem = item:get(i); 
        if dItem:getCategory() == "Container" then 
    if player:getClothingItem_Back() == dItem then 
    player:setClothingItem_Back(nil);
    end
    if player:getPrimaryHandItem() == dItem then 
    player:setPrimaryHandItem(nil);
    end
           if player:getSecondaryHandItem() == dItem then 
      player:setSecondaryHandItem(nil); 
    end
            texture = dItem:getTexture()
            dInv = dItem:getInventory(); 
            newInv= resultItem:getInventory(); 
            dInvItems = dInv:getItems(); 
            if dInvItems:size() >= 1 then 
                for i2 = 0, (dInvItems:size()-1) do
                    invItem = dInvItems:get(i2);
                    table.insert(transferred_Items, invItem) 
                end
            end
        end
    end    
    for i3, k3 in ipairs(transferred_Items) do
        dInv:Remove(k3); 
        newInv:AddItem(k3); 
    end
    resultItem:setTexture(texture)
end```
#

can adapt the code easily

wet sandal
#

And no luck with the TextureID settings, I can't call setMagFilter without getting an error

weak sierra
#

@ancient grail ?

#

u see my msg?

ancient grail
#

wow thnx

#

wow this is pretty long

#

getItems()

#

lol thats what iwas looking for i actually thought of this while afk cant believe i didnt test thnx alot

sour island
wet sandal
#

It does seem to be the magFilter from what I can inspect though

#

The vanilla item textures have magFilter=9728

#

And mod textures have magFilter=9729

#

Assuming thats an OpenGL enum or whatever the game is rendering with

#

Or I guess constants, since java enums aren't integer backed

sour island
#

I also think it's a matter of the java texture loader

wet sandal
#

Yea the inventory is just directly rendering the textures the same way I am

#

Oh that reminds me, you've been working on extending some debugging stuff.
Just a thought I've had a few times, but it would be awesome if we could clear the error log in the F11 menu!

bronze yoke
#

it bugs me to no end that i need to scroll all the way down to see the error i actually need to be looking at

#

it sort of makes sense for debugging in gameplay, but for active development it's just confusing to have old errors lying around

ancient grail
#

ow man my context menu isnt showing up

#

ahh cuz i was editing the backup file

#

omg

wet sandal
#

Me: Attempts to add clear button to error log but also introduces an error
The error log:

molten raft
#

hey guys, quick question, how do you log/debug tables?, i just print(table), but i cant get any readable info out of it

wet sandal
#

I'd suggest putting a break point down with the table in-scope and just inspecting it

ancient grail
#

bags doesnt get wet?

bronze yoke
#

otherwise you can do a quick

for k,v in pairs(table) do
    print(k..':'..v)
end
bronze yoke
wet sandal
molten raft
#

@bronze yoke i thought of that but the log gets very large rather rapidly haha, @wet sandal i didn't know there's an ingame inspector, or is that a mod?

wet sandal
bronze yoke
#

prints are pretty slow too - you can maybe copy all the data into a variable and print it at the end

molten raft
#

@wet sandal i have launched it with that flag

wet sandal
#

Its all in the F11 menu then

bronze yoke
#

something like this, though i think the formatting can be improved a lot more than this - mostly the general idea of how that would work

local result = ""
for k,v in pairs(table) do
    result = result .. k..":"..v..","
end
print(result)
wet sandal
#

Find your script by searching in the bottom right
double click to open it on the top right
Double click a line of code to place a break point
When you hit the break point the top left fills with your variables
Double click to inspect them

molten raft
#

@wet sandal haaaa ok ok, got it. Thank you guys!

true vault
#

I have come seeking assistance again >.>

How would I remove everything from the loot tables for zeds, as well as remove clothing assignment from their sprite, so as to be able to then assign very specific items and clothing, globally?

#

I took a look at the workshop for existing similar mods, but they're mostly out of date (like.. 2017 out of date), or not quite doing what I need to do, so the Lua in them isn't what I need to learn from..

ancient grail
#

its done thnx @weak sierra

weak sierra
#

yup

wet sandal
#
require "DebugUIs/DebugErrorsWindow"

local og_createChildren = DebugErrorsWindow.createChildren
function DebugErrorsWindow:createChildren()
    self.clearedAt = 0
    og_createChildren(self)

    local button = ISButton:new(20, 0, 100, 16, "Clear", self, DebugErrorsWindow.clear)
    button:initialise()
    button:instantiate()
    button.borderColor = {r=1, g=1, b=1, a=0.1}
    button.backgroundColor = {r=0, g=0, b=0, a=0.1}
    self:addChild(button)
end

function DebugErrorsWindow:refresh()
    local text = ""
    local errors = getLuaDebuggerErrors()
    
    local howManyToShow = getLuaDebuggerErrorCount() - (self.clearedAt or 0)
    if howManyToShow > errors:size() then
        howManyToShow = errors:size()
    end

    local start = errors:size() - howManyToShow + 1
    for i = start, errors:size() do
        local str = errors:get(i-1)
        str = str:gsub("\t", "    ")
        text = text .. str .. "\n"
    end
    self.textBox:setText(text)
end

function DebugErrorsWindow:clear()
    self.clearedAt = getLuaDebuggerErrorCount()
    self:refresh()
end

bronze yoke
ancient grail
true vault
bronze yoke
#

for loot you can change the SuburbsDistributions.all.inventorymale and SuburbsDistributions.all.inventoryfemale tables, and you can use SuburbsDistributions.all.Outfit_OutfitName if you still want specific loot for specific outfits

weak sierra
#

haha

#

looks great

#

i know people on my server who'd love this..

#

though i wonder whether it would work with attachment systems

#

could just tell them to not use attachments while hiding the bag tho.

ancient grail
#

ow yeah

#

i should put a disclaimer

sour island
#

Better question is who is robbing a skeleton

true vault
#

....I'll see myself out lolz

sour island
#

hm I'm having a particular issue

#

I'm trying to sync lights in MP for flares

#

but sending the inventoryItem through commands doesn't seem to maintain it's location

ancient grail
#

you know the one that stops players and bunch of zed eats em

north junco
#

I had a fun idea for a mod. What about having the zombie infection spread through the rain and infected water? So zombies wouldn't infect you, but getting caught in the rain would.

#

What do you guys think?

wet sandal
#

Whats the counterplay? For Susceptible (airborne infection) we had gas masks. Wear raincoats and boil water?

sour island
#

Maybe I'm overthinking this all... my current flare system works based off recipes to light the flare - then the information is handed over to the server to handle the tracking -- it sends commands to client to spawn the light sources and sounds. The issue is you can hold some of the flare types while lit - and sending the flare itself over the command doesn't seem to maintain where the flare is

wet sandal
#

I recently discovered that I can enforce mod requirements through the mod.info file, but is there a way to enforce incompatibility?

weak sierra
sour island
#

Yeah I know, trying to cut down

bronze yoke
#

i actually considered zombifying water for water goes bad but i couldn't really think of a way to justify it mechanically

sour island
#

transmitModData doesn't work if the item doesn't have a square tied to it as well

wet sandal
#

People keep enabling multiple version of Insurgent then complaining the mod doesn't work -_-

sour island
#

Not sure why the inventoryItem can get passed through commands but then has no container reference

sour island
#

or post lua load -and force them to reload the lua after deactivating it

#

just add a 'reloading lua cause you can't read' pop-up ๐Ÿ‘

bronze yoke
#

you can just not run your mod if a certain mod id is active (assuming your mod is something you can prevent with lua) but i think this is sort of annoying as long as we can't communicate it to users easily

#

would be a good feature for mod manager, or the community patch

sour island
#

are inventoryItem ID the same between client and server?

#

sending items across commands doesn't seem to be a good way to bridge information

wet sandal
#

Thats really bad for me

sour island
#

perhaps I'm doing something wrong as well

wet sandal
#

I store the grid data in the items

sour island
#

should be fine

#

I think when the item is on the floor is when transmission naturally occurs

#

my issue is I needed it while it's held

bronze yoke
#

if it's in someone's inventory, does it even exist on the server?

sour island
#

kind of sort of

#

I probably need to refactor the flares system

#

make held flares work differently than on the floor or launched flares

thick karma
zinc pilot
#

is the wiki being rewritten right now?

thick karma
zinc pilot
#

well, long overdue, nice

wet sandal
#

I've renamed it in the mod menu DO NOT USE and the description details how to upgrade

#

But..

thick karma
#

Just add InsurgentVersionWhatever = true to the top of each version's file, and then in V1 you could say, "if InsurgentVersion2 then return end"

worldly olive
#

Love that this channel is like the self-help and emotional release channel about user stupidity

wet sandal
#

"their our many" heck I'm tired

#

Wait, theres a way to ask if a mod is loaded by ID isn't there

ancient grail
#

getActivatedMod()

worldly olive
#

if getActivatedMods():contains("LeGourmetRevolution") then

end

#

This?

wet sandal
#

Perfect!

tame mulch
#

Almost... done... ded

drifting ore
#

if i'm trying to get a specific number of items from players inventory as a condition, would something like this work? craftwire is my sandbox option using an integer

local Wire = inv:FindAndReturn("Base.Wire == "..SandboxVars.Nipswitch.Craftwire) 
#

since I can't figure out how to do sandboxvars for required item # in recipe. i'm going to just have craft done via world context menu.

drifting ore
#

allow server owners to control amount of each item to craft recipe

#

x wire, x scrapelectronics

#

x is sandboxvar

#

i couldnt figure out using recipe script

tame mulch
#

So, player will can craft only X items, and then can't craft this item anymore?

drifting ore
#

no. like this

#

recipe Right Light Switch {
keep Screwdriver,
keep Wrench,
keep Scissors,
Wire=10,
ElectronicsScrap=25,
DuctTape=4,
Screws=10,

#

i want those to be sandboxvars

tame mulch
#

Hmmm

drifting ore
#

the wire amount scrap amount

#

i been trying 4 days

#

i was going another route to just find the items in inventory

#

and just add new context menu option but look for the items in inventory then just have the craft happen from choosing context menu but using oncreate or w/e

#

i already made workaround for using lightswitch outside of roomdef by using lightswitch like a lamp and increasing radius of light

#

that is inside player base haha

tame mulch
#
getScriptManager():getRecipe("Right Light Switch"):findSource("Base.Wire"):setCount(69)

#

Try this

drifting ore
#

ok thank you for suggestion

zinc pilot
#

mh is SetID() for items non functional in Lua?

tame mulch
drifting ore
#

oh shit! it worked!

#

ty @tame mulch

#

my mind is blown away

zinc pilot
true vault
bronze yoke
#

does that actually work? i was under the impression their inventory didn't even generate until someone looked at it

true vault
#

Yep, it seems to work just fine. Killed several zeds with that active, and nothing in their corpse.

I suppose it's possible there's a microsecond where there's items in the inventory, and they are removed faster than you can even see, but I'm not sure because I had the function also print to console when each zed was killed, and it fired without me looking at it, so, maybe it's possible the call to grab the inventory forces it to generate?

bronze yoke
#

huh! well that's good

true vault
#

All I need to do now is somehow swap their outfit to nothing.. can probably attach that to OnZombieUpdate

#

Well, more specifically, to a specific outfit. Haven't been able to affect that at all.

bronze yoke
#

you can change their outfit onupdate but the performance is absolutely dreadful

#

i'd definitely try to mess with the zones to get them spawning the way you want instead of changing them after they spawn

true vault
#

Yeah, my log being spammed by the print I did during it certainly agrees with that haha

bronze yoke
#

oh gosh, don't attach a print to an event that fires that much - my game straight up crashes if i do that, prints are incredibly performance heavy

true vault
#

Is it possible to create a new "type" of zed, or like, an outfit, and ONLY have the game spawn zeds with that outfit?

bronze yoke
#

my guess is that messing with the zone definitions like i was talking about earlier would let you do that

true vault
#

Yeah, I'll take another look and see; might dissect AuthZ

ancient grail
#
local tick = 0
function samplefunction(var)
  tick = tick+1
  if tick==30 then
    print(var)
    tick=0
  end
end

and if u use OnTick by default the parm is tick

Learned this from Burryaga

#

using mobile so no indentions

willow estuary
#

They don't generate loot until they're a corpse that has a container, yes.

bronze yoke
#

oh right, i must've confused it with living zombies not having an inventory

#

i have some code to rewrite ๐Ÿ˜…

willow estuary
#

Containers aren't containers until they "exist", and that is generally the point at which they spawn loot, either as becoming part of a player's ~150 tile reality bubble, or cases like zombies being killed and the live zombie being replaced by a corpse that is a container.

bronze yoke
#

i was generally aware of this, i just thought corpses were special for some reason - but clearly they're not

willow estuary
#

The misinformation re containers and loot spawn conditions is bizarrely persistent. I guess it's a case of assuming w/o following up with experiential evidence.

faint jewel
#

if you walk around a box clockwise before opening it, it will have a gun in it

ancient grail
faint jewel
#

that's for the minigun.

#

shhhhhhhhhhh

ancient grail
#

Hahahaa

bronze yoke
#

what happens is one person does something wrong, assumes that the thing they're trying to do is just impossible, and tells everyone about it

willow estuary
#

Yeah, that's a thing alright ๐Ÿ˜„

drifting ore
#

a word i try so hard to keep out of my vocab

sour island
#

that was basically the most common response a few months back

#

when the goto method of modding was browsing classes 1 by 1 unhappy

ancient grail
#

so is it now possible to restart the server via lua? Still no

tulip wolf
#

The game has some events like: OnZombieDEATH?

drifting ore
#

you only need to have a save and quit setup

ancient grail
#

I wonder how udderly did it

drifting ore
#

udderly didnt

ancient grail
#

Ow

bronze yoke
#

udderly stops the server with lua

drifting ore
#

they use outside source for restart

drifting ore
#

i just loop my .bat with it

tulip wolf
#

I'm trying something like:

Events.OnZombieDeath.Add(function(zombie)
  local x, y, z = zombie:GetPos()
  
  -- spawns the specific item at the location where the zombie died
  Object.Spawn("Item", x, y, z, {
    Item = "Water Bottle"
  })
end)```
ancient grail
#

GetPos?

bronze yoke
#

i remember someone telling me that moddata could only store numbers and strings, and when i followed up on it i found that this had actually been true, and was changed in... 2013 ded

tulip wolf
sour island
#

reminds me of the 'you can survive a bite' thing

sour island
#

check InventoryItem class' methods/functions

#

you can use zombie:getSquare() as spawning items can be done with a square as a param

glass basalt
glass basalt
#

If I add a condition to check for a type of item using the events onEquipPrimary and onEquipSecondary, just to add functionality to new items that I'm making, would this be a stupid idea with a high amount of traffic?

drifting ore
#

don't wanna @ him but Thank you again Aiteron. didn't even think it was possible to change items required for recipe using sandbox options so easily

#

in case anyone ever wants or needs

local function recipeAmounts()
    local wireNum = SandboxVars.Nipswitch.Craftwire
    local getScriptManager = getScriptManager
    local switchRecipe = getScriptManager():getRecipe("Right Light Switch")
    if switchRecipe then
        switchRecipe:findSource("Base.Wire"):setCount(wireNum)
    end
end

just my example but works very well.

#

seems to last the session

weak sierra
#

@drifting ore very excited for this update :)

drifting ore
#

Me too haha very soon this week prolly

weak sierra
#

i showed users the gif up there and they are excited :)

red tiger
#

๐Ÿท buzzed modder gang

tame mulch
#

ded 220 from 333 params translated drunk

tulip wolf
#

guys the script is not running...

    local square = zombie:getSquare()
    local item = InventoryItemFactory.CreateItem('Base.item_id')
    square:AddWorldInventoryItem(item)
end
Events.OnZombieDeath.Add(onZombieDeath)

Does the OnZombieDeath event exist?

drifting ore
#

OnZombieDead

tame mulch
tulip wolf
#

working, but the item didn't appear when it died

drifting ore
#

item name not correct?

tulip wolf
drifting ore
#

full or empty

#

๐Ÿ˜„

tame mulch
drifting ore
#

ayy

tulip wolf
#

I tried another way and it worked, thanks guys

limber oar
#

When using ClothingItemExtra/ExtraOption ("Hoodie Up" and all that jazz), is there any good way to get it to stick to the same "Type" (i.e., texture)? For example, you're wearing Type 2 of an item -- the second of its possible color options -- and you use the ExtraOption to swap to its sister item, and that sister item also appears as its Type 2 variant?

I've got a bunch of ribbons with different colors and I'd really like to avoid making, like, 15 different .xml files / items for each color and position if it's not absolutely necessary.

glass basalt
#

Why do server hosts have to such asshats

#

This is like the 16th request I've seen

#

for this mod alone

twilit onyx
#

Iโ€™m try to make a mod which extend metal working
I โ€˜am trying to add a recipe of turning 3 Accessories into workable iron using hammer
here is the example

keep [Recipe.GetItemTypes.Hammer],
Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond=3,
    
    ;workable iron = ironingot in the game code
    Result:ScrapMetal=1,

The problem is now i need 3 of the same type
changing the code to the following will prompt the recipe to appear even if you have just one Necklace but will result in error because the insufficient amount...

keep [Recipe.GetItemTypes.Hammer],
Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
    
    ;workable iron = ironingot in the game code
    Result:ScrapMetal=1,

so is there a way to make a code to use 3 necklaces of different types??

drifting ore
#

evolvedrecipe

#

one sec here. i think they use tags also

twilit onyx
#

evolvedrecipe ironingot
{
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:Sandwich,
Name:Make workable iron,
}

#

like this?

drifting ore
#

hey there you go lol

#

except no sandwhich

twilit onyx
#

i got a sandwish XF

drifting ore
#

sorry doing a lot myself haha

twilit onyx
twilit onyx
twilit onyx
#

evolvedrecipe ironingot
{
keep [Recipe.GetItemTypes.Hammer],
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:Sandwich,
Name:Make workable iron,
}

#

its not working

ancient grail
drifting ore
#

type also and other some other things

twilit onyx
#

i think adding the hammer part is wrong

drifting ore
#

oh yea

#

if you already import or use Base then you just use item name

#

keep Hammer

ancient grail
#

Get types isnt about module nippy

#

Its to get all the hammer like items
Like stone hammer and the other one with round end iforgot the name or modded hanmer (not sledge lol)

drifting ore
#

oh you are right i didn't even notice the getitemtype part

ancient grail
#

GetItemTypes.SharpKnife for example you might imagine theres alot of variation

#

Ow ok

drifting ore
#

yea i dont know if there is tag for jewels?

#

metal ones i should say

ancient grail
#

Theres non.

#

They should add that as vanilla. I mean all the acc should be in one tag

drifting ore
#

result item hammer lol ๐Ÿ˜„ worst case lololol

tulip wolf
#

I need a function that plays a base sound, example:
playSound("sound.ogg")

playSound, does it exist?

Where can I see a list of events/functions/methods?

drifting ore
#

if its base item and result item it should still be there after the craft haha

drifting ore
#

also if you feel like decompiling there is guides as well.

#

also searching files ๐Ÿ˜„

bronze yoke
drifting ore
#

more up to date?

bronze yoke
#

technically slightly out of date, but it has parameter names

drifting ore
#

ooo ty

bronze yoke
#

it also has a tiny bit of documentation, but it's really really sparse

#

the parameter names make it way way way clearer what a method actually does and what it wants from you without looking at the source

drifting ore
#

i'm practically the blind leading the blind here so i appreciate it lol

twilit onyx
#

btw what file should i reload using the f11 to refresh the new recipes... i already closed and opened the game 7 times...

drifting ore
#

it should show if it's all good

twilit onyx
#

no it didnt show ๐Ÿ˜ฆ

drifting ore
#

something not right

bronze yoke
#

if you have the mod disabled on the main menu and enabled on the save, you can just reload the save

twilit onyx
#

evolvedrecipe ironingot
{
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:Sandwich,
Name:Make workable iron,
}
i deleted the hammer but still no use

bronze yoke
#

why are you using an evolvedrecipe? that doesn't seem to be useful for this kind of recipe

hazy raft
#

think it's possible to change the game's perspective from what it is now to 3rd person view?

drifting ore
#

metal sandwich why not? LOL

twilit onyx
#

evolvedrecipe ironingot
{
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:ironingot,
Name:Make workable iron,
}
Mb

drifting ore
#

what is your suggestion albion lol

#

you are recipe guru here haha

bronze yoke
#

my suggestion is don't use an evolved recipe, use a normal recipe, unless there's some reason for it i'm not seeing

drifting ore
#

it seemed logical hahaha

bronze yoke
#

someone had a similar issue a bit ago, let me check how/if that was resolved

ancient grail
hazy raft
#

dang XD

ancient grail
#

If u want you can mod the whole world for that

#

You will become a legend among legends

twilit onyx
#

i think i know where i can find the answer

#

dismantling digital watchs?

bronze yoke
#

doesn't that just need one watch?

twilit onyx
bronze yoke
ancient grail
#

I just saw this post dated jan 26

bronze yoke
#

they were doing something with berries and they could make it so that you need 25 total hunger worth of berries

ancient grail
#

I blue print already a thing?

bronze yoke
#

this is b42

hazy raft
twilit onyx
ancient grail
bronze yoke
#

somebody was working on it months ago, but i think they gave up on it

hazy raft
#

making a game out of the game's modding code

twilit onyx
twilit onyx
drifting ore
#

dont give up

#

there is a way

#

100%

bronze yoke
#

you might be able to ensure there are 5 different items with an ontest function

ancient grail
#

Ye dont give up
Whats wrong

bronze yoke
#

that idea floated around a few times but i don't think anyone wanted to actually work on it LOL

rancid panther
#

is there already an item in the game the recovers pain when applied to a body part that is feeling pain or is injured?

#

or only actual wounds?

twilit onyx
#

the only workaround i'am able to think is to add each it separately

drifting ore
#

thats it

#

right there

bronze yoke
#

that's the same as setting it in the script

drifting ore
#

but you can add them all in an array and it will accept them right?

#

or 1 by 1

bronze yoke
#

if you have one condition for 3 it only accepts three of the same type of item, if you have 3 conditions for 1 one item satisfies all 3

drifting ore
#

ahhhhhhhhhhhhhhhhhhhhhhhhh

bronze yoke
#

the only way i can think of doing it is having 3 conditions and just checking there is actually 3 different items with an ontest function

#

but then the recipe will still go ahead with the one item so you need to also use an oncomplete(? don't remember what this one is called exactly) to delete the extra items

drifting ore
#

i spose that doesn't seem too bad to try at least

twilit onyx
#

i have a work around tho, but not optimal...

#

transforming each single Accessory into another new item
then 2 of the new item makes the workable iron

bronze yoke
#

ooh that sounds good

twilit onyx
#

but i really hope that the devs consider adding such command

#

or improve the recipe command

bronze yoke
#

b42 is very likely to resolve this

twilit onyx
#

i hope so

bronze yoke
#

i just can't imagine a full crafting tree would never run into this problem

twilit onyx
twilit onyx
drifting ore
#

np lol good thinking

tame mulch
red tiger
#

Its 2:30 AM however I'll try to take a look at it this weekend.

ancient grail
#

i wish modders recieve the spiffo merch after a certain point ๐Ÿ™‚ courtesy of either steam or TIS. just a thought lol

#

my daughter would love that

cosmic condor
#
#

5073 sold

ancient grail
#

damn

cosmic condor
#

SOLD OUT

fast galleon
#

Anyone have a guide which item script parameters work? Quirks / bugs list.

zinc pilot
fast galleon
#

From the top of my mind
DisplayName can be manually changed by using setDisplayName (script value, DoParam don't work)
anim masks(?) can only be set inside script and not changed with DoParam
...

ancient grail
#

Yes these are facts polt

#

Idk abt the guide might eant ro check aiterons current work

#

I also faced the same problem last night with the doparams
Cuz it affects all while i just want to change and instance
Since i cant change the clothingitem param
I had to create a new bag
And replace the current bag just to fake the hiding thing
And just stored the original properties as moddata

#

So that you can toggle back
Un hide

#

@fast galleon

buoyant violet
#

Im trying to make a simple function, that checks for a gun on equip and replaced the gunSound, I have around 3 days of reading material from zomboid so this may be extremely silly

sour island
#

Isn't gun sound a scripted value?

ancient grail
#

can i store png on the \Saves folder

#

and then the script items would still be able to use it as texture

buoyant violet
#

Idk if am lacking something to triggering it but this is the file

sour island
#

Is GWP your mod or are you trying to patch someone else's?

buoyant violet
#

It's gunsrunner mods the addon for VFE

#

I liked more when it had the vanilla sounds

#

But my patch on mind could in theory look to patch any mod without altering the original uploaders work

tame mulch
cunning canyon
tulip wolf
#

Has anyone tried changing the sound of the steps? Example of walking on wooden floors...

cosmic condor
#

What is the lowest number of ProceduralDistributions that we can set?

#

Value

#

I would like to set lower than 0.1

sour island
tulip wolf
#

There's more than one footstep sound, the sound is probably a sequence, right?

tulip wolf
tame mulch
#

I think you can only replace default sounds

tulip wolf
#

I'm using the sounds from the media/sound folder

tame mulch
sour island
#

The sounds are banked, the loose ones don't replace the banked files. If a file isn't found in a bank it then looks for a corresponding sound script, if it can't find that it grabs a loose file with the same name

#

@tame mulch a footstep Hook as well as Event would be nice. Could do a lot of fun stuff with those two.

#

Also there's an event for player move -- you could theoretically make the default sound blank and force your own that way based on what's being stepped on.

#

I guess on player move is the appropriate event actually

#

But a Lua hook would let you bypass the vanilla methods

tulip wolf
sour island
#

I believe you'd have to edit the bank files to change those specific sounds

#

I don't think vanilla sounds use sound scripts - but I could be mistaken

tulip wolf
#

I'm reading all .bank

sour island
#

Oh, carry on then

shy hearth
#

Eyo, does anyone have any experience working with the climateManager?

#

I'm trying to generate fog programatically, and it's working for the most part

#

but every ten minute tick the fog like, dips out and then comes back again

craggy furnace
#

@tame mulch checked it, is perfectly legible

shy hearth
#

i'm not sure if it's conflicting with some vanilla function or if I've got a bug in my code but if it's in my code I'm at a loss trying to find it

craggy furnace
#

great work

tame mulch
calm depot
#

nice birb artwork

weak sierra
red tiger
drifting ore
# cosmic condor What is the lowest number of ProceduralDistributions that we can set?

i use extremely low and it works as intended.

local function nipswitchBook()
local list = ProceduralDistributions.list
local targets = { BedroomSideTable = .000000001, BookstoreStationery = .00000001, LibraryCounter = .00000001,
                 OfficeDeskHome = .00000001 , LivingRoomShelf = .000000001}
local item = "Base.Lightswitches_fordummies"

for k,v in pairs(targets) do
    local items = list[k].items
    table.insert(items, item)
    table.insert(items, v)
        table.insert(items, "Base.Lightswitches_fordummies")
        table.insert(items, SandboxVars.Nipswitch.Bookchanceplace * 0.0000001)
    end

targets = {inventoryfemale = 0.000000001, inventorymale = 0.000000001}
for k,v in pairs(targets) do
    table.insert(Distributions[1].all[k].items, item)
    table.insert(Distributions[1].all[k].items, v)
    table.insert(Distributions[1].all[k].items, "Base.Lightswitches_fordummies")
    table.insert(Distributions[1].all[k].items, SandboxVars.Nipswitch.Bookchancezombie * 0.0000001)
    end
    ItemPickerJava.Parse()
    end

too much misinformation around how it works so i'd just do what works for you

#

use lootzed to confirm if it spawns ofc and the % and if you see an E in the value, then you know its EXTREMELY low lol

drifting stump
#

Busy bunch of days i had

#

Distributions should be a double iirc so you can use any number representable

drifting stump
#

?

#

a java double

cosmic condor
#

no idea what it is lol

drifting stump
#

should be fp64 i think?

cosmic condor
#

googling it now

#

I guess I understand now

#

thanks for the additional input

drifting stump
#

Also keep in mind chances are related with the sum of all items

drifting ore
#

all items in that container*

#

or def or however you wanna call it. had to get this confirmed by one of the devs also since i heard 3 diff theories ๐Ÿ˜„

#

don't really get how loot stuff has so many diff theories of how it works

drifting stump
#

yeah the same of that table

#

theres a bunch of wonky stuff going on

#

even i dont remember everything but i did read the whole code

#

zombie density in the area also affects chances

cosmic condor
#

that's new to me

sour island
#

It's a double but it's also multiplied a few times

drifting ore
#

oh someone mentioned that also... i forgot about that

sour island
#

So there's probably some buffer room

drifting ore
#

the zombie pop affecting

#

Hello, I'm new to making mods and I wanted to make one to re-scale the game interface, for example when going from a default resolution of my monitor of 1366x768 to 1280x600 in the game the menu and the animated background move to the left but other items no. So I thought of making a mod to fix that. But I don't know if that's possible.

drifting stump
#

most ui stuff can be modded

#

does that still happen after a restart?

drifting ore
#

yes

sour island
#

if Rand.Next(10000) <= chance(modified by luck) * 100 * lootmodifer + zombiedensity * 10

#

This is what the loot chance calc was a while ago - may have changed

red tiger
#

When my LTTS transpiler is competent, I'll resume work on the HTML UI engine.

drifting ore
sour island
#

It's modified elsewhere

jaunty marten
sour island
#

Oh lol

jaunty marten
#

nvm, just a rofl LUL

red tiger
#
function nextDouble() return Rand.Next(1000000000) / 1000000000) end
#

mmmm

#

I like me double coin flips.

fast galleon
atomic gyro
#

do it

drifting ore
#

i think you need a better understanding of what server options are available before you suggest mods

atomic gyro
#

whatchu mean

drifting ore
#

this is not the mod suggestion channel or debate about game mechanics channel... but i will only say this. most of your issue is with PVP balance which has already been explained that game does not revolve around pvp in its current form. your best bet is to learn how to mod for pz and learn how you can build a server to your liking

#

when you do that. you will be very pleased and feel rewarded ๐Ÿ˜„

#

even most of your concern though is addressed through specific server settings and a couple existing mods out there

atomic gyro
drifting ore
#

oh yes! much material for learning

#

also Aiteron is rewriting many of the pzwiki guides for modding right now

#

look at the threads up top

drifting ore
#

there is mod tool and links for all the good stuff

#

even some tools that help you decompile the game to see how things are done with vanilla game code

buoyant violet
#

I think I may be able to achieve the gun sound with this

#

cross fingers for me

drifting ore
#

oh you made an array for all the guns?

#

did you get one working first? lol

fast galleon
#
zx = 1.2
zx:floatValue()

print(zx)
1.2

print(zx:floatValue())
1.2000000476837158

zx = zx:floatValue()
print(zx)
1.2000000476837158

interesting this converts to float but zx stays the same

lunar robin
#

So I have this array for random name generating, but it wouldn't work for some reason, like the event is not triggered properly.

local firstNameArray = {"Ivan", "Michael"}
local lastNameArray = {"Jackson", "Buba"}
local function GenerateName(player)
    local firstName = firstNameArray[ZombRand(1, #firstNameArray+1)]
    local lastName = lastNameArray[ZombRand(1, #lastNameArray+1)]
    getPlayer():getDescriptor():setForename(firstName)
    getPlayer():getDescriptor():setSurname(lastName)
end
Events.OnNewGame.Add(GenerateName)

However, when I type this code (without event) in the lua interpreter ingame, it works... Any suggestions would be appreciated.

ancient grail
#

are equip items like bags and weapons on hand considered to be part of the

getPlayer():getInventory() 
fast galleon
#

yes, in vanilla

#

mods / bugs can break this logic

ancient grail
#

so what do i do when i want to check i the polayer has a specific itemeither on his inventory or bag or equipped wherever

#

i see

#

how do i check for custom attachment locations then

#

imean modded attachment

fast galleon
#

are you looking for a specific type or specific obj?

ancient grail
#

like iterate over all possible attachments

#

a specific obj

#

or letsay objects that contain either one of the tags

#
item:getItemsTag("myTag1") or item:getItemsTag("myTag2") or item:getItemsTag("myTag3")
fast galleon
#

what you typed + :getItems():contains(obj) is a possibility.

#

let me check what the tags code is

#

containsTagRecurse(string) returns true / false

#

getFirstTagRecurse(string) to get item

#

these are done on the ItemContainer

#

if you have multiple tags maybe it's better to do

ItemContainer obj:getFirstEvalRecurse(function(item) return item:hasTag("myTag1") or item:hasTag("myTag2") end)
ancient grail
#

ow yeah recurse

#

good idea

#

wait why is there an item container on the left

bronze yoke
#

it's the type

ancient grail
fast galleon
#

test it ๐Ÿ™‚

bronze yoke
#

i don't think equipped items leave the inventory

#

so it should be fine

ancient grail
#
ISWorldObjectContextMenu.doFillFuelMenu = function(source, playerNum, context)
    local playerObj = getSpecificPlayer(playerNum)
    if source:getSquare():getBuilding() ~= playerObj:getBuilding() then return end;
    local playerInv = playerObj:getInventory()
    local allContainers = {}
    local allContainerTypes = {}
    local allContainersOfType = {}
    local pourInto = playerInv:getAllEvalRecurse(function(item)
        -- our item can store fue, but doesn't have fuel right now
        if item:hasTag("EmptyPetrol") and not item:isBroken() then
            return true
        end
        -- or our item can store fuel and is not full
        if item:hasTag("Petrol") and not item:isBroken() and instanceof(item, "DrainableComboItem") and item:getUsedDelta() < 1 then
            return true
        end
        return false
    end)
#

similar to this??

#

or no

#

whats the diffrence with getAll

fast galleon
#

small changes depending if you want just a bool, the first item, best item, all items

#

this seems right

ancient grail
#

yeh i just need a bool

#

ahh so playerInv:getAllEvalRecurse

#

includes the containers

#

outside

#

?

fast galleon
#

inside playerInv

#

checks inside bags also

ancient grail
#
local function dakiBuffEffect()

    local player = getPlayer()
    if player:getInventory():getFirstEvalRecurse(function(item)
        return item:hasTag("DakiWeapon") or item:hasTag("DakiArmorFront") or item:hasTag("DakiArmorBack") 
    end) then

        local bodyDamage = player:getBodyDamage()
        local stats = player:getStats()

        bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - (bodyDamage:getUnhappynessLevel() / 4))
        if bodyDamage:getUnhappynessLevel() < 0 then
            bodyDamage:setUnhappynessLevel(0);
        end
        if player:isAsleep() then
            stats:setStress(stats:getStress() - (stats:getStress()/ 4))
            if stats:getStress() < 0 then
                stats:setStress(0);
            end
        end
    end
end
Events.EveryTenMinutes.Add(dakiBuffEffect) 

#

this is what i have so far

#

@fast galleon what ya think?\

#

did i apply the code you gave correctly

#

or do i literally type how you wrote it

#

cuz i dont have an obj param

fast galleon
#

looks ok

odd notch
#

any way to add a tile to spawn with trees?

#

say, in the same way that tileoverlays are spawned?

fast galleon
lunar robin
ancient grail
#

Or isoTrees? Maybe thats aa thing i forgot

odd notch
#

so you think i could hijack the tileoverlays checker to run my check for a tree, then spawn an object?

#

i will attempt this

#

i'm trying to add mining nodes

#

but i need a way to organically spawn them in the wildsโ„ข๏ธ

ancient grail
ancient grail
#

Sounds expensive to do

odd notch
ancient grail
#

Nice

odd notch
#

if i recall tileoverlays are generated at the mapโ€™s first generation so not too expensive

ancient grail
#

The audio could do better with a oittle adjustment cuz it its not sync with the pickaxe hit

ancient grail
#

Ow gotcha
Anyways so you made the other mining mod
Mines crap anyways

odd notch
#

mine is yet released

ancient grail
#

Ah so it wasnt you

#

I would definitely have noticed it if it was you

#

@fast galleon is there an event or something i can use for checking when a player places items in the world

I mean the rightclick place

#

The drop item isnt the same i think?

sacred matrix
#

Does anyone know the best way to programmatically control a zombie's clothing? The following snippet doesn't work:

        local soleClothingItem = InventoryItemFactory.CreateItem('Base.Jacket');
        local desc = SurvivorFactory.CreateSurvivor();
        desc:getWornItems():clear();
        desc:setWornItem(soleClothingItem:getBodyLocation(), soleClothingItem);
        targetZombie = createZombie(x, y, 0, desc, 0, IsoDirections.S);
        targetZombie:DoZombieInventory();

I looked at the bytecode for LuaManager#createZombie, and it seems the 'desc' parameter is completely ignored. So what's the proper approach?

bronze yoke
#

i think you can just do targetZombie:setDescriptor(desc)

#

it might be easier to use targetZombie:getDescriptor() and modify that but it depends on your usecase

sacred matrix
#

Alright, I'll give that a shot, let's see...

fast galleon
sacred matrix
fast galleon
#

ISPlace3DItemCursor -> ISDropWorldItemAction, not sure about events

fast galleon
sacred matrix
#

@fast galleon So it's not possible to programmatically create and add a piece of clothing?

fast galleon
#

haven't tried that

#

didn't notice you wanted that, sorry

#

IsoZombie extends IsoGameCharacter so maybe you can use setWornItem

#

basically what you did, just add it directly to the zombie

sacred matrix
#

I did that, and no dice. It's like any zombie made with createZombie cannot have its clothing changed.

ancient grail
#

the code earlier didnt work btw idk why

#

il try to fiogure it out using debug

stable ether
#

anyone have a good way of adding context menus or sub menus?

ancient grail
#

I use AuD as template for context menu

sacred matrix
#

OK, it looks like I can achieve it by creating a named outfit and using addZombiesInOutfit()

fast galleon
limber oar
#

Anyone know offhand whether it's possible to add tooltips to clothing, or is that reserved solely for proper "items"?

jaunty marten
fast galleon
sour island
#

Items have a tooltips param for scripts if you just need a single line of text

winged sluice
#

does anyone know if there is or if anyone is working on fish tanks as either just for show or to store fish in and keep as pets ?

drifting ore
#

what is the first event that happens when player data is available by chance, if anyone knows?

drifting ore
#

OnNewGame worked for my case

thick karma
nova socket
#

Is there any global data namespace between server and client, aka getModData but not tied to specific object?

thick karma
#

I think not.

sour island
#

There's global modData

thick karma
#

Pretty sure you need to use server-client ping pong to communicate between server and client @nova socket

thick karma
#

I mean there is an easy transmit function

sour island
#

There's events for receiving modData

thick karma
#

Right I don't think that's what he meant but I suspect that works for what he's probably trying to do

sour island
#

It's not very simple/easy to implement

nova socket
#

Simple as is to keep join-in-progress data between client that were in-game and weren't without re-transmitting it on each N time.

sour island
#

I have it go one way to clients and have commands to alter server side

nova socket
#

Its not about clients altering anything its about them getting state of existing data after they re-connect into existing game

#

Server has a bool, bool has a state, players come and go but I want to know if all of them keep the same state of that bool.

#

But I might just transmit it on connect event

#

Oh I see a solution ModData has
static request(arg0: string): void;
static transmit(arg0: string): void;

So you can both transmit and request data from it.

ancient grail
#

anyone know what moodle is affected by sleep

worldly olive
ancient grail
#

what stats

#

like i want to control the sleepiness of a player

#

im not sure if its fatigue endurance or what

#

i bet its fatigue

worldly olive
#

Fatigue

#

The fatigue level controls the sleep moodle

ancient grail
#

yep got it

#

i actually foun dit but i cant find the mutual of night owl

#

cuz i dont know what its called

worldly olive
#

Nightowl doesn't have a mutual exclusive trait

#

NeedsLessSleep
NeedsMoreSleep
Insomniac

Those are the sleep related traits that have mutual exclusive between them

ancient grail
#

i cant find what night owl does to be honest maybe its jhava?

worldly olive
#

Yeap

ancient grail
#

thnx

worldly olive
#

updateStats_Sleeping

#

Used in that method

ancient grail
#
    if getServerOptions():getBoolean("SleepAllowed") then
        -- somewhat counters sleepless traits effect by adding more fatigue but only uptil 0.8
        if (player:HasTrait("NightOwl") or player:HasTrait("NeedsLessSleep") or  player:HasTrait("Insomniac")  ) and player:getStats():getFatigue() <= 0.8 then
        player:getStats():setFatigue(player:getStats():getFatigue() + 0.01)
        end
        --  same as above but without the limit 
        if player:HasTrait("NeedsMoreSleep") then
        player:getStats():setFatigue(player:getStats():getFatigue() + 0.01)
        end
    end
red tiger
#

Going to put in 2ish hours of work on my transpiler tonight. =}

red tiger
#

Going to do another code jam this weekend.

#

Going to be for PZ modding. <3

#

Aiming for 15 hours min

faint jewel
#

ya so my menu will get done? lol

tulip wolf
#

Is there any function like: local x, y, z = player:getX(), player:getY(), player:getZ()

#

I need the location of the player so that the WorldSound function can play the sound in the correct position in the world

#

I'm using GetWorld():WorldSound for a test

bronze yoke
#

if you want to play a sound at the player's location, the player object has an emitter you can use for that

thick karma
thick karma
stiff furnace
#

Hey everyone, I have a silly question.

Did the devs change how recipes work? I'm having recipes that have multiple combinations that used to work in the last last patch. Now the recipe will "work" with even 1 of the items and produce an error when activating. The crazy recipe is bellow...

tulip wolf
#

does the WorldSound function of the GetWorld object exist? is returning me (nil)

bronze yoke
stiff furnace
#

It works if I have 10 of the items

#

Still allows me to execute it if I have 1 of the items, but it produces an error

bronze yoke
#

i've seen this exact issue a couple times in here over the last six months or so

#

recipes just don't support this unfortunately

stiff furnace
#

I'm not sure how to search for this issue ._.

#

Weird, this used to work before...or I thought? Damn

bronze yoke
#

oh, i'm not trying to shame you for not searching it! there really isn't an obvious keyword to find it

#

i'm just trying to express that i have reason to believe it never worked in the first place