#mod_development
1 messages · Page 540 of 1
I had a hunch. Encrypting would not help with speed at all
hahahaha
Good idea with path draw, but do this will be pain in the ass. For my RP mod I will add just numbers for each house and districts for easy navigation
But I understand his/her idea, I can see why
he/she thought about compiling the program
it could help not being tremendously big
i don't know lua enough to know for sure how it gets handled and turned into machine code
It handled by lib to Java
be careful, mods will probably not like that 
makes sense. I have very little lua experience but i know it's meant to be super easy and simple. I find it kinda similar to java
Man you giving big NPC energy
Yep, pretty nice language for modding
wat? lol
true, Nekoli is clearly an AI
idk u just got those vibes
its coz i emote
that is one of the reasons yes
im gud at it tho

it helps me express myself

if i was an AI i would be amazing and loveable
imagine me being in pz lol

it's a horde! RUUUUNN!!!!!!
lol
anyweez, i gtg
everyone hf💖💋🌛
Is there a way to teleport vehicles or do I have to give them force impulses to fly them to the destination?
I feel like we need another chat for people looking for or requesting mods, and leave this one for chat for people who make them
i think a more basic pointer that doesnt take pathing into account would be more doable tho? ive noticed exp heli events has this, it could still be helpful i think
also bumping this i legit just wanna know if its hard/soft capped at 5 or someth bc ive never seen anyone add more skintone slots or anything
where can i find the check for if a gun has a round racked in the chamber?
essentially i want to allow a gun to shoot without ammo in it
What's the game file/files that determines the zombie clothing? I want to determine the average spawn rate of clothing items per body part on a zombie
nevermind i found what i was looking for
I tried modding this and it was only Java. I don't know if there is a makeup layer that could paint over the skin though.
fair enough💖
ye i wish u gl
Gonna do a play through as a police officer any mod suggestions ?
Sorry for tagging. I guess it's the right part?
function ISMoveableSpriteProps:getObjectHealth()
local matHealth = ISMoveableDefinitions:getInstance().getHealthDefinition( self.material ) or 1.0;
return self.rawWeight * matHealth;
end
Can we create new Item Tags or can we only use the ones added in the patch?
Hi, does anybody know a mod with custom context menus?
So I can learn a little how to make one
where to find normal lua guide?
sorry doors seem to have different logic
Theres a lot of google pages with lua guides, and youtube videos
i've been trying to understand this mod and how it spawns items
what is CrateAntiqueStove ?
i've found this but i still have no idea to what does it actually correlate to ingame
You can add custom tags
Is distribution table. It will roll item from item list (here list with 1 element) with 100000% chance in crate
Some cars from mods and vanilla 😄
Im wondering WHAT it is distributing into
Some crate with tag CrateAntiqueStove
is there any way i can find out which crate that is?
I think no. I think it choose random from crate list distributions
where can i find the crate list distributions
Try check CrateAntiqueStove in ProceduralDistribution
That's where the original image came from
How it works:
when try generate loot in factory crate, it random choose from procList type of distribution. Then tried generate loot by this distribution
so one of the crates in any factory can have that tag>
?
or well, 5% chance
also which file is this? I'd like to look through it aswell
I don't remember how exactly, but I think tag not set to container. Just choose one of distribution
Hey guys, how would I go about creating a timer that executes a function when it finishes?
I'm mostly having trouble understanding how to count the time passed.
I saw another mod using getGameTime():getRealworldSecondsSinceLastUpdate() is that the best way?
Try getTimestampMs()
what value does that return exactly? Is it the time since the last update or something else?
Like current time in ms
Use diff for check how much time last
alright, thank you
Minimal Display Bars has some iirc, it's on GitHub
is there a setting or mod that allows us to access sewing or first aid kits without equipping?
could've sworn I done it before 🤔
Would be nice, just accessing containers inside of containers would be good.
Hello everyone (sorry for my bad english is not a native language).
I have a little question regarding the mods a week ago and I have not been able to find the solution, could you help me x.x?
more or less the summary: My partner and I started a world in PZ, it is not a dedicated server (I am the host), this new world has several mods installed (The world and the mods were configured in v 41.68), it happens about what; We recently decided that we want the world to last as long as possible, but I am aware that maybe at a certain point; either due to incompatibility between game versions or mod versions, it can get corrupted.
So I've been searching for days to find a way to disable PZ steam updates, start the game without steam, and create a backup of my workshop items (just in case one gets updated). to a future version after 41.68, and my world is still on that version).
The problem I have is in the last point, I made a backup copy of my workshop articles, and I unsubscribed from them from steam, but when I "manually" place the files back in the corresponding folder, the mods don't recognize me, they know how could i make it work?
oh, thanks!, I'll go ask there
if im adding mods to a server and its a mod that needs to be installed on the main mod screen lik ehorde night or become desensitized. does that mod also need to be added on the server as well?
yep
kk thanks
is there a way to check if a function is already registered in an event?
for example:
if not Events.OnTick.Exists(self.update) then
Events.OnTick.Add(self.update)
end
No. Only remove or add
If you need change self.update or disable it - just override it. If in event added local function, then only way - override all file (and do load your mod after original mod)
Does everyone on the server have to have the players on map for it to work for them?
what do the setJobType and setJobDelta actually do?
I'm making a timed action and these are in base files but it doesn't look like they ever really get used for anything
I'm trying to troubleshoot which mod might be causing a system freeze.
Does anyone know what the "receiveObjectModData: index=-1" translates to? The coordinates are usually player locations.
LOG : General , 1652235206316> 1,334,231,513> receiveObjectModData: index=-1 is invalid x,y,z=9332,11306,0
nevermind they make sense
anyone playing online using map moods? looking for a list of map mods that are confirmed to work. i slapped like 10 on and as you can imagine they arent all working.
Thanks, but I think is too complex for what I have to do
Actually, does anyone know where are the lua files of the Food Type and the lua files of the drink context menu?
Anyone got any recommendations for a "Multi-Tool" Mod? Only found one that adds a can-openner, knife, scissors and screwdriver together, which is amazing and all^
But I want to take it a step further. Like, sledgehammer + axe + hoe kind of multitool. Or Wrench + PipeWrench + Hammer.
Transmit of moddata not worked properly.
P.S. better find mod by turn on mod one by one
Just check that you added to Map param map folders
Need wait next patch, that adds tags for this items. Then just add tags to your multitool
Food type can be any string. Drink in ISInventoryPaneContextMenu
I mean, I wanna create a new Item Type, so I want to use the Food Type as a reference
What do you want to make
Is that a thing? Gods yes pls
Sorta reminds me of Rimworlds Tag System. Makes modding/editting items so much easier
how many parts should a car have?
Is there a possibility to modify the crafting UI? In particular regarding the size of the material window: There is a huge blank space on higher resolution that i would like to show since Hydrocraft often have many components
Yep, just override some vanilla UI functions
I want to make a custom type for a specific food which has to have a counter and interact with an especific item (also custom) in the character inventory.
That's why I think that the Food Type would be a good start to implement that
I guess you wan't to make an Icepack that can cool other things down? (or an heater for MRE?) An direct example would help
Is the function ISCraftingUI:render() constantly triggered while the window is open or only once? Is it recalled when the window is resized?
File: media\lua\client\ISUI\ISCraftingUI.lua
Hey, do you have any idea when that update could be coming out? I've been waiting for it for the same reason since currently it's not possible for multi tools to act as several tools in some specific areas such as cars etc...
Is there a mod that make zombies live again after a while?
They respawn i guess?
Hey guys
is there a modder here who accept commissions?
it would be for creating an armor/model.
Every UI update, so something like 20 time/s
Are you making a mod for the crafting UI ? Cause the dev work on it if I remember well
welp. I'm 99% sure I figured out why the vanilla debug menu's "setvehiclescript" doesn't work on the server. I've narrowed it down to "scriptreloaded".
Now to find an alternative way to refresh the vehicle for use in my mod
hey guys, how can I check if a lua table is empty? I found out that next(myTable) == nil doesn't work in Zomboid's Lua :
Also is there a list of all the differences between pure Lua and Zomboid's Lua?
A small addtion to Hydrocraft to show more materials in the crafting ui so you can better see the ingredients.
#myTable returns the size, an empty table would give you 0
for _,_ in pairs(table) do
stuff
break
end
quote the entire block with ```
yeah I guess this is the way, thanks!
I tried this but it doesn't work for all tables. https://www.lua.org/manual/5.3/manual.html#3.4.7
another reason to hate lua
# only works for tables that use number index keys, and only counts the highest index
pz's kahlua is based off 5.1, so use that manual instead of the 5.3
its also missing a few modules, io.*, os.*, and math.random are invalid for pz
(was unaware next didnt work though, so there maybe a few others i havent listed)
ah alright, that's good to know. Thanks!
oh math.randomseed as well
Any other insane gotchas in lua?
probably a few, depending on how well you understand tables lol. the fact they can be a sorted list/array, unsorted list/associative array, and a pesudo-object.. including all 3 at the same time probably counts as a gotcha lol
also depends on how far you want to go down the metatable hole, and when you start applying them to sorted lists etc.
No exception handling, no continue statement 😅
indexing starting at 1, thats defiantly a 'insane gotcha' (though a well known one)
no continue is insane, theres a work around though
And yes, that ^
Tables being lists and dicts at the samd time is a pain
as long as you dont need break at the same time lol
tables never give me too much trouble because i've always viewed them as dictionaries
for key, value in pairs(someTable) do repeat
if (condition) then break end -- break now functions as continue
until true end
oh, it breaks the repeat?
ya
neat
the repeat stops after the first iteration anyways with the until true
Yea but that is just excessive markup 😩
dont blame me, blame lua lol
For a thing that should be so simple
I just code loops to not need continue, but next time i forget and get an error, I'm using this
I'm sure they have their reasons, but it's one of those annoyances I have with it
idk why they didnt add a continue, its bizarre
I think i vaguely remember a Prof explaining why in University. They said something along the lines of it being because of the regular language lua uses making it impossible to implement in the parser.
Maybe not, googling seems to imply they just didnt wnat to add it
not wanting it seems more likely.. its meant to be minimal language without a pile of bells and whistles
Oh heres an explaination:
https://stackoverflow.com/questions/3524970/why-does-lua-have-no-continue-statement
There is some syntax issues with adding it
2nd answer
Yet we have for, while, repeat .. until 🤣
Continue, on the other hand, is a real feature. (It even changes the
syntax and the lexical.) Our main concern with "continue" is that there
are several other control structures that (in our view) are more or
less as important as "continue" and may even replace it. (E.g., break
with labels [as in Java] or even a more generic goto.) "continue" does
not seem more special than other control-structure mechanisms, except
that it is present in more languages. (Perl actually has two "continue"
statements, "next" and "redo". Both are useful.)
no issue, they just didnt want to XD
So basically: yup it's important. We won't add it because fuck u. 😂
If you read the proceeding paragraph:
At the time we "added" the local scope for repeat it really seemed
innocent. And it was not really an "added" "feature", we just changed a
scope rule. Unless the fact that it is different from other languages,
it should be neither simpler nor more complex than the old rule.
and note
Continue, on the other hand, is a real feature. (It even changes the
syntax and the lexical.)```
I think its was just work they didnt want to do
Does anyone know to make the tires on my modded vehicle larger? I legit have no clue what I can do to change them

lol tinywheels
Where exactly? I legit can't find anything to help me with that.
go smaller, commit
well first. i bet ya that you are scaling the model via the script and NOT the actual model.
and that breaks things.
You may be having a good bet right here.
scaling the model, scales the wheels.
are they custom wheels?
Is there a way for me to rescale them?
model InflatedTirePlusWheel
{
file = Vehicles_Wheel,
}
and just add scale = 1.5 for example?
you can try that?
Hey guys! I need help from someone experienced. Can I add a new attribute to an item? Example: item.isOnline=true. I need to set and get the value.
send me your vehicle script.
Yes, you can. And then in code check this param by item:getModData().isOnline == ...
Thank you so much!
Question: in VehicleZoneDefinition.lua it says that for spawnChance, "the total for a zone should always be 100" -- what happens when I add modded cars (e.g. Filibuster Rhyme's) and that value increases?
the comment stating that is extremely old and not valid. it can be lower or greater then 100, the end values are normalized.
Gotcha, that's what I thought but I wanted to confirm. I saw a patchnote that also said that the value was changed from an int to a float, so that means I could put, say, 0.5 for a vehicle's spawnChance to make it rarer, right?
sure, that patchnote specifically has to do with the original normalization function was converting the numbers to ints instead of floats (causing mutlitple issues), but yes, you can use a low float for extreme rares
great, thanks for the help!
ok, so. Coding question:
How does one "reload", or "update" a vehicle in the world, using lua?
Hello. How to make a very simple recipe where:
I can clean the dirty rag, bandage etc. with water and soap / Cleaning Liquid pls?
recipe Clean Rag
{
RippedSheetsDirty,
Water,
** Soap/CleaningLiquid **
Result:RippedSheets,
Time:40.0,
Category:Health,
OnTest:Recipe.OnTest.NotTaintedWater,
}
This is what I did but this isn´t working..I mean...I can clean rags without soap or Cleaning Liquid
Within the context menu when next to the sink or any other source of water
did you copy from vanilla?
yes
hmmm
wait
did you put a comma after soap/cleaningliquid?
it might be skipping that line due to a lack of a comma...
yes
in the crafting window....there is the option with cleaning rags with water AND soap ONLY
ah. Sorry I'm a bit daft
but I need to apply this also to the context menu when you stand next to the water source and can right click it and choose CLEAN RAG
yes
1
yes, but I might be VERY wrong here.. I'm pretty sure the context menu's applied automatically?
It says it needs Water (1 unit) and soap. But it cleans the rag anyway...
without any soap
yes, yes
😄 OK
Essentially you will have to look for that vanilla code and create a new version which prevents populating that option if soap isn't present
The question is where to look for it?
You will be much better off opening the lua dir (from within your PZ install\scripts\media dir) in an editor/IDE and learning to search these things for yourself
ok, so. Coding question:
How does one "reload", or "update" a vehicle in the world, using lua?
For the actual right-click menu you get from the sink I believe you're interested in ISWorldObjectContextMenu.lua. I'm not familiar with the other screen so I don't know where that code lives.
great..will look at it
Hi, Where can I see Traits in the game files?
another VehicleZoneDistribution question: I see lots of mods use "trafficjamw" for traffic jam spawns, sometimes other directions, but the base lua has a "trafficjamVehicles" matrix that it distributes to all 4 directions. Does this mean that modded vehicles will only spawn in the specific direction they've been added to the distribution (i.e., cars in only trafficjamw will only spawn in west-facing traffic events) ?
how do I actually call a costum timed action?
I basically copied the grab corpse action and dont know anything about adding a context menu and call the function itself
You're also welcome to look at the TimedActions I created for Item Searcher. SearchInventoryAction and SearchRoomContainerAction are actually used, SearchRoomAction is cruft-- https://github.com/TheCrimsonKing92/pz-item-searcher/tree/master/media/lua/client/TimedActions
new to lua, and using base game files and other mods to help me
when am i supposed to use a semicolon or not? it seems so random in the game files.
I come from java where it is everywhere
ok nevermind idk why i didnt just google it in the first place
they are optional, unless you want to seperate multiple statements on the same line
Does anyone have a help so I can create a trait for the occupation?
hey guys so does the this variable increase or decrease my hunger?
HungerChange = -100,
are questions about running a dedicated allowed in the section?
i really wnat to know how to run a dedicated but i never get a question answered with in the hour here
is there a way to create a mystery bag which gives you a random item like food?
how in the fuck do i add maps to gportal hosting lmao
Can someone help me with Vector3 plz? I am trying to apply an impulse to a vehicle to make it move in a certain direction, but I do not know how mathematically to put the global vector3 direction onto the vehicle's local axis so that the impulse is applied in the right direction.
How do you determine if an item belongs to a mod in lua?
Anyone know of a mod that adds like a portable cassette player like the Walkman?
ive downloaded some music mods and id like to listen to music with headphones doing looting runs
Not too bad for a mod right?
For what you want update veh?
Ur mod?
yeah
It's a music pack?
when calling my modded TimedAction, the game (in debug mode) breaks and gives me this output:
attempted index: StartAction of non-table: null
it also points to lines in my code that queue or startaction the timedevent
how can i start to fix this?
i presume this means I am somehow calling startaction to early?
Actually I want to make an item that can be drinked multiple times if you have a thermos with water in your inventory.(which I have to make too). Once you drink the item, the water in the thermos is reduced a little. Also, that drinkable item has to have some counter that after some uses, it turns into another item
That item is called mate, which is a regional drink in some countries of South America
Did you read guide / see how vanilla does it?
There is no StartAction
honestly that sounds something for an simple recipe that takes water + mug + mate (i guess you can't drink it from your hand)
I mean there is one but it's not something you need to do. Not part of guide.
yea I thought to do it that way, but I discarded it because it would be more tedious to drink it multiple times, because every time you have to make the item
I know that you can make multiple items from making only one recipe, but the mate should be unlimited to drink, as long as you have water in the thermos.
Thats why I decided to see if I can make a new type based on Food, with this little things I have to consider
you could just make the recipe and define the mate as "keep mate" that way its not used up. and tedious is relative you could make a "bigger" serving to drink (like -100 water) that way you could drink it partial
or make the mate a drainable item with like 100 uses (since even mate is not endless ;)) and use "mate=1" for the recipe
The thing is, that you can drink the amount of times that you want, as long as you have water
I like what you suggest, but after some uses the mate should turn into a version with almost no flavor, which changes its nutritional value and such, while its still drinkable (as long as you have water)
at some point it is basically just water with maybe some color 😄
Gotta start somewhere!
Usually "attempted index: <thing> of non-table: null" tells me that there's another issue. If you have any errors in the class which creates the custom timed action, Lua will act like it doesn't exist.
But Poltergeist is also right, I've never implemented a function StartAction on my custom timed actions
item:getModID()
Hey all. I was thinking of trying my hand at modding pz. I read that all the documentation is old and depreciated tho. Is that true or was that just some salty guy?
So far, this is what I've found:
- Lua as a language is well-documented... but for the Lua applicable to the game, you kind of have to rely on the media\lua folder in the game directory
- There are javadocs for the game, but from what I understand they are superseded by the game's files (which makes sense, if you think about it), and while many working mods make calls to Java functions, this is apparently no longer in vogue? Not 100% clear on this point, but if it works, don't fix it 😄
- Surprisingly (or not?), many of the old guides still have many nuggets of good info, but there is some sifting you have to do on your own
The rest is trial and error.
ah so that seems about on par with what they were saying. would be sweet if the java docs were up to date, but I suppose with everything being as open as it is you cant complain too much about needing to dig into source. Thanks for the info @native shore
I've not seen it explicitly said, but I think they're wrapping more and more of the Java stuff in Lua so you won't need them ig
I am become plunger
huzzah
does that mean you leveled up in the server?
yeah I guess I blabbed enough 🙂
Nice! good work lol
Now I just need to come up with an idea for a mod to add. I was thinking maybe making the showers function so you can clean yourself off faster
tyty, take care!
guys is there a mod where you can temporary increase your health bar?
hey guys, is there a decent smoking mods ? (like one that either removes the trait as someone " would quit smoking ") or one that allows you to grow tabacco and make your own cigarettes ? Thx
Tobacco growing, jiggas green fire. It also adds in weed to 420 it up
don't really care about the weed, but interested by the other one ! Thx
Np
I just recently started but I didn't realize they had a discord. I'm on day 3 and I'm understanding how to string this stuff together. Granted ill go on 12+ hour scripting sprees.
. Otherwise, id say it's easy to get with time
Also, I had a question about the channel. Is it possible to get info on a zombie that died on the OnZombieDead LuaEvent? For example, I want to know which player killed a zombie in that event.
Yee I have modded other games with WAY less docs and "modding support" so I dont see it being an issue. mostly was jw if it was even worth the time looking at or if it was all going to be dated
https://pzwiki.net/wiki/Modding:Lua_Event/OnZombieDead looks like you can
not sure about which player. maybe you could add that variable tho
hey, sorry to bother again, but do you have the link for the tabacco growing one ? Cause i can't seem to find it
It should just be jiggas green fire. It let's you grow tobacco
many working mods make calls to Java functions
Maybe you got mixed up between coding in Lua where you may make a lot of calls to Java functions, and coding in Java which can be done withCapsidStorm but is less convenient than Lua because steam workshop does not take Java.
The Towing Cars mod uses Vector3 in it, and the game's online Java documentation mentions two different Vector3's and a number of other sorts of Vector3 whatever they are.
and @chrome egret I dont have a function StartAction. That is why I am confused lol
It's hard to say without seeing a stack trace, but I would def commend you to look in your console.txt to ensure there wasn't a lexing error which essentially ends with your action file not being included
alright thanks
I fixed my issue. No more errors but the timedaction doesn't actually work yet lol
lol I feel ya
Maybe so. Easy mistake, given the architecture.
Ex: When I see IsoPlayer.getBodyDamage() I look through the media/lua folder's files and find no corresponding Lua function, but right there in the javadocs is IsoPlayer which inherits from IsoLivingCharacter which itself inherits from IsoGameCharacter, which has a matching getBodyDamage() method. 
Anyone got any decent mod lists for steam that don’t stray too far from vanilla and definitely don’t use Brittas?
There is nothing inherently wrong with calling Java functions, and many of the classes are exposed for that very reason.
no disagreement here; like I said, if it works, don't fix it lol 🙂
Yes, IsoPlayer is a Java class and it's in the Lua namespace with a Java-Lua thing called Kahlua.
IntelliJ IDEA doesn't seem to have any knowledge of it, despite picking up the rest of the Lua library I added to the Project Structure

e.g., I can do this:
local myCoolPanel = ISPanel:derive("myCoolPanel")
with no problems, but if I try
local myCoolPlayer = IsoPlayer:derive("myCoolPlayer")
or anything like it, I get nothing
but I can just wave my hands around and boldly type IsoPlayer:getBodyDamage() and get back a functional BodyDamage object 😄
(assuming IsoPlayer refers to a validly passed/assigned instance, of course)
how would i add something to the CharacterActionAnims?
https://zomboid-javadoc.com/41.65/zombie/characters/CharacterActionAnims.html
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, enum: CharacterActionAnims
You said you're calling it. If you're not calling it, maybe you're not passing the right character.
i fixed that issue. i was missing a variable in my action:new constructor
nice :)
thanks though
so I take it doesn't work because of something else?
yeah, I'm figuring that out right now
ISPanel is a Lua table created in a Lua file. I do not use IntelliJ, but maybe someone has made a plugin to add the game's Java things to the list of things. Maybe Capsid does it. Actually maybe it was Capsid that did that, and Storm that did Java modding. Yeah that's it.
yeah there's some tools that help with that for sure, but they're seemingly far out of date; I actually joined to ask about them and was told unequivocally that those are NOT to be used anymore as that paradigm is passé 😦
c'est la vie 😄
maybe when the game is stable
Do you mean you wanted to modify the Java?
nah, just have it available for doc comments and autocomplete and stuff
That would be nice T_T
having all the lua files is fine and I can just open the LuaManager.class file and use that when I need it
I synced it with the javadocs, for whatever that's worth, to get annotations
it's kludgy, but it works
I just use Notepad++ :(
hey, nothing wrong w/ that, it's a fine editor
I prefer Sublime myself, but to each their own
When you synched something with javadocs was that with IntelliJ or Sublime?
IntelliJ IDEA for sure lol, I know Sublime has an EmmyLua plugin, but probably not much else 😄
I'm so spoiled now, I want all the shinies
also, after trying to set up the EmmyLua extension in VSCode, I'm gonna stick with JetBrains lol
Hmm okay okay maybe I will download the hundreds of megabytes of IntelliJ if I start coding something tricky for Zomboid.
JetBrains' tools have a very consistent feel, so if you're used to them they're great, but man... they're really handsy and they tend to "suggest" stuff a lot that doesn't make much sense
What's the Emmy in EmmyLua or what's EmmyLua?
dunno where "Emmy" comes from, but EmmyLua is a doc comment framework, kind of like JSDoc or XML doc comments in .NET languages
it's handy for IntelliSense-type stuff, auto-completion, etc.
shiny
😄
Does it tell you if you put a string as an argument that was meant to be a number, and things like that?
It does! It's like this:
--- Transforms a value in [0, 100] to one in [0, 1].
---@param value number the value to transform
---@return number the fractional value
function utils.fractionalValue(value)
return scaleValueToRange(value, 0, 100)
end
Microsoft Visual Studio has a lot of features but it also takes up a lot of RAM (C# in Unity).
on mouseover you get that, and while typing the call it tells you what the type of input is
yeah!
exactly
that's just the same thing
Hmm okay so I may try out Sublime with EmmyLua oh actually maybe not because it doesn't get the Java documentation thing.
VS Code is lighter than full-blown Visual Studio
Actually for non-zomboid Lua I could use that.
VSCode hates EmmyLua (or the other way around) lol
I love it for TypeScript stuff though
changed my life
Hmm excellent. It will be nice to be able to have three (RAM-heavy/light) programs open at once (Web browser, code editor, Unity, a second Unity for multiplayer)
I typed something illogical and corrected it.
I meant I use
Unity, Notepad++ and Firefox
or
Unity and Visual Studio
for lack of RAM
so
Unity, VS Code, and Firefox
if VS Code is better than Notepad++ THAT'S WHAT I ACTUALLY MEANT
oooh I'm looking now and it seems like the EmmyLua package for Sublime is no longer on PackageControl 😮
I hope you have better luck than me if you try it in VSCode
I couldn't get it to recognize my OpenJDK
well, you see. when I run ScriptReloaded it seems to not save the change to the server. How would I send the change from the client, to the server?
I think this func will not work in MP. For what you need this func?
I'm dynamically replacing certain vehicles.
As idea, create command, send to server and on server side remove vehicle and spawn new
is it possible to update/reload a vehicle without using scriptReloaded?
also
what about the keys that spawn on the ground?
for set new script?
well, sort of
As i said, by custom command
update not possible. Only replace
setScriptName(NAME) runs just fine. When I unload the cell the vehicle's in, and return, it's what I'm wanting
but my issue is
I don't know how to "reload" the vehicle in real time?
Maybe try do this on server side and client side?
hm?
I might have missed the context, what script are you reloading?
a vehicle script
And that's because you're dynamically altering its content?
GetVehicle:setScriptName(arg); GetVehicle is the vehicle in question, arg is the new script name
Maybe need send command to server, on server run ScriptReloaded for vehicle, and then run it on client side
GetVehicle:scriptReloaded(); "Updates" the vehicle, so the change can be seen on the client, but it reverts the scriptname change.
How would I do that? SendServerCommand?
local args = { vehicle = self.vehicle:getId(), index = skinIndex }
sendClientCommand(self.character, 'vehicle', 'setSkinIndex', args)
like that
k
And on server side:
How do i create a new type of zombie for a zone? IE. in a CarRepair zone there is a mechanic. I want to make a new type of zombie with a specific outfit
Nvm i did find it, however if anyone else is curious it will be in this file steamapps\common\ProjectZomboid\media\lua\shared\Definitions\ClothingSelectionDefinitions.lua
is there a way to create a item bag when you open it (like food cans) gives you a random item?
Could anyone make a mod where if you have base protection on, turning PvP would allow you to steal from their base?
Im my head if you have offline raid protection enabled pvp wouldnt allow you to take anything. But if you wanna enter and steal from someones base you would have to enable PvP
you could probably define a list of all items you could want to give
then generate a random number and pull that index from the list
Hi guys
I was just wondering if Indie Stone is going to add a tape recorder/CD player to the game?
It would be nice to have time to paint during a trip by car and some routine work)
Maybe there is some kind of mod, but I did not find it
(written with google translate)
You mean music mod? True music for example
hi guys i have a quick question
Unless I'm misunderstanding why not just enable the setting that makes claimed land work like normal when the players are online?
I've been using it for a while now on my server. My players enjoy it and I think its fair. But sometimes players will be minding their own business in their base and a PvE player will come and snatch loot from people and theyll generally not be able to enable PvP.
PvE on and you wanna take loot from player players haha
Guess like a pvp zone around bases
You would think entering claimed space would enable pvp by default
would work then they could make factions
Good idea.
Should be a legit feature an not a mod
Maybe try reaching out to a dev.
Totally shouldn't be able to raid bases with pve on
Hi! Does some one knows how can I provide translation for my mod?
Is it possible to mod the size of the map. So not just add into it but expand the area of the original map?>
you mean expand minimap size?
Like I know some popular mods add new cities to the existing map but could you actually expand how many cells are in the map? giving more area to create.
Create files like this and add translates
Thanks a lot!
A question so i made a clothing.xml then i pushed a zombie outfit to the zombie zone definition table. The zombies appear in the horde debugger function. but when they spawn they are naked. Does anyone know why?
what mods currently work with the unstable build?
Is there like a reference for PZ? I keep looking through mods and they are using functions like
ISTimedActionQueue.add(VACCHOnInjection:new(player, item));```
and idk where to find these even in the original game files.
all of the vanilla clothing you include in the outfit also needs to be added to your guid table
Does that include their "paths" or are those inherited?
Awesome thanks bro I've been trying to find a solution forever
Hey guys, is there somewhere I can see all of the variables I can add/change to items? I'm talking about these not sure what to call them.
does anyone happen to know what the prepper house spawns are labeled as in the distribution tables?
I'd love if there was a write up of what all of them did. When I was making my dragon slayer mod I used the katana as a base and I had no idea what was worth editing or what half of them did/
yes, something like that. for example, music from 1993 (the action of the game in 1993?)
Completely new to modding but have some experience in RW modding. Been considering making a mod that would create certain custom items to specifically spawn in certain buildings. Is this possible/is this currently done in any other mods that I can use as a reference?
Don't know about item creation, but managing the spawning is done through media\lua\server\Items\Distributions.lua and media\lua\server\Items\ProceduralDistributions.lua.
👁️
Spawn distribution depends on container type. But you also can force spawn for specific tiles, zones, rooms, items. For spawn in certain building, you can make wrapper to ItemPicker.fillContainer func, call inside old func and if this container in certain building -> add your items
Could anyone point me to where I would find the loot tables for toolboxes having a chance to have items in them on spawn (I've already found the actual tables for spawning of items themselves). I'm attempting to make a new container, and using the toolbox as a basis
Hi would change some coordinates of spawning helicopter in the mod better helicopter but I don't know where find the file of the coordinates
Hey guys is there anyway to give zombies certain properties on spawn if they are a part of a certain clothing group?
so I looked at the code of the Oshkosh P19A
and from what I can tell the code for the windows is the same as the code for the Gage Commando's windows
but the firetruck windows break after a certain period of time
is there some other file that causes this?
guys how do i get my mods to download it wont everytime i click install
anyone know what the difference in cryo winter and eternal snow is?
Does anyone know what
_item:getContainer():setDrawDirty(true); does?
without looking at any code, I bet it marks it for rendering on the next pass
saves time to not re-render things that haven't changed
Cool Thank you!
np, hope I'm not too far off the mark 😄
I mean it could literally be "draw this as though it has dirt on it" 😄
lmao I hope so. I'll do some testing ig lol It's in UI files though so your first guess seems more reasonable lol
Maybe this can help you
local function OnZombieUpdate(zombie)
if zombie:getOutfitName() == "yourOutfit" then
-- doStuff
end
end
Events.OnZombieUpdate.Add(OnZombieUpdate)
iirc marks it as player intereacted
@native shore
Does Anyone know where I can find Game/GameOver from sounds_player.txt?
{
category = Player,
clip
{
event = Game/GameOver,
}
}```
anyone know any wig mod? 😔 Paw Low Loot has wigs, but the mod is too big and has some bugs (invisible groin for example). It can be vanilla hair, modded anime stuff, anything. Craftable or found in wardrobes, I don't mind
God tier 💯
anyone know how to transfer singleplayer mod presets to a server preset with the mod manager mods? its really annoying that the presets dont carry over
Use mod manager: server
At least I think that’s it’s name
It’s a mod
Only way to use presets for MP
i have the server version but the presets dont transfer over. so if i make a sp preset i cant then select that preset from the server version
No
You gotta make a new preset
They are technically two different mods so they can’t carry over each other
yeah i know i was asking if there was a way, maybe a setting i wasnt seeing that would allow me to do that.
ok its annoying but better than it was without the two mods
It’s only a minute or effort making a mp preset
While without it you’d need at least 3 minutes each time you wanna make a new server with different mods.
the issue im finding is how some mp mods requre to be active in the sp mod screen and it gets confusing what i ned to leave on for mp and what i dont want to run in sp. so i just wanted to have a single preset to swap to and from
They shouldn’t?
PZ servers are essentially GMOD
Where any mod the servers use is automatically set up
mods like horde night wont show up if theyre only active in the server version. needs to be added in the main screen as well
Anything that’s enabled in the server gets enabled on the Client
Works for my server without any issues like that I’m pretty sure?
Then again I don’t think horde night was designed for MP
I haven’t ran a server in a hot minute
But if it does require the client to have it enabled, just enable it on your normal mods tab the set it up in the server
Should be perfectly fine
i think the helicopter mod is the same way, become desensitized and they knew are a few more off the top of my head. i dont get settings for them unless they are activated in the sp section as well
Huh
Well then just have you and all your buddies install the mods and enable them on your default mods section
i mena it works wor them not having to add it im just saying for me the host i need it added to my sp mods. but my issue with that is swapping between sp and server gameplay is a pain to keep track of what mods i have installed cause for my server i need mods active i dont want in my sp game and im having to swap them off all the time and it gets confusing. and im always finding new mods and adding them so having just one set list isnt really happening
Yeah I advise not having a clusterfuck amount of mods for your MP
I have a set amount of specific mods for my server whenever I make it that’s just going to spice it up a bit more
eh if i cant mod the game the way i want then i lose interest in playing. pretty much every mod i have installed is a must have or i just dont wanna play
But, what if it’s not how your buddies wanna play?
When your playing in MP you’ve gotta make sacrifices
theyre alot less picky than me. but believe me sacrifices have been made
i want extremely rare loot, no brittas, and hardcore cryo winter and none of that is happening
i mean i lik ethe content of brittas but its just a shit show sometimes
But yeah, it sounds like you’ll probably just have to suck it up, as you can’t port over, or set up a dedicated mod list and never change it
Otherwise your kinda shooting yourself in the foot
You also shouldn’t really be adding mods to ongoing saves anyways
oh i mean yeah ill deal with it was just hoping there was a secret setting or some shit that i was missing.
It’s usually recommended to restart when a new mod is added
mods always get reloaded when entering a game be it single player or multiplayer
oh yeah im aware but i just risk it and if it fucks something up ill remove it and if its still fucked then well restart.
that means having them active on the menu doesnt matter unless youre making a new save
too many cool mods come out like everyday
except map mods. i know they need a new save
local allItems = getScriptManager():getAllItems()
for i=0,allItems:size() - 1 do
local item = allItems:get(i)
if item:getModID() == "Arsenal(26)GunFighter" then
print(item.SubCategory)
end
end
Why do I get nil for all objects if firearms have a subcategory?
cant access object fields that way. you'd need to use the getter/setter methods :getSubCategory(). but you'll also have to check if its a HandWeapon instance, since that method doesnt exist for all InventoryItem types
Hrm, i'm doing something wrong then. I tried checking if they were instanceof(item, "HandWeapon") but yielded nothing.
I'm trying to script functions that parse all available items for Arsenal's guns, magazines and melee weapons so that it can be placed into recipes without manually crawling through all the files and getting ids.
function Recipe.GetItemTypes.ArsenalGun(scriptItems)
local allItems = getScriptManager():getAllItems()
for i=0,allItems:size() - 1 do
local item = allItems:get(i)
if item:getModID() == "Arsenal(26)GunFighter" and instanceof(item, "HandWeapon") then
if item:getSubCategory() == "Firearm" then scriptItems:add(item) end
end
end
end
function Recipe.GetItemTypes.ArsenalGunMagazine(scriptItems)
local allItems = getScriptManager():getAllItems()
for i=0,allItems:size() - 1 do
local item = allItems:get(i)
if item:getModID() == "Arsenal(26)GunFighter" and item:getDisplayCategory() == "GunMag" then
scriptItems:add(item)
end
end
end
{
[Recipe.GetItemTypes.ArsenalGunMagazine],
keep MetalWorkbench,
...
}
recipe Disassemble Arsenal Gun
{
[Recipe.GetItemTypes.ArsenalGun],
keep MetalWorkbench,
...
}```
Like so.
Ah, I guess I got it. Feels roundabout but:
function Recipe.GetItemTypes.ArsenalGun(scriptItems)
local allItems = getScriptManager():getAllItems()
for i=0,allItems:size() - 1 do
local item = allItems:get(i)
if item:getModID() == "Arsenal(26)GunFighter" then
local itemInst = instanceItem(item)
if instanceof(itemInst, "HandWeapon") and itemInst:getSubCategory() == "Firearm" then
scriptItems:add(item)
end
end
end
end
oh, my bad, didnt full read before haha, missed the part you were checking script Item class, not InventoryItem.. thus the instanceof HandWeapon not being needed, should be item:getType() == Item.Type.Weaponi believe
though probably not needed to check the type at all really, since all script Items should support :getSubCategory() (defaults to a empty string for non-weapons)
if item:getModID() == "Arsenal(26)GunFighter" and item:getSubCategory() == "Firearm" then should be sufficient
why wouldn't this work?
the game breaks and tells me the problem is on line four
I guess maybe result is not defined but I'm just imitating the base game recipe to refill a blow torch
Ay can anyone recommend some mods to me? (I've only done vanilla)
Try check what type have result
hey guys, how would I go about adding a tooltip to an item?
I'm pretty new to modding and right now I'm learning from what other mods do and what I've figured out so far is this
- I write something like this
Tooltip = Tooltip_TestItem,inside the item definition - Inside
shared/Translate/EN/Tooltip_EN.txt(for the english version) I define a table calledTooltip_ENand inside of it I addTooltip_TestItem = "my tooltip"
Some questions I have: - Does the file need to be named
Tooltip_EN.txtor can it be anything I want? - Does the file get overwritten by other mods?
- Similarly does the table have to be named
Tooltip_ENand will it get overwritten by other mods if it's the same? - Assuming someone else in his mod also named his key
Tooltip_TestItemis it going to overwrite mine? - is the
Tooltip_prefix required for each key?
Sorry for the long list of questions, I'm just trying to figure out the best way to do this so my mod doesn't break anything in other mods.
I think it has to be called Tooltip_EN.txt but I'm not super sure. The table does need to be called that though.
Mods will just insert their own stuff into the translation tables so it won't replace anything that isnt a key with the same name. You can prevent conflicts by putting your item in a module called something other than "Base" so you'd do "Tooltip_TestModule.TestItem" instead.
The prefix is required
ah thanks! that answers my questions.
So I guess what's happening is the Tooltip_ prefix is telling the game to look inside the Tooltip_EN table for my Tooltip_TestItem key
I've seen tooltips in other mods being defined inside the UI_EN table and they do Tooltip = UI_TestItem which I guess would be another way to do it
Hi everyone.
I am currently working on a translation for some mods and wanted to customize tooltips to make a few things more clear.
What I noticed is, that <br> doesnt seem to always work to create a break rule in the ingame tooltips? Is there a limitation of the number of br's or rule to keep an eye out for when creating longer tooltips in Zomboid?
And how can I make some letters in the "positive green" or "negative red" colors of zomboid? To give the reader a quicker indication of whats good and bad about this particular item.
I' ve seen "< RGB: 1,1,1>" used for color, for line break I usually go with \n but I saw also <LINE>
Hot damn, thank you very much for the input!
so for coloration, I go for something like this? RGB:255,0,0RED TEXT</RGB>? Or when do I tell the game where to stop the coloration of text?
can anyone point me to any references on inserting a filled container (similar to how toolboxes can spawn with items in them) into the distro table. I've already been able to insert the container into procgen and whatnot empty, but now i need to populate certain places with it filled with x items as well
I use it like 1,0,0 to start red and then 1,1,1 to change to neutral
Oh okay!
If you want check all args (like <RED>) then check file "RichTextLayout"
Does that formatting work in the .txt files for tooltip translations? Or is that formatting only for luas?
Know that it will work for ISRichTextLayout. Not sure about other
Thanks! Where do I find that tho?
Sorry I am completely new to this. Currently working on some easy task, translating some tooltips and wanna make them more readable and informative
thanks so much!
when should I use getSpecificPlayer(player) rather than directly referencing the param 'player' itself in a function?
Im a bit confused as to getSpecificPlayer's purpose
if type(player) == number then getspecificplayer I imagine
depends if you want / have player object
getSpecificPlayer takes a number
so whenever the player variable is a number you want to getSpecificPlayer
If I'm changing item tooltips is there a way to see the changes without having to restart the game each time?
I think no. Just quit to main menu and then again load not work?
yeah that works 👍
im having problems adding mods to my new server,i enabled them both in menu and settings,i even tried ONE mod like Raven Creek just to see if a certain mod was causing problems and even Raven Creek did not show as a spawn location
you enabled in in map setting?
does this mean result is not the item, but the player?
and player is item
maybe need swap places of func param
alright, thanks
i would love a pagan / wiccan themed or just any witchcraft themed mod that would be really cool
it could go well with foraging
grow certain herbs like sages or hops
could give u mental health buffs n stuff inside your home or something
make ur own candles
I'm trying to add a custom option to the context menu for an item I made and I figured the best way is to use either the OnPreFillInventoryObjectContextMenu event or the OnFillInventoryObjectContextMenu event. (correct me if I'm wrong)
However I have trouble understanding one thing, those events have an items parameter but they're not the actual items(I think) even though it works since I see another mod doing this items = ISInventoryPane.getActualItems(items) and I'm trying to figure out why that is or if it's necessary.
Hello, sorry for asking here, I don't know where else to go! Does some one know what does this parameters do? I have an insane amount of respawning zombies on the server and I think it might be something with this?
Wrong link. Give me 1 sec
Yes no problem! ❤️ thanks a ton!
I thought I had a bookmark that detailed what those meant but I I can't seem to find it now. Sorry
Not sure if this is necessarily the correct place, but is there a way to spawn a specific type of zombie in multiplayer? Like the soldier zombie, or doctor zombie, or something added by AuthenticZ, etc
Yeah no worries!:))
Enable debug mode. You'll get access to a horde spawning UI
I'm logged in to admin mode, is it under a tab I'm just missing or something?
Or you could type in chat /spawnhorde 5 (or any number, being the number the amount of zombies)
But to spawn an specific zombie I don't know
To enable debug, close steam, right clic on properties and on the parameters tab, type "-debug" without the "", and you'll be able to do all kinds of stuff
I thought debug didn't work in multiplayer
So I have a workaround for the workshop mods always updating fucking my clients joining. Im tryingto update the pack of mods whats the mod.info? This must be new since its now telling me I need it compared to last time when I didnt need it
nevermind im dumb
ISInventoryPane.getActualItems(items) need because some selected items can go like lua table
debug works in mp, but only by admin role
Sweet, thanks. Didn't know that
Anyone know a fix for the guns/icons to show up for Brita's mod on a dedi? I've followed all troubleshooting I am able to find and no dice
how could i check if the player is standing on a powered tile?
what happened to the general container mod on the workshop?
try square:haveElectricity()
thanks
Does anyone have function to drop all inventory items?
so something like this would work?
i did find that getSquare was inherited, but if I have to use getX, getY, and getZ I will
maybe in some time will not work. Need check also:
if getWorld():isHydroPowerOn() and square:getRoom() ~= nil or square:haveElectricity() then
i almost forgot that power is on at the beginning of the game, thanks lol
hey guys, I see a lot of mods are adding their mod id as prefixes to their files to avoid conflicts with other mods but can't you also just create a new folder with a unique name(mod id) and put everything in there without having to add prefixes to every file?
eg. client/Mod/TimedActions/myTimedAction.lua, client/Mod/Context/myContext.lua etc.
Is it possible to use java that takes argument Predicate?
getRandomSquare(Predicate <IsoGridSquare>)
I tried passing Lua function, with no success
Just curious, I did it another way.
in lua, how can i get the player from an item
as in i have an item variable, and i need to use the player object that has the item
the only functions that i see that return a character object are getPreviousOwner() and getEquipParent() but idk if those are what i want
found my answer
local player = container:getCharacter()```
Hi! I build a mod for ATM's but I made them 3D objects, is there a way that when placing them in the ground, people cannot traspass them? Is like they weren't there, or how can I do that?
They are items, like a water bottle
Has anyone ever tried to make a level system similar to the one in 7 Days to Die? tldr level ups give skill points and there are multiple skill trees with perks that have multiple levels.
Anyone have a good rundown on britas guns and armor? Trying it in an existing world any tips?
Probably a silly thing I am not understanding, but can anyone advise why I cant do a ':size()' check on this table? It seems to throw an error when attempting to get the size of the table. If i try '#matUsed' it doesn't work either ignoring the fact the table has a size of 2. 🤔
:size wont work on tables, only java ArrayList and similar java collection objects
wont work, the table doesnt appear to be a list style table (ie: one using integer index keys)
in effect, that table is defined as:
{
["Base.Nails"] = 1,
["Base.Plank"] = 1,
}
its essentially the same reason you cant use ipairs and have to use pairs
but since your next line after the size check there is to call pairs on the table anyways, the size check is probably redundant. (it wont iterate over a empty table, and wont error)
Yes, you can
By custom tiles
Here how I implemented it:
https://youtu.be/im5ooYXMSIw
Huh, are recipes not supposed to care where the user decides to execute them?
I have this recipe that disassembles guns. I have different guns in my inventory and choose to disassemble a specific pistol by right clicking it and using the recipe directly from it, but it decides to disassemble some other gun.
do you have one recipe to dissasemble several types of guns?
Yeah.
that's your problem. look at the base game's dissasembly of spears, they have a recipe for each one
... Well shit.
I'm not sure if you can avoid that problem while still using one recipe
I guess the user could favorite them or leave them somewhere. Arsenal has around 100 guns... Kinda oof.
How isn't there a mod that uses these anims for bare handed combat https://v.redd.it/kk4o4qrttjz81
Thanks!!
local container = item:getContainer() sometimes stores multiple values, like if i am standing over a backpack. how can i get just the first value and store it?
actually this seems to only apply if the recipe i am calling this with has items split across the player inventory and something else, like the floor
I fixed my problem by avoiding it
anyone have a dedicated server using Arsenal(26) GunFighter Mod and brita, and when ur admin to custom options there is a drop down scroll bug? anyone have this problem?
Yes, I stopped using Asenal 26 bc of that... Couldn't make bows, bazookas and other stuff didn't appear:(
Because the animation system is all convoluted and reverse engineering it for a whole new combat aspect is really not fun at all. We need Animzed for that.
ok thank u for quick answer 🙂
Fair enough. Would totally love to see combat like this at some point tho. I know of 2 mods that attempt it but I think they just use the push anim.
I found that you could edit the arsenal files but when people tried to join the server it said they had a different file, and caused an error... Then I found that you had to put that same file in two different locations on your server files so that when people joined it would overwrite their file, but never tried it, just stopped using it xD sorry
By the way, AMAZING mod, it blew my mind. Congrats!
guys how to make your own custom animation in PZ? i just made a Bullpup Assault rifle.
Go to the steam workshop page of arsenal26 gunfighter mod. You have to use a template given, to make your own config. Then uploade your own workshop mod (the config). It will overrite the original settings file of arsenal26 gunfighter
is this a server advertisement?
no! DMCA!
몇사람에게 DM 줬지만 너무 많아서 그냥 올립니다.I gave direct DMs to a few people, but there are so many that I just post them.
so my englisg skill
ahh for copyright access.
yes! please notice to moder human!
Hey, would it be possible to mod vanilla trash bags so that they're burnable in a fire like corpses? I would like to burn bags as a garbage disposal
hi, looking to make a mod which brings in more food.
did some research, can't find what the nutrients in PZ are measured in. Grams?
if someone could answer my question it would make my day, thanks
I thought it was in calories but not positive
Which java file contains the context menu code? I'm looking to understand how context:removeLastOption() works.
If you uploaded mod with others mod to steam, then you will can get copyright strike
Hey people, is there any specific guide or procedure to completely wipe out loot tables from vanilla + mods of certain areas? want to alter weapon spawns for a mod and i would prefer to start with a clean slate
I want to add a can opening sound effect to a mod of mine that im creating. Is there a way to import a custom can opening sound effect and possibly change the time it takes to open it?
how about an addon?
Addon is ok. Just add requirement of original mod
I'm making an add-on for Vanilla Firearms Expansion.
would it be possible to swap the animations of a weapon to that one?
I don't see why not. in the reddit thread that was posted in someone sai that a brass knuckle mod uses it.
can't confirm tho
ah
well Other than the fact that it isn't being used officially I can't see why someone couldn't use it for another weapon.
I imagine the only reason it isn't already in the game is because the devs would want to add proper repercussions to fighting with your bare hands like getting scratches or fractures and it is too much work atm to put people to work on.
I have a scripting question..
If I want to change something about an item, let's say a good old "Book"
Do I have to put in everything about the item, or just the bits I'm adding or changing about it?
My gut says I need to put in the whole thing, but I just want to be sure.
Like, if I wanted to change "UnhappyChange" to -50, I'd have to put in everything, and not just
{
UnhappyChange = -50
}```
SOmething like getsctiptitem and doparam
How would I go about adding in occupation-specific foraging bonuses? Or know of an occupation mod that does already include the bonuses to foraging? So I can look at how they coded it. In the midst of creating a new occupation for learning purposes.
dont edit items through scripts instead do it through lua
getScriptManager():getItem("Base.Book"):setUnhappyChange(-50)
Hi guys, I remember seeing a video with a zomboid mod, that adds a van or a caravan in the game, where you can actually walk inside of it, but cant find it on the workshop. Anyone know what it is?
Does DisplayName overwrite ItemName in any way?
The whole thing.
It ovewrites the item ID.
In the console.txt file I get the following warnings when loading my mod:
WARN : Script , 1652597084550> ModelScript.checkTexture> no such texture "WorldItems\HTFACNotesPatient" for HTFAC.HTFACNotesPatient
WARN : Script , 1652597084550> ModelScript.checkMesh> no such mesh "WorldItems\HTFACLiterature" for HTFAC.HTFACLiteratureCadavers
WARN : Script , 1652597084550> ModelScript.checkTexture> no such texture "WorldItems\HTFACLiteratureCadavers" for HTFAC.HTFACLiteratureCadavers
WARN : Script , 1652597084550> ModelScript.checkMesh> no such mesh "WorldItems\HTFACLiterature" for HTFAC.HTFACFileGeneric
WARN : Script , 1652597084550> ModelScript.checkTexture> no such texture "WorldItems\HTFACFileGeneric" for HTFAC.HTFACFileGeneric```
this happens for every item in my mod. The items have textures and meshes and load up fine when I'm playtesting. How do I get rid of this warning or can I just ignore it?
I have my mod structure such that the items script and model scripts are in separate txt files. Could that be the reason?
is there a way to check if the game is paused or event that happens when the game gets paused/unpaused?
mech names in lowercase?
UIManager.getSpeedControls():getCurrentGameSpeed() == 0
thanks!
what do you mean?
the mesh names need to be lowercase? This is what my model script looks like:
{
mesh = WorldItems\HTFACSheetPaper,
texture = WorldItems\HTFACNotesPatient,
scale = 0.75,
}```
here is the item:
{
DisplayName = HTFACNotesPatient,
Icon = HTFACNotesPatient,
WorldStaticModel = HTFAC.HTFACNotesPatient,
Tooltip = Tooltip_HTFACNotesPatient,
DisplayCategory = Literature,
Weight = 0.05,
}```
everything else follows this general format
@drifting stump Thanks, guess I need to read up on how to Lua if I want to make this thing I'm thinking of, but doing it through Lua makes sense if it lets you just add/remove things from items
Howdy, I just wanna ask if I understood something right
getGameTime():getMultiplier() gives back just the speed at which the game is currently playing, i.e. 1.0 for normal speed and higher if the game is running faster
so if I wanted to get the time that passes in one tick, do I divide by 60?
you might want to divide by PerformanceSettings.getLockFPS() or PerformanceSettings.getFramerate()
not everyone is running the game at 60 fps
I'm not sure
https://zomboid-javadoc.com/41.65/zombie/core/PerformanceSettings.html#
it looks like there is a function to check if it is capped or locked
the only base game example is of a getLockFPS() function in client\ISUI\ISEquippedItem.lua
Javadoc Project Zomboid Modding API declaration: package: zombie.core, class: PerformanceSettings
getFrameRate seems to just fall back onto getLockFPS
s_uncappedFPS looks entirely unused
no idea whats going on here tbh
getAverageFPS might be your bet then
i dont have the java files so i didn't know it existed
on this note ^ does the OnTick event run at a constant rate or is it dependant on frame rate? if it's dependent on framerate then it would be the same as OnRenderTick right?
i wouldnt bet on it
it could just be very inconsistent language used
if logic tick and render tick were the same, the game would slow down every time you had fps hitches
ticks should not be tied to framerate because that would mean someone playing on 30fps played twice as slow as someone on 60fps
I think FPS is used interchangably here for tickrate
There is getGameTime():getMultiplier()
warnings because mesh name not lowercase. But warnings is not big problem
does the mesh name need to be lowercase in the model file? or the actual mesh file in the directory? I'm looking at how the vanilla items are set up and they don't seem to use lowercase for their meshes or in the script so I guess that's what's tripping me up
they are all working so i know its not a huge deal was just curious what was causing the warning
This cause of warning:
thank you!
Question, do gates open both ways or one particular way?
Just one way, toward the viewer.
red arrow right?
Gotta redo it otherwise the panels have magically swapped sides 😂
Red arrow, correct.
sound thankyou bud!
@tame mulch I found the problem! It was because i used backstrokes in the model script instead of strokes
This throws errors:
texture = WorldItems\HTFACNotesPatient,```
This does not:
```mesh = WorldItems/HTFACSheetPaper,
texture = WorldItems/HTFACNotesPatient,```
thank you again for your help! Use / not \ 🙂
I just did some tests, OnTick runs once every frame so if you're playing at 60 fps it's going to run 60 times etc @pulsar charm @spare hinge
same thing happens with OnRenderTick
so it's tied to framerate
oof
If a container burns do the contents get destroyed?
Followup question to this: could I use LUA to switch vehicle skins? Like "if skin=1, change it to t skin 2 instead" for example
I see this getTexture(filename);, would that work to get and set the texture?
hey im new here! i wanna make a notebook with notes in it allrdy. any idea what to put in the script to make it work?
Try check notes mods in workshop
roger, thanks alot! 🙂
Try something like this
local skinIndex = self.vehicle:getSkinIndex()
skinIndex = skinIndex + 1
if skinIndex >= self.vehicle:getSkinCount() then
skinIndex = 0
end
self.vehicle:setSkinIndex(skinIndex)
I would want it to set whenever the vehicle spawns, I'm really just trying to disable a few camo skins that I don't like, but I think the real easiest way to do it is to just rename the textures
hey can anyone do a little project for me and my server. you'd basically be working on a existing mod that was ravamped from a older mod, and id like for it to be revamped again haha. you'd be compensated for your time 🙂 i dont think it would be difficult just something i need adjusted
@spare hinge just pinging you because you had a similar problem with me and I figured it out. To get the time that passes in one "tick" with the same end result for any fps you can do one of the 3
getGameTime():getRealworldSecondsSinceLastUpdate()
getGameTime():getMultipliedSecondsSinceLastUpdate()
getGameTime():getGameWorldSecondsSinceLastUpdate()
the last two automatically handle different game speeds, however keep in mind that if the game is paused these 3 will still return as if the game speed was set to 1, not 0
hell yea
thanks
another unrelated question
is there any way to "draw" onto the screen directly in any way?
I want to draw stuff around the cursor
I would think change the cursor icon temporarily?
Hi, is there a way how to disconnect a player using server side lua script? I didn't find anything on the internets.
@pseudo lake Sure I can, but we would like to have a script which will automatically disconnects all players when less then X players are online.
you could do it with a bash script, wouldn't even need a mod
run the players command to check how many players are currently connected, and then kick them based on the parms u set
assuming running under linux
We can't run bash scripts unfortunately 😦
You COULD do it with RCON, but I found mixed results using that
On client lua I can disconnect player, but cannot figure it out in server lue script
Probably I can stick with client mod then, since we are a small group.
There is an event OnDisconnect
You might be able to hook into that. OnDisconnect if players < playersRequired Do some shit
I dunno how accurate this source is tho 😄
Right now I just listening for event EveryTenMinutes, but will use something like OnDisconnect in the end
OnDisconnect would make more sense, because then your code doesn't need to run in the background.. It'll evaluate every time a player disconnects
Sure, is there something like timeout function which will run provided fn after some time?
If not I am still stuck with EveryX events anyway
Hello, I'm using snake's mod pack. No actual problems. I was curious. is the check weather button from that mod or is it base game now?
I'm looking on the list. Theres nothing there.
Found the answer.
Hello, does anyone know if I can add mods to an on going multiplayer server hosted by me without messing things up?
It's a sort of how long is a piece of string question.... I'd just back up all your saves before you add the mods. If using mods that change item spawns and such, only cells that haven't been loaded before will generate that sorta loot. I'm sure there is other gotchas, but the best piece of advice is to back your saves up b4 messing with anything pal.
ty m8
Is there references behind the code for traits already in the game that I can draw on for adding in new custom traits to an occupation? Not too advanced with lua, and first time modding this game. For example, wanting to do a lesser version of organized. And was trying to find the code for how that trait works.
I guess it's not technically modding. But for any server owners out there; How much interest is there in a Discord bot for PZ server management?
I've made one for our own server, but it's perfectly capable of being reused for other servers.
It simply uses rcon to fetch info / run commands remotely, and has some neat features like nickname matching, logging & graphing player counts / calculating prime time, etc...
there is a depressing lack of l4d mods
part of me just wants to learn how to make them myself
@pulsar rock could have been my shotty code, but I found if I created a lot of sessions to rcon, it would cause issues (this was maybe a couple months ago when MP released). If you're running it on a linux vm, use a screen session and pass directly to the screen session would be my only suggestion
Turn on sprinters, highest ammo loot and weak zombies, bam
No issues so far tbh
Probably my shotty code 😄 but just thought I would tell ya what I encountered
i do wanna run a l4d mode with infection turned off
And RCON's responses are honestly so nice to handle
Rather than grabbing stuff from the screen session
but stuff like special infected would be a dream
Yeah fair cop 🙂 Looks dope either way 👍
NPCs and animals are coming like next update, so I'd wait until then. I'm planning to make some monsters myself.
i know the tank would be nigh impossible but like the witch would be cool
I saw a mod that added screamers
the cut enemy?
i wanna see if I can mod in the red safe room door myself
I dunno I never played L4D
screamer was a cut enemy type yea
How long has this game been around and nobody has attempted a grappling hook mod?
fr
I'd say I'd do it myself but realistically it's going to be me asking somebody else step by step how to code it lmao
hooks exist
Hooks?
hookhausen
this exist
Ninja Science has one
Is that one of those mods that has zero explanation of what's actually in it?
Yup algol
kinda 🤣
but it's planetalgol's mod
Before I waste my time, does it actually let you climb to higher levels?
it should, but he had tooltip on wrong item and I was testing wrong item
Hmm alright, guess I'll take a look.
if theres any good stock racing car mods there needs to be a jiimy gibbs jr mod
Maybe if that guy would put explanations of what his mods have people might actually use them
he's actually pretty good, if you don't look at that
Yeah I like the idea of most of his stuff, but the whole "too cool to contact" bullshit is infuriating
And the fact he refuses to say what's actually in half his mods, or how it works
Like if you don't want to ruin "the surprise" for yourself, don't read the description. Or spoiler it.
I'm using Even Worse Searching and found Intel Documents and some other crap. Ended up having to mine his stupid mod to see what they were for, and guess what! They're for nothing at all. I loooooove getting useless items that give me recipes you can't actually make in my mods, especially when they're not at all related to the mod itself
ppl need to tag their shit
Grappling hook works which is cool, wish you could break windows with it or use it to climb onto flat roofs
Hi Lupo 🙂 I'm not sure this is current, but this might be what you need 😉 https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How to make a custom trait.md
@pseudo lake Not exactly. I am sorry, I shoulda' specified more. I already have a full occupation done from learning today thus far, fully works in-game, etc. But I was looking to expand upon it further by adding in occupation-specific traits. Closer to something like Desensitized, from Veterans. what I had in mind, was combining together Organized, Low Thirst and Light Eater. But lessening the value of each, so that Organized only gives a 110% value increase in inventory capacity rather than than 130% increase. Low Thirst 15% and Light eater 15%. So I can't use the traits in the game already. But I wanted to see how the traits in the game were implemented, so that I could perhaps re-work them out in my own traits with different values.
I don't know if they're exposed in lua
They might not be. I'm at a loss for going further with it right now though. lol.
How does the game identify ledges that can be sheetroped?
@pseudo lake I did find a modded occupation that has a custom trait touches resilience akin Thick Skinned/Prone to Illness. Looking through his lua files, nothing stood out that would immediately help for what I am looking for. Though I just started today with this stuff. Not entirely sure if where he found those values would be in the same place or not but I did write him a comment. Nothing back yet.
so im struggling to get my custom ui element to actually run its render function
i didnt make a new class for it, ive just overriden the render method field directly, but it should work in theory
but it dont
(also it didnt work when i did do this one more conventionally)
the prints dont show up in the log at all
you didnt add to ui manager
Reason: Do not lash out, harass or attack other users.
I'm trying to see if I can get algol's grappling hook to work on ledges too, but I'm having some trouble identifying what counts as a ledge, as in what the game would let me use an Escape Rope on. Looking through Throw Them Out the Window I got this bit but it doesn't seem to be working
object:isHoppable() and object:canClimbOver(player)
is there a way to see what profession/occupation player chose?
anyone know of a mod which adds a military urban camo jacket
Yea just go to the info tab
no i mean in modding
local profession = getPlayer():getDescriptor():getProfession()
thanks
Hey, I'm trying to fix a mod for myself, after some update I get errors 'attempted index: of non-table: null', does this mean that parameter type I'm using was changed? The line was _item:getSprite():getName() .If someone could help me understand where to dig that would mean a lot, thank you.
I think some item don't have sprite
if I removed the getSprite it was throwing errors at getName, it's related to radios
I mean need check _item:getSprite() ~= nil then ...
Is there anyway I can check what changes were made to a specific lua file?(from indiestone)
uhu, so I need to download previous versions right? The changes are not documented anywhere?
In posts about pathes you can check main changes, but not all lua changes
so I originally had _item parameter that comes from ISRadioWindow.activate(pl, obj, true) in the ISWorldObjectContextMenu.lua, can it be that before the update it originally passed item, but now it passes IsoRadio and therefore I cannot access these methods mentioned above?
What you want to do with radio?
place a custom radio on ground and click device option so the menu pops up, the issue is the check that my radio is my radio and not the vanilla ones
Oh, that not easy to do. I think different type can pass by this func, not only items
well the code is there, it's just the update that broke the check
welp
I tried what Aiteron said, about the client/server thing. Using the vanilla code in VehicleCommands.lua as a reference. Keep getting this blasted error: file: STEV_VehicleOverrides_Server.lua line # 8. [16-05-22 12:46:56.943] ERROR: General , 1652723216943> ExceptionLogger.logException> Exception thrown java.lang.IllegalArgumentException at NativeMethodAccessorImpl.invoke0 (Native Method).. [16-05-22 12:46:56.943] ERROR: General , 1652723216943> DebugLogStream.printException> Stack trace:. [16-05-22 12:46:59.410] LOG : General , 1652723219410> ERROR: sendClientCommand: can't save key,value=vehicle,zombie.vehicles.BaseVehicle@dd32576.
my client code:
function stzo_stev_override(vehicle)
local GetVehicles = getWorld():getCell():getVehicles();
if GetVehicles ~= nil then
for i=0, GetVehicles:size()-1 do
local GetVehicle = GetVehicles:get(i);
local args = { vehicle = GetVehicle:getId(), name = "Base.85crownvic_rosewoodpolice" }
sendClientCommand(getPlayer(), 'vehicle', 'setScriptNameSTR', args)
end
end
end
server code:
require "Vehicles/VehicleCommands"
if isClient() then return end
local Commands = {}
function Commands.setScriptNameSTR(player, args)
local vehicle = getVehicleById(args.vehicle)
if vehicle then
vehicle:setScriptName(args.name)
vehicle:transmitScriptName()
end
end
Events.OnClientCommand.Add(Commands.setScriptNameSTR)
anyone know of any mod that adds any kind of mining smelting system?
theres a discrepancy between the error message, and the code your showing. specifically, your code is showing vehicle = GetVehicle:getId() as the args (meaning vehicle should be a int value), but the error is showing vehicle is a BaseVehicle instance.
in short, your error makes no sense for the code being shown.
also, your server side code / Event needs some reworking. its doing no validation on the module & command args, which are also missing from your function defined there
thats going to be incorrectly firing on every ClientCommand received.
ah
How would I do that?
I see why. I sent the error message that occurred when I removed getId()
function: setScriptNameSTR -- file: STEV_VehicleOverrides_Server.lua line # 8.
[16-05-22 15:35:47.784] ERROR: General , 1652733347784> ExceptionLogger.logException> Exception thrown java.lang.IllegalArgumentException at NativeMethodAccessorImpl.invoke0 (Native Method)..
[16-05-22 15:35:47.787] ERROR: General , 1652733347787> DebugLogStream.printException> Stack trace:.```
any thoughts on how to randomize the amount of water left in sinks/baths/toilets? Or else to make them tainted water sources? I'm very new to pz modding and want to make my one year later start even more punishing :p
So current multiplayer works by send command to clients? Do they need a rec and send? and timed actions?
Hi, Aiteron! Do you know (or some helpful soul here) how can I translate recipe names? I have some recipes on the scripts folder and I'm wondering how could I translate them? Thanks a ton for all the support provided 😄
Ayyyy.. nothing fancy but first mod works 🙂 just a really really overpowered machete to test the waters
Congrats!
I think so, yes
does PZ have any tools that let you profile the game as it's running to figure out where/why stutters or lag are occurring?
I'm pretty new so maybe this wouldnt even help but you know about the debugging cla?
are you referring to -debug ?
yee
that's not what I'm asking about
gotcha. like I said im new so im not sure what all you can and cant do with that yet.
it looked pretty extensive tho
there's a debug option I turned on that will write to the debug log if any lua events take too long, but unfortunately, that does not complain about anything
there is also an option that writes a bunch of profiling data in the form of CSV files, but judging by its format, it's clearly intended to be fed into some external tool, which I don't think gets shipped with the game
maybe theres something in the modding tools package? you probably checked that already tho :/ I dont think I can be any help to you sorry lol
no, that's just the tiles and world editors
gotcha. I will have to start digging into all that soon
ah, I just realised, I can run VisualVM on the game
so far all I did was add a modified version of an existing item, just getting a feel for the game
Did they make a change in the unstable version of PZ so that it doesn't load translation strings on the server?
How could I get the number of items inside a container? Or if there are any items at all? I really just need a yes/no if it contains something
Would it be if container:getItemCount() > 0 then ?
container.getItemCount() > 0 crashes too lol, I'm pretty confused over when to use : over . but that's another issue
if container:getInventory():getNumItems("name") > 0 then am I on the right track here?
table:function(arg1, arg2) is just a convenience that saves you from doing table.function(table, arg1, arg2)
if you don't care how many items there are, use isEmpty()
if you do need to know exactly how many, use getItems():size()
@runic bear ^
Hey guys. I have a dedicated server and am using a few custom mods, britas armour and some vehicle mods. However I haven’t seen any of it spawn anywhere. Do I need to start a new world,
Any advice?
Items won't spawn in areas already explored
I couldn’t find anything even in the military base.
No vehicles either
Is there a way to check if it’s spawning in the world without just running around ?
I'm pretty new to modding PZ myself so I'm not sure.
@hybrid mica yeah, log in with -debug turned on and enable the LootZed cheat
find any container it should spawn in, click on its icon (in the inventory screen) and a window will pop up
also, you want #mod_support, not this channel
with that said - does anyone know if localisations for DynamicRadio on the server side got broken recently/on 41.71?
I have a DynamicRadio_EN translation that works fine via getRadioText() on the client, but not on the server... which is a bit useless because obviously it's the server that sends the translated strings
hey guys, anyway to modify armor so that it cant get bloody? bloodlocation=null or something??
Maybe someone can tell me where I can find vanilla traits code?
BloodLocation is used to determine what part sof the body are protected by the armor values of a piece of clothing, so that wouldn't work as a solution.
hmm gotcha. i was mid replaceall with the bloodlocation and you just saved me some time hah
The code that dictates what traits do is spread throughout the lua and java code, but the code that dictates their points costs and such is here shared\NPCs\MainCreationMethods.lua
thank you sir
@willow estuary I know about traits costs. I need deeper exploration of trait mechanics

And thank you of course
Anybody know why sometimes I can't barricade window, this usually happens when I have a bunch of walls, windows and some doors cramped together.
ok, the problem is that window is nil when I right click
there is a sweet spot, when I can not see door and click above wall that lets me barricade, but when text only says barricade it's really hard to find. I tried this before and sometimes I find the spot, sometimes I don't.
Like this need to do
@cunning canyon are you still maintaining Save Our Station?
this seems to solve my windows issue, will it cause any issues?
seems fine to me
couple of Lua related things though:
and squareis unnecessary, it is impossible for it to evaluate to false
- you don't really need
squaressince it's just used for iteration, it can be reduced toipairs({a, b, c})
if you're wondering about point 1: a Lua table cannot have keys with nil values
1 can be problem, thanks
however, this then might create a problem for you, consider {"stuff", nil, "morestuff"}
if you iterate using ipairs() it will only go as far as "stuff"
making it from 1 to 3 again
or, if the order you process them in doesn't matter, just use pairs() instead
also good :)
just to clarify, {x, nil, y} results in a table with only [1] and [3] - pairs() will serve up 1 and 3, 2 simply doesn't exist so you still don't need the and square check.
Is there any good mods for admins
3D world items are depreciated in 41.71. Is there a way to draw models apart from using vehicles (ps and apart from using a 2D image)?
is there a proper way to catch java exceptions to handle them in the lua. I have some code that occasionally will do an attepted index of an non-table, and in that case I would want it to just skip the rest of the function with a return, but I can't figure out how to catch java exceptions. im using pcall to catch lua exceptions, but it doesnt work on java exceptions.
oh.. in the lua.. my bad. no clue
sorry about that if I could learn to read lol
@shadow geyser no, because you would have to write Java code to catch them and pass back into the lua state
Render them into image files from isometric cameras in Blender/whatever you use?
Also, deprecated whaaaaat?
In that case I should have specified that I meant rendering the models during the game like with vehicles and people and items, which can let you show them at different angles and intersect with other models.
It generates a 2D image from the model, not taking the World attachment into account.
The game does?
The game does.
Then I don't understand what the issue is
The game does generate a 2D image from the model, not taking the World attachment into account.



