As an example of the flexibility of the SE5 data format, I present to you a way to kill the gamey tactic of using light carriers as warships early on. This could also be used to make non-combatant ships (eg: mining hulls, transports, colony ships) non-combatant by not carrying many weapons, rather than just large to hit penalties that still allow the use of missiles.
First, you must add an ability to every single weapon. AI Tag ## abilities have stuck around, so I will use one of those. The following must be added to every weapon in Components.txt:
====================
Number Of Abilities := 1
Ability 1 Type := AI Tag 01
Ability 1 Description :=
Ability 1 Scope := Space Object
Ability 1 Range Formula := 0
Ability 1 Amount 1 Formula := 0
Ability 1 Amount 2 Formula := 0
====================
You can do this in a flash by extracting the following Python script in your mod's Data folder and running it. It will create a "ComponentsTemp.txt" file with the extra ability appended to all weapons.
add_ability.zip
Next, we need to modify the light carrier hull in VehicleSizes.txt. This is an abbreviated portion of the light carrier entry:
====================
Number Of Requirements := 7
Requirements Evaluation Availability := 1, 2
Requirements Evaluation Allows Placement := 3, 4, 5, 6, 7
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have at least tech level 1 in Light Hull Construction.
Requirement 1 Formula := Get_Empire_Tech_Level("Light Hull Construction") >= (1 + ([%Level%] - 1))
Requirement 2 Description := Empire must have at least tech level 1 in Fighters.
Requirement 2 Formula := Get_Empire_Tech_Level("Fighters") >= (1 + ([%Level%] - 1))
Requirement 3 Description := This vehicle must have 1 Bridge.
Requirement 3 Formula := (Get_Design_Ability_Component_Count("Control Center") = 1) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)
Requirement 4 Description := This vehicle must have at least Life Support for 100 crew members.
Requirement 4 Formula := (Get_Design_Ability_Total("Life Support", 1) >= 100) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)
Requirement 5 Description := This vehicle must have at least Crew Quarters for 100 crew members.
Requirement 5 Formula := (Get_Design_Ability_Total("Crew Quarters", 1) >= 100) or (Get_Design_Ability_Component_Count("Master Computer") >= 1)
Requirement 6 Description := This vehicle can only have a maximum of 12 movement.
Requirement 6 Formula := Get_Design_Ability_Component_Count("Movement Standard") <= 12
Requirement 7 Description := This vehicle must have at least 50% of its hull dedicated to Fighter Bays.
Requirement 7 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("Units - Launch", "Fighter") >= 50
====================
Take a look at Req 6. This is how max engines are defined now, a limit on the ability. Since we gave all weapons the ability AI Tag 01, we can use a similar limit to limit the number of weapons. You could add this:
====================
Requirement 8 Description := This vehicle can only have a maximum of 3 weapon systems.
Requirement 8 Formula := Get_Design_Ability_Component_Count("AI Tag 01") <= 3
====================
Of course, remember to increase the Num Reqs tag and add 8 to the allows placement, as so:
====================
Number Of Requirements := 8
Requirements Evaluation Availability := 1, 2
Requirements Evaluation Allows Placement := 3, 4, 5, 6, 7, 8
====================
Voila! Now, light carriers can only have 3 weapons!
Alternatively, you could make the limit a percent of the hull space, by making Req 8 be this instead:
====================
Requirement 8 Description := This vehicle can have at most 10% of its hull dedicated to weapon systems.
Requirement 8 Formula := Get_Design_Ability_Percentage_Of_Hull_Space("AI Tag 01", 1) <= 10
====================