Required module.py files to edit:
if you dont have that you can use it as a constant in the module_constants and the player troop slot, just enter in module_constants the line:
and in the mission_templates Intense weather code block just change the
to
To turn on (value=1, to turn off use 0) enter anywhere you want in any shape(button, dropbox, script, menu) the line
Search and add the weather code block in those entries (marked in orange text) in the mission_templates
a) "lead_charge"
Later in that entry you will see this block and put the code in there:
b) "besiege_inner_battle_castle"
later in that entry you will see this block and put the code in there:
c) "besiege_inner_battle_town_center"
later in that entry you will see this block and put the code in there:
d) "castle_attack_walls_defenders_sally"
later in that entry you will see this block and put the code in there:
And if you want ofc put it anywhere else you desire.
Alternatively instead of the:
The Intense Weather code block:
- module_scripts
- module_constants (optional to use instead of the module_scripts)
- mission_templates
- (and for the toggle option, anywhere you want, i use it in the module_game_menus)
"$intense_weather"
in the "lco_initialize_presentation" script block as: (assign, "$intense_weather", 1),
if you dont have that you can use it as a constant in the module_constants and the player troop slot, just enter in module_constants the line:
Python:
intense_weather_check = 1 ##0= turn off, 1= turn on
Python:
(eq, "$intense_weather", 1),
Python:
(troop_get_slot, ":intense_weather_check", "trp_player", intense_weather_check),
(eq, ":intense_weather_check", 1),
To turn on (value=1, to turn off use 0) enter anywhere you want in any shape(button, dropbox, script, menu) the line
(assign,"$intense_weather", 1),
or if you use the constant use the line (troop_set_slot, "trp_player", intense_weather_check, 1),
. (I use the toggle on(value=1) or off(value=0) as menu option in the camp actions menu).Search and add the weather code block in those entries (marked in orange text) in the mission_templates
a) "lead_charge"
Later in that entry you will see this block and put the code in there:
Python:
(ti_before_mission_start, 0, 0, [],
[
[COLOR=rgb(184, 49, 47)]##Put he Intense Weather code block here##[/COLOR]
(team_set_relation, 0, 2, 1),
(team_set_relation, 1, 3, 1),
(call_script, "script_place_player_banner_near_inventory_bms"),
(party_clear, "p_routed_enemies"),
(assign, "$g_latest_order_1", 1),
(assign, "$g_latest_order_2", 1),
(assign, "$g_latest_order_3", 1),
(assign, "$g_latest_order_4", 1),
]),
b) "besiege_inner_battle_castle"
later in that entry you will see this block and put the code in there:
Python:
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")[COLOR=rgb(85, 57, 130)], [COLOR=rgb(184, 49, 47)]##Put he Intense Weather code block here##[/COLOR]]),[/COLOR]
c) "besiege_inner_battle_town_center"
later in that entry you will see this block and put the code in there:
Python:
(ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")[COLOR=rgb(85, 57, 130)], [COLOR=rgb(184, 49, 47)]##Put he Intense Weather code block here##[/COLOR]]),[/COLOR]
d) "castle_attack_walls_defenders_sally"
later in that entry you will see this block and put the code in there:
Python:
(ti_before_mission_start, 0, 0, [],
[
[COLOR=rgb(184, 49, 47)]##Put he Intense Weather code block here##[/COLOR]
(team_set_relation, 0, 2, 1),
(team_set_relation, 1, 3, 1),
(call_script, "script_change_banners_and_chest"),
(call_script, "script_remove_siege_objects"),
]),
And if you want ofc put it anywhere else you desire.
Alternatively instead of the:
##Put he Intense Weather code block here##
you can add the code block below to a single new script and just call him in each entry mentioned above^ instead of copying the whole code block to the entries, for example: (call_script, "script_check_intense_weather"), that have the code block in it.The Intense Weather code block:
Python:
(party_get_current_terrain, ":cur_terrain", "p_main_party"),
(try_begin),
(eq, "$intense_weather", 1),
(eq, ":cur_terrain", rt_desert),
(store_random_in_range, ":rain_power_yes", 0, 100),
(le, ":rain_power_yes", 20),
(store_random_in_range, ":rain_power", 25, 100),
(set_rain, 1, ":rain_power"),
(store_random_in_range, ":haze", 25, 100),
(set_global_haze_amount, ":haze"),
(store_random_in_range, ":cloud", 25, 100),
(set_global_cloud_amount, ":cloud"),
(gt, ":rain_power_yes", 21),
(store_random_in_range, ":haze", 25, 100),
(set_global_haze_amount, ":haze"),
(store_random_in_range, ":cloud", 25, 100),
(set_global_cloud_amount, ":cloud"),
(set_rain, 0, 0),
(store_random_in_range, ":fog_distance_yes", 0, 100),
(le, ":fog_distance_yes", 50),
(store_random_in_range, ":fog_distance", 25, 100),
(set_fog_distance, ":fog_distance", 0x0000FF),
(gt, ":fog_distance_yes", 51),
(set_fog_distance, 100),
(else_try),
(eq, "$intense_weather", 1),
(eq, ":cur_terrain", rt_snow),
(store_random_in_range, ":rain_power_yes", 0, 100),
(le, ":rain_power_yes", 50),
(store_random_in_range, ":rain_power", 25, 100),
(set_rain, 2, ":rain_power"),
(store_random_in_range, ":haze", 25, 100),
(set_global_haze_amount, ":haze"),
(store_random_in_range, ":cloud", 25, 100),
(set_global_cloud_amount, ":cloud"),
(gt, ":rain_power_yes", 51),
(store_random_in_range, ":haze", 25, 100),
(set_global_haze_amount, ":haze"),
(store_random_in_range, ":cloud", 25, 100),
(set_global_cloud_amount, ":cloud"),
(set_rain, 0, 0),
(store_random_in_range, ":fog_distance_yes", 0, 100),
(le, ":fog_distance_yes", 50),
(store_random_in_range, ":fog_distance", 25, 100),
(set_fog_distance, ":fog_distance", 0x0000FF),
(gt, ":fog_distance_yes", 51),
(set_fog_distance, 100),
(else_try),
(eq, "intense_weather", 1),
(store_random_in_range, ":rain_power_yes", 0, 100),
(le, ":rain_power_yes", 50),
(store_random_in_range, ":rain_power", 25, 100),
(set_rain, 1, ":rain_power"),
(store_random_in_range, ":haze", 25, 100),
(set_global_haze_amount, ":haze"),
(store_random_in_range, ":cloud", 25, 100),
(set_global_cloud_amount, ":cloud"),
(gt, ":rain_power_yes", 51),
(store_random_in_range, ":haze", 25, 100),
(set_global_haze_amount, ":haze"),
(store_random_in_range, ":cloud", 25, 100),
(set_global_cloud_amount, ":cloud"),
(set_rain, 0, 0),
(store_random_in_range, ":fog_distance_yes", 0, 100),
(le, ":fog_distance_yes", 50),
(store_random_in_range, ":fog_distance", 25, 100),
(set_fog_distance, ":fog_distance", 0x0000FF),
(gt, ":fog_distance_yes", 51),
(set_fog_distance, 100),
(try_end),
Last edited by a moderator: