#mod_development
1 messages ยท Page 518 of 1
That was me. Was thinking that you address your message about software for code to everyone, but it's probably for anger.
forgot he also did some blodsugar thing ๐ฎ
OKAY i have notepad++ open and an LUA plugin but it isn't all pretty and color coded like i've seen other's be
No idea how to create a new PR with folder. Can i just drop translated words here? :D
Maybe click the language bar -> L -> Lua?
THANK YOU god it was so simple
|:
@cold burrow of course, just DM or on the workshop
@undone crag and @bitter frigate are you guys working together?
he's helping me quite a lot so in a way yes! he's on the list of people i'm going to thank whenever i get the mod in a presentable state
I was just sending messages here to help him...
D:
You don't know my steam account SO HA
It will just be a mysterious internet anon.
it's true u will!
(plz mention me not ._.)
u got it dude!
anger do credits like
"credit by me and only me "
just kidding ^^
how does it go along with the mod ?
yes yes ALL ME i came from the womb with my understanding of LUA FULLY FORMED and not EMBARRASSINGLY LIMITED at all
well the good news is 2/3 of the current code is in a working state! it's the last bit i'm having trouble with. i can't get it to cooperate
^^ yea i had like 3 lines of code of Fenris_Wolf maybe 4 which was like the lines of code i tried to find for like 1ยฝ day with no breaks out of my +100 lines of code to make my mod to work. and i had to ask few times here before he saw it and said he found it in few versions ago and i dont think he ever really used it completely
yep had the same problem all worked for me as well except the last 1% ๐
can someone please tell me if it'd be possible to create a QoL mod that autofills your last character build into the dropdown slot upon getting to the character select menu
so all you have to do is click start if you want to use the same character as last run?
pleeaaasee. i just need to know its possible then i can start on my journey of learning to mod
VSCode is great
Isnt that a feature already in the game lol
Isn't that the "Save template" button you're describing
^
That doesnt "Autofill"
i think @weary matrix did something like that
just allows you to select a build you saved
yea but everytime you goto the character selet screen you have to click the menu to select your preferred character again...
You legit just click the dropdown and select the build
dont know if he ever finished it
i want it to be autofilled
It takes like 1 second
kaiser don't be dumb...thats the definition of QoL. to save seconds over many instances
"One second is all you need for improvement"
damn he came in hot
i will say most of the time i just want to respawn with the same layout ^^
If you're too lazy to click 1 button then how do you have the patience to play PZ
Well, it could takes weeks or month to get how to do that.
kaiser don't even try to debate this stupid point...
Idk I just don't even see the purpose of a mod like that
kaiser it one time with the perks 1 time with map 1 time with the charector ๐ so atleast 3 sec ^^
I wrote a transaction handler in COBOL
he offered you a potential solution that is like 3 clicks. it's not exactly what you're looking for but he still offered help
and you come in hot
Its not even 3 clicks
I'm outie, not playing this game with you lmao
thats not a potential solution
Alright everyone chill
You click the dropdown, select the one you want and hit "play"
answer the question. do you code?
anyone know where lighting parts like lamps are found in the scripts or if they are somewhere else
kaiser are you a programmer?
I just told you I wrote a transaction handler in COBOL
but you probably don't even know what COBOL is lmfao
and you don't optimize your code apparently because seconds don't matter
'lol you don't know what cobol is lmfao'
wow you just proving your terrible character
This isnt coding chief this is a video game that requires patience to begin with, that extra 1 second isn't detrimental to your play experience
low life over here
Look, Kaiser gave a "wave the wrist" answer - thats fine, but not what you're looking for. Move on.
Don't name call here
A QoL mod is one that helps you do something quicker
LOL
just a reminder to be nice in here.
Selecting a chatacter using the BUILT IN QoL feature
Is there a mod that helps me click "start new game"
wow as in doing something like selecting the previous character quicker? way to completely invalidate your own original point!!
just because its too granular for you
doesn't make it pointless
I need help cus that extra click really makes my wrist hurt
whether it saves half a second or 10 is irrelevant lol
its saving time
get over it
Once again this game is all about patience
congrats you just invalidated your own argument. good job.
as you said a QoL mod is one that helps you save time
now you are saying it only matters if it saves more than 1 second? is two seconds enough?
where is the spectrum of time saving that it becomes worth it for your pedantic nature
I came here with a pretty straight forward answer and you called me a dumbass and kept pestering me about my programming knowledge
no you didn't come with an answer
Enough. This is getting both heated, and off topic.
People chill.
Its built into the game chief
you said this qol is pointless because it only saves ONE second lol
because apparently one second isn't enough for your standard of optimization
get over it
oh jesus y'all are still going. i went to go get a snack
people make mods we don't like, it happens. no point debating or deriding over it
so drop it.
gladly
so back to my original question. despite how little time it would save - is this QoL possible to implement
?
thats all i wanted to know
not whether its worth attempting or not
I did? ๐
@weary matrix do you think its possible to implement
regardless
?
kind of amazed that no one will give me answer to this question
be patient dude sometimes it takes a couple hours for somebody who knows and cares to share to meander through
Or days. :D
i've posted this question a few times within the past 48 hours..
i've been pretty patient
but fair point
speaking of questions anyone well versed with the lighting system in general
If I think something isn't feasible I don't like to say anything in case I'm wrong + it discourages someone? ๐
my advice is start looking into lua in the meanwhile. people are GENERALLY more willing to help when you come with an honest effort at coding it yourself
does this sound infeasible? you can say it lol
yea thats fair
As a mod, that feature would have issues in MP, in that the client and server have to have identical sets of mods running, so, if you wanted this to make logging into servers etc easier, it would depend on the server using it? That's the main issue I see.
you dont need to ask if its possible or not programming is all about trying things out and learning from your mistakes and experience along the way
unless you are concerned about wasting your time
yea thats mainly it
thats a good point
guess i couldn't just make it sp only
i haven't tried mp at all yet so
should be definitely possible but maybe not as simple as it sounds
yea as i thought about it more i realized its probably pretty complicated to implement for what i get out of it
not exactly sure I understand fully what you mean
it'd just autofill your last selected character build into the character template dropdown
so you dont have to bother with that if you want to use the same character as last time
it only saves like half a second
but i thought itd be a fun way to introduce myself to modding
and i like saving small actions
i mean thats programming right... ?
anything we do a handful of times repetitively could be worth optimizing usually
yes it's programming ๐
right...which is why i was dumbfounded by the previous responses...
I'm not sure, but maybe this would be helpful. It's Light API code.
https://github.com/Konijima/PZ-Community-API/blob/master/Contents/mods/CommunityAPI/media/lua/client/LightAPI/LightAPIClient.lua
what programmer in their right mind is going to berate someone for trying to optimize something...
mind blowing
how so? I haven't backlogged the whole conversation
Oh people act confrontational on the internet as a recreation; it's silly and unfortunate, and people who do that are better ignored.
totally
oh sick thanks ive been kinda aimlessly wandering trying to find anything about it
life saver
i just don't expect fellow programmers to say "omg you're trying to optimize just ONE second, how dare you"
holy shit @weary matrix
https://steamcommunity.com/sharedfiles/filedetails/?id=2737665235
congrats
Well, my wife is a university professor who teaches critical thinking, and she was telling me about this study she was reading about how people can say all sorts of things on the internet?
Hold on, that was not it. Your original comment didn't indicate that you were already aware of the save template button hence my response. Please re-read
Can we not? ๐
yea lets not
don't make me get the popcorn emoji
Just clearing my name of being "confrontational" or anything like that. Always down to help people
How to add new context button for specific item SubCategory? Any simple examples?
The popcorn gif means that the hallowed purpose of the workshop channels has been disrupted.
That makes Pat Bren sad. We don't want the hero of VHS tapes being sad ๐ข
yay! ๐
Oh, interesting example. Will try to read it. :D
Thank you. :)
maybe it was someone else then ^^
thats why you never wrote to me when i said i wanted to make a dynamic items ;p
Oh, I have pings disabled/headphones off/afk etc all the time too ahahaha.
I'm like a grandparent with their smartphone notifications with discord.
xD
"Why did my microwave beep? I don't even own one?!?!"
is there a way in lua to detect a zombie hit or kill?
whenever the character hits them with any weapon or firearm
try this maybe https://pzwiki.net/wiki/Modding:Lua_Events/OnHitZombie
thanks, appreciate it 
or this for the death: https://pzwiki.net/wiki/Modding:Lua_Events/OnZombieDead
great, thanksss
:)
Thanks @weary matrix finally a way to bring up this corpse that I had thrown out the window ! Great job
hehehe love your comment on the workshop โค๏ธ
I'm still laughing about it ๐
can anyone help out with this?
do
local CharacterCreationHeader_create = CharacterCreationHeader.create
function CharacterCreationHeader:create()
getPlayer():HasTrait
if player:HasTrait("valkyrieWoman") then
CharacterCreationHeader_create(self);
self.genderCombo:setVisible(false);
MainScreen.instance.avatar:setFemale(true);
MainScreen.instance.desc:setFemale(true);
end
end
end```
getting a nasty syntax error cause the trait "doesnt exist"
ProfessionFramework.addTrait('valkyrieWoman', {
name = "UI_trait_valkyrieWoman",
description = "UI_trait_valkyrieWomanDesc",
profession = true,
})```
I used profession framework, and it very well should exist
idk why the game is refusing to read the trait, probably cause its linked to a profession?
they're all in the same lua file
obviously I'm setting the trait first and the function later
can you show the error?
lemme go make it again
oh wait sorry
do
local CharacterCreationHeader_create = CharacterCreationHeader.create
function CharacterCreationHeader:create()
if getPlayer():HasTrait("valkyrieWoman") then
CharacterCreationHeader_create(self);
self.genderCombo:setVisible(false);
MainScreen.instance.avatar:setFemale(true);
MainScreen.instance.desc:setFemale(true);
end
end
end```
using this one
looks better, but still need the error
hum looks like your code is called before the player is created
I guess this would be a good way: https://pzwiki.net/wiki/Modding:Lua_Events/OnCreatePlayer
that wouldn't work
what does the game mean by creating player?
does it mean going to the character creation menu
or actually spawning in the player after everything is customized and selected
no it's when the IsoPlayer object is actually instantiated
yes
yeah that wouldn't work
I'm trying to remove the gender option if the player picks a profession
so when they go through with the profession into the character creation menu
there's no option
you'd probably have to hook a function from the character creation panel, just to hide the field, and in OnCreatePlayer() just set the value you want
do
local CharacterCreationHeader_create = CharacterCreationHeader.create
function CharacterCreationHeader:create()
CharacterCreationHeader_create(self);
self.genderCombo:setVisible(false);
MainScreen.instance.avatar:setFemale(true);
MainScreen.instance.desc:setFemale(true);
end
end```
if I remove the trait thing, it works
but it obviously disables the gender option to EVERYONE involved
not just people who picked the profession
ah right
what a pickle
hum in client/OptionScreens/CharacterCreationHeader.lua there's a self.genderCombo.selected field, guess you try to check that value?
ah no wait
sorry that's not working either I guess
is there a way to check for a player's occupation instead of trait?
maybe that would work
I made the trait just to hook up with the code
the trait coming from a profession
how would that solve the issue about no player created yet at that time?
I'm assuming the game is trying to find a trait that only comes into action on character spawn, and hoping that maybe professions dont function in the same way
xD
unlike traits, professions impact the character creation menu
like starting as a firefighter gives you firefighter pants
u know?
so I'm hoping the game checks for the profession
as it transitions into the character creation menu
hum I guess you could hook some function in CharacterCreationProfession.lua and check the value in self.listboxProf.selected?
I could try
Ooh teaching critical thinking. I have myself been thinking about and discussing the human mind and its failures and improvement and I think it would be good to talk about a facet of intelligence that is not spoken about much.
It's all right knowing how to structure a logical argument, but that is not going to guarantee putting it into practice consistently.
It's all right having a concept of objective truth, but that may not itself confer immunity to delusion.
It's all right reading a list of top twenty logical fallacies, but that may not be enough to not need lists of logical fallacies. There's even the "logical fallacy fallacy".
There is the trouble with people having compelled thought, with their motivated thinking, with them at one moment not being aware of their reasoning at another moment though they be in contradiction. There is the lack of introspection. The lack of thinking about thinking. People often do not know themselves. They do not scritinise their thoughts. They do not just decide their opinions with thoughts, their thoughts are sometimes controlled by their opinions.
This is made possible by a particular mode of thought protecting itself from the sort of awareness you would have of ordinary things. People lack the awareness of their own thoughts to notice when their thoughts is being compelled and their awareness is suppressed. They have the thought, but not the metathought. Some of the best reading I have done on it has been writings of an occultist.
Also that will glitch like that for a character without the Valkyrie trait. It's only running CharacterCreationHeader_create(self); after the check, so it will not create the menu if the character does not have the trait. If you change the code to have a check that works, you are going to need to run the original creation function in all cases. Like this in the replied to example.
do
local CharacterCreationHeader_create = CharacterCreationHeader.create
function CharacterCreationHeader:create()
CharacterCreationHeader_create(self);
if player:HasTrait("valkyrieWoman") then
self.genderCombo:setVisible(false);
MainScreen.instance.avatar:setFemale(true);
MainScreen.instance.desc:setFemale(true);
end
end
end
```(Farewell)
good point
My guy brought ladders to PZ praise you โค๏ธ
it's just that I really wanted to be able to climb those ladders haha
so im completely new to modding with lua..i was wondering how would you add a new trait, do you need to add a lua file under the \shared\NPCs
for the traits
since im basically going only off of another traits mod since i can't find any guides
https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How to make a custom trait.md is this relevant to you?
oh dam thanks
this will make my life much easier
yeah!! good luck dude i've been camping the main tutorials page for a week. many more things that may be helpful here https://pzwiki.net/wiki/Modding
The police variants of the cars don't let you switch from front to back seats or access its inventory, does anyone know what attribute set this behavior?
welp. . im hearing other npc getting jumpscared, eating and drinking . .
for the UI_trait parts, how would I add the description and title into the game? it doesn't really state where I would be able to add that
idk i might just be dumb dumb
like how would you construct your mod folder?
yes, but do i need to add a text file there or an image?
that's free asmr, right???
ok as far as i know for pretty much everything it's gonna be a text file u need. there are a few specific instances where that isn't the case but i don't think this is one of them.
good luck!
Not sure, but could be coz they are defined as separated seats group in:
Steam\steamapps\common\ProjectZomboid\media\scripts\vehicles\vehicle_pickupvan_lights_police.txt
Is that a mod script or base bame?
It's a base game. I just update path to file in my previous message.
i continue to feel AMAZING every time something works the way i'm reasonably sure it's supposed to. does this wear off?
i love having random jumpscare while im in my base cooking
also raids from npc spawning targets your current character, right? so hoping to another one would not target
Nope, never. But you will feel it less and less while you will be more experienced. Coz hard things became pretty common for you. :)
im still having trouble with this title and description of traits man

ive looked at the code of a few traits mods and looking in the UI folder and seeing no text file related to the title or desc of the trait
concerning me a bit
I think this is referring to https://pzwiki.net/wiki/Dash_Bulldriver
Only 2 seats
But thanks to that I found what I was looking for
in vehicle_car_lights_police.txt the passenger RearLeft has:
}
switchSeat FrontRight{
}```
Its empty thats why it won't work
Thanks @cold burrow
Oh, np at all. :)
Oh, clever way to make it works. :D
Hey all, when modifying drop tables in this manner:
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "Base.TinnedBeans")
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 0.01)
What does the table value (0.01 in this case) represent? Is it a percentage, or a weight? If it's a weight, is there an existing table for weights that I can reference? I'm looking for zombie drops here specifically, FWIW
For More Traits mod they are here.
Was also searching the More Traits mod trying to help ๐
But makes sense being a translate variable
thx so muchhh
Well, i surrender. I don't even know how to make getAllEvalRecurse works.
local function thisIsATestFunction(player)
local playerObj = getSpecificPlayer(player)
local inventory = playerObj:getInventory()
local items = ArrayList.new()
inventory:getAllEvalRecurse(function(item, player)
if item:isBroken() then return false end
if item:getScriptItem():getType():contains('Weapon') and
item:getScriptItem():getSubCategory():contains('Firearm')
then return true end
return false
end, items)
-- for _, item in pairs(items)
-- print("[TEST]: "..item)
-- end
end
Events.OnFillWorldObjectContextMenu.Add(thisIsATestFunction)
And now i have tons of questions. :(
I would really appreciate if i get some answers by a chance.
- What is
playerarg passing to main function? Where do we get value for it? - Why PlayerObj is
getSpecificPlayer(player)instead ofgetPlayer()? - What is the
itemarg passing to anonymous function ingetAllEvalRecurse? - Idk how to add context to each item, instead of world object. :(
Anyone know of a mod that allows players to claim vehicles? I'm told there is one but idk what it's called to find it.
Also if there a mod to make things non-destructible in player safehouses by anyone other than safehouse members? We have trespassing turned off because people can still sledge and steal (not that theft has been an issue) but I'd like to be able let people visit others safehouse.
Is there away to allow players to claim 1 safehouse but be a member of others?
finally got it working
i just wanted to see if the trait itself shows, time to figure out how to make the stats work now
wanted to ask, if i wanted to apply stats that are within the game (unhappiness over time), i would need to do that in the server folder?
or within shared?
The argument is the player index, in order to get the corresponding IsoPlayer objects, getSpecificPlayer() has to be called on it. getPlayers() only returns the local players, in some cases you need to retrieve the IsoPlayer object of another player
getAllEvalRecurse is calling the anonymous function on each item it can find, so that you can decide whether it should be added to the result
i've tried rewriting the bugged portion of my code from scratch but just wound up with a more convoluted version of the exact same thing. i feel like there's something incredibly simple here that i'm just not grasping
i feel like there's something incredibly simple here that i'm just not grasping
Me too, me too. :D
I'm pretty sure there should be pretty simple way to query specific itemsByparam. But i don't know how to make it works.
a couple hours later though this may be: you'll want to put the code for your trait in the client folder
Hi guys one questions where can i learn how to make scripts ?
- https://github.com/FWolfe/Zomboid-Modding-Guide
- https://github.com/MrBounty/PZ-Mod---Doc
- Download mods with examples and try to read code.
- Read vanilla code.
- Write and test. Write and test.
- And for sure ask questions here.
Thnks you so much
i know i literally just told somebody to be patient but i am LOSING MY MIND trying to get this to work. debug and create work independently and with each other. it's when raise is added that the whole thing breaks.
Diabetes = {}
local SugarValue = 0
-------------------------------------------------------------------------------------------------
-- debug ----------------------------------------------------------------------------------------
function Diabetes.PRESSED(key)
print("Key Pressed " .. tostring(key))
if key == Keyboard.KEY_COMMA then
print("Comma Pressed")
print(SugarValue)
end
end
Events.OnKeyPressed.Add(Diabetes.PRESSED)
-- debug ----------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
-- creates blood sugar --------------------------------------------------------------------------
function Diabetes.EXIST(playerOrSurvivor)
print("Yee the fuck haw.", PlayerOrsurvivor)
SugarValue = 120
end
Events.OnCreateLivingCharacter.Add(Diabetes.EXIST)
-------------------------------------------------------------------------------------------------
-- raises blood sugar --------------------------------------------------------------------------
function Diabetes.CalculateSugarValue(getPlayer())
SugarValue = SugarValue + 0.5
if SugarValue >= 400 then
setBodyDamage(getPlayer():getBodyDamage() + 0.05)
elseif SugarValue < 40 then
setBodyDamage(getPlayer():getBodyDamage() + 0.08)
end
end
Events.EveryTenMinutes.Add(Diabetes.CalculateSugarValue)```
function Diabetes.CalculateSugarValue(getPlayer())
SugarValue = SugarValue + 0.5
if SugarValue >= 400 then
setBodyDamage(getPlayer():getBodyDamage() + 0.05)
else SugarValue < 40
setBodyDamage(getPlayer():getBodyDamage() + 0.08)
return
end
try this?
you can't have multiple if statements in one function
something incredibly simple
shouldn't else should be elseif if you need to check something?
else looks like a bit different.
https://www.lua.org/pil/4.3.1.html
oh
How is it breaking? Just from looking at it, you are missing a "then" on the 2nd if statement
did it work?
I'm curious too. :D
it did NOT work, unfortunately. i updated the code with the fixes too
whats the debug saying
when i press the key to trigger the debug it's saying NOTHING. it's as though i didn't press a goddamn thing
i'm getting a little red 1 on the bottom right of my screen during *load. that isn't there before i try adding in raise
ok ok i was worried lol
are you trying to reduce the hp?
if the sugar value is that
yes i'm trying to slowly damage the player over time when their SugarValue is extremely out of range
then I think you should create a loop
i'm certainly not OPPOSED to that, i'm just not sure how i'd go about it??????
yes
I'm also a beginner but I'm trying my best to help you XD
I REALLY APPRECIATE IT DUDE like so much
cuz I feel like we can both learn from this x)
i like the way u think my friend & im thankful for all the help i can get. what do you think the structure of the loop should be?
because the setbodydamage idk if it does damage overtime does it?
did you copy it from another mod
no that part i actually wrote myself after seeing versions of "get" and "set" in both "waste management" mods
which could easily explain why it isn't working
i dont THINK it does damage over time per se? but i'm triggering damage every 10 minutes, so it's. by definition damage over time
nvm found it
ok let's try this
function Diabetes.CalculateSugarValue(getPlayer())
local sugarvalue = SugarValue + 0.5
if sugarvalue >= 400 then
setBodyDamage(getPlayer():getBodyDamage() + 0.05)
elseif sugarvalue < 40 then
setBodyDamage(getPlayer():getBodyDamage() + 0.08)
end
end
I think it might be because you called SugarValue = SugarValue + 0.5 same name as the global variable you already set lines above, so I switched it for lowercase
so your local sugarvalue inside your Calculate is lowercase
meaning that you can't use that sugarvalue outside of that function
let's hope it works lol
no dice 
same error?
same error in that there is no error or recognition of the mod at all
also my concern here is that sugarvalue = Sugarvalue + 0.5 would only ever = 120.5, since SugarValue = 120
function Diabetes.CalculateSugarValue(getPlayer()) << you cant do this
I was looking at that just now
please elaborate Oh great fenris
function Diabetes.CalculateSugarValue(SpecificPlayer)
local sugarvalue = SugarValue + 0.5
local SpecificPlayer = getPlayer()
if sugarvalue >= 400 then
SpecificPlayer():getBodyDamage():setBodyDamage: + 0.05)
elseif sugarvalue < 40 then
SpecificPlayer():getBodyDamage():setBodyDamage + 0.08)
end
end```
would this work?
thats attempting to call getPlayer() when you define the function (on lua loading). there is no player at that point, thus causing a huge error when parsing the file
you need to have a proper variable name there, not the return value of another function
but since that is getting added to the EveryTenMinutes event, it shouldnt have any arguments defined at all
function Diabetes.CalculateSugarValue()
this would work but serves no purpose with SpecificPlayer as a argument for 2 reasons
- the event wont pass any arguments, so SpecificPlayer would always be nil
- you redefine SpecificPlayer 2 lines down anyways
OOP has absolutely nothing to do with this issue
i see
it WORKS NOW BY GEORGE
which one did you use?
thank you so much i'm beside myself with relief
sweet
-------------------------------------------------------------------------------------------------
-- raises blood sugar --------------------------------------------------------------------------
function Diabetes.CalculateSugarValue()
SugarValue = SugarValue + 0.5
if SugarValue < 40 then
setBodyDamage(getPlayer():getBodyDamage() + 0.08)
elseif SugarValue >= 400 then
setBodyDamage(getPlayer():getBodyDamage() + 0.05)
end
end
Events.EveryTenMinutes.Add(Diabetes.CalculateSugarValue)```
this is what wound up working
Oh, Fenris_Wolf, while you are here, could i ask you something about optimization?
I often see that peps using this construction or something like that:
TweakItem("AAS.MountainDew","DisplayCategory","FoodB");
TweakItem("AAS.Pepsi","DisplayCategory","FoodB");
TweakItem("AAS.RCCola","DisplayCategory","FoodB");
TweakItem("AAS.RootBeer","DisplayCategory","FoodB");
TweakItem("AAS.FantaGrape","DisplayCategory","FoodB");
TweakItem("AAS.GingerAle","DisplayCategory","FoodB");
But isn't be faster just to place all the items in array and pass this array as argument to function, and inside function just sort it out with for and pairs/ipairs?
We kinda just call a function only once instead of tons of times.
possibly faster, it varies, depending on the loop structure and function. definitely cleaner, easier to read and maintainable
i'd throw it in a table and use the loop myself
but i dislike redundancy (like typing TweakItem over and over lol)
Aha, that's what i was thinking. Thank you so much for answer . :)
a more through answer though on the actual optimization of it, it can have a lot to do with the namespace of the functions involved (global vs local), i'm kinda a stickler for using local space and even pulling globals into local space before using them. the smaller the scope you put things in, the less resources its going to waste. so if you had a table you wanted to pass to ipairs to call the TweakItem function a potential optimization would be
local ipairs = ipairs -- pull it into local space
local tweaker = function(items)
local TweakItem = TweakItem -- pull this global function into local
for item, tweaks in ipairs(items) do
for key, value in ipairs(tweaks) do
TweakItem(item, key, value)
end
end
end
theres a trade off though pulling the TweakItem into local space inside the tweaker function, depending on how often its called. this would be more effective for large tables instead of small ones (the cost of calling the function vs the cost of pushing the variable onto the stack)
it maybe more appropriate to put the TweakItem function into local outside the function (as done with ipairs). and ofc at this point its probably best to just replace the TweakItem function entirely with a more optimized version
a more critical thing for this specific code though is that its probably only going to run once, at startup and most of these optimizations for performance are entirely unnecessary. If it was going to be running in a time critical spot (like OnPlayerUpdate or OnTick) then it be worth considering.
does anyone know if there is a way to prevent players from destroying peoples safehouses with sledges without turning on no tresspassing?
I'm just using method that Blair Algol post not long time ago instead of TweakItem API, but i just rewrite it a bit.
like:
local function changeItemProperty(items, property, value, module)
local module = module or "Base"
for _, item in ipairs(items) do
local _item = ScriptManager.instance:getItem(module.."."..item)
if _item then
_item:DoParam(property.." = "..value)
end
end
end
local items =
{
"item1",
"item2",
"item3"
}
changeItemProperty(items, "Property", "Value")
^ something like that
sure that format will work well if you're changing the same property/value for multiple items. TweakItem is basically just calling :DoParam anyways. as i said though since its just running once on startup performance optimization is kinda a non-issue, if you really wanted to optimize it though, getting the script manager instance could be done outside the ipairs loop
local manager = ScriptManager.instance
for _, item in ipairs(items) do
local _item = manager:getItem(module.."."..item)
but again its lookup cost vs pushing the variable onto the stack, so depends on how many times its going through the loop (ie: how many items), but in effect when its looking for ScriptManager.instance first its going to check the local stack...then hunt through the global...then look for the .instance field
I like my method in that I think it's the "simplest" method, and I'm dumb as shit, but I also like how it serves as a straightforward ledger of the changes I've made?
local item = ScriptManager.instance:getItem("Base.AssaultRifle")
if item then
item:DoParam("MinDamage = 0.8")
item:DoParam("MaxDamage = 1.4")
end
local item = ScriptManager.instance:getItem("Base.PistolCase1")
if item then
item:DoParam("Capacity = 3")
end
Oh, good advice. Thank you.
I already tried to use table structure like that:
items =
{
item = "Item1",
properites =
{
"prop1",
"prop2",
},
item = "Item2",
properties =
{
"prop1",
"prop2",
}
}
But no luck to get right values, i still really newb in lua.
Will try to do that again later.
local ipairs = ipairs
local manager = getScriptManager() -- i prefer this get method to ScriptManager.instance
local tweaker = function(module, items)
for name, tweaks in ipairs(items) do repeat
local item = manager:getItem(module .. '.'.. name)
if not item then break end
for key, value in ipairs(tweaks) do
item:DoParam(key .. ' = '.. value) -- string concentration not so good performance wise, but meh
end
until true end
end
tweaker("Base", {
AssaultRifle = {
MinDamage = 0.8,
MaxDamage = 1.4,
},
PistolCase1 = {
Capacity = 3,
},
})
thats how i'd end up doing it. overkill for a few items but the end table is nice and clean and saves overall redundancy when dealing with large amounts of items ๐
Yeah, I know that's the "right" way, but I feel like I'd end up spending about as much time cutting and pasting my existing templates as I would be making the tables for the above code? ๐คท
My main problem here would be that some items (not vanilla) could starts from numbers. This sadly leads to errors.
I already test that in table key and value is string type. But anyway lua can't let you use something like 42Key as a key. :(
That's why i need key like name. :(
you can, but you have to change it a bit from
{
42Key = 'blah', -- invalid
["42Key"] = "blah" -- valid
}
Ultimately it's just two different ways of writing out the same net equation, however?
idk if its the 'right' way. its highly overengineered lol
but its my way XD
oooh, i didn't know that is possible to use this construction.
Well, then I'm contractually obligated to say it's the right way and I'm a giant dum dum ๐
remind me to review your contract at a later date.
But, I think one of the merits of my method is that it's so simple, so it's a straightforward matter for newbies to get a handle on?
As they get more adroit with coding, then they can enjoy the fancier solutions.
yes. my way has a few headscratchers in there if your not used to lua. even if you are, the whole
for name, tweaks in ipairs(items) do repeat
-- snip
until true end
is unusual and not commonly done
Granted, there's also value in learning how to implement the other method for the educational matter.
(blame lua for not having a simple way of skipping over the rest of the loop. by using "break" i can skip out of the inner "repeat ... until true" part and continue the next iteration of the ipairs outer loop)
simple solutions are good. you know me though i tend to overengineer everything (cough orgm)
Yeah, ultimately everyone is going to have their own approach, and there's a million ways you can factor out an equation? I just try to keep the focus on "this is the simplest way I'm aware of", and I like to pretend it's for the benefit of other's and not that I'm simple.
Anyways, modding. "Rogue Trader" trading shack. It's a vehicle, except it's immobile.
I like to pretend it's for the benefit of other's and not that I'm simple
And it's really benefit of others. Imho.
that's so COOL oh my god?? i love this? will there be a radial menu to interact with it??
Maybe, if it makes it easier to implement, but the bulk of the interface would have to be a regular rectangular interface?
Shopping with a radial menu would probably be a bit much.
woof yeah i can see how that'd be out there. very very cool!!!
never even thought about immobile vehicles. are windows optional too?
Everything is optional if you're creative with Lua? But yeah, I made motorbikes that work like motorbikes so optional windows are feasible.
But yeah, immobile, nonfunctional vehicles are my solution for scenery etc objects where I want a 3D object, not tiles, that also ha collision?
I mean, really, you could make a tree house that was a vehicle, for example?
yeah, that really got me thinking
But the whole train of thought strayed with that I've had a longstanding desire to see nonfunctional scenery vehicles in PZ, just for set decor and vibes? Basically the same function the wrecked vehicles serve.
It's a very safe bet that there will eventually be tanks in vanilla fort Knox, and they will also be nonfunctional scenery vehicles?
But you could also do a lot with construction equipment, roadwork machinery, aircraft and cargo containers as people have done (I have an unreleased WIP cargo container thing with models by Filibuster going back a year now), wreckage, scissor lifts, etc.
My motorbike mod has working golf carts, electric wheelchairs, and electric mobility scooters in it, not because they serve any useful purpose, but they're good scenery?
Anything that adds more flavor is good, in my opinion
i guess i'm too used to the mapping mindset, where we're a bit more boxed in
Nonfunctional trains spawned on train track tiles by fancy Lua. Surface to air missile vehicles. Wrecked busses. Crashed airliners. Etc. Etc.
Yeah, I kinda take the meta approach with stuff like trash and corpses, or the mod spawning shipping containers scattered on the roads, where I apply my aesthetic to existing maps with my mods?
i'd still like to know if there's a way that map zones can be used in lua. I've seen a few people try it for things like street sign info, but i don't think anything ever actually stuck
seems possible, that's all handy info stuffed into a lua file and seems ripe for map modding, yeah?
I mean, if you're gonna work with Lua you can have information stored however you want with tables, global mod data, etc. Getting stuck on using map zones, if it's an issue, is shortsighted IMO, albeit that's part of the problem with being a newbie?
But until you get a handle on the basics, and develop good troubleshooting practices, etc, anything Lua is gonna be a fucking headache really, and it's gonna be anything from a speedbump to a roadblock for individuals?
naturally! I'll dive into lua eventually, i have too many projects going already.
actually, probably very soon, i've been prepping to write a tool for tilezed, but that's blowing my tiny mind right now
Yeah, I'm in the opposite position really, where there's a lot I want to do mapping wise, but too many Lua projects.
Oh awesome! I've actually had to edit the tie files manually to do some stuff, so I'm interested.
it has a lua console, some scripts to pull examples from, and the help docs list out the tilezed specific api- or most of it i think? I ended up fairly confused reading through the scripts, so I need to back up and read up on how lua actually works
guys what this entry here leads to?
item PipeBomb
{
DisplayCategory = Devices,
MaxRange = 10,
Type = Weapon,
MinimumSwingTime = 1.5,
SwingAnim = Throw,
WeaponSprite = Molotov,
UseSelf = TRUE,
DisplayName = Pipe Bomb,
SwingTime = 1.5,
SwingAmountBeforeImpact = 0.1,
PhysicsObject = PipeBomb, <----------------- is this a sprite or lua code or what ? where can i find it ?
MinDamage = 0,
Weight = 1.5,
MaxDamage = 0,
MaxHitCount = 0,
Icon = PipeBomb,
ExplosionPower = 90,
ExplosionRange = 7,
ExplosionSound = PipeBombExplode,
SwingSound = PipeBombThrow,
PlacedSprite = constructedobjects_01_32,
Tooltip = Tooltip_Trap,
WorldStaticModel = PipeBomb,
}
Is it possible to make an object with two different visual states that are toggleable? I have an item that I want to operate like a washing machine, but is visually distinct depending on if it is on or off.
hehe i did that on a minecraft machine
not a clue how to make it here thou, i wanted to make that but with a weapon, to make a lightsaber
oh that does sound like a cool idea... hopefully there's a way ๐
youre right i didnt think about that mmm
the fanny bag
yeah ill have to check out the code of one of the clothing mods i use.. i know they have toggled states
thanks for the idea
if you manage to do with other than clothing let me know ๐
and me please, would love to know it. :)
damn i love that 3d model ^^
i use one of those on real life on my masters lol
this should be in game by default
0:03 Says F*** u** tony
bit too much clutter. in heat of the moment, impossible to use
hmm id you need to add something to the normal distributionTable its insert.table(distributionTable["foo"].items , "bar") right ?
Hello, quick noob question. I'm trying to reskin a model (Can of Oats). I located the model and texture in the files and made a new texture for my mod item, but not sure how to get it in game. Do I need to install blender to update a texture reference in the fbx file?
Ooh I just found models_items.txt defining mesh & textures
so we have two mods (possibly more out there) that override each others vehicle menu entries, they both override this function:
ISVehicleMenu.showRadialMenu
is it possible to have multiple mods to add entries to the vehicle menu, and prevent them overwriting each others entries somehow?
i guess if they modder have coded it correctly hit. when mods overwrites functions it usually break other mods why it better if modders do hooks which it dont sound like they do
I wrote an api you can use that simplifies dealing with radial menus
so i would say no sry had something exploding on me when i fired up my zomboid
oh you did? that may help bring compatibility between mods, I'm just looking because the server I play on uses harder hotwiring and trueMusic, which means you lose the option to play casettes in cars as it appears the new hotwiring entries from that mod override them
just writing to the harder hotwiring dev trying to see if we can get a solution
Well i solved that too XD
:o
I have my own hotwire mod
@drifting stump do you know by anychance how to add to the default Distributions.lua table ? i failing to add items to that table hmm
The goal of it is to make things simpler, more compatible and move away from hooks
Ill link in a sec let me get on pc
Id have to look into havent dabbled with that
@mint sphinx I add things this way usually in media/lua/server/YourLuaFile.lua
table.insert(ProceduralDistributions.list.ShelfGeneric.items, "Base.ItemType");
table.insert(ProceduralDistributions.list.ShelfGeneric.items, 0.1); -- with 0.1 the odds of finding the item on an looting roll
documentation in the pinned discussion
still need to add the emote menu documentation
oh I see, nice API!
hmm i normal do table.insert(ProceduralDistributions["list"]["crate"].items, itemname)
also it only with one table i have the problem with ^^
as an added bonus of this hotwire mod everything is fully customizable too ๐
what happens if you use expanded hotwire with a mod that overrides ISVehicleMenu.showRadialMenu?
I'm assuming they'd have to code support for the framework right?
expanded hotwire doesnt do anything it uses the API
and the API is compatible with other mods using the old way of hooking
oh wow
so if you used 2 mods that override ISVehicleMenu.showRadialMenu plus the expanded hotwire+framework, would they all work or would only one of the overriding mods + expanded hotwire work?
harder hotwire is not tho because it doesnt hook it fully replaces with something from an old version of the game
o
if they are well coded (hook) then yes fully compatible
setMovementTypeโ(ParameterCharacterMovementSpeed.MovementType movementType) Will this work to change my players movement speed?
I'm trying to make a cheat to increase players mov speed
but I can't find anything similar
or is it based on animations?
@frosty falcon
editing the vehicle radial without the API should look like
local oldMenu = ISVehicleMenu.showRadialMenu
function ISVehicleMenu.showRadialMenu(player)
oldMenu(player) --hook
--do your stuff
--ask to render
--do controller support
}
so if they do that hook several can be used
its erm
stupid question where do you normal find eggplants in this game o.o xD
true music: https://pastebin.com/mHpNpCWw
harder hotwiring: https://github.com/openzomboid/harder-hotwire/blob/master/media/lua/client/harder_hotwire.lua#L220
so yeah I think they are, though not sure the hotwire one is adding the oldMenu(player)
like i said harder hotwire is not that mod should be avoided because:
- makes other mods adding to the menu not work if they were loaded before
- its code is from an old version of the game
yeah I'm talking to the guy developing it trying to make it compatible
no point tho
says he replaces the entire menu simply because he wants the slices in a particular position for nicer UX
hey, dont know if you figure this out, but i found out that you need to export the animations frames/sec to the same as in your keyframe, for example the bob_walk is like 4800, then it works
yep
function ISVehicleMenu.showRadialMenu(playerObj)
ISMusicVehicleMenu.oldShowRadialMenu(playerObj)
ISMusicVehicleMenu.showRadialMenu(playerObj)
end
so this simply means its appending entries?
yeah I can't make sense of the first 2 code blocks
yeah basically what it does is run the previous showRadialMenu then run the new one
so appending
and since it runs the previous its compatible with other mods
I seeee, so it's replacing the function but still appending any previously attached slices?
hm
yes
this helps thank you
no point using harder hotwire tho its incompatible with even vanilla and mine has more features
I think it's a lost cause with the wanting to keep slice positions etc, doubt you can append and still retain the order
you can very much append and retain order
the order it was appended
and my API lets you edit specific slices that were inserted before so the order of those is retained too
interesting, wonder what's his problem then ๐ค
either way, going to try yours with truemusic and see how it goes!
oooh exciting - i just had my first break on error!!
ur the mvp for making this by the way
It's not much, but it's honest work.
I appreciate if you help me test, and give me possible feedback to improve the code.
looking for someone to set up mods and settings on my serever for me will pay 25$ (edited)
Message #lfg_americas
nice!
In LUA I believe your way should work just fine!
Evening all, Quick lua item distribution question, the number of chances for an item to appear that is set there is a percentage right?
just the only problem is wen i try to add to a hiking_backpack its like it cant find the also havent open the field so the name might be wrong right now
wait from my mod?
Anger is developing their first mod
Don't panic, your clothing mod is fine ๐
This isn't the first time this has happened to me but I have this problem that I can't seem to solve. It's with combo boxes in UIs. Has anyone ever had the same?
no no, sorry!! your mod is perfectly fine. im debugging mine, haha
Please let me know if this is the wrong place, but does anyone know of a mod or setting that deals with the issue of looking directly at a fence, but not being able to see what's between it and your character?
There used to be a blind spot mod, but I can't find it any more
alright so the way i'm calculating damage over time is breaking the game. anyone have any alternatives or suggestions on other ways to calculate damage over time? apparently the game does NOT like setBodyDamage(getPlayer():getBodyDamage() + 0.05)
it would ALSO be super helpful if someone could explain WHY this error is getting thrown
Is there a way to change loot distribution of existing item (adjust looting chances?)
yes
- theres no global function called
setBodyDamage getPlayer():getBodyDamage()returns a instance of BodyDamage.class, not a number so trying to+ 0.05isnt going to work (its not a number)
thank you mr. fenris i am in ur debt
Thanks! Good to know it's possible, I tried something like ProceduralDistributions["list"]["LivingRoomShelf"]["BookCarpentry5"] = 100 but it did not worked ๐
Steam\steamapps\common\ProjectZomboid\media\lua\server\Items
ProceduralDistributions.lua
edit these numbers on the right should change the spawn chances
setBodyDamage(getPlayer():getBodyDamage() + 0.05)
You are not calling setBodyDamage on any Java object, so the code is trying to call a function that does not exist. You would need something like player:setBodyDamage(number) or player:getSomeJavaObject():setBodyDamage(number).
I typed getSomeJavaObject instead of checking what the actual function name was. I think you have to get the player object's damage object, and then set the damage on that.
its stored in a list style table, not a associative array style, you'll have to parse the table with ipairs or similar to find the index of the items your looking for
i dont think there a IsoPlayer.setBodyDamage method, like i said BodyDamage is a class, not a number. adding/subtracting directly isnt going to work
is there a mod that converts the radio's temps from F to C?
real stinky when you set the temps to celsius and the radio still displays F.
:o I edited my message whilst thou wert typing that.
will getPlayer():getOverallBodyHealth work? or is getOverallBodyHealth not a thing?
You can save time trying to guess function names by using the internet to find out about the functions that there are.
^^^^
i used the java documentation to find OverallBodyHealth but i can't find anything to tell me how it's used
:o
i know OverallBodyHealth is a thing but i don't know if getOverallBodyHealth is how i would reference it. i'm working under the assumption that getPlayer(): prefacing OverallBodyHealth will call the specific bodyhealth of the client
that could be very wrong
This may be relevant, the getBodyDamage you saw before.
It returns something called BodyDamage, which you can click on.
It has things like this.
It could be done like this:
getPlayer():getBodyDamage():AddGeneralHealth(number)
or
local player = getPlayer()
player:getBodyDamage():AddGeneralHealth(number)
or
local body_damage = getPlayer():getBodyDamage()
body_damage:AddGeneralHealth(number)
or
local player = getPlayer()
local body_damage = player:getBodyDamage()
body_damage:AddGeneralHealth(number)
i found ReduceGeneralHealth peeling through more of the BodyDamage page. it's EXACTLY what i need, combined with this. thank you bigly for demonstrating how to implement it
:o
Wow, but this is going to be very inefficient if I want to replace loot distribution of all existing books isn't it?
@bitter frigate feel like i should explain a bit of coding to you so you dont run into the same mistakes
in java there are primitive types which are int, byte, short, long, float, double, boolean, and char. they are like atoms irl(lets ignore they are made of tinier stuff for this example), what things are made of.
so if in that documentation you see something return this kind of stuff you know they are just raw values
then there are classes. objects made of stuff like a chair is made of wood which is made of atoms.
if you see something return anything that is not a primitive then its made of other things. classes can have attributes and methods so youll have to use those to interact with it. basically they are not raw values you can use right away, must use those attributes or methods.
hope its clear enough
assume strings as primitive too its easier that way XD
depending. could be more efficient (in theory). performace efficiency is a non-issue since its only fired once
local editDist = function(dist_table, replace_table)
-- check for a junk table, and edit it by recursively calling this function
if dist_table.junk then
editDist(replace_table, dist_table.junk)
end
local items = dist_table.items
if not items then return end
-- only need to check every second position, since thats the item name
for i=1, #items, 2 do
if replace_table[items[i]] then -- the item name exists in our new table
items[i+1] = replace_table[items[i]] -- replace the spawn rate with the new value
end
end
end
-- call the function editting the bookstore with new values
editDist(ProceduralDistributions.list.BookstoreBooks, {
BookCarpentry1 = 5,
BookCarpentry2 = 4,
BookCarpentry3 = 3,
BookCarpentry4 = 2,
BookCarpentry5 = 1,
})
this would replace values directly with another value, but may not be ideal since something like BookCarpentry1 can exist in the same table multiple times with different spawn chances. in which case it maybe better to change the line that does the replacers to use a multiplier instead of directly coping a value (ie:)
items[i+1] = items[i+1] * replace_table[items[i]] -- multiply the spawn rate by the new value
and then change the replace_table so its more like
{
BookCarpentry1 = 0.5, -- half the spawn rates
BookCarpentry2 = 0.5,
-- snip
}
(thats all enitrely untested code btw)
Hey guys, Im currently running a server with a friend of mine, and we currently have alot of mods installed, meaning the server is listed as ??? and its becoming difficult to gain new players as the server is hard to find.
Ive heard some people suggest making a custom modpack to reduce the installed mods on the server to allow it to be seen by more people.
If you know more about how to make a custom modpack, Please contact me!
Thank you
thank you!!!!!!! i had intuited that there were different "levels" to different things, but i hadn't quite caught on to the fact that these "levels" had a base where i could attach code that was predetermined by if they already had a value attached
if you try to do chair + chair you have no clue what to do
but if you get the number of atoms each is made of it makes sense to do a sum
stuff like that
that makes sense!!!!!!! it's so exciting to actually learn things i'm over the moon
is there somewhere i can see how hunger effects health regeneration? i know it slows it, but i want to see the mechanism
i've dug through the lua files in my steam directory but can't find anything promising
sorry if this been asked before, but I couldnt find it pinned or through the search bar. I was wondering if anyone knows about a tool for deleting map chunks from a save. I recently found a couple more mods that I found really interesting and wanted to add to my save. One is a map mod and another is just a mod that adds items. Ive already previously explored most cities on the map, so I know new Items and the map cant be loaded in. I know I could manually go file by file to delete chunks, but was hoping there might already be a tool for it.
decompile java files
Wow men this basically solves the whole issue with a single function ๐คฉ thanks a million! I'll try it, I did not knew this was fired only once, so as you said this should not impact performances much.
Thanks again, and as they said there are no wolf on Fenris ๐
like the ones i can find in Steam\steamapps\common\ProjectZomboid?
Steam\steamapps\common\ProjectZomboid\zombie
ah i'd consider it more of a prototype example then a final version though. by "only fired one" i just ment its done on loading not called over and over during the game...ofc you'll have to call it for each table you want to edit. and theres other factors to consider like you'll probably want to do your edits during one of the events to ensure all other mods have loaded and done w/e edits they'll be doing on the tables first
why does the lua files panel not have a search bar
Hey, I've been trying to do some work on vehicle collisions with different objects, but nothing seems to have worked so far. I've tried almost every IsoMovingObject method that has "collision" in it, but I always get nil or 0.
Anyone has an idea why that would get me nil instead of some actual value?
local function OnPlayerUpdate(player)
local vehicle = player:getVehicle()
if vehicle then
print(vehicle:getCollidedObject())
end
end
Does anyone know if there is a mod or a way to prevent players from using sledgehammers in safehouses they aren't a part of? I know you can turn off trespassing but I want players to be able to go into each other's safehouses.
somebody have a car modding tutorial ? v:
is there a way to add events that aren't predefined by the game or am i stuck with what i've got?
can you add mods to already existing worlds/ servers?
yea depends on the mod tho
how would loot from a mod be handled? would we have to turn on loot respawning in order to see some of the stuff it offers?
question is there a way to get kitsune's crossbow mod to work with arsenal 26?
short answer: no
short but truer answer: yes by patching the game files
woof that mcfuckin HURTS but i'll figure something else out
what are you trying to accomplish
(you like futaba pog)
i'm trying to do a lot right now that i don't know how to do, but SPECIFICALLY right now the crux of the diabetes mod comes down to lowering SugarValue when insulin is "injected". i've made an insulin syringe as a prototype & i was hoping i could create an OnUse event for it to lower SugarValue by ISF*InsulinInjected (Insulin Sensitivity Factor - essentially how much one unit of insulin brings down your blood sugar). i've created a function where i define ISF for the time being, but i'm at a loss for what to do with it
ah its stuff within your code
all you have to do is call a function
look at how items are used
and in the code for using your item do your custom stuff
i posted this in the wrong channel I'm very dumb
smooth brain very smooth
OH do it @ the item?????? okay that makes....... a lot more sense
items is an area i havent messed around in much yet but from what i know about the context menu is you just have to add in an option
that option calls a function you specify on click so in that faction you would check if the player has the item and if so perform whatever you want
would recommend looking at a mod doing something similar
i'm sure hydrocraft has SOMETHING i can reference in there, somewhere. i'll check it out! thank you
is there any mod that increases the field of view to 360 or that takes away the fog of war? would it be easy to create it? (I know about the game proposal and etc that people talk about)
what do you mean about the FOV? like a wider zoom?
to see in 360
Fog of war is a D&D term used to describe what your character cannot see from a top down perspective
Or has not seen
@tiny junco The term you are looking for is visibility fade
Maybe if you do a custom sandbox there might be a setting for visibility fade to be adjusted
oh, for a moment i thought you meant in 3d terms, now i gotcha.
- late edit, sorry i don't know of such a mod.
lol sorry for my english ๐
yall good
Really quick, in a TD;LR fashion, is a custom animation (for a weapon specifically) difficult to rig?
lemme check the custom sandbox
that entirely depends on your skill as an animator, but all the techincal steps are fairly straightforward
Would you be able to link a tutorial page by chance? I should be able to fill in most the gaps if it's anything like Fallout modding
Check pins?
i'm not sure if there is one. The total basics are do make an fbx animation with the clip name the same as the filename, that goes in the anims_X folder. There's also an AnimSets folder with xml to handle animation blending and logic; such as setting a condition to blend holding a shotgun while walking normally.
Cheers for that info, might surf around more for some sort of guide, or might see if I can contact iBrRus and their devs for true actions if nothing exists
Is there a decent "All in one" belt mod?
Specifically, I'd like to attach sensible items to belts. Radio, Medkit, etc
EDIT: Didn't realize this was a channel for making mods, my bad. I'll leave this here though, main chat gets clogged too fast
if someone wants and can help me to create an item mod, or a trait that gives the ability like Cheat.Player.SeeEveryone , to increase the angle of vision in 360 of the players, or increase the angle of vision of eagle eye, send me a private message. that is if it is possible to do.
no clue how to do it really, but from what I see it won't happen with Cheat.Player.SeeEveryone unless you're willing to have your subscribers to enable debug mode to use your mod
can backpacks have condition property? i mean can they be dmged and destroyed as usual clothes?
i dont think so man, i tried once and did not work, someone told me container types cant have those
yeah i also tried that my self and i was unable to do so, hoped maybe some one managed to
what am i doing wrong during item creation to cause THIS to display instead of the appropriate category?
I've not done any item modding, but it looks like the display category is done in the items.txt in the media/scripts folder. Like this.
item UsedSyringe
{
DisplayCategory = FirstAid,
}
right right. this is the txt file.
DisplayCategory = FirstAid
Weight = 0.05,
Type = Normal,
DisplayName = Used Syringe,
Icon = UsedSyringe,
}```
ah fuck is it because of the comma. let me see
that is embarrassing for ME goddamn it was in fact the comma causing this particular issue
Any method to modify player's speed
getPlayer():setMoveSpeed( 999 )
I found this but it only seems to affect the "walk to" speed
U need to config a file in
media\lua\Client\Vehicles\ISUI
...MechanicsOverlay.lua
@arctic vector
Thank you, I sifted through all the directories but I guess I missed that file.
Maybe you can have a hidden clothing item which modifies the running speed, making it hidden by giving it no displayname, and maybe being careful with water and dirt.
item Wiz_SupermanBoot
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Superman Boots,
ClothingItem = Wiz_SupermanBoot,
BodyLocation = Shoes,
BloodLocation = Shoes;LowerLegs,
Icon = Wiz_SupermanBoot,
StompPower = 2,
ConditionLowerChanceOneIn = 10,
ConditionMax = 200,
RunSpeedModifier = 1, <----------------- there is, i set this to 1.5 on another item and made the char move fast
RemoveOnBroken = false,
ScratchDefense = 70,
BiteDefense = 50,
Insulation = 0.5,
WindResistance = 1.0,
WaterResistance = 1.0,
WorldStaticModel = Boots_Ground,
}
Dude are you my dad?
Thank you so much
I was struggling so hard
i found that by acident the other day lol
Fog of war is a german military expression - just means situational unawareness. It's like 200 years old.
ok idk if this is the place to ask but how do i change the cursor
i think they speed modifier is not working on 41.65 anymore ๐ฆ i tried again now and did not worked like before, this dude also tested
Here I am in build 41.65 and I'm testing run speed with various equipment.
Sneakers, boots, firefighter pants, and other items all have a run speed modifier. Now I've had a suspicion it doesn't work for a while and this is the test to settle it.
So have been doing trial and error as to which folder the preview.png should be under, only to result in errors in items when I try to load them ingame. Anyone know which folder it should be under?
There is a ModTemplate in C:\Users\Username\Zomboid\Workshop that could help with structure.
Yo for someone who got cheat menu
Could you delete trees with the Terraform tool
to build a pathway from your secluded safe zone
to the main road ?
I'm doing something wrong and idk what. Already check everything a few times but still no luck.
I add my custom weapon (i just copypaste M16 stats/flags/etc) in scrips and spawn it. Display name is different, so, it's totally mine weapon.
My main problem is game still decide to show me M16 model, instead of mine, even i add my own.
.../media/scripts/Test_models.txt
module Base
{
model VSStest /* Item name is the same, Base item VSStest
{
mesh = weapons/firearm/VSStest,
texture = weapons/firearm/VSStest,
}
}
VSStest.x file in ...\media\models_x\weapons\firearm
VSStest.png file in ...\media\textures\weapons\firearm
Missing 3D items don't have anything related to my model.
Console is empty too.
What i'm doing wrong?
Dying light 2 is gonna come out, looking forward to get some mod idea from that game
YELLO
clothing modders, can we get some boots remodeled pls lmao
Looking for voice actors
If you know someone willing to contribute message azakaela
did you found it out?
@drifting ore also itll possibly support addons ๐
pz rule 34 XD
soon TM

this game is heading to the darkside now
yup
yup author of third person mod
me to
Damn, I figured. I wanted to use necroforge's code but it seems they don't have it anymore either
Hey, I'm currently working on the IS300 for the game and I need some opinions about size of the model. Is it too small or I can leave it as it is?
hey, how can I perform a delayed function? For example, after 1-2 game days after the player used the item, then nausea was superimposed on it, for example?
im trying to remove tables
is this correct?
table.remove(AttachedWeaponDefinitions["PoliceHandGun"].weapons,1); ```
trying to remove these ```AttachedWeaponDefinitions.LongGunOnBack = {
id = "LongGunOnBack",
chance = 30,
outfit = {"SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATWebbing","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
weaponLocation = {"Rifle On Back"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
weapons = {
"Base.AssaultRifle",
"Base.AssaultRifle2",
"Base.Shotgun",
},
}
AttachedWeaponDefinitions.PoliceHandGun = {
id = "PoliceHandGun",
chance = 30,
outfit = {"SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATWebbing","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
weaponLocation = {"Holster Left", "Holster Right"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
ensureItem = "Base.HolsterSimple",
weapons = {
"Base.Pistol",
"Base.Pistol2",
},
} ```
seems to be throwing errors
ERROR: General , 1643895146061> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index of non-table at KahluaUtil.fail line:82.
ERROR: General , 1643895146061> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index of non-table
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaUtil.luaAssert(KahluaUtil.java:70)
at se.krka.kahlua.vm.KahluaThread.tableSet(KahluaThread.java:1726)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:594)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:550)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:482)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:329)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:256)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:89)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
at zombie.GameWindow.logic(GameWindow.java:289)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:745)
at zombie.GameWindow.run_ez(GameWindow.java:661)
at zombie.GameWindow.mainThread(GameWindow.java:475)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1643895146062> -----------------------------------------
STACK TRACE
-----------------------------------------
function: Duck_SharkRemovals_LE.lua -- file: Duck_SharkRemovals_LE.lua line # 4
Feb 03, 2022 9:32:26 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException
Feb 03, 2022 9:32:26 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException:
Feb 03, 2022 9:32:26 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: at Duck_SharkRemovals_LE.lua:4
LOG : Lua , 1643895146068> Loading: C:/Users/Ray/Zomboid/mods/Duck's Shark and Brita Compatibility LE patch/media/lua/server/Definitions/Duck_Shark_AddingWeapons_LE.lua
LOG : General , 1643895146068> -------------------------------------------------------------
attempted index: weapons of non-table: null``` Error im getting
200 hours of work put into this room, all lootable and wearable
how can I add a custom variable to the player, for example, a counter of something
post-its, a sharpie, and a nailgun.
If it's specific to the player you can use modData - but it can get tricky with MP if you need the server or other players to know the data.
it's good but thought it was a BMW E60 for a sec and got excited about it ๐
did i type the lua wrong?
Yes
what should it be then
I'm joking lmao just replied yes for no reason
very funny
Thanks๐ป
I can't really read through code on my phone.
ah
But the error means what ever xyz.weapons is the xyz is not there
is someone making a BMW mod currently, doesn't matter if it's E30 or E36 or E46 they're pretty cool especially 90s bmws
AttachedWeaponDefinitions.PoliceHandGun.weapons = {};
changed code to this
since theres 2 entries
still didnt work
Are you confirming the load order in someway?
tbh if i finish this one i can try to make E30, E46 or E60
My guess would be you're trying to remove it before it's there
yep
Is that a yep as agreeing or yep as in you are confirming load order
E60 is 2003-2010
probably would be too modern
E46 is more close to 90ish style but it's 97'
Yeah it won't fit the game theme but there are a lot of mods with newer cars. E46 is from the same era as IS300
E36 perfectly fits BTW its 90s
But I would probably prefer older models, E30/E34/E36/E38
yep i confirmed load order is correct
e38 is like S class Mercedes lol
It's a 7 series
too luxury
E36 is 3 series and E34 is 5 series
3 series is the most cheapest BMW so I'd say go w E36
in which version though, sedan or coupe? sedan is probably the most common one
compact is out of the question because I'm not the fan of the look ๐
who drives a coupe BMW dude do a sedan
a lot of them in my country
maybe u can do an M version of the BMW too
more powerful engine and torque
ofc w diff bumper and such
I'm not really figured out yet how to properly set physics
Because when i'm using realistic parameters car is too slow and doesn't shift properly
All of the cars in the game seem to have too low weight and way to much power compared to real life
And I want it's performance to fit the vanilla game
Then before you're trying to remove it add a if and print checking for it?
Would be something like
print("--x:"..tostring(x))
If it's coming out as --x:nil it's not there
can anyone help me with a custom spawn point. when i spawn there are no zombies in the hospital. how do i make it so that i start with heaps of hospital zombies? ๐
And by confirming load order I mean adding in requires or placing the file in a deeper directory.
That's a vanilla feature / arguably issue with large buildings
i see some youtube videos though of custom maps where theres lots of themed zombies for e.g. in prison or hospital. i could try to make a hospital mod but not really sure how zombie spawns are handled o.o
That's a different topic if I understood your first question
Vanilla spawning is meant to clear out the building you're spawning in if it's being loaded into for the first time.
ah....
It's a sort of issue if you spawn in a multi story building that would take some defines by the devs to fix.
So adding in outfits and zones for those outfits wouldn't solve spawning in an empty hospital unless you just force spawn them in after the fact
I wonder what that does to distribution though -- like are all those zombies (atleast count wise) shifted outside?
how do i add a require function...
because my previous mod didnt require it
AttachedWeaponDefinitions.LongGunOnBack.weapons = {};
AttachedWeaponDefinitions.PoliceHandGun.weapons = {};```
it does have a require function
but not particularly for the mod
You would just type require "file path" Where file path is after the client/shared/server
Wait are those lines in your mod or the original?
my mod is in server so it should be fine right?
in my mod
the original is this
-- For Specific Outfits --
-- assault rifle on back
AttachedWeaponDefinitions.LongGunOnBack = {
id = "LongGunOnBack",
chance = 30,
outfit = {"SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATWebbing","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
weaponLocation = {"Rifle On Back"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
weapons = {
"Base.AssaultRifle",
"Base.AssaultRifle2",
"Base.Shotgun",
},
}
AttachedWeaponDefinitions.PoliceHandGun = {
id = "PoliceHandGun",
chance = 30,
outfit = {"SharkBlueSWAT","SharkBlueSWATBelt","SharkGreenSWAT","SharkGreenSWATBelt","SharkGreenSWATRiot","SharkGreenSWATGasMask,","SharkGreenSWATBelt","SharkBlueSWATWebbing","SharkBlueSWATRiot","SharkBlueSWATGasMask"},
weaponLocation = {"Holster Left", "Holster Right"},
bloodLocations = nil,
addHoles = false,
daySurvived = 0,
ensureItem = "Base.HolsterSimple",
weapons = {
"Base.Pistol",
"Base.Pistol2",
},```
Why are you looking for the tables contents if you're wiping them?
X = {} defines the table as empty
i just want to remove the weapons
yes
i want to add new weapons into them
-- Brita's weapons on shark's zombs --
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.M870_Police");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.Shotgun");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.M870_CQB");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.M1Carbine");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.M2Carbine");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.MINI14");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.M16Tape");
table.insert(AttachedWeaponDefinitions["LongGunOnBack"].weapons,"Base.ColtM16" );
-- Brita's Pistols on Shark's Zombs --
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.M9");
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.M9A3");
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.B93R");
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.P226");
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.AMT1911");
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.Colt1911");
table.insert(AttachedWeaponDefinitions["PoliceHandGun"].weapons,"Base.Colt_Commander"); ```
so icant just delete the weapons table
Misread the inclusion of .weapons
no im only wiping weapons
Is there something in the game already that stores the player name? I'd like to have something on create attach the player's name automatically - not a necessity but seems like a nice touch.
You have to require the mod's file still
And require only works in the same client/server or also shared
In what way? I need a certain perk to be removed from the player after a few days, is modData suitable for this?
yes
So something like require "definitions/filename" no .lua
This will ensure your file is loaded after the original mod's
wait so like this?
My assumption is your mod is getting loaded before
require "Shark's Law Enforcement Overhaul\media\lua\server\Definitions"
No
After server/
i dont need to insert a .lue right?
Start at "Definitions
would there be anyone willing to help making mods and such for a Project?
Stop making me type special symbols on my phone ๐ฉ
ooof
But yes that's correct
It's always good practice to put your file in the same location on your side of things but technically as long as it's in server or shared this will work
If it does not then there's a section missing from your table's path
nope
same error
ERROR: General , 1643900395950> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: weapons of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:550)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:482)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:329)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:256)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:89)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
at zombie.GameWindow.logic(GameWindow.java:289)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:745)
at zombie.GameWindow.run_ez(GameWindow.java:661)
at zombie.GameWindow.mainThread(GameWindow.java:475)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1643900395951> -----------------------------------------
STACK TRACE
-----------------------------------------
function: Duck_Shark_AddingWeapons_LE.lua -- file: Duck_Shark_AddingWeapons_LE.lua line # 4
Feb 03, 2022 10:59:55 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException
Feb 03, 2022 10:59:55 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: java.lang.RuntimeException:
Feb 03, 2022 10:59:55 PM zombie.Lua.LuaManager RunLuaInternal
SEVERE: at Duck_Shark_AddingWeapons_LE.lua:4
this is line 4
AttachedWeaponDefinitions.PoliceHandGun.weapons = {};```
Then there's something wrong with how it's being called
Maybe the outfit ID was changed?
When is this being called?
Can you add some ifs and prints
this? print("--x:"..tostring(x))
trying to figure out
how to word it
if [my mod] true
then print?
print ("AttachedWeaponDefinitions:"..tostring(AttachedWeaponDefinitions))
print("AttachedWeaponDefinitions.LongGunOnBack:"..tostring(LongGunOnBack))
If AttachedWeaponDefinitions.LongGunOnBack then AttachedWeaponDefinitions.LongGunOnBack.weapons = {} end
if AttachedWeaponDefinitions.PoliceHandGun then AttachedWeaponDefinitions.PoliceHandGun.weapons = {} end
I ended up creating a function that sets a variable when my weapon is equipped, so in the xml file this variable is my condition for the animations
did they change how lua loads?
nvm
Is it possible to modify the generator to run on a different fuel? Asking because even during the timeline of PZ farmers would run engines on woodgas from pyrolysis.
Generators are pretty javasided
ERROR: General , 1643901158445> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: weapons of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1643901158445> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: weapons of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:550)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:482)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:329)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:256)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:89)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
at zombie.GameWindow.logic(GameWindow.java:289)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:745)
at zombie.GameWindow.run_ez(GameWindow.java:661)
at zombie.GameWindow.mainThread(GameWindow.java:475)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1643901158446> -----------------------------------------
STACK TRACE
-----------------------------------------
function: Duck_Shark_AddingWeapons_LE.lua -- file: Duck_Shark_AddingWeapons_LE.lua line # 4```
Means, you ll have an easier time writing your own power system
attempted index: weapons of non-table: null
why is the table not there
this is driving me nuts
Did you add the prints?
Damn. Thanks @sour island
Cause that error shouldn't be appearing if you added the ifs
It gets printed to console.txt
wut
Along with the error
nope same error
Look at the ifs for the bottom
the print did nothing
Can you give me a example? Or is your mod online so i can have a look
im just as confused
Are you subbed to your own mod?
And your whole mod is just those 4-6 lines
yeppp
I was creating a slingshot, this was the .xml
<animNode x_extends="aim_default.xml">
<m_Name>aim_slingshot</m_Name>
<m_AnimName>Bob_IdleAim_Slingshot</m_AnimName>
<m_Conditions>
<m_Name>Weapon</m_Name>
<m_Type>STRING</m_Type>
<m_StringValue>Slingshot</m_StringValue>
</m_Conditions>
<m_Transitions>
<m_Target>IdleSlingshot</m_Target>
<m_AnimName>Bob_AimToIdle_Slingshot</m_AnimName>
</m_Transitions>
<m_Transitions>
<m_Target>sneakidleHandgun</m_Target>
<m_AnimName>Bob_AimToIdle_Slingshot</m_AnimName>
</m_Transitions>
<m_Transitions>
<m_Target>sneakIdleLowHandgun</m_Target>
<m_AnimName>Bob_AimToIdle_Slingshot</m_AnimName>
</m_Transitions>
</animNode>```
And the lua function that changes the weapon variable
```local function OnEquipPrimary(character, inventoryItem)
if inventoryItem ~= nil then
if inventoryItem:getFullType() == "Base.Slingshot" then
character:SetVariable("Weapon", "Slingshot");
end
end
end
Events.OnEquipPrimary.Add(OnEquipPrimary)
Thank you so much! This is what i needed. Thanks!
No problem.
If the player already start with the weapon, it won't trigger the setVariable, so you need the same logic on a OnGameStart event
local function OnGameStart()
local player = getSpecificPlayer(0);
if player:getPrimaryHandItem() ~= nil then
if player:getPrimaryHandItem():getFullType() == "Base.Slingshot" then
player:SetVariable("Weapon", "Slingshot");
end
end
end
Events.OnGameStart.Add(OnGameStart)
Also good to know :p
Anyone know of a way to disable the use of sledges in peoples safehouses? Or if there is a way to let people join multiple safehouses but only claim one? I want to turn trespassing safehouses on but the players on my server don't want to deal with potential tolls.
this looks amazing!!!! how close are you to release?
a month +
lots more rooms to do like this trying to make a dlc-esq dead rising-esq map
oh WOW you're going for it
that's really awesome i'm excited to see it as you continue working on it!!!
- Added a "SledgehammerOnlyInSafehouse" server option:
- if AllowDestructionBySledgehammer is enabled, you can set SledgehammerOnlyInSafehouse to true to allow destroying stuff with sledge only in player's safehouse.
Soon โข
@merry osprey maybe try this: https://steamcommunity.com/sharedfiles/filedetails/?id=2705751144
How would I go by creating a "Stat" such as anger or boredom? If there's an example (mod someone else created or documentation) can anyone link me to that?
i've been working on creating a new stat for a couple days (blood sugar!) and there are a couple mods i can recommend looking at for an idea of how to do it
lemme grab recs
"waste management" mods that create the need to defecate and urinate - this is where i started, because they both create new "needs" to manage.
https://steamcommunity.com/sharedfiles/filedetails/?id=2708312917
https://steamcommunity.com/sharedfiles/filedetails/?id=1436878551
danger moodles - creates a new stat to manage called "sanity" if i'm not mistaken???
~~https://steamcommunity.com/sharedfiles/filedetails/?id=2676526057~~
Oooh thanks for the info!
sanity might already be in the game just not used atm
i recall seeing references to that when decompiling
didnt look into that tho was doig other stuff
that's totally possible! i just know they do a lot with sanity and create a lot of functionality for it
let me make a decent post might be nice for the wiki
And improper camelcasing
you havent seen everything
if anybody was curious i missed another comma and borked my whole code again orz
ima just say the options screen is something else
Thats disgusting
Like
I dont even get why it would ever be like that to begin with
copy and paste is not always friendly
Clearly
Character Stats
float Anger
float boredom
float endurance
boolean enduranceRecharging
float endurancelast
float endurancedanger
float endurancewarn
float fatigue
float fitness
float hunger
float idleboredom
float morale
float stress
float Fear
float Panic
float Sanity
float Sickness
float Boredom
float Pain
float Drunkenness
int NumVisibleZombies
int LastNumVisibleZombies
boolean Tripping
float TrippingRotAngle
float thirst
int NumChasingZombies
int LastVeryCloseZombies
int NumCloseZombies
int LastNumChasingZombies
float stressFromCigarettes
float ChasingZombiesDanger
int MusicZombiesVisible
int MusicZombiesTargeting
I'm having a hell of a time deciphering where to define a stat using "Defecate" as an example
here's a pastebin (https://pastebin.com/xQK2SKbP) of my code for creating blood sugar. i don't know if you'll get any utility out of it, but it's possible!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
All I really need is to attach a new variable to the player and store a double lol
potentially in zombie.characters.Stats
but you dont
then I'll have to figure out how to get it to show in the Info tab of the character panel
you cant edit the java classes
you can however make use of them
modData is likely what youre looking for
Okay, if modData can help me here, does it persist through logout? Is it stored clientside or server side?
Sorry, i'm a bit unfamiliar with how PZ does things
while that does work and is perfectly valid it will however not save between relogs
you will have to add a way of storing the value for when a player reconnects
modData can be transmitted
any advice on how to start doing that? like where should i look or what should i look into
can also use global mod data
does anyone know where I can find OnEat_Cigarettes in the game's lua? i'm trying to use OnEat but it's not working and i think it probably has a lot to do with the fact that i have no idea how the function actually works
thank you!!! i'll look into this
i would finish the other parts of the mod first and then worry about syncing with the server
okay that's basically what i was doing! i was worried i'd moved on too soon or forgotten something basic, haha
{
DisplayCategory = Junk,
Count = 20,
HungerChange = 0,
Weight = 0.005,
RequireInHandOrInventory = Lighter/Matches,
Type = Food,
DisplayName = Cigarettes,
StressChange = -5,
Icon = IckySticks,
CustomContextMenu = Smoke,
CantBeFrozen = TRUE,
OnEat = OnEat_Cigarettes,
StaticModel = Cigarette,
EatType = Cigarettes,
WorldStaticModel = CigarettePack_Ground,
CustomEatSound = ,
}
``` this is in items.txt
ah that explains
i'm trying to use OnEat to lower SugarValue
thank you so much. i was looking for it in client, haha
what editor are you using?
notepad++
I just thought of this... I cant use the players name to create the modData since multiple players can have the same name, I cant use the account name since I want this value to follow the character. do players have a GUID or something similar I can tap into?
or should I say "Actors" since this i guess would include zombies
if it didn't include zombies i'd suggest taking a look at getPlayer() but i think zombies throw that out, if it was ever an appropriate suggestion at all
Hmm, I think I can ignore zombies and generate a random value dynamically
eh imo notepad++ is outdated
