#mod_development
1 messages ยท Page 459 of 1
You are correct
Okay, thanks.
actually in the lua file where the attachments are defined, changing an item's attachment type will change all atchments for that item, not ideal
most of them will look totally off
So, it would be positioned where the new points were defined?
Does Hunting Slime frequent this discord?
Cant find him/her in the members list, perhaps the have a different discord name
@undone heron that's not you is it?
ye
Hey dude
I use your awesome trait mod
I believe you just updated it?
And it's started throwing 100's of errors a second for me
I think I've narrowed it down to the SadoMasicistTrait.lua not patching in the masochist trait after it patches in the sadist trait
--add this patch so it can be enabled on existing games.
local player = getPlayer();
if player:hasModData()
and player:getModData().currentZombieKills ~= nil
then return
else
player:getModData().currentZombieKills = player:getZombieKills();
end
end
Events.OnGameStart.Add(sadistTraitData);
Events.OnCreatePlayer.Add(sadistTraitData);```
it had a typo, it's fixed
But no function to do the same for the other trait
Ah brilliant thank you sir
or maam
๐
hasTrait vs HasTrait
syntax
smh
Nice catch, I guess I was way off lol. I'll delete those comments from the mod page
Appreciate the quick fix
Fix works, thanks!
masochist also doesn't had ModData() since it just works off pain level. sadist however needs to keep track of your kill count so it needs to be saved
ty, and also to the people giving suggestions. Tho sad some ideas they have are outside my skill level to make.
like a greyscale shader for a colorblind trait would be neat but outside my skill level.
or like yepthatsmyname suggested: a bad trait that makes the fog of war show up instantly instead of re-appear after you finish sleeping
chronic migraines:
fov and hearing is limited, pain increased (happens randomly)
@undone heron thanks again for the quick fix; thought i'd lost my save for a few minutes
Oh and hey Soul I see you on here too, got a sec to talk about Farming?
Yes, changing the attachment type for the item will make it attach to the new points
Sure
@nimble spoke Rad!
yeah FoV /camera stuff is what's outside my skill limit. can't find variables for it to manipulate it
I'm getting the duplicate option for sow seed
The upper option works
The lower option throws an error
And sometimes the wheat is unharvestable even when appearing as "Harvest ready"
Not sure what causes that issue though
No other farming mods, right?
The only other one I can think of is Green Fire
well.... uhhh I see cannabis in there
And I honestly didn't think of that as being a culprit until you asked
I can toggle that one off and see if the dupe is still an issue
Lemongrass... that's probably from the orphanage
I have it in my mod unfinished, but I didn't add it to the menu
Hmm curious, I'll look into that as well
Okay well it doesnt appear to be green fire
Disabled that and still getting dupes
But still see lemongrass
So gotta figure out where that's coming from
So weird, I haven't updated it for some time so I have no idea why it started happening. I will update when I have a fix
Soul, is Lemongrass a vanilla item...?
It's listed there
No lemongrass or farming related mods
I mean the good news is it's not at all game breaking
Just... dont use the second option in the dropdown for sow seed ๐
Okay so lemongrass is a herb you can collect but not a seed you can grow in vanilla
So it's gotta be a sneaky mod I have
Yeahhhh
Okay found it
It's from Vanilla Food Fixes: https://steamcommunity.com/sharedfiles/filedetails/?id=2072147750
@nimble spoke ^
is it causing the duplications?
Its the mod that added lemongrass, at least
So, the only other mod affecting farming
Testing w/o it now
No mods
With only Soul Filcher's Farming Time enabled:
So I think something's gone amiss with your stuff @nimble spoke ๐ฆ
Happy to help debug more just lmk
I'll check that later today, it is just weird that I haven't changed anything that could cause that
for the Librarian profession, what would you expect them to have skill wise?
Short eyesight
That's actually funny ๐
And low run/sprint but high carry
Very nimble and quiet
Basically, not very fast or a good runner. Cant see very far/wide. But can hear very well, can move around sneakily and carry a lot (used to carrying books!)
That's my two cents
Maybe increased vision with glasses lol
probably out of scope on that last bit
I'm talking about for a modding profession. Giving them all that by default would leave the player with little choice like the other professions or I would need to do like -20 point cost lul
You dont have to take all of it ๐ Just throwing ideas out
Hey i have some mods installed and now my context menu won't open
Any repeat offenders or likely culprits?
Your best bet is to remove them until it comes back
in order to deduce which is causing the issue
Yeah but i have a lot on and it's kind of a hassle to mess with mods on pz
have you checked for any obvious errors in the console log?
C:\Users\USERNAME\Zomboid\console.txt
@drifting ore also use this https://steamcommunity.com/sharedfiles/filedetails/?id=2404803647
You can create a preset of all your currently enabled mods
And then start disabling them to figure out which is the issue
and then use your preset to turn the ones that you had on back on later
gl
If the problem just started happening recently I'd recommend disabling the most recent mods you've enabled first
Nice nice, what was it
rip
@echo leaf do the other 2 farming mods require mine?
uhhhhh, I wonder how these are even compatible then
I havent tried farming the weed or tobacco yet, but your stuff works fine with those enabled
Other than the dupe context options
But that issue exists with only your mod enabled anywho
have you ever tried playing with those 2 without mine?
is there any particular reason 'math.ceil' works and 'math.ceiling' doesn't?
This looks good? What would you feel the point cost of this should be? atm it's 0.
What's literacy do?
affects reading speed
Is that a vanilla thing?
no
ah
I dig it
Walk while reading is clutch
can you read while driving?
no that should be for a tween trait
Texting and driving skill
the Librarian is apart of a mod Better Literature: A Literacy skill mod. Adds in a new passive skill called literacy and reworks the reading system a tiny bit.
never seen that mod
it's new
not on steam?
it's so new, you could say it's still in development
basically more you read, more you level up the skill. higher level skill, faster you read. lower level of the skill from 'average' (5) slower you read.
Fast reader no longer 'makes you read faster'. it just gives you +2 literacy (which makes you read faster).
Slow reader does the reverse with -2 literacy.
it reworks magazines, books, comics to have page count and it does affect them.
cool cool
gonna need some sort of
eyestrain balance mechanic
otherwise im just gonna read for 12 days straight
doooo it
also never understood how i can read in the pitch black of midnight in a blacked out room
or how i can read at the same rate, at least
ยฏ_(ใ)_/ยฏ
you also gain walking and reading by just leveling the skill up to 9. so you don't need the librarian for it. the librarian is just a cheat for it
I'd love a trait that lets me equip/unequip a weapon while running
that could be possible
lmao i found this always sunny reference on a moving truck
assuming its from filibuster rhymes but it absolutely made my day either way
Also a craft while moving trait
Like lemme sharpen a branch into a spear while I'm running for my life
Hi everyone!
Is there any method (I assume not) that works the opposite as: TraitFactory.setMutualExclusive? I mean, if you pick a Trait "A" on the Character creation, it automatically picks "Trait B" too and vice versa
Or is there any event that is triggered when a trait is added in the Character selection?
imo I think there should be a glasses wearer trait that gives you skill points, I suggested this earlier this week but sort of jokingly, but I feel like this could actually be doable: basically, the trait would make the player need to wear glasses, otherwise, the player's visibility cone would shrink almost entirely, and will not be restored until the player puts the glasses back on. Maybe even glasses durability that has a chance to go down when glasses are dropped or fall off the player's face
not sure how easy it would be
if i knew how to mess with the FOV then I would but dunno how to
ooooo
didn't hydrocraft do this?
you know, its strange, i think it does, but ive never used the trait. also, for some odd reason, it doesnt show up on the main menu, just ingame
i know there was a hearing aid to fix hard of hearing
like, it doesnt show up on the main menus character creator, but in game it does
yeah
once again, never used it
free points ๐
@undone heron some of the weapons attachments from the brita pack affect fov, maybe take a look there?
hmmm, good place to look then
when will the Literacy mod release?
when I'm comfortable enough and get a few cross-mod things working
alright ty, gl!
Haha, hell yeah man. I'm glad ya liked it!
having some issues atm. it is okay with overwriting better lockpick's magazine, but not scrap weapon or L&M's
why do you need to do that exactly? Is there anything I can do to help?
i mentioned it earlier: I gave exp based off pages. books with no pages = no exp.
so I am doing a small overhaul and giving everything a page count
but you said these would have their number of pages tied to the number of recipes, right?
so I finished going thru some popular mods and making overrides for their skill magazines.
that I did manually
override the timed action -> check the list of recipes in the item if it doesnt have a number of pages value -> use list of recipe's size to find the desired num ber of pages -> give xp
you may also want to do some math for boredom change or something like that too
theres also books, comic books, and news papers from other mods that don't go by the name "books" "newspapers" "magazines" "comicbooks"
Does anyone have any mods to suggest that add in anything about farming or cooking content that isnt part of Hydrocraft for B40?
does anyone know how to use getRandomOutdoorFreeTile()?
i looked at the java design doc and don't see a way to call the recipes a book teaches.
tho doing so I did think of a way to the the difference for other mods and give them pages based on the boredom they heal. Since mags/newspapers are generally 10, comics 20, books 40. could be "hey it has an boredom heal of 10, give it 16 pages!"
that's actually clever
Soul Filcher's Cooking Time and Soul Filcher's Farming Time 
green fire lets you grow weed and tobacco lol
if thats anything
exactly what I had in mind
getTeachedRecipes() <--- returns a table with the recipes, get the size of the table
Will this work? getPlayer():getCell():getRandomOutdoorFreeTile(). Not sure how to use it.
I am having some trouble since getn and maxn isn't working cause it's a string and not numarical values, and a few solutions I found online have sucked and not helped/lead to errors
it's 1am but I don't care I got the recipe counted in a dumb way but it works
local testVariableThree = item:getTeachedRecipes();
local testVariableFour = 0;
for i in string.gmatch(tostring(testVariableThree), "[^,]+") do
print(i)
testVariableFour = testVariableFour + 1;
end
And got the formula for rest of them.
Math.floor(((Unhappiness+stress+boredom)/2)/8) *8
hey guys, is there an easy way to edit/add an existing trait ? i have minimal understanding of modding
to be more precise i would like to add a new trait for lucky but with less chance for extra loot and maybe cost less points
Hey can someone help me figure out a bug
LOG : General , 1618389796779> 1618389796779 znet: ZNetFriends::OnPersonaStateChange
LOG : General , 1618389802140> reloading C:\Users\deadk\Zomboid\joypads\XInputController0.config
LOG : General , 1618389802177> new focus nil table 0x2075241671
LOG : General , 1618389802178> update focus new should be table 0x2075241671
I think I've seen this in a mod, thought it was cool.
If nobody wants to do this idea, I will steal it and put it in my backlog
Hey does anyone know a way of having the electrical grid and water supply never shut off?
Are you looking for a mod that does this or a way to mod it yourself?
A mod would be helpful as I have no experience in making any mod myself XD
Unfortunately I do not believe this is currently possible according to the code I see
Is this not covered by the sandbox settings? Is it not covered by Sandbox+?
However I can add this to the list if you are unable to find a solution
Just checked, and Sandbox+ does not offer no-shutoff option
thanks for the help guys
Thanks man
np
You can change it in sandbox
need a save the station style mod but for power and water
Having issues wrapping my head around lua table lists. if anyone would like to help: that'll be awesome. Here is what I have so far.
local function onInventoryFill(_room, _containerType, _inventoryOfContainer)
local test1 = _inventoryOfContainer:getItems();
print("VARIABLE ONE TEST");
print(tostring(test1));
end
Events.OnFillContainer.Add(onInventoryFill);
So when a container is spawned, the event fires.
I get the items of the container into a variable as a list (test1)
I then need to get and check each item on the list <----- This is what I'm having trouble figuring out
I check the item by using the IsLiterature() boolean
If true, I do my stuff of editing the item (which I know works from a separate function)
if false, continue on the list
~~ I cant do what I did yesterday with the cheese of converting the whole list into a string, separating it base of the commas, and counting how many times it got separated. I actually need to access the items~~
Maybe something like this
for index=0, known:size() -1 do
print(index, known:get(index))
end
```https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md
How are you doing so far? Why do you need to edit each item separately?
consistency with tooltips.
at the moment: the code that gives pages to books only happens once you start reading a book If the book has no pages, it will be given pages. However other books in the world will still have no pages listed.
let me take a picture
Item Tweaker would help with that
so by using
Events.OnFillContainer.Add(onInventoryFill);
I can see if anything is (nice car) marked as literature when it is created. If it is, run the page code on it.
and I think Mr Anon gave me the piece I needed to finish
Uh, just use item tweaker and assign page counts to the literature items that way.
Going off of OnFillContainer has a hit on performance, and is also the insanely over complicated solution to this issue as opposed to just using Item Tweaker.
It's a clever solution, but unnecessary.
what is itemtweaker and will it affect even modded items
or will I have to assign every value for modded items individually
because I was originally going thru mods and making scripts to override book items: then soul was "just use a function to do it automatically". Now if it's back to manual, I might just stick to having it automatically happen.
You should be able to, at game start, evaluate all the literature item scripts, and, if they don't have a page count assign them a page count then via item tweaker or your own code.
I use OnFillContainer modification of items for one of my WIP, because in my case I have to for the insane bullshit I'm doing, and there is a noticeable hit on performance when entering new areas while using it.
You would be better off assigning the page counts once at game start as opposed to every time an item spawns.
As well,OnFillContainer gets fussy with stuff like containers inside containers and vehicle contents.
i'll look for a way to get an array of all the items at game start and do it that way. fillcontainer is still a backup plan.
or could just say screw consistency and not worry about the tooltips being inaccurate.
itemtweaker modifies the script values
itemtweaker uses
ScriptManager.instance:getItem("Base.something");
and
item:DoParam("something = something");
is pages read within those values?
I would (from what I looked at so far) find each item and know the base.id of the item for item tweaker. I would rather just get a massive array of the items and then sort it out.
you'd only need the base ID yes and the param ID nothing more
but I would still need to manually input everything, is my point
You can edit the item type like this
local item = ScriptManager.instance:getItem("Base.Spoon");
item:DoParam("TreeDamage = 10");```
You should be able to, at game start, evaluate all the literature item scripts, and, if they don't have a page count assign them a page count then via item tweaker or your own code.
unless books are a separate item structure from the rest- yes
I would (from what I looked at so far) find each item and know the base.id of the item for item tweaker. I would rather just get a massive array of the items and then sort it out.
I love me some low impact automatic code- but running a process every time seems wasteful too
talking about Item tweaker.
yes
yeah each book is it's own individual item
You could make a table of the item types like {"this","that"}, assuming what you want can be done by changing the item script thing, idk
they're all literature type though
example: Literature & magazines introduces 1k plus different books. I would need to go through and get the ID for each one and input that manually for hte mods to work together with item tweaker
What change exactly are you making to the item scripts?
you won't be able to use itemtweaker out of the box but you could modify it to only impact literature typed items and do what you need to
IF read pages are a parameter
seems odd to place that on the item considering MP
but having pages read from books being placed on the player would have solved your issue to begin with
the amount of pages read is stored on the character. the issue I'm trying to fix is a tooltip issue were a book's pages won't show until you pick up the book if the book did not have pages to start with.
which is a value stored on books called :number of pages
then target the tooltip process
local original_render = ISToolTipInv.render
function ISToolTipInv:render()
if not CONDITION then
original_render(self)
end
-- ... some custom code ...
end
```Copied from elsewhere, you could do something like that, to automatically add pages to literature of mouse-over.
"Literature & magazines introduces 1k plus different books"
One thousand yeah it would take a long time to copy their names into a table for doparam
I'm making no changes to the script (anymore).
Before I just added a page value (in the script). Now: when a person picks up and starts the read action - I check to see if it has any pages. If it doesn't have any pages (as in books with no set page count), it will then give it a page count.
The issue in trying to fix is that only the books the player has actively initiated the read action will display the updated values. I would like all books to display the page values.
Weird bug of my mod "fluffy hair"
Not sure what can cause that. Doesnt happen to often tho
Maybe this?
local original_render = ISToolTipInv.render
function ISToolTipInv:render()
--your code for the page number checking
original_render(self);
end
i'll try the tooltip fix
i have a mod request, if that is even possible to do and if someone is willing to do it: a target dummy for practicing shooting, basically a crafting recipe that spawns a zombie that doesnt move and have infinite health unless you dissasemble it. is it possible?
yeah it is
is there a way to Sort tables or arrays in Lua?
table.sort
Sorting tables is fun and easy to use! Find out how! | LuaLearning is the best educational Roblox scripting tutorial site, with hundreds of Roblox Lua tutorials to use!
honestly being able to shoot at items, windows, etc, and have it count for aiming would be neat
yeah, i don't see a function to get every item in the game on a list. rip the idea to do it on start. you can call an item (from what I seen) but you need the id for it.
Working on the mouse over idea now.
Figured it out. It happens if you have empty/overlapping or wrongly named vertex group which usually should bind your skinned things on the bones.
Funny tho it then gets attached to the avatar (hair from zombies)
@undone crag tooltip hover over works
it's still most likely not the best solution on doing this automatically (best would be on start if there was a way) but better than OnInventoryFill. I'll still look into a way to get a list of every item OnGameStart so I can switch over to that function
o:
any idea how much do silencers from silencers mod silence the guns ??? xD
a nvm
It reduces the sound the gun makes by 90%
xD
Check list:
- the skill functions in increasing and decreasing read time
- reasonable? Exp time. Able to go from 5 to 9 with every vanilla book once
- functional with books from other mods
- traits that effect the skill
- at least one profession that gives it.
--- should any vanilla professions affect literacy or nah?
--- still need to select spawn points for the librarian. Need to learn how to do that.
Any suggestions?
I'm not a big fans of modifying vanilla professions, and the skill is niche enough so I'd say leave them
Kk
Has anyone else had this problem of textures not being applied correctly to your models? For me it seems something along the lines of them being flipped
imported/exported X format?
doing it in a dumb way of exporting fbx from blender 2.8 importing it into blender 2.7 and then exporting X from there
If that's what you're asking
Don't convert to X, use FBX
Making weapons, isn't it required for weapons?
No, the game accepts FBX just the same
If you had a horde spawn on you, what size would scare you but be managable to deal with?
@undone heron @nimble spoke maybe you guys could chime in?
Omg it actually does, was under the impression fbx was for vehicles and clothing, since all the mods I've looked at and used for reference have only used .x so far for weapons
thanks a ton, the texture problem seems resolved already
depends on what you mean by scare but manageable. Depends on the situation I think. I'm not the type of player that guns down the whole city, but I also try to kill the loners and small groups in areas of interest
depends on the day? like first 7 days... a small amount. 10ish. like those standard zombie clumps but coming to you.
like a month in? large 30-40
if I run this will it delete data in the array? ```lua
zlistClose = ArrayList.new()
Meaning, if zlistClose has data in it, and I want set it bank to blank, will that work?
i am using superb survivors, and after a raider event happened, i am now getting constant errors. i just want to fix it.
wait, no, i think that i know how to fix it
Claustophobic
took me like 15 minutes to realize this is misspelled in the vanilla code lol
couldn't figure out why the code kept failing
lol
yeah, ok, i fixed it, sorry lol
Hey guys, is there somewhere a tutorial for adding static items ingame? (for example I want to add a different kind of fridge)
nice
Thanks!
Not enough zombie in cod, velikan goes to zomboid
HaโHaโ
Btw brita is thompson smg not yet added to your mod ?
It will be added in the next update
Great I'm really waiting for that gun to be added
It will set the variable zlistClose to a new initialized object which means it will replace the data currently held by the variable. If you want to add to the list you need to use one of the methods in ArrayList. Note that you can also merge lists, not only add individual elements
@main lion That's a FAST Helmet. Holy shit.
Any chance of working with Nolan to make SpecOps NPCs that wear that type of gear?
Compared to another file format, the .X has the Y axis in the opposite direction. By Y I mean the second of the three numbers that are called x, y and z.
accidentally spawned in too much bleach when testing mods.
RIP
From the latest Thursdoid: https://projectzomboid.com/blog/news/2021/04/8953/
The mapping tools are set to be updated, including all changes made since build 41! This has a few new things that mappers have been craving, new tile sets and the like, as well as support for newer features such as river flow directions, QoL improvements and so on. Weโre aware that weโve been a little lax on documentation on some of the modding processes, its been very much all knuckles to the grindstone of MP of late, but we do have plans for some additional support for modders, particularly those trying to crack 3d rigged / skinned models, its just weโre wary of diverting some key peopleโs time at the moment!
Hello all! Hereโs a rundown of whatโs been going on this week. But first: For all those not interested in multiplayer progress, since we went so MP heavy last week with our deep dive, we thought it only fair to give you something non-MP related, and a little more than weโd normally tease. Hereโs a [โฆ]
๐
does someone know how to edit the pan cam function? i'm looking for a way to set the zoom level - like zooming out the further the cursor is away from the char... with autozoom activated, the pan camera function works perfect between the lowest and the highest zoomlvl set in the options, but only when interior... just wanted to know if it would be possible to use it outside a house too. anyone ever edited the cam settings here?
No, you can't manipulate the java arrays directly. You need exposed code that does it
What makes you think this? ArrayList class is exposed
I haven't had the time to look into this but I am also interested in messing around with the camera, especially the zoom setting as I think it should be a bit more modular
Are you looking to do a mod that does this?
hi yooks. i dont know, not into modding rly. i thought editing the lua files would do the trick.
maybe extracting the autozoom function from the inhouse code above, so it is available everywhere... btw, the autozoom triggers when an zombie is attacking - should be possible to copy the code and paste it as a header or something so its availabel outside 
Everything is possible, it's just a matter of how difficult
Would anyone be interested in seeing zombies ambush players by crawling from underneath the cars?
yeeeee
have them sit and wait till a player gets close
kind of like zombies who "play dead"
Yes, but I don't think that feature works yet
Have you seen it work perhaps?
I've seen them sit against a wall, but never play dead
i 100% do not know. just something I seen while browsing code and states
My idea was that we can spawn them under cars when they are procedural generated. The chance to spawn under each car would be random (perhaps 10% or less). And then they would just sit there silently forever until a player approaches near a car at which point they would activate and start crawling towards him
that is a good idea
So there would be absolutely no chance to find out if the zombie is there or not
You would need to listen carefully once you approached a car since they would still moan
have it so if it gets a success with the 10% chance, it rolls again till it fails
What do you mean?
Exploding die.
it rolls the dice and gets the 10% chance, spawns a zombie.
it was a success
so it rolls the dice again and gets a 10% chance, spawns a second zombie
so it rolls again
it was a failure, so it stops
Oh no, you're evil 
Have like 10 of them piled up under a car ๐ป
That's absolutely dreadful... we're going with it!
I mean it's a 1% chance that there will be two, and a 0.1% for three. So the odds of 10 being there is so low it's near impossible.
but man i can't wait till some streamer goes to a car and 10 of them pop out
Just wanted to see what people around here think about that idea
Going to start working on it in a few days to promote Storm
I like that idea, could also tie into vehicle events
like a zombie was run over and was stuck under a car or something
also these zombies coming out from under the car would only be crawlers right?
or would they get up
I was thinking they would only be crawlers, but we can make some of them stand up
i like the idea of them only being crawlers imo, but that would be cool too
Although I like the idea of zombies being stuck, does that ever happen in vanilla?
One time i've gone over to a vehicle story and a zombie I thought was dead stood up and came at me, so kinda
there was blood around him so i assume thats what happened
would also be cool if those crawlers under cars had bandit or police sort of gear
like maybe as a joke police zombies spawn under police cars because they're attached to them even as zombies or something lol
Police zeds do spawn around cop cars
But he wasn't actually stuck as in unable to move
yeah exactly
I don't know if that ever happens in vanilla, but it would be a nice thing to implement
thats true, it would be cool if zombies could spawn wedged into walls or something via vehicle
In TWD they show a lot of zeds that are just stuck and unable to move
yo imagine if you could find zombies that previous survivors tied up that are still alive
once animzed comes out and you're able to do stuff like that that would be sick
like if someone tied a few up instead of killing them
We already can have custom animations though
The only thing I really need to implement what you mentioned is animations
Peach can do really good animations, I asked him to teach me so we will see
oh dang well I'll be very interested to see how it turns out!
can some one test https://steamcommunity.com/sharedfiles/filedetails/?id=2440051148 and see if it's working? It seems to not be working anymore for me.
even on a clean save with just it
these types of mods are likely to break (assuming this one is now broken) further with the change to loot tables coming soon. Unless the items are using Procedural_Distribution loot tables, then the items will simply end up on the 'cutting room floor' so to speak ๐ฆ
Can somebody help me to do a function to test weight? I would need to increase/decrease my weight by pressing a key
I tried by doing this but it didn't work ๐ค
function increaseWeight(keyPressed)
if keyPressed == 78 then
local player = getPlayer();
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
end
function reduceWeight(keyPressed)
if keyPressed == 74 then
local player = getPlayer();
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
end
Events.OnKeyPressed.Add(increaseWeight);
Events.OnKeyPressed.Add(reduceWeight);
Also tried this:
-- Used for testing purpose only
function increaseDecreaseWeight(keyPressed)
if keyPressed == 78 then
local player = getPlayer();
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
if keyPressed == 74 then
local player = getPlayer();
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
end
Events.OnKeyPressed.Add(increaseDecreaseWeight);
you're increasing weight in both cases
I just modified that with a -1, but anyway I don't increase or reduce weight :/
are you usre you're pressing the right keys?
function increaseDecreaseWeight(keyPressed)
if keyPressed == 78 then
local player = getPlayer();
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
if keyPressed == 74 then
local player = getPlayer();
local weight = player:getWeight();
weight = weight - 1;
player:setWeight(weight);
end
end
I used a print to see the keys and the numbers were 74 (minus in the numerical keyword) and 78 (plus in the numerical keyword)
Try looking for the defines for keys instead
Do you know where I can find them? I tried but couldn't find it
If you put a print() you can atleast see if it's getting called
It's usually 'Keyboard.KEY_' something
I usually use the numpad keys for tests
Ex: Keyboard.KEY_1 etc
KEY_MINUS is for -
KEY_ADD is for +
This is all assuming you're calling this function with Events.OnCustomUIKey.Add()
?
That could also work, but I think that one is for long presses?
Nvm, that would be keep Pressed
Both may work though
So, when you say "KEY_MINUS" or "KEY_ADD" that would be what I have to write instead of 74 and 78 in the if?
You tried use debug and check what specifically is not working?
Not really, I'm still not used to the debug in-game, I'm new to this ๐
=Keyboard.KEY_MINUS
I found the right keys, and I know the function is being called because the keys are being printed in the console, but I'm not changing my weight so it's probably the code about weight what's wrong
No errors, just nothing happens but the print, I changed to numpad1 and numpad2 to check with other keys
-- Used for testing purpose only
function increaseDecreaseWeight(keyPressed)
local key = keyPressed;
print(key);
if key == 79 then
local player = getSpecificPlayer(0);
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
if key == 80 then
local player = getPlayer();
local weight = getSpecificPlayer(0);
weight = weight - 1;
player:setWeight(weight);
end
end
Events.OnKeyPressed.Add(increaseDecreaseWeight);
OMW
-- Used for testing purpose only
function increaseDecreaseWeight(keyPressed)
local key = keyPressed;
if key == 79 then
print(key);
local player = getPlayer();
local weight = player:getWeight();
weight = weight + 1;
player:setWeight(weight);
end
if key == 80 then
print(key);
local player = getPlayer();
local weight = player:getWeight();
weight = weight - 1;
player:setWeight(weight);
end
end
Events.OnKeyPressed.Add(increaseDecreaseWeight);
Yep, It's probably an error related to the setWeight
damn. For some reason skill books for stuff like passive or combat skills won't work.
check their internal names just to be sure, because if I remember it right, there are mods with books for combat skills
I know I have books for maintenance in one of mine
Get weight isn't player weight
It's from IsoMovingObject and is returning location lmao
I'm looking at the Nutrition class and there is a method called getWeight there
I thought about that for like Strength, but Strength is just Strength in code, in the UI_file, ect.
Do you know how to get the player's weight? ๐ค
Then you need to get the plyers nutrition class
the book shows up: you can read it, but you won't get anything from it
Player: getNutrition(): getWeight()
it worked!!!
-- Used for testing purpose only
function increaseDecreaseWeight(keyPressed)
local key = keyPressed;
if key == 79 then
print(key);
local player = getPlayer();
local weight = player:getNutrition():getWeight()
weight = weight + 1;
print(weight);
player:getNutrition():setWeight(weight);
end
if key == 80 then
print(key);
local player = getPlayer();
local weight = player:getNutrition():getWeight()
weight = weight - 1;
print(weight);
player:getNutrition():setWeight(weight);
end
end
Thank you a lot!
I don't really know what's that guide ๐ค But now I'm interested ๐
oh, to see the method I directly read the code, but I was reading in the wrong place ๐คฆโโ๏ธ
Yeap! I use Intellij too to read it haha
I would recommend pz-mod
It's supposed to be initialized with in your mod's directory but you can just intilize it on itself and use what it builds as a library in intelliJ
Anyone familiar with saving information with ModData?
tried saving an object within a table, but the objects seem to get lost
MAde some progress from my last post. It seems to search thru a skill book table and returns nil of it isn't a crafting or foraging skill it seems.
I'm having it print these three things
print(self.item:getSkillTrained())
print(SkillBook[self.item:getSkillTrained()])
print(SkillBook[self.item:getSkillTrained()].perk)
A vanilla carpentry book returns
[15-04-21 23:03:41.163] LOG : General , 1618545821163> Carpentry.
[15-04-21 23:03:41.164] LOG : General , 1618545821164> table 0x990356555.
[15-04-21 23:03:41.164] LOG : General , 1618545821164> Woodwork.
The modded book returns
[15-04-21 23:04:50.057] LOG : General , 1618545890057> Nimble.
[15-04-21 23:04:50.057] LOG : General , 1618545890057> nil.
[15-04-21 23:04:50.058] LOG : General , 1618545890058> -------------------------------------------------------------
attempted index: perk of non-table: null.
try setSkilledTrained() for custom books
yeah I'm not sure how or where the table SkillBook is formed
---@class SkillBook
SkillBook = {};
SkillBook["Carpentry"] = {};
SkillBook["Carpentry"].perk = Perks.Woodwork;
SkillBook["Carpentry"].maxMultiplier1 = 3;
SkillBook["Carpentry"].maxMultiplier2 = 5;
SkillBook["Carpentry"].maxMultiplier3 = 8;
SkillBook["Carpentry"].maxMultiplier4 = 12;
SkillBook["Carpentry"].maxMultiplier5 = 16;
it's a global table
You could modify it on gamestart
I used pz-mod to find it but it's here: ProjectZomboid\media\lua\server\XpSystem\XPSystem_SkillBook.lua
you can also inject new info at runtime
like at OnGameStart, just plug in stuff
Idk if you can just declare entries to it in another file
and replacing the entire file can lead to compat issues down the road
I mean it's global so i should be able to, but I'm going to do it on game start like you said. Just making sure to stick it in the server folder just in case
ty for the help
np
Hello what are the maps that integrate on the vanilla map except these 3. Help is very much appreciated and thank you
Before I dig into it, does anyone have a simple method to play a sound? Like something I could hook to an event.
@undone heron retrieving perk will always return nil for modded skills, they aren't listed in the perk class
getSoundManager():playSound(sound)
I was talking about modded books, not modded skills
I know that the modded skills won't return anything, but was trying to figure out why stuff like Nimble or Strength wasn't returning anything
and chuck helped figure it out, there was a table that was the missing piece.
I like self.character:getEmitter():playSound(self.soundFile). The code I've seen and used lets you adjust the volume and radius of the sound, and also stop the sound if you want in the stop/perform function of a timed action.
@grave solstice yeah, that's what I'm using, it works great
@grave solstice i've seen a couple different ways to add them in. your mod is one way
If you see a way you prefer to the way I did it, let me know! I'd love to improve my code! I only basically copied other code I found.
@grave solstice haha, this is the way. If you don't specify a sound radius, is there a default? Or does it not broadcast to zombies if you don't specify? I'm thinking like "level up" sound
I have a zombie spawn event, and I'm think of adding a sound to it. I could either just play a general sound as a notification that it's starting (like a distant zombie scream) or maybe play a specific X,Y sound on the spawn tile
Here is how Chuck and me did when we worked on the Heli mod:
https://github.com/cocolabs/pz-ehe/blob/dev/media/lua/client/eHelicopter.lua#L19
If I weren't working on my mod, I'd want to do an experiment on zombies and volume/radius. My guess is that that the emitter sounds is better for diegetic sounds and the sound manager is better for non diegetic sounds. This will also be good to test once multiplayer arrives, when the difference between diegetic and non diegetic sounds becomes even more important.
good point, you're probably right about the difference between the two
@grave solstice So how do you change the radius and volume of the sound?
Do you mean how to change it once the sound starts playing? I don't know how to do that.
Oh, fade out would be cool sometimes. I wish I knew how to do that!
All my code does is set it before starting to play it
you could probably do it if it was looped by dropping the volume on every loop, but probably not a static sound
All you have to do is reduce the volume gradually
What is the equivalent to a delta time update so I can smoothly increment across time?
I know weโve got like every 10 minute ticks and such but those are too slow
Thatโs probably right, I thought those were a little slow but may be remembered wrong
Trying to rapidly move the player directly south east quickly to make fake falling
Adding these cliff sides to my map and if you walk into it it โslidesโ the player down to the bottom rapidly. Ideally itโll calculate damage done to clothes, injuries, tripping chances and the like too
The cliffs are just floor tiles with a IsCliffside tags so the game will check of the player is on one or not then go till they hit regular ground or a wall or something
Has anyone had an issue with Autostar Trailers where it seems like they've got a parking brake enabled?
I cant pull any of them today for some reason
Which is odd because it was all fine yesterday
boot it up today and nothin moves
Oh I think it might be filibuster update that did it
@ember orchid Hey duder, is there something I have to do on my end to be able to tow trailers effectively with your cars?
I'll ping ya on your own discord and figure it out there ๐
Think I have a mod knocking out my skills section, it's just blank with a little square clickable with a an arrow that does nothing. Any thoughts or recommendations to get that back?
Do you have extra skills system enabled?
@nimble spoke yes! I just found that
are there instructions I missed on how to pull them up?
Sound don't impact zombies - there's another function also named something related to sound for that
good to know
I think it's addsound(), not at the computer to check
Also I think players have fixed emitters (things that play sound) - but you can pull emitters as needed too
Dose it come in tan?
The heli event I'm working on has an emitter for the rotor sound, announcements, and guns
Otherwise they clip each other at times
I honestly would wait until after Noise works gets through with the sounds
They may change the skeleton of the system and the current one is a bit of a nest
If you could send me the error log it would be great. and the mods that use that as a requirement
Looking for a mod that gives random spawns in the current build. Anyone know one?
@sour island that's a good point. I'm really just using this bit of code for simplicity, it doesn't need to do much and isn't fancy ```lua
getPlayer():playSound("sound")
Maybe this is a silly question, but is there any kind of limit on sound file length or type or quality or anything? Or can I just make whatever I want and stick it in there?
@split cipher Thanks man!
no worries ๐
You should ask Raven, he knows most about sound stuff here
How long are you thinking? Some Survivor Radio sounds are basically songs, so 3 mintes +
i have noticed that stupidly long sound files will freeze the game time to time when they are loaded
@grave solstice @shrewd grove the one I just made is a minute. It doesn't need to be that long but I'm going to try it out
It's a long wind sound with a low rumbling thats a bit unsettling
I keep getting this error. It still plays the sound though: ```lua
getPlayer():playSound("RedFogIntro")
WARN : General , 1618623367064> GameSounds.getOrCreateSound> no GameSound called "RedFogIntro", adding a new one
not an error, it's a "warning" ๐
since you don't have a script for that sound file it's "creating" an object for you
I assume having a script speeds up loading
Hey guys, fairly new to modding zomboid, wanting to add a car into the game. Was wondering if you guys knew where I could find the fbx files to get a good idea as to how they're modeled. As far as I'm aware you have to swap z and y coordinates in order to get things in the right orientation but I'm not 100% sure where the car models are located/if I can even get them
@sonic quiver ProjectZomboid/media/models_X/vehicles
@radiant ginkgo thank you so much! I love your cars btw, I own an impala irl so it was really cool to see your mod show up.
Which is the reason I'm wanting to make my own
hey, so I think most of you in this channel are making mods, but I have a hydrocraft related question and I was pointed in this direction... is this the right place?
This is the channel for anything pertaining to modding/modded.
okay, cool.
so, I'm fairly new to the game and very new to hydrocraft. came across a couple Empty ICBs, and turned them into an ICB Tower. problem is I can't figure out how to place it. I found a video where someone placed one and they did it through an "Advanced Building" tab in their context menu, which I don't have. am I missing a skill or some necessary item?
A skill, or possibly a tool. I don't know what that is, but there's a good chance you can't just slap it down with your bare hands.
Hydrocraft has a wiki, doesn't it?
I only found a guide for it on the pzwiki
there are some related pages on undeniable.info too, but nothing that addresses what I'm dealing with
I'm still looking for information. I found a video (seemingly from the creator of hydrocraft?) where they are introducing the Advanced Building menu. there is no mention of any skill prerequisites or item requirement to access the menu but it does specifically talk about item requirements for the constructibles themselves and points out that those requirements are displayed as you can see in the case of the welding mask and blowtorch being required, here:
by comparison, in this other video, you can see the IBC tower has no item requirements beyond its construction components (though the naming is different so it's probably an earlier version):
I guess I'll ask about it on the workshop page for hydrocraft, but if anyone thinks they know what's up, I'd appreciate whatever info you can provide. I don't know how long it will take someone to get back to me on steam workshop.
How hard would it be to add a search function to inventory and would anyone consider making one? :p
Need a little help with Lockpicking mod ("Lockpicking. Just. Lockpicking" mod). I can't find the option to lockpick the car door.
tacticool
Yo. What would the Lua look like for an Or statment? Trying to diversify my trait mod by adding a range of possibilities rather making each one an individual trait.
playlists work with tsarcraft ? - if so, which format should they be in, and should it use relative or absolute path ?
i have +60 hours of music albums so that would be quite useful and space saving
Velikan had enough with ffar on warzone, to throw away some stress he came here to slay zombies
Lol I need to add a sykov pistol too
Yea that's a good idea
if anyone could help me with the sound playback, I'm trying to run this code. It usually works fine, but sometimes it just doesn't play. No error codes or warnings given, my guess it it sometimes plays at the same time as another competing sound that is looping or something and gets overwritten or ignored. ```lua
getWorld():getFreeEmitter():playSound("CustomSound")
hmmmm, this is annoying. Mod works solo. Tried to stick it in a private modpack so I can just activate it instead of 10 different mods. Mods stop working.
Morning everyone, been playing the game for awhile but finally switched to B41, is there a list somewhere that has some B41 mod essentials?
is CustomSound scripted?
module Base {
sound eHelicopter {
category = World,
loop = true,
is3D = true,
clip {
file = media/sound/heli_loop.ogg,
distanceMax = 1500,
volume = 3.0,
}
}
}
if it is scripted the category has to match the type of emitter you're grabbing
mhm figured out my issue from earlier. two mods edited the same thing. took a while to find. fixed it. mod pack now works again. yay
@sour island Yes, I scripted it, but will go back in and fix it up to see if that helps.
@undone heron Does your literature mod factor in already read books on existing saves?
Seems I just start in the middle with some wacky XP numbers:
-37k/30k xp doesnt seem right
Seems fine to me ๐
Anyone have some good documentation sources for just starting out with modding? Specifically looking to make a save manager. Is this something I'll have to do with java or is this something the lua api is capable of?
Description said mod was designed for new saves. Adding it mod save can cause issues.
Gotta go from 0 to hero with that xD -37k
that said, I'll work on a fix if it was added mid save to at least bring you to 0
Ahh I missed that in the desc, my bad!
Imma chad through this 37k, and then the next 30k
you just watch
Thanks for the mod, I love the idea ๐
at least it thinks you're level 5 so you get the default speed instead of 0 for the -75% speed
Yeah, it's not the end of the world that way
Thought it'd be interesting to make light a requirement for reading
bit odd you can read in the pitch black of a bathroom in the middle of night
Steam workshop there are a bunch mods that have been updated to work with build 41
Would anyone happen to know where items would be found in lua
Which class Items such as lighter would be in?
that's in scripts
I'm still learning so I am trying to write my first mod on lua but could not find the lighter anywhere. Would I search scripts under class?
If anyone can help me that isn't busy right now would be greatly appreciated
I'm not the best person to help you, but the lighter is in the items.txt file under scripts. (Project Zomboid directory/media/scripts/ - according to the wiki for Lighter)
Thanks but I am trying to find it on lua I'm trying to write a mod for the lighter
What are you trying to do with a lighter? Off the top of my head, it is easy to find examples if you want the lighter as part of a recipe, or if you want the lighter to give you a context menu option to do a timed action...
i want the lighter to start a fire
for example use the lighter anywhere to start a fire
if you wanna burn a house down full of zombies for example
i am looking under isofiremanager at the startfire line
trying to find the lighter and link it with the fire
Are you think something like if you have the lighter equipped, then you can click on a square and it gives you a menu that includes start fire? Or maybe something similar to how the sledgehammer gives you an option to destroy?
correct to start a fire on the spot on surrounding tiles that spreads
i was even looking into isostove to see how i can set the stove to catch fire faster
either would work
Have you looked at the ISBurnCorpseAction? That already uses the lighter.
interesting ill take a look maybe i can repurpose it somehow? im still learning the ropes
My guess is you could try doing exactly what that does, except not require a corpse to be in the spot
typing it doesnt show a result
where did you type it?
if you look for the file under /media/lua/client/TimedActions
will check right now thanks
i found it i have it open looking through the code just have to figure out how to make it work without the corpse
@undone heron is being able to read with ur literature mod while climbing/opening windows, and walking on furniture a bug?
it's not a bug, it's a feature
it seems like anything you can do while eating, you can do while reading once you get high enough
oh alright, thanks
tbh I love how sneak reading looks
it's so silly
I'm surprised the animation system even blinded for that
blended*
indeed
does anyone know where mods should be place. i placed the lua file and the mod info file in mods in project zomboid folder but they do not show on the mod list in game.
you just have to click download on the mods you wanna install on Steam and they should appear in the mod list in game
Have you figured it out?
Not sure because I can't find a lighter in game lol
Is there a command menu to spawn one?
Yes, lookup debug mode. If you enable that, you can give yourself a lighter
Got a lighter no option to light the ground.
I got rid of the corpse requirement
I replaced it with isocell idk if that's the right one to use for starting a fire on the floor
I need to set something in place of the corpse to set fire
Maybe you can find the code associated with the sledgehammer to destroy things, and switch that out to run the burn code on the lighter
Or maybe you can do something similar to how the construction actions work, where just clicking on the ground gives you the option to build something
No luck :(
is that the zip gun?
will they increase hearing range? or purely cosmetic
irl they amplify things like voices but they muffle gunshots
What's the optimal way of adding items to loot tables? I've looked at a few mods and it seems there's more than one way to do it, although I could be misunderstanding something
I consider this to be the "proper" way (although there's fancier proper ways as well).
FYI a lot of mods fuck up the disto tables with how they add items to them, so be careful about copying the methods from other rmods.
table.insert(SuburbsDistributions["policestorage"]["locker"].items, "CCVest");
table.insert(SuburbsDistributions["policestorage"]["locker"].items, 1);```
Thanks, that looks simple enough
Curious as to what the wrongly done method looks like
There's multiple degrees of "wrong", but the worst one just replaces the distributions files in it's entirety.
Also, FYI, the distributions tables are getting completely overhauled, which will break a ton of mods, so be prepared for the possibility of re-doing your distro table stuff after that goes live.
Ah yeah, I've seen people talk about that, shouldn't be too much of a hassle for me
Also the number value for the rarity of the item, how exactly does that work? A bit confused as to the ratio of rare to common and etc, is it a percentage or?
well I got sound working, but it could be more elegant. Does anyone know how this works? I tried it and it doesn't do anything. ```lua
---Specified by:
---FadeOutMusic in class BaseSoundManager
---@public
---@param name String
---@param milli int
---@return void
function SoundManager:FadeOutMusic(name, milli) end
Why are you creating the function inside SoundManager table?
When container loot is spawned a random number is generated, the maximun vakue of which is determined by the loot scarcity settings for it's category (I don't recall the exact values) and if the bunber is ewual to or less than the value, the iten is added to the container.
The rolls value in the distro table determines the nunber of rolls that are made for this check for every item in the container. Incidentally changing the rolls value is how some mods fuck up the distro tables.
But the nunber you want to go for is an art and not a science, you really should test and test and test again the spawns to get them dialed in to what you like. You can use debug mode to wipe the map & necroforge noclip to check spawns.
A lot of mods end up making items "too common", but conversely if a mod item is rare a lot of people will complain or insist the item doesnt spawn.
- using shitty phone thats hard to type with rn, ergo the atrocious spelling.
fuck item rarity feedback btw. people are the worst at telling you what's dropping and what's not
But some containers are far more common in the world than other ones, so, probability wise, that number alone won't really determine how often an item spawns. ie "art and not a science"
No luck on that one
Until you know the PZ code better, your idea is going to be very tough unless you can find a mod that does something very similar
Absolutely
But also some people want the orthodox hardcore experience, but others just want to play with the cool new mod toys?
When container loot is spawned a random number is generated, the maximum value of which is determined by the loot scarcity settings for it's category
Am I understanding this part correctly that for example a food item having the value of 1 wouldn't exactly be equal to a firearm having the value of 1?
It would depend on the loot scarcity settings, in the sandbox settings, but pretty much yes.
Art and not sciencd & extensive testing
Also, the zombies present in the area also affects this, the more zombies the less rare things are. Which sorta screws up making itens super rare.
Hi guys! does somebody knows how to remove traits from appearing in the character creation menu but not removing them from the game?
That's actually an awesome idea ๐ค if the trait is a profession trait, it has to be attached to a profession? or it can be free? because I need it to be free, exist in the game but not attached to anything
it doesn't have to be attached to a profession. you can have it set up so if you do something in game, you'll get it. but it won't show up in the character creation menu
That's awesome, I will try it! and if it works, kudos to you! ๐
hey, jd-gui suddenly won't open zomboid .class files. My only guess right now is a recent windows update, but i'm still on java version 1.8.0_271. Any ideas?
does anyone know how to use the riot shield in the swat/riot pack?
i have it equipped as a secondary... is that right?
appologize for being a small brain but could anyone explain to me how the immunity mod works? Instead of the vanilla, uh oh you got a scratch, time to wait 4 days for you to die anyway, is this mod supposed to give you a chance to survive the infection?
depends on wich one you are talking about
there is one that makes it so you no longer get real infected and just get fake infected (which causes stress, panic, ect. It's a vanilla thing that happens at times)
there is a second one that pretty much does the same thing as that one but slightly different. it's as a trait.
there there is a third (and best one in my opinion since you still have a high chance of zombie-fying) the antibodies. every 10 minutes once you've been bitten it increases a stat called "antibodies' based on your moodles. if antibodies ever > infection rate, then you'll live. if not, you'll become a zombie.
what's also nice about the antibody one is let's say you get scratched while healing, your infection rate can spike and overtake the antibodies, leading to your zombi-ing or if your conditions worsen enough so infection rate > antibodies again, it'll start to climb
gotcha, so if i ever get scratched or bitten for the last mod, barricading myself with medical supplies and food would be the safest and most reliable way for the antibodies to overtake the infection rate
correct
you just need to make sure you have enough food and supplies to last 2-4 days recovery
traits also affect the last mod. So picking stuff like thin skin or prone to illness will reduce your chance to recover with antibodies, but thick skin and resilient will increase the chance.
Off the current topic: fuck I thought I fixed a bug with Literacy but it still happens. gdi
@undone heron did you ever figure out how to modify player movement speed?
not atm
stuff like sprintMod(), changeMovementSpeed() and others don't seem to do anything when changed
which is sad since I really wanna do speed traits
Hmm, that is unfortunate and annoying, oh well
Perhaps try this:
player:setVariable("WalkSpeed", speedValue)
Unfortunate
First version of mod is up
Thanks to everyone who took the time to answer my questions
@eager prairie how do i attach trailer to my car?
press V at the back of the car
Not who you asked, but with a rope in your main inventory, press V to access the radial menu while standing behind the vehicle and in front of the trailer.
They need to be about one tile apart but a little closer or a little further will work.
In making a car mod, if we want to retexture the wheels, do you need to make a model of the wheels as well? I can not seem to find the vanilla wheel models.
hey guys any modder maybe willing to take a mod request?
I'm an open-minded novice. What did you have in mind?
i wonder if it would be possible to make a craftable garage door
Not I. But I see no reason why a knowledgeable individual could not
Dear developers of mods with weapons. I love your mods, but I PLEASE! Create a separate tab for weapons to avoid occupying the main tab.
it is created in the recipe script file !!!! For example:
recipe Use Standard Mag w/XM8LMG
{
XXXXX,
XXXX/XXXX,
Category:Weapons,
Result:Needle,
Time:40,
}
Stop cluttering the first tab in the recipe menu!
!!!!!!!!!!!!!!!!!!!!!!Category:Weapons,!!!!!!!!!!!!!!!!!!!!!!!!!
This way you can create any category / tab for your recipes.
I raised the problem not the first day ๐ฅณ
okay so i just got this game, got a map and hair mod, and now the menu wont load. all i get to look at is the image of the guy hugging the girl
do mods just take a while to load, or did i bug the game?
depending on the size of it it'll probably take at most 2-3 minutes atleast in my experience
More helpful would be the log file, it might give you a hint as to what it's held up on.
log file?
C:\Users...\Zomboid\Logs
The most recent generated log is in there.
Previous logs are in folders
You could either look through it yourself or give it to me to poke through. Not as good as an expert but the warning signs are usually pretty obvious
Ctrl+F : STACK TRACE will send you to any obvious red flags
i fixed it somehow
idk what happened but i turned the mods off and on and it worked
That honestly would be the motto of this chat channel.
@slender lance disable all mods
Open:
C:\Users\YOU\Zomboid\mods
file default.txt
need delete
and open game
my english greeteain britain :D
@slender lance But from now on, be careful. There are mods for the 40th version of the game. And there is for your 41st

tyvm!
Can you sleep inside?
Is there a mod that puts back my fav Item in the inventory I got it from? Like the Screwdriver, I want it back in my fannypack when I performed an action with it.
SwapIt might work for you
not realy but thx
oh misunderstood
Does somebody knows how to get the boredom and unhappyness level of the player?
I'm trying this:
player:getBodyDamage():getBoredomLevel()
player:getBodyDamage():getUnhappynessLevel()
But for some reason I'm not getting it ๐ค
player:getStats():getBoredom()
Are you getting the player? I use this and it works
I'm trying again, I never activated the mod when I was testing ๐คฆโโ๏ธ
But yeah I'm pretty sure that's the code, I'm seeing the Java code and they use it as this:
"this.Parent.getBodyDamage().getUnhappynessLevel()"
I'm pretty sure that it is from body damage and not from stats, stats is for stress if I don't miss understand
I mean you can use stats to get boredem level
But you can't manipulate it through stats
Actually, I just need to get the current boredom and unhappyness level, not increase or decrease it, just get it to compare
stats would get the number value, if you want levels like moodles you have to grab the moodles of the player
In the to get the number in values yes, so I should use getStats for that?
I basically need to compare what number of boredom and unhappines the player has and based on that, do things
yes, getStats() grabs the stat object tied to the player
@class Stats : zombie.characters.Stats
@field public Anger float
@field public boredom float
@field public endurance float
@field public enduranceRecharging boolean
@field public endurancelast float
@field public endurancedanger float
@field public endurancewarn float
@field public fatigue float
@field public fitness float
@field public hunger float
@field public idleboredom float
@field public morale float
@field public stress float
@field public Fear float
@field public Panic float
@field public Sanity float
@field public Sickness float
@field public Boredom float
@field public Pain float
@field public Drunkenness float
@field public NumVisibleZombies int
@field public LastNumVisibleZombies int
@field public Tripping boolean
@field public TrippingRotAngle float
@field public thirst float
@field public NumChasingZombies int
@field public LastVeryCloseZombies int
@field public NumCloseZombies int
@field public LastNumChasingZombies int
@field public stressFromCigarettes float
@field public ChasingZombiesDanger float
There are so many classes that sometimes the confusion is so big ๐
I will try with that one!!
there's a get and set for each of those fields, for the most part
I assume getMorale is for happines? ๐ค
could be, some things were named a long time ago
I will try with that, thank you a lot again ๐ always helping
np
Oooh,
So, something like this should work
local currentBoredom = player:getStats():getBoredom();
local currentUnhappiness = player:getBodyDamage():getUnhappynessLevel();
Yeah
Don't ask me why unhappiness is separated.
Tho it feels like getStats was an older system they used like in build 11 or so. They then switched to the body damage system and then added unhappiness
Ooh, but they added unhappines in the bodydamage but not boredom ๐ค I will try with getStats and getBodyDamage
I don't have any issues with getting boredom from BodyDamage:
local bodyDamage = player:getBodyDamage()
print("Boredom: " .. bodyDamage:getBoredomLevel())
Probably the error is in the if then ๐ค (I don't have the game in this moment so I'm developing without testing (bad idea))
local currentBoredom = player:getStats():getBoredom();
if currentBoredom > 75 then
I don't remeber when but I saw with one of the moods that it was multiplied by 100, boredom and unhappines is the same?
If you know it great, if not I will test it in the night
It's unhappiness if I remember right. The game uses decimals between 0 and 1 for some stats and then a regular 0 to 100 scale for other
So unhappiness will return 0.75 instead of 75
Maaaaakes fucking sense now why I'm not entering in the if ๐คฆโโ๏ธ
Always a good idea to get stats and print them to see how they are set up
Yeah, I usually do, but I'm not testing right now, I just have the IDE's to code but not the game and I'm using someone else to test for me ๐
I will try as soon as I arrive to my house, thank you a lot again Void ๐
As this point if you want to be mentioned in the credits of the mod, you'll be ๐
Cause if you tried say..
if x > 75 then
When it's a stat that uses a decimal scale, then the if statement won't ever trigger
Yeah, once I get the value I have to multiply it by 100 or use a if with > 0.75
If you ever feel stupid, please remember that I was using " " when calling my function in the event ๐ ๐ ๐
it's okay. At times I forget I'm writing stuff in lua and try stuff like +=
or else if instead of elseif
Everything is working now, I used getBodyDamage for both of them! thank you everyone who answered!
Some real bullshit for the masochists out there:
https://steamcommunity.com/sharedfiles/filedetails/?id=2462558471
Is there any event that is called when a profession or trait is added/removed in the character creation screen? ๐ค
I tried OnCreateLivingCharacter but it didn't seems to work
Or other question, is there any way to make a trait unpickable for certain profession?
give the profession a trait and make said trait incompatible with other traits
so when someone picks said profession, the other traits are locked out with the dummy trait
I tried to do it, but I give the trait to the profession, and that trait is still there to be picked twice ๐ค
make sure to mark the dummy trait as profession only
like i said, make trait A, then trait B. make sure trait A is marked profession only (so it doesn't show up on the trait list). give it to the profession you don't want having profession B. Make sure to mark A and B as exclusive. Now when they pick the profession, they get trait A and trait B vanishes
It worked the first time I picked Burglar ๐ If I keep going from Burglar to other Profession the trait keeps duplicating haha
I need to do this with Dextrous and not a new trait, should I create a fake Dextrous2 for example? and give it to the profession? if that's the case, it stills has the same effect? as it is a new trait
it's a dummy trait, so it won't do anything
say I don't want burglar to get dexterous. I would then make Dexterous2, and give that to the burglar. I would then make dexterous and dexterous2 mutually exclusive. Now people who pick the burglar can't get dexterous.
dexterous2 will have no effect unless you give it an effect. So if you dont want it to do anything, just make up something like "knows how to steal stuff well"
I need the opposite, I need to get Burglar with Dextrous
So I have this:
DTBaseGameCharacterDetails.DoProfessions = function()
local burglar = ProfessionFactory.getProfession("burglar");
burglar:addFreeTrait("FastReader");
burglar:addFreeTrait("Dextrous");
TraitFactory.setMutualExclusive("FastReader","FastReader");
TraitFactory.setMutualExclusive("Dextrous","Dextrous");
end
This works once, if I pick Burglar, then the game gives FastReader and Dextrous and removes those traits from being picked, but if I change to Unemployed for example, then there are two Fast Reader and two Burglar to be picked, that's the strange part, it is being duplicated for some reason
okay then you do exactly what I said before
but then OnCreateLivingCharacter you check to see if they have your dummy trait, and if they do, remove it for the real traits
so
local function makeTraits()
TraitFactory.addTrait("DummyBurglar", getText("UI_trait_DummyBurglar"), 0, getText("UI_trait_DummyBurglardesc"), true);
TraitFactory.setMutualExclusive("DummyBurglar", "FastReader");
TraitFactory.setMutualExclusive("DummyBurglar", "Dextrous");
DTBaseGameCharacterDetails.DoProfessions = function()
local burglar = ProfessionFactory.getProfession("burglar");
burglar:addFreeTrait("DummyBurglar");
end
Events.OnGameBoot.Add(makeTraits);
then
local function switchTraits ()
local player = getPlayer();
if player:HasTrait("DummyBurglar") then
player:getTraits():remove("DummyBurglar");
player:getTraits():add("FastReader");
player:getTraits():add("Dextrous");
end
Events.OnCreatePlayer.Add(switchTraits)
Well, it works! you're a damn genius ๐
I'm going to use this, Blair. I'm going to hate myself, but I'm going to use this.
We're slowly approaching my Skyrim modlist that had be frequently question why I do this to myself.
Say, is it possible to export a character you made in solo and apply it into Superb Survivors? I wanna have with my guy a specific follower which I made earlier as a Singleplayer char
@undone heron I can provide Brazilian Portuguese translation for the literacy mod if you want
Hmm.. I've put on my boots and am waste deep in figuring this all out, I know you can override lua functions as I am doing that (don't worry, making sure to keep it compatible and call the old function too) but I am looking for a way to add properties to the professions, I assume it is impossible to override java functions such as ProfessionFactory.addProfession? Then to go about this I'd be better off making my own list of professions with said data?
I assume it is impossible to override java functions...
That is correct, it is not possible to override Java functions with Lua modding
Man... I am so used to classes and such that Lua not having any with it's objects hurts my brain
You can always write your mods in Java
My complement to Worse Searching... ...Even Worse Looting which features locked containers that require keys/crowbars/bolt cutters to open.
that would be cool/nice/neat of you
crowbars rise even farther as "best long blunt"
PM me the file and I'll take a look
High tier containers will require bolt cutters as crowbars won't work with them....
that's fair but even low tier containers still raises it up on the list of 'best long blunt'
people will still generally use spiked baseball bats since with high carpentry and maintenance you can repair them easily and get a longer life spam with more damage, but I prefer weapons that also dual as utility items. more uses = better.
So I'm.. trying to make a base object to work from so I can make a simple list.. but I am clearly doing it wrong
function ProfExcl:new(prf)
prf = prf or {}
setmetatable(prf, self)
self.__index = self
return prf
end
ProfWithExclusiveList = {};```
that's the set up, trying to have ProfExcl as what I am making a bunch of
the list they are held in is ProfWithExclusiveList
tubesubjectProf.profName = "tubesubjectNAME"
table.insert(tubesubjectProf.exclusiveTraits, 1, "Labgrown2")
table.insert(ProfWithExclusiveList, 1, tubesubjectProf)```
I call that in a (failed) attempt to add a new entry to the list
print(ProfWithExclusiveList[0].exclusiveTraits[0])
and then that always results in errors
wait... lua arrays start at 1
fuck I'm an idiot
yeah lua isnt zero indexed
learning LUA is a fucking adventure, I have to unlearn practically all I know
fun fact
lua was developed on top of a language that was designed for people who didnt know how to code
Some lockers are locked, some aren't.
will zombies spawn on cells you haven't visited?
sorry blair
even virtual ones?
You sure it wasn't developed by people who didn't know how to code themselves? lol
I complain but it isn't terrible. I just need more practice is all
No, you were onto to something there, it is terrible
I guess it's good for a script language, but it can't compare to OOP
it was developed on a language for petroleum engineers
back in the day when engineers in general were expected to be a little more rounded
It's like they took python, which I am not a fan of, and threw C/Java or so elements at it until it looked like something
As in, their brains rounded, or their skillset?
I am not a big fan of python either
skillset
companies back in the day wanted (and still want) to hire people who know a bunch of shit so they dont have to hire people
Thats for fucking sure lol
lua is a great language for people who just need to be taught quickly
aaaaand thats about the extent of nice things i can say about lua
i dont hate it but i dont love it either
Ahaha, yeah I agree wholeheartedly with that
How do I get a cell from a specific X/Y coordinate?
what's worse (from what I read about it) Zomboid lua is outdated lua as well, since the lua it uses to interface with java with kulua
kahlua has not been updated in ages and LWJGL was updated for 41 i think
Lol I've spent all day on this and am ready to throw in the towel for now. I need to scrap it and approach it different. I'm close but not quite there
There's a global getSquare() that takes coords or you can call getSquare() from an isoObject
With the object you don't need coords
Also squares don't exist if the cell their in aren't loaded
Also, they don't exist above Z 0 unless created via furniture or something else
There is a getOrCreateSquare() that also takes coords
@sour island Thanks for the tips. I was playing around with the Virtual Zombie Manager and discovered some of these things.
No worries, I've been dealing with them for a bit with expanded heli mod
I have a few functions written I think could be useful for others but I'm not sure where I'd even post them
Are there any tutorials for making a model for something in game that someone could point me to? I'm watching the one by Blackbeard and debating if I want to dive into making an item.
As the Zerg Overmind used to say: Perfect
At this point, all I have remaining is:
- cleaning up the key spawning
- and implementing using keys/combinations to open locks
And it's done.
Randos who drop into my server are going to hate this shit so much ๐
SwatPack updated dudes, make sure to download the OG mod, i deleted my redux, but the content still carries on
i had a police bag from the swat mod on the ground, closed the game to go do stuff, came back and restarted the game, and my police bag full of stuff was gone. 
Do any of the faster read mods work with iwbums?
Really dislike the amount of time it takes to read, even with the fast reading perk
yeah a few of them
Have tried all of the ones on the workshop and none seem to work
With this mod some of the containers in the world will be locked. Keys will sometimes spawn for these containers, if you can find them, and, if you have a strength of 5 or greater, you can use a Crowbar, or in some cases Bolt Cutters, to open the container.
Should that be if you can't find them?
"keys will sometimes spawn for these containers if you can find them"
"Keys will sometimes spawn for these containers" "if you can't find them, and, if you have a strength of 5 or greater, you can use a Crowbar, or in some cases Bolt Cutters, to open the container"
because of the comma between containers. The base is "Keys will sometimes spawn for these containers, you can use a crowbar, or in some cases bolt cutters to open the container.". it can at least loose two commas and be less confusing.
Nice! Eblestock Operator pack?
I'm thinking of releasing it as Brita's armor pack!
Thanks)
Hi Hi, Anyone know how Lua send data to Java.
Example: When I click the button Tune-in on Walkie-Talkie. How the frequency is send to the java main file.
@main lion both are so awesome! :) when do you plan to release them?
although orgm is getting a bit annoying (i wish in the fine tuning mod you can set weapons and firearms to different spawn rates), ill always find hydrocraft to be the best mod for any playthrough
just the long term survivability of it all, making more gas eventually out of bio diesel, hell even making a solar farm that works as an infinite fuel generator
is there any reason why better sorting would affect drop rate of an item?
Without better sorting
With better sorting
Fresh save both times 100 kills
(tho being honest, I like the 1 in 10 drop rate over the 2 in 10 drop rate)
nvm
RNG is just being a bitch
did two more tests. got 35 books on one and 20 on another
Maybe next week?
alrighty. i'm hyped for it! :)
Nice! Awesome Helmet as well!
@main lion Awesome stuff!
Cant wait to play with your mod ๐
oh yeah
@craggy furnace Any progress on the heli mod, I really want to see the survivor one.
Still going strong
nice
@main lion that gear looks rad
@main lion Very cool