Divergent/mods/Screen Space Shaders/gamedata/scripts/ssfx_interactive_grass.script

78 lines
3.4 KiB
Plaintext
Raw Normal View History

2024-03-17 20:18:03 -04:00
-- @ Version: SCREEN SPACE SHADERS - UPDATE 16
-- @ Description: Interactive grass script
-- @ Author: https://www.moddb.com/members/ascii1457
-- @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders
local ssfx_inter_grass_player = 0
local ssfx_inter_grass_max_entities = 0
local ssfx_inter_grass_maxdistance = 0
local ssfx_inter_grass_radius = 0
local ssfx_inter_grass_x_str = 0
local ssfx_inter_grass_y_str = 0
local ssfx_inter_explosions_str = 0
local ssfx_inter_explosions_speed = 0
local ssfx_inter_shooting_str = 0
local ssfx_inter_shooting_range = 0
local ssfx_inter_mutants = 0
local ssfx_inter_anomalies = 0
local function apply_interactive_grass_settings()
get_console():execute("ssfx_grass_interactive (" .. (ssfx_inter_grass_player and 1 or 0) .. "," .. ssfx_inter_grass_max_entities .. "," .. ssfx_inter_grass_maxdistance .. "," .. (ssfx_inter_mutants and 1 or 0) .. ")")
get_console():execute("ssfx_int_grass_params_1 (" .. ssfx_inter_grass_radius .. "," .. ssfx_inter_grass_x_str .. "," .. ssfx_inter_grass_y_str .. "," .. ssfx_inter_anomalies .. ")")
get_console():execute("ssfx_int_grass_params_2 (" .. ssfx_inter_explosions_str .. "," .. ssfx_inter_explosions_speed .. "," .. ssfx_inter_shooting_str .."," .. ssfx_inter_shooting_range .. ")")
end
local function update_settings()
-- Get settings
ssfx_inter_grass_player = ssfx_001_mcm.ssfx_get_setting("inter_grass", "enable_player", ssfx_interactive_grass_settings)
ssfx_inter_grass_max_entities = ssfx_001_mcm.ssfx_get_setting("inter_grass", "max_entities", ssfx_interactive_grass_settings)
ssfx_inter_grass_maxdistance = ssfx_001_mcm.ssfx_get_setting("inter_grass", "max_distance", ssfx_interactive_grass_settings)
ssfx_inter_grass_radius = ssfx_001_mcm.ssfx_get_setting("inter_grass", "radius", ssfx_interactive_grass_settings)
ssfx_inter_grass_x_str = ssfx_001_mcm.ssfx_get_setting("inter_grass", "horizontal_str", ssfx_interactive_grass_settings)
ssfx_inter_grass_y_str = ssfx_001_mcm.ssfx_get_setting("inter_grass", "vertical_str", ssfx_interactive_grass_settings)
ssfx_inter_explosions_str = ssfx_001_mcm.ssfx_get_setting("inter_grass", "explosions_str", ssfx_interactive_grass_settings)
ssfx_inter_explosions_speed = ssfx_001_mcm.ssfx_get_setting("inter_grass", "explosions_speed", ssfx_interactive_grass_settings)
ssfx_inter_shooting_str = ssfx_001_mcm.ssfx_get_setting("inter_grass", "shooting_str", ssfx_interactive_grass_settings)
ssfx_inter_shooting_range = ssfx_001_mcm.ssfx_get_setting("inter_grass", "shooting_range", ssfx_interactive_grass_settings)
ssfx_inter_mutants = ssfx_001_mcm.ssfx_get_setting("inter_grass", "enable_mutants", ssfx_interactive_grass_settings)
ssfx_inter_anomalies = ssfx_001_mcm.ssfx_get_setting("inter_grass", "anomalies_distance", ssfx_interactive_grass_settings)
-- Enable/Disable All Effects
local effect_enabled = ssfx_001_mcm.ssfx_get_setting("inter_grass", "enable", ssfx_interactive_grass_settings)
if (not effect_enabled) then
ssfx_inter_grass_max_entities = 0
ssfx_inter_grass_player = 0
end
-- Enable/Disable Anomalies
local anomalies_enabled = ssfx_001_mcm.ssfx_get_setting("inter_grass", "enable_anomalies", ssfx_interactive_grass_settings)
if (not anomalies_enabled) then
ssfx_inter_anomalies = 0
end
-- Apply settings
apply_interactive_grass_settings()
end
function on_game_start()
-- General Functions
RegisterScriptCallback("on_option_change", update_settings)
-- Read and apply settigns
update_settings()
end