#mod_development
1 messages ยท Page 210 of 1
Multi dimensional array/list
Afaik Lua doesn't support/have it ready to go - but as with all things Lua, everything is a table
#tableception
Gotta love it
Is having thousands of zones a likely scenario?
I'm thinking you could store them under their cell
It would eliminate your 2hr thing
Break it into seperate tables, and on the getnearbyzones function we just combine the ones we need
X/Y / 300 = cell
Also valid ๐ good idea
zones[cell].zones would be the sublist
Problem is zones might exceed a cell
Under my API you can make a zone thousands of tiles wide lol
damn
How are you storing the data of a "zone" then?
x1, y1, x2, y2
With additional data
But that is the bare minimum needed
Right now it's just stored under zoneType
could someone please guide me on this? it's raising 1 error when spawning and the condition it's not set at all, maybe i'm using wrong getType()?
function onPlayerSpawn(player)
local inventory = player:getInventory()
for i = 0, inventory:size() - 1 do
local item = inventory:getItem(i)
if item:getType() == "HuntingKnife" then
item:setCondition(5)
break
end
end
end
Events.OnCreatePlayer.Add(onPlayerSpawn)```
I think this is a similar issue to what I was talking about before, the event onCreatePlayer happens before you click to start? 
it does? did you debug it?
So you could consider tying it to an onplayerupdate function and removing the event after it's complete so it only runs once when the player is properly available
Yes sir like a few minutes ago I tried something very similar, I saw my print before I even saw my player name
OnPlayerUpdate, are you sure to call stuff there?
Yes but make sure you remove the event straight after calling it
hmm, i'll try it out, but the tick rate should be pretty high, so...
Otherwise you're gonna be setting the condition of that knife every tick
ahh, i see, right, that's Remove right?
Events.OnPlayerUpdate.Remove(onPlayerSpawn)
Yeah bro, should work fine
Functions can kill their own events I think
yup, i don't think it's the best way, but i'll try it out to see if works under that, ty ๐
Probably not in all honesty, I've been hunting for sometime for a better way too, but realistically as long as that event get removed it will have 0 cost on performance ๐
oky, fully trusting ig ๐
The annoying thing is OnNewGame works fine, but it's only called when you make a new character 
I forgot to say as well, class work on Game Night bro, it is the definitive mod for playing cards by a long shot, had a full night playing black jack with some friends in 100 rads bar and after getting the muscle memory down somewhat it's seriously next level
And the whole thing works amazingly for chess too, and I'm a massive fan of chess outside of Zomboid so just made my dreams come true
Dealing with nested zones automatically dealt with? I ended up making my own zone array and nested zone array for myself to make things a little easier to manage.
well, the error is gone, but the condition still being not set
function onPlayerSpawn(player)
local inventory = player:getInventory()
for i = 0, inventory:size() - 1 do
local item = inventory:getItem(i)
if item:getType() == "Base.HuntingKnife" then
item:setCondition(5)
break
end
end
end
Events.OnPlayerUpdate.Add(onPlayerSpawn)
Events.OnPlayerUpdate.Remove(onPlayerSpawn)``` any ideas? i've changed `HuntingKnife` to `Base.HuntingKnife` but still..
getType will return if its a weapon or toolweapon
its the type
if you do print(item)
do getFullType()
you might see its already Base.HuntingKnife?
hm, inside the game the "edit option" says "Weapon Type: Base.HuntingKnife" i think
afaik Type = without prefix
fullType is with the prefix included
and the condition it's an int with value 10, idk why isn't a float i'm confused af tbh
setCondition expects a float right? so passing 5 it's not correct or it's rounded and handled in the instruction?
yes, getFullType() will return you the Module.Item
if not getType what function should i look for in the docs?
okay, thanks! i'll try it out to see if matches
might aswell throw a print(item:getFullType) to ensure you're getting what you're expecting ๐
ye? i think OnPlayerUpdate it's not the event i'm looking for :c
function onPlayerSpawn(player)
local inventory = player:getInventory()
local it = inventory:getItems()
for i = 0, it:size() - 1 do
local item = inventory:get(i)
if item:getType() == "Base.HuntingKnife" then
item:setCondition(5)
break
end
end
end
Events.OnPlayerUpdate.Add(onPlayerSpawn)
Events.OnPlayerUpdate.Remove(onPlayerSpawn)
get() from the inventory array?
I would also do this but I might be wrong
function onPlayerSpawn(player)
local inventory = player:getInventory()
local it = inventory:getItems()
for i = 0, it:size() - 1 do
local item = inventory:get(i)
if item:getType() == "Base.HuntingKnife" then
item:setCondition(5)
Events.OnPlayerUpdate.Remove(onPlayerSpawn)
break
end
end
end
Events.OnPlayerUpdate.Add(onPlayerSpawn)
hm, okay i'll give it a try why not seems pretty legit, the first snippet
Aye I stole this from myself so it should work

XDDDDDDDDDDDDDD fallen from my chair
I only steal from smart people.

Appreciate it ๐ , I don't know if you're aware but there's quick actions if you hold shift.
Helps deal with cards.
Not sure what you mean by this, sorry.
I don't really have much interest in doing it tbh but the idea is fun so I shared in case anyone else would like to
a zone within a zone
Like overlapping zones?
overlapping, or perhaps you want a square nested inside a larger square
And you're asking if my zones API can do that?
sort of, just wondering how you deal with it since its all input by the end user
Implementation for zone mechanics are handled by the other mod using the zones - otherwise cross checking across all the zones is usually the go-to
Player/object x/y > x/y1 and < x/y2, etc
If true do thing
I think my zombie zones mod expects there to be 1 zone only
The API itself doesn't dictate checking locations
is there any way to obtain the steam id of an user via a console command? sorry if this doesn't goes here ;c
What's the stack trace?
there's no stack generated, that's the weird thingy
the last non critical refers to a warn
Are the prints for the item coming through?
if you added them
If you did the event remove as you had before, like outside of the function, I imagine that when initialized as event remove is at the bottom of the script, the code won't even run
So best to check this first
didn't add the debug printing line c:
i'll try to move it before breaking the loop as you did
STACK TRACE
-----------------------------------------
function: onPlayerSpawn -- file: ProjectZeroTraits.lua line # 22 | MOD: ProjectZeroProfessions.
[18-12-23 13:34:50.084] LOG : General , 1702917290084> Object tried to call nil in onPlayerSpawn.```
```lua
-- Line 22
local item = inventory:get(i)```
i'll try to call getItem instead, i'm pretty confused XD
I feel like such an ass
local item = it:get(i)
I think I said inventory:get before

function onPlayerSpawn(player)
local inventory = player:getInventory()
local it = inventory:getItems()
for i = 0, it:size() - 1 do
local item = it:get(i)
if item:getFullType() == "Base.HuntingKnife" then
item:setCondition(5)
Events.OnPlayerUpdate.Remove(onPlayerSpawn)
break
end
end
end
Events.OnPlayerUpdate.Add(onPlayerSpawn)
& that's why you shouldn't do quick cp
Presuming that Events.OnPlayerUpdate.Remove(onPlayerSpawn) didn't cause you any issues
This should work ๐
XD, nope it didn't
Perfect
So sorry for the fuck up mate
I actually have faith in this now ^
Run it back and lemme know
hahh okay there's no problem wtf? thanks for helping me :3
Any time I love to help but I make rookie mistakes all the fookin time 
everyone got typos, don't worry XD
is this suppose to trigger on player update?
It will trigger only on the first player update
So for a single tick the moment player object is properly available and loaded into the server ๐
any approach on how to achieve disabling certain traits when others are picked? i.e: "advanced hunter" gives you "herbalist" so you can't pick that trait anymore
I haven't messed with UI in PZ, but traditionally, it would be a removal of the target item from whatever array/list/hash and a refresh of the window/frame presenting that list
thanks!
Though, I'm a sadist, so if they don't directly conflict (like agoraphobia and claustraphobia or strong and feeble), I'll leave them and let someone waste their points. LOL
Guys, do you know any Brasilian PZ MOD dev, taking jobs?
Do they have to be Brasilian?
Actually no. But as BRL (Brazilian currency) is over 5x times back to USDโฆ this makes foreign DEVs looks overpriced ๐ข
But we can talk, ofc and find a middle ground if you want
I'm not available for work myself, but I help manage a discord for commissions and community projects.
If your idea appeals to someone they may do it for something reasonable for you - but that limits the pool of people.
Got it, I would like to try it. If you agree ๐
Depending on the idea, you could even attempt to make it. ๐คทโโ๏ธ
yo so, is there a way toooo
intentionally desync something from the server?
like make a lamp post only client side?
i dont need an explanation just a yes or no, before i attempt the impossible
if its impossible
yes you can
how do i make a clothes mod?
like i need just the script for the item
okay i found the scrips but im looking to make masks
like bandannas
Does anyone know the hotkey to bring up the Lua Console in debug mode?
~
F11
Thanks, turns out it was hidden by my chatbox :l....
Question, With Sandbox options, Now i have basic knowledge how to use them in a mod, But how do i add Sandbox options into a items value like Happiness say i set it too 15 happiness each time they maybe eat this items, but the player wants to change the food item Happiness to something different?
u just have to make the variable to direct to the sandbox option
there's a whole well written tutorial.. u might want to google that
while translating my mod i just noticed that if i put an existing crafting tab like "Tailoring" it will add the recipes to the already existing tab. but if the language is changed then it instead makes a new crafting tab called Tailoring in english and puts them there.
how do i make zomboid translate text in the Recipes.txt file? or just in general make the tab work properly.
does anyone know where I can access the file that handles discord bot for discord integration on dedicated server?
or is it not accessible?
Hmm, I might be losing it, but Tailoring isn't a vanilla category, is it? AFAIK the translations for the crafting window are in IG_UI_EN search "CraftCategory" for examples.
hi, do anyone know how to achieve using special characters from Spanish language, i.e รก รฉ รญ รณ รบ to be displayed in the UI strings?
edit: encoding with utf-8 w/o byte order mask it's not working for me ๐ฆ
thanks!
Anyone knows where the server time is stored? Killed all saved data besides players.db and it seems like its elsewhere. Checked out <servername>.db but found only
sqlite> .tables
bannedid bannedip tickets userlog whitelist
So nothing related to timestamp of server.
Want to wipe out server but keep players thus I cannot just use ResetID
I'll check again but as I told I killed everything but players.db
Ok, can anyone clarify for me about creating Scrollable UI components.
From what I can gather, it looks like if a component is "Scrollable" it must manage the drawing / rendering of its child elements itself... is this the case?
Bueller... Bueller....Bueller.......
Child elements are impacted along with the parent for certain behaviors.
decisevely uninformative
The drawing and rendering is automatically handled if the child is added.
That is not what I asked at all
The rendering of elements in general is automatically handed, yes. You add something as a child to something else, it renders... however I am speaking about scrolling and Clipping
If you want to have a 'scrollbar' and want the scrollable region to be clipped, the Element which is the container for the scrollbar, must manage the rendering itself (so it seems)
The rendering and stenciling (the vanilla term) of child elements of a scrolling element should automatically be handled.
or rather, if you want clipping, looks like you need to manage it yourself
Can you provide an example where this actually happens? Every example I can find in the vanilliia UI manages it manually
There's only 2 types of scrolling elements. Or you can build your own, which I did with errorMag.
What example are you seeing?
Forget scrolling for a minute. Can you provide an example where clipping is "automatigically managed" by the element?
because I see every single UI element that uses it, handling it iself in its prerender and render fuctions
It's only handled for scrolling elements
Which are managing it themselves
otherwise you'd need to call stenciling
Ok, and I am doing that, and nothing gets clipped
function ISScrollingListBox:prerender() has calls to stenciling
Yup... but does it ALSO have to then render the child elements itself...
every example I see implies yes, it does
Can you provide a gif/screenshot of what you're seeing?
You also have to call self:clearStencilRect() after defining the stencil.
In my UI, or in the code?
The UI in action.
Yup, which only further implies it must handle the rendering of the children
Are you asking if you need to run stenciling on each of the children?
self:setStencilRect(stencilX, stencilY, stencilX2 - stencilX, stencilY2 - stencilY)
local y = 0;
local alt = false;
-- if self.selected ~= -1 and self.selected < 1 then
-- self.selected = 1
if self.selected ~= -1 and self.selected > #self.items then
self.selected = #self.items
end
local altBg = self.altBgColor
self.listHeight = 0;
local i = 1;
for k, v in ipairs(self.items) do
if not v.height then v.height = self.itemheight end -- compatibililty
if alt and altBg then
self:drawRect(0, y, self:getWidth(), v.height-1, altBg.r, altBg.g, altBg.b, altBg.a);
else
end
v.index = i;
local y2 = self:doDrawItem(y, v, alt);
self.listHeight = y2;
v.height = y2 - y
y = y2
alt = not alt;
i = i + 1;
end
self:setScrollHeight((y));
self:clearStencilRect();
if self.doRepaintStencil then
self:repaintStencilRect(stencilX, stencilY, stencilX2 - stencilX, stencilY2 - stencilY)
end
This is the scrollable list box. You can see it is manually drawing the child elements
If you do not do this, nothing gets clipped
So simply adding something as a child , and then in prerender doing the stencil calls, does nothing
You must, in prerender, make the stencil call, render the elements yourself manually, then call clearStencil
Those are drawn rectangles - so not exactly ui elements.
local y2 = self:doDrawItem(y, v, alt);
doDrawItem renders the child elements
notice its looping through self.items
Those aren't children elements actually, they're just drawing shapes and textures
children are held in the children list and are their own UI elements
NO
Ok
function ISScrollingListBox:addItem(name, item)
local i = {}
i.text=name;
i.item=item;
i.tooltip = nil;
i.itemindex = self.count + 1;
i.height = self.itemheight
table.insert(self.items, i);
self.count = self.count + 1;
self:setScrollHeight(self:getScrollHeight()+i.height);
return i;
end
The scrollable list box does not make a child element for each item, it manages its list of what the items are, then draws them itself
Yes?
.
There are no child elements in a scrolling list box.... that is my point
there are no child elements in ANYTHING that does clipping
You must manually render anything you want clipped, between the call to setStencil and clearStencil
It has "chidlren" or items, but no child UI elements
It does not automagically manage and handle the rendering of clipping in any way
Particularaly I was replying to this. I read it as you saying the List has child UI elements, and what is being rendered in prerender is not those. My no was to that, in that it has NO child elements, and the call to doDrawItem is what is rendering it "children"
I believe you mentioned them as children - so I was trying to clarify. Apologies if that's not something you meant.
Yeah, terminology... the root of all evil, lol
But I do believe prerender/stenciling should apply to anything drawn onto an uiElement as well as children elements being attached. I can test.
My issue is, this essentially means I need to make any elements I want "clippable" to have their own Draw function, and then have the scrollable container manually manage the clipping and drawing
No need, I have tested, this is why I come with this question. It appears it does not apply to children UI elements (or im doing something wrong, which is possible)
๐ข
the bottom buttons are children of the window and not being stenciled
So annoying, I need to write my own Scrollable Component, and make everything have its own Draw functions so I can clip things....
This is why their is an absurd over-reliance on the ScrollableList UI component throughout the entire UI, because nothing actually supports scrolling or clipping besides it
This is why I probably thought it did:
function ISUIElement:clampStencilRectToParent(x, y, w, h)
if self.javaObject == nil then
self:instantiate()
end
if self.parent then
local absX,absY = self:getAbsoluteX(),self:getAbsoluteY()
local stencilX,stencilY = x,y
local stencilX2,stencilY2 = x+w,y+h
if self.parent:isVScrollBarVisible() then
stencilX2 = math.min(stencilX2, self.parent.width - self.parent.vscroll.width)
end
stencilX = self.javaObject:clampToParentX(absX + stencilX) - absX
stencilX2 = self.javaObject:clampToParentX(absX + stencilX2) - absX
stencilY = self.javaObject:clampToParentY(absY + stencilY) - absY
stencilY2 = self.javaObject:clampToParentY(absY + stencilY2) - absY
self:setStencilRect(stencilX, stencilY, stencilX2 - stencilX, stencilY2 - stencilY)
return stencilX,stencilY,stencilX2-stencilX,stencilY2-stencilY
end
self.javaObject:setStencilRect(x, y, w, h)
return x,y,w,h
end
Yeah, it implies its supposed to work with the entire nested UI component thing
but it doesnt, lol
Only used in combo boxes - which I think are drop downs?
Yea, they are drop downs
and what I think its doing is say the combo is in a panel, it makes sure the combos drop down doesnt overflow its outter panel by adjsuting the clipping rect I think
You could just drop those calls into your UI - or are you concerned with the overhead?
They dont actually do anything
Well im sure they do, but in terms of if you are trying to clip things which are children ui components, it has no impact
This is what I was working on, redoing the trait selection screen, and I wanted a nice grid container with scrolling
Each trait entry is its own actual UI Element, and they are a child of an ISPanel component
In order to fix it, I need to make a custom Panel component (to handle the calls to set and clear the clipping) and then I need to make the Trait UI elements have a draw function, which renders them, instead of using any of the built in rendering
I literally might as well rewrite / write my own base UIElement class that actually properly does scrolling and clipping with nested child elements.
Looking at the clipping thing myself now, and it does appear to not want to play nicely
What I did with gameNight was actually only use 1 UI element
everything else is textures and I interpret what's being selected based on where the textures are expected to be
I could do that, but I am working on a complete UI overhaul with someone, and so we will have multiple spots where we want scrolling and clipping of various different elements. Going the route you did and like ScrollableList is ok for one or two things, but I have no idea how many different layouts things in a scrollable container we might end up with
You can also add these to a scrolling list already no?
As far as I can tell, the scrolling list is single wide.
I think you can kind of determine that using drawItem
I wanted grid, left to right, top to bottom
I also made my own for gamenight using textures only - the additional benefit is alot more friendly on performance
function ISScrollingListBox:doDrawItem(y, item, alt)
The signature only gets the Y, item, and alt ๐ฆ
I mean I guess Y kinda gives me its order, and then I could check size, and calculate that all in the draw funciton
Yeah, I could do that. I feel like the better option is just to make a better base UIElement
This window is I think 3 elements, close button, inner box and the main window
Like it sucks, dont want to write it, but in the long run I think it will be worth it
Because really I want to be able to throw "anything" in a scrollable area, and have it "just work"
You can extend the scrolling list and modify it as needed too
dont want to have to write spahgetti code to wire it up to "act right"
Using the derive functions the vanilla shows
you basically borrow the template for scrolling list, and make your own
Yea... Like I said, it is doable. I just dont like the methodology.
I still can't seem to get children to stencil even when called
I'm probably doing something wrong
Ill make a new base UIElement, derive everythign from that, and call it a day, lol
No your not, I think i know why it doesnt work
I suspect they are using an older openGL version (which makes sense for a 10 year old game)
and stencil is something that appies till you remove it... and in a UI this can be a pain in the ass. It is common for a UI system to pop the old stencil off before it renders its element
However, most UI systems have a way to control this as well, so it DOESNT happen, so you can do nested stuff like this
You got it clipping child elements?
Yeah
the close button and + are children of the main window
probably related to how I wrote the element
but I call the stencil in prerender and clear stencil at the end of render
interesting... so what is different here than in your other test that didnt work?
self:setStencilRect(0, 0, 100, self.height)
local children = self:getChildren()
for ID,child in pairs(children) do child:setStencilRect(0, 0, 100, self.height) end
self:clearStencilRect()
local children = self:getChildren()
for ID,child in pairs(children) do child:clearStencilRect() end
I had it under prerender or render entirely
seemed to ignore children
yeah, i mean if this works, awesome
My guess is children get their renders and prerenders called after the parent
I would have liked something like
self:setStencilRect()
self:clearStencilRect()
and it cascaded on its own, but if this works, awesome
The math for the stencil needs to be adjusted for children's positions I think
Well this is awesome, means I do not need to write a whole new base UIElement, I can jsut write a new base "ScrollablePanel"
Thank you for your intrest and assistance, saved me from remaking the wheel tonight
No problem, and it does appear weird
It is wierd, lol. I was about at my wits end with it.
I am noticing issues with the stencils at 0/0
Yeah I had some wierd issues where trying to use the stencil turnd random things black all over the screen. I just assumed I was doing something wrong at the time, and probably was.
Seems like it's using the stencil applied to the children for the parent
I think calling on the children may not be necessary after all - may just need to separate the stencil and clear
could be... setStencilRect is probably just a pass through function on all elements calling down to the openGL function to set a stencil
it doesnt actually care what its on
Quick questionโฆ whatโs a stencil, child/children, and parent in a coding context?
We are speaking about UI. So say you have UIElement A. You can add another UIElement to it via :addChild() so now UIElement B is a child of UIElement A
UIElement A is the Parent of UIElement B
a stencil, is essentially a mask. You are saying only draw within the region specified
Ahh, clear it in render.. interesting
Well... hold on
Do you have additional UI elements that should render that are not IN that window/panel?
Like ELement A (that panel) pre render - stencil is set.
If there are other elements that appear after it, wont their prerender be called also, and be impacted by the stencil?
The close button and +
and wont it also impact the render pass of any elements "before it" in whatever list its in as well?
Are children elements - and I'm only calling stencil on the parent
Yeah, but do you have another element on "the same level" as the parent, but after it?
I feel like setting the stencil in prerender, will cause "overflow" into elements on the same "level" as that element
Not sure what you mean about same level - visually or?
Ill find out in a minute, but was just asking if you had tried it
ok
UIManager
|-------Element A
|---------------Close Button
|-------Element B
Element A in its pre-render calls setStencil
I would need to check
This works for Close button, but I am wondering abotu what happens to Element B
Whatever the parent is should impact - if it's not a child you'll need to call stencil on it too I guess?
Im gonna find out here soon, im not sure that is the case, unless it calls pre-render and render for an element, before it goes onto the next
Making stuff children usually locks up how they can behave I found.
ElementA.prerender
ElementA.render
vs
ElementA.prerender
ElementB.prerender
ElementA.render
Is what im wondering about
Like if you add a child that's not inside the bounds of a parent you can't click on it
Nod, yeah im not talking about another child, but rather something with the same parent as the main panel we are calling setStencil in
Gonna find out in a minute
ARG, the tutorial needs a damn confirmation button. Just accidently clicked on that
So close, yet so far
For some reason its not clipping the text...
It clips the button BGs now, but not the text
And setting the clipping in prerender and clearing it in render does not impact Elements which are hieracically "next to" the main panel, which is good, it was what I was worried about
I have no clue how coding in zomboid works but this looks really good!, how did you call the images for each "Child"(Im refering to each box), just wondering
Using self:drawTextureScaledAspect(self.texture, 1, 1, imageWidth, imageWidth, 1, 1, 1, 1)
the image for a trait is a property on the trait object
So you defined the draw as the texture in zomboid so it calls on itself?
If I read that right. Yes. PZ has the image for the traits in it already. SO i am iterating the traits, getting the image, saving it to a variable on the UIELement, and then when the UIElement is supposed to render, drawing the texture
Is the text drawn in prerender or render?
Render, same place as the Tait image
Ohh you made me realize something though
The titles are not rendering... just the descriptions
The descriptions use the RichTextPanel
So i bet something with it (because it also uses clipping) is interfering
Maybe it's parent-prerender, child-prerender, parent-render, child-render?
Are the rich text panels children?
Possibly. This might actually get me to get the decompiled source just so I know the render order, lol
Yea, Children of the TraitUI element, which is a child of the Panel. So they are "grand-children" of the Element which is calling setStencil and clearStencil
but I am pretty sure its because they set their own stencil as well because they do scrolling. So it is probably over-ridding the currently set stencil
I can get rid of them and just make my own function to split the text. I only used the richTextPanel because it "automagically" handled that. I dont actually need the scrolling and clipping of it
True
man, thanks a million
No worries ๐
I'm slowly learning to like UI
It's pretty versatile
So each box is its own UI element?
Yeah, the PZ UI is not awful, not the worst I have seen for sure. I however have spent the last year working on the UI System for my game making it "perfect" to work with... everything is jsut so easy... that switching to anything else is like torture
You both probably are geniuses with lua and brushes, unbelievable!, And I aspire to just make a simple detect on hit for zombies for explosions haha
Yea
What on godot or unreal or anything else?
I was a big Advocate for Unity a long time ago, but since version 5 they seem to actively be trying to ruin their engine, and the latest licence stuff only made me glad I switched to writing my own stuff
WRITING YOUR OWN stuff????? No engine?
Unreal is ok, but its "to complicated" up front. The UI looks like the cockpit of the space shuttle. No one has time for that, easier tow rite my own, lol.
There is an engine... my own, lol
:|, what coding base are you using??
3d or 2d cause if its 3d that is just...
codebase? None. It is written in C++ from scratch with openGL as the graphics interface
Pygame lol
3D and 2D
It is designed with procedural generation in mind as well, which most engines barely consider if at all
Unity has long standing bugs with procedural generation of meshes causing memory leaks, since like FOREVER
Dude, that is one of the hardest things to do on your own, just making collisions and camerawork function is incredible,
There is a Main Window, in the Main Window is a TabPanel, in the TabPanel is a ISPanel, which containts the TraitUI Elements. The Trait panel is the one "doing the scrolling"
And if it has Ai paths .... we are seing the next red dead redemption on its works
And it's utilizing the vscroll stuff I assume?
AI pathing is in, pathing has been in forever. Custom A* implimentation, as well as some other pathfinding algorithms
Yup.
You're basically all but using a scrolling list* - would just need a little TLC to adapt it to have columns
Yeah, that is what Im gonna do know that I know how to make this clipping work. Make a new ScrollablePanel component, that supports rows, columns, etc.
May have some performance improvements using less elements too
A real nice customizable base scrolling panel
Just your existence is making me realize how incredible bad I am at absolutely game related... Keep making great stuff! signing off
Yeah I thought about it, but since its just UI menus curing creation I wasnt to worried. If this were during the game I for sure would use less actuall elements
For the card search window I calculate scrolled values and do some math based on texture sizes
Never judge yourself by the actions of others. Enjoy your night!
if anything you inspired me to work harder for what I do... awe inspiring
nice, well then be inspired!
Yea, if it were critical I would be 'rendering' them all via simple function calls and handling the mouse and everythign in the panel itself, and calculating the visible area and not even trying to render things not in view etc. But since its just UI in the beggining I figured it was overkill
I'm more worried about mods that add a couple dozen extra traits
Yeah, the entire thing is gonna go through testing. I am developing this with a couple other people (dont want to mention who as the main person hasnt mentioned it themselves as far as I know yet).
So well make sure to get mods that add a metric ton of traits, and everything else
Good night. Consultation. I'm trying to add refrigerators with freezers into the game, using assets that already exist currently. However, I can't use the ISWoodenContainer, because I wouldn't have both. You could have the freezer or the refrigerator, but not both at the same time. I don't know if I will have to create a new object, inheriting from one that already exists, or I don't know how to add that double functionality.
If I pick it up and place it, it creates fine. The problem is creating it initially.
It is as if they were 2 boxes, one on top of the other, or one inside the other, and one acts as a refrigerator and the other as a freezer.
I can add only 1, not both.
This is from TileZed, looking at tile properties.
I am confused, as the default fridge has a freezer as well.... what exactly are you trying to do
Yes, right son. In fact, when you pick up the game object and place it, it is added as it should be. The problem is adding it the first time. My idea is to use a context menu, like the one in carpentry, and add several objects, whose assets already exist, because I am going to use the vanilla ones for now.
Add it to the world. Creating a craft.
I want to add, all kinds of tiles, starting with the vanilla ones. Televisions, refrigerators, freezers, etc.
ah, so you're looking for the functions to spawn it initially? Try this when you place the object.
https://projectzomboid.com/modding/zombie/iso/IsoObject.html#createContainersFromSpriteProperties()
declaration: package: zombie.iso, class: IsoObject
Ovens, washing machines, dryers.
Thank you. I'm gonna check it.
Is there a mod that uses it?
How to see an example of the implementation.
Creating and Manipulating World Objects Seen questions pop a few times regarding placing objects on the map so decided to make a little tutorial on it. Most of the tutorial is written in a single file included in a mod you can download below. The code is commented so you can see whats going on. I...
It is used in vanilla ISMoveableSpriteProps.lua when you place a moveable.
Thanks.
Anyway, the problem is not placing it in the world. I am being able to do that. What I cannot do is make it fulfill both functions simultaneously, that is, refrigerator and freezer at the same time. I can only make it fulfill 1 of the 2. And if I pick it up and put it back, then it restarts and then both functionalities appear.
Anyway, I'm going to check it out.
๐
I made a mod for this https://steamcommunity.com/sharedfiles/filedetails/?id=2985989533
So I want to do something with the discord integration and so after browsing through the files I managed to find the class that handles the DiscordBot for discord integration, I also saw the classes that handles the message for the chat in game, so the question is if I decompile and edit it then compile again, will it cause a problem to the game?
do you know the version of their jdk?
hi everyone, how y'all doing? hope well ๐ could someone explain this to me:
public void addXPBoost(PerkFactory.Perk perk, int level) from the official docs at https://projectzomboid.com/modding/zombie/characters/professions/ProfessionFactory.Profession.html
the integer it's the exp multiplier per exp gain or how it works? couldn't find any more info out there ๐ฆ
okay, thanks for the info! could i ask what func does the boosting thingy?
let me check rq just to make sure
like when you read a book, i.e
declaration: package: zombie.characters, class: IsoGameCharacter, class: XP
AddXp right there
so youd have to get the player, get the xp object, and then add xp to it
like this
and that's the addition to the perk exp gain when achieved, right? thanks <3!
that adds the amount of xp you tell it to, if you wanted to like multiply how much xp you gained from a skill, you would have to check whenever the player gains xp and add an extra amount based on how much they got
buttt if you dont need that then yes that should work just fine
hey guys, is it possible to get all the saved players from a multiplayer server?
if yes, how should I do that on a proper way?
should I read up the save files?
I've found getAllSavedPlayers but its deprecated and it seems like it does not work in a mp environment
Hellos, 2 quick questions, how can I code a lua file that 1 detects the weapon in the players hand and 2 checks if a zombie was hit by a bullet and 3 creates an explosion. Im also having issues understanding how I can add a separate magazine attachment for animations. Thanks
OnHit Event
Can anyone deny or confirm (better with link to thread somewhere) that Zomboid has some sort of issues with some AMD hardware?
this just adds a perk level
Wrong statement
addXPBoost adds a % boost to XP gained to particular skill.
This boost however is somewhat wonky, int is not directly translated to % like 1 is not gonna make it +100% exactly.
oops
I might also be wrong but I think its not int either its float/double or something.
really?
i assumed this is for when adding traits
or giving traits xp
i use this same thing and thats what it does
weird that they give it diff functionality with same name
waitttt
let me check rq lol
it is an int, there are preset multipliers and you give an index of the multiplier you want
It's a method of trait, part of traits factory. So if you have some trait like "Big Guy" that you can choose from creation list. addXPBoost(Perks.Strength, 1) will add % boost to strength when its picked
trait:addXPBoost(perk, int)
its not getXp() method
yea it does also give you a skill level too
1 = x4, 2 = x5, 3+ = x6 (generally, some perks are weird)
well like
what if i just wanted to add
25 boost
is that not an option?
nope
if there is a will theres a way, i was just wondering if there was built in stuff.
getPlayer():getXp():setPerkBoost(arg0: zombie.characters.skills.PerkFactory$Perk, arg1: number): void;
But its like.. plain value, number I believe can be float/double
But its also wonky
that's just because you've gotten that from a luadoc
lua has no distinct number types
java does and calling a method will convert to the correct one, in this case an int
I mean yeah, some do some don't depends on whats under the box as you said.
so setPerkBoost is also rounded to int then?
yeah
oh well
PipeWrench to be exact, WebStorm makes wild magic when it comes to finding stuff when there are some amount of typings defined from there.
didn't know typescript used a number type too, but same idea applies
hey so i was thinking of making a mod where on spawn you get like medallion, which youll be able to wear, and after a bunch of differant kill milestones, it will be upgraded and maybe give u effects like after 5k kills you wont get stressed anymore, or another could be after 7k you can move while aiming and your accuracy won't be decreased (this is an idea from the insurgent mod, where the run and gun trait lets you walk around without losing accuracy while aiming).
I made a melee weapon mod a while back, and im proud of it, but this would probably be my magnum opus, so i figured itd be worth asking if anyone would wanna use it. I dont know if i want to pour a bunch of time into a mod that most people will just find useless
the other thing is that I wanted to ask if it was possible to have a 3d model be emmisive (im not talking abt a tile, im talking about like an item or a wearable) without just smashing your fps down
my idea with the emmisive or animated model, is that the medalion will light up, and pulse like a heartbeat, depending on how close you are to reaching a milestone.
another idea i had, was instead of just a medallion, you could get a slash or a sling, and after getting kill milestones, or acheivements, you could get patches or medallion, which might be more feasible for someone who knows so little abt modding to begin with
What kind of issue? I've been playing on a 7840hs on 780m laptop and don't notice any issues.
And I played a lot on a desktop 5600 with no issue
I don't think you'll find a definite answer for this because everyone has different preferences. Some might find it enjoyable and right up their alley, while others wouldn't want to use it. Its the same for every other mod soo ye if you enjoy the idea of creating this mod, just go for it
โ๏ธ
Balance. Always.
I have made various mods that practically nobody uses but hell if I loved making them
Good stuff on the thursdoid
Glad weapons are being fleshed out more away from "broken"
Maybe I'll be able to make my weapon combo mod a reality now ๐
I hope they can make it so that you could add new attributes yourself to weapons
Like they did with sharpness for spears
"procedural damage system", "procedural weapon crafting", "procedural weapon breakage", "procedural weapon upkeep ", "wilderness procedural generation system".
not as catchy as quantum AI but it works
Yea we just need to sneak in ai and chatgpt and every product manager will love it
I have no idea what you are talking about... but I hope whatever it was this statement was dripping with contextual sarcasm that I am missing.
Im dead serious
Putting "AI" and "ChatGPT" arbitrarily into produts is a sure fire way to guarentee I will no longer be using them, or a paying customer.
THat is the same kind of absurd mentality that sees us putting computers in everything, and non-sense like clocks on vacuums.
Is the Cook hobby and occupation trait still broken in vanilla?
Helloo, I want to add something on the Discord Bot that the discord integration handles I want to add extra features and edit the message it sends, I found the class that handles this but do I need to decompile all the files and recode it? or can I specifically just edit the class that I Want and is it not illegal(didn't read the terms and conditions)?
I was wanting to have an item function only work during the day time. Any advice on how to go about this? I have been reading code from a few weather mods but the amount of variables can be confusing. I came across these classes that could possibly help with this problem.
getDayLightStrength
getNightStrength
getGlobalLightIntensity
I am new to scripting and lua language but I'm getting there SLOWLY.. which of these would y'all use to achieve this? Is there another method that I should try? Thanks ๐
You created the Obvious Collecting mod correct?
He did, also other super popular mods including the #1 spot for most popular of all time ๐
you made plenty of awesome mods that are among the fastest subscribed in the workshop. probably 3rd after Ibrrus and KI5.
Hello, could someone tell me if in-game item distributions and the ability to spawn an as admin separate lists? I'm not seeing the item in item viewer and I'm not seeing any stack trace exceptions in my console.txt thank you
there is only one list of item. there are limitation as to what items you can see (some tags like obsolete and types like moveable may not be available)
It is a simple food item, not a movable object. Perhaps I made an error in the distribution lua file. Thank you.
@heady crystal - Also based on your year in review - you got almost a million more subs than me - not that I'm some metric to based anything off of.
i don't need to decompile the other class?
How do you get the Invetory Icon for an item? I thought it would be getIcon but its displaying nothing for everything
To answer my own question in-case it helps someone in the future
local icon = item.item:getIcon()
if item.item:getIconsForTexture() and not item.item:getIconsForTexture():isEmpty() then
icon = item.item:getIconsForTexture():get(0)
end
item:getTexture()
hmm. That throws an error for me
uh seems like in your case it may be item.item
Oh no, the code there was just an example I had found in the vanilla files... in my code its just item
Was a little more to it. The response from getIconsForTexture():get(0) is a string, and to ge tthe texture, you need to combine it with Item_ so getTexture("Item_" .. icon)
local icon = item:getIcon()
if item:getIconsForTexture() and not item:getIconsForTexture():isEmpty() then
icon = item:getIconsForTexture():get(0)
end
if icon then
self:drawTextureScaledAspect(getTexture("Item_" .. icon), 10, yPosition, 32, 32, 1, 1, 1, 1)
yPosition = yPosition + 34
end
does anyone know where i could find resources for making custom occupations? google hasnt given me much helpful stuff
any idea how I can edit it? I decompiled it on intellij IDEA but I can't write on it even tho it is set as writable
It's insane, I never expected to get that far. Tbf I couldn't care less about the number itself, what makes me happy is knowing every mod is making people's PZ experience better!
Or... worse. Looks at hive mind
But I look up to you and Tcherno. Love your mods, I use many
your common sense mod has saved my ass multiple times when i forgot to bring a can opener and was starving
For what it's worth, I find your mods to be really good, and you are really good at making them. Keep at it ๐ซก
just gonna ask about this one more time, all ive seen is people saying to use profession framework even though ive got no idea how i would even start doing that. just want to make a set of occupations that arent extremely overpowered and dont affect trait points cause that never made sense to me
if no one is answering then there might be no resources/info for that, try browsing through the game files and find it
thanks!
How would I go about directing one mod to read another mods files?
I'm trying to see if, with very little knowledge on the subject but a decent mind to figure things out as I go, add compatability between two mods via a third patch mod. Thus, I'm thinking I can simply add the file structure of the mod whos compatability i'm trying to add to the
require ('xxxx')
line and the required sprite / entity to the second
require ('xxxx')
line?
the below is the raw data from the mod I'm trying to copy a line from to add compat to.
return
end
require 'MetalDrum/SMetalDrumGlobalObject'
local _, _, barrelCols = unpack(require 'ValidDrums')```
open the file with a relative path reference, iterate the lines and extract what you want, i'd try that process imo, may be wrong, just trying to help ^__^
Hey, I'm making my first clothing mod and I'm having some trouble adding it to the zombie outfits, the model works in player and in player zombie but, when i add it to an outfit the spawned zombie spawns naked. I also copy pasted some outfit from the base game and it also appears naked, is there some any other file than clothing.xml to edit? Thank you very much
It might help you to read this #mod_development message
Kay, I read it.
not really understanding what all that means tho.
could I get that in captain dummy talk?
I'm new to lua.
entirely new.
w<
some of those terms don't make sense to me, as in I don't know what they mean.
๐ชฆthis might be too hard for you then
it might be hard, but i can learn.
๐
He means basically open the file using the code, loop over the lines, and then extract what you want if I am not mistaken, although I am having trouble understanding what is it exactly you want to do/what for. Maybe there's a better approach to it
Go for it, best way to learn is by tackling challenges. It's how I learn at least ๐
could you explain clearer what you are trying to do?
Lua is mostly tables and that is rather flexible. However if you need to change local variables then you may need to overwrite some files.
honestly, why do you bother into fixing other people code?
if you really want to learn, start by building something from scratch, on the basics and/or trying to figure out how a simple mod script works, then try to implement some of the logic into your own mod script
there are many ways on how could you, but what you trying to do it's not a target for someone who doesn't know lua basics, so...
on topic: extracting the lines from the file, just give you plain text i assume you'll need to figure out how to make that into actual functions or variables to be called/intercepted
Do any of you know where i can find the files for the Map Order/Mod Order? i found them for SP but cant find them for MP
Dominos Add-On Out now:
https://steamcommunity.com/sharedfiles/filedetails/?id=3120162128

Would someone be able to point me to a resource that explains how to create a new event? I am attempting to create my first framework which would be based on vehicle damages
LuaEventManager.AddEvent("MyEventName")
triggerEvent("MyEventName", ...)
imo events from lua is a bit redundant (why go lua -> java -> lua) but the overhead hasn't seemed like much from my testing and it's pretty simple to set up
oh. I thought it'd be more complex but that looks easier than I anticipated. Thanks!
wait fr?
shizzzz i was making my own everything for "custom events" lol
just never thought to see if you could add new ones i assumed you couldnt
huh
you still should
using vanilla event system is just going lua -> java -> lua
there's no need for that overhead
yea i do guess your right
ill lose the prettyness a bit
but its for the greater good
however in my experiments with rewriting vanilla lua-only events i didn't see as much of a performance gain as i expected
Would probably only see performance gains in events which are called / triggered with high frequency... Otherwise its a blip in the wind the the number of ops being done per frame anyways
and even then... the gain would be minimal
yeah i tested the highest performance impact ones and it still wasn't that significant
most of the impactful events don't come from lua to begin with
so they weren't part of the scope
Nod, makes sense
(though i did optimise those a little too)
but the logic isn't really that difficult to reimplement so if you can be bothered to do it i recommend it
Oh yeah, I have been using my own custom event dispatches for the same reason as marley, just didnt know you could hook into the main system like that, lol
plus it seems silly to use a global event system, for events on a component based architecture, unless it needs to be a global event
usually an event is preferable to multiple mods hooking the same functions
Aye. I didnt say I didnt use events, just that I dont use the built in global event system, and that using a global event system is silly for a component based architecture unless the event needs to be global
For instance, there is no reason any of my UIPanels which emit events when certain things happen within the panel should use the global event system. If you want to be aware of an event which took place on the panel, subscribe to the event on the panel.
it's your choice if you want to add a global interface or not
how to replace moodles?
If i put .md files in my lua directory for my mod what will happen?
- Nothing it will ignore them
- The game will crap its pants and throw errors?
- It wont crap its pants, but it will in some messed up way try to load them
- something else
I would like to provide .md files next to each lua file which contains relevant helpful information for interfacing and usage of the code in the specified lua file
Hi, I'm trying to use context:removeOptionByName() and it doesn't seem to work for a particular item, but it works for everything else.
Doesn't seem to want to remove the options - any idea why?
nothing will happen
eggscelent
it could be the option is added after you use the command or the name is different
Yep, I figured it out... now trying to remove "Grab" option when it's in a container. ๐
Thanks for responding though ๐
-_- there's a space after Grab
lmao
you should try and find the translation strings instead of hardcoding the text
otherwise your mod will only work in english
how to replace moodles?
hi orange joe
It's live and seems to be bug free at this point (edit: oof, forgot to delete unused mod option but the mod still works fine and I'll fix after the weekend ๐). Enjoy y'all. https://steamcommunity.com/sharedfiles/filedetails/?id=3118990099
friends, who can tell me an example/reference for spawning a simple tree?
Hey guys, was just working on my first mod and am trying to make a "dressing" type item that will act as a poultice and increase healing speed. Does anyone know how I could go about implementing that since it's not just a normal option?
what does this line of code in a tshirt decal mean?
not sure if this is the right channell, but I was looking foward to make a radio transmission mod. What that is is to modify some pieces of news and make it so that instead of being 1993, it is based in 2005. How do I changed the broadcast transcripts?
it links to one of the .xml files in "media\clothing\clothingItems" where the model and texture and stuff on the player are added
ah, that would explain alot
thanks
i am not sure where i went wrong, it was working before i uploaded it to the steam workshop so i can only assume i made a mistake with the folder setup somehow? ๐ค
contextually all the mod does is add in a ```CardiologistBaseGameCharacterDetails = {}
CardiologistBaseGameCharacterDetails.DoProfessions = function()
local cardiologist = ProfessionFactory.addProfession("cardiologist", getText("UI_prof_cardiologist"), "prof_Cardiologist", 2, getText("UI_profdesc_cardiologist"))
cardiologist:addXPBoost(Perks.Doctor, 2)
cardiologist:addXPBoost(Perks.Fitness, 1)
cardiologist:addXPBoost(Perks.Sprinting, 1)
local profList = ProfessionFactory.getProfessions()
for i=1,profList:size() do
local prof = profList:get(i-1)
BaseGameCharacterDetails.SetProfessionDescription(prof)
end
end
Events.OnGameBoot.Add(CardiologistBaseGameCharacterDetails.DoProfessions);``` profession so i am not quite sure why it isn't showing up in the profession list like it did when i was testing the mod in the mods folder
so if I understand the problem correctly, the mod was working fine and now it isn't, even though you didn't change the code?
essentially when i added the new folder setup and uploaded it thinking it was working because it was working prior to that when i had it in the mod folder
would you happen to be subbed to it by any chance on the steam workshop?
yeah i figured i would switch on over to the steam workshop version since i was finished
Try to unsub from the steam version and then check if your local version is still working as it is expected to
well i feel like i was hallucinating now as it doesn't seem to work even though as far as i am aware i have undone the changes to the folders required to publish it on the workshop
fixed it ๐ฅณ made the mistake of somehow getting rid of the media folder when transitioning over to the new folder format to upload to the workshop
honestly not sure how i managed to so that but all's well now though it has occured to me now the heart should be whiter i think
Woohoo!
is there any mods with a half life HEV suit?
super new to blender and modeling, does anyone know why my baby's first sword model would show up as a cube in game?
i had a hidden cube in my outliner... i've got a lot to learn
I though this was a test for some Socker Boppers, lol. Deadliest weapons ever given to children
Heya, How do i make the Players Hp capped at 50% hp?
anyone knows if pz uses JDA or Discord4j as an api for the Discord Bot Integration or they use something else?
Hello, I want to see the character penalty Moodle code based on Vanilla Payne level, but I couldn't find it, do I need to decompile Java?
We found penalties for additional activities such as fitness, but we couldn't find any penalty-related codes for character capabilities (ex: accuracy, probability of falling).
I see here that it uses javacord but on the javacord api docs I don't find anything like this or is it not yet documented? https://javadoc.io/doc/org.javacord/javacord-api/latest/index.html
Found it. Hardcoded so it's going to be hard to access. I've tried to reduce the penalty for pain but it seems impossible directly.
I am not fully sure how to do it, but I guess your best bet is to look into the following vanilla files:
media\lua\server\radio\ISDynamicRadio.lua
media\radio\RadioData.xml
Glad you figured it out :)
hi does anyone know how to add a new perk bonus to an existing occupation? even a mod I can refer from is welcome.
#mod_development message
you get the profession and then use a command like this one fireofficer:addXPBoost(Perks.Sprinting, 1)
Do i need to redeclare all the professions or can I just do below as an example
local function burglarOverride()
local burglar = ProfessionFactory.getProfession("burglar")
burglar:addXPBoost(Perks.YourPerkHere, 2)
end
Events.OnGameBoot.Add(burglarOverride);
no you do not to redeclare the other professions, unless you name your file as the vanilla file
Thank you so much!
local vanilla_DoProfessions = BaseGameCharacterDetails.DoProfessions
BaseGameCharacterDetails.DoProfessions = function()
vanilla_DoProfessions()
local engineer = ProfessionFactory.getProfession("engineer")
engineer:addXPBoost(Perks.Lightfoot, 10)
engineer:setCost(-10)
end
Events.OnGameBoot.Remove(vanilla_DoProfessions)
Events.OnGameBoot.Add(BaseGameCharacterDetails.DoProfessions)
So I did something this, on a unique lua filename but it won't work. (Just a sample to see if it's working)
Do i need to declare something else?
Thanks for additional guidance
it works for me, only need to adjust the description
if you don't see the light foot perk on the right side or the cost change then add prints and verify that the file or mod are added correctly.
this should work if you call it after you make the changes BaseGameCharacterDetails.SetProfessionDescription(engineer)
Ohhh yeah that was missing thanks a lot Berry
didn't work for me so I just redeclare the profession changes like SOTO did and it worked for me. For some reason, the getProfession won't work from my end, i think
Anyone got a video or guide of some sort on making and publishing a melee weapon? Wanted to make a mod as a Christmas gift for a buddy with just the one weapon + a craft for it
Do you do work for money?
I don't generally mod for commission, if that's what you mean.
I generally just get pulled into certain passion projects based on what I really want to see in the game.
awe i understand who does work for commission do you know?
Just wanting server specific shit and fixes
not sure where to look tbh
I can DM you some info
Is there a mod that lets you run over zombies without getting slowed down?
How do you go about refreshing a UI? I am using the following approach:
function MyUI:onOptionMouseDown(button, x, y)
if button.internal == "CLOSE" then
self:setVisible(false);
self:removeFromUIManager();
elseif button.internal == "LEFT_ARROW" then
-- Update the visible range to show the previous set of buttons
visibleRangeStart = math.max(visibleRangeStart - 10, 1)
visibleRangeEnd = math.min(visibleRangeEnd - 10, #self.skillTrees)
-- Refresh the panel with the updated visible range
self:refresh()
elseif button.internal == "RIGHT_ARROW" then
visibleRangeStart = math.min(visibleRangeStart + 10, #self.skillTrees - 9)
visibleRangeEnd = math.min(visibleRangeEnd + 10, #self.skillTrees)
-- Refresh the panel with the updated visible range
self:refresh()
end
end```, but this is throwing an error. I could try destroy it and and show it again, but feels like a dirty approach, assuming there's a better way/function I am not aware of
what's the error?
Object tried to call nil
at the self:refresh() line
are you sure the class got that method?
that's what I initially thought, as per the vanilla files, but I believe i was mistaken
i can't find the relevant UI class on the zomboid docs either
what exactly are you trying to refresh?
the current UI panel shown to player
visually you shouldn't need to, the game redraws the ui every ui tick anyway (
)
it's a lua class, you won't find it on the javadocs
custom-made ones too?
yeah, if your ui is showing it is being rendered every tick
from UIManager.java
public static void update() {
if (!bSuspend) {
if (!toRemove.isEmpty()) {
UI.removeAll(toRemove);
}
toRemove.clear();
if (!toAdd.isEmpty()) {
UI.addAll(toAdd);
}
...```
hmm I must be doing something wrong then. I have the panel elements dynamic in myUI:create based on certain variables defined outside the scope of create. When a user clicks a button, those variables update, so supposedly, the panel should update as well, but that doesn't happen unless I close it and re-open it
hmm not sure I understand what's going on there tbh haha
looks so
try self:update() instead of self:refresh()
what does your render function look like?
empty
where are these visibleRangeStart visibleRangeEnd variables actually being used then?
inside the :create()
doesn't do anything
you'll need to push the new variables to the objects then, create is only called when initially creating the ui (usually at game start or when opening it)
what about render? Is that what is being actually called every tick?
i'm guessing since your render is empty what you're actually displaying is a child element created in the create() right?
yup
so you need to update that object's property directly rather than visibleRangeStart/End
I see. I will try that, thanks!
Hey guys, not sure if this is the right chanel to ask this, but is there a more up to date post on how to make vehicles? I've followed Ringo's post to the T and I've managed to get the model to spawn, but it's just a shadow. My guess is that either I didn't compile the model correctly, which I can't find any info on, or I didn't set the code up properly for the model.
I also noticed two things, every one else is using a "models_X" folder instead of "models" and secondly the link for the ply to pz converter doesn't work. I was told I can just use an FBX file instead, but that doesn't give me a txt file which the guide claims I'll need. Any help would be greatly appreciated, or if this isn't the right place to ask these questions, a point in the right direction would be awesome
I'm planning to add extra features the Discord bot on pz that handles discrod integration but when I checked it the api it used is outdated, if I use an updated api and change what needs to be change will I still be able to recompile it then plug it in without any problems?
General question, is is possible to get multiple players โStatesโ and โHistoryโ of actions? Also, can a mod connect to the internet? I have an idea for a really fun mod, that generates user stories, based on playersโ actions and history, using ChatGPT. Thoughts? Kinda want to set expectations before I dive in. Iโve done mods for MC, Factorio, Valheim, etc.. but never dabbled in PZ
Question regarding vehicle settings... maybe someone knows what this is and how the values affect
offRoadEfficiency = 1.1 - does it work? I increased/decreased it, didnโt notice the difference
engineRepairLevel = 5, - I have no idea what this is
gearRatioCount = 4, - if itโs the number of gears (from the name) what does it affect?
isSmallVehicle = false, - does it affect anything?
I figured out the other settings ๐
UPD. although there seems to be an effect from offRoadEfficiency , with low values the car drives better off-road
offRoadEfficiency = 1.1 Affects the chance of failure of spare parts off-road.
engineRepairLevel = 5, The required level of mechanical skills to fix the vehicle engine.
gearRatioCount = 4, Sets the number of gears in the car. (Does not affect the maximum speed of the car)
isSmallVehicle = false, Sets variable that used in zombie behaviour logic.
ty
Can you tell me how you did the overlay on top of the snow? I have a similar problem)
Sounds interesting. Tho I don't understand what you mean by creating stories using chatGPT
So Iโm thinking of feeding some data to GPT. Player movement, actions, position on the map, injuries, the likes. Then feed some map info about locations, events, etcโฆ and then have GPT write a timeline of events every in game day, then output โStoryโ to discord or a game log or an in game journal.
the game doesn't record a history of any of this, you'd have to record it yourself
Yeh I realize Iโll have to capture it, more concerned if Mods have a limitation on network access.
i doubt you'll be able to get the game to communicate with chatgpt
The game does log alot of stuff actually - but for something this detailed you'd need to add more logged events.
Also the only way to have the game interact with outside programs is to rely on text files.
Game can output to a text, and have a 3rd party program read it and output to another - for the game to grab.
it's been done in a skyrim mod. but chatGPT requests have a cost !
oh, i don't mean that chatgpt can't do it, i mean the zomboid can't do it natively
So youโre thinking a fancy logger and maybe some middleware to actually process it.
That's the only way to go about it with the standard modding APIs
I'm sure there's other possibilities using Java
whats the event for checking the players current weapon?
There's an event for equipping something on primary and secondary
But it's not specific to weapons
You can use OnPlayerUpdate to check anything on the player.
Seems like there needs clarification on event vs function
Right... how do I point to the change in primary weapon then?, I'm just trying to make the game create an object on the position where the opposing zomboid was hit by the bullet, idk exactly about the code but basically along the lines of: Events.OnPlayerUpdate, check (primary weapon name and if its equipped), then wait for: onhit, then spawn pipebomb on x,y
I understand it might be a waste of time explaining this to me but I don't really want to do super basic gun mods all the time...
For what purpose? Also, how do yo uplan on distributing the external application you would need to run to make this possible? Does steam let you incldue compiled applications? Are you gonna just provide the source and make people compile it? I know I would absolutely NOT put my openAI key into any mod from the steamworkshop, ever, for any reason, but most certainly not a compiled program to which I can not see the source
got an odd issue, if I use addItem to put the item in a player inventory its fine, but if I put it in a container with addItem and pick it up the item disappears. If I put the items from the container on the ground first and then pick them up they are fine... containerObject:getItemContainer():AddItem(musicItem)
player:getInventory():AddItem(musicItem)
is there some sort of item sync a server needs after the add item? or maybe a container sync?
This actually happens on all my mods and I drop into the player to avoid it
Have you looked at how its handled in the vanilla files?
I'll take a look and see, in the debugger it logs the moves as normal and it moves into the inventory and then right after evaporates with no logged changes made
The debugger isnt gonna tell you jack
hilariously enough it shows the movement of items
and the movement logs look identical
and what exactly is that telling you.....
nothing, lol
so, the debugger isnt telling you jack
I would recommend looking in the vanilla files to see how the game handles it. If i knew myself I would point you in a better direction, but I have not had to work with containers yet.
though... i bet I can answer it after a single quick search
what is the value / wht are you passing to addItem()
Anyone here know how to cap a players HP?
jsut check if it goes above the cap and then set it to the cap
well thats the part im having trouble with, i do not know how to check the player hp
"FunctionalAppliances.FAHotdog" is one example but it happens on vanilla objects too "Base.Popcorn"
in the starting items file of the vanilla game the AddItem calls look identical to what I am doing and I see no server or calls to sync
machine:getContainer():AddItem("FunctionalAppliances.FATheaterPopcorn")
player:getInventory():AddItem("FunctionalAppliances.FATheaterPopcorn")
both of those lines load into the world, but the container version will not stay unless I drop them on the ground first.
Aye, i just did a quick scan. I see no network code either. Also thinking about it, my one mod does deal with container inventories, let me look at the code
This is the vanilla spawn items code the calls are the same
local newVendItem = self.object:getContainer():AddItem(items[ZombRand(#items)+1]);
if isClient() then
self.object:getContainer():addItemOnServer(newVendItem);
end
I guess. I figured this out by mucking with other mods that created items and added t hings to inventory
okay I see you load the additem as a value and then server load the value
And apparently this function is not something you would of found in the vanill lua files, a quick search of the vanilla files does not return a hit for it at all
yeah, it exists, just apparently nothing in the vanilla lua calls it. I am guessing most of the item MP management code may be java side?
oh, here is the other thought that may matter
WHO is creating the item getting added to the container. In my mod, the item is getiting created by the client, not the server. Which is why the client has to send this. Most spawning code im betting happens server side, which is why it wouldnt have to do this...(is my guess)
my code looks something like this
function ReduceHP()
character = getCharacter()
local bodyDamage = character:getBodyDamage();
if bodyDamage > 51 then bodyDamage:ReduceGeneralHealth(1);
end
end
ReduceHP();
Your code would only call this a single time..
You're a genius! That addItemOnServer() did the trick
psh, I am not the genius, someone else figured it out, I just replicated what they were doing in my mod
woops
Purpose includes one singular thing... A passion for coding and tinkering. I am very aware of the intricacies of software publishing. It would likely be a program that takes an API key, IF someone wanted to run it. There would have to be some other configuration as well, such as file/network access information etc.. so that the middle-ware can connect to the server and read the logs or whatever I come up with. Ultimately, the plan isn't really to deploy it to anyone else, it'd probably be something that lives on my server alone, as I'm not sure anyone else would have any real interest in it.
Totally open source as well. Cause malware is a thing, and I'm not about that life.
Awesome. Tinkering for the sake of tinkering is the path to joy, lol. I jut wasnt sure what your intended goal was. Some people have very cool, but very novel and niche ideas, and do not realize it, and put a bunch of work into something no one else would use, and that is never fun.
But when you are your own target audience,well then it doesnt matter, lol
Lol Early in my dev days, I was suckered by "The next big thing" so many times... so many unfinished ideas lmao
PZ seems fairly straightforward to mod however, compared to the likes of stuff like Valheim or KSP
I blame the inumerable list of unfinshed projects I have on the pathetically slow pace of rapid human cloning
If i just had more clones....
hehe
I think the thing that's gonna hold me up with this however, is the context limit
Yeah, the hardest part about PZ modding has been lua itself. I avoided lua like a crack head with an std until now (lua being the crackhead with an std, not me, lol)
LUA makes me want to cry haha
Its not a bad language, but its syntactical styling feels like it tries to be different merely for the sake of being different
If it wasnt for the fact it originated in brazil, I would swear it was made by hipsters of the era
friends, Iโm making a small mod for farming, but due to the overabundance of plants, the context menu is very large, tell me a reference so that I can at least arrange the plants by category.
Workshop ID: 3050914195
Hi, How can I tell if a character is in a vehicle and how can I get them out of the vehicle via lua?
If you need help I can write up something that will log things in a format you want - being that it is text
kind of depends what you want logged tho
simply tapping into timed actions you can basically track an entire player's life - you can also have movement logged periodically
I assume if you feed this into chatGPT it can determine who was where doing what
If you're familiar with chatGPT enough - I have a request
hi there, could someone tell me what's guid, an unique id but i can't figure what's the reference, guild? idk
[26-12-23 11:34:53.089] LOG : Network , 1703601293088> 5.065.979> [26-12-23 11:34:53.088] > ConnectionManager: [RakNet] "disconnection-notification" connection: guid=653021950328...
game unique id? i don't really know, who knows? idk man, idk...
globally unique identifier it's just an unique number being assigned to the connection
if character:getVehicle() then
--do something
end```
there's also :isSeatedInVehicle
you can call ISVehicleMenu.onExit(playerObj) to make the player exit the vehicle, which is the same as if the player tried exiting the vehicle. You can also call the timed action directly, or "eject" him out of the vehicle, but depending on your exact need, this may not be the recommended way considering the former function handles the logic to automatically switch seats and do other stuff if needed
thanks finn
Ooooh sounds interesting. Are you going to work towards making that possible or was it just an idea still?
Iโve worked with GPT a lot. That part is straightforward for me, however the tricky part is gonna be the middleware. I can create logs from a mod on the game. The middleware seems like itโll have to periodically check the local log files and parse the data to hand off to GPT, get the response back and then publish its response to discord or wherever.
if I am not mistaken, assuming its possible to create HTTP requests via Lua, it shouldn't be much of a problem communicating with ChatGPT API, although I haven't tried it myself, and I have no idea if it'll affect the performance in-game
Hello, is anyone familiar with Clothing.xml? I have an issue where im creating own zombie outfit and all my custom clothes work on it, but when i try to add vanila items by GUID's they do not appear on zombies for some reason?
Anyone know of a good video that would give a rundown on how to create a situation based mod? To be more specific, I want to take a specific part of the existing map, redesign it some, limit the player to just that area, and then make it a selectable challenge when starting a new game.
You could literally tell chatGPT to write a c# console app to do this portion, and it SHOULD be able to write it for you. The premise is simple enough and ChatGPT knows C# fairly well, and knows how to use its own api, and read text files. You might have to do a little tweaking but this should be 100% within the realm of ChatGPT to write on its own
I have a function that is called when the client connects with OnCreatePlayer, the function goes through but the server acts like it doesn't hear the request of the sendClientCommands it sends. Later I call the same function and it works flawlessly. I am guessing that this is too early for the server to get word from the client. Is there another event that is called later that might work? I'd rather not drop it into the tick to check but I could do that...
TMRadioClient.UpdatePlaylistFromServer = function()
print("client sending request for terminal playlist from the server")
sendClientCommand("TMRadio", "UpdatePlaylistTerminalA", {request = true})
sendClientCommand("TMRadio", "UpdatePlaylistTerminalB", {request = true})
end
Events.OnCreatePlayer.Add(TMRadioClient.UpdatePlaylistFromServer)
you can't send client commands until the second tick 
okay that makes sense and this is before that.
it's frustrating to work around as there isn't really a convenient event for it
yep, its to sync a playlist to the client from the server, so I am pulling a tick for the audio anyways. I will set a flag for it to run once and then not again.
delay it out a few ticks, thank you
Can you just cache the command in first tick then process on the second?
I have a tick running anyways, so I dropped it in there with a variable to run once only.
worked like a charm
If you have it be a seperate function, you can also have it remove itself from the event, so it only runs once.
Not that it makes much difference now, especially less if you already have stuff run in on-tick with just another check, but might be good to know for the future.
I was looking at the add and remove tick functions but have never used them before. Luckily not needed now but I will keep it in mind. Thank you
keep in mind that removing events during the event process causes difficult to diagnose bugs
the game loops forwards through event listeners so unless the listener removing the event is the last one, one will be dropped for that call only
it's usually fine or at least unnoticeable on OnTick but it's something to keep in mind
@worthy terrace Idk if you saw this - I was wondering if you'd be interested
Sent you a DM @sour island
๐ Hey y'all. I'm brand new to modding, how should I go about decompiling and setting up/using a workspace? Everything I've tried so far has been outdated.
for decompiling i'd use beautiful java https://github.com/quarantin/beautiful-java, it shouldn't give you trouble like some other projects do
for setting up a lua workspace i'd use umbrella, that has all the libraries you'll need https://github.com/asledgehammer/Umbrella
I'll give beautiful-java a try, thanks!
How is umbrella meant to be used?
anyone know what you have to change in a mods files to change the name listed in the manager? I know how to change the ID, but the name!!! THE NAME!??!
nvm
figured it out
it wasn't taking for some reason when I changed the name line in the mod.info file.
heyy!
if i select a log file by listing the directory (the last, by creation date), is there a chance that the game will create another log file while the server is online and my tasks will get stuck on an outdated file that's not the one being written in real time? i don't know the conditions the game uses for creating log files, that's why i'm asking ๐ i've assumed (perhaps wrongly) that they're generated on every server startup, correct? but maybe there's another conditions i don't know about, so...
a server restart count as a launch or will hook to the last log created on same date, different time? thanks โค๏ธ *
go it!, thanks Alree :3
Hello people, does anyone know where i can find appliances_cooking_01_24? That should be the model for the microwave, I am trying to create a mod that adds an electric heater and i cannot make it placeable so i'd like to find those appliances and copy somehow the attributes of the microwave. Please tag me in response, thanks in advance!
// 41.78
public class Moveable extends InventoryItem {
protected String worldSprite = "";
private boolean isLight = false;
private boolean lightUseBattery = false;
private boolean lightHasBattery = false;
private String lightBulbItem = "Base.LightBulb";
private float lightPower = 0.0F;
private float lightDelta = 2.5E-4F;
private float lightR = 1.0F;
private float lightG = 1.0F;
private float lightB = 1.0F;
private boolean isMultiGridAnchor = false;
private IsoSpriteGrid spriteGrid;
private String customNameFull = "Moveable Object";
private String movableFullName = "Moveable Object";
protected boolean canBeDroppedOnFloor = false;
private boolean hasReadWorldSprite = false;
protected String customItem = null;
// ...
public boolean CanBeDroppedOnFloor() {
if (this.worldSprite != null && this.spriteGrid != null) {
IsoSprite var1 = IsoSpriteManager.instance.getSprite(this.worldSprite);
PropertyContainer var2 = var1.getProperties();
return this.canBeDroppedOnFloor || !var2.Is("ForceSingleItem");
} else {
return this.canBeDroppedOnFloor;
}
}
}```
It will take a bit to understant it completely but i will try it, thank you!
Btw. Where did u find it?
you can see all PZ code source once you decompiled it. The best way I know of is https://github.com/quarantin/beautiful-java/tree/main but you can also use my old guide that's a bit easier to use https://steamcommunity.com/sharedfiles/filedetails/?id=2748451514
This is a tool to help reverse-engineering Java code. It's meant to help with reversing the source code from the game Project Zomboid. - GitHub - quarantin/beautiful-java: This is a tool to...
Ash killing some deadites around here
Is there an event for when the game boots up, but after all the lua files are loaded and any 'top level' / 'initial code' they have is run?
OnGameBoot is the closest thing i can think of
link them to your event list or they'll ask every little one questions.
Kind of an assumptive and ignorant thing to say. Esspecially since I have looked over every single event list that can be found and was asking incase someone was aware of something not documented somewhere.
OnGameBoot is to soon :/ I didnt think there was anything, but was hoping.
true
Saying true is good, a "Hey sorry I was kind of a dick" is better.
Let me politely disagree
Color me not surprised.
Thanks, but as I stated, I am aware of that event, and it is to early for what I am wanting. Thank you though.
then you don't want something to hook when the games boots up, be more clear XD
Is there an event for when the game boots up, but after all the lua files are loaded and any 'top level' / 'initial code' they have is run?
Pretty sure I was specific... perhaps next time read the entire thing?
hook to OnGameStart then? that's not when the game boots up ^__^
that's pretty much what that event is for, what's unsuitable about it? you said it was too early, what do you need it to run after?
ye, like i'm not helping any other ppl that doesn't tell what's trying to do, annoying af
OnGameStart is when a game starts, also not what I want.
No one asked you not read, and then provide an answer which was already stated as not being correct.
Right click and block. it will make them and you happier
is it possible to make a UI panel horizontally scrollable?
i think's not, i've never seen before an horizontal scroll bar either on the vanilla game/mod
actually this a good question for finn, i won't tag him tho
but you can make it rezisable, that's for sure hehe
This would be super-useful for a thing im working on. I am not really too bright with UI either to figure it out lol
The deault panel, I do not think so, but I am not sure. However you can make a horizontally scrolling panel if you want yourself. It is nothing more than clipping being done
Resizeable isn't really something "suitable" for the idea here unfortunately
what about pressing the button and realoding another serie of buttons maybe?
i mean, the next > button will trigger another menu rendering, maybe that's possible and easier idk just commenting XD
btw good looking ui
That's actually what it currently does, for the skill tree buttons. I am planning to add below them the actual skills/perks to be picked. In case the tree is too big, I want to make it possible to scroll horizontally, but if not possible, I might settle for a similar solution of < > buttons
Thanks! Appreciate it
Again. It is possible. Though I am not sure it is possible "out of the box" with the default panel.
From the ISScrollBar.lua file, indicating the ScrollBar component supports horizontal use.
function ISScrollBar:refresh()
if self.vertical then
local sh = self.parent:getScrollHeight();
if(sh > self.parent:getScrollAreaHeight()) then
--print(-self.parent:getYScroll());
--print(sh - self.parent:getHeight());
if -self.parent:getYScroll() > sh - self.parent:getScrollAreaHeight() then
self.parent:setYScroll(-(sh - self.parent:getScrollAreaHeight()));
end
end
else
local sw = self.parent:getScrollWidth()
if sw > self.parent:getScrollAreaWidth() then
if -self.parent:getXScroll() > sw - self.parent:getScrollAreaWidth() then
self.parent:setXScroll(-(sw - self.parent:getScrollAreaWidth()))
end
end
end
end
hmm that looks like something. I will try to tinker with it and see where it gets me. Thanks so much!
Anyone here I can commission for a mod possibly a few?
Feel free to check out this server - has a section for requests: https://discord.com/channels/136501320340209664/1125248330595848192
Hello, I want to make a mod that edits an existing vehicle mod, specifically to lower the spawn rate of the car. I don't have any experience with modding in general, but I want to try it myself if possible
Anyone know of any way, either command or not, to check all characters on the server connected or not?
Me again ๐ - I believe connected clients can only 'identify' near by people - I would assume the GameServer object can see all connected clients.
So it depends what you're trying to do - the approach changes.
I found a mod that already does it. So there is a way lol. I just need to know how many people are still alive lol. Currently the only way I'm aware of is by using players but that only checks connected players, not offline players.
hayo, im new here. I would like to start making mods since i love this game so much, where should i start_
?
Check out modding tutorials on youtube and join the unofficial modding discord.
would anyone like to perhaps have a peak at something im working on and tell me where ive messed up? im trying to make an outfit for zombies but despite following a tutorial i found online, and checking with another outfit mod to see if id structured everything correctly i still cant get the item to appear in the item menu, honestly no clue what ive done wrong, it could be real obvious who knows
hi what's the minimum value you can use on the spawnlist lua?
for a vehicle specifically the lowest number i see is 1, is that a percentage? If so I'm assuming I can go into decimals?
Guys, the only thing that makes the item disappear from the current save in the game is changing its name in the script or is there something else that I need to be careful not to change after the mod is launched?
don't change its Type
ooh thanks, i didn't know, that's a valuable tip.
https://projectzomboid.com/modding/zombie/characters/BodyDamage/Thermoregulator.html#setSimulationMultiplier(float)
so does this function just not work or something? the getter works just fine but it errors whenever I try to set it. I looked in the source code and it looks fine so I'm unsure what is happening here
declaration: package: zombie.characters.BodyDamage, class: Thermoregulator
im hoping its just a syntax or spelling thing im not seeing lol
it's a static method
Hello everyone ! I'm getting started on the Project Zomboid modding, and was wondering if there was a way to make some inheritance between items or recipes with the script system
there is not
Perfect, thank you !
Anyone have any references or guides they know of that deals with playing music files? Spent the last two hours spinning my wheels here.
something like this?
https://steamcommunity.com/sharedfiles/filedetails/?id=2960089295
It makes a sound script and it plays it.
Not a sound (though maybe that is the route i need to go) but music
For instance. I have some main menu screens. I want to StopMusic() the music the game plays, and then play my own music on these screens
it plays mp3, ogg not sure what is different in your case.
however :StopMusic() is not stopping the music, and playMusic and PlayMusic also seem to do nothing...
ah I see
Well yeah, I know I could trigger the music I want to play via triggering it like a sound... but there are different.. idk the right term... channels for music, ambient sounds, ui sounds, etc
So if I trigger my music like a sound, it will just play over the annoying main menu music, and youll hear both
This might be handled by MainScreen.lua and it uses playUISound.
I know I have seen the code for this somewhere but can't remember where.
its use of playUISound is to playUISounds, not the music
You said stop music doesn't work, it's fair to assume it could be ui sound.
except if you look at what its being used to play, its ui sounds
I thought maybe the same thing when you mentioned it, so i looked at all the stuff it was playing with playUISound
have you tried printing everything? print music and the clip.
I have tried everything and a bag of chips
This is the latest inspectJava from tyrir I can find.
#mod_development message
half the problem is I am not even sure PlayMusic and StopMusic are entirely valid functions anymore... they are each used in exactly 1 place in all of the lua files, and I can not be certain those sections are even called ny something
I have also stumbled across forum posts indicating that at some point there was a method to play music that worked, and then some update broke that.
Then there is the fact the default music is stored in fmod sound banks... which makes me wonder if my music needs to be in a sound bank also... but there is like zero documentation on any of it
and then of course there searching for anything related to music brings up the True Music mod, but from a couple things I have read I got the impression it also does not use the music system, as I read a comment by one user about how they turn off the ingame music so they can hear their true music clearly
Hey guys! Is there any mods for npcs that is compatible for multiplayer?
Well, the main screen music is definately 'music' setting the music volume in the options adjusts it, and if i setMusicVolume to 0 it also silences it....
no
anyone know how this works? I was trying something using RadiatedZones function and I was hoping to integrate to Bus Tickets, but it won't let me get the file even though I defined the folder or the mod ID as the one on the "RadiatedZones" part
local reader = getModFileReader("RadiatedZones", "media/coordinates.txt", false)
Please ignore, I was able to make it work ๐ซถ
hi, could someone recommend a script or package to monitor for mod updates and schedule a restart? i'm looking for something I can run on a linux host, i did find one or two windows solutions. thx
This should let you set up services - includes a check mod updates + restart
Haven't ever used Linux tho ๐คทโโ๏ธ
Windows based hosts are more than fine if you're paying for a Linux service
cool, thanks. i read the docs on this earlier but i couldnt find reference to the mod checking and i didnt look at the code
Tryin to link the command section: https://github.com/quarantin/pz-server-tools#command-pzserver
checkmods Check mod updates
eagle eyes
I assume if the update is found it will auto restart - but I'm not sure
For windows you can just use Udderly-Up-To-Date and a BAT restart on quit script
Hiya. Is there a mod loading shenanigan that prioritise the local mods before the Workshop mods ?
I'm trying to work on a mod that require Hydrocraft, but I don't seem to have access to Hydrocraft stuff
how do i add a description to an item?
I've seen a lot of mods that involve collectibles and cards and such, but I've been thinking of an idea of a card game you can collect and battle.
But instead of Pokรฉmon or other spoofs where the copyright is already gray, the card game I am thinking of would be standalone PJZ content. In other words, it could eventually become a real part of the game (a mini-game window inside the game itself to escape the horrors for a bit of extra fun).
As I don't know if something like that has already been attempted and I'm not a modder, I'm more than happy to share the concept to someone who likes it and can use it. If anyone's interested, let me know.
Sorry for wall.
That looks intriguing and I could see this card game idea integrating into that.
Idk why but it makes me chuckle that for whatever reason, those two humans behind Spiffo look utterly miserable
The references / homages ๐
anyone know the line that addsa description?
@sour island hey man, can I pack skill journal? This is the second time one of your updates have royal screwed us.
No, sorry.
Iโll move us to Eveโs version, ๐
Not familiar with that, good luck
Indeed
That's interesting to stumble across that skill journal mod. I literally had an idea for something like that. I was going to suggest crafting a Last Will and Testament for passing skills to new characters at the creation screen, but they have to take that deceased characters surname or something like that.
I really should check the workshop... lol
helllo, got question. is it easier or faster to make a mod about making glue and its recipe? i just want to make a homemde glue with salt, flour and water.
but the mods glue are unrealistic.
bone glue or zombie glue.
also makes the game less challenging cuz zombies and bones are everywhere
Making glue out of zombies is realistic though innit?
Also wut iz the question?//.. Easier or faster than what? Or easier than fast? Or faster than easy?
Any lua wizards out here? I'm thinking on making the following:
Whenever season changes, change all given sprites to some other given sprite. Depending on the season, also add stuff to the container associated to the sprite. I.e. a fruit tree simulator.
What I have after 2hrs of googling so far is something crude, and my lua-patience is running low to the point where I hate the whole language, send help:
local Season = ClimateManager.getInstance():getSeason()
-- if Spring
if Season == 1 then
-- do stuff
end
-- if Summer (values 2 and 3)
if Season == 2 then
for i=sq:getObjects():size(),1,-1 do -- how tf do i access all squares
o = sq:getObjects():get(i-1)
if o:getSprite() and (o:getSprite():getName() , "CUSTOM APPEL TREE SPRING SKIN TILESHEET COORDINATE GOES HERE") then
self:setSpriteName("CUSTOM APPEL TREE SUMER SKIN TILESHEET COORDINATE GOES HERE")
-- how tf to make this self refer to the appletree
-- how tf do i edit container contents via this
end
end
end
if Season == 3 then
-- do stuff
end
-- if Autumn (4)
if Season == 4 then
-- do stuff
end
-- if Winter (5)
if Season == 5 then
-- do stuff
end
end
Events.OnClimateTick.Add(TestApples)```
idc if you even steal the idea and make it a mod yourself, all i want is a working appletree :-D
I can't answer the container edition, as I don't know very well the lua code of the game atm, but basically, what you need for the self is to make an appletree class and put the TestApples() method on it
Pls help! anyone know where i can find file location of this Ham Radio? thanks a lot
@upbeat spindle
AppleTree = {health = 100, <insert whatever properties you find relevant here>}
function AppleTree:new(health)
local self = setmetatable({}, AppleTree);
self.health = health;
return self;
end
local function AppleTree:TestApples(ClimateManager)
local Season = ClimateManager.getInstance():getSeason()
-- if Spring
if Season == 1 then
-- do stuff
end
-- if Summer (values 2 and 3)
if Season == 2 then
for i=sq:getObjects():size(),1,-1 do -- how tf do i access all squares
o = sq:getObjects():get(i-1)
if o:getSprite() and (o:getSprite():getName() , "CUSTOM APPEL TREE SPRING SKIN TILESHEET COORDINATE GOES HERE") then
self:setSpriteName("CUSTOM APPEL TREE SUMER SKIN TILESHEET COORDINATE GOES HERE")
-- how tf to make this self refer to the appletree
-- how tf do i edit container contents via this
end
end
end
if Season == 3 then
-- do stuff
end
-- if Autumn (4)
if Season == 4 then
-- do stuff
end
-- if Winter (5)
if Season == 5 then
-- do stuff
end
end
tree = AppleTree:new(100);
Events.OnClimateTick.Add(tree:TestApples);```
It's been a really long time I've done Lua, so I might get the syntax completely wrong, but I think this is a correct approach
ooh! Thanks a plenty!
Is there a meaning to the health-value that I am missing?
For context: I'm not intending to connect this to any farming mechanics etc., where I've seen other mentions to health values. I'll make it so that in the tile-editor there is a set of 4 different trees that also have container sizes (and are tagged as trees so they can be chopped), and then ideally use the script to pick the correct seasonal variant, and spawn apples in it whenever autumn starts.
To me this reads that "tree = AppleTree:new(100)" creates one individual representation of this class, whereas I'd need the script to find every appletree in the map. So perhaps using the syntax "self:setSpriteName" is a wrong approach from me, and I should instead use something like
"for each Tile in EntireMap:
If Tile Is AppleTree:
Tile:changeSpriteToSeasonallyAppropriateVariant
Tile:editContainer
end
end"
that mod it's written by you? ๐ฎ or did you improve it?
So, just doing some minor feasability probing, hopefully someone more familiar with the code structure around crafting can answer;
Would it be possible to create a mod that implements CDDA's system for tool use in crafting? i.e. tools have stats instead of hardcoded recipe uses in many cases?
A pipe wrench is decently flat and heavy, so I could use it to pound nails into a baseball bat but probably not anything precise like assembling furniture. So it'd have
wrenching 5
hammering 1
and recipes would have stat requirements instead of a list of which kinds of hammers specifically will work
No, it was just to get a property in the class, don't worry about it
IT works too I'd say.
My approach was an OOP example, so it would work if you convert every apple tree in your custom one
Yeah, it would work, but then I'm still needing to somehow form a catalogue of all the appletree objects. ๐ค
Oke, thanks!
Yes, unfortunately I wrote it for the time being lol
You can do this dynamically probably but the recipe UI is not equipped for it and would show dozens and items.
and how hard would it be to modify that section of the UI? On a scale of "Seperate skillset but doable" to "You may as well make a new crafting system altogether?"
My vision is just two lines of text, like "Requires: Tool with cutting of at least one
Your highest tool [icon] has [x] cutting"
It's doable, to hide UI elements. But alot of UI systems are not written in a way to make slight tweaks.
So I wouldn't be able to confirm.
maybe hide the existing tools section of recipes, and overlay it with either a new window or a button to show a new window?
I'll look more into it, thanks for your insight. This at least seems moderately doable, so I won't be wasting my time either way
Recipes have variable/parameters in their script that calls on Lua functions
That's where you'd dictate script checks for items
I like the idea, but wouldn't be requiring doing the whole crafting system ?
Or can we modify the source of a recipe dynamically ?
hello hello. is it possible to create a sound effect that's attached to the player for certain events like, for example, killing a zombie?

