#mod_development
1 messages Β· Page 143 of 1
just wait till y'all see the steam workshop image
its amazing
i'm not gonna spoil it
but i spent too much time on it
Does anyone have a good tutorial for applying bones to outfits?
I want to get off Mr. Bones' Wild Ride.
SUBSCRIBE - Don't miss another video:
https://www.youtube.com/tubecody?sub_confirmation=1
JOIN - Become a member and support my work:
https://www.youtube.com/channel/UCrJFlE7xYivQHiVzh8UiJ3w/join
DISCORD - Be a part of our community:
https://discord.gg/N4...
π
Long live Jobel
i suck so bad with regex
how do i use string.match on '('
local vapeFlavor = string.match('GnomeBar (Cool Mint)', '\(')
does not work
which i thought would be the escape sequence
do you want everything past (?
alr gimme one min
awesome site for regex btw
i feel like the dip in nthe middle is a little too low hanging
or maybe it needs to be wider
yeah p restricted with image size
that looks like a space invader
but yeah like an APC too
gonna adjust it a bit
normal vehicle (my ref) and APC icons
made the APC a pixel lower and less fat
eh, has less detail
I have the lower pixels as "suspension"
top pixels are for the turret-ish outcrop
how many pixels is this
looks like batman
car icons always look funny when viewed from the front π
the dimensions are a little funky, im going to instead try tracing over my source image
I think your first image with the "turret" top removed is pretty good though
if you're referring to my icons, I have no clue what you're referring to π
these are facing front
traced over my source image
you mean the side view? no, but I am already using these front-facing icons. I'll show my folder
I mean, you took the worst approach for a pixelated icon
π€·ββοΈ I am a programmer
these trait icons are insignificant anyway, just making them unique for my own pizzazz
yes, but I find them a pain
Fair
would you go with this

lol that def looks like a space invader

should i have the whole item name be colored or just the flavor name?
I'm okay with my latest version. I just want to move onto other patches I need to make
whole name is cleaner. keep it like that
For a food script item, how can I make it so that food can never rot?
Oooooooh that's a cute addition
food items have a field for that
as in you define how long until it rots, and set it to nil or 0, idr
okay thank youu
item MeatPatty
{
DisplayCategory = Food,
HungerChange = -40,
Weight = 0.3,
Type = Food,
IsCookable = TRUE,
DangerousUncooked = TRUE,
DaysTotallyRotten = 4,
MinutesToBurn = 70,
DisplayName = Meat Patty,
Icon = MeatPatty,
DaysFresh = 2,
MinutesToCook = 50,
EvolvedRecipe = Stew:15;Pie:15;Burger:10;Taco:10|Cooked;Burrito:10,
FoodType = Meat,
Carbohydrates = 0,
Proteins = 46,
Lipids = 30,
Calories = 380,
BadInMicrowave = true,
GoodHot = true,
BadCold = true,
WorldStaticModel = MeatPatty,
}
DaysTotallyRotten is the field. if it can be set to nil, idk
unless you are not touching lua, in which case directly edit the file and remove that line
About this, is there anything about how long does it stay good frozen?
Because I remember food going stale and rotten even while being frozen
that might be determined outside of the items themselves
Ice cream is special, i'd look at that
idk having just the flavor colored might look better
AAAAA they're so cool
hehe
thank you but it looks v wide
in that case I'd remove the parentheses. maybe it'll look cleaner?
i see
item Icecream
{
DisplayName = Ice Cream,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Icecream,
Packaged = TRUE,
ReplaceOnRotten = IcecreamMelted,
DaysFresh = 1,
DaysTotallyRotten = 1,
HungerChange = -30,
UnhappyChange = -10,
Calories = 1680,
Carbohydrates = 180,
Lipids = 84,
Proteins = 26,
WorldStaticModel = IceCream,
Tags = GoodFrozen,
}
It's Tags = GoodFrozen
yeah and whatever GoodFrozen is, it effectively puts the rotten timer on hold
but ice cream immediately melts when it becomes unfrozen, because the frozen factor is multiplied to the rotting rate, so to speak
not frozen, meaning rot time of 1 day is instant
I think
here's my last attempt
Choncc
i actually like this one
i think yyoure right
i added one pixel height to the last design since i was confident in the shape
now i just have to figure out how to get the current usedDelta on inventoryItem instead of Item
or some way to display the uses remaining bar
even if you dont go with it, using grey will help create the illusion of diagonals and roundness
you'd have to scan ItemContainers whenever you find them maybe 
I can't find any GNOME products that look like those pods, but I found these...
(I don't vape)
ahhhhhhh lol
i modeled it after those ones
understandable

where does runtime located?
uh, the whole runtime?
its located in the Zulu Architecture Process π
hahaha
is there any way to store dynamic info in an InventoryItem? like storing my own value in the item to mutate when necessary
modData
script
thats a table for everything imaginable, meant to store other stuff
what is the name of the sound file for the power shutoff?
thank you
there's a sound like that?
it sounds like a big power surge
i have never heard that in any games I've played
this script.. where can I find this
it's like a deep loud noise that sounds like everything is losing power at once
it only plays when the power goes out
yeah ik what you mean, I just don't think it actually plays. the water and electricity simply stop working, no sound or anything
no idea honestly, I would look in the functions that play once the player dies
did you try locating in the sound bank >?
actually I find the ISPostDeathUI. but I cant find that specific script
@rancid panther
this sound?
https://www.youtube.com/watch?v=-cv-eigCASk
π₯ Made with Moments from @SteelSeries #ForGlory
I have no clue how I've never encountered that sound
You can't hear the water one, but the electricity one you can when indoors
so, since it's SFX called in a function, I don't think its in a soundbank, unless there's a very specific reason
how can I send a little message notification to a player, like how a tv or radio works, but only to that player?
That'd be a server thing
player:Say()
works client-side
im just wondering cuz doing getWorld():setHydroPowerOn(true/false) doesnt get the sound to play, but using getSandboxOptions():set("ElecShutModifier", getSandboxOptions():randomElectricityShut(0)) does
Only client side, or server side too?
only client-side, if you want server-side then you need to work with the chat functions
setHydroPowerOn seems good for disabling the power without messing with the electricity shutoff sandbox setting, but it doesnt play the sound
the addLineChatElement(*) functions?
it does water & electricity?
From what I can tell (and I don't know absolute shit about coding), playing the sound only happens "once", because randomElectricityShut(0)) triggers setHydroPowerOn(False), and not viceversa
no clue honestly, I haven't looked at that, sorry
oh okay, all good, thank you
So take it with a gram of salt, I'm only using brain power and zero knowledge to say that
i kno but i am trying to see if i can get the shutoff event to happen without changing the sandbox option
Should i try to make a bar for the uses remaining or should I just have a numeric percentage
Or does anyone know if there's an easy way to make those bars?
bar would be nicer tbh
the more vanilla-looking it is the better
it looks really offputting when a mod adds something that looks different from how it would look if it were vanilla
especially when it comes to ui
does my ui look okay so far then
yea it does
yea
I swear if you make it so I can clip it on my belt I'll love you for the rest of my life
ill figure this out
its in the item scripts, attachment points
Oh my god
maybe make it compatible with noir's attachments so you can put it in a bottle slot
π₯Ή
i really am putting off learning how to properly do item distributions
Im trying to add a respawn time after death.. I already done it, but the problem is the text of the button doesnt count down
that's really the only thing left
item distros are ezzz
i wish itemzed worked on my pc
AttachmentType = Walkie,
attaches to belt.
anybody knows how to disable the button ?
have you tried setEnable>
just added the attachment
ill test it out
now we need a gnomebar plushie for the plushie slot
ill check if the attachment type is universal or not, i took it from a radio item
button2:setEnable(false)
ok.. Ill try
or self, idk
nice
make it a throwable
and then mae be like: never releases because item distributions
Chuck the fucking thing for a chuckle
then the mod will have so many features ppl complain that their friend attached vapes to every slot on their backpack and is throwing them around like a madman
doesnt work
what is self
drainable ?
yea
ithnink by using self .. it doesnt specify that specific button
wow
do you have the file where the death screen has its functions
today i learned discord had threads
yes
the fact that you got so far without them is pretty phenomenal
*duck
also have #1070852229654917180 and #1070858800501891172 , most important ones
courtesy of Glytch3r
maybe i should toss my ideas in that ideas corner and cast aside all responsibility
always an option π
i only have one or two ideas that I have no idea on how to implement
the rest are in my to-do
oh shit it is well past midnight
I need to get up tomorrow
gn lol
gn
is there any event which tracks item uses?
what kinda item uses
Are there any good tutorials on adding full body outfits? having issues with mine
Can I make it so when a food item is eaten it does not get destroyed/consumed?
you could change the timed action to where it gets the item being eaten
then when it hits the perform section (when the action ends), it re-adds that item to the inventory
yeah i was thinking something like that, but theres no built-in way to do that?
What are you trying to do?
I'm trying to make a dabpen to add to the MoreSmokes mod
Wh-
What is a dabpen?
Aren't you pretty much trying to do the vape thing this absolute chad just made in a different package?
essentially yes, seemed like a fun idea but its not a carbon copy because you would have to convert MoreSmokes cannabis into oil first then fill the dabpen (weed pen, cannabis pen, etc) it, then you can smoke it and get the effects from MoreSmokes
how can i check if the world power is on? i know i can turn it on/off using getWorld():setHydroPowerOn(true/false) but can i check if the value is true/false?
getHydroPowerOn?
i think i tried that already. i'll try again
isHydroPowerOn then
that's right, thanks!
if you microwave it, it explodes
"Hello, is your isHydroPowerOn working correctly?"
well thats neat
So its the refined idea behind the GnomeBars, refilling the og GnomeBar with the flavour for then it be empty ready to refill, yes?
But I do get the jist of the idea and how is it not "carbon copy"
uh sure? I don't see how this is relevant though
So far I've only seen one specific "way", if I could call it that, and has to do with how you can choose to eat a consumable a quarter or half way instead of fully
One mod specifically has gone their way to add the "3/4s" for all the options possible
If not replacing the item each time it is consumed for a lower quality of the same item
Do check what autodrink does with bottles
That might have some insight
alright I will, thank you
lol
Bottles are Drainables rather than Food, which makes sense maybe I could implement my items like that
@fading horizon would you be willing to help me on my mod?
Kk
Jaja
anybody knows how to disable this button without removing it.
EveryHours is supposed to run every :00 hour right?
i am using it but it is doing every ten minutes
or do i need to restart the save for it to change? i already reloaded the file
looks like that worked
okay i got the basic features of a temporary blackout to work
Day 2. Steam Workshop Survivor diary. Adding gifs to desc with the help of imgur.
maybe try this https://i.imgur.com/kfiMB77.gif
Thx
basic structure of the blackout is made
i need to learn how to store the vanilla sandbox setting since my mod will be overwriting it every time there is a blackout
and how to make a queue to check if there is an upcoming blackout so it doesnt reschedule it as it is about to happen
(better to schedule a blackout the next day so it uses the vanilla blackout time randomizer, methinks. but it seems to always pick a time close to noon. i'll have to do more testing with that)
lmk if anyone sees a way to do those things i havent figured out yet
Hey, I'm making a food can mod, but I can't open it with a can opener, any ideas on how to fix this?
It uses practically the same stats as "Canned Peaches" but not able to open it
There must be a tag you must be missing, read carefully all the tags Dog Food has
(I say Dog Food as I remember it being the case to be only openable with a can opener, could be any other can)
Exact same as peaches, I'm thinking it might be a recipe thing?
Ahhh
Ok
That explains why then, thanks.
Another question, for the 3D models that on the ground, how do I go about changing that? The tutorial I watched only shows how to get the inventory icons working, but not the models themselves.
I'll take a look at that, thanks.
I'd imagine I just have to make a copy of the texture that get's put on the 3D model and edit it, but where to place it or find it is beyond me lmao
need help in this.. anybody knows how to disable this button without removing it.
your next best option is to remove and replace the button with a placeholder that doesn't do anything
hmm .. im planning on adding a timer that enable the button when time the runs out .. i already did the timer function..
button:setEnable(false)
button.Enable(false)
doesnt work\
even better idea: add an invisible unclickable window over the button
that disappears when the time is up
Joy can you colab on a mod with me?
i do not plan on collabing on any mods as i have no expertise
is it not meant to be button2?
if u collab with me on a mod i guarantee it will not work
Is there anyone you know who would colab?
its just a variable
what type of mod ?
yeah but does it not refer to the button it created
A knife sharpening mod
Dm me
join Glytch3r's orbit modding server and see if there is anyone who can collab with you there
no.. you can change it to "ThisButton", after all its just a variable
Yo hattori
Can you send me the inv? I canβt find it
can I see the full file?
Hi not sure if its documented but,
How can I add to a repair script ? it just gets overridden depending on the filename/load order....
I might have something
You could drop a check for enable in the function the button calls
Also, I'm pretty sure I've set enable to false on a button to make it disabled before π€
It's setEnabled not setEnable
but you can still click the button even though It's hidden from the screen
You're calling self.button2:setEnabled() ?
You can click it I believe but it shouldn't register the action
I just tried it it sent me back to the menu even though the button was hidden
invisible
SetEnabled shouldn't be making it invisible
like this?
Yes enabled false fades it
unclickable, but idk what trying to achieve
trying to do this
Someone wants to prevent respawning for a duration
I just used setEnable
is the timer not able to recall it after a certain time to true?
He tried but I guess he's not calling on the instance
He can just prescribe a timestamp to a global list with steamIDs for keys
Overwrite the UIs render or some similar event - and toss setEnabled if current time is less than the stamp
But I think his issue is getting the actual button
can't you just do it on the client side without all that?
with lua checksum on it shouldn't be a problem right?
that one
The global list can be client side
I only mention it being global to avoid issues with creating a new character
Chances are your new character will take over as the IsoPlayer
I mean is there any point to a list when you can just use client side lua to lock the button for x time
thats my syntax haha
Relogs?
true depends how long the timer is, they can quit to desktop and rejoin
that'll take at least 30 sec?
list would indeed be the better idea there
Im trying to make a Respawn Time .. the client will abel to click the respawn or new character after a period of time \
but wouldn't you have to prevent them joining/spawning
guess thats easy enough with server side code
can you help me with it ?
if their modlist is different from the server modlist it will take even longer
nope I don't know any lua, sorry
just experience from other languages
just call the button and setEnable(false)
remove player from whitelist and then add them back once the time is up
like this
I did it in the games lua code directly, where the button is drawn so its easy
you won't want to do that tho
thats a lot of work on my server .. i have a bunch of clients on my server
you need the button from ISPostDeathUI I believe
oh ok
He can overwrite the buttons parent's render()
i still think having a button overwrite is way better than changing the current button
For sure
put an invisible unclickable window on top of it
I did that
Replacing the button isn't overwriting it lol
You have to call on a function as a local variable
that the original code I just add some functions
an unclickable window over the top sounds like the worst way to do it, no more unnecessary elements when you can just overwrite the code
you know like how journalists and stockphotos do it? they make it hard for u to right click their images
u have to inspect element to delete the invisible window that is on top of the image
not that that's what i do 
can anyone do it ?
but you need to reference the original button object and overwrite it with a timer
local funStored = something.func
function something.func()
funStored(self)
end
On phone, so forgive any typos
my bad, this was under the assumption that they really arent able to do it, but they clearly are.
I remember when you initially asked I looked at ISPostDeathUI. All of the buttons are stored as fields, so you should be able to easily access it without overwriting the entire file
yea theres a function to just disable it
SetEnabled works
You don't need a blocker
There's a few types of elements that enabling doesn't work on which would need a blocker if you want that type of effect
button:setEnabled(false)??
Yes
Ill try it
But you need to make sure you're calling on the button
hmm I have question
UI are pseudo classes - and players usually have an instance to them
does anyone know the function of this context
That's java side I believe
oh ok2 ..
Don't take my word for it though -- I'd confirm but can't as I'm at work
Which I need to get to π
πββοΈ
I need help on something .. hmmm I how can the text of the button be responsive to a timer.??
add the timer as part of the text
Heya, trying to put my modded item into loot distributions, but I'm getting an error and not seeing it spawning.
Here's my code.
require 'Items/ProceduralDistributions'
table.insert(ProceduralDistributions["List"]["CrateCannedFood"].items, "Base.SurstrΓΆmming");
table.insert(ProceduralDistributions["List"]["CrateCannedFood"].items, 6);
table.insert(ProceduralDistributions["List"]["GigamartCannedFood"].items, "Base.SurstrΓΆmming");
table.insert(ProceduralDistributions["List"]["GigamartCannedFood"].items, 6);
table.insert(ProceduralDistributions["List"]["GroceryStorageCrate1"].items, "Base.SurstrΓΆmming");
table.insert(ProceduralDistributions["List"]["GroceryStorageCrate1"].items, 0.5);
table.insert(ProceduralDistributions["List"]["KitchenCannedFood"].items, "Base.SurstrΓΆmming");
table.insert(ProceduralDistributions["List"]["KitchenCannedFood"].items, 100);
(Just started making mods, I have absolutely no idea what I'm doing lmao)
( .. "seconds until respawn") or smth
remove Base.
Alright; the tutorial I was watching was to have it there, but can do
What does the error say?
Not sure, it pops up right as I start a 'game' and disappears almost instantly
just try removing "Base."
its in the console
If you check console.txt you should be able to see it. I'm unsure off the top of my head where the file is located, unfortunately
Potentially your user folder/Zomboid
Yeah I can't find anything there, unless you're talking about the numbers, in that case "640" and "360"
is there a way to store data for the world the same way u can store data on players or objects?
Did you search for "error" in it?
thats the line inside the file
Global mod data?
console.txt shows "no errors" as far as I can tell
it works, but just hidden
theres an error in it
Im positive about it
i see. i am familiar with how moddata works on players somewhat, but wasnt sure how to write it in regards to the world
thanks
There's probably a guide on it somewhere, it works via events & manually transmitting it
If so I can't see it / too dumb to spot it
send me the console
i'll look around tomorrow or something when i actually am working on it
Have you confirmed that all of your table key accesses are correct? They would be case sensitive; List β list
delete that file .. and run the game .. after the error close the game.. cgheck consoe
me? i havent started on it yet. i only made a todo list to add these things
I meant doomsday, discord decided not to reply
ah
i can use global moddata to store something like if i have a blackout queued right?
Yeah. If it's something only the server has to worry about, you won't need to transmit it
Um no idea, as I said, I'm following a tutorial so. I'm clueless
.
Okay, you should open the Lua files in the game directory and look at the distribution code
something like, if there is a blackout already queued, then my mod wont schedule another one the next day
Sounds like something you'd handle server-side in a multiplayer context, no?
I need help Agustting spawn rates
my blackout code is in /shared rn cuz i wasnt able to use the functions im familiar with in /server. do they act differently? or does it just mean i did something wrong with the server folder?
You should still be able to use functions in Lua files in the server folder. I wouldn't rely too hard on the folder structure anyhowβexplicit checks are better
i see i see
Some functions don't work when run by the server (and vice-versa for the client) but usually it's simple to guess that that'd be the case from context
More detail?
So the error seems to have disappeared, but it's still not spawning surprisingly
Can anyone help me with a mod in making, Iβm having trouble adjusting spawn rates
Have you confirmed that you're able to spawn the item at all? A good way to do this is to use the item list in debug mode to manually add the item
Or the "additem" command
Yes, I've verified that it works (opening it, 2d icon, 3d model etc)
And you've gone to a new area so it has the opportunity to spawn?
By more detail I meant what exactly are you having trouble with
I've created a new game so that'd count no?
That should, yeah
I'm not too sure why it wouldn't spawn. I haven't messed with item distribution myself too much
I just want my can of food to spawn D:
The spawn rates are fucked they are spawning in every single last container
Seems you two have opposite problems

What's your code for item distribution? Seems odd that it'd spawn that much
I think the term you're looking for is script kiddie, although script kitty is adorable
Yeah that
I don't think anyone can help that much unless you send the code
I also think it's worthwhile to try to understand any code you use
So I've checked the console for when my mod loads and there's no errors or anything
My only guess is that it could be having trouble with the ΓΆ, but I doubt that. Could be that something is missing that I'm not seeing
WARN : General , 1680267043586> ItemPickerJava.ExtractContainersFromLua> ignoring invalid ItemPicker item type "Surstr mming"
I think you're correct
Oh π
How can I add to fixer script without it getting overridden depending on the filename/load order.... ?
Events.EveryTenMinutes.Add(function() if z ~= x then z = x end end)
the loading wars
laughgs and says If I'm a dog, then you're dog food... then realized they have it in PZ Hmm wonder if they got a Luke Valentine zombie lurking about somewhere...
hey hey guys
need a help here
im keep producing a nil result..
so I have a recipe which has this code
{
Apple,
Result: Apple,
RemoveResultItem: False,
NeedToBeLearn:False,
Sound:PutItemInBag,
Time:3.0,
OnCreate:OpenmagZ_OnCreate,
Category:WURO_recipe, /*λ μνΌ μ°½μ λμ€λ μ΄λ¦*/
}
and after onCreate
function OpenmagZ_OnCreate(result)
chk = result
print (chk)
--local tex = item.getTex()
--print(tex)
name = result.getName()
print(name)
end```
and when I try to get name for print(name)
it produces error with nil
i thought the result would just pass right into result variable..
result should be the 2nd arg, first is an array of source items
is that onCreate specific?
would be nice if the print result was't cropped out
How would I make it so the higher a skill is the higher the chance or repair success is, if it fails it damages it instead of doing nothing. I also want the repair to be locked behind a skill wall.
Check vehicle engine repair, higher level gets you to use less parts; for failing check replacing windshield or exhaust, failing damages the component
Wdym
Iβm incredibly new btw
By check I mean take a look at those specific interactions for ideas on how to code what you want to code
Well someone also said the args are wrong
Where would I see that code?
ah true
Well, it is me again. I need to have a Client send something to the Server
As in, I need to make sure that while the client starts someyhing, it's executed fully on the server's side of things for the results
Nnno clue, I just know the interactions you are describing and where they come from. lol
Oh jaja
is this parameters or contructors
where can I find them?
is it oncreate() specific? or just in general for any function?
How do I make it so a crafting recipe has a chance to fail and damage the item
Idk what that is
I want the it to have a chance to fail
And not be created
Itβs a knife sharpening mod
I want it to have a chance based on skill level to fail
then after Oncreate
do a player skill level check
then based on the skil level
alter their chance
How do I implement percentages? And whatβs the code for skill check
i would use ZombRand method
ROLL = ZombRandBetween(0,10);
that rolls number from 0 to 10
and gives a random number
And for a skill level it would be a smaller number pool?
yea u can getplayer() then use a method that would check player's skill level
then do a if check
Question, since the java docs don't really tell you what anything DOES beyond the method name: SandboxOptions methods, should I use sendToServer() or applySettings() to dynamically change the sandbox options?
if the player has certain level of skill, u will increase the chance
if the player has low level of skill, u reduce the chance
How do I set it so a certain number is a fail or succces and how do I tie that into the recipe
actually it's more simpler thant hat
local Z = SandboxVars.Wuro.LocZ
using SandboxVars. "option name". "variable name"
u can automatically call the int, boolean, text
from the sandbox file
To read yes, but to write in memory?
ah,
sendToServer I've seen is the function
I'm messing with it too, and my current issue is to make that function be called ftom the server itself?
Haha, same... I'm like, "Should this be in shared, or server?"
Which, yes, for MP
ah u want to do it in sp?
No, I want the server to consider some of the variables when it's time to rally or respawn zombies.
And those values can change over time
ah.. i see
do you know how to use conditionals?
Kind of like the random rally settings mod, but MP compatible, and extended out more.
like IF statements
if a number comes out to be 0 or 5
then u can let the program to consider them as fail
Thank you, will try this whenever I can actually get home to test it.
Is this a decent way of making my code run when the player spawns in the server and only then?
local Daikon = Daikon or {
SandboxOptionsSyncing = {
}
}
Daikon.SandboxOptionsSyncing.TellServerItNeedsToUpdate = function()
if isClient() then -- Check if it's running in MP or SP (Returns true in MP and false in SP)
sendClientCommand("SandboxOptionsSyncing", "SyncTheSettings", {});
end
Events.OnPlayerUpdate.Remove(Daikon.SandboxOptionsSyncing.TellServerItNeedsToUpdate)
end
Events.OnPlayerUpdate.Add(Daikon.SandboxOptionsSyncing.TellServerItNeedsToUpdate)
return Daikon ---> REMEMBER THIS NEEDS TO BE AT THE END OF THE FILE
It might be explained in the javaDoc but for me personally I looked through the java
You can also called them arg1, arg2, arg3 and then print them to check
ah good idea π
anyone knows what is the best function to use to get all the players in the server? to get their playerIndex
getOnlinePlayers()
fighting
do i have to iterate it?
It's an ArrayList
ah
and if i want to select each players in the list
to get thier zombie kills
ill have to iterate then right?
/**
* @noSelf
*
* Method Parameters:
* - (Empty): java.util.ArrayList<zombie.characters.IsoPlayer>
*/
static getOnlinePlayers(): java.util.ArrayList<zombie.characters.IsoPlayer>;
Yeah.
You grab something from the list, either:
- You know the index and grab the player from that index or
- You iterate through each player and figure it out.
it starts from 0 right?
.
I kinda know how to use python conditionals is that similar?
Can you be so kind to make a list of the stuff I need to do to this idea mod work?
Dm if you can
- make a recipe with onCreate: to call a function that would roll a repair chance
- in client.lua folder create an onCreate function that would do
- create a variable that saves player's skill level (example: axe )
3-1: roll a random numbers that would b used as chance percentage (1-100 for example)
3-2: create an if statement and choose a range that would b considered as repair Success
3-3: else it would b fail --> destroy item
Can someone help me or send me a guide on how I can create an occupations mod?
I wanna do some Marine Corps occupations.
thanks
I need a one for traits too so np
https://theindiestone.com/forums/b.)%20Creating%20the%20profession
its says 404 server not found
Can I set the condtion of the weapon the recipe will spit out?
RoboMat's Modding Tutorials - An introduction to modding for Project Zomboid - I - Introduction I1 - Where to start I2 - What is neededI3 - Lua TutorialsI4 - Other Resources II - The first steps II1 - Getting the connectionII2 - The entry point: Events III - The first mod III1 - Preparations III1...
thanks have a good one
@open drum yo
Is there a chance that modding custom power sources will be easier once the new updated power system rolls out? (which appears to finally add a proper wiring system where each generator is treated properly rather than the weird way it is now?)
one can hope
how do you check the game is MP or SP?
If either isClient or isServer true then it's an MP game
help ?
SP runs both isClient and isServer....
Anyway, searched the discord history, is...
getWorld():getGameMode() ~= "Multiplayer"
I'm pretty sure SP returns false for both
GameMode has issues when changing modes as you keep the old mode upon entering the MainMenu
So starting up a server then going back to the MainMenu will still return "Multiplayer"
Not really an issue in most cases I imagine.
thanks
Me and a friend of mine where working on a windturbine mod (got pretty far into it) but we stopped looking into it hoping the new power system rework update will simplify some aspects. Like how we should deal with someone making multiple turbines. Hopefully this means generators actually has a limited Wattage output system as well unlike the strange system we have now where you need to make a lot of custom code to make multiple generators see eachother in the same system and where the entire power system is like confined within one generator and normally unsharable...
I was working on a mod that made it so building zombies would spawn in as soon as the chunk would spawn in. But I'm having trouble hooking an event to when cells are loaded. It seems like the OnPostMapLoad event isn't firing in the first place, or so I think; The "cell loaded!" print is not firing off. Should I be using another event in this case? I've tried making the script a Server, Client, and Shared, so I think I've covered my bases. (The script cannot be on the client anyhow because the roomSpotted method only works on the server)
local function DucksBZSF_CellLoaded(cell,x,y)
print("cell loaded!")
local rooms = cell:getRoomList() -- Returns an ArrayList
for index=0, rooms:size()-1, 1 do
local room = rooms:get(index)
print("room loaded!")
VirtualZombieManager:roomSpotted(room)
end
end
Events.OnPostMapLoad.Add(DucksBZSF_CellLoaded)```
(P.S. I made a forum post and then immediately saw that they never get any responses so I just copy pasted my question here :P)
i'm not sure why it's not calling at all, but i don't think onpostmapload (or cells in general) is meant to do what you think it does
the cell stores the entire current loaded area, it's not related to the cells they use in mapping so this is only called once, when the player is first loading in
if you want to catch new areas loading, painfully the only option is Events.LoadGridsquare
Join the wait for v42 and the ChunkLoaded event
this makes much more sense, thankyou
I'll just check for rooms that are loaded in ever so often instead of checking every grid square that's loaded in lol
I use the OnSeeNewRoom in one mod, it's rather efficient. You can use that and check all other rooms too when it triggers or is that took late?
OnSeeNewRoom is when the room spotting is fired so it wouldn't change much
it's fired when you can see into the room and are in like... 16 tiles or so? i can't remember the exact range
yeah, it really wouldn't change much LOL
but the point is to fire zombie building spawning wayyy before that so that making noise actually drags em out
I mean when that happens, also check the rest of the area.
it looks like it's when the room can first be seen inside?
(Scratches Head)
Well for all the back-and-forth on deciding whether the inventory stuff should be server-side for the past several years, I hope this iteration of server-authority is better.
i'll be honest that this code is a little too dense for me to go through quickly but that seems to be how it works
i'm basing a lot of my knowledge from this video and from my skimming of the code it seems to line up: https://www.youtube.com/watch?v=UOQaZ0PflZs
The system, known as the "BS mechanic" or building spawn mechanic, can be both unfair and illogical. So let me learn you how it works.
Let's Each break this bs mechanic down. Each building in the game has a chance to spawn zombies once a player interacts with it beyond a certain threshold, which we also explain.
We also discuss how this mechan...
but the gist is: zombies that spawn inside buildings don't spawn until you can see into the building via a window/door, and if you're within a certain tile radius
if you loop through the room list every ten minutes or so it should be sufficient
aye, that was gonna be my plan
I managed to make my hat visible!!
granted it is about 100 times too big and sideways - but progress!!!!
I'm also a little upset as to how vague the discussion surrounding upgrading recipes has been.
I want to know more about how ZedScript is changing for 42.
=/
what was wrong last time?
I think that the format needs heavy revision and they're not up for that If I were to put my bets on it.
That's what I'm asking.
It went client-auth for some reason that I'll likely not find out.
@bronze yoke would you happen to know how to grab that room list? i know the method is attached to IsoCell but what would be the best way of getting the cell? would there be multiple cells I'd need to go through?
Whether TIS revises ZedScript for B42 is not going to affect my plans to write a whole new format that compiles to ZedScript. =)
getCell()
Alternate universe where an existing format with a detailed spec was used for scripts: world peace
you can use getCell(), or cache it from OnPostMapLoad
aye, thanks
Hopefully my extension gets us closer to world peace.
lol
We can realistically make our own scripting specifications that can compile to PZ's format.
Mine is in its 4th week or so of planning.
@bronze yoke @fast galleon Thanks for the help - got it working:
For reference, this is what happens when you approach the prison normally:
i forgot where the distributions are
Good afternoon everyone
Mod looking sick dude! Do we have a shorter eta than announced on the mod page or still the same ?
Still the same
The core grid is a tad scuffed ever since I added item stacking
Haven't even tried to fix it yet since it's still serviceable
Awesome progress. Great job
I'm working through my to-do list, but it's big because I have invested so much time at this point I need this to launch bug free
Also need to add (sandbox option to disable) searching containers
Sound
searching counters in all equipped inventories ?
Not the equipped, new ones you find in the world
wait.. is that where that search arrow comes from that i pushed by accident?
it is from this mod ?
xD
where the f is it coming from okay then lol, looking forward to it
Thanks and same lol
I haven't played Zomboids is so long lol, just been running around in debug mode for months
Notloc you seem to have a good understanding of how the ui works.
Do you know of an easy easy to create the "remaining uses" condition bar on drainables
I made a custom context menu but have no idea how to add the progress bar
I have been trying to play around with mods a little now. got 2 going for now and a couple of ideas. not able to do them yet though because I just don't know how lol.
All my friends that play on the server are very happy with the mod π
I inject a progress bar for mask condition in Susceptible, feel free to steal whatever you need from that
You're the best, thank you!
I'm out right now, not at a computer, can't link directly
There's one for the popup UI, but also one injected into the inventory itself
Hey, anyone have an issue with crop stop growing in a MP server. Like it stalls at 0 hours to next growing phase. I have checked the code and it works on another MP server and it was working on this server and then just stopped.
When using a drainable item in a recipe, I've seen it done PropaneTorch;2, what is the :2 represent? Is it a % of the amount?
the =2 or ;2 is the amount of units of the use delta used up. so like if an item has 10 units, that uses 2 of the 10
that's what I thought, but didn't want to restart my game 4-5 times to test it
Hello I wanted to do some back end work with the servers on Zomboid, what language is it written in?
π
i figured it out lol
lol glad you did, i will probably use some bits and pieces of your mod when you release it if that is ok with you?
I need to understand how to spawn new items in with custom textures and what not
And you actually comment your code so i can learn lol
where should I make them spawn
just gas stations and zombies?
or should i add it to other just general spawn tables too
idk how rare i want them to be
of course!
Any idea what item:setCustomName does? I'm assuming it's related to customized items like annotated maps or something, but I'm not sure exactly what changing the flag does.
it's a bool
its whether the name is a custom name or not
its not how you set a custom name
strip malls, electronics stores, gas stations, maybe some schools (you know kids vape).
I would do more locations with lower chance of spawning if that makes sense
i would personally do houses (bed dressers etc) as well but that is up to you. you gotta play with the drop table to make sure that they can all spawn in those locations but spread out the drop rates between them.
And np, the least i can do. i will be able to help with coding once i get the hang of it too lol
Lmao that I understand
But when I set a name, it doesnβt seem to matter if I set the flag or not
oh i see
It still shows my custom name even if that is false
sorry i just remembered seeing that the other day
How do I make my mod item spawn?
first test if your item works so far in debug mode
@drifting orehttps://www.youtube.com/watch?v=N6tZujOPnDw
This tutorial video will show you how to make a simple drink in Project Zomboid. I will go into the steps involved from start to finish. Read more below.
0:00 intro
1:08 Start
1:44 Searching for images to use in game
2:30 Searching for the Sound Effect
3:06 Creating mod file directory
3:54 Creating mod.info
4:34 Creating a poster
7:14 Adding ne...
what parameters do i need if im creating and setting global mod data at the start of a game?
wdym?
finally about to test item distributions
if i can get this right i should be releasing it tonight
ModData.getOrCreate("blackoutqueue")
i want to use this to store data on whether or not a blackout is already queued for the next day, through a boolean.
so the blackout qualifier would look something like this if getGameTime():getNightsSurvived() < blackoutoverride and ModData.getOrCreate("blackoutqueued") == false then
yea i know that part im wondering what the function is to store that information to use
it returns a table
i cant just put it in there without creating it at the start of the world can i?
when i made the immunity mod i used playerIndex to store data on the players so it can be used everywhere else
but i dont know what parameters or function i would need when making it for the world itself
it returns a table, so like
local modData = ModData.getOrCreate("string key")
modData.foo = "bar"
do i need a specific function and event to make it at the start of a new world?
OnInitGlobalModData is the earliest you can use it, it happens pretty early so most normal events are fine to use
and for the function itself, do i need specific parameters?
i see
there's stuff like ModData.create, ModData.get, etc, but you usually won't really need anything but getOrCreate
Mod I made isnβt showing in zomboid, I moved it to my mods folder
go to ProjectZomboid/media and format your mod folders the same way according to which folders you used
since you are using scripts, your folders would be something like ModName/media/scripts/script.txt
and follow the examplemod folder for the icon and info
Still very confused
y'all
the vape mod is ready
i just have to make the steam page and upload it
i got the item distributions right i'm pretty sure


Maumento pls help
i can't rn i'm going to get some dinner to celebrate
Lmao
C:\Users\USERNAME\Zomboid\Workshop
or
C:\Users\USERNAME\Zomboid\mods
that's where it should go
C:\Users\USERNAME\Zomboid\mods\Clove Cigarettes\media\scripts\CloveCigarettes.txt
that's an example of where your item definition script should go
then you see if you can spawn the item with either cheat menu or debug mode
This is how an item definition file looks
{
imports
{
Base
}
item CloveCigarettes
{
DisplayCategory = Junk,
Count = 12,
HungerChange = 0,
StressChange = -3,
UnhappyChange = -3,
Weight = 0.001,
RequireInHandOrInventory = Matches/Lighter,
Type = Food,
DisplayName = Clove cigarettes,
Icon = cloves,
Tooltip = Get lung cancer in the edgiest way,
CustomContextMenu = Smoke,
CantBeFrozen = TRUE,
OnEat = OnEat_Cigarettes,
StaticModel = clove,
EatType = Cigarettes,
WorldStaticModel = clove_ground,
}```
another example
@drifting orehope that helps somewhat
should be the basics to at least let you spawn some type of item
your Icon file is stored in media\textures and needs item_ in front of the filename. So for example my clove cigarette texture icon is
C:\Users\USERNAME\Zomboid\mods\Clove Cigarettes\media\textures\item_cloves.png
you deserve it! dont forget to post it here
tying to decide whether to post it tonight or tomorrow
since its kinda late
and i was misunderstanding how to add dif types of data
it is early somewhere else in the world xD, but yea.
maybe tomorrow morning. but we are all waiting here π₯Ή
so now my mod can store the original shutoff date secretly
flaw: if the server owner decides to manually change the permanent shutoff day, it might become an issue
I still donβt understand how to make the mod show up
in your mod list?
What I just listed will get an item that is spawn able on game
Yes
make sure you change the mod.info file to have a unique mod name
take a screenshot of your mod folder and the contents within it please
are you putting it here? C:\Users\yourname\Zomboid\mods
K one sec
Is the ui images 16x16 or 18x18
@rancid panther
18x18
Thank you
look in here C:\Steam\steamapps\common\ProjectZomboid\media\ui
Poster is 256x256 right
hmmmm
would it be better to make the blackout event have a chance for every hour instead of every day and scheduling it the next day?
it seems that scheduling the blackout a day ahead usually makes it happen between 7 am and 12 pm
aka the least threatening time for a blackout to happen
here is how it looks now
i think i will change it to everyhour and just make the chance lower
so what exactly is modData
mod data is persistent storage for mods
Wut
is it just like a variable
they're tables that let you store variables between game sessions
tables are just arrays but for lua right?
yeah
i used it to save information that i need to pull from or change so it is consistent with each other
im actually removing the blackout queue thing cuz im changing it to blackout chance every hour, but i was using it so it wouldnt schedule a blackout on a day that one is already scheduled
felt like changing it since it kept scheduling them at midday when it was conveniently bright outside
how would I get the length of this?
I have no idea how to do it in lua
would you do something with a for loop and add to a variable?
:size()
do you want to just send us the files and we can try?
if i change what frequency events are being added and reload the file, it still uses the old frequency (EveryDays vs EveryHours) is there a way to make it use the new event besides reloading the world?
I can dm you the file
I donβt want my idea stolen
np
you dont need to copy folders that you are not using
when you reload your file it just executes it again like it's a new file, it doesn't do anything to 'undo' the old version of the file
so things you add to events won't be removed
ah
same with anything you do in the global namespace
so i just gotta reload the world
yeah
I think we have the problem
I dmed
classic chess blunder
Oh my goodness
i suc
lol, my blackout mod made a blackout happen with perfect timing for a random scream event
for the Recipe OnCreate callback what are the arguments passed to it?
damn, even with 50% chance of blackout recovery, it made a blackout take an hour and a half to recover from (9 failed attempts)
this is why you dont gamble, kids
.2% chance... 
can you show code snippet
ArrayList<InventoryItem> items, InventoryItem result, IsoPlayer player
is this on javadoc
no
where did you get it from
myself
so do you just have to remember it?
pretty much
I see thanks
should i chill with the print statements in my mods for things like checks and cooldowns?
i remove my print statements before release
i see
if i'm feeling really fancy i give them their own function that checks for debug mode before actually printing
i see i see
prints are really bad for performance
i felt like i was spamming the command console with my prints
i'll keep that in mind, thanks!
source
Thank you, and theres no documentation anywhere for these?
i don't have anywhere specific to point you to, but i've seen tests showing it performed here and it's generally well accepted knowledge here
You're writing to a file with every print. No source should be necessary, really
not that i know of!
neat 
I know I'm messing
source trust me bro
speaking of writing to file do you know what those 2 arguments do?
create file if it doesn't exist, append to existing file
thanks very useful
you can see parameter names on this site https://projectzomboid.com/modding/ , they usually help decipher these things
for sure
how can i make time pass during an event function?
like if my function runs at every ten minutes, it all happens pretty instantaneously. is there a way to make a sequence within my function that takes a few seconds?
do i make it call a new function that is able to do that? or can it stay within the same function
.GIF files below 2MB are good
i'm spending way too much time on these workshop images
lmao
i need something to fill the space on the right though
hmmm
is there a mod that lets you zoom in more
so i can get a good shot of the car vaping
i like the glow tho
my monitor calibration is shitty though
so maybe it looks bad on others screens
it is good, and ur own mod. i just have weak eyes
might be. What values did you set for the glow? I can help you calibrate it
1 sec
i'm finishing the last letter
then i can just send the psd file if you want to look
I don't have photoshop on this computer, and my installation on my other one is jank. just send a SS of the params
I can eyeball it
@fading horizon
yea for me it was mostly lemon mint and cool mint that was harder to read
yeah, immediately noticed it
i'd say a lil bit on the pink lemonade but it is still readable. could help to use a stronger border shade tho
is the glow in front of or behind the text?
seems like in front. if the blending options are set to be behind, it would be much more legible imo
unless it is behind, in which case some of the glow is bleeding into the font itself
ah wait, I CAN read PSD files. this site takes them
https://www.photopea.com/
Photopea Online Photo Editor lets you edit photos, apply effects, filters, add text, crop or resize pictures. Do Online Photo Editing in your browser for free!
not sure if its up-to-date with all of adobe's features tho
hmm, you also have a lot of stuff going on
yeah I'll try tweaking the settings if you send me the file
you could put the layer of the border on the top layer to make the letters pop more while making the glow stay glowy

π»
