Create an account


Upload: 24 Nov 2022, 03:28
Created by: star
Uploaded by: Aqxaro

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)
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.

The minimum comment length is 10 characters.