For the mod I am creating I spawn and create a fleet of ships from a new country that is created at the time. The country_type is custom with hostile = no as a modifier.
In the previous patch 1.0.3 it worked fine and the ships would spawn as neutral and go on their way. Now with the patch they spawn as hostile and are immediately attacked. There is no change in code for the mod between the old version and the patch. (except for version number in description file.)
Here are the relevant (I think ) bits of code and then the entire mod.
Steps for replication.
1. Open the civ_trader_test.sav
2. Settle a colony or use console 'own'
3. civtrade.1 event should pop and spawn the fleet at the homeworld.
4. If in patch 1.0.3 the fleet will be neutral
5. If in patch 1.1.0 beta the fleet will be hostile.
In the previous patch 1.0.3 it worked fine and the ships would spawn as neutral and go on their way. Now with the patch they spawn as hostile and are immediately attacked. There is no change in code for the mod between the old version and the patch. (except for version number in description file.)
Here are the relevant (I think ) bits of code and then the entire mod.
Steps for replication.
1. Open the civ_trader_test.sav
2. Settle a colony or use console 'own'
3. civtrade.1 event should pop and spawn the fleet at the homeworld.
4. If in patch 1.0.3 the fleet will be neutral
5. If in patch 1.1.0 beta the fleet will be hostile.
Code:
country_event = {
id = civtrade.1
title = "civtrade.1.name"
picture = GFX_evt_exploding_ship
show_sound = event_space_battle
desc = {
text = civtrade.1.desc
}
fire_only_once = yes
is_triggered_only = yes
trigger = {
is_country_type = default
NOT = {
has_policy_flag = restricted_trade
has_country_flag = birth_of_civtrade }
any_owned_planet = {
is_homeworld = no
}
custom_tooltip_fail = "civtrade.trigger.fail"
}
immediate = {
set_country_flag = birth_of_civtrade
owner_species = { save_event_target_as = owner_species }
capital_scope = {
save_event_target_as = spawnpoint
space_owner = { save_event_target_as = home_country }
}
if = {
limit = { has_technology = "tech_wormhole_generation_1" }
create_country = {
name = "Traders"
type = civtrader
species = event_target:owner_species
ignore_initial_colony_error = yes
}
solar_system = {
create_wormhole_station = {
owner = last_created_country
angle = random
}
set_star_flag = trader_wormhole
}
last_created_country = {
establish_communications_no_message = root
establish_contact = { who = root }
save_global_event_target_as = civilian_traders
set_country_flag = civtrader
add_opinion_modifier = { who = ROOT modifier = opinion_alliance }
}
last_created_country = {
create_leader = {
type = admiral
species = event_target:owner_species
name = random
skill = 100
}
create_fleet = { name = "Civilian Trade Fleet" }
last_created_fleet = {
set_owner = PREV
set_fleet_stance = evasive
random_list = {
50 = { create_ship_design = {
design = "C1"
ftl = ROOT
}
}
50 = { create_ship_design = {
design = "C2"
ftl = ROOT
}
}
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
assign_leader = last_created_leader
set_location = event_target:spawnpoint
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = civtrade.1.trigger.1
any_planet = {
OR = {
NOT = {
has_modifier = trade_network
}
has_edict = "trade_hub"
}
exists = controller
controller = { is_same_value = event_target:home_country }
}
}
found_system = {
move_to = THIS
}
}
find_random_planet = {
trigger = {
id = civtrade.1.trigger.2
OR = {
NOT = {
has_modifier = trade_network
}
has_edict = "trade_hub"
}
exists = controller
controller = { is_same_value = event_target:home_country }
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 3
random = 1
}
effect = {
id = civtrade.1.effect.1
planet_event = { id = civtrade.8 }
}
}
}
}
}
}
}
else = {
if = {
limit = {
OR = {
has_technology = "tech_warp_drive_1"
has_technology = "tech_hyper_drive_1"
}
}
create_country = {
name = "Traders"
type = civtrader
ignore_initial_colony_error = yes
species = event_target:owner_species
ethos = ROOT
}
last_created_country = {
establish_communications_no_message = root
establish_contact = { who = root }
save_global_event_target_as = civilian_traders
set_country_flag = civtrader
add_opinion_modifier = { who = ROOT modifier = opinion_alliance }
if = {
limit = {
ROOT = { has_technology = "tech_warp_drive_1" }
}
set_country_flag = warp_traders
else = {
if = {
limit = {
ROOT = { has_technology = "tech_hyper_drive_1" }
}
set_country_flag = hyper_traders
}
}
}
}
last_created_country = {
create_leader = {
type = admiral
species = event_target:owner_species
name = random
skill = 100
}
create_fleet = { name = "Civilian Trade Fleet" }
last_created_fleet = {
set_owner = PREV
set_fleet_stance = evasive
random_list = {
50 = { create_ship_design = {
design = "C1"
ftl = ROOT
}
}
50 = { create_ship_design = {
design = "C2"
ftl = ROOT
}
}
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = last_created_design
graphical_culture = "pirate_01"
}
assign_leader = last_created_leader
set_location = event_target:spawnpoint
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = civtrade.1.trigger.3
any_planet = {
OR = {
NOT = {
has_modifier = trade_network
}
has_edict = "trade_hub"
}
exists = controller
controller = { is_same_value = event_target:home_country }
}
}
found_system = {
move_to = THIS
}
}
find_random_planet = {
trigger = {
id = civtrade.1.trigger.4
OR = {
NOT = {
has_modifier = trade_network
}
has_edict = "trade_hub"
}
exists = controller
controller = { is_same_value = event_target:home_country }
}
found_planet = {
orbit_planet = THIS
effect = {
id = civtrade.1.effect.2
planet_event = { id = civtrade.8 }
}
wait = {
duration = 3
random = 1
}
}
}
}
}
}
}
}
}
}
}
option = {
name = civtrade.1.a
trigger = {
OR = {
has_government = theocratic_republic
has_government = transcendent_republic
has_government = theocratic_oligarchy
has_government = transcendent_oligarchy
has_government = divine_mandate
has_government = transcendent_empire
}
}
}
option = {
name = civtrade.1.b
trigger = {
OR = {
has_government = military_dictatorship
has_government = martial_empire
has_government = military_junta
has_government = ordered_stratocracy
has_government = military_republic
has_government = martial_demarchy
}
}
}
option = {
name = civtrade.1.c
trigger = {
OR = {
has_government = despotic_hegemony
has_government = ai_overlordship
has_government = science_directorate
has_government = illuminated_technocracy
has_government = direct_democracy
has_government = subconscious_consensus
}
}
}
option = {
name = civtrade.1.d
trigger = {
OR = {
has_government = moral_democracy
has_government = irenic_democracy
has_government = peaceful_bureaucracy
has_government = irenic_protectorate
has_government = enlightened_monarchy
has_government = irenic_monarchy
}
}
}
option = {
name = civtrade.1.e
trigger = {
OR = {
has_government = despotic_empire
has_government = star_empire
}
}
}
option = {
name = civtrade.1.f
trigger = {
OR = {
has_government = plutocratic_oligarchy
has_government = mega_corporation
}
}
}
option = {
name = civtrade.1.g
trigger = {
OR = {
has_government = indirect_democracy
has_government = democratic_utopia
}
}
}
}
Code:
civtrader = {
has_leaders = yes
relations = yes
ai = {
enabled = no
}
faction = {
hostile = no
auto_delete = no
needs_border_access = no
generate_borders = no
needs_colony = no
}
modules = {
standard_leader_module = {}
###standard_economy_module = {}
exclusive_diplomacy_module = {
can_receive = {
action_offer_trade_deal
action_cancel_trade_deal
}
can_send = {
action_offer_trade_deal
action_cancel_trade_deal
}
}
all_technology_module = {}
}
}
Attachments
Upvote
0