MOD - Creating Custom Faction Buildings

Hey All,

I'm trying to mod custom buildings for a faction i'm working on. I've already created the images I needed. I also figured out that i'd need to create a tech tree for them, for which i'm planning on using a very simple modification of the Terran tech tree. I would think that i have to update it with my improvement names and attach them to the appropriate techs. Has anyone tried something similar? Are there any pitfalls or shortcomings that I might want to be careful about?

I'm not overly comfortable with the XML files yet, so any feedback from the community would be most appreciated!!!

6,513 views 4 replies
Reply #1 Top

You actually dont need a new Techtree, if you just want to add new Improvements.

 

<!-- Prerequisites -->

<Prerequ>
  <Techs>
    <Option>XenoIndustrializationTech</Option>
    <Option>InfrastructureTech</Option>
  </Techs>
  <UpgradesFrom>BasicFactory</UpgradesFrom>
</Prerequ>

</Improvement>

 

 

like here you can just set in the improvement-xml, which tech is needed to build the improvement.

(here its either XenoIndustrializationTech or InfrastructureTech, you dont need both)

Reply #2 Top

Quoting mortili, reply 1

You actually dont need a new Techtree, if you just want to add new Improvements.
End of mortili's quote

You do need to tinker with the TechTree, IF, you are using a PreReq tech that is generalized, which most are. Otherwise your new improvement will be buildable by anyone.

Improvement.xml:


        <Prerequ>
            <Techs>
                <Option>XenoCommerce</Option>  <--- Generalized Tech
            </Techs>
        </Prerequ>

You would have to change that or anyone that gets that Tech would gain access to the improvement:-


        <Prerequ>
            <Techs>
                <Option>BorgXenoCommerce</Option>
            </Techs>
        </Prerequ>

Then change the General tag in TechnologyDefs.xml:

    <GenericName>BorgXenoCommerce</GenericName>

You will have to edit any techs that required XenoCommerce to require BorgXenoCommerce as a PreReq in your tech tree or you will end up with a broken link. (broken links will get listed in the debug.err file)

Same rules apply to Ship Components too.

Reply #3 Top

yeah i somehow thougt he wanted to add new improvements to existing races/techtrees^^

Reply #4 Top

I freely admit that my own programming has been rather 'scattered' and isn't strictly professional, but I've been playing with adding buildings for sometime so hopefully there's something out of this mess of points that helps;

1. The >Upgrade< and >Preclusions< tags are very important and useful, as the former allows your building to improve through the ages so to speak, whilst the latter lets u effectively make colony unique buildings which can be upgraded without unlocking earlier additions of that building (I.E. preventing a Slave Recycler from being available if the colony's one upgrades to a Protein Sequencer).

2. >Bonus Type<  (Flat/Multiplier) and >Scope< (Faction/Colony/Ship/Queue/ZOC/etc...) are both important ways of adding nuance and significance to objects. The latter is self-explanatory (in my opinion), but the former is quite important. From memory (and please correct if wrong) Flat gives a set amount, whilst Multiplier is a percentage of a target value. differing situations call for either Bonus Type, but I generally like to explore a gradual increase of a faction's whatever (research/economy/production/etc...) through Faction wide Multipliers through colony unique buildings. The two can be leveraged together (a Flat bonus can increase the Multiplication of the property) to interesting effect, though I do have a preference for percentages of any sort as opposed to static buffs, as they allow for scaling to the game's conditions.

3. I strongly recommend studying/pasting the code already in Defs such as Improvements and CultureTraits, as it can both be a great time-saver, and also allows one to see how the code works and many differing uses of it.

4. Putting the >PreRequ< tag to a Racial Ability is another way of individualising the race without adding it to tech, though I admit I still haven't attempted this so it is just conjecture ATM (don't see why it wouldn't work though).

5. Tried many differing ways of making Improvements effect the EXP/Level of ships, but either stopped the game or nothing perceptible happened. A workaround is to add the code of Racial Trait 'Experienced' to your faction's Racial Trait(s), or to give the buffs of Ship Level (such as HP) directly (I.E. like the Stellar Forge).

6. Horemvore's point is especially important, as some techs such as Engineering are a pain to re-add all the previous unlocks

7. Atmospheric Cleansing is strange, as on my game its the only Tech which doesn't display any unlocks, and when I appended a building to it in a 'Factionalised' version of Atmospheric Cleansing the ability to colonize those otherwise inhospitable worlds no longer functioned. May be best to avoid this particular tech.

8. Adjacency bonuses = their integer value * 10 / 2 and converted to a precent (I.E. an adjacency of 8 equals 8*10/2, or 40%). I took a brief break just after toying with this, and I noticed  degradation of the percent bonus (but not the labelled adjacency bonus). I haven't tested this, but it might be something to watch out for.

9. Its an aside to the OP, but ship components are an excellent way of customising a faction further, and otherwise doing stuff which adds risk/fun/novelty to a playstyle (such as making an advanced colony module which can survey, and gives credits for doing so).

Hope this helped, and please ask/comment if something comes to the mind.