﻿
## Mods compatibility
on_game_start = {
    on_actions = {
        on_wm_start
    }
}

on_wm_start = {
    effect = {
        set_global_variable = {
			name = wm_is_loaded
			value = yes
		}
		# Just to avoid error logs:
		if = {
			limit = {
				exists = global_var:wm_is_loaded
			}
		}
    }
}

#### War Maps UPDATES ####
# Using code from Silk Road mod: https://steamcommunity.com/workshop/filedetails/?id=2493459927
# on_game_start_after_lobby = {
# 	on_actions = {
# 		line_mapmodes_initialize
# 	}
# }


# #Keeping different initializations to avoid the same exact date for all checks
# line_mapmodes_initialize = {
# 	on_actions = {
# 		line_mapmodes_semimonthly
# 		line_mapmodes_monthly
# 	}
# }

# ### Initializing mapmodes
# line_mapmodes_semimonthly = {
# 	on_actions = {
# 		delay = {days = 15}
# 		line_mapmodes_semimonthly
# 		line_mapmodes_map_semimonthly_update
# 	}
# }

# line_mapmodes_monthly = {
# 	on_actions = {
# 		delay = { months = 1 }
# 		line_mapmodes_monthly
# 		line_mapmodes_map_monthly_update
# 	}
# }

# ### Setting mapmodes_map variables
# line_mapmodes_map_semimonthly_update = {
# 	effect = {
# 		if = {
# 			limit = { 
# 				exists = global_var:custom_map_mode
# 				global_var:custom_map_mode = flag:line_warring_map 
# 			}
# 			line_mapping_warring_map = yes
# 		}
# 		else_if = {
# 			limit = { 
# 				exists = global_var:custom_map_mode
# 				global_var:custom_map_mode = flag:line_raiding_map 
# 			}
# 			line_mapping_raiding_map = yes
# 		}
# 	}
# }

# line_mapmodes_map_monthly_update = {
# 	effect = {
# 		if = {
# 			limit = { 
# 				exists = global_var:custom_map_mode
# 				global_var:custom_map_mode = flag:line_weather_map 
# 			}
# 			line_mapping_weather_map = yes
# 		}
# 	}
# }
#### War Maps ENDS ####

