Militia

== Custom Militia Defenses ==
Adding ships to a local neutral militia setup using a text editor.
First you need to assign the planet a template to use under planet items and set 'useDefaultTemplate' to False:
 planet
 designName "Planet40"
 inGameName ""
 type "Terran"
 pos [ 155 , 153 ]
 owner ""
 isHomePlanet FALSE
 startingUpgradeLevelForPopulation 0
 startingUpgradeLevelForCivilianModules 0
 startingUpgradeLevelForTacticalModules 0
 startingUpgradeLevelForArtifacts 0
 planetItems
 templateName ""
 subTemplates 1
 template "Template:MyTemplate"
 groups 0
 spawnProbability 1.000000
 useDefaultTemplate FALSE
Then you write your new template at the bottom of the file, using the same template name as used for your planet:
 templates 1
 template
 templateName "Template:MyTemplate"
 subTemplates 0
 groups 1
 group
 condition
 type "NoPlanetOwner"
 param ""
 owner "RandomMilitia"
 colonizeChance 0
 items 2
 item "Tech:CapitalShip:BattleShip"
 item "Tech:CapitalShip:Siege"
This would spawn a Kol and a Marza for any planet using the template. It also then shows the new templates in Galaxy Forge and they can be edited.
I think the problem is theres no way to set the owner to RandomMilitia within the editor, so it has to be done manually.
You can also spawn different races as militia, 'Psi:' is Advent, 'Phase:' is Vasari and 'Tech:' is TEC. You can get the unit types/names from within Galaxy Forge, listed on the right when you edit a planet.
----
open up the .galaxy file, find the planet def,
which looks like this:	and change it to something like this:
 planet
 designName "Planet5"
 inGameName ""
 type "Desert"
 pos [ 260 , 230 ]
 owner ""
 isHomePlanet FALSE
 startingUpgradeLevelForPopulation 0
 startingUpgradeLevelForCivilianModules 0
 startingUpgradeLevelForTacticalModules 0
 startingUpgradeLevelForArtifacts 0
 planetItems
 templateName ""
 subTemplates 0
 groups 1
 group
 condition
 type "Always"
 param ""
 owner "Pirate"
 colonizeChance 1
 items 4
 item "Tech:CapitalShip:BattleShip"
 item "Tech:CapitalShip:Carrier"
 item "Tech:CapitalShip:Colony"
 item "Tech:CapitalShip:Siege"
 spawnProbability 1.000000
 useDefaultTemplate FALSE	
 planet
 designName "Planet5"
 inGameName ""
 type "Desert"
 pos [ 260 , 230 ]
 owner ""
 isHomePlanet FALSE
 startingUpgradeLevelForPopulation 0
 startingUpgradeLevelForCivilianModules 0
 startingUpgradeLevelForTacticalModules 0
 startingUpgradeLevelForArtifacts 0
 planetItems
 templateName ""
 subTemplates 0
 groups 1
 group
 condition
 type "Always"
 param ""
 owner "Pirate"
 colonizeChance 1
 items 4
 item "Tech:CapitalShip:BattleShip"
 item "Tech:CapitalShip:Carrier"
 item "Tech:CapitalShip:Colony"
 item "Tech:CapitalShip:Siege"
 spawnProbability 1.000000
 useDefaultTemplate FALSE
This will add a planet with the Kol, Sova, Akkan, and Marza capital ships.
These sorts of militia changes should be possible with the template system by defining new templates in ...\Sins of a Solar Empire\GameInfo\GalaxyScenarioDef.galaxyScenarioDef and using them in the .galaxy file (or even through the Forge tool) , but my initial testing with that didn't do well.
----
DClick on the planet then make a new scenario template and add 3 groups to it one for each race (if you want one for each) and in thoes groups you put the race/ship/mdule combos you want the planet to start with. Then you highlight the new template and click apply to current planet.
----
 template
 templateName "RandomMilitia"
 subTemplates 0
 groups 1
 group
 condition
 type "Always"
 param ""
 owner "RandomMilitia"
 colonizeChance 1.000000
 items 23
 item "Tech:Module:CrystalExtractor"
 item "Tech:Module:CrystalExtractor"
 item "Tech:Module:MetalExtractor"
 item "Tech:Module:MetalExtractor"
 item "Tech:Module:CombatLab"
 item "Tech:Module:NonCombatLab"
 item "Tech:Module:CultureCenter"
 item "Tech:Module:FrigateFactory"
 item "Tech:Module:CapitalShipFactory"
 item "Tech:Module:HangarDefense"
 item "Tech:Module:GaussDefense"
 item "Tech:Module:RepairPlatform"
 item "Tech:Frigate:AntiFighter"
 item "Tech:Frigate:Carrier"
 item "Tech:Frigate:Colony"
 item "Tech:Frigate:Heavy"
 item "Tech:Frigate:Light"
 item "Tech:Frigate:LongRange"
 item "Tech:Frigate:Siege"
 item "Tech:Frigate:Utility0"
 item "Tech:Frigate:Utility1"
 item "Tech:Frigate:Constructor"
 item "Tech:Frigate:Constructor"
"RandomMilitia" is the term in sins for the independent colonies that do NOT expand, but do defend their GW; it is NOT for players.
http://forums.sinsofasolarempire.com/328426
http://forums.sinsofasolarempire.com/330921/page/1/#1950558
Category:Modding
Category:Mapping