#mod_development

1 messages ยท Page 12 of 1

willow estuary
#

But that's just me.

unreal garnet
#

eee... there is no mod for mp and they are outdated from what I'm seeing

#

also mod options (build 41) is broken? I have no issues with that, comments say otherwise tho

#

๐Ÿค”

willow estuary
unreal garnet
#

huh, alright, guess that's why some of the fully working mods do give an error

#

if mod is not working as client then I guess that while I'm hosting it's not working either? XD

#

I should probably dump some of the mods I'm using...

#

also, was this mod deleted?

#

I can't access it, nor find it on worksohp

#

alright, modding this game is like coding

#

I deleted one mod, and suddenly new options for older mods popped up in sandbox settings

subtle sapphire
#

Hello survivors! ๐Ÿ‘‹ I was thinking about a feature that might be helpful for admin purposes. The ability to "spectate" a player, that means select the player you want to spectate on and the camera will automatically follow that player. Do you think this is something achievable by writing a mod?

tranquil reef
#

not sure if it's possible to make the player invisible to itself, but I guess if you teleporting the player to another player every tick or something lol, would probably be a bad solution though

willow estuary
subtle sapphire
#

I see, it happened that from time to time I just wanted to spectate some players without having to use the admin character.

#

I just wish one day this magic button "spectate" will appear in the the players list ๐Ÿคž

willow estuary
#

Honestly, there's probably some utility for an auto-follow admin tool?
But ah, PZ is very specific about how it instances the environment re the player account.

calm depot
#

you could do this in a very hacky way right now by turning on god+invis+noclip and running a teleport call to the target's coords every X ticks

#

when they're in a vehicle though, oh boy is that going to suck

subtle sapphire
willow estuary
subtle sapphire
#

but yeah, I agree that this a "vanity" feature probably. It won't add or improve anything to the game.

calm depot
#

such a thing can be quite handy on RP servers for admins running events

#

I see it commonly used on DayZ RP servers

subtle sapphire
#

I see, in case, just keep this as a future feature request โค๏ธ

willow estuary
#

I mean, if you make a tool where admins have noclip/ghost mode/are invisible(can be done with clothing modding)/and stick to a player you have that?

#

But adding a tool that can crash servers as a vanilla feature (spectator mode), probably not in the cards.

subtle sapphire
calm depot
#

Well, the actual (and more generic answer) that solves it is a freecam

willow estuary
#

The engine don't support that.

calm depot
#

nothing is supported until it is ๐Ÿ˜„

subtle sapphire
#

Yes, it is not that important @willow estuary , mine was just an idea ๐Ÿ™ Maybe it will be implemented in the future

willow estuary
#

Again, I'm the newest and stupidest member of the team, so I'm not qualified to defend the matter for internet court, but I know it's not possible?

calm depot
#

definitely possible, but almost certainly an inordinate amount of work to do

willow estuary
#

I'm the newest and stupidest member of the team so yes, anything involving an inordinate amount of work is going to be impossible ๐Ÿ˜‰

calm depot
#

if you're the newest, how do you know you're necessarily the stupidest ๐Ÿ˜

willow estuary
#

Because I know my place? ๐Ÿคช

unreal garnet
#

aaaaaaaaaaaaaaaaaa fucking steam

#

the files didn't synchronise and I lost my backpack with all my gear!

#

how does this game saves stuff?

calm depot
#

periodically, and when you quit

unreal garnet
#

can I access older saves?

gilded hawk
unreal garnet
#

question, why do some mods break others?
I had few mods that add some actions or coding like Zed health or vehicle dismantling, barridace and such standalone staff, but when I deleted them I lost some parts of my own equipment and some of the things stopped working?

gilded hawk
unreal garnet
#

so I can't safely delete a mod for furniture without breaking my weapons?

gilded hawk
#

it's hard to say, but usually very different mods should not affect eachothers

#

A difference is when two mods are similiar or related

#

eg: Proximity Inventory vs Alternate Inventory Rendering

These two will cause issue to eachother unless both devs decide to find some common fixes

#

Also, the "how" you mod it's important for mod compatibility

#

Let me give you as example my mod "Show Exact Level Number" the first version was not compatible with "Fix XP View"

#

And it all boils down to how you write the mod

#

In the first version I was overriding the entire drawXpBoostMap function, this made it so I was "owning" entirely that function, and I was forcing all the other mods to use my version of drawXpBoostMap

CharacterCreationProfession = CharacterCreationProfession

function CharacterCreationProfession:drawXpBoostMap(y, item, alt)
  local dy = (self.itemheight - self.fontHgt) / 2

  local levelString = ' ('..item.item.level..')';
  self:drawText(item.text..levelString, 16, y + dy, 0, 1, 0, 1, UIFont.Small);

  local percentage = "+ 75%";
  if item.item.level == 2 then
    percentage = "+ 100%";
  elseif item.item.level >= 3 then
    percentage = "+ 125%";
  end

  local textWid = getTextManager():MeasureStringX(UIFont.Small, item.text)
  local greenBlitsX = self.width - (68 + 10 * 4)
  local yy = y
  if 16 + textWid > greenBlitsX - 4 then
    yy = y + self.fontHgt
  end

  for i = 1, item.item.level do
    self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - (68 + 10 * 4) + (i * 4), (yy) + dy + 4
      , 1, 1, 1, 1);
  end
  if item.item.perk ~= Perks.Fitness and item.item.perk ~= Perks.Strength then
    self:drawTextRight(percentage, self.width - 16, yy + dy, 0, 1, 0, 1, UIFont.Small);
  end

  yy = yy + self.itemheight;

  self:drawRectBorder(0, (y), self:getWidth(), yy - y - 1, 0.5, self.borderColor.r, self.borderColor.g,
    self.borderColor.b);

  return yy;
end
#

Instead, in the second version, I was "injecting/hooking" my custom code into the original function drawXpBoostMap, this made it so if another modder is hooking in this function in the same way I did it, both our code will run side by side, as long as we don't override eachother

CharacterCreationProfession = CharacterCreationProfession

local old_CharacterCreationProfession_drawXpBoostMap = CharacterCreationProfession.drawXpBoostMap
function CharacterCreationProfession:drawXpBoostMap(y, item, alt)
    local result = old_CharacterCreationProfession_drawXpBoostMap(self, y, item, alt)
    
  local dy = (self.itemheight - self.fontHgt) / 2
  local levelString = ' ('..item.item.level..')';
  self:drawText(item.text..levelString, 16, y + dy, 0, 1, 0, 1, UIFont.Small);

    return result
end
#

I hope this makes sense @unreal garnet

#

The rule of thumb of modding IMHO is that you should keep the amount of custom code you write to the minium and use as much vanilla code as possible to ensure max compatibility and long term sustainability

unreal garnet
#

well, I deleted few unrelated mods

#

which fixed few other also unrelated mods and broke other unrelated mods

gilded hawk
#

may God help you

shadow geyser
calm depot
#

if a new version of the game code adds additional arguments, the first version has definitely broken the game.

#

less-common though nonetheless sensible semantics for returning apply if you have to call the original function first and can't immediately return its result:

-- do stuff
return unpack(ret)```
unreal garnet
calm depot
#

for MP, you can edit the files directly

turbid solar
gilded hawk
# calm depot less-common though nonetheless sensible semantics for returning apply if you hav...

Does (...) work if there are no more params?

Cause if it does I could add it automatically everytime I generate a new hook to my vs devtools https://github.com/mxswat/vscode-pd2-dev-tools

GitHub

This extension gives some snippets for PD2 modders - GitHub - mxswat/vscode-pd2-dev-tools: This extension gives some snippets for PD2 modders

gilded hawk
calm depot
#

because a function can return an arbitrary number of arguments

#

it ensures that when your function returns, it passes back precisely whatever the original function did

#

and yes, (...) works as the only "parameter"

#

you can even access it inside your function by wrapping it into a table

quartz cave
#

Why does this in game only allow me to use the "Wet bath Towel" and not both?

Recipe something
{
        Destroy BathTowel/BathTowelWet=1,
        Result : RippedSheets=4,
}
calm depot
#

local args = {...}

gilded hawk
calm depot
#

yes

keen frost
#

99% of steam users don't read mod descriptions, most of my mods have no sense comments , I just leave them on to see how far an user can go with his comments lol

drifting ore
#

anyone know if there is a specific size required for item icons? eg. im creating a backpack mod, does the inventory icon for the backpack need to be a specific size, such as 32x32?

gilded hawk
calm depot
#

lol, we have an almir emoji on here?!?

drifting ore
gilded hawk
calm depot
#

MWS?

gilded hawk
calm depot
#

I guess they like Payday 2

gilded hawk
#

Just a litte lol

#

It's the former LastBullet

calm depot
#

heh

#

you know AJ and Zero fell out a while ago

gilded hawk
#

Like, ages ago

#

Last time I saw/talked to AJ was like 2018 or something

calm depot
#

yeah, it was pretty bad

gilded hawk
#

Yeah ๐Ÿ˜ฆ

calm depot
#

some IRL shit

gilded hawk
#

Loads of shit, money stuff too, too bad, aj was one of the guys that gave me a massive hand when I got into modding for the first time as a modder. Good times ๐Ÿง“

thorn cipher
drifting ore
#

already got that done :(

thorn cipher
#

but only in the file name

#

not in the script bit

drifting ore
thorn cipher
#

maybe a spelling error? or an extra space in the script file?

#

that happened to me

drifting ore
#

im not sure, ill have to double check

quartz cave
#

Does anyone know why this in the game only allow me to use the "Wet bath Towel" and not both?

Recipe something
{
        Destroy BathTowel/BathTowelWet=1,
        Result : RippedSheets=4,
}

the bathtowel and bathtowelwet are a drainable item so they have to be destroyed otherwise it only drains them a little...

#

or is there something else then "destroy" I can use

drifting ore
#

if you specifiy "keep" then itll keep the item

#

otherwise it gets used up

quartz cave
#

if you perform this recipe in game you get to repeat it 10x before the towel is used up

#

So, how do I make it use the whole towel? @drifting ore

Recipe Rip Towel
{
        BathTowel/BathTowelWet=1,
        Result : RippedSheets=4,
}
drifting ore
quartz cave
#

it sadly doesn't

thin hornet
#

try adding destroy in front of it
destroy BathTowel/BathTowelWet=1,

drifting ore
quartz cave
#

when doing

Destroy BathTowel/BathTowelWet=1,

it only show the BathTowelWet as a possible ingredient and the BathTowel cant be used

drifting ore
#

try BathTowel=1/BathTowelWet=1

#

idk

thin hornet
#

destroy BathTowel/BathTowelWet

#

BathTowel is a drainable and BathTowelWet is just a normal item

#

but when looking at other recipe that use destroy item such as Battery it just use destroy Battery
and battery is a drainable

quartz cave
#

I see BathTowelWet is Normal indeed

#

any way to still do what im trying to do?

#

I tried

#

Destroy BathTowel/BathTowelWet,
Destroy BathTowel=1/BathTowelWet=1,
Destroy BathTowel/BathTowelWet=1,

#

only the wet one shows

thin hornet
#

alright then remove the destroy tag

#

and add a OnCreate function that remove the bath towel (dry or wet)

#
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyBathtowel(items, result, player)
  for i=0, items:size()-1 do
    local item = items:get(i)
    if item:getType() == "BathTowel" or item:getType() == "BathTowelWet" then
      player:getInventory():Remove(item)
    end
  end
end

something like that

#

but you could also just use

YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyIngredients(items, result, player)
  for i=0, items:size()-1 do
    player:getInventory():Remove(items:get(i))
  end
end

since your recipe only destroy the ingredients

floral lodge
#

oh sweet konijima's here! I just needed to ask you something

#

did you ever implement some example mods for pzpw?

#

I'm trying to get started with it now :)

quartz cave
#

I don't understand this entirely. xD

The recipe stays like this and we use the function to remove the towels after the recipe is completed?

{
        BathTowel/BathTowelWet=1,
        Result : RippedSheets=4,
}

also how does this know what items to delete?

YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.DestroyIngredients(items, result, player)
  for i=0, items:size()-1 do
    player:getInventory():Remove(items:get(i))
  end
end
thin hornet
floral lodge
#

thanks a ton

quartz cave
quartz cave
thin hornet
#

๐Ÿ˜„

quartz cave
# thin hornet ``` Recipe Rip Towel { BathTowel/BathTowelWet, Result: RippedShe...

if I wanted to use this how would I adopt it?

    -- add thread sometimes, depending on tailoring level
    if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
        local max = 2;
        if nbrOfCoveredParts then
            max = nbrOfCoveredParts;
            if max > 6 then
                max = 6;
            end
        end
        max = ZombRand(2, max);
        local thread = InventoryItemFactory.CreateItem("Base.Thread");
        for i=1,10-max do
            thread:Use();
        end
        player:getInventory():AddItem(thread);
    end
thin hornet
#
YourModID = {}
YourModID.OnCreate = {}
function YourModID.OnCreate.RipBathTowel(items, result, player)
    for i=0, items:size()-1 do
      player:getInventory():Remove(items:get(i))
    end
  
    -- add thread sometimes, depending on tailoring level
    if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
        local max = 2;
        if nbrOfCoveredParts then
            max = nbrOfCoveredParts;
            if max > 6 then
                max = 6;
            end
        end
        max = ZombRand(2, max);
        local thread = InventoryItemFactory.CreateItem("Base.Thread");
        for i=1,10-max do
            thread:Use();
        end
        player:getInventory():AddItem(thread);
    end
end
quartz cave
#

ohh for some reason i thought it would be a lot harder

#

thank you so much @thin hornet โค๏ธ

thin hornet
wind abyss
#

Oooh

gilded hawk
#

I'm wondering, how can I show a message above the character head without using :say() ?
I don't want to accidentally aggro zombies

worldly stone
#

wisper?

gilded hawk
#

It's not the same, zombies can still hear it, and players too I'm looking for something completely client sided

floral lodge
jaunty gate
thin hornet
#

@floral lodge

onSomeEvent.trigger(param1, param2, ...)
floral lodge
#

so it would be called within code, ok, thank you!

#

side note: I tried to speed up time on a server and clients basically desynced

#

I can figure that part out, but I'd like to just confirm if anyone knows it's possible :P

thin hornet
#

well server speed up when everyone is asleep might wanna check on that part

floral lodge
#

ah yeah true

#

I think I did it wrong before, so that each client was speeding up but the server itself wasn't

jaunty gate
# gilded hawk Thank you!

You can also do HaloTextHelper.addTextWithArrow(player, getText("YOUR_TEXT_HERE"),true, HaloTextHelper.getColorGreen()) if you want the arrow to point up (the true/false part)

floral lodge
#

but I think that's where the commands come in :)

vagrant swift
#

can anyone help me out? i made a addon for true music and i want to add new songs to it mid save, how do i do that?

weak sierra
#

attachments on guns i add do not show up even though i have them set up as model parts and i set the attachment positions - i briefly had one showing up at some point but i cannot recreate that success

#

this is the x2 scope set parented to the "scope" point, so u can see it should sit there ok

#

then in game it's attached..

#

and yet..

#

and yes i've hit save, lol

#

world position for the gun works fine

#

from the file just to confirm

#
        attachment scope
        {
            offset = 0.0040 0.0210 0.0790,
            rotate = 0.0000 0.0000 0.0000,
        }```
#

anyone?

red rapids
#

hello i am trying to edit the values of a backpack but the values dont change in game it is from a mod
i change it with note pad plus but the values do not change in game do i have to do something else?

floral lodge
#

if you link the mod and tell me what you want changed I may be able to help you

#

but I will say, after you change the values that I would copy the folder of the mod into your mods folder at C:/users/yourusername/zomboid/mods

#

because maybe workshop is just changing the values back or something

#

@red rapids

#

also have you tried going back to the main menu and clicking reset lua at the bottom right?
that may update your changed values

red rapids
#

i am changing the first aid bag from authentic z

#

capacity to 100

#

for SP

#

but i think this eliaz better bags mod is overwrriting it gonna test it without it

floral lodge
#

๐Ÿ‘

red rapids
#

it is still not applying

floral lodge
#

try the reset lua thing first!

#

if you're not doing that

red rapids
#

i dont know where the option is

#

i keep closing and opening the game

floral lodge
#

oh that'll work too

quartz cave
#

in game it says the function doesn't exist in the log...

    {
        DishCloth/DishClothWet,
        Result : RippedSheets=2,
        Sound : PZ_ClothesRipping,
        Time : 220.0,
        Category : Survivalist,
        AnimNode : RipSheets,
        OnCreate : Recipesplus.OnCreate.RipTowel
    }```
floral lodge
#

it may be only in debug mode come to think of it, but I have it at the bottom right of the main menu, a little blue button

red rapids
#

I'm gonna try doing that but if it doesn't work what else could I do?

floral lodge
#

@quartz cave I haven't done recipes before, but do you need to insert parameters into the function call?

red rapids
#

This is the zomboid mods folder i dont know where to put the modified mod

floral lodge
#

so like: Recipesplus.OnCreate.RipTowel() or Recipesplus.OnCreate.RipTowel(items, result, player)

floral lodge
#

the same folder with the examplemod folder in it

red rapids
#

ok

quartz cave
floral lodge
#

drop it right there and reload game, then I would comepletely unsubscribe from the original mod so when you go to select it in-game you aren't confused on which one to pick

red rapids
#

ok

floral lodge
red rapids
#

cant i change the name?

floral lodge
#

but just make sure that the original and edited mod aren't loaded at same time

red rapids
#

i just did time to test

#

aight

#

Not showing in game

#

I thought it would be easy to just modify values lol

#

I was proven wrong

floral lodge
#

make sure there aren't spaces in any of the ids for the mod info

#

use camelCaseLikeThis or underscores_like_this

red rapids
floral lodge
#

remove spaces

#

should be good

#

I hope ๐Ÿ™‚

red rapids
#

Alright

#

Test again

#

I just don't know why the values wouldn't change lol

thin hornet
quartz cave
#

it is :"(

thin hornet
#

mhm

quartz cave
#

can i have more then one function per .lua file?

red rapids
#

It did showed up now, now to test if it works

red rapids
#

Display name still shows as the one from before but now I'm loading to see if the values changed

#

WORKED

red rapids
#

Thanks!!!

floral lodge
#

ok whatever you do don't touch anything looool

#

hopefully mod doesn't update and break it again

floral lodge
quartz cave
thin hornet
#

the file ok

#

but maybe there is an error preventing it from loading

#

idk

quartz cave
floral lodge
#

revolution are you using vscode?

quartz cave
#

yes

floral lodge
#

ok this may sound stupid

#

but did you save the file

quartz cave
#

yes

floral lodge
#

the one with the function in it

#

have you tried restarting game

quartz cave
#

yea

floral lodge
#

alrighty

#

cause I've thought I had errors before just due to not saving :P

quartz cave
#

yea no its saved ๐Ÿ˜›

#

checked for spelling mistakes and everything

floral lodge
#

darn

thin hornet
#

wait my vs is acting up

#

it detect an error i just cant see what it is

quartz cave
#

๐Ÿ˜จ

floral lodge
#

oh god revolution broke it

#

you managed to find some super elusive bug

thin hornet
#
Recipesplus = {}
Recipesplus.OnCreate = {}

-- destroys ingredients on create
function Recipesplus.OnCreate.DestroyIngredients(items, result, player)
    for i = 0, items:size() - 1 do
        player:getInventory():Remove(items:get(i))
    end
end

-- get thread sometimes, depending on tailoring level
function Recipesplus.OnCreate.GetThread(items, result, player)
    if ZombRand(7) < player:getPerkLevel(Perks.Tailoring) + 1 then
        local max = 2;
        if nbrOfCoveredParts then
            max = nbrOfCoveredParts;
            if max > 6 then
                max = 6;
            end
        end
        max = ZombRand(2, max);
        local thread = InventoryItemFactory.CreateItem("Base.Thread");
        for i = 1, 10 - max do
            thread:Use();
        end
        player:getInventory():AddItem(thread);
    end
end

function Recipesplus.OnCreate.RipTowel(items, result, player)
    Recipesplus.OnCreate.DestroyIngredients(items, result, player)
    Recipesplus.OnCreate.GetThread(items, result, player)
end
#

btw you can do this instead of repeating the code

#

try this idk if i fixed it vscode stopped complaining

quartz cave
#

ill try it now ๐Ÿ˜Ž

tranquil reef
#

Is there any way to check if the player has hit a zombie?

#

I need to figure out the weapon used, the zombie hit, and obviously detect the hit lol

floral lodge
#

Events.onHitZombie

tranquil reef
#

The speed of that reply was illegal

floral lodge
#

loool

tranquil reef
#

Thank you though, you saved me like 10 hours of searching through code lol

floral lodge
#

hey @tranquil reef

#

here's an awesome tip

#

and search no more

#

to find that command, all I did was go into my editor, type hit, and the function for onhitzombie popped up

quartz cave
floral lodge
#

and I pretty much know how to use the tool after just an hour or 2

thin hornet
#

lolll

#

removed the test function, reformatted a bit

floral lodge
#

hey can you help with with something

#
    if (enabled) {
        checkIfTimeBasedTasks()
        if (skipTime) {
            setGameSpeed(3)
            getGameTime().setMultiplier(20)
        } else {
            setGameSpeed(1)
            getGameTime().setMultiplier(1)
        }
        skipTime = true
    }
})



function checkIfTimeBasedTasks() {
    for (let i = 0; i < getNumActivePlayers(); i++) {
        let player = getSpecificPlayer(i)
        let queue = ISTimedActionQueue.getTimedActionQueue(player)
        if (queue) {
            let current = queue[1]
            if (current) {
                print(current.type)
                if (current.type != ISReadABook) {
                    skipTime = false
                }
            }
        }

    }```
#

this is flipping back and forth between game speed 1 and 3 and I feel like I'm missing something

#

I made a mistake somewhere

quartz cave
thin hornet
tranquil reef
floral lodge
#

it just lets you program in typescript, along with easily finding function calls rather than searching for them manually

thin hornet
#

thats what it look like lol

#

everything at your finger tip

quartz cave
#

wow

thin hornet
#

plus arguments info

tranquil reef
# thin hornet

I use visual studio, is it something you can just kind of plug in lol?

thin hornet
#

visual studio is much heavier than vscode

#

for this kind of work at least

#

would stilll work

#

no worry about it

#

both created by microsoft pretty sure it act the same way

#

but vscode has the tasks panel to run package.json commands

solid cloak
#

hi guys, any experienced modder available for hire?

floral lodge
#

$1M ๐Ÿ™‚

quartz cave
#

define experienced ๐Ÿ˜›

solid cloak
#

pretty deep knowledge of how PZ works

#

and what can/can not be done

quartz cave
#

what do you want, out of curiosity?

solid cloak
#

some custom development for a server I want to build, basically I'd like to have pre-generated characters instead of allowing the user to build their own

quartz cave
#

sounds really cool and I'm sure its possible to do

#

but I'm not experienced enough sadly

solid cloak
#

im looking to build some sort of survival server where there's no respawn and last character standing receives a reward

#

i want to generate the characters myself and assign them randomly to users

#

basically have the game sync with my server and check which character is assigned to a specific user

floral lodge
#

ok, I'm trying to set the game speed for the server, but it doesn't actually do anything...

#

anyone have tips?

solid cloak
floral lodge
#

true

floral lodge
#

nono

unreal garnet
#

so... deleted few shit mods I didn't need and... my whole game is slowly falling apart?

floral lodge
#

like in singleplayer how you can speed up time

#

I gotta know

#

falling apart how

#

this is for mod development

weak sierra
quartz cave
#

maybe that could help you somehow?

weak sierra
#

that's the thing, i'm already doing the same thing as a known-working mod

#

heh

#

the only difference is that im patching my weapons into the attachments mount-on list during loading instead of overwriting the script file

#

but i have a hard time believing that that would matter, since it lets me attach them fine

thin hornet
#

the only thing i can think of is when everyone is sleeping at the same time

#

and that is happening in GameServer.java but thats private

#

they send a special packet and then they syncTime

#

you could probably do your own fast forward using getGameTime() and setting time on the server using this and syncing clients with it

#

nevermind

#

lol

floral lodge
#

Uugh so I can't do it then?

#

That makes me sad

thin hornet
#

get used to it

#

๐Ÿ˜›

floral lodge
#

Can I request the developers or something somewhere to expose the function :P

thin hornet
#

or find a way

#

what exactly does the fast forward do in your thing?

#

cause logically if people are not sleeping it cant really fast forward

#

in single player when you fast forward and press a key it stop it cause you cant move if fast forwarding right

floral lodge
#

It just makes it so that when all players are doing a long term task like reading or working out then they can vote to fast forward until one of them finishes it or moves

#

Fast forwarding auto cancels when moving

thin hornet
#

yeah

#

i see

floral lodge
#

That's super unfortunate, maybe there's a way for the clients to trick the server that they're sleeping? Then just making sure to reset their sleep where it should be

icy dome
#

Hello guys. How are you ? Are your families ok? (vin diesel)

Well I created a Single Player and modified the lua file
lua/client/DebugUIs/ISSpawnHordeUI.lua
so that it would allow me to spawn zeds with a very large life like 999999999999

It works very well, however when I try to replicate in MP the zed just dies and disappears.
The maximum health I can add to a zed MP is 32.7....

#

Does anyone have any suggestions on how I can make an extremely strong zed?

gilded hawk
floral lodge
#

Zombies do have special properties that affect their health and stuff, so I'm sure that you could set their stats that way

gilded hawk
icy dome
#

Thank you for the tips. I'll try, especially put iron armor on the zombie

weak sierra
#

do armor stats that zeds wear affect them in combat?

#

speaking of that

#

or wud u have to fake it by adjusting hp/etc

#

never looked into that system

#

but curious

icy dome
icy dome
#

This command has an interface that is managed by lua I sent

floral lodge
#

why is this not running? everyOneMinute.addListener(() => { if (!isServer()) return; getSpecificPlayer(0).Say("it's running")

#

should this not have my character saying "it's running"?

floral lodge
#

I've also tried if(isClient()) return;

gilded hawk
#

I need support from fellow experienced modders, how can i give to a ItemContainer a fake parent, so that I can set that parent to "locked/padlocked"?

I'm trying to improve my proximity inventory mod

#
function ISInventoryPage.GetLocalContainer(playerNum)
    if ISInventoryPage.localContainer == nil then
        ISInventoryPage.localContainer = {}
    end
    if ISInventoryPage.localContainer[playerNum+1] == nil then
        ISInventoryPage.localContainer[playerNum+1] = ItemContainer.new("local", nil, nil, 10, 10)
        ISInventoryPage.localContainer[playerNum+1]:setExplored(true)
        ISInventoryPage.localContainer[playerNum+1]:setOnlyAcceptCategory("none")
        ISInventoryPage.localContainer[playerNum+1]:setParent(IsoThumpable.new(getCell()))
    end
    return ISInventoryPage.localContainer[playerNum+1]
end

I tried this but im getting loads of errors

jagged ingot
#

Also, I think that you can play single player and both isServer() and isClient() returns false.

#

I'm not sure how getSpecificPlayer(..) operates in a single-player context.

floral lodge
#

yes I'm using konijima's tool

#

that why it's typescript

#

but I'm on a server playing by myself, not singeplayer

cyan basalt
#

try printing?

floral lodge
#

yep

#

nothing there either

#

very strange

cyan basalt
#

try looping through all player indexes? idk if there's a case where you wouldn't be 0 if you're the only one but worth a shot

floral lodge
#

trying now

jagged ingot
#

Could write a function that checks against player names.

cyan basalt
#

this is a shared script im assuming right?

floral lodge
#

is that bad

jagged ingot
floral lodge
#

maybe but how's that help me :P if looping through all players and using the say command doesn't work I'm not sure how looking for a name would do anything

#

not putting down what you suggested or anything, I might just not understand what you mean

jagged ingot
#

Ehh. Thought you had an issue getting the right player.

floral lodge
#

ok looping through player index and using say not working

#

here:

#

everyOneMinute.addListener(() => {
if (isClient()) return;
print("running?")
for (let i = 0; i < getNumActivePlayers(); i++) {
getSpecificPlayer(i).Say("it's running")
}

cyan basalt
#

can you even do a say from serverside? you probably can but i am a beginner so im not sure

floral lodge
#

uhhhh

#

that's a very good question

jagged ingot
#

You can use sendServerCommand and then hook into the event that ISChat listens to.

#

Strings sent to ISChat for Server messages prepend an identifier to handle it differently than normal text.

floral lodge
#

I just setup a command sent from server to client to talk

jagged ingot
#

I think you can set the msg and timer for the chat instance without having to modify it.

floral lodge
#

though I am growing increasingly less confident in my ability to do things like that correctly

#

ok well that's not working either

#

maybe I'm just awful at this

#

on sec

#

client:

    if (module == "setSpeed") {
        getPlayer().Say("my time is set")
        if (command == "speed=") {
            getGameTime().setMultiplier(args[0])
        }
        return
    }

    if(module == "talk"){
        getPlayer().Say("talking now")
    }
})

server (not the entire file since that would be a lot)

    if (isClient()) return;
    print("running?")
    for (let i = 0; i < getNumActivePlayers(); i++) {
        getSpecificPlayer(i).Say("it's running")
        sendServerCommand(getSpecificPlayer(i), "talk", "Yes") // send normally if server
    }
    if (enabled) {
        checkIfTimeBasedTasks()
        if (skipTime) {
            getGameTime().setTimeOfDay(calculateFinalTime())
        }
        if(skipTime != prevSkipTime){
            for (let i = 0; i < getNumActivePlayers(); i++) {
                let player = getSpecificPlayer(i)
                let speed = 1
                if(skipTime){
                    speed = speedMultiplier
                }
                if (isServer()) {
                    sendServerCommand(player, "setSpeed", "speed=", { speed }) // send normally if server
                } else {
                    triggerEvent("OnServerCommand", "setSpeed", "speed=", { speed }) // send hack for single-player
                }
            }
            prevSkipTime = skipTime
        }
        skipTime = true

    }
})```
jagged ingot
#

Oh. You're talking about the player text above head.

floral lodge
#

yeahhhh

#

printing would've been fine too but I can't get either it seems

jagged ingot
#
for (let i = 0; i < getNumActivePlayers(); i++) {
    const player = getSpecificPlayer(i)
    player.Say("it's running")
    // send normally if server
    sendServerCommand(player, "talk", "Yes") 
}
#

๐Ÿ™‚

drifting stump
#

getSpecificPlayer is for local players not all players connected to a server

#

split screen

jagged ingot
#

Haha. Needs that good old documentation.

floral lodge
#

are you kidding me noooooo

jagged ingot
#

You should be able to get all players.

floral lodge
#

I know for sure there's a way to loop through players

#

lemme look into it

jagged ingot
#

A moment.

floral lodge
#

also I'll see if your thing works delta

drifting stump
#

getOnlinePlayers()

jagged ingot
#

Bingo.

#
ArrayList<IsoPlayer> getOnlinePlayers()
floral lodge
#

AHAAAAAAAA

#

thank y'all a ton

jagged ingot
#
for (let index = 0; index < players.size(); index++) {
    const player = players.get(index)
}
floral lodge
#

seriously super grateful, what a mistake loool

jagged ingot
#

Not your fault. The API for PZ is full of these silly technicalities we've all learned over time.

cyan basalt
#

ahhhh that's good to know ๐Ÿค”

floral lodge
#

hey awful news

jagged ingot
#

The tools that you're using allows for documentation from other modders to be contributed to otherwise API without any documentation at all.

floral lodge
#

it didn't work

#

everyOneMinute.addListener(() => {
if (isClient()) return;
print("running?")
let players = getOnlinePlayers()
for (let index = 0; index < players.size(); index++) {
const player = players.get(index)
player.Say("it's running")
// send normally if server
sendServerCommand(player, "talk", "Yes")
}

jagged ingot
#

If that's on the server, I don't think the .Say(..) method will work but I could be wrong.

floral lodge
#

right, but calling getPlayer().Say("something") in client should work

jagged ingot
#

Correct.

floral lodge
#
    if (module == "setSpeed") {
        getPlayer().Say("my time is set")
        if (command == "speed=") {
            getGameTime().setMultiplier(args[0])
        }
        return
    }

    if(module == "talk"){
        getPlayer().Say("talking now")
    }
})```
jagged ingot
#

You return if the execution is on the client so that code won't run.

floral lodge
#

hm?

jagged ingot
#
everyOneMinute.addListener(() => {
    if (isClient()) return;
floral lodge
#

sorry I'm a little new to modding

jagged ingot
#

Is this code supposed to run on the client?

#

That method invokes player.Say(..)

floral lodge
#

it's supposed to run on the server, and tell the clients to do things

#

that's why I'm doing the messages

jagged ingot
#

Ok. Trying to understand your code.

drifting stump
#

why check every time if its a client

#

register only if its a client

floral lodge
#

are you saying I can prevent clients from even seeing the method?

#

anyway delta, to explain my code:
I want the server to tell the players when they should do something

#

so no client needs access to anything in the server file

drifting stump
#
if isServer() {
    everyOneMinute.addListener(() => {
        print("running?")
        let players = getOnlinePlayers()
        for (let index = 0; index < players.size(); index++) {
            const player = players.get(index)
            player.Say("it's running")
            // send normally if server
            sendServerCommand(player, "talk", "Yes") 
    }
}
floral lodge
#

๐Ÿคฆโ€โ™‚๏ธ that makes sense

drifting stump
#

would give you an example on how to do that kind of server client communication but its lua

#

well tbf itll be mostly the same

floral lodge
#

yeah the typescript and lua are just about the same

jagged ingot
floral lodge
#

very similar, typescript is just a bit easier to use

drifting stump
#

nah i much prefer lua

jagged ingot
#

Ah. Yeah. Experienced Lua modders don't need TS.

floral lodge
#

too bad I'm not experienced :P it also just looks neater to me though anyway

drifting stump
#

can be an experienced lua modder and still not know how to properly write lua

floral lodge
#

lollll

drifting stump
#

do agree most people should use the ts transpiler

jagged ingot
#

When I'm not busy, I'll be writing documentation for the PZ API.

#

A tool for documenting the TS stuff.

drifting stump
cyan basalt
#

speaking of typescript im having issues with adding to the distribution tables:

import { getGlobal } from "PipeWrench-Utils"


let ProceduralDistributions = getGlobal<KahluaTable>("ProceduralDistributions");

// Add it to the same parts of the distribution table as the WeldingMask
table.insert(ProceduralDistributions.list.ArmyHangarOutfit.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.ArmyHangarOutfit.items, 1);

table.insert(ProceduralDistributions.list.CrateMetalwork.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.CrateMetalwork.items, 2);

table.insert(ProceduralDistributions.list.CrateRandomJunk.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.CrateRandomJunk.items, 0.6);

table.insert(ProceduralDistributions.list.GarageMetalwork.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.GarageMetalwork.items, 4);

table.insert(ProceduralDistributions.list.MechanicShelfOutfit.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.MechanicShelfOutfit.items, 5);

table.insert(ProceduralDistributions.list.MetalShopTools.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.MetalShopTools.items, 3);

table.insert(ProceduralDistributions.list.ToolStoreAccessories.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.ToolStoreAccessories.items, 3);

table.insert(ProceduralDistributions.list.ToolStoreMetalwork.items, "WeldingGoggles.WeldingGoggles");
table.insert(ProceduralDistributions.list.ToolStoreMetalwork.items, 2);```

same thing works in lua but gives me an error here ๐Ÿค”
#

any idea? looks like it's having problems getting the global var itself

floral lodge
#

my favorite thing with typescript is how crazy easy it is to find functions

jagged ingot
cyan basalt
#

yeah I like that part too. and I'm much more familiar with js so it's easier for me lol

#

yeah i just have bothered Konijima so much lol ๐Ÿ˜…

floral lodge
#

believe it or not I never liked javascript

jagged ingot
#

Lua tables are a WIP with PipeWrench.

floral lodge
#

but I'm liking typescript with this

cyan basalt
#

ahh gotcha that makes sense

jagged ingot
#

You can write your own typings ontop of PipeWrench's typings to fix missing table stuff if that becomes an issue for right now.

#

The white paper for PipeWrench actually shows how to do this.

cyan basalt
#

yeah i saw that on the wiki page as well, i guess in this case I'm just confused what it's actually missing

floral lodge
#

YO

#

thanks delta and gilbz!

cyan basalt
#

how'd you eventually do it?

floral lodge
#

idk :D

#

literally got no clue what fixed it

#

When I restarted the server it was fixed, for some reason reloading the scripts just wasn't doing it

jagged ingot
#

Sooooooo PZ doesn't use Lua modules. The Lua example here uses modules.

#

The ISUI.d.ts example is simply wrapping and defining the module that you return with the ISUI.lua file.

#

It's basically mapping pre-existing Lua code.

cyan basalt
#

ahhh I see

#

i feel like i will definitely encounter something like this in the future so thank you!

jagged ingot
#

Packaging basically.

#

No problem.

#

Think of PipeWrench as one giant phone book directory.

cyan basalt
#

Interesting ๐Ÿค” ! It will probably take a bit for me to see it that way haha

jagged ingot
#

No worries.

floral lodge
#

also I think I can confirm that player.Say() doesn't work from server ๐Ÿ‘

jagged ingot
#

Would be fun to rewrite the entire ISUI library in Typescript.

cyan basalt
#

that would be pretty cool

jagged ingot
#

It'd fix some mistakes in there with overloading property signatures in the Lua tables for classes.

#

Also ambiguity with table structures like joypad data, UI-specific metadata, etc.

cyan basalt
#

sounds like it would be a bit of work as well

jagged ingot
#

Reusability to prevent copied / wet code.

#

I'd say that PipeWrench is best with scalability.

drifting ore
#

has anyone used the new fluid system in the latest update to make a purple drank lean mod?

cyan basalt
#

i thought the fluid system was build 42 stuff

floral lodge
#

just spent 15 minutes debugging because I didn't notice my "enabled" variable was set to false by default ๐Ÿ˜ญ

thin hornet
#

@jagged ingot there is a problem with lualib_bundle.lua substring method

#

im trying to fix bugs in basement mod but i cant even reproduce them so its HAARDD

cyan basalt
#

i can fiddle around with it and try to reproduce it

#

is it on new game?

thin hornet
#

some people experience the bug on new and existing savegame

#

like the map is not loading so its void

#

but like i cant reproduce that, map always load for me

cyan basalt
#

weirddd

#

yeah i can build a basement and enter it normally with no issues

#

actually wait i reproduced it by adding a basement on an old save

solid cloak
#

@jagged ingot can I send you a dm? I have some modding questions and Iโ€™d really appreciate your guidance ๐Ÿ™‚

thin hornet
cyan basalt
#

new patch changed lots of map stuff i guess

cyan basalt
#

so the issue i'm facing is from lualib_bundle.lua for pipewrench and it occurs when __TS__StringSplit makes a call to __TS__StringSubstring(self, start, ___end) but without a third param

        out[count + 1] = __TS__StringSubstring(source, index)
    end```

and then `__TS__StringSubstring` freaks out cuz there's no third param when it tries to do this i guess?
`return string.sub(self, start, ____end)`
#

im sure that made no sense tho lol

cyan basalt
#

okay my b for spam but i got it to work by adding a check in __TS__StringSubstring:

        ____end = -1
    end```
if anyone else happens to have this problem when accessing ProceduralDistributions in typescript
#

there's prob a better way to do it but it worked lol

novel barn
#

This might be a silly question but... I'm working on fixing the item distribution for an outdated mod I want to use. I found a way to add items with table.insert but I want to verify my code by observing the loot table. I found LootZed in the debug tools and I've been using that. Unfortunately you need the container to already exist to observe the table. There are tons of containers I either can't locate or spend an hour or more teleporting around the map before I find. Additionally lootzed seems to be completely ineffective for observing vehicle and zombie loot tables. I wanted a more direct way to observe loot tables and found ItemZed by turbotutone but it looks like it's a few years old at this point and I couldn't get it to work. https://theindiestone.com/forums/index.php?/topic/21923-itemzed-updated-11b/ Does anyone know of an easy way to QA loot table adjustments?

fwiw I'm working on updating https://steamcommunity.com/sharedfiles/filedetails/?id=2371410264. This mod adds a recipe magazine and two tools. I have successfully added all three to a few very common containers but I wanted to be more thorough.

thin hornet
quartz cave
novel barn
quartz cave
#

what are you trying to add?

novel barn
#

Me? or Gilbz? I've successfully added a recipe magazine and a few tools. I'm looking for a better way to verify they're in the right containers.

quartz cave
novel barn
#

I was really hoping for a better tool than that but if that's the best we have ๐Ÿ˜ฆ That's what I've been doing.

quartz cave
#

its probably easiest to make it spawn 100% in the right container

#

and then change the rarity

novel barn
#

debug mode has a tool called lootzed that shows you everything that can spawn in a container and it's spawn chance. I just can't find some containers.

quartz cave
#

what container can't you find? @novel barn

cyan basalt
novel barn
quartz cave
#

do you have the distribution.lua?

novel barn
quartz cave
#

are those "tags" not under a category or something?

#

i found hunter ingame

novel barn
#

I'm not completely sure what you're asking but GarageFirearms appears to be its own category in ProceduralDistributions.lua I understand what you were asking now. You meant for me to literally look in Distributions.lua not proceduraldistributions. I do see that GarageFirearms is in the proclist of locker.

#

Was I wrong assuming Hunter was an actual zombie?

quartz cave
#

yea its in the secure storage

#

was hunting for the garagefirearms lol

novel barn
#

Incredible. Yeah I've seen a ton of antique crates. I didn't realize Hunter was in that pool as well

#

I got lazy with Hunter because I had already given up on GarageFirearms

quartz cave
#

I think the Garagefirearms is the weapon locker in a garage/secure storage

novel barn
#

I looked at just about every locker I could find in Louiseville and a few in Muldraugh and they were always a different kind of weapon storage. I appreciate the help but I think I'm going to head to bed. If I ever stumble across this container I'll be sure to let you know!

quartz cave
#

I'm happy I could help you somewhat haha, goodnight maybe with a fresh head it will come together ๐Ÿ˜„

quiet nebula
#

Is it hard to make zombies 'say' something? Like show text above their head?
Because I've tried :say and either I'm doing something wrong or that's not the way to do it

austere pecan
quartz cave
vocal wigeon
thorn cipher
quiet nebula
short fulcrum
#

Q: I'm new to modding Zomboid. And I'm trying to update an old (Build 40) mod so it's no longer broken. I think I've figured out how to fix it. But I'm wondering:

#

If the old mod is both broken and abandoned, then is there any issue to releasing my updated version with the same Mod ID?

#

Would that cause a problem? I mean, is there any advantage to changing the ID in that case?

quartz cave
#

You might wanna make a new ID like TC_originalIDhere
I think that's best

#

I also don't think it lets you use the existing ID when uploading

willow estuary
#

Unless there is some very good reason to do otherwise, please don't use existing mod IDs for workshop uploads. It causes no ends of issues with MP server file mismatches.

short fulcrum
#

Okay... good to know.

#

Thanks for the explaination.

willow estuary
#

๐Ÿ‘

gilded hawk
gilded hawk
drifting ore
#

hmm

#

any modder free rn i got a question

#

@willow estuaryyou available?

quartz cave
#

what question?

quartz cave
drifting ore
#

how do i overwrite or change a lua variable

cosmic condor
#

be more specific

drifting ore
#

i want to change daySruvived

#

do i just overwrite it?

#

i want to change the variable daySurvived to something else

#

under AttachedWeaponDefinitions

#

for assaultifleonback

#

so itd be something like

cosmic condor
#

you edit another mod?

drifting ore
#

yea

#

trying to integrate two mods together

#

its a headache

quartz cave
#

what mods?

cosmic condor
#

what does daySurvived do?

drifting ore
#
    id = "assaultRifleOnBack",
    chance = 5,
    outfit = {"ArmyCamoGreenMale"},
    weaponLocation =  {"Rifle On Back"},
    bloodLocations = nil,
    addHoles = false,
    daySurvived = 0,
    weapons = {
        "Base.AssaultRifle",
    },
}```
#

it only spawns that attached weapon

#

after you have survived that specific number of days

#

i want to change the number from 0

#

how do i do that

cosmic condor
#

basically you can just change it

drifting ore
#

its not a table

#

uhh

#

yea i can change it on my end but im making a mod to connect 2 mods together

cosmic condor
#

but if you want your friend to have the same effect that you edited, you have to create a new mod

drifting ore
#

is there a function to change that variable

#

yea im doing that

#

can i just overwrite it

quartz cave
#

just change 0 to whatever you want?

cosmic condor
#

well, we don't know what control those variables

#

you better just change it and give it a test to see if it works

drifting ore
#

ill ask around a bit more

#

im just trying to edit the variable

#

its a variable you declare on your own, nothing controls the variable

mellow oyster
#

How do i make submenus within context menus?

drifting ore
#

nvm

#

this is a table

#

i just have to uh

#

nvm

#

i still have no idea if im doing it right

#

so assaultRifleOnBack is a table itself

#

im trying to change the index of chance and days survived

#

table.insert(AttachedWeaponDefinitions["assaultRifleOnBack"].chance, 20);

#

could i just write this

#

does it overwrite or add to the old value

willow estuary
#
require "Definitions/AttachedWeaponDefinitions"
AttachedWeaponDefinitions.assaultRifleOnBack.daySurvived = 420 -- whatever number of days you want it to be

should work

drifting ore
#

or do i not need one

#

lol

drifting ore
#

btw the number

#

is it a percentage thing?

willow estuary
#

It is an integer and is the number of days since the start of game.

short fulcrum
#

Can someone point me in the direction of a link or forum post or something to explain in detail how to use the table.insert and table.remove LUA functions (particularly table.remove)?

#

Well, examining the code inside certain mods, I think I've got something of a grasp on table.insert.

#

Like so:

#

table.insert(ProceduralDistributions["list"]["ClassroomDesk"].items, "MAG.Actionmanga");
table.insert(ProceduralDistributions["list"]["ClassroomDesk"].items, 2.0);

thin hornet
#
local myTable = {
  "im index 1",
  "im index 2"
}

---    table,  indexToRemove
table.remove(myTable, 2)
short fulcrum
#

myTable is...?

thin hornet
#

what ever table you pass to it

short fulcrum
#

table.remove(RemoveItemFromDistribution["all"]["ClassroomDesk"].items, "base.VideoGame");

#

table.remove(ProceduralDistributions["list"]["ClassroomDesk"].items, "base.VideoGame");

#

which to remove from ClassroomDesk?

thin hornet
#

@short fulcrum
example

--- remove videogame from ClassroomDesk
RemoveItemFromDistribution(ProceduralDistributions.list.ClassroomDesk, 'VideoGame', false, true)

--- remove videogame from all ProceduralDistributions
RemoveItemFromDistribution(ProceduralDistributions, 'VideoGame', false, true)
gilded hawk
#

So, IsoThumpable is setExposed in the java\Lua\LuaManager.java

Then why I can't create one in lua ๐Ÿ˜ฆ ?

#

I'm trying to make one in memory, but I don't want to place it anywhere in the world ๐Ÿ˜•

abstract carbon
#

quick question, not sure if anyone can help me but can someone direct me to a mod guide for making guns. Iโ€™ve made the models and looked online but all the tutorials are outdated

tight osprey
#

are there any mods that give traits that are a little unbalanced? a little op?

shadow geyser
drifting stump
#

i dont use ts i simply changed the code they posted

shadow geyser
# floral lodge When I restarted the server it was fixed, for some reason reloading the scripts ...

I'm still scrolling through messages but incase someone hasn't said, the reason why it doesn't work is that when you reload a lua file from the f11 UI, it doesn't reload lua files on the serverside when playing MP, just the client. there is a command you need to use to tell the server to reload some file. can't remember it exactly rn, but you can probably find it from this channel. also the event stuff has some funny business with regards to loading in MP, so sometimes you need to restart to fix it properly

shadow geyser
# mellow oyster How do i make submenus within context menus?

couldn't find a great example from vanilla, but I compile a more simple one from another mod.


Hydrocraft.doBuildMenus = function(_player, _context, _worldObjects)

    local player = _player;
    local context = _context;
    local worldobjects = _worldObjects;
    local HcMenuOption = context:addOption("Building", worldobjects); this adds a new option to the right click context menu
    local HcSubMenu = ISContextMenu:getNew(context);   <-- this creates the new context menu object
    context:addSubMenu(HcMenuOption, HcSubMenu);     <-- this associates the created submenu with the new option that was added previously

    Hydrocraft.BuildOptionGlassRoof(player, HcSubMenu)    <-- this calls a function that will populate the submenu with options
end

Hydrocraft.BuildOptionGlassRoof  = function(player, HcSubMenu)
    local option
    local tooltip
    option = HcSubMenu:addOption("Glass roof", nil, function() Hydrocraft.onBuildGlassRoof(player) end); <-- this is the line that add the new option to the submenu. The third field is a function that you want to call, if the player clicks on the submenu. you can leave it as nil, if you just want to display info when hovering over the option
    tooltip = Hydrocraft.toolTipcheck(option)
    tooltip:setName("Glass roof")  <-- the following couple lines affect another window that displays the following text. you can use more complicated lua to make it more dynamic if you want
    tooltip.description = "<RGB:1,1,1>Welding Mask <LINE>Propane Torch <LINE> Steel Rod: 2 <LINE> Glass Pane: 1"
    tooltip:setTexture("roofs_02_55")
end

local function func_Init()
    Events.OnFillWorldObjectContextMenu.Add(Hydrocraft.doBuildMenus)
end

Events.OnGameStart.Add(func_Init)
shadow geyser
#

what exactly are you trying to achieve with a virtual isothumpable? doesn't it kind of defeat the purpose of being thumpable if it doesn't exist in the world?

stiff brook
#

I'm getting this error when trying to upload my mod. Can someone help? I also attached the files tree

abstract carbon
#

Does anyone know what code I need to make my gun work?

#

like the full code

eternal garnet
#

If something has the Cosmetic = TURE, Tag, what does that function mean, and or do?

queen leaf
#

Nice!! looking forward to it -- maybe swimming goggles could be used?

cyan basalt
#

To swim?

weak sierra
#

another modder told me that if you use more than one texture per model it can cause issues with attachments, turned out to be model declarations rather than the actual mesh, but that wasn't my issue

worldly olive
#

Hello
Does somebody knows what the different parameters of the drawTexture() function means?
I'm trying to add a custom moodle to my mod and I have been reading other mods code to see how they do and all use the drawTexture() but I can't make the game draw anything stressed

thin hornet
#

also image has to be a png

worldly olive
#

Hmmm you mean this?:
DTOverdoseMoodle = ISUIElement:derive("DTOverdoseMoodle");

#

Yes it is a png

#

To be honest this is me right now. I have been doing modding mostly related to IsoGameCharacter since I started so everything that's related to textures I have no idea how it works, trying to understand it now ๐Ÿคฆ๐Ÿปโ€โ™€๏ธ

thin hornet
#

๐Ÿ˜‚

cobalt arrow
#

Hey all ๐Ÿ–– does anyone have some up to date links/resources on how to add custom categories for the crafting menu by any chance ? Tried to add "Category=XXXX," in my recipe but since it doesn't work I'm assuming I would have to tell PZ that said "XXXX" is actually a category first, right ?

thin hornet
#

it would be in the translation files

#
IGUI_CraftCategory_Fishing = "Fishing",
#

so you would create this in your mod media\lua\shared\Translate\EN\IG_UI_EN.txt

#

and add your own translation for each new category you create @cobalt arrow

#
IGUI_EN = {
  IGUI_CraftCategory_MyCustomCat = "My Custom Category",
}
cobalt arrow
small topaz
#

does anyone knows whether the vanilla game by default respawns cockroaches, dead mouses and dead rats which can sometimes be found in trash cans or various containers?

steady herald
#

whats the name of the zombie sting file?

weak sierra
#

looks at CyberCow2077

#

the violin sting?

#

not sure off the top of my head but there's a mod that removes it which should make it real easy to figure out

#

something along the lines of "no violin sound"

#

probably replaces it with a blank file

#

@steady herald

#

this one

steady herald
weak sierra
#

because the mod will contain one file

steady herald
weak sierra
#

and it will be the one you need the name of

#

lol

steady herald
#

someone also needs to explain why stuff like this are in the files

#

found it

#

stab 1 2 and 3 are the culprits

#

now my dastardly plan can begin real_shit

gilded hawk
steady herald
#

Oh aye

#

I shouldnt make mods when tired

#

But thats when i get the most autistic ideas

gilded hawk
#

I'm looking for help regarding my mod, I can't keep items highlighted without having to use the onTick,

Without onTick they blink a lot

Problem is on some PC using ontick kills the FPS, how can I make this work without having to rewrite the entirety of ISInventoryPage:update?

I was thinking about checkingif the user is moving or something, in that case I could avoid invalidating my container cache

https://github.com/mxswat/pz-ProximityInventory/blob/master/Contents/mods/ProximityInventory/media/lua/client/1ProximityInventory.core.lua

GitHub

Contribute to mxswat/pz-ProximityInventory development by creating an account on GitHub.

thin hornet
#

is there really a big fps drop when highlighting a couple boxes?

icy dome
#

Hello guys. Goodnight.

I need to see a zombie's inventory.

I'm using the DoomZombies mod as a base, I'm studying how the mod structure works.

I'm trying to use this function, but it's throwing an error. How can I check if this function exists in this "variable"

#

local bool_scanner = corpse:getContainer():contains("ScannerModule")

Well I tried to create a variable to understand if it works like boolean

#

This appears to be generating an error.

thin hornet
icy dome
thin hornet
#

move it in there

#

you still need to check if the corspe is a corspe

#

if that still dont work post the error from the console.txt that will be more detailed

icy dome
#

Right

icy dome
#

And I'm just picking up zombies from the ground. However, I will modify as you recommended

thin hornet
#

give me more info, more code and more error log ๐Ÿ˜›

icy dome
#

Ok, ok

#

Basically I'm trying to read a zombie's inventory.

#

The idea is, when a player picks up the body an action occurs.

The action would be to check if the zombie has an item in the inventory

#

I'm using a mod as a base, to create this function
But I notice that some functions are not working as expected, maybe the mod hasn't been updated over time

thin hornet
#

so you are hooking into function ISGrabCorpseAction:perform() ?

#
local original_ISGrabCorpseAction_perform = ISGrabCorpseAction.perform
function ISGrabCorpseAction:perform()
  print(self.corpseBody) -- exist
  original_ISGrabCorpseAction_perform(self)
  print(self.corpseBody) -- dosn't exist anymore
end
icy dome
#

Not exactly, I'm using the event:

Events.OnContainerUpdate.Add(jiangshifuhuo)

thin hornet
#

but you want to do something during the action of picking up a dead body?

icy dome
#

I want to see if inside the body there is any specific item

thin hornet
#
local original_ISGrabCorpseAction_perform = ISGrabCorpseAction.perform
function ISGrabCorpseAction:perform()
  local container = self.corpseBody:getContainer()
  local scanner = container and container:contains("ScannerModule")
  if scanner then
    print('i found scanner in the corpse inventory')
  end
  original_ISGrabCorpseAction_perform(self) -- corspe is now deleted and is just an item in the player inventory
end
#

what you see here is a way of adding code inside an existing function without overwriting the function, i call this hooking
by looking at the original function you can see what you have access to using the self variable
we then call the original function and pass its self so that the original function execute. You can execute it before or after your own code addition.

#

in your case you can see in the original function you have access to the corpseBody being picked up.
you can also see that the body will be removed and deleted after the execution of this function.

#

Hooking the clean way

local original_ISGrabCorpseAction_perform = ISGrabCorpseAction.perform --- this save the original reference of the function
function ISGrabCorpseAction:perform() --- now we are overwriting it
  original_ISGrabCorpseAction_perform(self) --- when ready we call the original reference and pass the 'self' back to it

Hooking into a method that return something

local original_ISGrabCorpseAction_new = ISGrabCorpseAction.new --- this save the original reference of the function
function ISGrabCorpseAction:new(...) --- now we are overwriting it
  local o = original_ISGrabCorpseAction_new(self, ...) --- we call the original reference and pass the 'self' and other parameters and get the original result
  o.something = 123 --- we change what we want here
  return o --- we don't forget to return it
end
#

Now that you know this, there is over 150 timed action you can hook into ๐Ÿค“

icy dome
#

Thank you very much!!!

drifting ore
#

nvm

#

i pathed wrongly

#

im a dingus

icy dome
tranquil reef
#

Anyone know where the script for washing clothing is in the base game files? As in, the one that calls the timed action, not the timed action itself

thin hornet
dark finch
#

can someone make a screamer zombie mod please!? id pay!

dark finch
#

its almost perfect, the screamer is super jank, skeleton of the model is corrupted and the screamer teleports

#

its broken but would be cool if it worked

dark finch
#

thats basically the same thing as customizable zombies

keen frost
#

not the same lol

cosmic condor
#

your mods are cool

dark finch
#

oh wait now i see but can you edit the chance of it spawning in?

#

it doesnt seem so

#

thats a major deal breaker the fact it has all the other variables but not that

cosmic condor
#

I hope everyone can see your mod collections

keen frost
keen frost
cosmic condor
#

I guess everyone that plays MP is always surprised by the mods that the server owner puts on a server

dark finch
dark finch
#

Looks cool tho

keen frost
dark finch
#

Screamer and variable customization. So many good mods are ruined due to not being able to adjust them๐Ÿ˜ฅ

keen frost
#

what kind of customization?

dark finch
#

Simply just the spawn chance

keen frost
#

ah, I could add that in my mod, but you probably will hate the other features it has๐Ÿ˜†

dark finch
#

Aslong as i can 0 them out and and only let the screamer spawn in that would be awesome

#

I have sprinters at 13% so i wan a keep it that way

keen frost
jolly harbor
#

Anyone know why I keep getting this error? ๐Ÿ˜ญ
Trying to post my first mod but Iโ€™m new to all this โ€ฆ

keen frost
#

first time seeing that error, seems that you are missing some folders? it should be like /Contents/mods/yourModFolder

jolly harbor
#

This is how it looks โ€ฆis that wrong?

thin hornet
keen frost
#

its look fine, idk stressed

jolly harbor
#

I know how to take a screenshot ๐Ÿ˜‚๐Ÿ˜‚
I just took these pics cause I was in a hurry ๐Ÿ˜‚๐Ÿคฆ๐Ÿฝโ€โ™‚๏ธ

#

I canโ€™t for the life of me figure out what Iโ€™m doing wrong โ€ฆ๐Ÿค”

shadow geyser
#

double check that there aren't any hidden files in any of those folders

polar gyro
#

I trying to make traits which:
1.Allow you to add or siphon gas faster
2. Make campfires faster, fuel to campfires faster.

Anyone can give help me with? I tried to modify timeactions but not working. :c

dark finch
cyan basalt
drifting ore
#

How do I change a traits icon ?

#

I checked the files but only 4 trait icons are shown and I really have no idea how to change them

#

vanilla traits btw

radiant obsidian
#

Is there a guide or tutorial on how to repack mods for a server? I'd like to reduce my 170 mods into something manageable for my friends. I have a collections page set up already but I'd like combine things that are abandoned, etc.

#

also is there anything like AMUMSS (No Mans Sky mod conflict merger) for PZ?

shadow geyser
# radiant obsidian Is there a guide or tutorial on how to repack mods for a server? I'd like to red...

you more or less just take all the mods and merge their media folder, and reupload it. You should ask for permissions though. there technically isn't a rule against it but is very disrespectful to do so without perms. and alot of mods anyways don't give permissions for that stuff. why do you want to pack them anyways? it doesn't really make much of a difference from just subscribing to a collection

radiant obsidian
shadow geyser
radiant obsidian
#

Yeah I wouldn't be packing mods if they forbid it and I'd ask permission if they required it, no worries.

plucky junco
#

hi, there is a function to add to a recipe to give no result?

shadow geyser
#

then basically the result item specified only provides the png for the recipe

fast galleon
#

I want to dismantle an item into more than one parts, is it necessary to make a function oncreate or can I just put them all in the result?

shadow geyser
fast galleon
#

ok weird, I have moveable item full type "mymodule.myitem" but when I place it and pick it up it has fulltype "moveables.spritename"

PS: finally figured where to set the mysterious customitem

steady herald
#

is there anyway to trigger an in game event like the jumpscare? for somereason im having a hard time getting it to happen lmao

steady nova
#

what

spiral sparrow
#

Metalworker

thin hornet
thin hornet
#

copy paste that into your debug console

#

to test it

thin hornet
#

replace getPlayer() by the correct player object as needed (for splitscreen support)

steady herald
#

how?

#

how do you access debug console?

thin hornet
#

you need to start the game with -debug in the param line

steady herald
#

well crap

#

my mod didnt work

#

thought i followed the pathing pretty well

#

is that not the correct pathing for a sound mod?

cosmic condor
steady herald
shadow geyser
#

when you load a game, does it show any of the files from your mod being loaded?

steady herald
#

no idea

thin hornet
#

@wooden falcon hey mate
for ChangeSandboxOptions2
can you add this line getSandboxOptions():toLua() for the new settings to apply directly please.

cosmic condor
steady herald
#

weird they are called stab tho

cosmic condor
steady herald
cosmic condor
#

yes. also, your folder should not contain any space to avoid problems

cosmic condor
#

better rename it to something more unique to avoid overwriting

steady herald
#

alright

#

ill update the mod and try again

#

nyet

#

still plays the original sting sounds

cosmic condor
#

you can download any jumspcare mod on the workshop and see its code

steady herald
#

didnt think of that

#

i already have one to look at

cosmic condor
#

check what you did wrong

steady herald
#

ahhh

#

the script is different

cosmic condor
steady herald
#

just renaming everything

#

....

#

@cosmic condor

#

i forgot the s on scripts

cosmic condor
#

folder? lol

steady herald
#

yep

#

renamed and it works

#

thanks for the help

#

and thank you @thin hornet for the debug line

cosmic condor
weak sierra
steady herald
#

id love our character to go insane and hear whispers

cosmic condor
#

I guess it was used before, maybe too annoying so they removed it?

steady herald
#

theres also 4 random cut screams

#

finally

#

my first pz mod

#

odd ive only modded zombie games...

cosmic condor
steady herald
#

thats why i had a bit of issues lol

weak sierra
steady herald
#

the first of many mods to come

#

i wanna try and add my artwork into game next. just to hang them up on stream

dark finch
#

Does any one take commissions out here?

#

I understand mods arnt easy but like no one wants money lol

steady herald
dark finch
#

Atleast ur honest

steady herald
#

aye

#

can do you a friends and family for ยฃ1050

dark finch
#

Lets convert that into yen

steady herald
#

171,266.02 yen

#

but im nice

#

lets make it 171,267

#

just to round up

#

kinda curious tho @dark finch what ya want commissioning?

dark finch
#

Special infected zombies

#

Tbh im pretty picky but i just hate the design choices of most of whatโ€™s currently available which is barley much at all.

steady herald
#

ahhh

tranquil reef
#

Is there a way to check the skin color of a zombie?

sour island
tranquil reef
#

Alright, thank you

sour island
#

Anyone familiar with UI?

#

Trying to add a combobox to a window and its just not appearing

#

combobox is the one with a drop down right?

#

A drag and drop UI editor would be amazing

#

I take back everything bad I said about mapping

#

UI is way more tedious

#
    self.assignComboBox = ISComboBox:new((self.width/2)-50, (self.height/2)-1, 160, 22, nil, nil, nil, nil)
    --self.assignComboBox.internal = "ASSIGN"
    self.assignComboBox.borderColor = { r = 1, g = 1, b = 1, a = 0.4 }
    self.assignComboBox:initialise()
    self:addChild(self.assignComboBox)
    self:populateComboList()
#

printing if it exists works, and there are no errors

eternal garnet
#

What code defines an item so that you do not cut your hands when picking up glass?

keen frost
keen frost
#

this I how I did it some time ago, looks similar to yours

self.bountyRewardCombo = ISComboBox:new(bountyTitleX+70, bountyTitleY+140, width, 20)
self.bountyRewardCombo.font = UIFont.Small
self.bountyRewardCombo:initialise()
self.bountyRewardCombo:instantiate()
self:addChild(self.bountyRewardCombo)
    
self.bountyRewardCombo:addOption("Muldraugh",{})
self.bountyRewardCombo:addOption("Westpoint",{})
sour island
#

it's inside of a initialise()

keen frost
#

well it should work anyways, hard to know with just that piece of code

#

but feel free to DM me if you need help with that ๐Ÿ˜ƒ

sour island
#

is there a way of layering UI with out relying on draw order?

#

figured it out

weak sierra
#

i have encountered the strangest error with my gun mod. when i mouse over the gun in my inventory the popup panel of info just says the gun name then some blank space below it, and errors are constantly thrown out while i'm doing this. if i right click the gun I get only a partial context menu, equip/unequip, drop, and insert magazine iirc

#

the insert magazine does not know what magazine goes in it, and is always red with no tooltip

#

in the log it says that it can't run getDisplayName because the result of getting the item is null

#

does this for a few different things that cause the error, mousing over it and right clicking generates the one

#

i feel like it has something to do with the magazine due to this

#

the assignment in the gun script is

#

it is defined as

#
    {
        CanStack         = FALSE,
        Weight         = .6,
        Type         = Normal,
        DisplayName         = PPSh-41 Drum Magazine,
        Icon         = PPShDrum,
        MaxAmmo         = 71,
        AmmoType         = Base.762Bullets,
        WorldStaticModel         = PPShDrum,
    }```
#

(the module is UdderlyGuns)

#

the kicker is i have a drum magazine and it exists and has no issues with the tooltip/etc.

#

so perhaps that's a red herring

#

the locations the error occurs in

#

function: render -- file: ISToolTipInv.lua line # 108 | Vanilla

#
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 593 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla```
#

guess i'll poke through those when i get back and see if there's any hints in the context

weak sierra
#

def has to do with the mag

#
``` for the latter location
weak sierra
#

turns out i had a comma after the item name on the item script, somehow - bet that's it.

#

scripts sure could use a parser that did some form of error checking

fair current
#

Is there a mod for trading? or stores?

weak sierra
#

yeah noir made a store mod that's public

#

and bikinihorst has a vending machine/shops mod that's less player-controlled

#

included as part of his PARPChat mod

#

wrong channel tho

fair current
#

Thx

jagged ingot
#

I really need to write that GUI application for scripts.

#

I keep coming back here and seeing these issues costing people a lot of time they could've spent working on their mods. =/

#

Still on my TODO list.

full vine
#

Did anyone try to make a weapon with PiercingBullets = TRUE and MaxHitCount > 2? If yes, did it work for piercing more than 2 targets?

full vine
steady herald
#

i just had the best idea but i dont know if it would work

#

anyone know the code for pressing q?

dim hill
#

Is there a mod that will, like, quarter the amount of cigarettes that spawn in the world? Or at least makes Smoker less OP?

full vine
#

also Lucky quite twists up Smoker if you're into too much "realism" thing

steady herald
#

if i wanted to change the sound that plays when you die would i change it from event to the sound file. or do i add it to the sound

glad ridge
#
    local key = _keyPressed; -- Store the parameter in a local variable.    
    print(key); -- Prints the pressed key to the console.    
    -- We test if the correct key is pressed.    
    if key == 12 then        
    local player = getSpecificPlayer(0);    -- Java: get player one    
    local inv = player:getInventory();  -- Java: access player inventory    
    
    -- Java: add the actual items to the inventory    
    inv:AddItem("Base.Axe");
    inv:AddItem("Base.Katana");    
    inv:AddItem("Base.Bag_Schoolbag");    
    inv:AddItem("Base.Garbagebag");
    inv:AddItem("Base.Bag_FannyPackFront");
    end
end
Events.OnKeyPressed.Add(addItems);```
#

what am i doing wrong here? making my first code following robomats old 2013 guide since i can't find updated guides..

cyan basalt
#

is it printing anything?

#

and im assuming this is a client script correct?

glad ridge
#

i just enabled the debug menu and it doesnt seem like it's printing anything

#

yes i set it up in client

cyan basalt
#

what directory did you put the mod in? is it set up correctly?

glad ridge
#

but i did base everything off of a 2013 guide so i'm not sure its accurate

cyan basalt
#

easiest thing for me was to download some mods off the workshop and then study those

#

and also look at the prexisting lua/folder structure from the actual game

glad ridge
#

that is what i've been trying to do, but i havent found one that lets you add to inv with a keypress

small topaz
glad ridge
#

i have it set like this

small topaz