SearchModeAPI

If you liked this item, please rate it up on Steam Workshop page.

Author: star

Last revision: 20 Aug, 2022 at 23:14 UTC

File size: 7.17 KB

On Steam Workshop

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