#mod_development
1 messages ยท Page 110 of 1
Don't even mention it. Documenting this mod is horrible, that's why I don't do it anymore :kek
๐
I have a few ideas, but I'm worried about starting them cause I can't stop ๐
There are way too many hidden/background mechanics added that is just to time consuming to even create documentation for them
Alot of documentation can come from how you name stuff
You don't have to comment everything
I mean yeah. But people won't read the files xD
they don't even read the descriptions lol
Do you want people to make submods? Documentation is mostly for me

That's why I stopped. I once did a documentation that had EVERYTHING, literally even the internal values of the variables, moddata, etc
And people kept asking "Is this trait dynamic"
Some people argued with me that the helicopter only comes on day 7
Even if they are presented with information they'll choose to ignore it
I avoid putting multiple mods in one workshop because it can cause confusion and lead to people enabling all of them
How many years does the EHE already has? I'm still teaching people how to configure your mod in the Spanish community
I started it with Shark in 2020 I believe
Fact
Well, 2023 and I still teach people about sandbox options from EHE...
Like how they work? Or how to enable?
I had a submod that was for More Traits mod, needed to remove it because people was asking where to find toadtraits to use DT 
How they work.
Like if they want to have helipcopters for X time and so on
People just don't get it
I changed how they work and what they were called for that reason
Ow so you the original author of dynanic traits?
It used to be start day and cut off day
Genesis
having multiple versions of the mod is a better option in case they cause conflicts
Yeah, the hated one ๐ hahaha
I wish Steam let people use the older uploads
Technically it should be possible to deactivate mods if you try to toggle two on
yesss
it'd make server management hurt less
esp for maps
How do i use doparam and not affect everything?
but just being able to schedule updates to once a week or something
jesus
i run 500 mods on my server
local vitamins = ScriptManager.instance:getItem("Base.PillsVitamins");
if vitamins then
vitamins:DoParam("FatigueChange = -7");
end
That too, but also specific to skill recovery journal -- people refused to let go of a character or lose a single XP point
Is there an alternative that only alplies to an instance
can't put them in a modpack w/o violating rights or getting permission - plus it's annoying to manually maintain
Oh, only one instance
i'd LOVE if i could go "just continue using old version until i hit button:"
How do i capture the variable of what is currently set? If it has no getter or setter?
Wlso that was a quick answer btw impressively fast
Technically hosts could send files to players but it'd be a big strain not to mention security issue
pepperGPT
I had Intellij casually opened ๐
IntelliJ is great for documenting -- if you use emmyLua - comments above functions show up when you hover over them and you can type and list arguments/parameters
ChuckGPT
I think I don't have it but will use it
Moved to Intellij a while ago, I used to use VSCode
I actually wrote ChuckGPT on the credits for the atmv2 mod
lol
It's a bit daunting, but the plugins are found in settings within the program.
isnt it allowed to put all the mod files into an unlisted / private mod?
Btw do you guys knows if it is possible (not necessarily how, I can research that) to add new types of injuries and also comfreys?
Nobody has done it before so maybe not
i think aiteron tried before
I've been thinking of adding more injury types ๐
Would be nice
More variety of injuries is one of my big projects I'm avoiding
I also want to add possibilities of scratch, burn, etc by doing daily stuff with low level but is another thing that I need to research
hahahaha don't avoid it!
The way Id want to do it is disabled the vanilla systems and implement my own for stability and scalability
Something like that would have alot of depth - and it gets messy if you're juggling vanilla stuff
time to drink smoothies for the rest of the game until u get level 10 medical
- the vanilla injuries are not objects unto themselves but fields on the class -- so it's pretty rigid
Same with medicine
That's why eating burned food is the same as eating poison
and dont forget to read the recipe magazines vol 1 to 5
not without permission from the mod author
they made it very clear that that's in fact not ok :P
It's not officially allowed, but people are going to do it and it's very hard to tell otherwise
prolly better that way, would suck to get bug reports from outdated versions
Would be nice if they still included the originals as required on steam but not enabled in game
the only time i do anything like that is when a mod is pulled that had no issues and my server depends upon, and it's happened only once.
i try to contact the original author if i can
but i feel uncomfortable about the whole thing
tbh
that'd break everything
nothing wrong with asking tbh
the game loads based on mod id not workshop id
so if you put both workshop IDs in
it'll try to load both
override one with the other
etc
Ah true
and then if it's a map or tileset
it can just randomly try to load the tiles even if a totally diff id
They'd have to change more stuff
many authors have released great mods and then disappeared 
game will load tiles even if u have no copy of the mod anywhere enabled
lmao
game is a pain to mod and there's a lot of drama in the community, and bugs introduced by devs that go unfixed for months
i dont blame them
sometimes i wanna walk away too
waiting for the "crafting menu" update
They're adding workbenches - I hope they made adding more in easy
finally
i hope it doesnt require those tiling tools cuz they dont work on my pc
Hope most of those workbenches are spread across the factories of the map and that to use them you need to go there. That's going to motivate people to move across the map and not have an improvised factory in their bases
then they will base in the workbench tho
But you can't have all the workbenches in the same base
I like the idea of some buildings having unique crafting recipes to them but there would need to be alot of variety
I mean, not all of them to be unique to that building, but would be cool to have some unique that you can't have in your base
Smaller workbenches of course would make sense in your base
easiest qol mod, move workbenches incoming
The "More X thing" is always a thing for EVERY game and it always works ๐
yeah
devs give us the tools and we customise it how we like lol
Does anyone know if it's possible to allow a player to build an object that's 2x2 (or more) tiles? I looked at ISBuildingObject and ISDoubleTileFurniture but I can't quite understand a lot of the functions around squares and positions specifically
I dont think thats been done before
up to 4x4 is ok, check making new tiles guides
some double beds are 2x2 but they consist of 4 items
The building object I had in mind would be built from a context menu so that sounds pretty close, I'll see if I can take a peek at how they handle it for beds, thanks
I already have the sprites and sprite pack made so that ty for confirming! haha
glad to know it's at least possible
cant build 2x2 beds i think. Can only dissasemble and move existing ones
this is so true, a number of things is more than 1 object.
ooohh, I see
I think theres only 1 craftable bed in vanilla and its 1x2
wait i think theres a furniture mod that allows you to build 2x2 beds
nvm
it doesnt hav ebeds
Yeah, the only vanilla stuff I could find was 1x2 at the most for tables, beds and tents, which is why I got stuck hehe
i never messed with that stuff since it doesnt work on my pc so ur kinda on ur own
No worries, I figured I'd put the question out there in case it had been done before
You assign each piece of the tile offset itโs own item
For context, I want to use the code for two ideas: One is bigger farming plots for things larger than vegetables, and the other is bigger graves
In tile properties
Craft each piece. When you have all together you should be able to place as long as the tile properties are setup to know how the tile is oriented in game
Via tile offsets
If itโs 2x2 and you have all 4 items. You will be able to place the 2x2 in world if tiles are setup correctly
Important to define the item itโs tied to in tile properties though
Not sure whatโs all possible with code but tilezed can get you most of the way there
I appreciate the advice, thanks!
imean use doparam but only apply to the current instance and not all
sorta like setDisplayName()
it only applies to that thing and not the whole for the whole world's future spawned items
So you need to change it to a single item but no the defined item itself?
You can add an override image asset in the same relative path as the asset in the tileset / package.
(IIRC)
Not sure if the doParam works over an specific inventory item in the client code, you could try to change only that instance and not the entire item
It may sound funny or not, but is it possible to increase the frequency of jumpscares?
not all the paramaters have getters and setters which is why doparam exist but the problem is theres no similar function to alter an instance only
getPlayer():getPrimaryHandItem():setName('test')
but its limited to that
go into debug mode > stash debugger > spawn into the map, you may get some jump scare
not sure if there are any better method lol
getPlayer():getPrimaryHandItem():setSplatNumber(2)
for example
wont work
ow wait it worked
lol
bad example
๐คฃ I love the jumpscares, and changing the sound makes it even better.
now I can help people with less rank than katana
getPlayer():getPrimaryHandItem():setTags('CutPlant')
this is an example of thelimit
it doesnt have a set for the tags i know theres anotehr way for it but thats beside the point
that not all the params have set and get ๐ฆ
@faint jewel has the dupe item bug been fixed?
?
I've seen someone post a report on your mod discussion page
it should be... I can't reproduce it.
it happens on my friend's server too
ah okay, I'll ask them how they did it
are they using controllers?
nope
why whats the dupe bug? i have encountered the same and i fixed it
if isClient() then
item:getContainer():removeItemOnServer(item);
end
item:getContainer():DoRemoveItem(item)
Uhh, so... How would I get all the inventories the player has access to?
I have to double check if I do this
I know that there's getBagsWorn, which gives me all the bags the player wears, and getInventory for the main inventory, but how do I access all the surrounding inventories the player can access?
There's a debug remove tool that has a lot of processes to use and cases checked for
Lunch in 5 minutes. Time to get some work done.
"EatType" would it be the animation of the drink?
EatType
Sets the animation variable that will be used when the item is eaten (FoodType variable in .xml files).
Example:
EatType=Kettle,
any reason my noodle pots are inedible?
item PastaPot
{
DisplayName = Pasta,
DisplayCategory = Food,
Type = Food,
Weight = 3,
Icon = PotFull,
BadCold = true,
BadInMicrowave = true,
CookingSound = BoilingFood,
GoodHot = true,
IsCookable = true,
ReplaceOnUse = Pot,
MinutesToCook = 20,
MinutesToBurn = 50,
DaysFresh = 4,
DaysTotallyRotten = 7,
UnhappyChange = 20,
Calories = 560,
Carbohydrates = 109.3,
Lipids = 2.66,
Proteins = 18.66,
WorldStaticModel = CookingPotPasta_Ground,
Tags = HasMetal,
/* added by skiz */
RequiresEquippedBothHands = true,
StaticModel = PA_CookingPotPasta,
primaryAnimMask = HoldingCarryMidRight,
/* secondaryAnimMask = HoldingUmbrellaLeft, */
}```
the soup one can be drank. noodle cannot be eaten.
thanks, that's it
I think problem in param RequiresEquippedBothHands
well then... what do i do? i should be in both hands it's a big ass pot of soup.
Remove this param and use param for anim (EatType)
Try remove param "RequiresEquippedBothHands" and set "EatType = Pot,"
Hmmm
needs to be carry, and needs to be eaten.
is it a food or drink?
food
soup you have to drink, not eat... i think
it's a pot of cooked noodle!
Do you want to eat from the pasta pot with both hands?
Very strange
@faint jewel I added to this item param RequiresEquippedBothHands = true, and Eat option worked
I think you changed something else
compare this to the default pastapot.
hey, if I wanted to propagate someone to every player on the server, is there a better way other than looping through the getOnlinePlayers list and send them stuff from there?
item PastaPot
{
DisplayName = Pasta,
DisplayCategory = Food,
Type = Food,
Weight = 3,
Icon = PotFull,
BadCold = true,
BadInMicrowave = true,
CookingSound = BoilingFood,
EatType = Pot,
GoodHot = true,
IsCookable = true,
ReplaceOnUse = Pot,
MinutesToCook = 20,
MinutesToBurn = 50,
DaysFresh = 4,
DaysTotallyRotten = 7,
UnhappyChange = 20,
Calories = 560,
Carbohydrates = 109.3,
Lipids = 2.66,
Proteins = 18.66,
RequiresEquippedBothHands = true,
StaticModel = CookingPotPasta_Ground,
WorldStaticModel = CookingPotPasta_Ground,
Tags = HasMetal,
HungerChange = -10,
}
for example, stopping some kind of looping sound that started from a player
When you send a serverCommand it goes to all players already
this is what i added when it was bugging
the dupe items
Adding to that, you can send to a specific player too.
/**
* @noSelf
*
* Method Parameters:
* - (String arg0, String arg1, KahluaTable arg2): void
* - (IsoPlayer arg0, String arg1, String arg2, KahluaTable arg3): void
*/
static sendServerCommand(arg0: string | zombie.characters.IsoPlayer, arg1: string, arg2: se.krka.kahlua.vm.KahluaTable | string, arg3?: se.krka.kahlua.vm.KahluaTable): void;
so is it the anim masks doing it?
Try remove anim mask and check
How's the progress on Script Item stuff? D:
I can't wait to sink my teeth into that when completed.
=)
Is it possible to apply clothingmask via lua on an instance
Good! I think will need create 333 pages for item script params ๐
I'm going to base a web application around your work.
Take breaks sometime tho dont over work . It might cause burn out
well that will make my life a whole lot easier
thanks
and to you too
No problem.
@zinc pilot I got this from my rendered docs for PipeWrench here: https://github.com/asledgehammer/PipeWrench/blob/stable/java/zombie_Lua.d.ts#L441
This one has generated documentation on each method signature.
41.76's official JavaDocs: http://projectzomboid.com/modding/
package index
you're a lifesaver
damn
declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject
This is every exposed global API call. (Apart from exposed classes)
another dumb question
what's the differente between sendClientCommand with player as a parameter and the one with no isoPlayer parameter?
The one without the isoPlayer assumes the player playing in the client to be the player to pass in the other call.
If it's split-screen is where I think you'd need to pass the player.
oh alright, makes more sense
Okay, so for some reason the mod I'm trying to make just makes pants disappear for some reason.
Hot
Is it because I have a script named clothing_pants?
If you're overriding a vanilla file perhaps
Well I'm trying to add more colors so would I just need to change the script name for it to work?
worst case could transform the item's settings on the fly
eat -> change values -> perform eat
I'm not familiar with the TINT system, but generally if you name the script the same it will replace the vanilla one
Well it's not a tint, I'm manually adding different colors.
Like how the lumberjack has only 4 colors.
Someone help me, the bottle does not appear in the character's hand with the texture I put, and the custom sound does not play
item Heineken
{
HungerChange = -20,
Weight = 0.3,
Type = Food,
ThirstChange = -20,
UnhappyChange = -20,
DisplayName = Heineken,
Alcoholic = TRUE,
UnhappyChange = -10,
ReplaceOnUse = Heineken_Empty,
Icon = Heineken,
CustomContextMenu = Drink,
CustomEatSound = Hkbottle,
AlcoholPower = 2,
Carbohydrates = 0,
Proteins = 0,
Lipids = 0,
Calories = 1500,
Packaged = TRUE,
CantBeFrozen = TRUE,
StaticModel = Heineken,
EatType = WhiteWineBottle,
}
item Heineken_Empty
{
Weight = 0.1,
CanStoreWater = TRUE,
Type = Normal,
DisplayName = Garrafa Heineken Vazia,
ReplaceOnUseOn = WaterSource-WaterPopBottle,
Icon = Heineken_Empty,
MetalValue = 5,
}
}```
{
model Heineken
{
mesh = Heineken,
texture = Heineken,
}
}```
You set sound like this?
{
sound DrinkingFromBottle
{
category = Player,
clip
{
file = media/sound/Hkdrink.ogg,
volume = 0.5,
}
}
}```
Doesn't it work like that?
My hero !!! I was trying to change it for hours, since yesterday... I'm newbie
No problem) I am working at this moment on complete guide about this theme)
About model - try place model script above item script in same file
PWp its modID, but staticmodel it's not going
do you have a "not going.x"
hey now that getOnlinePlayers is useless how do we get an IsoPlayer for an online player from the client by username?
do i need to implement a server command to achieve that?
module PWp
{
model Heineken
{
mesh = Heineken,
texture = Heineken,
}
}
can you test this with module Base for a moment, and say what the item modules are
It worked, now I understand how models.X works
So, if the item is customized it would be from the mod, but if not, it is a vanilla Base item, correct?
Blender still breaks me
Now my model file is useless as the texture already exists in Base.
I believe I have to craft this item in the blender:
usually the logic is: for same module you don't need to state the module or import it, if it's a different module though then you need either to use PWp.Heineken or add
module ???
{
imports
{
PWn
}
...
}
if it fails, make everything base until you figure it out
thanks! My plan is to change some things from vanilla, because I'm taking some things from games like sounds: Resident Evil, World War Z...
also you can put them all into the same file
feb 2021 ๐ฅฒ
As a newbie, my first challenge was to create a super fryingpan๐คฃ
Well, Feb 2023 and the sandbox options still seems to be a mystery for many...
Running into a slight problem with my inventory mod, nothing too serious, but definitely annoying.
It seems that mod items are always blurry.
The built in alice backpack looks nice and crisp, but the modded backpack is clearly filtered
That jacket is another mod item
on the bottom right
for MP?
that mod excites me so much but i hope you put something that automatically guesses sizes based on the type of item rather than it all being configured by hand
It do
i remember having to change some code to get the game to even render modded icons when vanilla icons were working fine, so there's definitely some internal difference
i await it eagerly then
a lot of internal stuff is packed into resource pack things
like moodles, etc.
maybe everything?
not sure why that'd cause that issue tho
that's true, modded items are rarely in resource packs
That inventory mod combined with the old and outdated Worse Search mod from Blair would probably be the better combination of all items lol
In Unity engine, this would simply need me to change the textures filter mode to point, but I don't see that exposed in the API
I'm gonna hopefully add searching as a sandbox option
Won't launch with it though, want to ship this year lol
Really? shut up and take my money
What func you use for draw item?
https://steamcommunity.com/sharedfiles/filedetails/?id=2846623627 this is my favorite item searching mod
opens from context menu so should be compat
assuming u keep context menus
xD
inviBagFuncs = {}
function inviBagFuncs.transferBagData(oldBag, newBag)
newBag:getModData()['isInviBag'] = true
newBag:getModData()['prevType'] = oldBag:getFullType()
newBag:setName(oldBag:getName())
newBag:setWeightReduction(oldBag:getWeightReduction())
newBag:setWeight(oldBag:getWeight())
newBag:setCapacity(oldBag:getCapacity())
newBag:setTexture(oldBag:getTexture())
newBag:setFavorite(oldBag:isFavorite());
ISInventoryPage.renderDirty = true
end
function inviBagFuncs.toggleInviBag(playerIndex, context, items)
items = ISInventoryPane.getActualItems(items)
local player = getSpecificPlayer(playerIndex)
local inv = player:getInventory()
local wearOption = context:getOptionFromName(getText("ContextMenu_Equip_on_your_Back"))
if not wearOption then return end
--local subMenuWear = context:getSubMenu(wearOption.subOption)
local oldBag = player:getClothingItem_Back()
for _, item in ipairs(items) do
if wearOption and item:canBeEquipped() then
if oldBag:getModData()['isInviBag'] then
wearOption:addOption("Unhide Bag", item, function()
local newBag = inv:AddItem(tostring(oldBag:getModData()['prevType']))
inviBagFuncs.transferBagData(oldBag, newBag)
inv:DoRemoveItem(oldBag)
player:setClothingItem_Back(newBag);
ISInventoryPage.renderDirty = true
end)
else
wearOption:addOption("Hide Bag", item, function()
local newBag = inv:AddItem('Base.Bag_invi')
inviBagFuncs.transferBagData(oldBag, newBag)
inv:DoRemoveItem(oldBag)
player:setClothingItem_Back(newBag);
ISInventoryPage.renderDirty = true
end)
end
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(inviBagFuncs.toggleInviBag);
drawTextureScaledUniform
I also have issues with drawn textures
havent tested it yet but if it works im just missing the function to transfer inventory
Compresses the crap out of them
Because it's from the base module, I haven't tried yet
thing that makes bags invisible as a toggle?
Seems to be anything brought in from the media folder - textures from the UI.packs are fine
i have code for transferring inv
Like @sour island noted, you can see artifacting around the modded texture
But its defnitely not in the raw file
may i ask for it ๐ pretty pls @weak sierra
Added the background to help see any errant pixels
You tried this functions?
DrawTextureScaledAspect2(...)
DrawTextureScaledAspect(...)
DrawTextureScaled(...)
from bag to bag btw
if i can find it..
I'll give them a shot
It's even present in vanilla textures that are from the media/ui folders
Oh, just found this
https://zomboid-javadoc.com/41.78/zombie/core/textures/TextureID.html
Javadoc Project Zomboid Modding API declaration: package: zombie.core.textures, class: TextureID
This contains the texture options
texture:getTextureId()
I'll play with this too
can't find it for the life of me atm but it's basically just loop through every item, remove from bag inventory, add to other bag inventory
not rocket science
xd
I already know that mam. But i couldnt find the syntax of the contents like how i iterate it
Thats the only thing missing
Then in off to to test the code and pray it works
oh wait i found it
it's somethin blair posted once for use with upgrading bags but it applies here
--function to use for the OnCreate recipe paramater when upgrading bags
function Transfer_Bag(item, resultItem, player)
local player_Inventory = player:getInventory();
local transferred_Items = {};
local dItem;
local texture
for i = 0, (item:size()-1) do
dItem = item:get(i);
if dItem:getCategory() == "Container" then
if player:getClothingItem_Back() == dItem then
player:setClothingItem_Back(nil);
end
if player:getPrimaryHandItem() == dItem then
player:setPrimaryHandItem(nil);
end
if player:getSecondaryHandItem() == dItem then
player:setSecondaryHandItem(nil);
end
texture = dItem:getTexture()
dInv = dItem:getInventory();
newInv= resultItem:getInventory();
dInvItems = dInv:getItems();
if dInvItems:size() >= 1 then
for i2 = 0, (dInvItems:size()-1) do
invItem = dInvItems:get(i2);
table.insert(transferred_Items, invItem)
end
end
end
end
for i3, k3 in ipairs(transferred_Items) do
dInv:Remove(k3);
newInv:AddItem(k3);
end
resultItem:setTexture(texture)
end```
can adapt the code easily
Tried them all, they all looked the same.
And no luck with the TextureID settings, I can't call setMagFilter without getting an error
wow thnx
wow this is pretty long
getItems()
lol thats what iwas looking for i actually thought of this while afk cant believe i didnt test thnx alot
I noticed textures for items don't get messed up in the inventory - I forget what that UI element is called itemList?
Thanks, I'll give that a look
It does seem to be the magFilter from what I can inspect though
The vanilla item textures have magFilter=9728
And mod textures have magFilter=9729
Assuming thats an OpenGL enum or whatever the game is rendering with
Or I guess constants, since java enums aren't integer backed
I also think it's a matter of the java texture loader
Yea the inventory is just directly rendering the textures the same way I am
Oh that reminds me, you've been working on extending some debugging stuff.
Just a thought I've had a few times, but it would be awesome if we could clear the error log in the F11 menu!
it bugs me to no end that i need to scroll all the way down to see the error i actually need to be looking at
it sort of makes sense for debugging in gameplay, but for active development it's just confusing to have old errors lying around
ow man my context menu isnt showing up

ahh cuz i was editing the backup file
omg
Me: Attempts to add clear button to error log but also introduces an error
The error log:
hey guys, quick question, how do you log/debug tables?, i just print(table), but i cant get any readable info out of it
I'd suggest putting a break point down with the table in-scope and just inspecting it
bags doesnt get wet?
otherwise you can do a quick
for k,v in pairs(table) do
print(k..':'..v)
end
yeah, bags aren't really clothing items so most clothing stuff doesn't work properly on them
You can inspect variables in the F11 debug menu when you hit a break point.
Or print using @bronze yokes code
@bronze yoke i thought of that but the log gets very large rather rapidly haha, @wet sandal i didn't know there's an ingame inspector, or is that a mod?
Launch the game with the flag -debug
prints are pretty slow too - you can maybe copy all the data into a variable and print it at the end
@wet sandal i have launched it with that flag
Its all in the F11 menu then
something like this, though i think the formatting can be improved a lot more than this - mostly the general idea of how that would work
local result = ""
for k,v in pairs(table) do
result = result .. k..":"..v..","
end
print(result)
Find your script by searching in the bottom right
double click to open it on the top right
Double click a line of code to place a break point
When you hit the break point the top left fills with your variables
Double click to inspect them
@wet sandal haaaa ok ok, got it. Thank you guys!
I have come seeking assistance again >.>
How would I remove everything from the loot tables for zeds, as well as remove clothing assignment from their sprite, so as to be able to then assign very specific items and clothing, globally?
I took a look at the workshop for existing similar mods, but they're mostly out of date (like.. 2017 out of date), or not quite doing what I need to do, so the Lua in them isn't what I need to learn from..
its done thnx @weak sierra
yup
require "DebugUIs/DebugErrorsWindow"
local og_createChildren = DebugErrorsWindow.createChildren
function DebugErrorsWindow:createChildren()
self.clearedAt = 0
og_createChildren(self)
local button = ISButton:new(20, 0, 100, 16, "Clear", self, DebugErrorsWindow.clear)
button:initialise()
button:instantiate()
button.borderColor = {r=1, g=1, b=1, a=0.1}
button.backgroundColor = {r=0, g=0, b=0, a=0.1}
self:addChild(button)
end
function DebugErrorsWindow:refresh()
local text = ""
local errors = getLuaDebuggerErrors()
local howManyToShow = getLuaDebuggerErrorCount() - (self.clearedAt or 0)
if howManyToShow > errors:size() then
howManyToShow = errors:size()
end
local start = errors:size() - howManyToShow + 1
for i = start, errors:size() do
local str = errors:get(i-1)
str = str:gsub("\t", " ")
text = text .. str .. "\n"
end
self.textBox:setText(text)
end
function DebugErrorsWindow:clear()
self.clearedAt = getLuaDebuggerErrorCount()
self:refresh()
end
i think the easiest way to do this would be to overwrite ZombiesZoneDefinition.Default with the outfits you want, and then make all the other members of that table point to default (or just nil them, if that makes the game use the default and doesn't just bug everything out)
That's actually what I've been attempting to figure out how to do, yeah aha
for loot you can change the SuburbsDistributions.all.inventorymale and SuburbsDistributions.all.inventoryfemale tables, and you can use SuburbsDistributions.all.Outfit_OutfitName if you still want specific loot for specific outfits
why are you a goddamn skeleton lmao
haha
looks great
i know people on my server who'd love this..
though i wonder whether it would work with attachment systems
could just tell them to not use attachments while hiding the bag tho.
Better question is who is robbing a skeleton
Probably someone that has a bone to pick with them..
They're simply looking for a skeleton key

....I'll see myself out lolz
hm I'm having a particular issue
I'm trying to sync lights in MP for flares
but sending the inventoryItem through commands doesn't seem to maintain it's location
this is my admin profile.. kinda RP in a way.. which is why im trying to build a zed mod (passion project)
i really want to be able to drag down players
you know the one that stops players and bunch of zed eats em
I had a fun idea for a mod. What about having the zombie infection spread through the rain and infected water? So zombies wouldn't infect you, but getting caught in the rain would.
What do you guys think?
Whats the counterplay? For Susceptible (airborne infection) we had gas masks. Wear raincoats and boil water?
Maybe I'm overthinking this all... my current flare system works based off recipes to light the flare - then the information is handed over to the server to handle the tracking -- it sends commands to client to spawn the light sources and sounds. The issue is you can hold some of the flare types while lit - and sending the flare itself over the command doesn't seem to maintain where the flare is
I recently discovered that I can enforce mod requirements through the mod.info file, but is there a way to enforce incompatibility?
that's an insane amount of net traffic ._.
Yeah I know, trying to cut down
i actually considered zombifying water for water goes bad but i couldn't really think of a way to justify it mechanically
transmitModData doesn't work if the item doesn't have a square tied to it as well
People keep enabling multiple version of Insurgent then complaining the mod doesn't work -_-
Not sure why the inventoryItem can get passed through commands but then has no container reference
you can call deactivate mod - I think you can shove a check into preluaload
or post lua load -and force them to reload the lua after deactivating it
just add a 'reloading lua cause you can't read' pop-up ๐
you can just not run your mod if a certain mod id is active (assuming your mod is something you can prevent with lua) but i think this is sort of annoying as long as we can't communicate it to users easily
would be a good feature for mod manager, or the community patch
are inventoryItem ID the same between client and server?
sending items across commands doesn't seem to be a good way to bridge information
oh no
Thats really bad for me
perhaps I'm doing something wrong as well
I store the grid data in the items
should be fine
I think when the item is on the floor is when transmission naturally occurs
my issue is I needed it while it's held
if it's in someone's inventory, does it even exist on the server?
kind of sort of
I probably need to refactor the flares system
make held flares work differently than on the floor or launched flares
Are you keeping them in the same workshop item or something?
is the wiki being rewritten right now?
Pretty sure Aiteron is working on it
well, long overdue, nice
I joined an in-progress mod, Insurgent, and refactored AWAY from multiple mod versions to an add-on structure.
Problem is that the people using the original add-on alternate version would have their saves broken if I just deleted it, so its sticking around for at least a month or so more.
I've renamed it in the mod menu DO NOT USE and the description details how to upgrade
But..
I see. You could probably use global variable flags to prevent double-loading if you're in control of all the relevant versions
Just add InsurgentVersionWhatever = true to the top of each version's file, and then in V1 you could say, "if InsurgentVersion2 then return end"
Love that this channel is like the self-help and emotional release channel about user stupidity
The mod is slightly to big for that I think, would turn into a load order race and there are many non-script assets.
That said, the idea could be applied to open a popup telling the user the configuration is invalid. So I might run with that...
"their our many" heck I'm tired
Wait, theres a way to ask if a mod is loaded by ID isn't there
getActivatedMod()
Perfect!
Almost... done... 
if i'm trying to get a specific number of items from players inventory as a condition, would something like this work? craftwire is my sandbox option using an integer
local Wire = inv:FindAndReturn("Base.Wire == "..SandboxVars.Nipswitch.Craftwire)
since I can't figure out how to do sandboxvars for required item # in recipe. i'm going to just have craft done via world context menu.
What exactly you want to do?
allow server owners to control amount of each item to craft recipe
x wire, x scrapelectronics
x is sandboxvar
i couldnt figure out using recipe script
So, player will can craft only X items, and then can't craft this item anymore?
no. like this
recipe Right Light Switch {
keep Screwdriver,
keep Wrench,
keep Scissors,
Wire=10,
ElectronicsScrap=25,
DuctTape=4,
Screws=10,
i want those to be sandboxvars
Hmmm
the wire amount scrap amount
i been trying 4 days
i was going another route to just find the items in inventory
and just add new context menu option but look for the items in inventory then just have the craft happen from choosing context menu but using oncreate or w/e
i already made workaround for using lightswitch outside of roomdef by using lightswitch like a lamp and increasing radius of light
this is where i got so far ๐
https://cdn.discordapp.com/attachments/1021900332709715968/1071365651324731442/java_sAjExCBfWz.gif
that is inside player base haha
getScriptManager():getRecipe("Right Light Switch"):findSource("Base.Wire"):setCount(69)
Try this
ok thank you for suggestion
mh is SetID() for items non functional in Lua?
I think it work
doesn't seem like it
So, I found out something... even easier, more straightforward...
function clearZedInv(zombie)
zombie:getInventory():clear()
end
Events.OnZombieDead.Add(clearZedInv)
does that actually work? i was under the impression their inventory didn't even generate until someone looked at it
Yep, it seems to work just fine. Killed several zeds with that active, and nothing in their corpse.
I suppose it's possible there's a microsecond where there's items in the inventory, and they are removed faster than you can even see, but I'm not sure because I had the function also print to console when each zed was killed, and it fired without me looking at it, so, maybe it's possible the call to grab the inventory forces it to generate?
huh! well that's good
All I need to do now is somehow swap their outfit to nothing.. can probably attach that to OnZombieUpdate
Well, more specifically, to a specific outfit. Haven't been able to affect that at all.
you can change their outfit onupdate but the performance is absolutely dreadful
i'd definitely try to mess with the zones to get them spawning the way you want instead of changing them after they spawn
Yeah, my log being spammed by the print I did during it certainly agrees with that haha
oh gosh, don't attach a print to an event that fires that much - my game straight up crashes if i do that, prints are incredibly performance heavy
Is it possible to create a new "type" of zed, or like, an outfit, and ONLY have the game spawn zeds with that outfit?
my guess is that messing with the zone definitions like i was talking about earlier would let you do that
lolz... luckily no crash, or even much of a slowdown, but it was intense haha... thousands of lines in a second or two. I immediately closed the game and commented that out lolz
Yeah, I'll take another look and see; might dissect AuthZ
local tick = 0
function samplefunction(var)
tick = tick+1
if tick==30 then
print(var)
tick=0
end
end
and if u use OnTick by default the parm is tick
Learned this from Burryaga
using mobile so no indentions
That whole thing about containers only spawning loot when a player looks at them is persistent misinformation. It might be the case when there's loot respawn, but that's just speculation on my part.
They don't generate loot until they're a corpse that has a container, yes.
oh right, i must've confused it with living zombies not having an inventory
i have some code to rewrite ๐
Containers aren't containers until they "exist", and that is generally the point at which they spawn loot, either as becoming part of a player's ~150 tile reality bubble, or cases like zombies being killed and the live zombie being replaced by a corpse that is a container.
i was generally aware of this, i just thought corpses were special for some reason - but clearly they're not
The misinformation re containers and loot spawn conditions is bizarrely persistent. I guess it's a case of assuming w/o following up with experiential evidence.
if you walk around a box clockwise before opening it, it will have a gun in it
No you have to walk around it 50x
Hahahaa
what happens is one person does something wrong, assumes that the thing they're trying to do is just impossible, and tells everyone about it
Yeah, that's a thing alright ๐
a word i try so hard to keep out of my vocab
that was basically the most common response a few months back
when the goto method of modding was browsing classes 1 by 1 
The game has some events like: OnZombieDEATH?
you only need to have a save and quit setup
I wonder how udderly did it
udderly didnt
Ow
udderly stops the server with lua
they use outside source for restart
yes
i just loop my .bat with it
I'm trying something like:
Events.OnZombieDeath.Add(function(zombie)
local x, y, z = zombie:GetPos()
-- spawns the specific item at the location where the zombie died
Object.Spawn("Item", x, y, z, {
Item = "Water Bottle"
})
end)```
GetPos?
i remember someone telling me that moddata could only store numbers and strings, and when i followed up on it i found that this had actually been true, and was changed in... 2013 
is used to get the zombie's position in the world, no?
reminds me of the 'you can survive a bite' thing
both object.spawn() and isozombie:getpos() are not things
check InventoryItem class' methods/functions
you can use zombie:getSquare() as spawning items can be done with a square as a param
You should def remove the old Brita version by the time you guys release the big update. Anyone who is still playing a save with it enabled is a shmuck 
If I add a condition to check for a type of item using the events onEquipPrimary and onEquipSecondary, just to add functionality to new items that I'm making, would this be a stupid idea with a high amount of traffic?
don't wanna @ him but Thank you again Aiteron. didn't even think it was possible to change items required for recipe using sandbox options so easily
in case anyone ever wants or needs
local function recipeAmounts()
local wireNum = SandboxVars.Nipswitch.Craftwire
local getScriptManager = getScriptManager
local switchRecipe = getScriptManager():getRecipe("Right Light Switch")
if switchRecipe then
switchRecipe:findSource("Base.Wire"):setCount(wireNum)
end
end
just my example but works very well.
seems to last the session
try a lower value that might overflow the type
@drifting ore very excited for this update :)
Me too haha very soon this week prolly
i showed users the gif up there and they are excited :)
๐ท buzzed modder gang
220 from 333 params translated 
guys the script is not running...
local square = zombie:getSquare()
local item = InventoryItemFactory.CreateItem('Base.item_id')
square:AddWorldInventoryItem(item)
end
Events.OnZombieDeath.Add(onZombieDeath)
Does the OnZombieDeath event exist?
OnZombieDead
"The death of one zombie is a tragedy. The death of millions is a Project Zomboid." (ะก) J. Stalin
working, but the item didn't appear when it died
item name not correct?
('Base.WaterBottle')
try this:
square:AddWorldInventoryItem('Base.WaterBottleFull', 0, 0, 0)
ayy
I tried another way and it worked, thanks guys
When using ClothingItemExtra/ExtraOption ("Hoodie Up" and all that jazz), is there any good way to get it to stick to the same "Type" (i.e., texture)? For example, you're wearing Type 2 of an item -- the second of its possible color options -- and you use the ExtraOption to swap to its sister item, and that sister item also appears as its Type 2 variant?
I've got a bunch of ribbons with different colors and I'd really like to avoid making, like, 15 different .xml files / items for each color and position if it's not absolutely necessary.
Why do server hosts have to such asshats
This is like the 16th request I've seen
for this mod alone
Iโm try to make a mod which extend metal working
I โam trying to add a recipe of turning 3 Accessories into workable iron using hammer
here is the example
keep [Recipe.GetItemTypes.Hammer], Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond=3, ;workable iron = ironingot in the game code Result:ScrapMetal=1,
The problem is now i need 3 of the same type
changing the code to the following will prompt the recipe to appear even if you have just one Necklace but will result in error because the insufficient amount...
keep [Recipe.GetItemTypes.Hammer], Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond, Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond, Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond, ;workable iron = ironingot in the game code Result:ScrapMetal=1,
so is there a way to make a code to use 3 necklaces of different types??
that would be a life savior
evolvedrecipe ironingot
{
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:Sandwich,
Name:Make workable iron,
}
like this?
i got a sandwish XF
sorry doing a lot myself haha
i'am following this guide
https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/scripts/README.md
thank you
wait
evolvedrecipe ironingot
{
keep [Recipe.GetItemTypes.Hammer],
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:Sandwich,
Name:Make workable iron,
}
its not working
Rude as f*
type also and other some other things
i think adding the hammer part is wrong
Get types isnt about module nippy
Its to get all the hammer like items
Like stone hammer and the other one with round end iforgot the name or modded hanmer (not sledge lol)
GetItemTypes.SharpKnife for example you might imagine theres alot of variation
Ow ok
Theres non.
They should add that as vanilla. I mean all the acc should be in one tag
oh fivehead move
result item hammer lol ๐ worst case lololol
I need a function that plays a base sound, example:
playSound("sound.ogg")
playSound, does it exist?
Where can I see a list of events/functions/methods?
if its base item and result item it should still be there after the craft haha
also if you feel like decompiling there is guides as well.
also searching files ๐
i would recommend https://projectzomboid.com/modding/ over zomboid-javadoc
package index
more up to date?
technically slightly out of date, but it has parameter names
ooo ty
it also has a tiny bit of documentation, but it's really really sparse
the parameter names make it way way way clearer what a method actually does and what it wants from you without looking at the source
i'm practically the blind leading the blind here so i appreciate it lol
btw what file should i reload using the f11 to refresh the new recipes... i already closed and opened the game 7 times...
it should show if it's all good
no it didnt show ๐ฆ
something not right
if you have the mod disabled on the main menu and enabled on the save, you can just reload the save
evolvedrecipe ironingot
{
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:Sandwich,
Name:Make workable iron,
}
i deleted the hammer but still no use
why are you using an evolvedrecipe? that doesn't seem to be useful for this kind of recipe
think it's possible to change the game's perspective from what it is now to 3rd person view?
metal sandwich why not? LOL
evolvedrecipe ironingot
{
BaseItem: Necklace_Gold/Necklace_GoldRuby/Necklace_GoldDiamond,
MaxItems:4,
ResultItem:ironingot,
Name:Make workable iron,
}
Mb
my suggestion is don't use an evolved recipe, use a normal recipe, unless there's some reason for it i'm not seeing
this
someone had a similar issue a bit ago, let me check how/if that was resolved
The tiles are 2d oso even if you shift the camera then the player and the items are the obly ones who would look ortho the world would still be iso
dang XD
If u want you can mod the whole world for that
You will become a legend among legends
wait
i think i know where i can find the answer
dismantling digital watchs?
doesn't that just need one watch?
oh nvm
i don't think it really was, they found something similar that worked for them but it was a food-specific solution
I just saw this post dated jan 26
they were doing something with berries and they could make it so that you need 25 total hunger worth of berries
I blue print already a thing?
this is b42
a mod with the size equivalent to a whole game
twice
Possibly bigger
somebody was working on it months ago, but i think they gave up on it
making a game out of the game's modding code
i guess i should too...
thank you for your time tho
you might be able to ensure there are 5 different items with an ontest function
Ye dont give up
Whats wrong
that idea floated around a few times but i don't think anyone wanted to actually work on it LOL
is there already an item in the game the recovers pain when applied to a body part that is feeling pain or is injured?
or only actual wounds?
the only workaround i'am able to think is to add each it separately
that's the same as setting it in the script
if you have one condition for 3 it only accepts three of the same type of item, if you have 3 conditions for 1 one item satisfies all 3
ahhhhhhhhhhhhhhhhhhhhhhhhh
all of them are Accessories
the only way i can think of doing it is having 3 conditions and just checking there is actually 3 different items with an ontest function
but then the recipe will still go ahead with the one item so you need to also use an oncomplete(? don't remember what this one is called exactly) to delete the extra items
i spose that doesn't seem too bad to try at least
i have a work around tho, but not optimal...
transforming each single Accessory into another new item
then 2 of the new item makes the workable iron
ooh that sounds good
but i really hope that the devs consider adding such command
or improve the recipe command
b42 is very likely to resolve this
i hope so
i just can't imagine a full crafting tree would never run into this problem
thank you for you time
and you too
np lol good thinking
YEEES ๐งโโ๏ธ! After 35 hours of work, after 332 parameters analyzed, after creating an article with analysis for each parameter - the Complete Item Script Guide is ready!
https://pzwiki.net/wiki/Scripts_guide/Item_Script_Parameters
@craggy furnace, @red tiger Can you check for mistakes in content or in spelling? โค๏ธ
P.S. I am dead inside 
Its 2:30 AM however I'll try to take a look at it this weekend.
i wish modders recieve the spiffo merch after a certain point ๐ courtesy of either steam or TIS. just a thought lol
my daughter would love that
Struggling with surviving the Project Zomboid apocalypse? Need a companion by your side to give you helpful tips and looks of encouragement, or to hug before you meet your inevitable demise? Look no further: Spiffo is here!Spiffo is the ultimate companion to every newbie survivor, with his trusty nailbat and a backpack full of beginner essential...
5073 sold
damn
SOLD OUT
Anyone have a guide which item script parameters work? Quirks / bugs list.
I'm an idiot, you're right
From the top of my mind
DisplayName can be manually changed by using setDisplayName (script value, DoParam don't work)
anim masks(?) can only be set inside script and not changed with DoParam
...
Yes these are facts polt
Idk abt the guide might eant ro check aiterons current work
I also faced the same problem last night with the doparams
Cuz it affects all while i just want to change and instance
Since i cant change the clothingitem param
I had to create a new bag
And replace the current bag just to fake the hiding thing
And just stored the original properties as moddata
So that you can toggle back
Un hide
@fast galleon
Im trying to make a simple function, that checks for a gun on equip and replaced the gunSound, I have around 3 days of reading material from zomboid so this may be extremely silly
Isn't gun sound a scripted value?
can i store png on the \Saves folder
and then the script items would still be able to use it as texture
I tried with a doParam earlier
Idk if am lacking something to triggering it but this is the file
Is GWP your mod or are you trying to patch someone else's?
It's gunsrunner mods the addon for VFE
I liked more when it had the vanilla sounds
But my patch on mind could in theory look to patch any mod without altering the original uploaders work
I think no
Save Our Station is finally updated and working in multiplayer again! https://steamcommunity.com/sharedfiles/filedetails/?id=2398274461
Has anyone tried changing the sound of the steps? Example of walking on wooden floors...
Like this other example of changing the sound of a zombie walking up stairs
What is the lowest number of ProceduralDistributions that we can set?
Value
I would like to set lower than 0.1
I believe steps are hard coded without an event or hook. Perhaps something easy to toss in @tame mulch
Iโll check it ๐
There's more than one footstep sound, the sound is probably a sequence, right?
I still don't understand how these numbers work, I tried to make it more likely to spawn, but it's still low.
Footstep sounds is hardcoded
I think you can only replace default sounds
How do I know what the defaults are?

I'm using the sounds from the media/sound folder
Try create "FootstepWood" sound and check if it will work. But not big chances on success
The sounds are banked, the loose ones don't replace the banked files. If a file isn't found in a bank it then looks for a corresponding sound script, if it can't find that it grabs a loose file with the same name
@tame mulch a footstep Hook as well as Event would be nice. Could do a lot of fun stuff with those two.
Also there's an event for player move -- you could theoretically make the default sound blank and force your own that way based on what's being stepped on.
I guess on player move is the appropriate event actually
But a Lua hook would let you bypass the vanilla methods
I changed the wooden door sound, maybe get the wooden steps... IDK
I believe you'd have to edit the bank files to change those specific sounds
I don't think vanilla sounds use sound scripts - but I could be mistaken
I have already extracted the .bank file from the desktop
I'm reading all .bank
Oh, carry on then
Eyo, does anyone have any experience working with the climateManager?
I'm trying to generate fog programatically, and it's working for the most part
but every ten minute tick the fog like, dips out and then comes back again
@tame mulch checked it, is perfectly legible
i'm not sure if it's conflicting with some vanilla function or if I've got a bug in my code but if it's in my code I'm at a loss trying to find it
great work
nice birb artwork
๐ it happens
Thanks for checking it before I did. Busy day.
i use extremely low and it works as intended.
local function nipswitchBook()
local list = ProceduralDistributions.list
local targets = { BedroomSideTable = .000000001, BookstoreStationery = .00000001, LibraryCounter = .00000001,
OfficeDeskHome = .00000001 , LivingRoomShelf = .000000001}
local item = "Base.Lightswitches_fordummies"
for k,v in pairs(targets) do
local items = list[k].items
table.insert(items, item)
table.insert(items, v)
table.insert(items, "Base.Lightswitches_fordummies")
table.insert(items, SandboxVars.Nipswitch.Bookchanceplace * 0.0000001)
end
targets = {inventoryfemale = 0.000000001, inventorymale = 0.000000001}
for k,v in pairs(targets) do
table.insert(Distributions[1].all[k].items, item)
table.insert(Distributions[1].all[k].items, v)
table.insert(Distributions[1].all[k].items, "Base.Lightswitches_fordummies")
table.insert(Distributions[1].all[k].items, SandboxVars.Nipswitch.Bookchancezombie * 0.0000001)
end
ItemPickerJava.Parse()
end
too much misinformation around how it works so i'd just do what works for you
use lootzed to confirm if it spawns ofc and the % and if you see an E in the value, then you know its EXTREMELY low lol
Thank you โจ
Busy bunch of days i had
Distributions should be a double iirc so you can use any number representable
what double?
binary?
no idea what it is lol
should be fp64 i think?
Also keep in mind chances are related with the sum of all items
all items in that container*
or def or however you wanna call it. had to get this confirmed by one of the devs also since i heard 3 diff theories ๐
don't really get how loot stuff has so many diff theories of how it works
yeah the same of that table
theres a bunch of wonky stuff going on
even i dont remember everything but i did read the whole code
zombie density in the area also affects chances
that's new to me
It's a double but it's also multiplied a few times
oh someone mentioned that also... i forgot about that
So there's probably some buffer room
the zombie pop affecting
Hello, I'm new to making mods and I wanted to make one to re-scale the game interface, for example when going from a default resolution of my monitor of 1366x768 to 1280x600 in the game the menu and the animated background move to the left but other items no. So I thought of making a mod to fix that. But I don't know if that's possible.
yes
if Rand.Next(10000) <= chance(modified by luck) * 100 * lootmodifer + zombiedensity * 10
This is what the loot chance calc was a while ago - may have changed
When my LTTS transpiler is competent, I'll resume work on the HTML UI engine.
unnecessary ) 
Even after reinstalling steam and deleting any game files
The (modified by luck) isn't pseudo code more of an inline comment
It's modified elsewhere
Oh lol
nvm, just a rofl 
function nextDouble() return Rand.Next(1000000000) / 1000000000) end
mmmm
I like me double coin flips.
same way devs say that clients don't load server folder ๐คทโโ๏ธ
*mistakes happen
do it
i think you need a better understanding of what server options are available before you suggest mods
whatchu mean
this is not the mod suggestion channel or debate about game mechanics channel... but i will only say this. most of your issue is with PVP balance which has already been explained that game does not revolve around pvp in its current form. your best bet is to learn how to mod for pz and learn how you can build a server to your liking
when you do that. you will be very pleased and feel rewarded ๐
even most of your concern though is addressed through specific server settings and a couple existing mods out there
i wouldnt say that
would you recommend some place that i can find some content of how to do it?
oh yes! much material for learning
also Aiteron is rewriting many of the pzwiki guides for modding right now
look at the threads up top
thank u very much
there is mod tool and links for all the good stuff
even some tools that help you decompile the game to see how things are done with vanilla game code
are you still doing that
zx = 1.2
zx:floatValue()
print(zx)
1.2
print(zx:floatValue())
1.2000000476837158
zx = zx:floatValue()
print(zx)
1.2000000476837158
interesting this converts to float but zx stays the same
So I have this array for random name generating, but it wouldn't work for some reason, like the event is not triggered properly.
local firstNameArray = {"Ivan", "Michael"}
local lastNameArray = {"Jackson", "Buba"}
local function GenerateName(player)
local firstName = firstNameArray[ZombRand(1, #firstNameArray+1)]
local lastName = lastNameArray[ZombRand(1, #lastNameArray+1)]
getPlayer():getDescriptor():setForename(firstName)
getPlayer():getDescriptor():setSurname(lastName)
end
Events.OnNewGame.Add(GenerateName)
However, when I type this code (without event) in the lua interpreter ingame, it works... Any suggestions would be appreciated.
are equip items like bags and weapons on hand considered to be part of the
getPlayer():getInventory()
so what do i do when i want to check i the polayer has a specific itemeither on his inventory or bag or equipped wherever
i see
how do i check for custom attachment locations then
imean modded attachment
are you looking for a specific type or specific obj?
like iterate over all possible attachments
a specific obj
or letsay objects that contain either one of the tags
item:getItemsTag("myTag1") or item:getItemsTag("myTag2") or item:getItemsTag("myTag3")
what you typed + :getItems():contains(obj) is a possibility.
let me check what the tags code is
containsTagRecurse(string) returns true / false
getFirstTagRecurse(string) to get item
these are done on the ItemContainer
if you have multiple tags maybe it's better to do
ItemContainer obj:getFirstEvalRecurse(function(item) return item:hasTag("myTag1") or item:hasTag("myTag2") end)
it's the type
this includes the hands right
test it ๐
ISWorldObjectContextMenu.doFillFuelMenu = function(source, playerNum, context)
local playerObj = getSpecificPlayer(playerNum)
if source:getSquare():getBuilding() ~= playerObj:getBuilding() then return end;
local playerInv = playerObj:getInventory()
local allContainers = {}
local allContainerTypes = {}
local allContainersOfType = {}
local pourInto = playerInv:getAllEvalRecurse(function(item)
-- our item can store fue, but doesn't have fuel right now
if item:hasTag("EmptyPetrol") and not item:isBroken() then
return true
end
-- or our item can store fuel and is not full
if item:hasTag("Petrol") and not item:isBroken() and instanceof(item, "DrainableComboItem") and item:getUsedDelta() < 1 then
return true
end
return false
end)
similar to this??
or no
whats the diffrence with getAll
small changes depending if you want just a bool, the first item, best item, all items
this seems right
yeh i just need a bool
ahh so playerInv:getAllEvalRecurse
includes the containers
outside
?
local function dakiBuffEffect()
local player = getPlayer()
if player:getInventory():getFirstEvalRecurse(function(item)
return item:hasTag("DakiWeapon") or item:hasTag("DakiArmorFront") or item:hasTag("DakiArmorBack")
end) then
local bodyDamage = player:getBodyDamage()
local stats = player:getStats()
bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - (bodyDamage:getUnhappynessLevel() / 4))
if bodyDamage:getUnhappynessLevel() < 0 then
bodyDamage:setUnhappynessLevel(0);
end
if player:isAsleep() then
stats:setStress(stats:getStress() - (stats:getStress()/ 4))
if stats:getStress() < 0 then
stats:setStress(0);
end
end
end
end
Events.EveryTenMinutes.Add(dakiBuffEffect)
this is what i have so far
@fast galleon what ya think?\
did i apply the code you gave correctly
or do i literally type how you wrote it
cuz i dont have an obj param
looks ok
any way to add a tile to spawn with trees?
say, in the same way that tileoverlays are spawned?
#mapping message
you mean this?
I'm running this clientside, by the way
Yes detect the tiles if its tree
Or isoTrees? Maybe thats aa thing i forgot
so you think i could hijack the tileoverlays checker to run my check for a tree, then spawn an object?

i will attempt this
i'm trying to add mining nodes
but i need a way to organically spawn them in the wildsโข๏ธ

Sounds expensive to do
the emperor wills it
Nice
if i recall tileoverlays are generated at the mapโs first generation so not too expensive
The audio could do better with a oittle adjustment cuz it its not sync with the pickaxe hit
itโs in dev

funny runescape sound
Ow gotcha
Anyways so you made the other mining mod
Mines crap anyways
mine is yet released
Ah so it wasnt you
I would definitely have noticed it if it was you
@fast galleon is there an event or something i can use for checking when a player places items in the world
I mean the rightclick place
The drop item isnt the same i think?
Does anyone know the best way to programmatically control a zombie's clothing? The following snippet doesn't work:
local soleClothingItem = InventoryItemFactory.CreateItem('Base.Jacket');
local desc = SurvivorFactory.CreateSurvivor();
desc:getWornItems():clear();
desc:setWornItem(soleClothingItem:getBodyLocation(), soleClothingItem);
targetZombie = createZombie(x, y, 0, desc, 0, IsoDirections.S);
targetZombie:DoZombieInventory();
I looked at the bytecode for LuaManager#createZombie, and it seems the 'desc' parameter is completely ignored. So what's the proper approach?
i think you can just do targetZombie:setDescriptor(desc)
it might be easier to use targetZombie:getDescriptor() and modify that but it depends on your usecase
Alright, I'll give that a shot, let's see...
the one where you rotate items?
No go. I found 'dressInClothingItem' and that didn't work either.
ISPlace3DItemCursor -> ISDropWorldItemAction, not sure about events
zombie:dressInPersistentOutfit(string)
zombie:dressInNamedOutfit(string)
zombie:clothingItemChanged(string)
@fast galleon So it's not possible to programmatically create and add a piece of clothing?
haven't tried that
didn't notice you wanted that, sorry
IsoZombie extends IsoGameCharacter so maybe you can use setWornItem
basically what you did, just add it directly to the zombie
I did that, and no dice. It's like any zombie made with createZombie cannot have its clothing changed.
yes
the code earlier didnt work btw idk why
il try to fiogure it out using debug
anyone have a good way of adding context menus or sub menus?
I use AuD as template for context menu
OK, it looks like I can achieve it by creating a named outfit and using addZombiesInOutfit()
I managed to add an Item but it doesn't save, you're much better off using outfits ๐
Anyone know offhand whether it's possible to add tooltips to clothing, or is that reserved solely for proper "items"?
will be feature to dig without using context menu like for trees (just attack it)?
Where there's a will, there's a way
Items have a tooltips param for scripts if you just need a single line of text
does anyone know if there is or if anyone is working on fish tanks as either just for show or to store fish in and keep as pets ?
what is the first event that happens when player data is available by chance, if anyone knows?
OnNewGame worked for my case
In case you didn't see this due to timing. @limber oar
Is there any global data namespace between server and client, aka getModData but not tied to specific object?
I think not.
There's global modData
Pretty sure you need to use server-client ping pong to communicate between server and client @nova socket
But that is not global between server and client without transmitting it, is it?
I mean there is an easy transmit function
There's events for receiving modData
Right I don't think that's what he meant but I suspect that works for what he's probably trying to do
It's not very simple/easy to implement
Simple as is to keep join-in-progress data between client that were in-game and weren't without re-transmitting it on each N time.
I have it go one way to clients and have commands to alter server side
Its not about clients altering anything its about them getting state of existing data after they re-connect into existing game
Server has a bool, bool has a state, players come and go but I want to know if all of them keep the same state of that bool.
But I might just transmit it on connect event
Oh I see a solution ModData has
static request(arg0: string): void;
static transmit(arg0: string): void;
So you can both transmit and request data from it.
anyone know what moodle is affected by sleep
What you mean by what moodle is affected by sleep? in which sense?
what stats
like i want to control the sleepiness of a player
im not sure if its fatigue endurance or what
i bet its fatigue
yep got it
i actually foun dit but i cant find the mutual of night owl
cuz i dont know what its called
Nightowl doesn't have a mutual exclusive trait
NeedsLessSleep
NeedsMoreSleep
Insomniac
Those are the sleep related traits that have mutual exclusive between them
i cant find what night owl does to be honest maybe its jhava?
thnx
if getServerOptions():getBoolean("SleepAllowed") then
-- somewhat counters sleepless traits effect by adding more fatigue but only uptil 0.8
if (player:HasTrait("NightOwl") or player:HasTrait("NeedsLessSleep") or player:HasTrait("Insomniac") ) and player:getStats():getFatigue() <= 0.8 then
player:getStats():setFatigue(player:getStats():getFatigue() + 0.01)
end
-- same as above but without the limit
if player:HasTrait("NeedsMoreSleep") then
player:getStats():setFatigue(player:getStats():getFatigue() + 0.01)
end
end
Going to put in 2ish hours of work on my transpiler tonight. =}
Going to do another code jam this weekend.
Going to be for PZ modding. <3
Aiming for 15 hours min
ya so my menu will get done? lol
Is there any function like: local x, y, z = player:getX(), player:getY(), player:getZ()
I need the location of the player so that the WorldSound function can play the sound in the correct position in the world
I'm using GetWorld():WorldSound for a test
if you want to play a sound at the player's location, the player object has an emitter you can use for that
function xyz(player)
return player:getX(), player:getY(), player:getZ()
end
-- Example: local x, y, z = xyz(getPlayer())
Now there is.
I don't know if it's only because I was teleporting, but I had to use the world sound manager for other players to hear my jump.
Hey everyone, I have a silly question.
Did the devs change how recipes work? I'm having recipes that have multiple combinations that used to work in the last last patch. Now the recipe will "work" with even 1 of the items and produce an error when activating. The crazy recipe is bellow...
does the WorldSound function of the GetWorld object exist? is returning me (nil)
all i can ask is... are you sure it worked?
It works if I have 10 of the items
Still allows me to execute it if I have 1 of the items, but it produces an error
i've seen this exact issue a couple times in here over the last six months or so
recipes just don't support this unfortunately
