#mod_development
1 messages ยท Page 187 of 1
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.
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

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
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
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
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.
where do lineX, lineY come from?
local lineY = tooltipPaddingTop;
for i = 1, #tooltipTextTable do
local lineX = tooltipPaddingLeft;
...
lineY = lineY + lineSpacing
...
end
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
I mean the bounding works for the tooltip background, not for text you draw after.
the background seemed like it was going too far too, just not as much
Yeah but it stops in some point.
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?
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.
yeah, all this redundancy concerns me that something isn't the same and it's just difficult to spot
I have the same feeling now when remaking the main menu buttons ๐
afterwards, think of a way to call oldRender (maybe like eris_food_expiry mod) or you'll have a very low mod compatibility.
when calculating the position longestLeftTextWidth is used, but during rendering longestTextWidth
what's the difference? is that intended?
how much experience did you have? didnt work
I'd say I'm pretty new to this stuff.
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.
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.
how come there arent front right and front left windows in the vehicle mechanics, even though it should be there???
https://steamcommunity.com/sharedfiles/filedetails/?id=3006109377 this should get your started for the most part, if you still have questions then feel free to ask around here.
i would recomend looking at the code of similar mods or the scripts of the game itself than analyze it
after that watch a bit of tutos ask a bit of questions and you should be set
or atleast thats what i did
this line breaks singleplayer, works fine on MP.
I have this line and it doesn't break anything
In sp both isClient() and isServer() are false
i had to put this snippet inside if getWorld():getGameMode()==Mulitplayer block
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.
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
game mode is only accurate after OnInitWorld Event
#mod_development message isClient and isServer return table
OnInitWorld triggers only once in-game tho after a new world is started?
no and no
It is when loading a save new or old.
am i good to rely on it to find game mode tho?
There's a parameter check in initworld for newworlds though
You're better off using not isClient()/isServer() tbh
i initially was but this becomes true for SP and just returns
That should return false in SP
is it in client folder? if so just remove it.
I can't answer that since I don't know what you're doing.
not isClient() results into true atleast for me.
just transfering items from one container to other
Doesn't isClient/isServer return if the game getCore() is bClient or bServer?
he uses not isClient() in client folder, and he needs that for both client and SP?
@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
alr
Afaik, the issue stems from how the old MP code ran
So the terms are all the same, but they're unrelated now
it does, because servers don't load the client folder
this is where im using this snippet to call transfer goods function which transfers items for reference
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
he's using not isClient()... not false equals true

Oh derp
๐
I just woke up lol
does that mean im good to go with gamemode thingy? seems to work out for now unless im missing a big picture.
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
while this code is in client folder, it's safe to remove that check.
so itll be something like if isClient()....then if not isClient() then return?
do you want something different to happen for SP and client?
not really same stuff both modes
if false then return end or just remove the check
ah i think i understand what you mean, let me try removing the check.
Wait why have the check at all then?
i orginally was working with MP, was very confused with this client and server stuff
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
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.
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
Not your fault lol, it can be a doozy - especially with the terms
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
thats a gold mine right there, thank you for sharing.
OnClientCommand only fires in /server/
- so I have to double check that everytime
lol you're not the only one
@sour island @fast galleon Thank you, my 7 holy subscribers send their gratitude
You just gave me a powerful idea. Time based objectives, if you fail your save will be corrupted.
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?
Def you can code that if you have something in inventory your player heat is changing and it requires lua.
I didn't do anything with making new heat source object yet. so can't really tell.
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?
https://youtu.be/_rAPaAdtliw pz is so great for story telling
parkour mod ๐ฎ
movement is insanely limited in vanilla - glad tchern and others have added some much needed depth
everything looks perfect, modders are doing great work.
all possible cause of the nifty animation system
is that something introduced in newer pz builds?
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
ah that's nice, B42 would give us more tools to play with.
i think i heard a discussion about that in #pz_b42_chat way back.
There is also a bunch of writing and considering the rate of scenes changes, they must have spent a crazy amount of time on the video post-prod. I'm also opbiously very happy with the showcase.
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.
Already looks so cool! Excited to see more progress updates, really impressive stuff.
yall know why my item has black and red texture along with why the icon wont load on it
Anyone run into a way to tell if a player is backpedaling?
do you have a ? inplace of icon? Got the naming, location and the way you call it correclty?
isnt it supposed to be in textures
textures yes, icon file name should also have prefix item_ and when you call those file in script don't use this prefix
yes
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
how do i fix the texture
bt
w
not sure what you mean by that, can you post a screenshot or something?
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
heres the thing btw
not sure what could be wrong here, your texture is not red and white squares i assume?
wait i got a question
is static model only for clothes
and where can i find them
cuz idk if thats the right static model for guncase
static model is for when character holds stuff in hand from what ik
worldstatic is for stuff thats placed in world, i think static models are designed different. Thats a question for #modeling prolly.
do i just texture_Upgrade_Kit.png?
are you familiar with uv maps? all 3d models have UV maps based on that you design textures.
?
not really
so the model you have is it yours or an ingame one?
okay and you applied YOUR texture to it?
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
you will need to do model script btw for applying textures to these models after you design textures.
okay so i see your item definition... where is your MODEL definition?
hm ok
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.
i have the texture for the gun case
so basicly
i need to rename the texture get the model with that
and put it in models_X?
the texture goes in textures
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
it didnt load its model_items right
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.
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
Anybody know if it's possible to send a command from a client to another?
you can put a condition in there if you're targeting a particular client?
clientA->server->clientB
well im no coding genius neither do i know it very well but maybe try replicating the command and sending the result trough the other client?
but you'd need something to identify, im sure there would be something to differentiate.
I got a bit more confused between how client and servers work ever since I found out the folders are useless and stuff lol
Not particularly useless
what clients you are targeting btw? is there something specific?
Its just that your client is also your server
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
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
small question is the plastic lunchbox model the same model as gun case?
nop
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
alr than
steamapps\common\ProjectZomboid\media\scripts\models_items.txt
Alternatively i would look how trading in mp does it
cant i just take the model from the game or do i have to put a replica in my mod folder
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.
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.
you have to ping off the server like alphabee says
we can't directly communicate between clients
probably for the best really
@faint jewel its kindy a bit unpolished but it works so thank you
๐
wait do i need perm from the devs or something? or cna i just use thier assets xd
i was bored so i was reading this stuff
no. you are't using their assets
ah ok
ah yeah i can
actually does that count
i mean i am kind of editing thier models textures
im overthinking xd
prolly
i got a question should i have it like this or mash all of them together
like does it make it harder on other poeples pc like rendering more scripts or just does nothing
i think its safe to mash em together
ye its safe but is it required or is it better?
cuz i wanna stay organized but still be in the green zone
you can put them all in one file, i RECCOMMEND the items and model be in theri own files.
prolly better to have all relevant stuff together
I mean you can just always check if player exists.
and return if not on both sides. (About communication issues)
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 ?
Behold (ty tcher for the gif poster trick) https://steamcommunity.com/sharedfiles/filedetails/?id=3013923320
Is there any mod that makes zombies get through walls by stacking up on it?
good idea
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
I made a guide for my favorite way to use an animated thumbnail in Steam Workshop for Project Zomboid. https://steamcommunity.com/sharedfiles/filedetails/?id=3013991606
Can confirm the software is legit, I use it as well.
Is there any way I can prevent players from selecting any traits on the character creation Menu?
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.
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
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.
damn
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
thanks
You can see every available translation module in lua/shared/Translate/EN
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?
maybe have it rebind the key automatically during the OnDisconnect or OnGameStart events
can't make it work :/
Iโve never tried anything involving rebinding keys so I donโt know how else to help you there
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.
Maybe the stored default is reset when the game restarts
MainOptions.saveKeys()
if it does not work as you expect, make your own function that does the same. see 'keys.ini' uses under MainOptions.lua
Thanks, i'll try
by the way, is your crawling soldier still raising its leg ? I'm interested in the solution you'll apply
The solution was to cut his leg off, no need to animate it. (joke)
This is trick, i've made an simple transition animation between the poses and kind fixed it. But, if i keep spaming and pressing the keys while in transition then cancels it making the glitch appears
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
looks like a pain in the a...nimation
Indeed it is. I've spent a lot of time in this.
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
wym? mods not active ? you cant see your files?
anyone here tried interacting with player body temp before? the amount of variables that goes into temp, is it even possible?
i don't see it in the mod list, its active
in the mod list in the lua debugger
dont remember seeing a mod list in debugger, mostly just looked at files and variables.
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?
nvm i figured it out
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
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!
There is a Sandbox option under Character named "Melee Movement Disruption". Make sure that is disabled, and your character should be able to walk and attack.
even with that enabled you should be able to move
btw u did misstake by using table.remove while iterating same table with ipairs
that's.. not my mistake. That's the basegame code
cos with table.remove I'll skip a few key, value pairs
But is that why at the end of my table, some of my values were nil?
wdym?
but frankly, that code only removes a single item at a time, so...
Right, I have managed to get some progress... One sec
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?
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 
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
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
doing i=i-1?
I remember that with shrinking lists, you should iterate from the back
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
This works but only if you can iterate over the list:
Let me try
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?
Actually, I'm dealing with a lua table here
The array approach fails completely for some reason
Let me show you
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
I'm working with Zomboid's UI
Trying to work around an edge case the devs didn't think about
Which is?
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
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
Yeah, would be a good case to do so unfortunately lol
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
Frankly I need to report this to the forum but I think I have a bad track record with one bad report and zero good ones
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
Right... And I've made mods to fix singular issues
Yeah lol, my goal is to have a place people can dump those into
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
Fixable back holes is exactly that
and my most popular mod too
over 10k subscribers, oh wow
Well if you ever want to add it on, you'd be very welcome to
I'll see if I have time
I wish there was a way to add contributors automatically
I have my own holes to fix
The github repo is set to upload automatically to the workshop on a schedule
So it's unmanned
Working with albion on StatsApi too... since I kinda needed it
Have you tried recalling CharacterCreationProfession:populateTraitList(list) after?
lads do i need to give an oncreate to every recipe?
Nvm this doesn't wipe the list
It also ignores mutually exclusive traits
So it would only make my problem worse
to use table.remove correctly with sequence table need to go for i = #tbl, 1, -1 do instead for i = 1, #tbl do
---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?
Yeah, did that right after ๐
Going to add this to the patch if it works
something similar
I don't have your mod to test with unfortunately lol
Insatead iterating over all traits and seeing if they're not multiplayer compliant
I was getting an NRE in a standard library
The mod causing the issue is Udderly Knocked Out
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
I scuffed the require - although I doubt that's the issue
...It's pointing at the exact line
there's no space
cough
or wasn't when I first posted it
Wait, don't you need to pass in the "self" parameter first when calling an original?
Okay, attempt 2
that's probably the issue lol
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
can you guys answer this by any chance?
oncreate is the additional lua function - so no
ah
you could check for cost just to keep it inline with vanilla
---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
Okay. So far, the patch doesn't break it completely, so progress
Let me go die real quck
Dying successful
And holy shit, your patch worked!
๐
I've been working on this for like 6 hours
You're free to use a copy if you don't want to add a requirement mod
Went so bad I scuffed dinner
Thank you
I'm sure Eve wouldn't mind but copying is faster...
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
?
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```
that check is for adding them on
Excuse my napkin boolean math
If isRemoveMP and not MP then = good, or not isRemoveMP = Good
It's actually a redundant way to check lol
So to remove, we just need to check if it's MP and the trait is removed in Mp
yes
if exclusiveTrait:isRemoveInMP() and isClient() then
But you're saying your traits are getting removed?
no worries
I guess mycollege education is finally paying off
After years, one thing I remember
I just need your acc name, I'll add you as a contributor
Diakon5
aw I scuffed it, forgot to make it a PR, but added you as a contributor lol
Nah
the action isn't setup quite right though - So Ill have to figure that out
Fires on PR publish instead of merge :x
Oh no
Well, I have no knowledge of CICD systems, as I have only did a presentation about them
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
how do you make recipes?
arent you supposed to put it in scripts
im guessing it should look somewhat look like this?
Hey all, does anyone know how to edit the already existing moodles for the game or is that not possible at the moment?
Just SP. My own personal mod as it were.
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\zombie\characters\Moodles
all of it should be there
Ah, okay then. Sooo...no coding or anything like that?
u just need to look around for your moodles that u wish to change
btw what drive is pz installed in
than it might be d or idk
rn thats for c
It's identical to what you typed.
alr
Sick. Thank you for the info!
you still need to install something that supports java from what i know
i recomend getting a java extension for visual studio code
Oh, okay then. I'll see to that later. Thank you!
if you need it i can edit it
i already have the java extension installed
Nah, I think I'm good. I'll definitely ask for help if I'm having trouble with it though!
alright than
Thank you for the offer though!
no problem mate
Is there a mod to fix it so you don't have to have water barrels in extremely specific places? Like a pipe system?
AFAIK that mod only connects rain barrels. It doesnโt let you pipe a barrel from a different spot to a sink
yeah, still the closest of what you're looking for, afaik.
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?
first this is for #mod_support
second it might be because that it is incompatable with some other mods
third you need to put it both in mods and workshop so a mistake might have happened there
There's just this 2 mods activated, and TchernoLib is required for my mod to work. And I've found that not only my mod is not working in MP but all mods that uses TchernoLib is not loading properly here. There's no mistake in the mod setup, others loaded fine. Now i'll try to find out if is my game problem or something else.
@dark wedge Thanks for the reply. I gave it a shot but unfortunately didn't help.
@bronze yoke thanks for confirming that the methods should be working. That lead me to test the mod on my keyboard and it works just fine, suggesting the problem is my joypad setup. I have a few things I can try after work โ๏ธ
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!
Is it possible to change level 8 tailoring for repairing holes in clothes? I couldn't find the lua side for that.
lmao this idea made me remember of fallen angels from rec film series
imagine in zomboid where you'll only be able to see/touch some stuff and demons when there's no light
anyone familiar with this thing?
yeah, look for canFullyRestore and addPatch calls to clothing from lua and replace them with your own version
it's the class responsible for spawning items in containers when loading squares
don't really know what the name refers to, maybe it replaced a slower system
ah i got excited, thought maybe ill have the power to load squares๐
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.
I would start with scripting
Adding items, recipes such stuff will help you with how modding in pz works and interacts with different items
*and editing
Many thanks
You want to replace the model?

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
Yep, like these "Pear Body Shape" (or something like that) mods I found on the workshop, but instead of changing the body, I only want to edit the head
you do not need an oncreate for every recipe
only recipes that need special functionality need one
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?
player.db and any other depends on what information you need.
Yeah and bunch of other connections to that but i dont want to map the whole thing lol
It was just to give idea
Albion is right tho
You can choose not to make a lua file if youre recipe script is simple enough
@ancient grail I was answering @onyx basalt question.
My bad
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
does anyone have the jumpscare mod template, so i can add my own sounds
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?
Hate design, took me forever.
mod with ui to check wall health?
the mod is there already, just adding some new content and probably last till b42
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
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.
anyone know how you're supposed to interact w/ the vinyl player from the True Music mod?
there's no option for device options
Thank you so much! I canโt wait to get a solid V1
i think i understand what's going on here, apart from the last bit about hooking it into your main function. Looks great btw, assuming you're managing this mod now? or just doing it for yourself?
The mod is on workshop already, I'm working on final update to it rn.
sweet
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
Do you need to trigger both events? Also dont need to pass player to function call
you should prefer OnCreatePlayer to OnCreateLivingCharacter
living character will fire for the main menu character preview
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?
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?
I actually wanted to implement this for a mod. I dont think it can be done without doing something abot hacky
Maybe as the player equip that inventorycontainer we spawn another bag that doesnt have sprite and doesnt show up on the inventory and auto magically equip it (and remove/delete it when player unequips the first item)
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.
successful addition of my ugly test map along with zeds, trees, water, two custom buildings and a lot of zeds
guys im boutta publish my first mod where do i put the preview.png
should be along in same folder where /Contents and workshop.txt is
uh
can u send text that i need to put in the workshop file
xddddd
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.
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```
it should be 256x256 yes
it is
well can you show your folder structure
u awnt me to just send the whole thing?
so its mods/content/(issertmodname)
and stuff
nope, open the folder where your preview.png is. Take a screenshot which also has its path name.
its in contents
C:\Users\A\Zomboid\Workshop\mods\Contents
it hsould be in same folder as /Contents not inside
ignore the extra workshop.txt file
all of this would be inside Users/User/ProjectZomboid/Workshop/ModNameHere/
wait can i send the mod thru dms and u take a look at it?
cuz me brain no worky
actually can u even send files?
dont send the mod, but you can send screenshot containing different files that way i can look where you placed files.
yes you can
your supposed to put it all in mods right?
ye correct
so
Mods
Content (folder)
Workshop.txt
preview.png
Contents
Jesterims Vanilla Bag Upgrades
Jesterims Vanilla Bag Upgrades
scripts and shit
wait why its not in workshop?
so like Users/user/ProjectZomboid/Workshop here?
yeah
but i put a mods folder
some guy told me that i need to put em in a mods folder
mods folder is for testing stuff
the one in my screenshot is the one you need to make put your modfolder inside
sweet
u can use items in mp right
u dont need a server lua or something
cuz i tested the items in sp
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.
no i mean like after you format stuff, headings/lists etc etc on steam description mod description page. If you plan to format.
like this how it would look after you're done formatting otherwise its just plain text which is uncomfortable to read.
ah
it kinda looks a bit bad but its fine ig right?
its my first mod so doesnt matter
lol
aw
looks cool
steam makes the pics res go low
i can count the pixels on it
actually its 256x256 but
uhh
anyways
you can add more pictures of using your mod
ye, you should see add images option on the right side
or you can put your higher resolution pic there as well
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
then your preview will be only shown on right side of your mod page
and thats the texture lmao
yeah ik
so your mod improves weight reduction? thats the idea right
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.
uhh theres this
and a lot of bag recipes
i cant add all on screen but theres like 4 recipes for each bag
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
oh yeah
the top image is what will make most users decide whether they care to even read what's mod about.
wait how big is
the thumbnail
i just took screenshots, dont think therers a cap on it.
alr than ill just do a big one
how about GameBoot or start?
i think yep, not sure, but i want add recipe for old and new player
if they already has recipe - do nothing
do you guys know how i can add a mod that changes an existing vanilla items properities
client side lua
Lord, take this file and put it in your mod in the lua/client folder
and then?
open and use and following the example, replace the parameters of items with your own
but not change Item type
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
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
i want it to melt aswell
or for HealthMenu - it's should be stuff for context menu
I guess it's a bad idea
If u change item type - it's remove all changed items
Game boot happens when you're loading the game, like when mods and stuff loads. Game start is after loading the save I believe. Choose what you require, I might not be much help here.
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
with ARSENAL GUNFIGHTER 2.0?
activate both arsenal or only one?
i activated all 3 mods
britas, arsenal, and mod options
new arsenal or legacy?
@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
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
Like the warm up mod?
What exactly you need>
Lemme dig through my files -- I made a Tile Converter that deletes tiles and spawns an item
(or corpse)
(or anything)
(Even cars)
I was just curious if that was released
no u use blankets
and ice packets
same idea diffirent execution
Ah, saw that and didn't register
so uhh can u tell me?
Check how that mod does it?
uh sure
i think its diffirent
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
Hi people!
My mod is finally out!
https://steamcommunity.com/sharedfiles/filedetails/?id=3014820613
Thanks everyone that helped! especially @bronze yoke with the IntelliJ/EmmyLua help (that was a lifesaver!)
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
yes men
@crystal terrace You maybe wanna take a look on this ๐
rating should go thru soon
looks great, i gave on the idea after realizing i was limited to player built double doors only without making something same as automatic doors. Yours look way better anyway, nice work.
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
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.
aw
declaration: package: zombie.characters.BodyDamage, class: Thermoregulator
what the hell is that
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.
me is scared
id like to work on this one prolly later down the road, would require some more understanding of temp mechanism.
you can, itll change for a unit of time and go back to normal again.
uhhh
yeah thats the thing
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
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.
yeah ik that but what would be the actual function
also its a recipe
u right click and it shows up y'know
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
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
for real, thank you! 

Yeah, making mods for Zomboid can be rough 
anyway, I appreciate it!
even items are kinda hard
Yeah, lots of syntax and stuff
miss a colon and you're screwed

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)
didn't try out models yet! (probably will in the future)
yeah blender is good and its easy to do since the games graphics are questionable so you dont have to try too hard for it to fit in but
still
its a bit hard to get into in the first place
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
saw some guides about it, seems very straightforward, but definitely need skill
yeah cuz pz has some very simple graphics u can copy over to your models
Good work bud! Looks cool!
thank u
I'll try to do some models for the items of my mod
It's currently using existing ones :/
yeah same with mine
ERROR: module "Base" imports itself... should i not do that in my item script?
Base refers to vanilla Module, just like you have your scripts inside your module. Vanilla stuff is inside Base module.
wouldnt that cause problems? or it just adds more stuff to base module?
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
yep seems like a bad move.
is that the beornheard font on pixlr
look im not good at this stuff
u cannot blame me for it
thats my first mod
idk what to use
yes it is
i knew it

ive used that so much
lol
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
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
i had the model data in a separate text file
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
https://pastebin.com/5rpVNKep new attempt
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
old attempt https://pastebin.com/D0gSaepY
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
send txt
pastebin is banned in my country
they put government shit in there
they banned it
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.
main.tsfile: https://pastebin.com/GhzHkg75CT_AIController.tsfile: https://pastebin.com/HbtjA4eD
Any help would be greatly appreciated.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
sounds complicated
very
you might have more luck asking in the sledgehammer discord
nobody really uses pipewrench afaik
Ok, thanks, I'll try that, @bronze yoke.
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 ?
there should be a lua file, usually in lua/server/
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 ?
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
)
Yeah I guessed it
Alright, now I know I was unlucky for not finding that fucking magazine lol
Anyone know the mod that gives you gun racks to place your guns on like an armory?
Hi, does anyone know if there is a lua trigger that runs when text inside a notebook is changed?
https://steamcommunity.com/sharedfiles/filedetails/?id=2992690035
also go to #mod_support next time
doubt that's a thing, events are usually for something that can result into an action. Writing stuff in notebook is not something that could lead to any action, you prolly would need to check if notebook data is changed since last time with the help of a trigger every min/10 or a day.
ISUIWriteJournal:onClick(button) when button.internal == 'OK'
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,
So your issue is to fix the glovebox for these cars or repair the parts? What do you do for repairs, do you add recipes or fixing or ???
The essence of repairing the glove compartment, its removal and subsequent repair, then reinstalling it on the car
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.
Author of these mod cars I suppose ?
This is how it turned out in default cars
and like in mod cars
the '70 glovebox doesn't seem to have an item that can be uninstalled
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
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
they seem to have an itemType in script but they do not load the default template and they do not add install / uninstall tables, you can ask the author about it.
I already wrote to him, waiting for a reply
you could add a fixing script if he doesn't want it uninstalled and add repairMechanic = true,
For now, let's try to ask him to add it like in default cars, but if it doesn't work out, I'll make repairs without removing. Thanks a lot
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?
yes, you have to reapply your modification at each reload. I did a similar thing for Recut mod https://steamcommunity.com/sharedfiles/filedetails/?id=2889428155
I see, so i need to add a moddata to item and check it. Thank you.
Oh damn this is such a nice mod! Love it!
Reason: Bad word usage
What is the simplest way to hide an item in the ISInventoryPage? There must be a simple way no?
Try set name of item to ""
I will, thank you.
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
Try overwrite render func for this button and add new feature
Alright thank you.
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
Sorry, for the ping but I'm not understanding something about the ISButton once an image is set via button:setImage
Is the image stuck at the center of the button? because by looking at the render function ( function ISButton:render()) it looks like it, but I don't know if i'm being dumb or not.
In the mean time, the custom names are working! ๐
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> ")
Anyone know if there's a way to cancel an attack animation mid swing?
Another one released!
https://steamcommunity.com/sharedfiles/filedetails/?id=3015577318
This one was simpler tho, but teached me a lot about hooking into vanilla things 
The <RGB> thing only works on RichText tho, don't know for sure what the game is using on rendering tooltips
Does anybody have a number on how many non-canned food exists?
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.
can someone make a craftable barbed wire fence mod
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?
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 ๐
You're doing a good job man, can't wait to try it when it's finished.
Oh, this is intersting.
I can use the sprite as an icon ๐ค
Can you rename the floor?
The specific tile on the floor, or just the label for the floor container?
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?
Why not?
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
You could maybe make it so that one could change icons for containers?
Yep
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
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
I was thinking more along the way of mod compatibility with modded in containers
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 ๐
Does it save through reloads?
Do you save tje name to its moddata or does it keep after you renamed it?
You probably overwritten halve the inventory ui lol
Can you also change the name of your backpacks that you wear through it?
Actually no lol, wanna take a peak?
Sure
https://steamcommunity.com/sharedfiles/filedetails/?id=3013901070
is developer of this mod in this Discord? I made a few changes to his mod as a proof of concept. 
Finally Done!
I have disabled for now the sprite as icon, but for a first version this is GOOOOOOOD
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. ๐
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
That's fine I understand
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
And the new faster action mod is also working
my item does not show up in the debug menu ingame any idea what could have gone wrong?
well i watched a tutorial so i asume ???
what does correct mean?
im new to modding first time
The script.txt file has to follow a very spefic format, otherwise it won't be loaded by the game
Share the file here
Yeah
its just that one thing
my crafting stuff works so its not the mod i asme that file is wrong
Found the erro


