Project Zomboid

Project Zomboid

More Loot Settings v1.3.6 [41.78]
Compatibility with sorting and weapon mods
Hey. Wanted to ask what would I need to check over the mod files to make it compatible with sorting mods and weapon mods like VFE.

I checked the files and saw some references to better sorting with its new categories. If instead of just one category we had a bunch of separate categories (like Better Sorting actually has now for clothing), would we just need to add those different categories to the references?

For example, this is how it currently looks:

if itemCategory and itemCategory == "VehicleMaintenance" or itemCategory == "Mechanics" -- category from better sorting

In case we had more than one mechanics category would it just be a case of doing it like this?

if itemCategory and itemCategory == "VehicleMaintenance" or itemCategory == "Mech" or itemCategory == "MechAcc" or itemCategory == "MechArm" or itemCategory == "MechBat" (etc.)

Would it be possible in case we have a bunch of categories, that all start the same, to do instead something like this?

if itemCategory and itemCategory == "VehicleMaintenance" or itemCategory contains("Mech")

Regarding weapon mods like VFE, if they have custom sorting, as long as we include those categories in the MLS code above it should be fine right?

Thanks!
< >
Showing 1-8 of 8 comments
Champy  [developer] 23 Sep, 2023 @ 5:39am 
Just seeing this now. I haven't checked on this mod in a while.

Best thing to do would be having a category table for each category like this :

mechanicCategories = { VehicleMaintenance = 1, Mech = 1, MechAcc = 1, MechArm = 1, MechBat = 1, }

And then checking like this :
if itemCategory and mechanicCategories[itemCategory] then (etc.)

Which requires going through all BetterSorting categories to set up all the tables.

I'm currently looking at everything that needs updating, I will update the mod in the coming days.
Jacques the Crab 24 Sep, 2023 @ 10:09am 
Thanks for the reply. Might check what you said with some categories I have.

Looking forward to the update.
Champy  [developer] 24 Sep, 2023 @ 10:50am 
I updated the mod, but I didn't find the categories you mentioned. Could you link the relevant mods that uses those item categories ?
Champy  [developer] 24 Sep, 2023 @ 11:22am 
All right man, I updated the mod again
Jacques the Crab 24 Sep, 2023 @ 12:01pm 
Oh nice! Many thanks for the attention.
Originally posted by Jacques the Crab:
Oh nice! Many thanks for the attention.
was this ever figured out? I'm not understanding the convo quite clearly but I'm trying to make it work with VFE with restricting loot from spawning in houses but it seems to not do anything involving vanilla firearms. it wont stop them from spawning in houses even though it gives the option to.
Hi, to be honest I can't quite remember how I eventually did it and I can't find the files anymore. VFE was updated somewhat recently right? Maybe they changed how it interacts with vanilla firearms? I wouldn't know right now because I've taken a break from PZ for a while but from what I remember, as long as the categories are included in this mod's code they should be affected.
< >
Showing 1-8 of 8 comments
Per page: 1530 50