I have been working on this for some time and i believe i've fixed most of the bugs, but i have a major one left that i don't think i can fix myself. As far as i can tell that bug was in PDX original code so i have no idea what i should do about it.
Here the errors :
And here the part of the code that spawn it this:
Can't find any mistake there and i don't get any error from my code, even with the heavy changes i made.
Here the errors :
Code:
[eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
[18:04:25][eventtarget.cpp:934]: Undefined event target: pirate_target, location: file: events/pirate_events.txt line: 965
[18:04:25][eventtarget.cpp:934]: Undefined event target: pirate_target, location: file: events/pirate_events.txt line: 965
[18:04:25][eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
[18:04:25][eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
[18:04:25][eventtarget.cpp:934]: Undefined event target: pirate_target, location: file: events/pirate_events.txt line: 965
[18:04:25][eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
[18:04:25][eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
[18:04:25][eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
[18:04:25][eventtarget.cpp:934]: Undefined event target: pirate_target, location: file: events/pirate_events.txt line: 965
[18:04:25][eventtarget.cpp:934]: Undefined event target: capital_system, location: file: events/pirate_events.txt line: 953
over and over...
And here the part of the code that spawn it this:
Code:
# Building a new fleet (HIDDEN)
country_event = {
id = pirate.2
hide_window = yes
trigger = {
is_country_type = pirate
OR = {
num_fleets < 2
num_ships < 5
}
any_owned_ship = {
is_ship_size = pirate_station
}
}
mean_time_to_happen = {
#days = 180
days = 30
}
immediate = {
random_country = {
limit = {
has_relation_flag = { flag = pirate_relation who = ROOT }
}
save_event_target_as = pirate_target
capital_scope = {
solar_system = { save_event_target_as = capital_system }
}
owner_species = { save_event_target_as = owner_species }
}
# If we get to spawn a new fleet, we want a better admiral to run it
create_leader = {
type = admiral
species = owner_main_species
name = random
skill = 300
}
# What design we will use for our brand new fleet
if = {
limit = {
ROOT = { has_technology = "tech_mass_drivers_1" }
}
create_ship_design = {
design = "Reaver"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = { has_technology = "tech_lasers_1" }
}
create_ship_design = {
design = "Hunter"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = { has_technology = "tech_missiles_1" }
}
create_ship_design = {
design = "Vagabond"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = { has_technology = "tech_lasers_1" }
}
create_ship_design = {
design = "Brigand"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_mass_drivers_1"
has_technology = "tech_shields_1"
}
}
}
create_ship_design = {
design = "Skull"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_lasers_1"
has_technology = "tech_mass_drivers_1"
has_technology = "tech_spaceport_3"
}
}
}
create_ship_design = {
design = "Marauder"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_missiles_1"
has_technology = "tech_mass_drivers_1"
has_technology = "tech_spaceport_3"
}
}
}
create_ship_design = {
design = "Corsair"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_missiles_1"
has_technology = "tech_mass_drivers_1"
has_technology = "tech_spaceport_5"
}
}
}
create_ship_design = {
design = "Strife"
ftl = ROOT
}
add_ship_design = last_created_design
}
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_lasers_1"
has_technology = "tech_missiles_1"
has_technology = "tech_spaceport_5"
}
}
}
create_ship_design = {
design = "Raven"
ftl = ROOT
}
add_ship_design = last_created_design
}
# We take any pirate station as our new spawn point
random_owned_ship = {
limit = { is_ship_size = pirate_station }
save_event_target_as = pirate_home
create_fleet = { name = "Pirate Fleet" }
last_created_fleet = {
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 150
set_owner = ROOT
# We spawn a few ships
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
# For the second set
# We spawn 2-3 more
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_missiles_1"
has_technology = "tech_mass_drivers_1"
has_technology = "tech_spaceport_3"
has_technology = "tech_lasers_1"
}
}
}
random_list = {
40 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
}
30 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_destroyer"
graphical_culture = "pirate_01"
}
}
20 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_destroyer"
graphical_culture = "pirate_01"
}
}
10 = {
create_ship = {
name = random
random_existing_design = "pirate_destroyer"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_destroyer"
graphical_culture = "pirate_01"
}
}
}
else = {
random_list = {
40 = { }
30 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
}
30 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
}
}
}
}
if = {
limit = {
ROOT = {
AND = {
has_technology = "tech_missiles_1"
has_technology = "tech_mass_drivers_1"
has_technology = "tech_spaceport_5"
has_technology = "tech_lasers_1"
}
}
}
random_list = {
40 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
}
30 = {
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_destroyer"
graphical_culture = "pirate_01"
}
}
20 = {
create_ship = {
name = random
random_existing_design = "pirate_cruiser"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_corvette"
graphical_culture = "pirate_01"
}
}
10 = {
create_ship = {
name = random
random_existing_design = "pirate_cruiser"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
random_existing_design = "pirate_destroyer"
graphical_culture = "pirate_01"
}
}
}
}
# We assign leader to fleet
assign_leader = last_created_leader
set_location = PREV
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "pirate.2.trigger.1"
NOT = {
has_star_flag = hostile_system
is_same_value = event_target:capital_system
}
any_planet = {
OR = {
has_mining_station = yes
has_research_station = yes
}
# Attacking a spaceport is suicidal
NOT = {
has_spaceport = yes
}
exists = controller
controller = { is_same_value = event_target:pirate_target }
}
distance = {
source = PREV
max_distance = 200
min_distance = 20
}
}
found_system = {
move_to = THIS
}
}
# We find a juicy target to kill
find_closest_planet = {
trigger = {
id = "pirate.2.trigger.2"
OR = {
has_research_station = yes
has_mining_station = yes
}
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 20
}
}
}
# We go home to heal
find_random_system = {
trigger = {
id = "pirate.2.trigger.3"
any_planet = {
is_planet = event_target:pirate_home
}
}
found_system = { move_to = THIS }
}
# We go to base for some rest
find_closest_planet = {
trigger = {
id = "pirate.2.trigger.4"
is_planet = event_target:pirate_home
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 200
random = 150
}
}
}
}
}
}
}
}
} # the end of new fleet
Can't find any mistake there and i don't get any error from my code, even with the heavy changes i made.