#mod_development
1 messages · Page 47 of 1
Who says you can't?
Audio hallucinations would be easy
Visuals would just take more work
ohhh such a good idea, and also textbased voices popping up
u can make a zombie chase a player only client side afaik
Barotrauma has a really robust hallucination system
i think this desyncs the zombie
My favorite is just seeing fires everywhere
SS13 also has a good hallucination system
They have clientside players attack you
So you'll possibly go out and attack the real one
But honestly audio in PZ would be enough
Zombie sounds, doors rattling
Foot steps
Etc
Basically the meta events but only 1 player and spooky
I might make a dream/nightmare system
@thorn cipher Your union mod is 10/10 
Yahoo im done with my meth buff lua code!
Hopefully by tommorow i can code the crashing part or the trait for it
Woot finally learned moddata! So happy
hey guys
can anyone give me a solid modlist
as in, what mods do you guys enable
in your playthroughs?
Just to share, I still am not able to update the overlay on the containers when its relevant. Still managing to understand how to do
Also, as a different problem, has anyone sucessfully made a freezing container that works on MP?
AFAIK every mod that deals with this have the problem of insta-freezing the item instead of working as a regular refrigerator/freezer
I think you would be better at #mod_support . Here is focused on making/editing mods
thank you!
what does DoSpecialTooltip do?
@sour island Hey, you are the expanded heli person, right?
just curious
@ancient grail I checked the mods I have on my server and one of them, MoreBuilds(515555911) use it when you try to build a well. So maybe its that Tooltip like "Dont have enough planks"
Is it intentional that the heli vests spawn at the Military shop and drop from the heli but you cannot wear them?
@drifting ore Sorry, I think I dont understand what you did. AFAIK you subscribe to the mods and then start a sandbox playthrough, where you go to the Mods tab and select them
You can wear them but the equip context is busted for them
Try double clicking
So I've been making a vehicle mod, everything on it more or less works ingame, but I've noticed that no matter what I do with the suspension variables, its either stiff as a doornail or collapses in on its weight
is there something specific im supposed to put for it, or is it something else?
ok...? so it will show a tooltip on a certain item if conditions are met?
Thanks!
I can only guess. I must confess that I didnt test it a lot
Every time I want to do something I look in the workshop folder
Not even sure if it was on my server or some server I joined tbh
Huh, it worked. I wonder why it isnt showing the equip context
I meant to sit down and figure that out
I think it's cause it's using the bag features
Maybe thats why Authentic Z treats bulletproof Vest as two items?
You can convert one to another
But you cant wear it when its a bag or hold as a cointainer when its armor
Ah, yeah no I hate that lol
I'll probably mess with the context menu and give peach stuff
What could be the problem? I added items for my car and that only they were put on it, but for some reason the game complains about the condition
Nothing help
your item is nil the create failed
Yep
nil?
Hi everyone, anyone knows how I can declare a mod dependent to many other mods ? (ingame, not on steam) when I use require=mod1 and require=mod2, only mod2 is required. while require=mod1;mod2 is rejected by the game.
yes, Base.NivaGasTank1 is likely not to be a valid item type in your game session.
The console says Item = nil, and the highlighted line is trying to check the Condition max of Item
Somewhere your item is getting deleted
You're not messing with Lua right? Just writing scripts?
I'm far from the console and checking what's wrong, I thought adding an item it would already be in the game, apparently it's not
So yes
Just scripts
How can an item be deleted if it is registered in the script?
Something on the level of incredible
The item type is not available. It is not the instance that is deleted. so somehow item NivaGasTank1 is not part of Base list of items. it probably does not exist at all but it could be part of another item list.
Everything would be like that, but I just changed the model without touching the script, now I have this
Before that, everything worked perfectly, all the items were available to me
did you try require=mod1,mod2?
I see some NivaGasTank1 and some NivaGasTank
Much love mate 🙂 that's it
Vanilla cars have 3 versions of items in the items, at the end they have 1 2 or 3, while when the name without numbers is indicated in the car script, this does not prevent game from choosing an item in any way
@ruby urchin also thanx a lot fot the custom moodle exemple I used as a basis for MoodleFramework
If I add the digit 1 in the script of car, then the game in can add another digit 3 at the end and there will already be error a Base.NivaGasTank13
I don't understand how it all works at all
Or it can add 1
hey guys, i have another issue im trying to figure out.
in the clothing.xml file, im trying to have an item in an outfit have a static color to it and not be randomized.
i checked with this reference:
https://projectzomboid.com/modding/zombie/core/skinnedmodel/population/ClothingItemReference.html
and came to the conclusion that randomdata should be the field that would correspond to that type of thing
<m_items> <!-- Face -->
<probability>1</probability>
<itemGUID>a3a1ca7b-4ded-43fe-be01-dacfdfef68aa</itemGUID>
<RandomData>
<m_Tint>lightGray</m_Tint>
</RandomData>
</m_items>
but it dosent seem to really work...
can anyone help me?
I solve my problem
Oh, I think there's an automatic thing going on, where 123 stands for standard/heavy/sport -- I forget the exact syntax it has to be
Oh you figured the solution out? What was it exactly?
Some parts have a different category
I do not know, but the main thing is that it works
Im hoping that guy making a script editor finishes soon
I still can't figure out how templates in vehicle scripts work
I understand how they should work and what they should be able to do
But I have no idea about the specifics
Is someone developing it? Then it should be placed in the unimaginable section
I present them as separate files so as not to fill in the main script
Look
I assumed the template needed to be it's own file
And that subsequent files calling on it borrowed it's definitions and applied it's own changes rolling forward
I have this long text, but I could create a separate file and just write template= NivaWindows\part\NivaWindshieldRear
So the template at the top is defining a new template ?
I only see such a plus in these templates
Template from above indicates the vanilla settings of the part, and what I write "part NamePart" indicates a change in the settings of the already vanilla template without a global change for everyone
And these settings will be on my car and not on others either, template is template, where the example or settings come from
Yes
It creates basic settings for my car and indicates that this car has this part
Part it is not needed
Oh this part is from inside another vehicle script
No
Is it possible to create a version of zombies that are totally blind but have good hearing and can kill you in one hit? Straight up Quiet Place type threat?
Not very easily
The vision code isn't very exposed
Part allows me to change the ready-made settings for my car
I don't explain well, sorry, I don't speak much English
Has it changed since the pre-41 days? Because I remember that the Insomnia mod made zombies totally blind during the day.
You can turn their activity off
Until there is noise made but it's like they then can see
So it wouldn't work in MP the way you'd want
I.e. staying still and letting other people attract them
The zombies would just see everyone
Unless they change how vision works
Scent of blood may provide a better way I suppose
But that may also be buffing zombies to all near by players accidentally too
whoops posted it in wrong place lmao
So with my current vehicle mod, apparently the car features zero suspension sway of any sort no matter what I change in its parameters compared to the vanilla car. What on Earth even dictates vehicle sway with the game engine?
Hmmm... Center of mass perhaps?
Assuming the cars are an attempt at modelling realistic physics
I only moved the thing up a bit, it doesn't seem to change much when I move it higher, apart from the collision going into the stratosphere with it
does anyone know if there's a benefit to packing items and textures into a texture pack? i think it's mandatory for tiles, but does it save memory/performance/anything for other textures?
@hearty dew
tbc56 commented 16 hours ago
after recent update any normal chat in /say is no longer displaying for anyone other than the speaker. Chat isnt recorded in the log and it seems to be treated as speech done from the mod
Why would this be happening?
I have this at the top ```lua
if isServer() then return end
other than that this shouldnt be breaking say/
--- Apply filters to process say
local original_processSayMessage = processSayMessage
function processSayMessage(command, ...)
command = ConditionalSpeech.Speech(getPlayer(), command)
return original_processSayMessage(command, ...)
end
``` I would think?
hmmm
Are there any other car pack mods like filmbusters?
Return all the parameters of the car from vanilla and play with the collision in the car editor and try to set it like vanilla
good news, suspension mostly works now
bad news:
apparently thats how it works now
everything else except the size parameter did nothing
hey, is there a way to define recipes using lua instead of the .txt scripting system?
is there a mod or easy script to prevent any damage to player build structures (doors, windows, walls) by other players?
also does anyone have an example of a mod adding a foraging item that works in the latest version? I'm comparing my code to the game's code and I don't see why my items aren't showing up
I don't think there's a good way of doing this without causing a ton of lag. In theory you could do like injury mods do and track every structure's HP and check if it was damaged by a player every tick by comparing its old state to its current state, but that would probably be laggy. Ideally there would be a onHit hook that we could use that had the target and dealer passed in for stuff like this but without a hook like that I think itll probably be a laggy onTick hook even if there is a way to implement it
does anyone know if there is a hook like that?
https://pzwiki.net/wiki/Modding:Lua_Event I think this is an up to date list of hooks
But u can hook into the java functions. I just dont know how the one for damaging player structures is called
these are the hooks exposed to lua, you can't (easily) hook into java functions
there is one for when an IsoGameCharacter hits another... I don't remember if constructions are IsoGameCharacters though
they don't appear to be based on this https://zomboid-javadoc.com/41.65/overview-tree.html
Javadoc Project Zomboid Modding API class tree
IsoBarricade maybe?
that's probably what it is, but there's no hook for onHitThumpable (which would be what you want)
WeaponHit(IsoGameCharacter gameCharacter, HandWeapon handWeapon)
Javadoc Project Zomboid Modding API declaration: package: zombie.iso.objects, class: IsoBarricade
🤔
ok how about this
- save the state of all player constructions
- hook onWeaponHit and whenever it fires, search for all player constructions within range of the weapon's range
- compare the saved state with the new state, and if there's a difference revert the state to the old state
that might get laggy if there's a bunch of players shooting with long range rifles close to player bases, but better than doing that same logic in an onTick
is the following not possible?
IsoObject_WeaponHit = IsoObject.WeaponHit
function IsoObject.WeaponHit(self, gameCharacter, handWeapon)
local thisObject = self
if instanceof(thisObject, "IsoWindow") or instanceof(thisObject, "IsoDoor") or instanceof(thisObject, "IsoBarricade") then
return
end
IsoObject_WeaponHit(self)
end
someone who knows better than me would have to comment, but I don't think you can override java functions from lua like that
ah, and I answered my own question about foraging
it got moved(?) to forageDefinitions.lua
WeaponHit is exposed on IsoBarricade IsoDoor IsoObject IsoThumpable IsoTree and IsoWindow, but the only one that is ever called in the vanilla lua is IsoTree.WeaponHit
so is it possible to hook into java functions directly?
not without modding the java directly
sideload a .class file that reflects the methods, but that's not something you can publish to the workshop 😛
anyone tell me why this doesnt show the translation strings in-game?
file on the right is at UdderlyVehicleRespawn/media/lua/shared/Translate/
looks at one of her other mods
oh.
EN folder.
shakes head in annoyed
oh that is a cool fucking text editor
is there a place for feature requests?
I just use notepad++. I followed the guide in chat history for using IntelliJ to decompile the game java, but frankly I don't like IntelliJ. I'm more of an Eclipse user.
I'm sure my aggravations are just ignorance for using IntelliJ, but damn does it aggravate me.
hey guys maybe a dumb question but does anyone know what is the unique identifier for a given BaseVehicle ?
nvm i missed the getId()
keep in mind that doesn't persist between loads
does any does ?
uhh, I think there is an SQL ID, which should be persistent I imagine
is there a debug option for the foraging system so I can see hidden items and just walk to them?
so I can test the foraging tables that I just made
ah I think I found it nvm
omg that zombie just instant killed me.
hey, so I added some foraging items, but when I gather them it shows up as <somepath>.png not the item in the overhead bubble
how do I get it to show a friendly name?
Hello! I'm sorry to ask what is probably a repeat question. Google searches for the issue often ended with 'ask on the discord!' with no follow up, and a search here hasn't uncovered the solution either.
I'm attempting to make a simple mod to add some alternative food items. In this case, cans of soda. I have added the first item and I am able to find it in the world, I can manually spawn in it in debug mode, it has an icon, and when I drink the soda, it appears to have the custom texture I have provided. However, if I place the soda on the ground, it is invisible during the placing. Once I click to place the item it shows up as the icon image instead of the 3D model.
Is can someone help me understand what I am doing wrong?
{
imports
{
Base
}
item BeefAid
{
DisplayName = Beef-Aid,
DisplayCategory = Food,
Type = Food,
Weight = 0.3,
Icon = BeefAid,
FoodType = SoftDrink,
DisplayCategory = Food,
CantBeFrozen = TRUE,
EatType = popcan,
Packaged = TRUE,
ReplaceOnUse = PopEmpty,
HungerChange = -10,
ThirstChange = -70,
UnhappyChange = -12,
Calories = 140,
Carbohydrates = 39,
Lipids = 0,
Proteins = 0,
CustomContextMenu = Drink,
CustomEatSound = DrinkingFromCan,
StaticModel = BeefAidCan,
WorldStaticModel = BeefAidCan,
}
}```
I do have the model and texture named appropriately as far as I can tell
[MODPATH]\media\models_X\BeefAidCan.X
[MODPATH]\media\textures\BeefAidCan.png
Also, the model is copied from ProjectZomboid from PopCanRed, so I don't believe the model is corrupt, but I don't know if it needs something else to define the texture on the model. Since it shows up during drinking I think not... but I'm pretty lost. Thanks for any help in advance!
You need to create a model on scripts, like
module PRGES
{
model BeefAidCan
{
mesh = WorldItems/BeefAidCan,
texture = BeefAidCan,
scale = 1.0,
}
}
and change WorldStaticModel = BeefAidCan to WorldStaticModel = PRGES.BeefAidCan,
You can see examples on ..\ProjectZomboid\media\scripts\models_items.txt
Thank you! The mod I was referencing must have been outdated. I appreciate the quick reply!
Was that the source of the /say issue? and resolved?
You can patch the lua functions on java objects that call back into the java method. What that affords you is that lua-side calls into java methods can be patched. However, if java code calls that class method, it won't be affected.
For example, if you patched IsoPlayer's getDisplayName(), this: ```lua
print(getPlayer():getDisplayName())
would be affected.
However if java-side code called that method, ```java
System.out.println(IsoPlayer.instance.getDisplay())
that would not be affected.
Dragdown?
Can use this to patch java class methods @summer rune
Worldstatic isnt same as staticmodel
Can you patch a java method before the base game Lua loads? (without overwriting a base-game file, which I think might work)
you can add things to a building's right click menu right?
Yes, there's either a lua event for it here https://pzwiki.net/wiki/Modding:Lua_Events, or an event-like thing in a lua file for the building right click menu. You could use it something like this
function myFunction(however_many_arguments)
--stuff
end
Events.Whatever_it_is_called.Add(myFunction);
(unless I made a mistake or something. farewell.)
ok tyvm, I'll look into this and see if there's something that does what I want
In that case, earliest you can get mod lua code to run is after vanilla shared/ lua loads (but before client/ and server/ code)
see the lua load order
ok, I can copy what the generator does. ty @undone crag
Alas, for I was thinking about changing BodyLocations.getGroup("Human").getOrCreateLocation. 😔 which is used in base game shared
I don't know what you mean but there may or may not be better way than it.
nope, what I want to do is exactly what the generator already does
:o
Cars tiles players item weapons containers
What else can we use to store moddata
If i have a delay timer that i want to be persitent even if people login and out or if the server restarts
How can i do this?
Can use global moddata for the timer
For individual moddata, you can look at all java classes that derive from IsoObject. IsoObject implements the moddata methods
Is anyone familiar with how the herbalist magazine applies the trait to the character? I'm looking through the code and I'm not seeing how it does it.
herbalist:getFreeRecipes():add("Herbalist");
I found that, but it's part of the character creation page
I want to create a magazine like The Herbalist that applies a specific trait to a character.
Traits, as far as I remember (someone please correct me), are just a data structure with a list of strings representing the player's active traits. The magazine probably just adds the trait to it
I'm sure that's the case, just trying to figure out how it does it xD
Same with the generator mag
{
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
DisplayName = How to Use Generators,
Icon = MagazineElectronics02,
TeachedRecipes = Generator,
ReplaceOnUse = ElectronicsMag4,
StaticModel = Magazine,
WorldStaticModel = MagazineElec4Ground,
}```
TeachedRecipes = Generator,
Is that calling something in the lua or even Java, or does that just naturally apply the trait
doesn't the magazine just teach you the recipe, not give you the trait?
For the Herbalist and Generator it provides a trait
all the functionality comes from the recipe, the trait just gives you the recipe
oh hmm
Most of the other code checks if the player has the recipe
to determine whether a herbalist or not
but, indeed there is a trait too
That one just teaches the Generator recipe I believe
And is also the electrician trait that teaches the Generator recipe
yea, I saw that too
i can't work it out - can't find anything special about the herbalist recipe, the trait, or anything that would do this in the functions for reading a book
I wonder if there's a Herbalist recipe like the generator.
one thing i'm thinking about actually
i remember there was a bug before where the new foraging system checked for the herbalist trait, not the recipe, so the recipe didn't work for a while
so maybe the trait you're seeing is fake?
i don't see how that could have happened if the magazine actually gave you the trait
unless that's how they fixed it, i guess
How to use Generators gives you the Generator Expert trait as well
Oh, hey, albion. Didn't recognize you with the diff avatar until now 😅
haha yeah i don't usually have an anime boy profile picture
you're running a mod, that's not vanilla
hmm
yeah, it doesn't
damn
if you want to have a book grant a trait, the public version of my literacy mod still has a book that removes a trait
ReadLiteracyMag = ISReadABook:derive('ReadLiteracyMag')
function ReadLiteracyMag:update()
local pagesRead = math.floor(self.item:getNumberOfPages() * self:getJobDelta())
if pagesRead >= self.item:getNumberOfPages() then
self.character:getTraits():remove('Illiterate')
if ISCharacterInfoWindow.instance then
ISCharacterInfoWindow.instance.charScreen:loadTraits()
end
end
ISReadABook.update(self)
end
```probably should have put that on perform() not update()... but still
and then i had a custom context menu option that would trigger my time action instead of the vanilla book reading one - since this was to get rid of illiterate i didn't have to work out how to hide the old one, though
generator use isn't a trait
it's a hidden recipe
this is honestly not that well written so i don't know if i should be sharing this code as a guide LOL
yea, we figured that out xD
the trait gives you the recipe as does the book
mk
wish i was here to let u know sooner lol
self.character:getTraits():add('Something') i think is probably what they need tho
today i learned you can use single quotes in lua for a string
in linux that usually helps with special characters I'd imagine it does the same
yeah i exclusively use single quotes because i'm annoying
if only it were so easy to remove a trait from the selection screen
i come from C# land so single quotes means char to me
as it does for those who live in similar places
'a' and "apple"
etc
I'm a heathen and come from bash/perl :p
YOU CAN WRITE FUNCTIONS "FUNCTIONS"
uh-huh
i'm from c++ (with some healthy python) but i've been working on zomboid stuff almost exclusively for the last year or so
me too
and last year it was rimworld
lol
the last year bit, not the c++ bit
C++ is the only c family language i havent gotten to
ive poked it, but that's about it
to be honest, i was probably pretty crap at c++, i don't remember actually doing too much with it, i guess i'm just from python
but in *theory* c++ is my main language
The only real difference between c and c++ is how null values are handled, and the entire class system
i got started messing around with toontown stuff, which is an mmo programmed in python 😨
I think I took C++/VB at the same time in college before I took Java, C++ as a first language was tough
when i did C i did C89 tho
you can still write classes in c btw
so it's a bit more of a leap
oh yeah i suppose i did a bunch of vb in college
🤣 but also 😭
but yeah between C and C# i can probably fudge my way through C++ at this point
yeah i've used c# a bunch for unity and i never got deep enough to care about the difference
other than syntax of course
C# is the most beautiful language ever written fight me
yeah i can't say i love c++ syntax
laughs in go
caveat: i haven't tried rust and go yet
yeah
i hear they are very similar
and good
i do plan to try them
idk, their underlying structure is pretty different
like go doesn't have classes for instance
might have been morons lol
I'm inclined to think they might not know what they're talking about, but that's just me
yeah
line terminators bug me more than they should
hmm, is there an "OnRead" for books like there is an "onCreate" for recipes?
the lack of line terminators in lua drives me nuts
i can't say it's too hard for me to get used to using them, but i just don't like how they look
or really anything that will call a function after finishing reading the book
now that I've used more than three languages that don't use line terminators, I think I'd be pretty annoyed needing line terminators again. it really is a pretty antiquated hack because parsers weren't so good back then
you could use the dark arts
I think more traits has a thing that does this because after you read the generator book it adds the generator trait, you can copy what they do
actually it's a bit overkill, you can just hook ISReadABook:perform()
SOTO does it by doing a everyoneminute check
yea, I was looking at your example earlier
soto?
Simple Traits and Occupations
there's nothing outside what are you talking about?
local old_perform = ISReadABook.perform
function ISReadABook:perform()
if self.item:getType() == 'Mod.Whatever' then
-- add a trait or something
end
old_perform(self)
end
oh, I was talking about more traits not simple traits
I know, I was just adding that another mod does something similar by using the everyminute event
yeah, I think most mods right now use really bad triggers
yeah i don't know the exact workings of that mod but that doesn't sound like the best way to do things
I was working on more traits recently and I think there's is an on tick for things like evasive, there's probably a better trigger for that
Does this do the check on every performed action?
Sorry, I'm still really new to modding
every time you finish a book
oh, that's not bad
in retrospect this is absolutely the wrong way to do this outside of my exact use case
ah, it's on player update never mind
Honestly, I just want to create a magazine and apply a trait from a different mod
local old_perform = ISReadABook.perform
function ISReadABook:perform()
if self.item:getType() == 'Mod.Whatever' then
self.character:getTraits():add('TraitName')
end
old_perform(self)
end
is there a tool to visualize vehicle zones in debug mode?
i almost never use debug mode
yes
i wrote a whole vehicle respawn mod blind
function ISReadABook:perform()
if self.item:getType() == "APBPack.Locksmith_Ledger" then
self.character:getTraits():add("Locksmith")
end
old_perform(self)
end```
it's amazing, we're just waiting on the blacklist portion
yeah i meant to do that today but other things happened
i did just fix some bugs
planning to get to that tomorrow
you'll get it done when you get it done lol ¯_(ツ)_/¯
are you going to add scene cars to a built in blacklist?
they're completely nonfunctional
scene cars are their own vehicle scripts? i thought scenes were just normal vehicle scripts
or do u mean wrecks?
I'm pretty sure it was a scene car. You couldn't get in it, but it was like max health and you could take parts off it
it was a vanilla car
I should've taken a picture of it, sorry
it had a special name that I wasn't familiar with
let me jump in debug and see if I can duplicate, I don't want to talk about of my ass xD
does anyone know how hard ZombRand() hits the system?
usually 1-100 or so
so. i enabled a bunch of mods and now the game is just a black screen. relaunching didnt work.
is there a way to launch zomboid in a safemode that doesnt use mods?
like performance-wise? i wouldn't worry about it
yea
in general i wouldn't worry too much about performance in that way, if a mod runs poorly it's probably because of some silly loops or running more often than it needs to than the actual function
not that you shouldn't optimise, but only the big things really matter
I wrote a lootbox mod for our server, and you can imagine I've got a lot of calls to ZombRand, but they're segregated into functions so they only get called when the recipe to open that specific lootbox is called.
generally, the most efficient way to do things is also the one that's easiest to write and follow
(or close enough, anyway)
nah, they're vehicle scenes
You mean for stuff like car crashes you find on the road?
yes
what's wrong with those spawning
sorry the game calls them "storys"
Sure
they don't act like normal vehicles
if they're on the map naturally
But you can still scrap them
why should i care if they are on the map unnaturally
requires a mod, but yes
They're still potentially a bit of loot/parts/fuel
they will despawn like any other vehicles
if you see them then ignore them
so i dont think it's a problem?
i do need to add condition stuff to the respawn mod
Maybe you can slap that into the options you're making?
yeah
if i can find a way to identify these that'd be nice
cuz if they just appear in with NORMAL cars
oof
i imagine they're in with burnt or wrecks
oh, you know what I bet happened
?
No
I have that crashed cars mod, and one of these spawned, but it was a "wrecked car" so it was a scene car, but "wrecked"
oww can you teach me sempai.. how to use animation this way
i can only do the emote ive been trying to figure out how to use setvariale
that reminds me im planning to add a tag to the car if it was spawned by my mod
function SearchJunkTimedAction:start()
self:setActionAnim("Loot")
self.character:SetVariable("LootPosition", "Low")
self.character:reportEvent("EventLootItem");
end
so that in the future one can identify by looking at mod data
doesnt work
i guess u'd have to have a tool to look at the mod data for that
i do tho
:p
others can look in debug ig
it doesn't matter either way, cause if I'm running respawns I'd have salvage on and I'd just tell them to salvage it.
yup
or ignore it and it'll go away if nobody sees it in a while
built-in solution there
drag it into the woods lol
oh, I was going to ask, does it count "wrecks" as a car or does it spawn another wreck
i think i have a mod that does something like what you're trying to do, but i won't be able to check until tomorrow
- Option for toggle between whitelist vs. blacklist
- Option for percentage chance of a vehicle being a wreck/burnt vs. normal.
- Tag vehicles with moddata if they are spawned by the mod so that admins can id them if necessary for troubleshooting/reporting bugs.```
it does not care what you - or it - removed
it has an even chance to spawn any vehicle at any place anytime one is spawned
at present
i could add a bias toward more wrecks when removing wrecks and more normal cars when removing normal cars
but
that would be annoying cuz every salvage/dismantling mod i support has its own code block
and will have its own code for grabbing which car it was
hah
hopefully not that bad
but yeah
anyway if that's desirable i could make it happen
as an option
i think there should always be a chance of one or the other though
nah, I don't think it's a big deal
this is plans for tomorrow
the main issue with cars in general is that there's X amount of cars in the world, which means, there's X amount of metal in the world from cars
exactly
im moving my server to use Vehicle Repair Overhaul i think
yea, we did
it seems more balanced re: salvage
i just pushed support for that tonight btw
sorry it took so long
xD
wasn't hard, just so busy
he's also super responsive, I asked him to give us a sandbox option to disable salvage and he had it like 2 days later
so u cud yeet it temporarily?
hehe
that's good
well no need now, it's in place
tested it
if u want me on hand on ur server to chat up about stuff
feel free to invite me
if u have a modding section or etc
then if u have issues it'd be easier to get in touch
up to u ofc
Sure, I'll make a segregated area.
most pz servers have a developer section of some kind
in my experience
then u can request things and ping me to report things, etc.
oh god i looked away and it's 2:30am
big f
Yea, I'm on nights right now, so I've got another 6.5 hours of work haha

i got it
it works now
you want the code
?
function SearchJunkTimedAction:start()
SearchRecyclables()
self:setActionAnim("Loot")
self.character:SetVariable("LootPosition", "Low")
self.character:reportEvent("EventLootItem");
end
it actually worked
the thing is i forgot to call the function for doing the stuff
lol
What is agood approach to coding something that stops hunger from increasing without overwritting function?
Ow shit nvm i have an idea hehe
Hi there, just to let you know the domain zomboid-javadoc.com is going to expire on the 23rd of december. If you're using the website please consider making a donation on my ko-fi (see my discord profile). If no one cares I'll just drop the website.
Is setName() suitable for changing character's name?
I'm currently trying to implement a function to automatically change character's name and surname on OnCreatePlayer event trigger.
Anyone else having any issues making music for the music mod? when i tried to ran the exe file to add my music to the mod for MP it caused my entire PC to essentially die and all the mod could tell me was there was a problem with the files
Once again, & very seriously so, you have helped me a huge amount allowing me to code what i wanted without errors, i was so close & i knew it, you simply gave me the wording & THATS HUGE! i would've prob given up before coming up with those exact "phrases" so a serious thankyou for helping me when noone else would!
my 2 traits will be refined, unlisted, & you allowed me to play with my friends under the conditions they desire aswell, so u helped more then just me
big thanks!
you do know his the mod author of more traits right?
np man
getPlayer():getDescriptor():setForename("Chester")
getPlayer():getDescriptor():setSurname("Bennington ")
getPlayer():setUsername("LinkinPark")
getPlayer():setDisplayName("Vocalist")
depends on what you need change
i just tested this now using debug and it worked
OnCreatePlayer triggers everytime the character is loaded; therefore it will change everytime someone loads the save / joins the server.
OnNewGame with the player character as arg for function would work better, as it only procs when you make your character.
hazmatList = hazmatList or {}
if getActivatedMods():contains("aSampleModWithHazmatSuit") then
table.insert(hazmatList,"Base.HazmatSuitFromSampleMod")
end
if you are a server admin and you have ideas of mods with hazmat suit pls assist 🙂
i just need to put all posible hazmat suit from diffrent mods
into one table
Yes, I had to refactor some stuff to separate it.
OHHHH i think i got it now
ppl do
x = x or {}
because if x doesnt exist, it makes {}
BUT if it exists, it wont reset it
is that true
that makes so much sense now lmao
Ye, very handy trick
You'll have to manually do this for every mod Or create a tag and ask mod authors to use it. Not really a way around it.
For the NVG stuff I did, I did both
hmmm well its not patching their mod actualy its just enabling theirs to be used as hazmat for my mod i dont think i need to ask everyauthor abt that since im not doing anything with their mod.
im simpling adding their items if the mod exist on the server
hazmatList = hazmatList or {}
table.insert(hazmatList,"Base.HazmatSuit")
if getActivatedMods():contains("AuthenticZLite") then
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuit")
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuitBlack")
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuitBlue")
table.insert(hazmatList,"AuthenticZLite.CEDAHazmatSuitRed")
table.insert(hazmatList,"AuthenticZLite.NBHHazmatSuit")
table.insert(hazmatList,"AuthenticZLite.HazmatSuit2")
end
if getActivatedMods():contains("Authentic Z - Current") then
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuit")
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuitBlack")
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuitBlue")
table.insert(hazmatList,"AuthenticZClothing.CEDAHazmatSuitRed")
table.insert(hazmatList,"AuthenticZClothing.NBHHazmatSuit")
table.insert(hazmatList,"AuthenticZClothing.HazmatSuit2")
end
if getActivatedMods():contains("TheyKnew") then
table.insert(hazmatList,"TheyKnew.MysteriousHazmat")
end
if its not nil basically
but i havent seen it used on other types excpt table
and array i think
i guess this i s all the hazmats not sure if there are jmore
i wonder if i really need to put the getactivated mods cuz it might not trigger an error if it only checks if the player is wearing 1 of the suits
so if it doesnt exsist then it might not trigger error?
anyone knows a code to check two tables if theres a match .. so basically i want to check all of getPlayer():getWornItems():getItem()
and check if one of the items is from the hazmatlist
yes pretty much saves you a line of if
another popular one is
x = TrueOrFalse and A or B
Can u give an example
How is it something whilebeing something else?
X = gettype() and x == true or x ~= nil.
Haha just guessing
it's like
if x then x = A else x = B end
What's the mod where people can carry ingame stuff? I want plants in my house :c
uh gimme a min
How hard is it to code in lua
local function tableContains(t, e)
for _, value in pairs(t) do
if value == e then
return true
end
end
return false
end
you could make a loop of ur table that uses that function
nothing
whats t and e
im kinda stuck lol
ow ok ok
for _, value in pairs(t) do
if tableContains(hazmatList, getPlayer():getWornItems():get(i):getItem()) then
return true end
end
is this correct? @deft falcon
no
u copy this and paste it somewhere at top or something in the code
then do
for _, item in pairs(hazmatlist) do
if tableContains(getPlayer():getWornItems():getItems(), item) == true then
break
[code for when character has hazmat]
end
end
@ancient grail
i think u can break from for loops
yea so do that
it looks like wants to iterate through an array though, so
my item = array:get(i)
...
for _, item in pairs(hazmatlist) do
if tableContains(getPlayer():getWornItems():getItems(), item) == true then
return true
break
end
end
I'm behind on them messages
function Recipe.OnTest.isHazmat(item)
for _, i in pairs(hazmatList) do
if tableContains(hazmatList, getPlayer():getWornItems():get(i):getItem()) then
return true
break end
end
end
oh that works too
yey thnx alot man
now for the oncreate which is me for the first time modding setused delta
is tableContains Lua?
function Recipe.OnCreate.ProduceMeth(items, result, player)
local tank = nil;
for i=0, items:size()-1 do
if items:get(i):getFullType() == "Meth.FreonTank" then
tank = items:get(i);
end
end
result:setUsedDelta(tank:getUsedDelta() + result:getUseDelta() * 30);
while result:getUsedDelta() < 1 and tank:getUsedDelta() > 0 do
result:setUsedDelta(result:getUsedDelta() + result:getUseDelta() * 30);
tank:Use();
end
if result:getUsedDelta() > 1 then
result:setUsedDelta(1);
end
end
i might need to find an api for it if in case
cuz looking at the pz lua it doesnt have anything of that sort
ow snap i did
so if this doesnt work then im back to square one ill try it now on debug hehe
or i think i just need to make 2 for loops
its not
add this to top of ur code
local function tableContains(t, e)
for _, value in pairs(t) do
if value == e then
return true
end
end
return false
end
@ancient grail add this at the top of your code
anyone knows how you get the text from those translate filess? Apparently calling getText doesnt work always?
function Recipe.OnTest.isHazmat(item)
for i = 0, #hazmatList - 1 do
for c = 0, getPlayer():getWornItems():size() - 1 do
if hazmatList[i] == getPlayer():getWornItems():getItemByIndex(c):getFullType() then
if isDebugEnabled() then
print(hazmatList[i]);
print(getPlayer():getWornItems():getItemByIndex(c));
end
return true;
end
end
end
end
got it to work
figured that 2 for codes will work and also my variable was off
i needed getFullType()
first i tried getClothingItemName()
it prints but it wont match the one from the table i did
sinc ei did use fulltype
tableContains just doesnt work btw
when I use thisObject:getHealth() to get the current health of the door, it works. if a zombie starts hitting it, and I call the method again, it also works. it shows the new reduced health. however if I, as a player, start hitting it, then the value from thisObject:getHealth() does not show any changes. HOWEVER if I keep hitting it, I destroy the door nonetheless. Meanwhile it still showed max HP. How? What am I missing
it has 2 diffrent health i guess
since there is the zombie door damage sandbox so it might be cuz of that
like if its disabled for zed to destroy doors
but thats just my guess
ah makes sense now
bro i literally said
to add that piece of code i sent
ahh idint get it
and when i read that part of the chat i had success with the code i did
let me check it again
ahh wow this works too
nice
thnx
can i keep it as a util ? 🙂
Hey could someone point me in the right direction of making arsenal attachments compatible with another weapons mod? Just am curious how you would even add one to a new weapon
utility
yea u can
im reading about pairs and ipairs im not sure if i truely understand the concept.. but for me as long as for i works then thats where im going haha
this is the call in the java door class on the weaponhit event from players this.Damage((int)(handWeapon.getDoorDamage() * 2.0f * n));
and this is the damage method in the door class:
void Damage(final int n) {
this.DirtySlice();
this.Health -= n;
}
Have you read this on SO? https://stackoverflow.com/questions/55108794/what-is-the-difference-of-pairs-vs-ipairs-in-lua
ipairs iterates more or less on arrays with number based entries. pairs iterates on hashmaps/dicts with key based entries
can anyone help, with some insight?
ahhh gotcha
better to do (optimized way)
local hazmatList = {
["item1_class"] = true,
["item2_class"] = true,
["item3_class"] = true,
}
function Recipe.OnTest.isHazmat(item)
local items = getPlayer():getWornItems()
for i = 0, items:size() - 1 do
local item = items:getItemByIndex(i)
if hazmatList[item:getFullType()] then
if isDebugEnabled() then
print(hazmatList[item:getFullType()])
print(item)
end
return true
end
end
end
changes here are .. you included = true just so that its not nil... and then made
this part shorter
if hazmatList[item:getFullType()]
right
why does it have to be optimized tho
i dont think its a havy code anyways since there are only a few gasmask and only a few items on a character
even it's small table this way is anyway better than for .. for .. end end and in future it can have more affect for ur mod if u got my sense
u can use ur method but it's good to u as dev to know optimized ways to do iterations and etc
Isee ok then
Nah, neckbite.
Yep thats what i thought so i noted your version down
Perhaps ill change to it later on but for now i want to proceed with the usedelta part as i dont know a thing about it yet
Im still far from finish woth this mod. But im certain i get this mods lua code done within 3days
Ow must be some tough zed 🤣
what r u trying to do btw
A drug mod
Includes weed meth heroin
I think it was survivor mode. I just got unlucky and was tired so slowed reflexes.
Including production
The weed part for now is unsure if we continue
ownalso cocaine
I have the meth effects done
Iwas suppose to do the heroin effect but ended up starting with the proccess of ontest haha just cuz i thought it would take a long time to gather data of mods with hazmats
My idea of the heroin effect is to allow player to go afk without worrying about logging out
So basically it will make the player not be able to move
And then hunger and thirst moodles stop increasing
Then other moodles like stress and fatigue gradually reduce till the player wakes up
So its an alternative to sleep but has a diffrent way to it
I plan to have the dosage set to 5mins 10mins 15mins
The meth effect i did was the player gets 4 traits
Fast reader ,speed demon,light eater and dexterous
Then after the drug wears off reverts to the players original traits like if they have the negative mutual of these traits
And made sure that if a player decides to logout they will revert back to their setting preventing potential exploit
Im not sure if someone else had the same ideas for afik my concepts are original 🙂
You should include fentanyl and all it does is make the player immediately OD and die lol
Idk what dat is but
This is a comission mod btw so i have a scope to follow and limited creative freedom
I dont with to add to the scope if its alot of work but if a budget would be approve to do this then why not
Heroin can overdose right i should add that
Fentanyl is an opioid that is becoming increasingly common to mix with heroin and cocaine. It's a pretty big problem where I live. You can definitely OD on heroin and coke, though
But! Wait logicaly its imposible
Since you cant move once u took the dose
.. not unless i make the effect of not being able to move a bit delayed
Ah havent heard about it. Not sure if kentucky has that too
Since the server im doing the mod for is RP server and they are set to kentucky
I'm sure it is, but it really began to become more prominent in the past few years, so if they're sticking to the 90s theme then it's irrelevant
Yep that too
Any ideas how useddelta works as far as i know its 0-1 1 being full
But this is probably easy to figure out
Im stuck on the animation part really. I cant seem to make the player lie down without staggering
I should probably require trueactions
how can i easily print out all values/properties of an IsoDoor ?
i am hitting a door with an axe, and i want to implement a feature that players can see the remaining HP of their build structures
Wow
so they can prepare for raids
i already increased the Max HP of all structures. now they need to hit a wall for like 20 minutes.
There might be a chance that it resets tho
the door breaks after hitting it for 2 minutes with an axe. however the displayed HP never changes. only if trigger a zombie and the zombies hits the door, then the hp value goes down.
Back when i was i still playing this game i noticed that some zed hit the same door but i manage to stop them everytime so it dodnt break but the other door broke with i think less hits if i add all the dmg the first took from diffrent occurance of atk
but i can still break the door. and increased Health value works as well, i need to hit it longer
you can also increase thumpDmg, high values decrease damage taken. Just needed that a few days ago.
I would conduct experiment
Try making a new door count how many times a zombie hits before breaking
Then doing the same thing with just half dmg then teleport away then go back
Then count again
If my theory is correct then it will reset the hp
can u help me with my issue? i dont understand why the .Health or .getHealth() is not showing the damage taken by WeaponHits ? But it still breaks the door internally nonetheless. I am certain the Health property is the right one that gets damaged
see here ^
I bet Felkami's zed can 1 hit that door of yours
yeah no idea
i am not doing much, just printing the health of the door in the console. like shown here. and it never changes, but it eventually breaks.
and if a zombie hits the door , then the value goes down
totally weird
yes & i contacted them but i've made enough progress to gain the confidence to release my own mod where the player starts with "invisible traits" that are custom of my own, to try to simulate human error
so i think i got this, untill i start to fail for 5 days in a row & get tunnel vision again
for now, looks nice & things are going slowly but well
Congrats man
Any modder want to come work for us?
PZFG - 600+ members.
lol
How many modders do you need i can recommend those who i know takes commission too
Mind sharing your implementation of increasing door HP? Been struggling myself to
Your zeds are modified right?
Must be cool to do crazy things with them
Haha i discovered before that you can reanimate a corpse but on multiplayer it wont work. Howver when you grab it and drop it it will produce both a corpse and a new reanimated zed
I don't wana be the guy asking dumb questions, but yet i am a dumb guy, with dumb questions
_
local endr = _player:getStats():getEndurance();
^
this results in a print() that =0.9-0.1 rather then what i expected which is 1-100, im willing to tinker for a few hours on it but if anyone has a quick answer it would save me some time!
now i dont understand LUA (yet) in full.. but can i do " local endr = _player:getStats():getEndurance( * 100)); "?
dont laugh
lol
Nah, just standard zeds. A neck bite will one-shot even on regular settings. I should have been wearing a helmet with neck protection but I forgot.
local endr = _player:getStats():getEndurance( ) * 100;
^
Your mileage may vary. I'm extremely tired and prone to mistakes.
i assume that means yes? ill give it a try! i instead first am trying
endr = endr * 100;
This would work too.
thanks again!
I also think lua support endr *= 100 but again, I'm tired and might be mixing up my languages.
sorry if its looked down upon for a non lua man to request random help when i run into issues, but i do get help from some of you, so until told by a mod that im not allowed to ask the questions i ask ill be seen around these chats from time to time asking relatively simple things
yea man ill try them all & see the results & if they differ or are all the same * 100
ty again
Righto. And with that, time to stare blankly at my wall in a vain attempt to sleep with my eyes open. Byebye
Be warned redflag
Claims to be founder of pz but checked with staff he is not
And he wants me to do the work first before he pays it
This is straight up redflag
What is PZFG ? a server community ?
So if anyone wants to go proceed with his mod project then the risk is yours and i did my social duty to warn people
The other case i didnt name drop because i wanted to protect him from being shamed on the modding chat as he is a fellow modder
But this case is different as it is straight up scam like
If im wrong then i take full responsibility of doing this person harm
But i take the risk as i want fellow modders to be safe
lol I didn't realize, he took the discord custom URL, probably devs should contact discord support
I mean, commissioned zomboid mods seems kind of like a red flag already to me
_player:HasACold ----- means the player is sick right? not just, a level of cold? temperature?
as in the player is ill
Click the link idiot. It's to a FAN GROUP.
Do your research before trying to work with someone
Smh
Go ahead y'all. Click it
lmfao
<@&671452400221159444> can one of you take a look at this?
Yes please do
It's not to this server
It's to my fan server?
PZFG stands for Project Zomboid Fan Group. The name is Project Zomboid Fan Group
Nowhere do I claim to be the creator of project Zomboid
Nowhere in my discord either
It's some idiot taking it out of proportion
I mean.. it looks like you do unless project zomboid is the fancy link to your fan server
okay, but wouldn't it do the community more good if you gave that fancy link to this server and picked a new one?
Project Zomboid never took it. It was available way after Project Zomboids discord was even made
If PZ wants me to change it I can
But I won't change it till otherwise told to
idk, seems pretty suspicious to me not going to lie
Im not trying to be PZ. I don't even want be them. It's only a fan group
Just to follow up, a modified version of this was the solution. The mesh path did not need WorldItems/ in it. Thank you for the solution!
they're not going to lie, you're doing a poor job of communicating that it's a fan server and should consider changing it on just that alone
Thanks for the tip! This combined with what Dislaik posted got me to a solution. Thank you both!
There I changed my bio to make it easier
Trust me, I'm not trying to immitate Jack shit
Keep it for now 🙂
Better a fan project than a scam, but we'll reach out to Discord if there would be a way for us to switch ours while keeping discord.gg/theindiestone which they said would not be possible a couple of years ago. Who knows if anything changed.
Sorry for the suspicion it's getting you 😄
Thanks buddy for clearing this up. Thanks for approving it. Cheers 🥂
I wonder if you could have one server bounce people over to another
Sadly that wouldn't work. They would loose members doing that. And they wouldn't be able to get it verified
it can also resolve in new scamming methods arising that would make discord almost impossible to use.
Yes that as well rage
lol
Does anyone has a small snippet that prints all properties of an IsoObject like IsoDoor, when i pass it the object ?
function printAllInfo(obj)
print("DEBUG - printAll() - start")
for key, value in pairs(obj) do
if value then
print("["..key.."] = "..tostring(value))
end
end
print("DEBUG - printAll() - end")
end
i wrote this real fast, any better ideas?
you need quite a few members to get a vanity URL like that to begin with. so you can't just bounce people to another server
isn't this documented already?
i want the values of the object, printed out. sorry if i did not explain it well enough
ah ok, I thought you were looking for keys My bad
you can still get the types from documentation if that helps
is there a way to check if a value can be converted to a string without raising an exception?
Nope. Looks good
I'm not quite sure
thanks 🙂
i think i got it
if type(value) == table and not value["__tostring"] then
value = "--no conversion to string--"
end`
it is awesome that everything is a table in lua. such a breez. need a function? just get it from the table hashmap. done 😄
No problem man
anyone know this mod to glow containers?
it is no mod
that's the unstable build
comes with the new 41.78 version of PZ
endurance is 0 to 1, unlike most other stats that are 0 to 100
basically treat it as if 0.5 was 50
it throws an error Expected a table for the for loop with pairs
The next update will add it. It's gonna be so cool 😎
any idea?
Check for typos. I've made that mistake before
Or if you're trying to run too much at once that could also be it
Could be it
Javadoc Project Zomboid Modding API declaration: package: zombie.iso, class: IsoObject
yes i am trying to check an IsoDoor
Javadoc Project Zomboid Modding API declaration: package: zombie.iso.objects, class: IsoDoor
if thisObject["getHealth"] then
local health = thisObject:getHealth()
end
this is working, specifically this row thisObject["getHealth"]
so why can i not use it as an table then.
i want to print all properties with their current values of a IsoDoor into the console.txt. Can you recommend a short snippet?
since mine is not working
is moddata a table?
there you go
thats why u cant use it as a table
i can not follow. sorry. getHealth() is part of the IsoDoor https://zomboid-javadoc.com/41.65/zombie/iso/objects/IsoDoor.html#getHealth() and i can read it like i would with a key from a table. Where does moddata come into this? u lost me 😅
you're trying to print all values on IsoDoor right?
yes. without putting them all in one by one.
IsoDoor has moddata, so your code is breaking when it reaches moddata which is a table, is what they're getting at
KahluaUtil.luaAssert(o instanceof KahluaTable, "Expected a table");
yes you can use object["method"] but its not specifically a KahluaTable. just because it looks like a duck and quacks like a duck doesnt actually make it a duck
my code fails at row #3 with the message java.lang.RuntimeException: Expected a table
oh i didn't see that 😅
i feel like tyrir had something like this, but i think that was specifically for inspecting the metatables - probably doesn't work on objects if they don't count as tables
ohhh okay. so how can i read the properties with their values of an IsoDoor without copy & pasting every row of the documentation?
offhand i dont have a solution and not really in a position to test for one atm (i may have solved this at one point ages ago, can dig through my stuff later)
maybe you can make a table of members from the metatable and then loop through that on the object
@quasi geode A bit back you gave me the code for your Buyable Traits mod. I have a few more adjustments I'd like to make to it, but once I do may I post it? And if so, what kind of accredidation would you like since the original on the workshop no longer exists?
Search for tyrir and printr or what it's called.
thats not a bad solution
he has a very detailed print function
go ahead, and w/e if you use some of the code just comment in the code where it was taken from
local metatable = __classmetatables[zombie.iso.objects.IsoDoor.class].__index
for k,_ in pairs(metatable) do
object[k] -- ...
end
```i think would work
thank you, a lot. i will try 🙂
Okay cool, thanks!
just to point out in your snippit here, you should remove the if value then stuff, its unnecessary and will skip printing any values that are false or nil (both will convert to strings)
you can probably bypass nils if desired but i'm pretty sure your going to want to output those falses.
yeah , true. i for sure want those falses, since i am on a bug hunting mission 😄
The fields?
yes, all available fields with their current value.
Try this
It will print out the static and instance fields in addition to methods
If you have the output in an ANSI terminal and set ANSITerminal to true, it will do the coloring too
UdderlyEvelynUtils.inspectJava(isoDoorObject, "[Ii]nventory") what do i have to put in the second parameter for the IsoDoor object
The second parameter is optional. It is a lua pattern to match against the field/method name
Yep more wizardry
e.g. if you want only the 'name' field, you'd put 'name' as the 2nd arg. If you want all fields printed, pass no 2nd arg

fantastic. and output is the console.txt.
Have you tried comparing the health of the door on the client vs the server? I've noticed some desync issues on vehicle damage from players vs zombies
no, not yet. i have been also thinking about some desync. or maybe missing sync back to the client. but what would my solution then be? i cant flag an object as dirty or can I? so i have to get the information everytime from the server?
for my side of things, trying to manage vehicle damage, I'm going to verify the actual issue and report it on the bug forum, then probably manually handle updating the vehicle with a command until the bug is fixed.
what I've been seeing is parts on a vehicle can be "destroyed" on the client by zombies, but reloading the game or just getting out of the car and hitting the part myself with a bat will make it reappear with only the damage from the bat
that is mysterious as well 😮
the magically bat repair.
the russian way of fixing things. 🙂 that is at least what the brother of my wife taught me. hit the computer a few times and then it works again.
just have to hit the right resonance and everything falls into place
---@module 'JSON Database'
local DB = require 'JSON Database';
DB.Connect("default")
local result = DB.execute("SELECT name, displayname FROM players WHERE name = Test2 AND id = 3;");
--[[for k, v in pairs(result[1]) do
print(tostring(k) .. ": " .. tostring(v))
end--]]
for i = 1, #result do
for k, v in pairs(result[i]) do
print(tostring(k) .. ": " .. tostring(v))
end
end
omg +200 lines only SELECT statement, but I'm happy :)
did u reimplement sql for json text files?! or what is a JSON DB ?
yep, using json like database
{
"test" : [
],
"players" : [
{
"name" : "Test1",
"displayname" : "Tes1",
"id" : 1
},
{
"name" : "Test2",
"displayname" : "Test2",
"id" : 2
},
{
"name" : "Test2",
"displayname" : "Test2",
"id" : 3
}
]
}
very cool. nosql key/value datastorage with sql like syntax.
Anyone want to make a mod for me? I want to get a t-shirt launcher
make sure when it hits a zombie it knocks it down, but when it gets back up its wearing the tshirt
Very persistent
make the zombie slower, the more it wears.
🤔 if you strip the zombie after you can repack the tshirt to shoot it again
m_Tint's type is ImmutableColor
does anyone know if this is correct to write an xml file like this?
<RandomData>
<m_Tint r=0 g=0 b=0/>
</RandomData>
u could be decorating zombies from a distances, with shirts, pullovers, hats and all kind of things
perfect for the christmas time 😄
Indie Stone said I was alright
So stop trying to lie to people
As I was asking earlier...
Anyone want to help?
sorry guys and gals, i have another question. i know i am shooting them out today. But it is all part of a big mod.
local square = getWorld():getCell():getGridSquare(12759,4956,0)
local objs = square:getObjects()
for i=0, objs:size() - 1 do
... some stuff ...
end
somehow my square is null? Exception: lang.RuntimeException: attempted index: getObjects of non-table: null at KahluaThread Any idea why? It is called on the ServerSide in the OnTick Event. Do I have to use getOrCreateGridSquare instead?
Not quite sure on this one.. 🤔
The indie Stone said it was ok
@iron salmon I'm really sorry for pinging you, but he's still going on about this..
I changed my bio too
And that's for my server? Not this one
He said I could keep my invite link
I'm the founder of MY server. The fan server
You are just misunderstanding
Why is this in the modding channel
Its misleading and you dont wanted people to work first then pay. . Ok ill just let you be
Ill remove my post
I was questioning you because someone told me you are not reputable. And then you blocked me
So that is suspicious as hell
I even changed my bio after you misunderstood me
But one of the Indiestone said I was all good
See?
Im not reputable? Somekne said that? When did i ever scam anyone
Not that you scammed, but that your work is trash
Not trash, but just not good
For the price you were charging
Imoght not be as good as alot of the modders but i do the work
I've had mods similar done alot cheaper
<@&671452400221159444> you probably want to step in here
I think the two of you either take this to DMs or just flatout stop
Most of the time you cannot know when a square will be loaded, so you just have to manage the nil case by doing nothing.
I apologize, I don't know why he is still saying I'm scamming people
Yep im stopping
I am too
that easy, huh? i thought i was doing something wrong, the whole time. thanks for clarifying. 😄
anyway, is there a way to add a foraging item to the map in lua?
I'm not quite sure. I wonder if Google might have something?
Probably has a table that you can insert the item
oh, i never tried google, thanks Sherlock
I was just trying to help geez
no, you're being an asshole
???
lay off me okay, I told you to get out of my DMs and now you're harassing me in this server
just lay the fuck off asshole
I'm trying to help??
no, you're posing as someone trying to help just fuck off
I have no real skin in any of this. I think people could easily mistake the bio still, and I think you two legit just got each other on the wrong foot due to a discrepancy in expectation on what it'd be like to work with each other.
I understand trying to warn others of each other, but as long as it's not legit a scam, it's not really going to be any sort of "impartial review" or the sort and as such should be kept away from here 🙂
As I said, we're reaching out to Discord about the possibility of switching to "projectzomboid" as the vanity URL while still keeping "theindiestone" to prevent the potential of someone pretending to act in any official capacity, but as far as I understand it - and I didn't check yet - Keepie's server is just a fan group as they said, and they mentioned they're open to free up the URL too if need be, so I'm intended to believe there's no malicious intend there.
Ok..
https://steamcommunity.com/sharedfiles/filedetails/?id=2677920531 check out this mod. it has everything regarding forageing. this dude is fantastic. u can see how foraging works.
tyvm!
Let's keep it civil in here too 😄 
I like that idea
sorry guys for quite spamming about this but i am having serious trouble understanding why this wont work
im trying to get a static color to appear on an outfit
<m_items> <!-- Face -->
<probability>1</probability>
<itemGUID>a3a1ca7b-4ded-43fe-be01-dacfdfef68aa</itemGUID>
<RandomData>
<m_Active>false</m_Active>
<m_Tint r="0" g="0" b="0"/>
</RandomData>
</m_items>
for some reason the clothing item still wont have a static color and will just pick a random color
I could assist you in DMs if you don't mind
sure
forageDefinitions.lua heres the lua that might have the the table
i fixed it with this
local endr = _player:getStats():getEndurance();
local endr = endr * 200;
somehow this rolls me a 2-200 so... ummm.. w.e, i dont get it but it works
thanks, but doesn't that just add it to the things that might possibly show up? I'm talking more about making an item spawn at a certain coordinate in the foraging system forcefully
ohh.. why use the foraging for that?
I'm working on a change to hydrocrafts hunting system and I thought it would be cool to integrate it into the foraging system, but I would need to Make a animal track item spawn nearby the player if they are holding dung
maybe just try to see if they are in forage mode and then spawn these tracks in front of them, without changign the forage system
Ow wow thats much indept.. you could replicate the function that would seem like its foraging
Imean thats not a proper solution but it might work
the whole forage system is based on chance/rolls/randomness and differenct locations like forest/farm/city/... what u want is kinda different. but i mean u can make anything work
I mean, it is but it also isn't. if you go into debug mode you can see that the game already knows where stuff has spawned and it's just whether or not you walk close to it basically
You might want to check how it triggers
So i guess if you could first forcefully trigger the forage with just any items then next step would be to replace the item.. im not really sure but thats howni would approach it mostlikely but im sure there are better ways
so in theory I can just jam my own items in the same way that it does probabilistically
this could actually work pretty well
Does it have to be part of the forage system? If not then yeah you could probably just replicate the function then instead of it relying on chances it will be triggered by your event (the force spawn function) then instead of it looking for items on the table it will just show the item u want to spawn
Its like reverse engineering it to something else but looks similar sorta
i think it only spawns a handfull of those forage-nodes if u are closeby to them. and that would result in a very very short hunt for an animal, like in ur case. u are probably better off using the UI overlay and mode of the foraging system and then add ur own logic.
Yeah this is a great trigger
Tho he wanted to do jt by force on specific tile
So this might be more of a requirement instead of the actual trigger
Or could be both
Like if player is near the tile and if the foraging mode is on then do function
here is a starting point for u
local mode = getSearchMode():getSearchModeForPlayer(playerObj:getPlayerNum())
getSearchMode():setEnabled(playerObj:getPlayerNum(),true)
thanks, I'll note that down along with the other example mod for when I get around to trying to implement it
there's a TON of stuff to fix before I get to it, but just wanted to know if it was possible for when I get around to it
I hate how current HC is just stand next to random item and rub hands together lol
for sure, for sure. I made something similar. Different use case, but similar. and the two functions above are the biggest part of the magic.
Im curious to know what u did lol
oh yeah, I mean it doesn't fit thematically with HC (or zomboid really), but seeing that there was a "on the apex of a swing" event, I immediately thought it would be great for a magic mod 🙂
hunting pokemon cards, in toxic zones or weather events like thunderstorms, fog or blizzards.
swing a wand at someone and fire comes out, that would be cool
And players did looked for it? Sounds awsome , what are the cards for?
RP collection?
it is the currency on my server.
Owww shiiiiz thats unique
u can combine cards in their evolution class to make them more worthwhile and different gimmicks
Do they have rarity?
that's actually a good mod damn
How many cards did u manage to turn into items? Sounds like alot of work to be able to catch em all
🤔 you could probably use a drainable and modinfo to make a pokemon deck too
there is a pokemon card mod published on the workshop. it is not mine. but it is only the items and 3d models. i patched in all the funktionality
Damn imagine making some of them admin spawn only and u make it as a prize for events
Daaamnn thats gonna make players login for the event
yeah i have all that with automated events, where u get notified ingame before hand 😄
Ow wow so you have an inproved servermsg mod? Sounds cool
overhauled chat system, radio system and other things. yeah ton of work. but sadly i dont have enough time to implement all my ideas
I wish we had that sort of thing before . Its pretty hard to make players read discord updates . Players tend to rely on faction members to tell em upcomming event
true. right now i am struggeling with the pvp and raid systems. i want people to be able to check the HP of their build structures
but i am fairly certain at that point the HP data on the IsoObjects is not always in sync with the server.
Hey , I have never modded anything but I’ll like to start. could you tell me what do i need learn (I do know python and c++)? the mood that I would like to accomplish is a "training whistle (amulet)"
1.- should be droppable from killing zombies
2.- character stats such as: hunger, thirst, weight, stamina should be displayed(on bars) at the top right corner of the screen, once the whistle is equipped
3.- should increase wearer xp yield by 1% on everything
So, maybe I could manage learning 1 and 3 on my own, but I have no idea how to do 2 (bars that reflect current stats)
even in SP that's something I want lol
Hmm if theres a problem with that why not make another hp bar that you control
Just make the doors unbreakable but then your hp bar lowers then just trigger the door breaking by force
lua basically, all modding in PZ is done with lua and some custom .txt languages
for #2, there's already a HP bars mod that you can cheat off of. Basically just hide the bars when an item isn't equipped. Should get you 80% of the way there
here's link https://steamcommunity.com/sharedfiles/filedetails/?id=2004998206
it crossed my mind. however there is too many parts of that equation. the WeaponHit registration, the update to the clients, the animation, the animation of the object getting hit (like the door rattles). it is just too dirty to implement my own HP system , just so that i can display the actual HP.
Hi
For starters you might want to check the pz media folder
That contains all the vanila files
As you can use that as reference
And learn lua
🙂 You can get more info from pz wiki and forums
Also github
for #3 there's an onAddXp (I think that's how its spelled) hook that you can use to add even more xp
Hmm .. i get it..heres an idea
Dont make it consider all those stuff and make the hp something like per hit
So whatver used to hit it will always be equal to -1
#1 is just adding the item to a zombie loot table btw, there's plenty of examples in the zomboid vanilla folder (which is another great place to look for modding cheat sheets)
Now the doors will then have dor example 10hp
Then if a player strikes it 9x then zed will just need to hit 1x to destrooy it
Just make it so that the door hits orginal function is disabled excpt for the animation
my idea was to make only 1 item, that is expensive to craft, that can be used for raiding. that is like ur idea. but for that case, i would need the ability to make doors and barricades unbreakable. i have not found a way to do that.
thanx for everything, I’ll give it a try
Goodluck 🫡
I wish the PZ hooks for stuff like "on hit" could return false if we wanted to block the hit event
yeah. this.
so true/nil return is "let the thing happen", false return is "stop this from happening"
I suggest trying to create an item first using vanilla resources
Then try recipe .once you have done that then proceed to lua 🙂 thats where i learned
I guess it never occured to them that modder would make stuff like this
Is the onhit collision based or is it proximity based
Ah wait nvm i know the answer its based on the weapons range
i think they calculate the apex of the hit animation and then go by collision from that point. with weapon range and other factors.
I mean, its not really documented, but onhit should trigger, you know, when the weapon hits something
Nope its just the weapons range
idk if that's how it actually works
that is what i meant
I made a weapon with long range but its melee and its just basically the catfish sprite
And the sound i used is the flute
XD
Just for the sake of tryng out stuff
I should make a mod where if you crouch over and over it spawns a red brick at the player's feet
whyyy. all i do is crouching
What is the purpose of the brik
make it a silent throwable bomb that spawns no fire ¯_(ツ)_/¯
and has a 1 tile range
so you can throw it at zombies
Lool 1 tile throwable
explosion range that is
Its like you tried to smash it but its heave so you dropped it lol
XD
Seems like this is a parent mod for a future mod that uses this
also the purpose is so you can shit bricks 😎
