recruit_chosen_army = {
	if = {
		limit = {
			[[MINERALS]
				resource_stockpile_compare = {
					resource = minerals
					value >= $MINERALS$
					mult = value:positive_modifier_mult|MODIFIER|armies_cost_mult|
				}
			]
			[[ENERGY]
				resource_stockpile_compare = {
					resource = energy
					value >= $ENERGY$
					mult = value:positive_modifier_mult|MODIFIER|armies_cost_mult|
				}
			]
			[[FOOD]
				resource_stockpile_compare = {
					resource = food
					value >= $FOOD$
					mult = value:positive_modifier_mult|MODIFIER|armies_cost_mult|
				}
			]
			[[ASTRAL_THREADS]
				resource_stockpile_compare = {
					resource = astral_threads
					value >= $ASTRAL_THREADS$
					mult = value:positive_modifier_mult|MODIFIER|armies_cost_mult|
				}
			]
		}
		if = {
			limit = {
				has_country_flag = auto_recruit_army_on_carrier_flag
			}
			prev = {
				create_army = {
					owner = root
					type = $army$
				}
			}
		}
		else_if = {
			limit = {
				prev = {
					any_fleet_in_orbit = {
						is_ship_class = shipclass_transport
					}
				}
			}
			prev = {
				random_fleet_in_orbit = {
					limit = {
						is_ship_class = shipclass_transport
					}
					create_army_transport = {
						army_type = $army$
					}
				}
			}
		}
		else = {
			create_fleet = {
				effect = {
					set_owner = root
	
					create_army_transport = {
						army_type = $army$
					}
	
					set_fleet_stance = passive
					set_location = prevprev
				}
			}	
		}
		[[MINERALS]
			add_resource = {
				minerals = $MINERALS$
				mult = value:negative_modifier_mult|MODIFIER|armies_cost_mult|
			}
		]
		[[ENERGY]
			add_resource = {
				energy = $ENERGY$
				mult = value:negative_modifier_mult|MODIFIER|armies_cost_mult|
			}
		]
		[[FOOD]
			add_resource = {
				food = $FOOD$
				mult = value:negative_modifier_mult|MODIFIER|armies_cost_mult|
			}
		]
		[[ASTRAL_THREADS]
			add_resource = {
				astral_threads = $ASTRAL_THREADS$
				mult = value:negative_modifier_mult|MODIFIER|armies_cost_mult|
			}
		]
	}
}