Sins of a Solar Empire : Real-Time Strategy. Unrivalled Scale.
© 2003-2016 Ironclad Games Corporation Vancouver, BC. All rights reserved.
© 2006-2016 Stardock Entertainment

How do I use templates?

By on February 11, 2008 8:44:05 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

stanalonis

Join Date 02/2008
+1
I've looked through the .galaxy files to understand how each start system (or series) is built when using notepad. In each planet group there's a line for template then "" followed right after it. about every .galaxy file shares this line for each planet group. Does that mean templates haven't been implemented yet for the game?

And if templates are there, where are they stored at? what format do they use? How can I force the game to use my defaults instead of the ones that give the planet bonuses and a frigate center for you at the start? I've looked through the .entity files (after decoding the binary format) and still haven't tracked down where templates are stored. Are they to be user made templates then? The Galaxy Forge editor would seem to suggest this but I still see template "" in the file anyway.

So how do templates work?
Locked Post 8 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
February 13, 2008 9:00:46 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
bumpity
Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 9:48:22 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

*bad forum*

 


Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 10:06:25 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Templates can be added at the bottom of the galaxy map in notepad or the like.  Here's an example of that (it follows after the "player count" info which I have shown too just so you know where it will be--towards bottom of map file):

playerCount 1
player
    designName "NewPlayer0"
    inGameName "NewPlayer0"
    overrideRaceName ""
    teamIndex -1
    startingCredits 12000
    startingMetal 6000
    startingCrystal 6000
    isNormalPlayer TRUE
    isRaidingPlayer FALSE
    isInsurgentPlayer FALSE
    themeGroup ""
    themeIndex 0
    pictureGroup ""
    pictureIndex 0
templates 1

This shows the total number of templates you will use on the map--make sure the number of templates matches that number.  Next, you will actually add the templates.  Here is an example of a player template named and identified as "Start":

templates 1
template
    templateName "Start"
    subTemplates 0
    groups 6
    group
        condition
            type "PlanetOwnerIsRaceNormalStart"
            param "Tech"
        owner "PlanetOwner"
        colonizeChance 0.000000
        items 5
        item "Tech:CapitalShip:Colony"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Artifact:WormholeTravel"
    group
        condition
            type "PlanetOwnerIsRaceNormalStart"
            param "Psi"
        owner "PlanetOwner"
        colonizeChance 0.000000
        items 5
        item "Psi:CapitalShip:Colony"
        item "Psi:Frigate:Light"
        item "Psi:Frigate:Light"
        item "Psi:Frigate:Heavy"
        item "Artifact:WormholeTravel"
    group
        condition
            type "PlanetOwnerIsRaceNormalStart"
            param "Phase"
        owner "PlanetOwner"
        colonizeChance 0.000000
        items 5
        item "Phase:CapitalShip:Colony"
        item "Phase:Frigate:Light"
        item "Phase:Frigate:Light"
        item "Phase:Frigate:Heavy"
        item "Artifact:WormholeTravel"
    group
        condition
            type "PlanetOwnerIsRaceQuickStart"
            param "Tech"
        owner "PlanetOwner"
        colonizeChance 0.000000
        items 5
        item "Tech:CapitalShip:Colony"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Artifact:WormholeTravel"
    group
        condition
            type "PlanetOwnerIsRaceQuickStart"
            param "Psi"
        owner "PlanetOwner"
        colonizeChance 0.000000
        items 5
        item "Psi:CapitalShip:Colony"
        item "Psi:Frigate:Light"
        item "Psi:Frigate:Light"
        item "Psi:Frigate:Heavy"
        item "Artifact:WormholeTravel"
    group
        condition
            type "PlanetOwnerIsRaceQuickStart"
            param "Phase"
        owner "PlanetOwner"
        colonizeChance 0.000000
        items 5
        item "Phase:CapitalShip:Colony"
        item "Phase:Frigate:Light"
        item "Phase:Frigate:Light"
        item "Phase:Frigate:Heavy"
        item "Artifact:WormholeTravel"

The above template affects any player owned world it is attached to (we'll do that next).  In this case, it looks at what race the planet owner is and then gives him the ships/constructions/artifacts shown in the template.  If he's Advent, he gets Advent stuff, etc.


Now here is the stuff you will add to the planet you want the template on and it will be up in your galaxy file.  If you open in notepad you will see the planets and stars there.  Here's what they look like before the template is added say if you created the map to start with Galaxy Forge:

planet
        designName "Planet154"
        inGameName "Your Sample Planet"
        type "Terran"
        pos [ 4460 , 7387 ]
        owner ""
        isHomePlanet FALSE
        normalStartUpgradeLevelForPopulation 0
        normalStartUpgradeLevelForCivilianModules 0
        normalStartUpgradeLevelForTacticalModules 0
        normalStartUpgradeLevelForArtifacts 0
        normalStartUpgradeLevelForInfrastructure 0
        quickStartUpgradeLevelForPopulation 0
        quickStartUpgradeLevelForCivilianModules 0
        quickStartUpgradeLevelForTacticalModules 0
        quickStartUpgradeLevelForArtifacts 0
        quickStartUpgradeLevelForInfrastructure 0
        planetItems
            templateName ""
            subTemplates 0
            groups 0
        spawnProbability 1.000000
        useDefaultTemplate TRUE


Now to add the template we created back above, this is how the planet info above would change:

planet
        designName "Planet154"
        inGameName "Your Sample Planet"
        type "Terran"
        pos [ 4460 , 7387 ]
        owner "NewPlayer0"
        isHomePlanet FALSE
        normalStartUpgradeLevelForPopulation 0
        normalStartUpgradeLevelForCivilianModules 0
        normalStartUpgradeLevelForTacticalModules 0
        normalStartUpgradeLevelForArtifacts 0
        normalStartUpgradeLevelForInfrastructure 0
        quickStartUpgradeLevelForPopulation 2
        quickStartUpgradeLevelForCivilianModules 2
        quickStartUpgradeLevelForTacticalModules 2
        quickStartUpgradeLevelForArtifacts 2
        quickStartUpgradeLevelForInfrastructure 2
        planetItems
            templateName ""
            subTemplates 1
            template "Start"
            groups 0
        spawnProbability 1.000000
        useDefaultTemplate FALSE

 

That's an example of a template applied to a player owned world.  If you wanted the planet to be the player homeworld, then you would change the FALSE to TRUE on that line. Militia's are done a little differently but I don't have a working template handy for one here. Here's a link on the forum to more info that can help:

http://forums.sinsofasolarempire.com/339832

 

Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 4:01:48 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

here is a template that I use in a map(twenty gw's use the template in the map) that can slideshow ANY computer, the template is to create militia planets and infrastructure

template
    templateName "RandomMilitia"
    subTemplates 0
    groups 11
    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"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.9"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 11
        item "Tech:Frigate:AntiFighter"
        item "Tech:Frigate:Carrier"
        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:Module:HangarDefense"
        item "Tech:Module:GaussDefense"
        item "Tech:Module:RepairPlatform"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.8"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 10
        item "Tech:Module:GaussDefense"
        item "Tech:Module:HangarDefense"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Utility1"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.7"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 11
        item "Tech:Frigate:Utility1"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Module:HangarDefense"
        item "Tech:Module:GaussDefense"
        item "Tech:Module:CultureCenter"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.6"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 10
        item "Tech:Module:GaussDefense"
        item "Tech:Module:HangarDefense"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Utility1"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.5"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 10
        item "Tech:Frigate:Utility1"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Module:GaussDefense"
        item "Tech:Module:HangarDefense"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.4"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 11
        item "Tech:Module:HangarDefense"
        item "Tech:Module:GaussDefense"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Frigate:Carrier"
        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:Module:CultureCenter"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.3"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 10
        item "Tech:Frigate:Utility1"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Module:GaussDefense"
        item "Tech:Module:HangarDefense"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.2"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 10
        item "Tech:Module:HangarDefense"
        item "Tech:Module:GaussDefense"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Utility1"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.1"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 11
        item "Tech:Frigate:Utility1"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Module:GaussDefense"
        item "Tech:Module:HangarDefense"
        item "Tech:Module:CultureCenter"
    group
        condition
            type "PlanetOwnerIsMilitiaWithChance"
            param "0.05"
        owner "RandomMilitia"
        colonizeChance 0.000000
        items 11
        item "Tech:Frigate:Utility1"
        item "Tech:Frigate:Utility0"
        item "Tech:Frigate:Siege"
        item "Tech:Frigate:LongRange"
        item "Tech:Frigate:Light"
        item "Tech:Frigate:Heavy"
        item "Tech:Frigate:Carrier"
        item "Tech:Frigate:AntiFighter"
        item "Tech:Module:GaussDefense"
        item "Tech:Module:HangarDefense"
        item "Tech:Module:CultureCenter"

 

harpo

 

Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 5:13:44 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Harpo IS the reason I even figured out how to do what I know with templates (and didn't lose my sanity in the process).  The force is strong in this one.

*steals militia template*

So do those group forces stack?  Meaning, the first one is 100%, the second 90% etc. and they all add together as and if they spawn?  Could you also show one map sample world with that template in the info?  (I want to make sure I remember how to do it right).

Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 5:49:40 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

ok sinimperium, here is one of the planets that are using the template

    planet
        designName "Planet38"
        inGameName ""
        type "WeightedColonizable"
        pos [ 67 , 198 ]
        owner "Militia"
        isHomePlanet FALSE
        normalStartUpgradeLevelForPopulation 0
        normalStartUpgradeLevelForCivilianModules 0
        normalStartUpgradeLevelForTacticalModules 0
        normalStartUpgradeLevelForArtifacts 0
        normalStartUpgradeLevelForInfrastructure 0
        quickStartUpgradeLevelForPopulation 0
        quickStartUpgradeLevelForCivilianModules 0
        quickStartUpgradeLevelForTacticalModules 0
        quickStartUpgradeLevelForArtifacts 0
        quickStartUpgradeLevelForInfrastructure 0
        planetItems
            templateName ""
            subTemplates 1
            template "RandomMilitia"
            groups 0
        spawnProbability 1.000000
        useDefaultTemplate FALSE

and the stacking is spawn probability with each check seperate ie the first is certain, then a 90% chance of the second, and 80% change of the third, then a 70% chance of the fourth, etc, the template typically gives between 5 and 7 level, but has given from 3 to 10(and I judge the level by the numbers of each frigate as each level adds one of each frigate to the  gw.

harpo

 

Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 5:58:07 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Awesome--thanks dude!   I drool in your presence (man, I seem to suck up a lot here).

FYI--thanks to your help now and in past (and some others such as Goa) I'm about to release my "Imperium" map which is a looong play, massive universe...the kind you save and play in pieces.   Based on the 1977 GDW scifi classic boardgame, Imperium.  The map is a literal representation of the board game map with choke points and all built in just like the boardgame (which was a blast to play). You youngsters have nooo idea how desperate we were for a game like Sins back then.

P.S.  Do you realize some of the best and easiest template explanations on the forum have been posted by you guys in just one day!?  More!

Reason for Karma (Optional)
Successfully updated karma reason!
February 21, 2011 6:23:56 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

I learnt this back in 2009 when I was getting into mapping in sins and had the same issues ie wanting defensive forces that would punish all that entered their gw, but I also received help from a member of the 7ds team at the time.

harpo

 

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #101114  walnut1   Server Load Time: 00:00:00.0000860   Page Render Time: