Project Zomboid

Project Zomboid

Gasmask filter and Respirator filter fix[B42] OBSOLETE
47 Comments
József  [author] 16 Jul @ 9:31am 
From what i can see the notank variant has no "UseDelta" field defined in its item definition file.You need to modify the appropiate Items_(category).txt file and add it.
666 16 Jul @ 6:36am 
hello, i'm trying to increase the oxygen tank duration. i changed the valor '' UseDelta '' from 0.0625 to 0.000001 but it only works in SCBA with tanks. in SBCA (notank), it bugged. maybe can you help me ??
József  [author] 30 Jan @ 10:48am 
Will do some testing, it seems that TIS fixed the issue therefore rendering this mod OBSOLETE
József  [author] 30 Jan @ 10:44am 
nevermind i see the error, seems like TIS removed or modified itemcount parameter
József  [author] 30 Jan @ 10:34am 
Post the error please
pikasonic 30 Jan @ 7:49am 
this mod have error in b42.2
Dafish 24 Jan @ 9:08am 
thank you for your respond
József  [author] 24 Jan @ 8:53am 
Could be that they secretly modified the recipecode, i haven't played in a while now
József  [author] 24 Jan @ 8:52am 
Most likely vanilla as the lua works the following way:
it gets the worn item ( in this case, a gasmask or respirator) checks the bound UseDelta field that got assigned to it when the filter was attached, then makes the filter's useDelta field the same
Dafish 23 Jan @ 11:00pm 
(vanilla question)
Dafish 23 Jan @ 10:59pm 
there's something weird about gas masks, for example, i remove the filter from a 100% condition gas mask then the gas mask's condition lowered to 20% (worn), is this a feature or am i missing something?
UnCheat 8 Jan @ 4:22am 
Great!
József  [author] 8 Jan @ 4:20am 
Updated the mod so the Engineer starts with the recipe learned
József  [author] 8 Jan @ 4:01am 
Yup, i checked it and the engineer occupation is the only one that gives the recipe as free so i'll update that too
József  [author] 8 Jan @ 3:58am 
Unsure, i would think that the Engineer professuin would give it but i've been playing as engineer for a while now and haven't been able to craft it without the magazine if i remember correctly but i'll take a look
UnCheat 8 Jan @ 3:51am 
I'm sure that there are some professions with known recharge filter recipe. Do they grab new recipe from magazine or it should be corrected too?
UnCheat 7 Jan @ 12:37pm 
So you'll get second recipe that would accept empty filter and won't mess with main recipe like this: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3402840205
UnCheat 7 Jan @ 12:34pm 
And use as your first try:

module Base
{
craftRecipe Recharge Filters Empty
{
UnCheat 7 Jan @ 12:31pm 
I think you can just add second recipe that won't overwrite then
Just call it "craftRecipe Recharge Filters Empty" :D
József  [author] 7 Jan @ 12:24pm 
So i had to remove the "module Base" line to stop the game from recognizing the recipe, i'll try and fix this tmrw but its getting late rn and i have school to attend to.Also if anyone could look at the recipe or write Lua that works(i've thought of modfying the OnTest functiom too however i decided against it due to the limited time ihave right now) i'd appreciate it if someobne could help out with overwriting a vanilla recipe cause the game loads the vanilla recipe and the recipe that is supposed to overwrite it :)
József  [author] 7 Jan @ 12:12pm 
probably used the wrong method to import the "Base." prefix
József  [author] 7 Jan @ 12:08pm 
thought the game would already overwrite it if i used the same id lol, guess not
UnCheat 7 Jan @ 12:06pm 
József  [author] 7 Jan @ 11:53am 
made a typo, had to get another update out so if it doesn't work then please redownload the mod
József  [author] 7 Jan @ 11:45am 
updated the mod to include your fix however i couldn't for the life of me have been able to get the game to modify the recipe through lua, i'll try again some other time though
József  [author] 7 Jan @ 11:10am 
i'll mess around with lua then, i'll try to get it out soon since i haven't messed with recipes before
UnCheat 7 Jan @ 11:04am 
And the right way to edit recipe will be via lua so it'll be compatible with any of mods:

We can access recipe by ScriptManager.instance:getRecipe("Base.RechargeFilters")
UnCheat 7 Jan @ 11:01am 
By the way what about not fully depeleted... those should be accepted too... and destroyed
József  [author] 7 Jan @ 10:54am 
so i've tested it without adding "mode:destroy" and it seems to work the same way, i'll upload it in a few mins
UnCheat 7 Jan @ 10:53am 
Basicaly you can overwrite by only one
craftRecipe RechargeFilters record (not the whole file)

I might check if we can tweak those by lua and let you know
UnCheat 7 Jan @ 10:52am 
The source file is here: media/scripts/recipes/recipes_gasmasks.txt
UnCheat 7 Jan @ 10:51am 
And again: we've to edit
craftRecipe RechargeFilters
and change first input to
item 1 tags[GasmaskFilter;RespiratorFilter] mode:destroy flags[NotFull] itemcount mappers[FilterMapper],
József  [author] 7 Jan @ 10:49am 
i'll test it and then overwrite the original recipe
UnCheat 7 Jan @ 10:48am 
yep that worked
UnCheat 7 Jan @ 10:47am 
Looks like we've to add more flags like
mode:destroy flags[NotFull] itemcount
but not items 0
so
craftRecipe RechargeFilters
...
item 1 tags[GasmaskFilter;RespiratorFilter] mode:destroy flags[NotFull] itemcount mappers[FilterMapper],
József  [author] 7 Jan @ 10:41am 
Alright now i might have misunderstood you, so if the problem is that the game does not let you use empty filters then you simply need to either add its tag or create a seperate recipe that uses empty filters.
József  [author] 7 Jan @ 10:40am 
So i just checked around the vanilla recipes, it seems to me that the game handles drainables as if they were mutliple items meshed into one.As i see it the filter has the max usage of 24 so i would need to set the item number to 24.
József  [author] 7 Jan @ 10:37am 
i can see what you mean, however do not set it to zero as its almost the same as removing the number infront of the item so either the game crashes or as you said it bugs out.I'll experiment around and see what i can do
UnCheat 7 Jan @ 10:35am 
I did try to set
item 0 tags[GasmaskFilter;RespiratorFilter] mappers[FilterMapper],
Now it can use empty filter but it still is bugged and does not consume it
József  [author] 7 Jan @ 10:26am 
nevermind i just checked and "improvised gasmask" has the tag "Gasmask" so it should work with that too
József  [author] 7 Jan @ 10:20am 
However i do gotta say that the recipes haven't been modified, this is a lua only mod so if its a recipe problem then most likely i won't touch it however i can most certainly try
József  [author] 7 Jan @ 10:18am 
i haven't touched the other filters yet (Improvised, recharged) but i'll have it out in a 10 minutes at max
UnCheat 7 Jan @ 10:15am 
Still recipe "Recharge filter" should be fixed to consume not 1 unit of filter but whole (Empty) one
QUE TIPO DE FILTRO LOS DE MASCARA DE GAS DE POLVO DE BRICOLAGE O LOS MODELOS DE 40 M NATO POLCIAL DE LA MASCARA DE GAS DE EL JUEGO QUE USA EL EJERCITO Y LA POLICIA DE EL JUEGO
UnCheat 7 Jan @ 9:51am 
Perfect!