Project Zomboid

Project Zomboid

537 ratings
SearchModeAPI
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
7.233 KB
20 Aug, 2022 @ 2:10pm
20 Aug, 2022 @ 3:14pm
2 Change Notes ( view )

Subscribe to download
SearchModeAPI

Description
Framework for "search fog" mods compatibility, e.g. Read While Walking

How to use (for modders):
SearchModeAPI.Register("my_mod_name", 0.5) -- only once! the second parameter is your priority ............. -- low priority mods will be igonred SearchModeAPI.Lock("my_mod_name") -- you're the ruler, locks the fog for you .......... SearchModeAPI.Unlock("my_mod_name") -- you don't need fog anymore ................ -- your code must be marked: SeachModeAPI.Activate("my_mod_name") -- all stuff now is related to your mod local mode = getSearchMode():getSearchModeForPlayer(0) getSearchMode():setEnabled(0,true) mode:getBlur():setTargets(0.5, 0.5) mode:getDesat():setTargets(0.5, 0.5) mode:getRadius():setTargets(3, 3) mode:getDarkness():setTargets(0.1, 0.1) SeachModeAPI.Deactivate("my_mod_name") -- end of code from your mod

The priority is the number. You need high values if your mechanics is very specific, e.g. you enables it only on certain actions. And you need low values if your mechanics is common, e.g. you use the fog all the time. This concept allows to lock searchmode manager for some/all mods.

Some values of priority:
-100: default value for all unknown mods, also is applyed to vanilla search mode.
10: Read While Walking mod.

P.S. It was quite hard to make this mod.


Workshop ID: 2851764922
Mod ID: SearchModeAPI41
Popular Discussions View All (2)
0
1 Mar @ 10:44pm
Use This for Blindbolds, Masks, etc.
NerdgamerDave
0
20 Aug, 2022 @ 2:34pm
How it works
star
20 Comments
star  [author] 30 Mar @ 3:56am 
@Morgan, sure.
@Retrad_, you can make such a mod.
Morgan 28 Mar @ 5:57pm 
May I add this to my modpack?
Retrad_ 7 Feb @ 5:05pm 
i did not expect a user manual for it, wow!

say, how would you go about making a script that detects clothing and triggers the fog? say... sunglasses, yes, sunglasses
Camoblast 6 Oct, 2023 @ 12:58am 
it wasnt your mod that i was concerned about but i noticed my problem after moving the reading mod in the list is why i used your mod.but yea ill give it a whirl
Camoblast 6 Oct, 2023 @ 12:57am 
Ok cool.ill give that a whirl..i have not had these many problems using most mods really until i cam bak to PZ for a spin and had found MY SON lol who loves PZ had subbed to the Manager Mod because he hated the cursor lag with so many mods in the list normally,without Manager,,IMa fuck it off.and see what happens and put your mod above what ever mod request that when i sub to em..Is the reading mod the only mod this serves..I found it because walk while readin was buggin out...was working then not working..put your mod in and it works..
star  [author] 4 Oct, 2023 @ 9:49pm 
I don't use Load Manager, so I'm not sure. But I think it's better to load this mod first. This mod is just a framework and doesn't conflict. Conflicts between other mods may arise in theory if some mods use this API and others don't. Anyway, it's very specific, and you can treat these notices as warnings.
Camoblast 4 Oct, 2023 @ 8:55pm 
With just Load Manger and Load enhancer enabled and nothing else,when you go into the manage order you will notice Text on top of the Order window,,IT tells you 2 different things,i will try explain....
ok so just enable those 2 mods i said.go into your load order and read the Text above...IT will usually say (You Normally have to change load order to avoid conflicts and errors...NOW..when i attempt to put in any mod after those 2,and that mod would be Mod Options the Text above will change after i refresh and say (You DO have to change this to resolve certain conflicts and errors,as precedence is important in many cases yada yada yada).. I understand what it means but is it telling me this as a reminder or is this part of the functions for the load manger/Enhancer? I mean is it designed to switch between text when mods conflict?
star  [author] 1 Oct, 2023 @ 10:37pm 
@Camoblast, who tells you? "it"?
Camoblast 1 Oct, 2023 @ 10:49am 
So where do you put this in load order? Im using :
Mod Options
Mod manager
Mod Server
when i add SearchModeAPI it tells me i DO have to change order to avoid certain conflicts and errors.cant add anything past Mod :oad Enhancer without getting that message above the Load Panel...even if i leave SearchModeAPI out...any ideas..ive rusubbed to all my subs and even reinstalled PZ but still says same thing...
star  [author] 4 Mar, 2023 @ 2:14pm 
@LineTinzer, yes, you can.