#mod_development

1 messages ยท Page 187 of 1

warm vessel
#

Though panning is what I wanted, not specific zoom alterations kekw

warped condor
#

So my first look on arsenal mode I see something like this in function:

            if attacker:isAiming() then

                local data1 = "            +"
                local r = 0.0
                local g = 1.0
                local b = 0.0
                local zoom = getCore():getZoom(0)
                local height
                ----------------------------------
                --    FOR RESOLUTION ADJ            --
                ----------------------------------
                local sx = IsoUtils.XToScreen(attacker:getX(), attacker:getY(), attacker:getZ(), 0);
                local sy = IsoUtils.YToScreen(attacker:getX(), attacker:getY(), attacker:getZ(), 0);
                sx = sx - IsoCamera.getOffX() - attacker:getOffsetX();
                sy = sy - IsoCamera.getOffY() - attacker:getOffsetY();
                sy = sy - 82
                sx = sx / zoom - 40
                sy = sy / zoom

            --    DebugSay(3,"X "..tostring(sx).." Y"..tostring(sy).."ZM "..tostring(zoom))

                if        zoom <= 0.25    then    height = 60        -- 24
                elseif    zoom <= 0.375    then    height = 36        -- 10
                elseif    zoom <= 0.5        then    height = 24        -- 8
                elseif    zoom <= 0.625    then    height = 16        -- 4
                elseif    zoom <= 0.75    then    height = 12        -- 4
                elseif    zoom <= 0.875    then    height = 8        -- 2
                elseif    zoom <= 1.0        then    height = 6        -- 2
                elseif    zoom <= 1.125    then    height = 4        -- 2
                elseif    zoom <= 1.25    then    height = 2        -- 0
                else                height = 0
                end
#

it may lead you somewhere.

warm vessel
#

That's definitely interesting

#

I'm gonna try to achieve what I want without delving into something like that, but it might come to that xD

#

thanks for all the help

bronze yoke
#

with empty hands, with an unupgraded rifle, and with a rifle with an 8x scope i was able to achieve exactly the same pan levels

warm vessel
#

f*ck

warped condor
#

I know that when I was using britas/arsenal with x16/and other scopes the camera range* changed to further one.

#

Arsenal also uses their own DynamicRangeModifier function.

#

more info about in GunFighter_02Function.lua | Line 6359

trim mist
#
local oldRender = ISToolTipInv.render
ISToolTipInv.render = function(self)
...
  local mx = getMouseX() + 32;
  local my = getMouseY() + 10;
...
  if not self.followMouse then
      mx = self:getX();
      my = self:getY();
  end
  if self.desiredX and self.desiredY then
      mx = self.desiredX;
      my = self.desiredY;
  end
  
  --update tooltip objects with calculated vars
  self:setX(mx + tooltipOffsetX);
  self:setY(my + tooltipOffsetY);
  
  self.tooltip:setX(mx + tooltipOffsetX);
  self.tooltip:setY(my + tooltipOffsetY);
...
  -- screen bounding
  --right-side bounding
  local exposedX = (self:getX() + longestLeftTextWidth + tooltipPaddingLeft + tooltipPaddingRight);
  local exposedY = (self:getY() + (textHeight + tooltipPaddingTop + tooltipPaddingBottom))
  local exposedWidth = getPlayerScreenWidth(player:getPlayerNum());
  local exposedHeight = getPlayerScreenHeight(player:getPlayerNum());
  if (self:getX() + longestLeftTextWidth + tooltipPaddingLeft + tooltipPaddingRight) > getPlayerScreenWidth(player:getPlayerNum())
  then
      self:setX(getPlayerScreenWidth(player:getPlayerNum()) - (longestLeftTextWidth + tooltipPaddingLeft + tooltipPaddingRight))
      self.tooltip:setX(getPlayerScreenWidth(player:getPlayerNum()) - (longestLeftTextWidth + tooltipPaddingLeft + tooltipPaddingRight))
  end
  --bottom-side bounding
  if (self:getY() + (textHeight + tooltipPaddingTop + tooltipPaddingBottom)) > getPlayerScreenHeight(player:getPlayerNum())
  then
      self:setY(getPlayerScreenHeight(player:getPlayerNum()) - (textHeight + tooltipPaddingTop + tooltipPaddingBottom))
      self.tooltip:setY(getPlayerScreenHeight(player:getPlayerNum()) - (textHeight + tooltipPaddingTop + tooltipPaddingBottom))
  end
  --Draw tooltip

  self:drawRect(0, 0, (longestTextWidth + tooltipPaddingLeft + tooltipPaddingRight), (textHeight + tooltipPaddingTop + tooltipPaddingBottom), self.backgroundColor.a, self.backgroundColor.r, self.backgroundColor.g, self.backgroundColor.b)
  self:drawRectBorder(0, 0, (longestTextWidth + tooltipPaddingLeft + tooltipPaddingRight), (textHeight + tooltipPaddingTop + tooltipPaddingBottom), self.borderColor.a, self.borderColor.r, self.borderColor.g, self.borderColor.b)
...
 self.tooltip:DrawText(leftText, lineX, lineY,
                            currColor:getRedFloat(),
                            currColor:getGreenFloat(),
                            currColor:getBlueFloat(),
                            currColor:getAlphaFloat())
...
#

Hoping I can get some help with the above. See the video for a quick explanation

#

Actual problem description begins at 0:42

warped condor
#

Seems like problem with that bounding as you can see the text is still following the mouse position.

#

Can't really take a closer look on it rn.

bronze yoke
#

where do lineX, lineY come from?

trim mist
#

as best as I can tell, drawing the text and rect rely on the setX and setYs earlier on in the code. LineX and LineY are just padding, essentially

#

LineY is a little more important since it tells the tooltip code how much further down to draw a line of text

warped condor
#

I mean the bounding works for the tooltip background, not for text you draw after.

bronze yoke
#

the background seemed like it was going too far too, just not as much

warped condor
#

Yeah but it stops in some point.

trim mist
#

yeah and that's the strangest bit. They've been assigned the same value, why would they stop at different points, and the other not at all?

mellow frigate
#

I guess that: the answer to the problem does not lie in the shown code only. I suggest you do all your computation localy first and then you self:setX and Y and after wards you do everything that uses getX a Y. The logic problem should appear clearly.

bronze yoke
#

yeah, all this redundancy concerns me that something isn't the same and it's just difficult to spot

warped condor
#

I have the same feeling now when remaking the main menu buttons ๐Ÿ’€

mellow frigate
#

afterwards, think of a way to call oldRender (maybe like eris_food_expiry mod) or you'll have a very low mod compatibility.

bronze yoke
#

when calculating the position longestLeftTextWidth is used, but during rendering longestTextWidth

#

what's the difference? is that intended?

crystal idol
#

how much experience did you have? didnt work

crystal terrace
crystal terrace
#

little update: i used addItemOnServer and removeItemOnServer , it works. Now i can see the same items on a different client.

#

i think its safe to say now my mod is compatible with MP as well, i wonder what happens if i just use the above two methods instead of removing/adding items individually to containers. Might try that out see if it works.

vestal token
#

how does making a mod workd

crystal terrace
# vestal token how does making a mod workd

that's a broad question. You can pretty much do a lot of stuff from adding items, interacting with a lot of game mechanics, weather, player stats the list goes on. If you're interested i can share a guide i made on steam that should be enough to give you directions on how to exactly add custom items to game. That could be the start.

vestal token
#

yes please :D

#

i want more new object in this game

royal stirrup
#

how come there arent front right and front left windows in the vehicle mechanics, even though it should be there???

crystal terrace
uneven jay
#

after that watch a bit of tutos ask a bit of questions and you should be set

#

or atleast thats what i did

crystal terrace
#

this line breaks singleplayer, works fine on MP.

fast galleon
#

I have this line and it doesn't break anything

neon bronze
#

In sp both isClient() and isServer() are false

crystal terrace
#

now it works for both MP and SP

#

It's hard to get your head around how pz handles server client in terms of SP and MP, hopefully it doesnt break anymore. Tested in both modes now.

glass tartan
#

Hiya, can an item serve as a heat source for the purposes of cooking, either as an inventory item or as a worldobject using the "place item" interaction

fast galleon
crystal terrace
fast galleon
crystal terrace
#

am i good to rely on it to find game mode tho?

sour island
#

There's a parameter check in initworld for newworlds though

sour island
crystal terrace
sour island
#

That should return false in SP

fast galleon
crystal terrace
#

ye the file is in client folder

#

should it be in server instead?

fast galleon
#

I can't answer that since I don't know what you're doing.

crystal terrace
#

just transfering items from one container to other

sour island
#

Doesn't isClient/isServer return if the game getCore() is bClient or bServer?

fast galleon
#

he uses not isClient() in client folder, and he needs that for both client and SP?

sour island
#
        @LuaMethod(
            name = "isClient",
            global = true
        )
        public static boolean isClient() {
            return GameClient.bClient;
        }
#

The isClient and isServer doesn't have anything to do with the client/sever folders

crystal terrace
#

alr

sour island
#

Afaik, the issue stems from how the old MP code ran

#

So the terms are all the same, but they're unrelated now

fast galleon
crystal terrace
#

this is where im using this snippet to call transfer goods function which transfers items for reference

sour island
#

Running isServer is /client/ is pointless yes, but you can run isClient is /server/ -- in this case regardless isClient shouldn't be returning true in SP

fast galleon
sour island
#

Oh derp

crystal terrace
#

๐Ÿ‘€

sour island
#

I just woke up lol

crystal terrace
#

does that mean im good to go with gamemode thingy? seems to work out for now unless im missing a big picture.

sour island
#

it should be fine technically, but there's also some finicky stuff with gamemode and exiting to the menu - probably not to be worried about

#

if you want the code to get blocked in MP the code should have been if isClient() then

#

including the not flips the boolean check

fast galleon
#

while this code is in client folder, it's safe to remove that check.

crystal terrace
#

so itll be something like if isClient()....then if not isClient() then return?

fast galleon
#

do you want something different to happen for SP and client?

crystal terrace
#

not really same stuff both modes

fast galleon
#

if false then return end or just remove the check

crystal terrace
#

ah i think i understand what you mean, let me try removing the check.

sour island
crystal terrace
#

i orginally was working with MP, was very confused with this client and server stuff

sour island
#

If the code is in /client/, it won't ever be ran by the server-side entity

#

If you don't care about MP or SP, then it's safe to not have a block at all

crystal terrace
#

ah i think i explicitly made sure it doesnt run on server side but it makes sense now. Client stuff wont run on server side, i complicated it way too much.

sour island
#

Unless you're just trying to block the mod in MP and slapping a 'SP only' sticker on it so you don't deal with commenters

sour island
#

I posted a summary of what I found - it's still trips me up a few times anytime I touch MP code

#

I usually have comments next to the send commands

#

I wish they named it more explicit for dumbdumbs like me - OnClientToServerCommand

crystal terrace
sour island
#

OnClientCommand only fires in /server/ drunk - so I have to double check that everytime

crystal terrace
#

lol you're not the only one

sour island
#

mod 2 good

#

efficient brick lol

crystal terrace
#

@sour island @fast galleon Thank you, my 7 holy subscribers send their gratitudefrog

warped condor
# sour island

You just gave me a powerful idea. Time based objectives, if you fail your save will be corrupted.

glass tartan
#

Can inventory and/or placed items (not tiles, like the campfire) function as a heat source (both for warming up and cooking food)? Would it require lua scripting?

warped condor
#

Def you can code that if you have something in inventory your player heat is changing and it requires lua.

glass tartan
#

thanks

#

How about placed items? would I use the IsoHeatSource script?

warped condor
#

I didn't do anything with making new heat source object yet. so can't really tell.

icy kelp
#

Just wanted to confirm something about map layers. It goes IsoCell > IsoChunk > IsoGridSquare right? And files are saved as IsoChunks in the servers cache folder?

crystal terrace
sour island
#

parkour mod ๐Ÿ˜ฎ

#

movement is insanely limited in vanilla - glad tchern and others have added some much needed depth

crystal terrace
#

everything looks perfect, modders are doing great work.

sour island
#

all possible cause of the nifty animation system

crystal terrace
#

is that something introduced in newer pz builds?

sour island
#

in relation to the history of PZ, yeah

#

it held up development quiet a bit - and has made alot of stuff more feasible since they didn't need to sprite everything from models

#

players used to be 2D rendered from 3D ๐Ÿ˜…

#

Similiar to how corpses are done

crystal terrace
#

ah that's nice, B42 would give us more tools to play with.

crystal terrace
mellow frigate
crystal terrace
#

ye he's the story telling guy for sure, a lot of work goes into it for sure.

#

it's also that pz gives you a lot of props to play with, you don't even need zombies in there to tell a good story.

sleek magnet
#

Already looks so cool! Excited to see more progress updates, really impressive stuff.

uneven jay
#

yall know why my item has black and red texture along with why the icon wont load on it

sour island
#

Anyone run into a way to tell if a player is backpedaling?

crystal terrace
uneven jay
crystal terrace
#

textures yes, icon file name should also have prefix item_ and when you call those file in script don't use this prefix

uneven jay
#

oh so im supposed to use item_(instert name)

#

?

crystal terrace
#

yes

uneven jay
#

so
Icon = item_Upgrade_Kit,
instead of

#

Icon = Upgrade_Kit,

crystal terrace
#

nah i meant the icon file should be saved as item_Upgrade_Kit and when you call it in script it should be Upgrade_Kit only

uneven jay
#

alr

#

ill try it

crystal terrace
#

not sure what you mean by that, can you post a screenshot or something?

uneven jay
#

yeah wait

#

need to load the test save

#

alr icon works

#

my first mod so recycling some stuff

#

:p

#

lol the mods name is stuck

#

from the save

#

i changed it to backpack upgrades

#

i thought it would be easier to do

#

as my first mod

crystal terrace
uneven jay
#

is static model only for clothes

#

and where can i find them

#

cuz idk if thats the right static model for guncase

crystal terrace
#

static model is for when character holds stuff in hand from what ik

uneven jay
#

ah

#

how can i apply textures to a specific item?

crystal terrace
#

worldstatic is for stuff thats placed in world, i think static models are designed different. Thats a question for #modeling prolly.

uneven jay
#

do i just texture_Upgrade_Kit.png?

crystal terrace
#

are you familiar with uv maps? all 3d models have UV maps based on that you design textures.

faint jewel
#

?

uneven jay
#

not really

faint jewel
#

so the model you have is it yours or an ingame one?

uneven jay
#

in game one im using the gun case

#

but i wanna apply diff texturew

faint jewel
#

okay and you applied YOUR texture to it?

uneven jay
#

didnt yet to see if it worked at all but i assumed it should have had the normal texture + i didnt really see a texture option

crystal terrace
#

you will need to do model script btw for applying textures to these models after you design textures.

faint jewel
#

okay so i see your item definition... where is your MODEL definition?

uneven jay
#

hm ok

crystal terrace
#

a simple hack if you're using in-game models, you can try to replicate somewhat similiar pattern of texture available in-game that way you don't need to dive too much into uv map and stuff, but i would advise to checkout what is UV map so you get the basic idea to go forward.

uneven jay
#

so basicly

#

i need to rename the texture get the model with that

#

and put it in models_X?

#

the texture goes in textures

crystal terrace
#

if your texture is ready, you need model script to define what model you will apply this texture to and what scale you wanna keep of the model etc etc, checkout vanilla /scripts there should be a file with model... in there.

#

models_X is for 3d models

uneven jay
#

it didnt load its model_items right

faint jewel
#

hold on.

#

module J'sPackUPGS
{
    item Upgrade_Kit
    {
    DisplayCategory = Material,
    Weight    =    0.5,
    Type    =    Normal,
    DisplayName    =    Upgrade Kit,
    Icon    =    Upgrade_Kit,
    WorldStaticModel = UpgradeKit_Ground,
    }

    model UpgradeKit_Ground
    {
        mesh = WorldItems/Clothing/PlasticLunchBox_Ground,
        texture = clothes/bag/GunCase,
        scale = 0.4,
    }    
}
#

there.

#

you can adjust the texture there.

uneven jay
#

thanks

#

do i just make a clothes folder and put a bag folder in it? @faint jewel

#

sorry for asking so many questions my first time

faint jewel
#

in your mod folder, yes

#

change guncase to your png name.

heady crystal
#

Anybody know if it's possible to send a command from a client to another?

crystal terrace
#

you can put a condition in there if you're targeting a particular client?

#

clientA->server->clientB

uneven jay
crystal terrace
#

but you'd need something to identify, im sure there would be something to differentiate.

heady crystal
#

I got a bit more confused between how client and servers work ever since I found out the folders are useless and stuff lol

neon bronze
#

Not particularly useless

crystal terrace
#

what clients you are targeting btw? is there something specific?

neon bronze
#

Its just that your client is also your server

heady crystal
#

Yeah I wanted to be able to go for a specific player

#

I am not sure if sendClientCommand sends to everybody or just the server

crystal terrace
#

should be doable then, you send command from one client and check if its player A and then command server to send command for player B

uneven jay
faint jewel
#

nop

heady crystal
#

That's what I was thinking, but this could mess with communications

#

Sending from player A to server then back to player B all the time

uneven jay
faint jewel
#

steamapps\common\ProjectZomboid\media\scripts\models_items.txt

neon bronze
#

Alternatively i would look how trading in mp does it

uneven jay
faint jewel
#

steamapps\common\ProjectZomboid\media\scripts\items*.txt

#

you dont need to move the model.

#

just make sure in the model definition you have it pointing to the right model.

crystal terrace
#

i think it would depend on your usecase, that would make things more clear whether this could become problematic.

#

i tried something like this when i just wanted to update moddata from particular client and then fetch from a particular client.

bronze yoke
#

you have to ping off the server like alphabee says

#

we can't directly communicate between clients

#

probably for the best really

uneven jay
#

@faint jewel its kindy a bit unpolished but it works so thank you

faint jewel
#

๐Ÿ™‚

uneven jay
#

i was bored so i was reading this stuff

faint jewel
#

no. you are't using their assets

uneven jay
#

ah yeah i can

#

actually does that count

#

i mean i am kind of editing thier models textures

#

im overthinking xd

crystal terrace
#

prolly

uneven jay
#

like does it make it harder on other poeples pc like rendering more scripts or just does nothing

crystal terrace
#

i think its safe to mash em together

uneven jay
#

ye its safe but is it required or is it better?

#

cuz i wanna stay organized but still be in the green zone

faint jewel
#

you can put them all in one file, i RECCOMMEND the items and model be in theri own files.

crystal terrace
#

prolly better to have all relevant stuff together

warped condor
#

and return if not on both sides. (About communication issues)

frosty estuary
#

So I'm trying to implement a change in the server xp multiplier in certain time periods changing the sandbox var. First try to make this change os server side but apparently the server don't apply and transmit the change for player, now trying on client side, but only work if a admin do the command change, regular players the server blocks due to unauthorized packet (disabling anticheat 8 stop the player from being kicked, but the comand is still blocked). Any way to authorize this comand for regular players ?

sour island
warped condor
#

Is there any mod that makes zombies get through walls by stacking up on it?

tardy wren
#

Are traits related to sleep automatically marked as "removed in Multiplayer" by the game?

#

Anyway, running into a weird issue when trying to patch a method in the character creation UI

#
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    Original_mutualyExclusive(self,trait, bAdd)
    local traitList = TraitFactory.getTraits();

    for i = 0, traitList:size() - 1 do
        ---@type TraitFactory.Trait
        local trait = traitList:get(i);
        if trait:isRemoveInMP() then
            print(trait:getLabel())
            self.instance.listboxTrait.removeItem(trait:getLabel())
            self.instance.listboxBadTrait.removeItem(trait:getLabel())
        end
    end
end
#
attempted index: 1.0 of non-table: null


STACK TRACE
-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: removeItem -- file: ISScrollingListBox.lua line # 190 | Vanilla
function: mutualyExclusive -- file: RespawnProfession.lua line # 76 | MOD: Udderly Knocked Out
function: onSelectProf -- file: CharacterCreationProfession.lua line # 547 | Vanilla
function: onMouseDown -- file: ISScrollingListBox.lua line # 491 | Vanilla

ERROR: General     , 1691011087340> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: 1.0 of non-table: null at KahluaThread.tableget line:1689.
ERROR: General     , 1691011087340> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: 1.0 of non-table: null```
#
function ISScrollingListBox:removeItem(itemText)
    for i,v in ipairs(self.items) do
        if v.text == itemText then
            table.remove(self.items, i);
            self.count = self.count - 1;
            if not v.height then v.height = self.itemheight end -- compatibililty
            self:setScrollHeight(self:getScrollHeight()-v.height);
            if self.selected > self.count then
                self.selected = self.count
            end
            return v;
        end
    end
    return nil;
end
#

Mind you, yhe function is getting the index number from the table that it complains is null, which... I don't understand at all

mellow frigate
warped condor
#

Can confirm the software is legit, I use it as well.

tardy wren
#

Is there any way I can prevent players from selecting any traits on the character creation Menu?

modern hamlet
#

Is complete clothing repair available on the lua side that allows it to be done with 8 level tailoring? I found the patching thing but I couldn't find the complete repair function.

tawdry moss
#

trying to change my mod so it's easier to implement translations, but it feels like no matter what I do I can't get it to show the intended text. theres very little resources i could find for this. any ideas?

#

after fixing smash and heat not having commas it still doesnt work im genuinely at a loss

warped condor
#

I might be wrong but translation function is hard coded and takes lines from modules that you have in game already, so you need to choose one and add your translation there.

tawdry moss
#

damn

warped condor
#

as it is context menu you can just add it here example

#

Install_Canister could be any

#

everything else must stay as it is.

#

So adding new line, you need to include ContextMenu_ at the start.

#

so in short, you can't change file name and module name, but you can add your custom translation @tawdry moss

tawdry moss
#

thanks

warped condor
#

You can see every available translation module in lua/shared/Translate/EN

tawdry moss
#

tysm

normal scroll
#

Guys, I'm trying to change the crouch key to none while doing some stuff of my mod and reset to default when done. I managed to make it work but everytime i reload my game i need to rebind the key in the options.
Anyone knows why isn't saving?

tawdry moss
#

maybe have it rebind the key automatically during the OnDisconnect or OnGameStart events

tawdry moss
#

Iโ€™ve never tried anything involving rebinding keys so I donโ€™t know how else to help you there

normal scroll
#

I'm trying

local old_MainOptionsApply = MainOptions.apply

function MainOptions:apply(closeAfter)
    old_MainOptionsApply(self, closeAfter)
    crouchKey = getCore():getKey("Crouch")
end```
and
```getCore():addKeyBinding("Crouch", crouchKey);```
To reset the key to default

Everything works fine, i print the crouchKey and get the correct value. But when i restart the game, the value goes to 0.
tawdry moss
#

Maybe the stored default is reset when the game restarts

mellow frigate
#

if it does not work as you expect, make your own function that does the same. see 'keys.ini' uses under MainOptions.lua

mellow frigate
#

by the way, is your crawling soldier still raising its leg ? I'm interested in the solution you'll apply

warped condor
#

The solution was to cut his leg off, no need to animate it. (joke)

normal scroll
#

I'm not sure why this happens yet. I've tried to rotate the bones every angle you can imagine. I even tried to reverse the bones position lol

mellow frigate
#

looks like a pain in the a...nimation

normal scroll
#

Indeed it is. I've spent a lot of time in this.

wide sierra
#

how do I test my mod for errors in the lua debugger in debug mode? I looked at the list and don't see my mod

crystal terrace
#

anyone here tried interacting with player body temp before? the amount of variables that goes into temp, is it even possible?

wide sierra
#

in the mod list in the lua debugger

crystal terrace
#

dont remember seeing a mod list in debugger, mostly just looked at files and variables.

young trellis
#

Does anybody know of a mod that can essentially allow for say a set area of loot containers actually respawn different than the sandbox settings. For example if I wanted to make a food store respawn more freqeunt to that of the area around it, is there one made already yet?

wide sierra
hollow pine
#

Anyone know a mod that makes plumbing better? Cause needing a water barrel for every water item in a very specific spot for each thing is basically impossible for some buildings

cosmic moon
#

Hey ya'll, I'm making an accessibility mod for a buddy of mine and could use a little advice.
What I have so far:
-Press controller button
-Face closest zombie
-Attack
My problem is that when calling player:AttemptAttack() or player:DoAttack() the player is unable to move while attacking. I've tried setting player:setAttackAnim(true) to go into aiming mode, but it appears the Attempt/DoAttack() doesn't work at all in that mode.
If anyone has any comments, I would really appreciate the wisdom.
Thanks!

dark wedge
bronze yoke
#

even with that enabled you should be able to move

jaunty marten
tardy wren
jaunty marten
#

cos with table.remove I'll skip a few key, value pairs

jaunty marten
#

wtf

tardy wren
#

But is that why at the end of my table, some of my values were nil?

jaunty marten
#

wdym?

tardy wren
#

but frankly, that code only removes a single item at a time, so...

tardy wren
#
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    local traitFactory = TraitFactory
    Original_mutualyExclusive(self,trait,bAdd)
    for i, v in pairs(CharacterCreationProfession.instance.listboxTrait.items) do
        print(i,v)
        if v ~= nil then
            local trait = traitFactory.getTrait(v.item:getType())
            if trait:isRemoveInMP() then
                print(trait:getLabel())
                CharacterCreationProfession.instance.listboxTrait:removeItem(trait:getLabel())
            end
        end

    end
    for i, v in pairs(CharacterCreationProfession.instance.listboxBadTrait.items) do
        print(i,v)
        if v ~= nil then
            local trait = traitFactory.getTrait(v.item:getType())
            if trait:isRemoveInMP() then
                print(trait:getLabel())
                CharacterCreationProfession.instance.listboxBadTrait:removeItem(trait:getLabel())
            end
        end
    end
end
#

I rewrote my addition to be t his

#

And when I was debug printing the pairs, in my modlist, I had 50 traits in the positive slot, but 4 of them at the end were Nil

#

One of them was a trait I was trying to remove

#

Could it be that... my list was shifting under my nose all the time?

jaunty marten
#

by pairs there shouldn't be any v = nil cos in this way they even doesn't exist in this table lul. value = nil => remove from table what

tardy wren
#

And yet, at the end, there were a few instances of valid i that had a nil v

#

I have been shrinking the array I am iterating over...

#

Thinking about it now, I see where my point of failure could've been

sour island
#

I ran into some issues with pairs and removing things

#

If I recall my work around was setting them to false, then iterating over it again

#

Either that or setting the iterator number back 1

tardy wren
#

doing i=i-1?

sour island
tardy wren
#

I remember that with shrinking lists, you should iterate from the back

sour island
#

Yeah doesn't work actually

tardy wren
#

I tried a different approach

#

But it runs into the error I have stated above

#
LOG  : General     , 1691062738619> Athletic
LOG  : General     , 1691062738620> -------------------------------------------------------------
attempted index: 1.0 of non-table: null

LOG  : General     , 1691062738620> -----------------------------------------
STACK TRACE
-----------------------------------------
function: @stdlib.lua -- file: null line # 10
function: removeItem -- file: ISScrollingListBox.lua line # 190 | Vanilla
function: mutualyExclusive -- file: RespawnProfession.lua line # 132 | MOD: Udderly Knocked Out
function: removeTrait -- file: CharacterCreationProfession.lua line # 801 | Vanilla
function: onOptionMouseDown -- file: CharacterCreationProfession.lua line # 714 | Vanilla
function: onMouseUp -- file: ISButton.lua line # 56 | Vanilla
#
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    Original_mutualyExclusive(self,trait,bAdd)
    local traitList = TraitFactory.getTraits()
    for i = 0, traitList:size() - 1 do
        ---@type TraitFactory.Trait
        local trait = traitList:get(i);
        if trait:isRemoveInMP() then
            print(trait:getLabel())
            if trait:getCost()>0 then
                CharacterCreationProfession.instance.listboxTrait.removeItem(trait:getLabel())
            else
                CharacterCreationProfession.instance.listboxBadTrait.removeItem(trait:getLabel())
            end
        end
    end
end
sour island
#

This works but only if you can iterate over the list:

tardy wren
#

Let me try

sour island
#

Oh wait it doesn't work

#

well

#

because my test is even/odd

#

let me change the conditional

#

Reconfirmed you can do this

#

But you're also dealing with an array - not a lua table correct?

tardy wren
#

Actually, I'm dealing with a lua table here

#

The array approach fails completely for some reason

#

Let me show you

sour island
#

Going backwards also works if you're not comfortable with shifting the key -

#

And if this is only being done once, I don't think it's worth worrying about table.remove

tardy wren
#

I'm working with Zomboid's UI

#

Trying to work around an edge case the devs didn't think about

sour island
#

Which is?

tardy wren
#

My profession's trait is mutually exclusive with traits that are set to be deleted in multiplayer

#

Selecting the profession and deselecting it calls code that re-places the mutually exclusive trait in the trait boxes

sour island
#

ah

#

Wouldn't it be possible to rerun the process that checks for MP removal?

tardy wren
#
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    for i = 0, trait:getMutuallyExclusiveTraits():size() - 1 do
        local exclusiveTrait = trait:getMutuallyExclusiveTraits():get(i);
        exclusiveTrait = TraitFactory.getTrait(exclusiveTrait);
        if exclusiveTrait:isFree() then
            -- nothing
        elseif not bAdd then
            -- remove from our available traits list the exclusive ones
            if exclusiveTrait:getCost() > 0 then
                self.listboxTrait:removeItem(exclusiveTrait:getLabel());
            else
                self.listboxBadTrait:removeItem(exclusiveTrait:getLabel());
            end
        elseif not self:isTraitExcluded(exclusiveTrait) then
            -- add the previously removed exclusive trait to the available ones
            local newItem = {};
            if exclusiveTrait:getCost() > 0 then
                newItem = self.listboxTrait:addItem(exclusiveTrait:getLabel(), exclusiveTrait);
            else
                newItem = self.listboxBadTrait:addItem(exclusiveTrait:getLabel(), exclusiveTrait);
            end
            newItem.tooltip = exclusiveTrait:getDescription();
        end
    end
end

this is the code that is bugged

#
function CharacterCreationProfession:mutualyExclusive(trait,bAdd)
    for i = 0, trait:getMutuallyExclusiveTraits():size() - 1 do
        local exclusiveTrait = trait:getMutuallyExclusiveTraits():get(i);
        exclusiveTrait = TraitFactory.getTrait(exclusiveTrait);
        if exclusiveTrait:isFree() then
            -- nothing
        elseif not bAdd then
            -- remove from our available traits list the exclusive ones
            if exclusiveTrait:getCost() > 0 then
                self.listboxTrait:removeItem(exclusiveTrait:getLabel());
            else
                self.listboxBadTrait:removeItem(exclusiveTrait:getLabel());
            end
        elseif not self:isTraitExcluded(exclusiveTrait) then
            -- add the previously removed exclusive trait to the available ones
            local newItem = {};
            if not exclusiveTrait:isFree() and ((exclusiveTrait:isRemoveInMP() and not isClient()) or not exclusiveTrait:isRemoveInMP()) then
                if exclusiveTrait:getCost() > 0 then
                    newItem = self.listboxTrait:addItem(exclusiveTrait:getLabel(), exclusiveTrait);
                else
                    newItem = self.listboxBadTrait:addItem(exclusiveTrait:getLabel(), exclusiveTrait);
                end
                newItem.tooltip = exclusiveTrait:getDescription();
            end

        end
    end
end
#

And the nuclear solution of overwriting it whole works

sour island
#

Yeah, would be a good case to do so unfortunately lol

tardy wren
#

But there's concerns for compatibility

#

So instead I'm trying to iterate over the listboxTrait items to remove any that shouldn't be in MP, after a call to mutualyExclusive

tardy wren
sour island
#

Going to add it on the comm patch issues list

#

and take a look at it

tardy wren
#

Thank you

#

...There's a community patch?

sour island
#

Yes and no

#

I've just been collecting issues that don't really warrant their own mod

#

but would be nice to fix/deal with

tardy wren
#

Right... And I've made mods to fix singular issues

sour island
#

Yeah lol, my goal is to have a place people can dump those into

sour island
#

so it's in 1 place, and not a bunch of mods - as I've written mods consisting of 1 line before to fix stuff and it's kind of silly

tardy wren
#

Fixable back holes is exactly that

#

and my most popular mod too

#

over 10k subscribers, oh wow

sour island
#

Well if you ever want to add it on, you'd be very welcome to

tardy wren
#

I'll see if I have time

sour island
#

I wish there was a way to add contributors automatically

tardy wren
#

I have my own holes to fix

sour island
#

The github repo is set to upload automatically to the workshop on a schedule

#

So it's unmanned

tardy wren
#

Working with albion on StatsApi too... since I kinda needed it

sour island
#

Have you tried recalling CharacterCreationProfession:populateTraitList(list) after?

uneven jay
#

lads do i need to give an oncreate to every recipe?

sour island
#

Nvm this doesn't wipe the list

tardy wren
#

So it would only make my problem worse

jaunty marten
sour island
# tardy wren So it would only make my problem worse
---https://github.com/Project-Zomboid-Community-Modding/pz-community-modding/issues/60

require "OptionScreens/CharacterCreationProfession"
--(trait:isRemoveInMP() and not isClient()
local mutualyExclusive = CharacterCreationProfession.mutualyExclusive
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    mutualyExclusive(trait, bAdd)
    
    for i = 0, trait:getMutuallyExclusiveTraits():size() - 1 do
        local exclusiveTrait = trait:getMutuallyExclusiveTraits():get(i)
        exclusiveTrait = TraitFactory.getTrait(exclusiveTrait)

        if exclusiveTrait:isRemoveInMP() and not isClient() then
            self.listboxTrait:removeItem(exclusiveTrait:getLabel())
        end
        
    end
end

You've tried something like this?

sour island
sour island
sour island
#

I don't have your mod to test with unfortunately lol

tardy wren
#

Insatead iterating over all traits and seeing if they're not multiplayer compliant

#

I was getting an NRE in a standard library

tardy wren
sour island
#

That mod adds a profession?

#

Oh I see, it's how to regain the stats

tardy wren
#

Yes

#

Though your patch like all the other break the whole thing

#
LOG  : General     , 1691064866157> -------------------------------------------------------------
attempted index: getMutuallyExclusiveTraits of non-table: false

LOG  : General     , 1691064866158> -----------------------------------------
STACK TRACE
-----------------------------------------
function: mutualyExclusive -- file: CharacterCreationProfession.lua line # 749 | Vanilla
function: mutualyExclusive -- file: RespawnProfession.lua line # 100 | MOD: Udderly Knocked Out
function: addTrait -- file: CharacterCreationProfession.lua line # 735 | Vanilla
function: onDblClickTrait -- file: CharacterCreationProfession.lua line # 483 | Vanilla
function: onMouseDoubleClick -- file: ISScrollingListBox.lua line # 463 | Vanilla

ERROR: General     , 1691064866158> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getMutuallyExclusiveTraits of non-table: false at KahluaThread.tableget line:1689.
#

It is different from mine so I guess that's good

sour island
#

I scuffed the require - although I doubt that's the issue

tardy wren
#

...It's pointing at the exact line

sour island
#

there's no space

tardy wren
#

cough

sour island
#

or wasn't when I first posted it

tardy wren
#

Wait, don't you need to pass in the "self" parameter first when calling an original?

sour island
#

uh...

#

you do

tardy wren
#

Okay, attempt 2

sour island
#

that's probably the issue lol

tardy wren
#
require "OptionScreens/CharacterCreationProfession"
--(trait:isRemoveInMP() and not isClient()
local mutualyExclusive = CharacterCreationProfession.mutualyExclusive
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    mutualyExclusive(self,trait, bAdd)

    for i = 0, trait:getMutuallyExclusiveTraits():size() - 1 do
        local exclusiveTrait = trait:getMutuallyExclusiveTraits():get(i)
        exclusiveTrait = TraitFactory.getTrait(exclusiveTrait)
        if exclusiveTrait:isRemoveInMP() and not isClient() then
            self.listboxTrait:removeItem(exclusiveTrait:getLabel())
            self.listboxBadTrait:removeItem(exclusiveTrait:getLabel())
        end
    end
end
#

Went with this

#

removeItem doesn't do anything if it doesn't find it, so I can try to remove it from both boxes

uneven jay
sour island
uneven jay
#

ah

sour island
#
---https://github.com/Project-Zomboid-Community-Modding/pz-community-modding/issues/60

require "OptionScreens/CharacterCreationProfession"
--(trait:isRemoveInMP() and not isClient()
local mutualyExclusive = CharacterCreationProfession.mutualyExclusive
function CharacterCreationProfession:mutualyExclusive(trait, bAdd)
    mutualyExclusive(self, trait, bAdd)

    for i = 0, trait:getMutuallyExclusiveTraits():size() - 1 do
        local exclusiveTrait = trait:getMutuallyExclusiveTraits():get(i)
        exclusiveTrait = TraitFactory.getTrait(exclusiveTrait)

        if exclusiveTrait:isRemoveInMP() and not isClient() then
            if exclusiveTrait:getCost() > 0 then
                self.listboxTrait:removeItem(exclusiveTrait:getLabel())
            else
                self.listboxBadTrait:removeItem(exclusiveTrait:getLabel())
            end
        end

    end
end
tardy wren
#

Let me go die real quck

#

Dying successful

#

And holy shit, your patch worked!

sour island
#

๐Ÿ˜„

tardy wren
#

I've been working on this for like 6 hours

sour island
#

You're free to use a copy if you don't want to add a requirement mod

tardy wren
#

Went so bad I scuffed dinner

sour island
#

๐Ÿ˜ฆ

#

๐Ÿซ‚

tardy wren
#

Is there a way to check for loaded mods? then I can not apply my patch if you do already

#

Oh, wait

#

This is almost disastrous

sour island
#

?

tardy wren
#

My traits were removed, and I was testing this in singleplayer

#

((trait:isRemoveInMP() and not isClient()) or not trait:isRemoveInMP())

#

There's a reason this check has the additional not trait:isRemoveInMP

#
a = isRemoveInMP
b = isClient
a && !b || !a

a     b        F
a     !b        T
!a    b        T
!a    !b        T```
sour island
#

that check is for adding them on

tardy wren
#

Excuse my napkin boolean math

sour island
#

If isRemoveMP and not MP then = good, or not isRemoveMP = Good

#

It's actually a redundant way to check lol

tardy wren
#

So to remove, we just need to check if it's MP and the trait is removed in Mp

sour island
#

yes

tardy wren
#
        if exclusiveTrait:isRemoveInMP() and  isClient() then
sour island
#

But you're saying your traits are getting removed?

tardy wren
#

Yes

#

Because rn it inverses the isClient

#

so it treats SP as MP

sour island
#

oh true

#

mybad lol

tardy wren
#

no worries

#

I guess mycollege education is finally paying off

#

After years, one thing I remember

sour island
#

Do you have a github?

#

I want to check if my upload action still works lol

tardy wren
#

uh, yes

#

what do you need me to do?

sour island
#

I just need your acc name, I'll add you as a contributor

tardy wren
#

Diakon5

sour island
#

aw I scuffed it, forgot to make it a PR, but added you as a contributor lol

tardy wren
#

lmao, thanks

#

So, anything I should do?

sour island
#

Nah

#

the action isn't setup quite right though - So Ill have to figure that out

#

Fires on PR publish instead of merge :x

tardy wren
#

Oh no

#

Well, I have no knowledge of CICD systems, as I have only did a presentation about them

sour island
#

I think I fixed it, also added the keyword for hotfixes to the fix and it ran off itself lol

#

The patch is live ๐Ÿ™‚

#

Pipedream would be a way to automate the changelog for uploads

#

I know its possible but I'm not that well versed in github action stuff

uneven jay
#

how do you make recipes?

#

arent you supposed to put it in scripts

#

im guessing it should look somewhat look like this?

swift pagoda
#

Hey all, does anyone know how to edit the already existing moodles for the game or is that not possible at the moment?

uneven jay
#

yeah let me look at the code

#

do you want it for mp or sp

swift pagoda
#

Just SP. My own personal mod as it were.

uneven jay
#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\zombie\characters\Moodles

#

all of it should be there

swift pagoda
#

Ah, okay then. Sooo...no coding or anything like that?

uneven jay
#

btw what drive is pz installed in

#

than it might be d or idk

#

rn thats for c

swift pagoda
#

It's identical to what you typed.

uneven jay
#

alr

swift pagoda
#

Sick. Thank you for the info!

uneven jay
#

i recomend getting a java extension for visual studio code

swift pagoda
#

Oh, okay then. I'll see to that later. Thank you!

uneven jay
#

i already have the java extension installed

swift pagoda
#

Nah, I think I'm good. I'll definitely ask for help if I'm having trouble with it though!

uneven jay
#

alright than

swift pagoda
#

Thank you for the offer though!

uneven jay
#

no problem mate

hollow pine
#

Is there a mod to fix it so you don't have to have water barrels in extremely specific places? Like a pipe system?

tepid dawn
#

Finally its done ! Thank you everyone here for helping me get through this.

hollow pine
#

AFAIK that mod only connects rain barrels. It doesnโ€™t let you pipe a barrel from a different spot to a sink

mellow frigate
normal scroll
#

Guys, for some reason my mod it's not loading in multiplayer. I've checked the coop-console and found this.

WARN : Mod         , 1691075682589> 27.882.419> ZomboidFileSystem.loadModAndRequired> required mod "TrueCrawl" not found```
Any idea of what might be occurring?
mellow frigate
uneven jay
normal scroll
limpid grail
#

Mod idea: weeping angel zombies

#

Paired with: they know where you are

cosmic moon
solid isle
#

Hi everybody! I've been trying to make a female body replacement for a couple of days now and I've had no success. Well, I actually got it to work once but it only worked for once and broke the next time I opened the game. I've been trying replacing it on a new mod, on other replacement mods (using my .fbx instead of the one they come with) and even replacing the file in the game directory. What I get all the time is either a black screen or an invisible body on the character creator. My guess is that I'm doing something wrong when exporting the .fbx from Blender, but probably there's some special installation step I'm missing. I made a working hair mod at least. I haven't found a way of exporting .X files either. I'm only trying to edit the head part so I might just create a head accessory and roll with it, but I'd like to get to the end of this and see why what I'm trying to make doesn't work so I thought I may as well try and ask here. Thanks a lot in advance!

modern hamlet
#

Is it possible to change level 8 tailoring for repairing holes in clothes? I couldn't find the lua side for that.

cosmic arrow
crystal terrace
#

anyone familiar with this thing?

mellow frigate
bronze yoke
#

don't really know what the name refers to, maybe it replaced a slower system

crystal terrace
#

ah i got excited, thought maybe ill have the power to load squares๐Ÿ‘€

scarlet hornet
#

I love the modding community for this game and have a couple of somewhat simple (I think) mod ideas. I want to get started in modding and was wondering where I should start? Other than bettering my knowledge of Lua, of course, I mean zomboid-specfic things.

neon bronze
#

I would start with scripting

neon bronze
#

Adding items, recipes such stuff will help you with how modding in pz works and interacts with different items

#

*and editing

scarlet hornet
#

Many thanks

ancient grail
ancient grail
#

Recipe is related oncreate ontest
onperform

So youre right you need oncreate for recipe

Java --> lua --> (txt --> png / xml) --> x / fbx

And scripts recipe and similar stuff basically one lua file
The
Recipecode.lua

solid isle
bronze yoke
#

only recipes that need special functionality need one

onyx basalt
#

Hello, I have a Zumboid server and I need to find a way to pull the information and status of the players like how many zombies he killed, how many hours of game he has, etc. But I need access to this information outside the game, how can I do that?

warped condor
#

player.db and any other depends on what information you need.

ancient grail
#

Right right

#

What im saying is its just related

ancient grail
#

Albion is right tho
You can choose not to make a lua file if youre recipe script is simple enough

warped condor
#

@ancient grail I was answering @onyx basalt question.

ancient grail
#

My bad

bronze yoke
#

you can write a server mod to write these stats to a file if you need information that isn't easy to extract from the database

languid abyss
#

does anyone have the jumpscare mod template, so i can add my own sounds

gentle mountain
#

Hey folks, I'd like to extend a backpack mod so that it's got more than one container-slot that acts as backpack. For example a small ammo pouch to resemble one of the bags on the side of the model, another for medic stuff, etc. Is that possible?

warped condor
#

Hate design, took me forever.

crystal terrace
warped condor
#

the mod is there already, just adding some new content and probably last till b42

hybrid light
#

Hey guys, can someone help me please? I installed a few car mods, and no one is spawning on the map. Even after a chunk cleaner.
And in the logs i founded this :
WARN : General , 1691101731946> 69,696,568> VehicleType.initNormal> vehicle type "Base.91range" doesn't exist
WARN : General , 1691101731946> 69,696,568> VehicleType.initNormal> vehicle type "Base.91range2" doesn't exist
WARN : General , 1691101731946> 69,696,568> VehicleType.initNormal> vehicle type "Base.92nissanGTR" doesn't exist
WARN : General , 1691101731946> 69,696,568> VehicleType.initNormal> vehicle type "Base.ATABMWe36" doesn't exist
WARN : General , 1691101731946> 69,696,568> VehicleType.initNormal> vehicle type "Base.ATAArmyBus" doesn't exist

warped condor
#

The problem with that was when you added new tooltip for option in worldcontextmenu, the rect (black background) is based on your text length and so if the length is less than the value that they put in default, the rect will have default value and that value was making that too long for me, so I needed to change it.

#

I tried to get it without changing the main function but I failed, so I just hooked my to main one.

glossy cosmos
#

anyone know how you're supposed to interact w/ the vinyl player from the True Music mod?

#

there's no option for device options

chrome veldt
crystal terrace
warped condor
#

The mod is on workshop already, I'm working on final update to it rn.

crystal terrace
#

sweet

verbal yew
#

guys, how to improve Event stuff:

function zReRAC_GetRecipes(player)

    local zReRACRecFlag1 = 0;
    local zReRACRecFlag2 = 0;
    
    if    getActivatedMods():contains("Swatpack") or                -- SWAT
        getActivatedMods():contains("KPAP") or                    -- KP ARMOR
        getActivatedMods():contains("Brita_2") or                -- BRITA's ARMOR PACK
        getActivatedMods():contains("Dislaik'sClothingPack")    -- DISLAIK CLOTHING PACK
     then zReRACRecFlag1 = 1; else zReRACRecFlag1 = 0;
    end
    
    if    getActivatedMods():contains("ScrapArmor(new version)")    -- SCRAPS ARMOR
     then zReRACRecFlag2 = 1; else zReRACRecFlag2 = 0;
    end
    
    local playerObj = getSpecificPlayer(player)
    
    if zReRACRecFlag1 = 1 then
        if not playerObj:isRecipeKnown("zReRACRecArmorRepair_Part") then
            playerObj:getKnownRecipes():add("zReRACRecArmorRepair_Part");
        end
    end
    
    if zReRACRecFlag2 = 1 then
        if not playerObj:isRecipeKnown("zReRACRecArmorRepair_SCRAPS") then
            playerObj:getKnownRecipes():add("zReRACRecArmorRepair_SCRAPS");
        end
    end
    
end

Events.OnGameBoot.Add(zReRAC_GetRecipes);
Events.OnCreatePlayer.Add(zReRAC_GetRecipes);
#

It seems to me that I am not using events correctly...
OnGameBoot ~ OnGameStart
OnCreatePlayer ~ OnCreateLivingCharacter

crystal terrace
bronze yoke
#

you should prefer OnCreatePlayer to OnCreateLivingCharacter

#

living character will fire for the main menu character preview

gloomy adder
#

I apologize for bothering you, I saw you have dealt with the transparency problem with clothing before - could you tell me what the problem is, please?

gentle mountain
#

Hey @ancient grail, good to see ya! From a noob to a vet, would my idea be as simple as adding more bags to the backpack, or would I have to dive into Lua?

ancient grail
gentle mountain
#

That sounds like a good way to go about it, and just about what I'd come up with after rolling this idea through my head a bit. I just got no idea how to implement that.

crystal terrace
#

successful addition of my ugly test map along with zeds, trees, water, two custom buildings and a lot of zeds

uneven jay
#

guys im boutta publish my first mod where do i put the preview.png

crystal terrace
#

should be along in same folder where /Contents and workshop.txt is

uneven jay
#

can u send text that i need to put in the workshop file

#

xddddd

crystal terrace
#

you can leave it empty i think, just place the boiler text in there for now. Once you write a nice description through steam itll populate itself.

uneven jay
#

bruh

crystal terrace
#
title=PutNameHere
description=This is an example mod with two worlds.  You can use this as a template for your own map mods.
description=
description=The first world has a single 300x300-tile cell.
description=The second world adds cells all around the first world.
tags=
visibility=public```
crystal terrace
uneven jay
#

it is

crystal terrace
#

well can you show your folder structure

uneven jay
#

so its mods/content/(issertmodname)

#

and stuff

crystal terrace
uneven jay
#

C:\Users\A\Zomboid\Workshop\mods\Contents

crystal terrace
#

it hsould be in same folder as /Contents not inside

uneven jay
#

so in mods?

crystal terrace
#

ignore the extra workshop.txt file

crystal terrace
uneven jay
#

cuz me brain no worky

#

actually can u even send files?

crystal terrace
#

dont send the mod, but you can send screenshot containing different files that way i can look where you placed files.

crystal terrace
uneven jay
#

your supposed to put it all in mods right?

uneven jay
#

but not

#

folders

crystal terrace
#

ye correct

uneven jay
#

so

Mods
Content (folder)
Workshop.txt
preview.png
Contents
Jesterims Vanilla Bag Upgrades
Jesterims Vanilla Bag Upgrades
scripts and shit

crystal terrace
#

wait why its not in workshop?

uneven jay
#

the mods is in workshop

#

arent you supposed to put a folder named mods

crystal terrace
#

so like Users/user/ProjectZomboid/Workshop here?

uneven jay
#

yeah

#

but i put a mods folder

#

some guy told me that i need to put em in a mods folder

crystal terrace
uneven jay
#

ohhhh mods come later

#

im dumb af

crystal terrace
#

mods folder is for testing stuff

#

the one in my screenshot is the one you need to make put your modfolder inside

uneven jay
#

OH YEAH

#

I CAN NOW

#

thank you

#

caps

crystal terrace
#

sweet

uneven jay
#

u can use items in mp right

#

u dont need a server lua or something

#

cuz i tested the items in sp

crystal terrace
#

oh should be alright i think but can't say for sure. Since i thought the same about my mod then i realized it wasnt the same.

#

quick tip, if you plan to release future updates. After you're done formatting your description through steam, copy that and save it somewhere. Because each further update of same mod resets the desc text back to normal and it's frustrating doing it again and again.

uneven jay
#

alr than

#

i think i have a copy in my other folder

#

yeah

#

PZ mods

crystal terrace
#

like this how it would look after you're done formatting otherwise its just plain text which is uncomfortable to read.

uneven jay
#

ah

#

it kinda looks a bit bad but its fine ig right?

#

its my first mod so doesnt matter

#

lol

#

aw

crystal terrace
#

looks cool

uneven jay
#

steam makes the pics res go low

#

i can count the pixels on it

#

actually its 256x256 but

#

uhh

#

anyways

crystal terrace
#

you can add more pictures of using your mod

uneven jay
#

i think i will

#

like those uh long ones

#

rn its not very detailed

crystal terrace
#

ye, you should see add images option on the right side

uneven jay
#

yeah i need to get some first tho

#

how do i even make backpacks look good

crystal terrace
#

or you can put your higher resolution pic there as well

uneven jay
#

i mean is there any good way i can advertise it its basicly the normal vanilla backpacks but with more weight reduction and storage

#

and like 1 item thats not fully vanilla

crystal terrace
#

then your preview will be only shown on right side of your mod page

uneven jay
#

and thats the texture lmao

crystal terrace
#

so your mod improves weight reduction? thats the idea right

uneven jay
#

and storage

#

it adds 2+ on to the stats on small ones

#

4-5 on big bags

crystal terrace
#

well you can do side by side comparision with or without mod and put same kind of stuff in there so people would get good reference. Or maybe different items if you wish to.

uneven jay
#

uhh theres this

#

and a lot of bag recipes

#

i cant add all on screen but theres like 4 recipes for each bag

crystal terrace
#

the basic idea is same for each bag so i think one image comparing the different would be great, others can be about how to upgrade step by step

uneven jay
#

uhh biggest bag btw

#

pretty op

crystal terrace
#

the top image is what will make most users decide whether they care to even read what's mod about.

uneven jay
#

why didnt i think of that

#

ill get working on it

crystal terrace
#

i just took screenshots, dont think therers a cap on it.

uneven jay
#

alr than ill just do a big one

verbal yew
verbal yew
#

if they already has recipe - do nothing

uneven jay
#

do you guys know how i can add a mod that changes an existing vanilla items properities

uneven jay
#

no im making a mod

#

not change it on my side

verbal yew
#

Lord, take this file and put it in your mod in the lua/client folder

uneven jay
#

and then?

verbal yew
#

open and use and following the example, replace the parameters of items with your own

#

but not change Item type

uneven jay
#

im trying to make it so u can use ice packs to cool off and stuff

#

not durability

#

like can i cahnge a peice of the script

#

to make it something else

#

so u can both use it on wounds and use it to cool off

verbal yew
#

And, in general, you donโ€™t need to fix the items (or its parameters)

#

i think u should do recipe for item

#

with ice pack

uneven jay
#

i want it to melt aswell

verbal yew
#

or for HealthMenu - it's should be stuff for context menu

uneven jay
#

so turn it into a food

#

so it can melt

verbal yew
#

If u change item type - it's remove all changed items

crystal terrace
ornate cape
#

guys, how to check working mod or no? i downloaded britas weapon pack but can't find items from this mod, and i don't know work it or no

#

please help

ornate cape
#

and mod options

verbal yew
#

activate both arsenal or only one?

ornate cape
#

britas, arsenal, and mod options

verbal yew
#

new arsenal or legacy?

ornate cape
#

latest version

verbal yew
ornate cape
#

i will check it

sour island
#
    @LuaMethod(
        name = "getOrCreateGridSquare"
    )
    public IsoGridSquare getOrCreateGridSquare(double var1, double var3, double var5) {
        IsoGridSquare var7;
        if (GameServer.bServer) {
            var7 = ServerMap.instance.getGridSquare((int)var1, (int)var3, (int)var5);
            if (var7 == null) {
                var7 = IsoGridSquare.getNew(this, (SliceY)null, (int)var1, (int)var3, (int)var5);
                ServerMap.instance.setGridSquare((int)var1, (int)var3, (int)var5, var7);
                this.ConnectNewSquare(var7, true);
            }

            return var7;
        } else {
            var7 = this.getGridSquare((int)var1, (int)var3, (int)var5);
            if (var7 == null) {
                var7 = IsoGridSquare.getNew(this, (SliceY)null, (int)var1, (int)var3, (int)var5);
                this.ConnectNewSquare(var7, true);
            }

            return var7;
        }
    }

Anyone know if using this can properly handle modifying/spawning stuff on unloaded squares?

#

This is a method for IsoCell and seems to 'work' at retrieving a gridSquare - just curious what it's doing with a square outside of it's constraints

#

Hoping to avoid implementing a farSpawner system again - should have released that API a while back

#

I recall you made something similar recently? @abstract raptor

#

I don't see it listed on your workshop

uneven jay
#

yall know how i can make someone cool down and warm up with recipes im making a mod where u can warm up and cooldown

sour island
#

Like the warm up mod?

abstract raptor
#

Lemme dig through my files -- I made a Tile Converter that deletes tiles and spawns an item

#

(or corpse)

#

(or anything)

#

(Even cars)

sour island
#

I was just curious if that was released

uneven jay
#

and ice packets

#

same idea diffirent execution

sour island
#

Ah, saw that and didn't register

uneven jay
sour island
#

Check how that mod does it?

uneven jay
#

uh sure

uneven jay
#

tho

#

it uses animtion

#

not recipes

#

for mine im a beginner

#

u right click on blanket use warm up

#

u right click on ice pack

#

u cool down

cobalt fiber
#

Thanks everyone that helped! especially @bronze yoke with the IntelliJ/EmmyLua help (that was a lifesaver!)

uneven jay
#

oh wait i think there was a diffirent variation of this that i wanted to find

#

nice

#

i can just unlock the gates

#

props to this man

#

5 stars

#

me like it

cobalt fiber
#

Thanks bud!

#

I've put a lot of work on this

uneven jay
#

yes men

cobalt fiber
#

@crystal terrace You maybe wanna take a look on this ๐Ÿ˜‰

uneven jay
crystal terrace
uneven jay
#

alpha

#

u know

#

how to

#

controll temp

#

im trying to make a mod where u can cool down and warm up

#

with blankets

#

and ice packets

crystal terrace
#

temp is a complex mechanism wrt to player, there's a lot of variables tied to it. I tried tweaking some stuff but was unsuccessful.

crystal terrace
uneven jay
#

what the hell is that

crystal terrace
#

i think this has to do with player body temps, i tried tweaking temps but it would go back to a certain value prolly due to this class. It decides what will be the temp for player i think based on a lot of stuff.

uneven jay
#

me is scared

crystal terrace
#

id like to work on this one prolly later down the road, would require some more understanding of temp mechanism.

uneven jay
#

can u just do -body temp = 50 or smth

#

lel

crystal terrace
#

you can, itll change for a unit of time and go back to normal again.

uneven jay
#

uhhh

uneven jay
#

its supposed to go back

#

not set it to a value for a certain time

#

i want it go down by like 20 or something

#

or go up by 20

#

what do i add to the script for that

crystal terrace
#

i dont think itll be useful for what you trying to achieve, but the general idea should be you would need to trigger lua function in your script for something like onConsume or whatever it's called. That would trigger a function say reduceTemp. Now that function would be responsible for temp stuff if you can manage to tweak it for a bit of duration. This is just an idea, personally havent done something like this.

uneven jay
#

yeah ik that but what would be the actual function

#

also its a recipe

#

u right click and it shows up y'know

crystal terrace
#

ye meant to say recipe, mb

#

trying digging through vanilla food items, see if there's any recipe that has something like onconsume or similar method

uneven jay
#

there is no warm up or cool down of foods

#

thats the thing

crystal terrace
#

that i understand, im suggesting if there's something like onconsume....function then you can use that to call your temp stuff when the item is consumed

cobalt fiber
uneven jay
cobalt fiber
uneven jay
#

hella

#

i just got into it

cobalt fiber
#

anyway, I appreciate it!

uneven jay
#

even items are kinda hard

cobalt fiber
#

miss a colon and you're screwed

uneven jay
#

lol

#

also models

#

textures and icons arent that hard

#

(my opinion)

bronze yoke
# verbal yew how about GameBoot or start?

different purposes - ongameboot fires on the main menu when the menu has finished loading, ongamestart fires at the very start of a game that's just been started/loaded (after Click to start)

cobalt fiber
#

didn't try out models yet! (probably will in the future)

uneven jay
#

still

#

its a bit hard to get into in the first place

uneven jay
#

yall wanna check out my first mod? it doesnt look very pretty but uh

#

it works

#

so ill post it

#

also steam makes the preview so low res

cobalt fiber
uneven jay
#

yeah cuz pz has some very simple graphics u can copy over to your models

uneven jay
#

thank u

cobalt fiber
#

I'll try to do some models for the items of my mod

#

It's currently using existing ones :/

uneven jay
#

yeah same with mine

tepid flume
#

ERROR: module "Base" imports itself... should i not do that in my item script?

bronze yoke
#

if your module is base it doesn't need to import base

#

it's already base

tepid flume
#

what does base mean

#

ok i shouldnt

crystal terrace
crystal terrace
bronze yoke
#

it just adds more stuff, but you shouldn't really do that anyway

#

the whole point of modules is to keep mods isolated from each other so they don't conflict

crystal terrace
#

yep seems like a bad move.

tawdry solar
uneven jay
#

u cannot blame me for it

#

thats my first mod

#

idk what to use

tawdry solar
#

nah im not making fun of you

#

i was just asking

uneven jay
#

yes it is

tawdry solar
#

i knew it

uneven jay
tawdry solar
#

ive used that so much

uneven jay
tepid flume
#

my weapon model wont show

#

i hang it up in my back and it does around 15 errors

#

drop it and the world entities disappear in a radius

#

and when i equip it the game freezes

uneven jay
#

did you do a special model for it

#

module Base
{
item Weapon
{
DisplayCategory = Melee,
Weight = 0.5,
Type = Normal,
DisplayName = Melee,
Icon = Weapon,
WorldStaticModel = Weapon,
}

model Weapon
{
    mesh = WorldItems/Clothing/Weapon,
    texture = clothes/bag/Weapon,
    scale = 0.4,
}    

}

#

that should be somewhat

#

working

#

for you

#

if you tweak it

#

prob btw

tepid flume
#

i had the model data in a separate text file

uneven jay
#

try to have it in the same file maybe just incase

#

wait could u send the txt file that contains the model and the weapon?

#

@tepid flume

tepid flume
uneven jay
#

send txt

#

pastebin is banned in my country

#

they put government shit in there

#

they banned it

thorn elk
#

Hello.

I'm currently working on a mod called CompanionAI (taking inspiration from Superb Survivors). I'm using the PipeWrench API along with some custom code to create a companion system. The mod is intended to add a survivor companion that helps the player during the apocalypse.

However, I'm facing an issue with the companion not actually moving in the game, even though it reaches its destination. I've implemented the movement logic using the CT_AIController class to control the companion's behavior.

Any help would be greatly appreciated.

bronze yoke
#

you might have more luck asking in the sledgehammer discord

#

nobody really uses pipewrench afaik

thorn elk
#

Ok, thanks, I'll try that, @bronze yoke.

bright fog
#

So I'm currently looking into a mod's file to see where an item added by it spawns. I found the item in question and the lines defining it but not where it spawns, where could I find this information ? How is it handled in PZ modding ?

bronze yoke
#

there should be a lua file, usually in lua/server/

bright fog
#

ma man doesn't look too organised lol

#

I'll check those thx

bronze yoke
#

generic file names are very bad

#

unless it's in a subfolder

bright fog
#

Found it thx

#

So the folders are important (media/lua etc), but the files in it I would guess are just automatically ran at start up or what ?

#

How does it work ?

bronze yoke
#

yeah, the lua runs at start up

#

on a client the server folder is delayed until you actually get into a game (and is not server-only drunk)

bright fog
#

Yeah I guessed it

#

Alright, now I know I was unlucky for not finding that fucking magazine lol

hollow pine
#

Anyone know the mod that gives you gun racks to place your guns on like an armory?

vivid imp
#

Hi, does anyone know if there is a lua trigger that runs when text inside a notebook is changed?

crystal terrace
mellow frigate
thorny girder
#

Yo, hi guys, I need help with my mod, made for car repairs. What I found out is that not in all mod cars, the glove box is registered as a container, in the car config itself, in fact, how to add a glove box to them, as a container that can be dismantled like, say, a hood or doors. In standard cars, everything is fine, it is registered as an object and you can remove it accordingly. Even in some mod cars, where the glove box is registered as a separate container, you can remove it. Examples of mods where it doesn't work:
'67 Cadillac Gage Commando
'69 Chevrolet Camaro
'70 Dodge Challenger

if anyone can help that would be nice

https://steamcommunity.com/sharedfiles/filedetails/?id=3006454396

#

For example, let's take one mod car, and one default car

template = TrunkDoor,
template = Trunk/part/TruckBed,
template = Seat/part/SeatFrontLeft,
template = Seat/part/SeatFrontRight,
template = GloveBox,
template = GasTank,

fast galleon
thorny girder
#

The essence of repairing the glove compartment, its removal and subsequent repair, then reinstalling it on the car

fast galleon
#

so you uninstall it and then check it's type, is it different type?

#

If you want to add a glovebox because they didn't then it's best to contact the author.

thorny girder
#

Author of these mod cars I suppose ?

#

This is how it turned out in default cars
and like in mod cars

fast galleon
thorny girder
#

That's exactly what this is about, I suppose this is due to the fact that it is not registered somehow separately in the car config.
Because in another mod machine, alas, I donโ€™t remember which one, the glove box was registered, and dismantling worked there

vivid imp
# mellow frigate ISUIWriteJournal:onClick(button) when button.internal == 'OK'

Thank you @mellow frigate I learned something new today.
For future readers, this is an excerpt of what I had to do to override the onClick method of ISUIWriteJournal:

require 'ISUI/ISUIWriteJournal'
local original_ISUIOnClick = ISUIWriteJournal.onClick;

function ISUIWriteJournal:onClick(button)
    original_ISUIOnClick(self, button)

    if button.internal == "OK" then
        print("CLICKED!")
    end
end

I hope it helps

fast galleon
thorny girder
fast galleon
#

you could add a fixing script if he doesn't want it uninstalled and add repairMechanic = true,

thorny girder
modern hamlet
#

Hello, I'm trying to make a mod that changes the RunSpeedModifier and CombatSpeedModifier of the clothes, but when I exit the game and log in, the values I changed return to their original state. Is there a way to fix this?

mellow frigate
modern hamlet
#

I see, so i need to add a moddata to item and check it. Thank you.

gilded hawk
slow graniteBOT
#
worstweedman has been warned

Reason: Bad word usage

gilded hawk
#

What is the simplest way to hide an item in the ISInventoryPage? There must be a simple way no?

gilded hawk
#

I will, thank you.

gilded hawk
# tame mulch Try set name of item to ""

Is there a way to force the tooltip of a button to appear without actually hovering it?

I would like to make it so that when I'm dragging an item, it shows the button tooltip by the side of the button.

Test example in the photo

tame mulch
gilded hawk
#

Alright thank you.

gilded hawk
#

So, I just did something

#

The size auto adapts to the biggest container name

#

And now I also want to make it so you can manually resize the buttons bar

#

Now I Just need to find a way to render a background under the text of button, but above the texture

gilded hawk
#

In the mean time, the custom names are working! ๐ŸŽ‰

modern hamlet
#

Is it possible to add new lines and colors to item's tooltip?
This didn't work.

item:setTooltip(" <RGB:0,1,0> " .. "Something Amazing" .. " <LINE> ")
cosmic moon
#

Anyone know if there's a way to cancel an attack animation mid swing?

cobalt fiber
cobalt fiber
covert carbon
#

Does anybody have a number on how many non-canned food exists?

lethal phoenix
#

Hi everyone! This is my first time developing a mod for PZ. I decided to allow for disinfecting wounds using soap and water. Looking at the vanilla code, the only requirement to disinfect wounds is for the item to have an AlcoholPower property > 0. However, I would like to have the player also use a source of water along with the soap. Is it okay to have a script overriding the vanilla medical system check or can anyone suggest a workaround? For example, I don't know if it is possible to alter the soap's AlcoholPower dynamically if water is detected nearby.

drifting ore
#

can someone make a craftable barbed wire fence mod

iron trellis
#

Hello!
I've been wanting to make a mod that changes the zombie sounds, but I have no idea on how to do it.
I tried looking through other mod's files, but I have no idea how to work with the .bank files. Any help, please?

gilded hawk
#

New UI in test development ;D

#

How can I get the texture/sprite of a tile? ๐Ÿค”
Like, I want to try and put it in place of the existing icon

#

I was not expecting this to actually be as pretty as it's coming ๐Ÿ˜…

vivid imp
#

You're doing a good job man, can't wait to try it when it's finished.

gilded hawk
#

Oh, this is intersting.

I can use the sprite as an icon ๐Ÿค”

neon bronze
#

Can you rename the floor?

gilded hawk
neon bronze
#

The label for the container

#

Is it not the same container everywhere?

gilded hawk
#

Well, at the moment I did not look into it, but yes, should be possible to rename the floor. Why would you do that though?

neon bronze
#

Why not?

gilded hawk
#

Fair lol

#

I'm still a bit surprised how much I went from hating making UIs in lua, to being fairly confident with what I'm doing. But I still prefer working with React and css ๐Ÿคฃ

#

i'm thinking about the ability to change the icons per specific container. I think it would be very cool ngl

neon bronze
#

You could maybe make it so that one could change icons for containers?

gilded hawk
#

Yep

neon bronze
#

I dont know if you can get all the containers through the scriptmanager

#

But if you could then you could make a list with their respective icons like in the tilepicker panel

gilded hawk
#

I want to do better, like, if you have 3 container with 3 different ammo types inside. You can set the container to the have same icon as the ammo type.
Imagine having a specific box for 5.56 ammo, and both the name of the container and the icon will convey that information

neon bronze
#

I was thinking more along the way of mod compatibility with modded in containers

gilded hawk
#

That should be fairly easily, most of my code is written in a way to not be in the way of vanilla and modded code

#

Also, this work ๐ŸŽ‰

neon bronze
#

Does it save through reloads?

gilded hawk
#

Yep

#

I'm building this feature to be MP proof

neon bronze
#

Do you save tje name to its moddata or does it keep after you renamed it?

gilded hawk
#

I put the custom name in the moddata

#

And then I replace it on the UI

neon bronze
#

You probably overwritten halve the inventory ui lol

gilded hawk
neon bronze
#

Can you also change the name of your backpacks that you wear through it?

gilded hawk
neon bronze
#

Sure

gilded hawk
#

It's just ~100 of code

storm pecan
gilded hawk
#

Finally Done!

I have disabled for now the sprite as icon, but for a first version this is GOOOOOOOD

vivid imp
#

Nice work! Now to add more realism you could make that you need a sheet of paper (which will be removed from inventory), some duct tape and something to write on to add the descriptions. ๐Ÿ˜‰

gilded hawk
#

Thank you, but I won't implement that.

This is part of my casualoid mod, and adding realism is out of scope. This project aims to make the game simpler and more intuitive for the average casual player

vivid imp
#

That's fine I understand

sleek forum
#

Does anyone know how to give a grid square or an object a different color? I've seen some color properties but not sure which one I should look at. I'd like to know if I can change the color of a floor tile for example

#

as if to highlight something

gilded hawk
short zinc
#

my item does not show up in the debug menu ingame any idea what could have gone wrong?

gilded hawk
#

Is your script.txt file correct?

#

have you checked the console logs?

short zinc
#

im new to modding first time

gilded hawk
#

The script.txt file has to follow a very spefic format, otherwise it won't be loaded by the game

#

Share the file here

short zinc
#

is that the file you meant?

gilded hawk
#

Yeah

short zinc
#

its just that one thing
my crafting stuff works so its not the mod i asme that file is wrong

gilded hawk
#

Found the erro