Hi,
I got interested in an idea I found where someone suggested to make stations able to spawn "defensive ships" that would have no FTL and so they would defend the star system but would never be able to leave.
I wanted to start small just to see if it works. I started with a Corvette.
My "ship_sizes" folder has a file "00_ship_types_defensive_fleets":
Then my "section_templates" folder has file "defCorvetteSection":
As the ship uses the same components as normal corvettes, I made no changes to "component_templates". I thought that it would be enough to "define" new ship type in "ship_size", remove the FTL component from this "new" corvette type and then define what sections this new type can use in "section_template" and everything else "links" to the same files as normal corvette.
In the ship designer, I can select this "new" corvette:
(I haven't made any strings yet, so the text is not a problem)
But then I get this:
I cannot select any section (gives me no options) and I cannot select any core modules (also gives no options), the sensors are auto-selected bu power plant, thrusters and combat computer offer no options.
Extremely noobish question, I know, but what am I doing wrong?
Or if you know of someone who's done the same or similar mod, can you give me a link so I can take a look at how they did it? Thanks!
I got interested in an idea I found where someone suggested to make stations able to spawn "defensive ships" that would have no FTL and so they would defend the star system but would never be able to leave.
I wanted to start small just to see if it works. I started with a Corvette.
My "ship_sizes" folder has a file "00_ship_types_defensive_fleets":
Code:
def_corvette = {
formation_priority = @corvette_formation_priority
max_speed = @speed_very_fast
acceleration = 0.35
rotation_speed = 0.1
collision_radius = @corvette_collision_radius
max_hitpoints = @corvette_hp
modifier = {
ship_evasion_add = @corvette_evasion
ship_piracy_suppression_add = 2
}
size_multiplier = 1
fleet_slot_size = 1
section_slots = { "mid" = { locator = "part1" } }
num_target_locators = 2
is_space_station = no
icon_frame = 2
text_icon = military_size_1
base_buildtime = @corvette_build_time
can_have_federation_design = no
enable_default_design = yes #if yes, countries will have an auto-generated design at start
enable_3dview_in_ship_browser = yes #if yes, ship design will have a 3d view in the ship browser
default_behavior = swarm
prerequisites = { "tech_corvettes" }
combat_disengage_chance = 0.00
class = shipclass_military
construction_type = starbase_defenses
required_component_set = "power_core"
required_component_set = "thruster_components"
required_component_set = "sensor_components"
required_component_set = "combat_computers"
resources = {
category = ships
upkeep = {
energy = @corvette_upkeep_energy
alloys = @corvette_upkeep_alloys
}
}
min_upgrade_cost = {
alloys = 1
}
}
Code:
@section_cost = 15
ship_section_template = {
key = "CORVETTE_MID_M1S1"
ship_size = def_corvette
fits_on_slot = mid
should_draw_components = yes
entity = "corvette_M1S1_entity"
icon = "GFX_ship_part_core_mid"
prerequisites = { tech_missiles_1 }
ai_weight = {
modifier = {
factor = 10.0
is_preferred_weapons = weapon_type_explosive
}
modifier = {
factor = 0.1
NOT = { is_preferred_weapons = weapon_type_explosive }
}
}
component_slot = {
name = "SMALL_GUN_01"
template = "small_turret"
locatorname = "small_gun_01"
}
component_slot = {
name = "TORPEDO_01"
template = "medium_missile_turret"
locatorname = "medium_gun_01"
}
small_utility_slots = 3
aux_utility_slots = 1
resources = {
category = ship_sections
cost = {
alloys = @section_cost
}
}
}
ship_section_template = {
key = "CORVETTE_MID_S3"
ship_size = def_corvette
fits_on_slot = mid
should_draw_components = yes
entity = "corvette_S3_entity"
icon = "GFX_ship_part_core_mid"
ai_weight = {
factor = 1
}
component_slot = {
name = "SMALL_GUN_01"
template = "small_turret"
locatorname = "small_gun_01"
}
component_slot = {
name = "SMALL_GUN_02"
template = "small_turret"
locatorname = "small_gun_02"
}
component_slot = {
name = "SMALL_GUN_03"
template = "small_turret"
locatorname = "small_gun_03"
}
small_utility_slots = 3
aux_utility_slots = 1
ai_weight = {
modifier = {
factor = 10.0
is_preferred_weapons = weapon_type_kinetic
}
modifier = {
factor = 0.1
NOT = { is_preferred_weapons = weapon_type_kinetic }
}
}
resources = {
category = ship_sections
cost = {
alloys = @section_cost
}
}
}
ship_section_template = {
key = "CORVETTE_MID_S2PD1"
ship_size = def_corvette
fits_on_slot = mid
should_draw_components = yes
entity = "corvette_S3_entity"
icon = "GFX_ship_part_core_mid"
ai_weight = {
modifier = {
factor = 10.0
is_preferred_weapons = weapon_type_energy
}
modifier = {
factor = 0.1
NOT = { is_preferred_weapons = weapon_type_energy }
}
}
component_slot = {
name = "SMALL_GUN_01"
template = "point_defence_turret"
locatorname = "small_gun_01"
}
component_slot = {
name = "SMALL_GUN_02"
template = "small_turret"
locatorname = "small_gun_02"
}
component_slot = {
name = "SMALL_GUN_03"
template = "small_turret"
locatorname = "small_gun_03"
}
small_utility_slots = 3
aux_utility_slots = 1
resources = {
category = ship_sections
cost = {
alloys = @section_cost
}
}
}
In the ship designer, I can select this "new" corvette:

(I haven't made any strings yet, so the text is not a problem)
But then I get this:

I cannot select any section (gives me no options) and I cannot select any core modules (also gives no options), the sensors are auto-selected bu power plant, thrusters and combat computer offer no options.
Extremely noobish question, I know, but what am I doing wrong?
Or if you know of someone who's done the same or similar mod, can you give me a link so I can take a look at how they did it? Thanks!