I just started messing with the event files and decided to take a look at the pirate one since it's in dire need of fixing. I did some programming in my days (read like 20 years ago, maybe less since i did some coding while modding) so i can make some sense of what it's there. But what struck me is what seem like obvious mistakes in the code, things that explain why we get multiple pirate stations or why pirates ships only use one type of guns even when they could use more.
like this gem:
There is no else there so it create one station for each type of weapon you have. If you researched all 3 then you get 3 stations instead of just one. I'm not familiar with the language here so i don't really know how to fix it, but it would make more sense to have else statements and have cases for when you have more than one of the base weapon tech so the game could spawn a more advanced pirate station (that i would gladly make
).
Or this:
It will only build the last created design, so if you have all 3 weapons you will face missile ships only. Rather dull. Another case where some more elaborate code would do a better job and a missed opportunity to have ship designs with mixed weapons or utilities.
Anyway, i'm looking forward to editing it, but i will need to first learn what language it is and what it can do (much more than shown here i'm sure).
like this gem:
Code:
last_created_country = {
set_name = random
save_event_target_as = pirate_band
set_relation_flag = {
who = ROOT
flag = pirate_relation
}
establish_communications_no_message = ROOT
create_fleet = { name = "Pirate Station" }
if = {
limit = {
root = { has_technology = tech_mass_drivers_1 }
}
last_created_fleet = {
set_owner = PREV
create_ship = {
name = random
design = "Pirate Nest"
graphical_culture = "pirate_01"
}
set_location = PREVPREV
}
}
if = {
limit = {
root = { has_technology = tech_lasers_1 }
}
last_created_fleet = {
set_owner = PREV
create_ship = {
name = random
design = "Pirate Lair"
graphical_culture = "pirate_01"
}
set_location = PREVPREV
}
}
if = {
limit = {
root = { has_technology = tech_missiles_1 }
}
last_created_fleet = {
set_owner = PREV
create_ship = {
name = random
design = "Pirate Den"
graphical_culture = "pirate_01"
}
set_location = PREVPREV
}
}
There is no else there so it create one station for each type of weapon you have. If you researched all 3 then you get 3 stations instead of just one. I'm not familiar with the language here so i don't really know how to fix it, but it would make more sense to have else statements and have cases for when you have more than one of the base weapon tech so the game could spawn a more advanced pirate station (that i would gladly make
Or this:
Code:
if = {
limit = {
root = { has_technology = tech_mass_drivers_1 }
}
create_ship_design = {
design = "Reaver"
ftl = ROOT
}
}
if = {
limit = {
root = { has_technology = tech_lasers_1 }
}
create_ship_design = {
design = "Hunter"
ftl = ROOT
}
}
if = {
limit = {
root = { has_technology = tech_missiles_1 }
}
create_ship_design = {
design = "Vagabond"
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"
}
It will only build the last created design, so if you have all 3 weapons you will face missile ships only. Rather dull. Another case where some more elaborate code would do a better job and a missed opportunity to have ship designs with mixed weapons or utilities.
Anyway, i'm looking forward to editing it, but i will need to first learn what language it is and what it can do (much more than shown here i'm sure).
- 3