#mod_development
1 messages Β· Page 8 of 1
Hey guys this morning I was a bit self-brainstorming..Don't you think we miss a mod about these flying guys? LOOL π
( Ignore the 2020 writing I'm referring to the baloon )
We got choppers and jets I think it could be done in some way π
maybe something like a very very slow passing jet ( First guess come to mind )
Just eye candy I guess
You mean it attracts zombies and moves slowly along the map?
- what you wrote
Because I can imagine it attracting a large horde that then wanders accross a certain path
exactly
..and with that thing slow it will attract zeds for a lot of time
We need something even more nasty than the EHE events LOOL π
Can you guess a horde of angry sprinters going straight for your general location? Nasty indeed, I guess...
You can make your own events as as a sub-mod.
Oh that's very interesting didn't know about it, thanks mate! π
Np, it's always been advertised as a framework but I think only 1 person used it so far, so I wrote a guide to help along the process.
Never heard about it LOOL π ( I try to see if I'll can implement my idea )
Also, github is not friendly to lua, so if you have a editor try to get a lua plugin to see at least the annotation colors
ok, thanks
Np, lmk if there's any unclear points
Brilliant job both with the guide and the EHE mod! Keep up the good work!
Appreciate it 
will do mate, thanks for the tips, availability and kindness...Have a good day Sir!
Is it possible to change a zombie's speed?
I've tried speedmod, but that doesn't seem to do anything
Sry I know nothing about that :/
I have a question about modding practices.
I'm looking at Autotsar's trailer, and in media/lua/client/TimedActions\, iles in there seems to be some overwritting of vanilla base functions.
I understood it correctly right?
Is there things I should be aware of doing this? Obviously I dont wanna kill sone data stored in here and just add some features, but then is that harmless?
As you know when you put an item in the hotbar there's only room for 1 item per slot available...Any way to set the same item multiple times on a slot?
I mean...Let's imagine I have 7 bananas and I want to put all of them in my vest ( Let's say simulating a vest that has multiple pockets )..Is there any way to put all the 7 bananas on a single hotbar slot? ( For example Vest Right ) or we are forced to use only 1 item a time/per slot?
My only guess so far is this...Take a banana ( for example ) edit it so it can load a clip and then using the other 6 bananas left as a sort of bullets to reload ( Obviously wiithout going around with a banana shooting banana bullets LOOL π )
So in the hotbar it will display the banana icon and below something like 6+1
Gotta to try if feasible...
In the case you'll see someone pointing a gun-banana at you, don't worry, it's just me modding LOOL π
Yes, but you are fixed to the prescribed speeds. Open up Super Weird Helis to see an application of unique zombies with speed different to settings.
Does all furniture share an objectType?
Thank you very much, I'll check that out π
Is there a way in lua to load an outfit? I tried getAllOutfits(), but this only gets me a list of names...
I think I need an outfit object to apply to the humanvisual of a zombie to dress it in a specific outfit
Or should I apply individual clothingitems to a zombie instead?
Hey, question on mods, client/server and saves. Trying to understand some interactions.
Is it a good approximation to think that:
if my mod is pure clientside .lua (eg no map) and never use lines such as newObject:transmitCompleteItemToServer(); ,
then modded saved games will run even if mod is disabled when loading ?
Can I edit default item sprite with a mod?
yes you can re create it and overwrite it I think
you add your custom sprite and change its sprite name when you copy/paste the item .txt line
(and then there should be a few other steps if you wanna change their clothing properties, aka how they are shown when used)
For example I just want to edit diary's icon in inventory and it's 3D model
Of course, I'm not that stupid
(I guess, I'm thinking for the next steps)
I just didn't work with PZ before
then you have multiple options and I4m not an expert ^^
what's longer and will work for sure is to create your new diary and to change the loot distribution (you replace the basic diary with yours)
what's much shorter (but might involve problemsn I'll let other reply) is to redefine base item guid table (that tells the game where icons and textures are located)
and as I told, overwrite the .twt file defining your item.
to check how to define an item ( @lusty nebula told me all about this), go to base game / media/scripts/NewItems.txt and look a bit whats in there
then, in media/lua find a file with that should be guidtable.lua and see how its linked to the .txt
I have some programming experience, I think I'll understand
ho ok then I'll send you something
Thanks
@opal stag MP
Oh thank you! Apparently I need to get in the habit of checking the lua and Java files before I bother discord. This is like the 3rd time Iβve asked about something I could of found myself haha
^^;
Hey, I probably have the same thing.
If you can't find it, then you might as well ask and see if someone has an answer ready, if not, you continue searching π
When you right you right π€·ββοΈ
π
I've spent the past hour or so trying to figure out how to apply an outfit to an already existing zombie xD
Oof. Yeah. That sounds like a doozy haha. Have you check out Authentic Zβs code?
Hey, anyone knows in which order PZ will read our .lua files of media/lua subdirs ? Like, does it always start with /shared root lua files?
(its for log and boot issues)
You can check the log file to see the order
According to a Modding guide:
https://github.com/FWolfe/Zomboid-Modding-Guide
media/lua/shared/
Used for lua scripts shared by client and server-side logic. These are the first Lua scripts that get loaded.
media/lua/client/
Used for client-side scripts. UI elements, context menus timed actions and the like. These get loaded after any 'shared' lua scripts.
media/lua/server/
Used for server-side scripts. Item spawning, core farming, weather and other server-side events. These only get loaded when the game is actually started (loading a save, starting a server, etc).
thanks mate, I didnt knew that guide!
Exactly what I needed!
you're right I'm doing that also π
π
@quiet nebula in the same modding guide I just posted there looks to be a section on adding clothes to zombies, not sure if it will help. About half way down the page https://github.com/FWolfe/Zomboid-Modding-Guide/tree/master/clothing
Nice! I'll check it out!
That's for adding clothes to the game in general. I want to apply clothing or an entire outfit to an already existing zombie
Ooo, okay. My bad! I'll look more into it next time before I post something!
But it looks like I might have to rework the way my mod chooses what zombies become special zombies ^^;
It might not be possible to do what I want to do
Don't worry about it, it was a good pointer, you didn't know what I was looking for specifically π
I did tho, you mentioned it earlier lol. I just saw "clothes" and my brain was like "ooo that sounds relevent share it" without any further though lol
Anyone know where I can get the character model skin? Like the actual face and whatnot
Would something like this be possible?
print = function(...)
if DEBUG then
tmpprint(...);
end
end```
If I want to override `print(...)` to put a debug variable check in 1 place, instead of everywhere I want to print info?
I should probably read up on how setmetatable works, because I think I'm attempting to use it for stuff it's not intended for π
I don't think I quite understand what it does or what a metatable is
can't you just monkeypatch the print function normally. without needing the metatable?
im not sure if the print is somehow a special function though, that would prevent that
from my understanding meta tables are like the dundermethods if you are familiar with them from python. you can modify the metatables to modify how operators like the plus sign or minus sign works when they are used with that table
is there a list of AnimNode's anywhere?
for example
what other ones are there?
thanks!
Ohh, I didn't know it would work like that, I thought I'd just overwrite the previous pointer. Thank you π
Btw, is there a way to make it so a zombie can't attack anything?
I'm trying to find the logic for zombie attacks in the Java code, but I can't find anything that really gets me any closer ^^;
Would I need to do setTarget(nil) constantly?
That feels a bit hacky
Sorry I know it but ATM I have a mind lapsus...What's the file or string that determines in a clothing item if it can be worn over other clothes or not?
I remember a while ago there was someone here trying to do a similiar thing by making a mod for blind zombies that only react to sound. was a really hard thing to do. you might get some good help if you search back in this channel to get his name
Thank you, I'll try!
Did you ever figure this out? I am having the same problems too...
I'm still working on this, I'm considering putting all the mods in a single mod to avoid update issues, because I assume it's a problem with the mods being updated. It's a shit solution, but better than nothing
They've never worked for me, but I have also only started the server today π
But I added a bunch of maps (pretty sure I did everything right; put the Workshop IDs in WorkshopItems, Mod IDs in Mods, Map IDs in Map, and made sure to priortize dependencies > maps > all other mods) and so far the 2 places I can run to from spawn (Grapeseed + West Point Lighthouse) aren't there at all.
Ok remembered it..The BodyLocation thing...it's bad to get old and stoned.. LOOL π
Okay, so apparently clearing target makes a zombie completely stop moving. I should have expected this, but I was still surprised π
Same problem, this is only happening on the server tho, not in single player
You running dedicated server or through a server host?
I'm running dedicated
Dedicated
I found some guide that has some suggestions I haven't tried and I'm trying it now, but so far no luck yet.
This is what I'm following: https://steamcommunity.com/sharedfiles/filedetails/?id=2718469431
Guide image is accurate π
A bit counter intuitive ( and wrong IMHO )....Sweater is worn over TorsoExtra but Jacket over Sweater...So you can put a cloth using bodylocation sweater above your armor vest but your jacket ( that is worn below the armor vest ) will be worn above the sweater layer...
So basically instead of having the correct sequence Jacket --> Armor Vest --> Additional cloth, you get instead Additional cloth --> Jacket --> Armor Vest if you wear them at the same time...
is there a mod that lets you put maps up on the wall?
i like maps as artwork
so maybe instead of flags, there are the different maps that could go up on a wall
None that I'm aware of unfortunately
Anyone know how I could set the battery charge of a car battery? There's getVehicle():getBatteryCharge() but not getVehicle():setBatteryCharge()
can you share it? thx
Well I just went and found the recipe doc in the vanilla game files and just searched βAnimNodeβ within it. Will paste the file in here, one mo -
ok
thx
np!
what about you clear target and write something that control them with sound?
this mod if I understand correctly direct the zombies to the player with sound
I'm trying to make a magazine that makes you learn how to craft some custom armour
Is anyone able to offer a few tips?
Thanks π
media/scripts/items_literature.txt
there inside there are the vanilla magazines
Doesn't sound affect all zombies?
I only want to affect that specific zombie, not all of the zombies around
oh
The zombie itself is already generating a lot of sound, by itself
Every 10 seconds it generates sound in a 250 block radius
thanks will have a look π
Excuse me "SleepWithFriends" how to set this mod
sorry, I missed that part
I'd say try #mod_support , this is a channel for modding, not mod support π
Np np, thank you either way for thinking along! π
btw, i was rewatching the walking dead the other day, would be nice to make a mod where you wearing a "zombie mask" can stop them from attacking you but still able to attract them with sound, maybe of course giving a "expiration date" to the mask
How do I make these custom recipes require being read by a magazine first?
Because currently, you can just craft them from the start
NeedToBeLearn:true,
if i'm not wrong
in the recipe
recipe Make Wooden Cage Trap
{
keep [Recipe.GetItemTypes.Saw],
Plank=3,
Nails=5,
Result:TrapCrate,
Sound:Sawing,
Time:120.0,
Category:Trapper,
NeedToBeLearn:true,
}
for example
Thanks, will try that out π
and is there a way to make it
for example
tailoring level 3
or what other options are there to tailoring?
thanks again!
thanks!
SkillRequired:Tailoring=3,
Type = Normal,There are various types of items in Project Zomobid, below you will se each of them with a short description. Normal β A basic item. Drainable β An item that has a certain amount of uses before it's destroyed Food β An item that can be consumed by the character Weapon β An item that...
here for more info
tell me
just put a ";"
item HuntingMag2
{
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
DisplayName = The Hunter Magazine Vol. 2,
Icon = MagazineHunting2,
TeachedRecipes = Make Wooden Cage Trap;Make Stick Trap,
ReplaceOnUse = HuntingMag2,
StaticModel = Magazine,
WorldStaticModel = MagazineHunter2Ground,
}
for example
you are welcome
I don't know what I did
But I've managed to make it so every single print() now says ZombieVariety Debug at the start of it...
The mod I'm working on is called ZombieVariety. But I don't see where this came from
It could be because at some point I had this in my project...
print = function(...)
if ZOMBIEVARIETY_DEBUG then
tmpprint("ZombieVariety Debug",...);
end
end```
does anyone know the ids of furniture items? (couches/chairs/etc0
want to add a recipe using them but cant find their ids
good, I need help, when I want to start a game without mods in the click part I freeze the game but I listen to the character, what can I do?
Do you mean when holding the furniture in hand?
yeah
or would just "Base.Movable" work?
You would have to use base.movable but also use the lua parameters for recipes to figure out which kind of movable it is
how do you mean with that, Im not that knowledgeable (just know how to edit recipes)
recipe NAME
{
[FUNCTION]
keep ITEMTYPE,
Result:ITEMTYPE,
OnCreate:FUNCTION,
OnTest:FUNCTIO,
OnCanPerform:FUNCTION,
Time:30.0,
Sound:SOUNDFILE,
}
There's a lot more parameters for recipes but you can make one of the required items a function noted with []s
There's also 3 lua functions you can overwrite OnCreate/OnTest/OnPerform
wait, would be better to find the code of "dissasemble" and try to edit that?
Im trying to get planks from furniture without a hammer/saw (kind of like breaking them)
If that's all you want yeah, probably
Not sure if this is it, media/lua/client/Moveables/ISMoveableDefinitions.lua
seems to have scrapping definitions at the bottom
will check, thanks
np
Did you got any updates regarding this?
I gave up for a while and just got them working a few minutes ago. I did mess around with the instructions in that guide and IMHO the main secret seems to be moving the default maps to the end of the Map= list. The instructions say to make sure that Mauldraugh is the last one in the list or else no maps load. I don't know if that's true, but I followed it based on superstition and it actually seems to be working (for now).
Ah, okay, this is interesting.
Thank you dude.
Good luck! π I have no idea why it's working now and wasn't working before - but it is so I'm not touching it. π
Too bad that I already have the server up and some progress there, so I'll get in touch with the group and see if they want a hard or soft reset
maybe i'm wrong but probably that function is in here media\lua\client\TimedActions\ISDismantleAction.lua
https://www.youtube.com/watch?v=mjcZHU-ombg& Something something WIP, introducing more psychological horror to PZ.
I JUST REALIZED THAT THE EVENT ENDS DURING NIGHT TIME SO YOU DON' SEE THE TRANSITION FROM DARK TO LIGHT....... But I hope you get the jist of what is happening.
This mod is inspired by Silent Hill. Don't sue me Konami.
For once I managed to make a big mod that's not made up of spaghetti lua code
The features:
Adds periods of darkness in Knox County that could go on for days! Will severely limit your visibility, especially with fog.
Adds ambient sirens (and other noises) that go off when the darkness is coming!
Zombie lore can be changed when the darkness comes!
Experimental "Heavy fog" that appears thicker than normal in-game fog!
The darkness can also affect vehicles! They might become a bit unreliable during darkness.```
this is a bit too complex for my understanding 
for me too 
make it randomly kill 1 people
stay inside or die
I'd say having zombies' hearing change to super-hearing would do that anyway π
TV is also tiles, you might want to check out
recipe Dismantle Television
{
Radio.TvAntique/Radio.TvWideScreen/Radio.TvBlack,
keep [Recipe.GetItemTypes.Screwdriver],
NoBrokenItems:true,
Result:ElectronicsScrap,
Time:30.0,
OnCreate:Recipe.OnCreate.DismantleRadioTV,
OnGiveXP:Recipe.OnGiveXP.DismantleRadio,
Category:Electrical,
AnimNode:Disassemble,
Prop1:Screwdriver,
Prop2:CDplayer,
Sound:Dismantle,
}```
wait you can just use isomovables directly?
huh
item TvAntique
{
DisplayCategory = Communications,
Type = Radio,
Icon = Television,
Weight = 10.0,
DisplayName = Antique Television,
UseDelta = 0.014,
UseWhileEquipped = FALSE,
DisappearOnUse = FALSE,
TwoWay = FALSE,
TransmitRange = 0,
MicRange = 0,
BaseVolumeRange = 10,
IsPortable = FALSE,
IsTelevision = TRUE,
MinChannel = 200,
MaxChannel = 1000000,
UsesBattery = FALSE,
IsHighTier = FALSE,
WorldObjectSprite = appliances_television_01_8,
}
WorldObjectSprite
Why do I feel like not many things use this
if you just want to see a base item name, check out translation files in lua folder
I guess this was added when they redid movables a while back
that's really handy for recipes
and exactly what @wet osprey needed
These strings are not present in EN
I get them by using -debugtranslations
so you can't search the item name in English, but have to take a look in other languages translation files
oh I mean EN folder π
media\lua\shared\Translate\IT\ItemName_IT.txt
@wet osprey
check this file for your chairs
oh damn
wait, where are those item names?
media\lua\shared\Translate\IT\ItemName_IT.txt
there is a lot! alrighty this is an start
apparently, you can use Item List menu in debug mode, filter it with "mov_" to show 130 moveables
Hey guys, when I click on an tile in debug mod, with chunk debug enabled, I see on the left the list of all placed textures on the tile. Each of these texture comes with something tagged as an isoObject.
Do you know how to access this isoObject from texture's name and a IsoSpriteManager ?
No need to go through translation file actually since all items start with "Base" module π
Tilezed
idk, it way easier for me
isn't there a correspondance
not sure what you need though, sorry if I misunderstood π
between sprite
ok lemme be more precise please π
there must be a correspondance that is made (I guess, in the sprite manager) between
- the tilesheet's sprite as you linked
2)the isoObject (which have a more deep incarnation) on which I can click in game in debug mod (chunk debug, click on tile, check left of screen UI)
Exemple : place appliances_misc_01 in tileZed, get an isoGenerator ingame
(beeing a generator isnt in the .tiles file)
I think its a very nice feature to understand for mods
wait Im adding the "base." at the beginning, always do but still I dont get to see the option in game
recipe Dismantle Item
{
Base.Mov_BlueComfyChair/Base.Mov_BluePlasticChair/Base.Mov_BlueRattanChair/Base.Mov_BrownComfyChair/Base.Mov_BrownLowTable/Base.Mov_DarkBlueChair/Base.Mov_DarkWoodenChair/Base.Mov_FancyBlackChair/Base.Mov_FancyDarkTable/Base.Mov_FancyLowTable/Base.Mov_FancyTable/Base.Mov_FancyWhiteChair/Base.Mov_GreenChair/Base.Mov_GreenComfyChair/Base.Mov_GreyChair/Base.Mov_GreyComfyChair/Base.Mov_LightRoundTable/Base.Mov_LongTable/Base.Mov_OrangeModernChair/Base.Mov_PurpleRattanChair/Base.Mov_PurpleWoodenChair/Base.Mov_RedChair/Base.Mov_RedWoodenChair/Base.Mov_RoundTable/Base.Mov_SmallTable/Base.Mov_WhiteComfyChair/Base.Mov_WhiteSimpleChair/Base.Mov_WhiteWoodenChair/Base.Mov_WoodenChair/Base.Mov_WoodenStool/Base.Mov_YellowModernChair=1,
NoBrokenItems:true,
Result:Base.Plank=1,
Time:100.0,
AnimNode:Disassemble,
Sound:Dismantle,
}
Do you mind sending either here or in PM, your server ini file? So I can compare it to mine
Hey, one question. How do you test your local mods in MP?
seems like I point you the wrong way, you can drop TV on the ground, but not furnitures 
maybe not π
upload to steam but hide your mod from the public?
aah you're right, thanks
recipecode.lua
function Recipe.OnCreate.DismantleRadioTV(items, result, player, selectedItem)
local success = 50 + (player:getPerkLevel(Perks.Electricity)*5);
for i=1,ZombRand(1,6) do
local r = ZombRand(1,4);
if r==1 then
player:getInventory():AddItem("Base.ElectronicsScrap");
elseif r==2 then
player:getInventory():AddItem("Radio.ElectricWire");
elseif r==3 then
player:getInventory():AddItem("Base.Aluminum");
end
end
if ZombRand(0,100)<success then
player:getInventory():AddItem("Base.Amplifier");
end
if ZombRand(0,100)<success then
player:getInventory():AddItem("Base.LightBulb");
end
if selectedItem then
--print("Main item "..selectedItem:getName());
if selectedItem:getType()~="TvAntique" then
if ZombRand(0,100)<success then
player:getInventory():AddItem("Base.LightBulbRed");
end
if ZombRand(0,100)<success then
player:getInventory():AddItem("Base.LightBulbGreen");
end
end
end
end
please take a look in 'ProjectZomboid\media\lua\server\recipecode.lua'
ProjectZomboid\media\lua\client\Context\World\ISContextDisassemble.lua
I wonder which file determines that it is Radio.TvAntique and not Base.TvAntique ? π€
Run a server on my machine and join it through PZ
How would I have text or textures* on screen like this? (edited example image)
or which class would that be under
Why do I have the sudden feeling of wanting to add Sims 1 tiles to Project Zomboid?
Would it be possible to make a dark background map mod that doesnt hurt the eyes as much?
just make all the back ground a dark grey or something? This would be a huge QoL for me, I have sensitive eyes and my map hurts my eyes/head every time I open it. Not too much but certainly noticeable. I would happily commission someone for this if its possible? I'd do it myself but am not savvy like that. Any thoughts would be appreciated. Thanks Survivors. β€οΈ
can be done
the question is, you want to use it in MP or SP?@rough goblet
Is it possible to check if a square is visible to real player?
E.g. this square isn't visible:
cant seem to find my custom crafting item in the catagories
only in filter all
anyone know what's im missing?
metalwelding
SkillRequired:MetalWelding=3,
here @thorn cipher
same for the Category, it is Category:MetalWelding,
don't know why they put the name of the skill and the actual script different
Just SP would be fine, both would get more attention I'm sure.
For the modder
ok, basically the simpliest way is for you to modifiy this file ProjectZomboid\media\lua\client\ISUI\Maps\ISWorldMap.lua
and you have to modify this string
o.backgroundColor = {r=0, g=0, b=0, a=0.6}
this will let you have a darker map even on multiplayer
all i have is notepad, will that work?
yes
this value o:noBackground()
change in this one o.backgroundColor = {r=0, g=0, b=0, a=0.6}
sorry
i made the wrong screenshot
i dont seem to have the same file path as you
SteamLibrary\steamapps\common\ProjectZomboid\media\lua\client\ISUI\Maps\ISWorldMap.lua
you delete this o:noBackground()
just delete the whole line 728?
ahhhh okay
remember, you will have to do it every times the game has an update
how does the a= value affect it if i wish to tweak?
duly noted
r=0, g=0, b=0, this part is the background color in rgb
a=0.6 this one is the trasparency of the panel
if you change it it would became more dark but difficult to read
i think at 0.6 should be ok
nice, noted. thank you so so much Kratos. You are a gentleman and a scholar, a god among men.
haha, no need. you are welcome
My retinas shall remember this day. πππ
I ended up having to revert it because it glitched out my map mods
shouldve known
worth a try though!
maybe someone (or even IS) will make a dark mode map, with bright roads and poi's and forest, but a dark grey background. would be so sweet
What you mean?
ummm the map symbols were big black squares
both on mini and main maps
i assume from "extra map symbols" or possibly "draw on the map"
heres the pitch: modular sandwich building with mod compatibility with vegetables
and meats
i can do the modeling for it
itd be rlly simple n fun
a reason to bake your own bread n shit
HEy anyone knows what isoThumpable are?
anyone know how to add a custom image to a magazine cover?
Make a png file in the texture directory
Should be the icon:
Wait, you mean the icon in the inventory? Or the texture on the ground?
Hey!
I would like to add some Sandbox settings to adjust spawnrates of some zombie outfits.
So far the Sandbox settings do appear on a own page on the settings menu.
The problem tho is that this number wont affect the spawnrate, and makes them actually spawn not at all.
I copied that idea of putting the variable directly after "Chance" from "TheyKnew" but it also seems like it doesnt work at the first place in this mod as well.
Do i actually need to make a function which adds the number to the spawn chance?
This is the sandbox setting:
Try to print the SandboxVars that you are using and see if they are correct when joining the game. It may be not yet transmitted when this script is running.
It seems to be set right ingame since i have put a "100" in the sandbox settings
you did print this from the distribution file right?
so if that work, well great, but changing the value in sandbox options will require a restart as the distribution will be already parsed.
I just typed in "print(SandboxVars.UndeadSurvivor.PrepperChance)" in the console.
But i guess it might be the variable before it is transfered to the actual distribution file.
How can i print local variables of a lua file?
the same way, add print(your stuff) in your dist file
then load the game and check the console.txt after reloadlua has completed
Thank you.
Got a possible hint from the console txt.
Might be a translation problem.
But the actual value isnt printed there
Nevermind, had to add a keyword to find it.
But its not the correct number i added in the sandbox settings. It seems to take the default value i set in the settings.
I saw people complain that even though they adjusted the spawn rate to the lowest, it's still easy to find that custom zombie
You should try testing the original mod to see if it's working as expected.
Yea.
It depents alot on if you play solo, or multiplayer i guess.
In my solo runs i rarely see those outfits.
@low yarrow Ignore the translation thing...log is full of them and they do absolutely nothing
If you , for example, enable the Brita's mod you'll get a list of that translation errors long as half of the Bible LOOL π
True, it just clutters the log in the background π
In that case tho i actually put the translation file in the wrong folder, so that one is fixed now.
But hasnt fixed the wrong values of the distribution file
what's the issue?
It seems like the settings the settings in the sandbox settings are not transfered into the lua file for the distribution.
If i print the variables in the Lua file i only get the "default" value i set in the sandbox setting file which is "0,04".
So it seems like it kinda reads the sandbox setting as it gets the default value set in there.
But wont apply a new value between 0.01 and 100
@low yarrow Looking at the pics it seems you forget to set the values in the chance field
Sample:
table.insert(SLEOZombiesZoneDefinition.Default,{name = "SharkBlueSWATGasMask", chance=0.02});
It continues in the new line, scratched out it looks like that.
So the variable i set on top should be the chance.
Distribution are all parsed in IsoWorld.init() right before OnWorldInit event
you might want to try and add your distribution from within a OnPostDistributionMerge event.
Ah i see what you mean. Thanks for looking that up!
So i should add a event which triggers once after spawning
local function addMyDistribution()
--do it here
end
Events.OnPostDistributionMerge.Add(addMyDistribution);
it may work or may not i still dont know
i would expect the sandbox options to be transmitted already when the world is initializing
@thin hornet Can you write me a function or script that will make me reach instantly IRL? LOOL π
Reach what? lol
oh Rich?
Possibly the second one LOOL π
local function onRealLifeBoot()
while true do
getPlayer():AddItem("Money")
end
end
Events.OnRealLifeBoot.Add(onRealLifeBoot);
You may freeze tho
I was wrinting the same LMAO π
It worked! Thank you alot
oh nice!
Ok so now we got a rich Scavanger around? π
Thats how it looks now in case someone needs it as well:
That also looks 69ish as i have set that value.
So it is also percentual
by the way you can print in one line
print("Something: " .. tostring(value))
Alright, thanks!
it doesn't work. I'm still broke πΈ
me too
@thin hornet 2 scotch tapes in the inventory and you'll get fixed LOOL π
If anyone is interested into making PZ mods using Typescript, it's now possible with PipeWrench.
https://github.com/asledgehammer/PipeWrench/wiki
Here's a couple benefits:
- Full Java/Lua auto-complete
- Object-Oriented Programming, ES6 Class
- Easy mod and workshop compilation
- Typescript compiled into Lua
Don't hesitate to ask question if needed.
We are still writing documentation to make this even more easy to understand but if you look at the examples you'll see the benefits behind this project.
Anyone have any tips on where to look to alter how fast time is moving?
If you mean clock speed there is a vanilla Sandbox option for that
I lied
not sure if this is the right place to be putting this, but if anyone needs a voice actor for a radio show mod, I'm your man.
hey I am pretty new to modding and was following a tutorial for making a custom radio station but ran into this error and unsure what to do. can anyone understand whats going on with this?
You will learn a bit more about the error if you look into C:\Users\<USER>\Zomboid\console.txt
Okay, now I figured it out, a lot easier than I though. Just getGameTime():setMinutesPerDay()
Is there a way to disable spawn locations? Like with a mod or in console?
Like specific buildings
Not sure if I'm allowed to post this here. But I'm currently on a small team running a PvP RP KoS server. Suppose you enjoy creating realistic gameplay for players. Let me know, and we can have you fill out an application to join the team. We are currently trying to figure out what we will do with our economy.
How would one go about modding in new commands?
I believe you'd have to change the spawnpoints .lua file
This can be done purely server-side
Hi guys, does anyone know how to make a random output for AddItem? like player:getInventory():AddItem("Base.DuctTape","Base.Glue") --Player gets DuctTape or Glue
Oh
That means It should be like
Yee = Base.DuctTape/Base.Glue
player:getInventory():AddItem(Yee);
Something akin to:
random_items = ["Base.DuctTape", "Base.Glue", ...]
item_index = rand()%len(random_items)
...:AddItem(random_items[item_index])
(This is just a pseudocode example)
Thank you so much, Will try it now
I know its a very noob question but may I ask what does a rand()&len do..?
You take a random integer and use the modulo (%) operator on it with as right side the length (amount of items) of your random_items array
You may want to read up on modulo if you're unfamiliar with it. It's a handy operator when programming.
Thanks for letting me know. I gotta study modulo before editing Lua files.
Sorry I just started modding yesterday, I had no idea what should I study first
What is difference between table.insert(Distributions, 1, distributionTable);
and injecting directly into Distributions?
Also why not just
table.insert(Distributions, distributionTable);
(without index shift)?
I forgot, what's the code to give or remove a trait from the player lol
Anyone know if there is a way to make a weapon cause non-damage effects in pvp?
As an example, would it be possible to make a modded baseball bat that gave the target depression?
If you figure that out let me know because I've been wondering about that for a long time
I haven't really searched for an answer, but it would be nice to know
did you try adjust the weapon damage to 0 ?
not sure if it's possible to use negative integer
I havenβt played around with it yet, just curious. Would be really cool to be able to effect another player that way, since it would open up a ton of alt combat potential in MP
I might try to dive into it if I'm not being too lazy π
If no one answers you, that means we are not sure. You might try testing that while nobody confirms that yet.
Yeah, came up because I was thinking about doing a tweak to the existing boxing glove mod to make gloves that cause pain, maybe even using the muscle fatigue system as a sort of stand in for bruising, but actually do minimal damage
Yeah, I will be diving through what I can. Itβs 2:30am here, so itβs definitely a tomorrow issue haha. Just wanted to scratch the itch and ask before anything
Yes, you have to locate the coordinates of the building with the online map and after look for those coordinates in the spawnpoints.lua file of the server
for example @severe rapids
yeah you definitely could. not sure if you can add the effect directly to the weapon, but you can use a Onweaponhitcharacter event, and in the event check what weapon was used. then do what ever effects are appropriate
Why everyone writes "Build 41.65+"?
What is so important done in that version?
Do those mods that write 41.65+ update their mod recently?
Yes
that's usually when they last updated
or I guess they don't wanna change it for each version so it stays as .65+ until it breaks? /shrug
I would just leave it as the version number the mod was last updated for tbh
Hey guys,
I'm trying to make a clothing mod that includes a full body uniform with shoes but keep having an issue where the player gets scratched at their feet as if they're not wearing shoes.
I made a new Bodylocation and included in the "shoes" location as there is no such Bodylocation group that includes all body parts that I need. I also included shoes in the BloodLocation list but still the bug continues.
Is the feature where the shoe Bodylocation making the player immune to scratches hard coded to that specific Bodylocation? or can I also assign that property to my new Bodylocation
Even if I have disabled it, the game continues, when launched, to ask for the save to be in sync with Steam so I guess that is something that has been added by the devs..Anyone know where the file controlling this is located so to edit it to not sync the saves anymore?
Hello just a quick q
hopefully
I was wanting to work out on the True Music mod how many tiles away music can be heard by zeds
basically so I can find a reasonable volume to standardise all the music to
I was just gonna experiment with spawning zeds in but was wondering if there is a quicker method that can be achieved by just looking in the files?
Or would that be a bit of a blag to find?
Take in mind that the distance at which zeds hear sounds is also affected by their "cognition" and " "follow sound distance" parameters... π
so I guess you'll have to standardise more zeds behaviour than sounds...
Don't forget also that the character can be more noisy when moving if you select certain perks/skills
yeeea but the issue is with standardising volumes on the songs
So I guess there are several factors that contribute on how zeds are capable of hearing sounds
yea gonna keep them constant atm
dont have any issue with zeds current level of cognition
Just need a sense of how far this mod has set the reach of sound
somehow I guess that if you go through mod files you should find at least some hints ( sorry I don't use that mod )
just read the mod files
yea I assume its in there somewhere but Im not versed in these things so I get the feeling experimenting will be quicker than.
There isnt anything in there about that radius changing with volume setting is there?
That was my next experiment
vol comes from client i guess
yes see the image
RADIUS * volume
otherwise you can make all zeds deaf LOOL π
Yea it is
how many bars are on the radio vol
I was just trying to remember, im assuming its ten
Not 0.1 - 1?
Ah ok no worries
it does some funky stuff with the vol number tho
Surely cant be reaching 250 tiles at top volume?
can't read russian to understand
Yea no worries, youve already helped alot thanks
Until this time, I knew that seats with more than six seats could not be implemented. But I don't know why, but it seems works fine
Did everyone know about this?
Are there any mods that make the correct items appear on shelves? I just took a bunch of displays from the gun store but when placed in my base and filled with guns their models show jewelry instead.
hey there, i'm a bit confused about getting the exact syntax for something, if anyone can easily fix :
I have :
a java vanilla class vanillaclass with a method public void VanillaMethod(){ codehere involving this.Stuff}
In my mod, I just wanna make a custom class that is (basically) vanillaclasswith VanillaMethod changed.
I'm debugging, am I doing something wrong here?
local customclass = vanillaclass local function fun(x) newcodehere with x replacing self end customclass.VanillaMethod() = fun(customclass)
I think I got it, I have to change last line with customclass.VanillaMethod = fun right?
technically thats how you reassign a method yeah customclass.VanillaMethod = fun
but not sure if you can reassign a java method
java object are not tables in lua, they are of type userdata
I'd love to know about it later π
Well actually I think in my case I can do that, the class is isoGenerator, so it has a isoGenerator.lua with just mehod names, and the method is public. It should help right?
Thanks a lot again π
That IsoGenerator.lua file is generated from when you decompiled the source
it act as an "interface" to let your editor know of the properties/methods
I understood its just an interface, but I didnt knew it comes from decompiling π
But when the game run, there is no IsoGenerator.lua and a trying to overwrite userdata method will result into an error, cause we can only assign table in lua right
wdym
to what I've understood (the lua java compatibility thing) it should work
local generator = IsoGenerator.new(...);
print( type(generator) ) -- = userdata
wasnt expecting that
yeah unfortunatly
properties are mostly accessible through getter method right
javaObj:getCondition()
javaObj:setConfition(val)
yeah
yeah, but lets imagine you could overwrite a java object method.
then any mods or even the base game could break when trying to call that method
(for me that's only because game devs put some parameters to private and other to public, and build these methods using that, so we dont mess with everything too easily, but I might be totally wrong)
defo, for that I intended to do it locally only, but I though java allowed me to
but the real reason is that a lua function cannot replace a java function they are different thing
haaa crap
Still what do you want to do with the generator there might be an other solution to achieve what you want
yeah
I want to customize its update loop
remove fire condition, add a custom event when reaching 0 fuell...
all of that is done in isoGenerator:update()
so was expecting
local generator = isoGenerator.new(blabla)
genarator.update = rewrite isoGenerator.update without it and with trigger
would have allowed me to use vanilla mechanics to keep it updated
instead of recoding a loop that checks its updates
okay so technically the generator update shouldnt run if its unloaded
so you could intercept the generator in the LoadGridSquare event and do something to it there as its being loaded into a player surounding
taht a solution yes, thanks
originally I wanted to avoid something like this
to avoid having to keep track of all generator:update() in the game
its even worse, update() controls the sound played by the generator
so if I cant touch upate I cant change generator's sound π¦ can I?
yeah you cant
well thanks a lot for anwers I wont search for nothing at least ^^
yeah π
Hello π
I am just learning how to make mods etc, mainly by looking at existing mods, and I have a problem. I'm pretty sure it's something simple and stupid but I can't find it >_<
I made an item, a "cure". So I made a recipe to inject it and it has OnCreate:recipe_InjectRemedy
In my lua/server I made a function beginning with function recipe_InjectRemedy(items, result, player)
But when I use the recipe I got a "no such function" message. What did I do wrong ? π¦
can you show the lua file ? contain recipe_InjectRemedy
@thin hornet if by chance I can have access to a moment just before a generator gets updated, for every updates, Then I could temporarily rerout what 'generatorloop'means in the soundmanager right ?
thoses files are in the server directory of your mod and you reloaded your game right?
Basically, this is meant to be a "false" remedy that turns you "half zombie". It heals the infection, prevent future infections, makes your meat infected if eaten by cannibals (I got this part right), and if you test your blood with the vaccine or antiserum mod it has a positive result. It worked when I first tested it and now it wont u_u
yes
post the error log please
try avoid global function and objects when you can
the recipe function is one case that must be global
oh okay, thank you π
playerBody inside SecondDeath is not declared inside the scope
Also the error log with lines numbers will help know a bit more about what is really going on
Make yourself a favor and check logs from C:\Users\<USER>\Zomboid\console.txt π
I have so many folders open it felt easier xD
Initially I had one but it gaves me the same message "=" expected near "=" :/
not sure why but also playerdata should be local, is LabRecipes_CurePlayer inside that server folder too?
whoops, LabRecipe is in another one, I copied it under the name Remedy_CurePlayer, corrected it π
Okay ill give you a tip
- Create a file inside
lua/shared/YourModID/Remedy.lua - Add you functions that might be used anywhere in it
local Remedy = {};
function Remedy.doSomething(player)
end
return Remedy;
- Inside other script that need to call function just import that file
local Remedy = require("YourModID/Remedy");
Remedy.doSomething(player);
Thank you π
So you make a collection of useful functions into shared and its usable anywhere else when required
I could even use it to call a function from another mod if it has the first file in it ?
For your recipes lua code its usually a good idea to have a global object containing your functions so that you do not have bunch of global functions
lua/server/MyModID_Recipes.lua
MyModID_Recipes = {};
function MyModID_Recipes.InjectRemedy(items, result, player)
end
script/MyModID_Recipes.txt
...
OnCreate:MyModID_Recipes.InjectRemedy
...
Thank you so much, i'll try that π
If your other mod require the file it will work yeah
othermod
if not getActivatedMods:contains("MyMainModID") then return; end
local Remedy = require("YourModID/Remedy");
Remedy.doSomething(player);
great, thanks π
when you run LoadGridSquare and find the generator, add it to a table
in a tick loop
-> check if its nil, remove it if true
-> do something with it
local loadedGenerators = {};
local function onLoadGridSquare(square)
local generator = ...find generator object logic here...
table.insert(loadedGenerators, generator);
end
Events.LoadGridSquare.Add(onLoadGridSquare);
local function updateGenerators()
local toRemove = {};
for i = 1, #loadedGenerators do
local generator = loadedGenerators[i];
if generator then
-- do something this tick
else
table.insert(toRemove, i);
end
end
for i = 1, #toRemove do
local index = toRemove[i];
table.remove(loadedGenerators, index);
end
end
Events.OnTick.Add(updateGenerators);
something like that, keep in mind the generator will most likely be loaded on multiple player clients.
also generator sounds are playing local to the player playSoundLoopedImpl
you can get its sound emitter with ```lua
generator:getEmitter()
Hi guys, does anyone know why this item_index not working..?
TestItemlist = {"Base.DuctTape","Base.Hinge","Base.Yeast"}
item_index = 1 % 3
function OpenTest(items, result, player)
player:getInventory():AddItem(TestItemlist[item_index]);
end
Thanks for these lines, they'll help to add custom update on the top of regular update. I'll see if I Can locqlly change what 'generatorloop' sound means for clients then !(except if you tell me I cant :D)
well the generator update loop does this
this.emitter == null || !this.emitter.isPlaying("GeneratorLoop")
so technically it will be impossible to change that sound unless it has the same name GeneratorLoop
What are you trying to do ?
Oh so when I destroy OpenTest, I should be able to get one of "Base.DuctTape","Base.Hinge","Base.Yeast"
but some reason I always get DuctTape only
print(1 % 3) always return 1
o/
So you want to return a random item right?
Oh yes
Oh, hi
Oh hi
ZombRand(1, #TestItemlist + 1)
ZombRand
param 1 = min (by default start at 0)
param 2 = max (non inclusive) so if its 3 the max will be 2
Oh ZombRand
it does
Anyway, random question
Thank you so much, will try it now
Can I add new commands through a mod?
What kind of command
And can I access an SQLite database (or REST API) through LUA?
Like, easily
As a mod
Trying to link my Python bot & a mod to check player stats for achievements, discord badges & in-game rewards.
local TestItemlist = {"Base.DuctTape","Base.Hinge","Base.Yeast"} -- use local so that it doesnt clutter the global domain
function OpenTest(items, result, player)
local index = ZombRand(1, #TestItemlist + 1);
player:getInventory():AddItem(TestItemlist[index]);
end
Does LUA have decent networking functionality?
So between 1 - (4-1) will be selected
With timeout handling?
i think the best you can do it GET
getUrlInputStream
The mod grabs the account name when the player logs in to character creation, checks if they get any additional trait points by querying the REST API through a GET, and adds any additional points.
youd pass data as url param
Aye, I've worked with web dev
Just never LUA
And this wouldn't cause issues as a mod?
@LuaMethod(
name = "getUrlInputStream",
global = true
)
public static DataInputStream getUrlInputStream(String var0) {
if (var0 != null && (var0.startsWith("https://") || var0.startsWith("http://"))) {
try {
return new DataInputStream((new URL(var0)).openStream());
} catch (IOException var2) {
var2.printStackTrace();
return null;
}
} else {
return null;
}
}
should work right
at character creation ?
Aye
ZombRand(1, 4)
-- Possible results:
-- 1
-- 2
-- 3
Just test and its working. Thank you so much..
Had no idea how to use ZombRand
local success = 60;
player:getInventory():AddItem("Base.ElectronicsScrap");
if (ZombRand(0,100) < success) then
I thought ZomRand only had 2 results.
like true or fase
btw for formatting your code in discord (using 3 backtick)
I can't type ` manually, it's language change button. Have to copy from somewhere else π
Couldn't you change your keybinds?
nope, it's standard key for Thai layout
get a querty keyboard
remind me of traveling with my keyboard when ever i will travel
@pulsar rock
local stream = getUrlInputStream("https://google.com");
local str = stream:readUTF();
stream:close();
You cannot add custom command like the admin command with just vanilla but there is a java mod for server only that does allow to create custom commands
How would I parse json?
Okay, I set the macro to insert ` on my keyboard. Thank you for reminding me of this.
Is there a string to dict parse function?
@pulsar rock you could include the lua json lib to your mod
https://github.com/Konijima/PZ-BaseMod/blob/master/lua/shared/MyModName/Libraries/Json.lua
would be nice to have a java json encode/decode function natively
there is a JSONObject used in the java codebase but nothing exposing it
for custom commands there is:
a server java mod solution
https://steamcommunity.com/sharedfiles/filedetails/?id=2825060402
a lua only solution here (updated 6 month ago)
https://steamcommunity.com/sharedfiles/filedetails/?id=2739440696
i only tested the java one and works with rcon
I did a bit mofity this.
local index = ZombRand(1, #DiamondItemList + 1);
local success = 80;
if ZombRand(0,100)<success then
player:getInventory():AddItem(DiamondItemList[index]);
end
local index = ZombRand(1, #DiamondItemList + 1);
player:getInventory():AddItem(DiamondItemList[index]);
end```
cool, you dont need to add local to the second index variable.
this will reassign the one already declared
function OpenTest(items, result, player)
local index = ZombRand(1, #DiamondItemList + 1);
local success = 80;
if ZombRand(0,100)<success then
player:getInventory():AddItem(DiamondItemList[index]);
end
index = ZombRand(1, #DiamondItemList + 1); --- already declared we just set a new value to it
player:getInventory():AddItem(DiamondItemList[index]);
end
other than that this look good
YaY
Is lua sensibly slower than java ? Like, imagine the following (cant reality check : not home):
-All active generators are java-updated on tick,
-we can Events.OnTick.Add(stuff).
Question : if I define a lua isoGenerator:newUpdate(), then properly put: OnTick.Remove(vanillaupdate); OnTick.Add(newUpdate),
would it be a perf problem to run a lua on tick ?
@thin hornet I finished applying the changes you told me, now my function works π Thank you again for your help !
Great so now you have a more solid structure π
I use this kind of structure all the time
Lua is a bit slower then java, its being interpreted by java.
You cannot add/remove/replace properties or methods to a Java object (type userdata in lua).
OnTick runs every tick, no exception what you want to check is if triggerEvent("OnTick") is called before or after the things you are working with, in the game update loop. (java)
I've made a custom item, it has an OnEat function, when it's added into things like stews will the stews retain the same OnEat functionality?
Highly doubt that
I really didn't want to make duplicates of every single food item to create a custom variant 
That I understood from our last exchange, thats why I Ask. But lemme get home so I dont make it more prΓ©cise for nothin ^^
Zomboid modding moment
(yeah made a mistake in my question but question still exists^^)
local original_OnEat_TheItemContainingOtherItem = OnEat_TheItemContainingOtherItem;
function OnEat_TheItemContainingOtherItem(food, character, percent)
if original_OnEat_TheItemContainingOtherItem then original_OnEat_TheItemContainingOtherItem(food, character, percent); -- apply original func if exist
-- check if it contains the ingrediant or spice
---- apply the special stuff
end
I'd still have to add all the items to a script file though lol
Id try to look at stew recipe, Γ©dit it to add a test if your custom thing is ingrΓ©dient, and if yes, add ModData to the output stew, then search an Γ©vent that allows me to check ModData before eating
Actually yeah, that's not the most optimal solution but at least it doesn't require as many duplicates lol
Thank you both
right you could also just hook into function ISEatFoodAction:perform()
local original_ISEatFoodAction_perform = ISEatFoodAction.perform;
function ISEatFoodAction:perform()
original_ISEatFoodAction_perform(self);
-- do stuff
end
Can you dynamically add sandbox options based on what mods are active? Or are there any mods that already do this as reference?
Wait you can just modify events like that?
Too many things I still don't know lol
ya you can hook into anything that is accessbile and run the original plus your own stuff
Nice, thank you lol
lets say you didnt want to execute the original code for a specific item you could do this
local original_ISEatFoodAction_perform = ISEatFoodAction.perform;
function ISEatFoodAction:perform()
if self.item:getFullType() == "MyMod.Item1" then
-- do custom stuff only
ISBaseTimedAction.perform(self); -- dont forget to perform it like the original do
else
-- anything else do normal action
original_ISEatFoodAction_perform(self);
end
end
Thank you so much for helping me out. I successfully made a random looting box. Still can't believe its working
I was thinking about probably making an actual mod if I can manage to do it on my own.
The idea is to make the Artifact from Stalker into a mod.
Model each Artifacts with blender, simple sphreres I guess with textures.
Get them to do stats like healing, freezing, Burns, and all the shit with some coding, shoulnd be too hard?
And see the spawnings, I was hopping I can make them work with the Foraging system, the search one.
How hard is this from 0/10 scale If I never done it before.
lol nice
Can anyone explain me how I find the link between the sound file involved and this ?
sound GeneratorLoop { category = Object, clip { event = Object/Generator/Running, } }
What are you trying to do?
to replace generator's loop sound for my custom generator
its played during the isogenerator:update() java methode that I cant touch
game sounds are into .bank files
so my only hope is to change what this.emitter.playSoundLoopedImpl("GeneratorLoop") means for my generator
ok thanks, I'll google from that
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\sound\banks\Desktop
not sure if they changed that there is a lot of sound that are not into a .bank
yeah I already search these ones
and since the paths indicated is weird (event= somepaththatcorrespondtonothinghere) I guess I'll have answer in the .bank
module Base
{
sound GeneratorLoop
{
category = Object,
clip
{
file = media/sound/purringcat.ogg,
}
}
}```
I believe this should work
ok on next mod I promise all my generators will make purring cats noise π
I'm trying to unchange the noise of base generators
so, i'm not sure I can, but I really hope I can redefine like
function CustomGenerator.emitter.playSoundLoopedImpl(S) if S=='GeneratorLoop' then purringcat else CustomGenerator.emitter.playSoundLoopedImpl(S) end end
(because the loop playing generator loop cannot be touched and call that .emitter.playSoundLoopedImpl('GeneratorLoop') )
@thin hornet I just hope I'm not gonna get the same problem hitting java core ^^'
(I checked, playing in between updates seems impossible, its done at the cell level if I got this right)
Anyone knows if OnWorldSound triggers for any sound, or WorldSound are a category of sounds like alarmas?
Ho is world sound just the part that manage what moves zombies?..
Alright thanks for the help man!
you are welcome
Anyone know if there is the chance to increase the zoom level when you zoom-in on the character? ( So to have the camera a bit more closer to the character )
Ohh, I had not thought of that yet. That's a good one, I should have a look at the lua functions I could hook into, I might be able to find some interesting ones that will make my code less terrible π
Mh, if I have :
lua/shared/remedy with inside local Remedy = {}; -- functions return Remedy;
How can I call one of those functions directly from a script file ? I tried OnCreate:Remedy.functionname but it didnt work π¦
Also can I call it in mod 2 via a script too ? Or should I use it inside a server function and call this one in the script ?
so you can do:
(on other files I mean)
Remedy = require "remedy"
use Remedy:YourFunctions
...
(that was if your file is shared/remedy.lua)
if its shared/remedy/Remedy.lua, you'd do
require "remedy/Remedy"
so it would be OnCreate:Remedy/Remedy.functionname in my script file ?
ho
yeah, I manage to call it from other lua files but not directly from script :/
no, in anyway you'd need to use require
(sorry, cat stepped on my keyboard x) )
what are you trying to do with OnCreate:Remedy/Remedy.functionname ?
ho well
wait
I think I just understood
you want to call lua from a script file?
yes, but this function is in the shared folder instead of the server folder because I'm using it for 2 different mods
but, by script, you mean a lua script right?
yeah ok, so no problem. I think the mods are loaded one by one, so either you make sure IdontknowHow that the good mod gets loaded first
either you merge them but its a bit meh
Sorry english isn't my native langage so maybe i'm not clear enough ^^'
np ^^
Ooooh maybe it loaded in second, I'll check that, thanks
but once the two mods are loaded, they are all considered as in the same lua/shared folder
(just, when the first gets loaded, it cant read the second)
Thank you, I changed the order, I'll try that π
if I set fire on a square server side, with squaree:StartFire(), does it automatically gets transmitted to all clients?
you also need the require
in the script file too ?
I have it in lua/server in the file that holds most of the functions
Oncreate functions I believe need to be global unfortunately tmk as the script processor won't be able to find the function otherwise. edit: This is for those script txt files that are for recipes, items, and repair definitions.
you do like this :
File 1------------- (shared/folder/file.lua)
local ModuleName = {}
function ModuleName:DoACustomThingWith(that)
look, a custom thing with that!
end
return ModuleName```
-- ------------File 2 :
```lua
ModuleName = require "folder/file"
--Ho, I need to do a custom thing with that :
ModuleName:DoACustomThingWith(that)```
so you would need to have Remedy not be a local variable. You could always attach the oncreate functions to the Recipe object to store your oncreate functions to stop polluting the global namespace further. ie, attach your oncreate functions to "Recipe.Oncreate.YouModName.OnCreateFunc"
Thanks, that's what I have and it seems it worked π I only changed the loading order. So now I can try to call this function from the other mod π
What would be misconfigured in a mod for a weapon's category to display as this? DisplayCategory looks to be configured fine.
Anyone know if starting a fire serverside starts it for clients?
is there an easy way to get lua console serverside? running a dedicated server
How are weapon repairs handled? Like what determines giving me 50% repair or 25%?
did you ever publish this mod?
public static double getCondRepaired(InventoryItem item, IsoGameCharacter character, Fixing fixing, Fixing.Fixer fixer) {
double var4 = 0.0D;
switch(fixing.getFixers().indexOf(fixer)) {
case 0:
var4 = 50.0D * (1.0D / (double)item.getHaveBeenRepaired());
break;
case 1:
var4 = 20.0D * (1.0D / (double)item.getHaveBeenRepaired());
break;
default:
var4 = 10.0D * (1.0D / (double)item.getHaveBeenRepaired());
}
if (fixer.getFixerSkills() != null) {
for(int var6 = 0; var6 < fixer.getFixerSkills().size(); ++var6) {
Fixing.FixerSkill var7 = (Fixing.FixerSkill)fixer.getFixerSkills().get(var6);
int var8 = character.getPerkLevel(PerkFactory.Perks.FromString(var7.getSkillName()));
if (var8 > var7.getSkillLevel()) {
var4 += (double)Math.min((var8 - var7.getSkillLevel()) * 5, 25);
} else {
var4 -= (double)((var7.getSkillLevel() - var8) * 15);
}
}
}
var4 *= (double)fixing.getConditionModifier();
var4 = Math.max(0.0D, var4);
var4 = Math.min(100.0D, var4);
return var4;
}
AH YEAH I just looked it up
Thank you
Theres really not much interesting you can do with that then ?
You cant change these default values but you could add more or less condition from hooking the ISFixAction Perform method
Ye. I was wanting to see if I could treat repairs like a crafting recipe
Like have it require certain items but not consume
Oh you could totally do that
Like can I use "Keep" in the recipe
I think a mod is conflicting right now so its not working for me
yeah the require item to fix use keep and consume the other stuff needed
Going to turn some off
Ahh yeah thats what I tried but I think one of my mods is breaking my game
you can use OnCreate to apply the repair and RemoveResultItem = true to not give a result item
Oh yeah good idea
OnCanPerform to check the condition is not full
mhm NearItem seem like a new field for recipe
well the good thing is you may use the same functions for multiple recipes especially if its for fixing a weapon
otherwise you can use Tag to have special functions that lookup for item Tag
Ye
Say you had a vehicle with 3 skins. Most assign an index per texture, some make multiple vehicles with the same stats/model, but each with a different texture.
Would the spawn rate end up being the same using either of these methods?
Taxi with 3 textures assigned & -1 index:
VehicleZoneDistribution.parkingstall.vehicles["Base.CarTaxi"] = {index = -1, spawnChance = 15};
vs
3 Taxis with same stats/model, each with 1 assigned texture:
VehicleZoneDistribution.parkingstall.vehicles["Base.CarTaxi"] = {index = -1, spawnChance = 5};
VehicleZoneDistribution.parkingstall.vehicles["Base.CarTaxi2"] = {index = -1, spawnChance = 5};
VehicleZoneDistribution.parkingstall.vehicles["Base.CarTaxi3"] = {index = -1, spawnChance = 5};
any good guides for java modding?
or should I stick to lua
I just read that java has deeper access to functions and stuff so I'd prefer that
Is it possible to add a custom function for custom recipes? Similar to how the OnEat_ thing works, like crafting a toy bear would do a function that creates an explosion or something
Also is it possible to disable the vanilla "Grab" button that appears for items on the ground, this is a special item I want the player to have to clean up through a custom context menu rather than just putting it into their inventory
Hi, may I ask about the real purpose of getModData()? does it have any real usage aside from allowing modders to implement custom variables and functions?
It's used a bit in the actual game code but I think it's mainly for modding lol
Is the attchments editor in debug mod bugged? When I save the settings it writes/saves the file but with empty coords....
Did you follow this guide? https://www.youtube.com/watch?v=3c229O6KPjY
Now on multiple Platforms:
https://www.youtube.com/c/AuthenticPeach?sub_confirmation=1
https://www.bitchute.com/channel/authenticpeach/
https://www.minds.com/AuthenticPeach
Livestreaming Channel - https://www.twitch.tv/authenticpeach
Does anyone know, or is there a command line that gives infinite item durability or item condition?
CanHaveHoles = false,
Or does having this make it where items act like underpants where they have infinite condition?
Further more, when getting injured and bandaging, how does one make it so that bandages do not appear as they are clipping through my custom armour mod.
I didn't know about it ( I saw another video but this video tutorial seems to be more specific ). Thanks for the link mate! π
In the tutorial he doesn't say that...I presume that if you don't select male or female the settings will be saved for both, correct?
..or better to select every time male/female depending on needs?
question about this, i followed the exact steps and added the stuff to the properties, but when i startet the application it seemed to not do anything but when i checked the normal PZ tab on steam it showed to be running and according to task manager zomboid was running, yet nothing came up on my screen?
There's a lot more simplier way to have the mods always correctly updated...
what is it? i am trying to mod the game and rn wanna start the first test to see if the distribution is working
Go to the mod of interest, submit a comment, subscribe to the discussion and your mod will be always auto-updated correctly
Don't ask me why but it works...
ah i see thank you
can't confirm cuz I haven't put this feature to use in my mod yet
Ok, thanks mate, I'll use the " trials & errors " method so LOOL π
Yes, I posted this mod and a similar mod for bait tooltips on my profile: https://steamcommunity.com/id/tmh47/myworkshopfiles/?appid=108600
Take in mind this..Every mod at which you are subscribed to the discussion will auto-update automatically when a new version of the mod is released. For all the ones that you don't subscribe to the discussion you'll have to do it manually ( Subscribe to mod/Unsubscribe ).
A little tip: go to your " 108600 " folder ( all your mods are contained here ) and right click on a empty spot and select " Sort by last edit " so you can easily check what has been updated and what's not π
Check for strings like:
BiteDefense = 75,
ScratchDefense = 75,
BulletDefense = 100,
and set all to 100
You'll become the new Robocop LOOL π
Is 100 the max for infinite then?
Does tripping effect it?
Is that the max number integer?
YES
Basically yes. In addition there are also other strings that may affect it...If you find something that seems related to it set the value to 100 and basically you'll go around like a tank LOOL π
ConditionMax = 999999,
RemoveOnBroken = false,
ScratchDefense = 100,
BiteDefense = 100,
BulletDefense = 100,```
This is how I have it now
In addition if you run the game in debub mode you'll have the " God Mode " available
e
and just press N
N = Nuke? π
I will set all the stats to that then.
Any idea about the bandages appearing on the model when you are wounded?
I scratched my hand and when I applied the bandage it wrapped it over the hand and was making my model look jank
Cba
Again..debug mode mate π
What do I do in debug?
Will that show me the command line?
Once in select the " Dev " tab you see all the options you need. Or you can do it with Blender.
The various options of the debug editor will show all you need π
If you look at this video ( and the tutorial posted above some mins ago ) you'll see how it works ( skip the blender parts if not of interest )
https://www.youtube.com/watch?v=2M2fWLBLaX8&list=PLwV27NP3RkJl27tveCa9EMMvAdjmGXZsf&index=16&t=3008s&ab_channel=Blackbeard
0:00 Intro
0:29 Video Start
1:00 Start Blender
1:22 Using a background image
2:04 Using photoshop to edit the background image
2:52 Adding the edited background image to blender
3:26 Adding the cube mesh
3:46 Quick start with the cube
4:56 Importing a finished 3d Model from the internet
5:56 Moding the imported model
6:47 ADD NOTE ABOUT MAGAZIN...
question, where do i find the log for mod loading errors?
Here it keeps me still on 41.71...
console.txt in the Users folder π
or check the Log folder same location
any way too look through those logs for errors specifically? cause they are extremely large text
At the top you'll see the tab " Search ". Write ERROR and serch for it π
alright thank you man
making my first mod and ugh right as i want to do the first test it updates the game and if i remember correctly 41.72 changed the way distribution works
i am going to cry the mod isn't even shown in my list anymore

If you get an error indicatig something like " line 222 bla bla bla " , the number is refered to file line number when opened with Notepad ++
ah alright
Welcome to the magic world of modding LOOL π
To show it you need to save it in the Users folder under Mods π
( if you didn't upload it to the workshop )
ah ofcourse, putting it in either one of the "mods" folders didn't work, but putting it in BOTH did,
i fucking hate coding. that doesn't even make sense to me
modding is a magical process and i honestly applaud anyone who makes big mods
Forgot to mention...Console.txt and all the files present in the Log folder can be deleted anytime ( they will be written again at the next game launch ) but never delete the main folders π
( In the Users folder I mean )
The console.txt is just one, in the Log folder instead every time you run the game a new one is created
@lusty nebula I am in the Debug mode, I have Dev part open.
Where do I go from here to find where I can stop the 2D Bandages from appearing on your model when you get bitten?
Attachments Editor select the bandage modify pos save ( but first equip it )
top left there's the search bar for items
by right clicking on the item, additional options available
Is it possible to add a property to a room in mp?
While saving the pos where it will be saved is displayed during the process so you can then go there and check the file
E.g. toxic gas level.
is there any easy was that and input output container for an object ? like put scrap into a macerator which it take from one container and output to another one ?
grab ---> inventory --> Put in
Like this?
or if the containers are close to each other simply right click on the item of interest then " Put in "
robert it not one to one . like it scrapping small amount of its waight over time ^^
Sorry can't understand what you mean mate sorry
I did and I still can't find this "bandage modify pos sav" on my item that I just posted a picture of to you
what the weight for a scrap? i cant remember on top of my head by lets say it have a weight of 5 Kg
and then over time while it running it would lower the scraps weight while put stuff into another container as weight on that object as well lets say
5 kg iron scrap get lower after 1 min to 4.5 kg and have produced 0.5 kg iron dust.
and dont create a new obejct each time
could you possibly explain to me what this means?
Don't worry about it, I'll ask elsewhere
Because you selected the attachment not the item ( Check the top left bar )
in the top bar write " Bandage " for example then select it π
Attachments editor ---> Top left bar ---> enter item name --> select ----> move positon --> save
position is moved by clicking on the colour of interest ( same if you need to rotate it )
What is the best object to save data related to entire world?
The part of interest is below stack trace. That kind of error, if you are working on items, is normally generated by a wrong setting in the item files
Take in mind that in files punctualisation is very important...even a missing comma in a script, for example, can return a red error
Correct. At the top you can select too if you want to apply it to the male/female model
( Check the player model tab )
IMHO is better to work with a model so it's more easy to place the item having the body as reference
make a backup first of the original file so if something goes wrong by accident you'll have always a safe backup available π
i found the error and god i feel dumb,
i made a new bodylocation called BeltStrap
when making the 2 exceptions so that fanny packs and the canteen strap can't be worn together i wrote it as BeltSTrap
Typical error of the series " Shit happens ". At times item names, commas, brackets and dots will become your worst enemy LOOL π
nah my worst enemy in coding will forever be ; since it has made me loose countless hours when i tried learning c+
@eternal garnet Did you get it in the end?
"near eof" excuse you?
hmm time to look through 200 lines of distribution i guess
suggestion: check in particular the last edits you made
No, I'm a smooth brain with Autism
LMAO π
what you don't get?
you can try also another way
Example:
Just following the text.
Quite a visual learner so unless a video shows me I fold up.
It just takes me a while to process what I am reading.
hmm even looking through the entire file i see nothing wrong
I'll use a file from a smoke granade mod ( Sorry I do not remember the author ) somehow....
file name: SmokeGrenades_models_items
If you open it it contains:
{
model pa_SmokeGrenade
{
mesh = pa_smokegrenade,
texture = pa_smokegrenade,
}
model pa_SmokeGrenade_ground
{
mesh = pa_smokegrenade,
texture = pa_smokegrenade,
attachment world
{
offset = 0.0000 0.0000 0.0000,
rotate = 90.0000 0.0000 0.0000,
}
}```
}
You can try by editing directly yourself the coords values ( that is basically what the editor does )
coords should be X,Y,Z if I remember correctly
oh huh well first of all that's not even the problem i have so that's another thing for the list of things i need to do, the issue i see in game is that the game doesn't even spawn the item and i didn't feel like making all the models before i know the code works
i don't see why i can't spawn the item tho
sample:
offset = 0.0500 0.0100 0.0050,
rotate = 90.0000 0.0000 10.0000,
if needed you can do even smaller adjustments. Sample:
offset = 0.05012 0.01001 0.00503,
rotate = 90.0000 0.0002 10.0001,
That can be a issue LOL π If they are not secret files can you drop me the files via PM? ( I'll try to give a check to them if you want )
i would appreciate that a lot
ok so what you're waiting for? π
Hey there, I wanna change an emitted sound on LoadGridSquare, but i struggle to get Access to the emitted. This doesnt seems to work:
--(before that we check If square has a generator:)
x=square:getGenerator()
X=x.emitter --problems from here(Nil index..)
If X.isPlaying("generatorloop") then
X.stopAll()...``` (on phone so I might have made a method misname, but..)
I usually use GameTime
My own convention is getGameTime():getModData().ModName.Scope.data.
now in debug mod you can find the spawnpoint and delete it from inside the game seems
- Added list of mods in Pause menu + this list show mods that cause errors
Zomboidbros, did we just win?
hi, I'm not an experienced modder, so when I decided to make a custom profession, the easiest way for me was to take other's profession mod and edit it. it looks like my edited version kinda overrides the original mod. can someone help me? I can send any file if needed
Oooo is this just called debug mod in the workshop?
Makes it a lot easier than searching through the files lol
Wait.. we can make mods with TypeScript ? (PipeWrench)
awesome thank you this is a extremally helpful mod
you will want to save it to the global mod data
eof means end of file. most likely is a bracket somewhere that hasn't been closed. because of the missing bracket, the interpreter reads the entire file and reaches the end of the file trying. and therefore it gets an unexpected symbol near eof
What's the mod called in the workshop?
it's called "it's vanilla now because they released the 41.73"
π
just use the debug
How do I find the debug console then π sorry lol
u r a god amongst men
can't of course be used in servers where you are not admin
How do I see this in game? When I try to launch it with debug mode on it gives me like a console and a bunch of other things
I'm guessing it's translated into lua right?
I'll help you out
No idea I didn't try it yet
they are not, the other day testing it one gloves broke
It was this line
it makes it unbreakable
Yeh the gloves worked because they were from the vanilla gloves code
The Armor base was from another mod
but fixed now
will update later
thanks again π
hey there, thanks for the answer. But I checked that before in the real code. So isoObject.emitter should work NP?
no backet seems to be missing, all i did was make a new distribution file that shouldn't replace the vanilla one
so i have no idea why or how a bracket would be missing
anyone know why the leather strips only increase condition but not protection?
ah
you need to be level 8?
in tailoring to bring it up to full condition?
are you using an IDE? using one would really help spot any syntax errors
IDE?
an integrated development environment. basically its a file editor that is designed for programming purposes. they have alot of tools that help with coding. what is useful for your case is the syntax checker which essentially is a grammar checker for code, which would point out the missing character. sure it won't always give you the perfect clue as to the issue, but usually its pretty useful at pointing out what is wrong
Oh yes i use visual studio
actually, can you show a screenshot of the last few lines of the file giving the error?
@shadow geyser my confusion is that it says nothing is misding