This is a modding guide for those interested in designing custom ship styles that are used as the default style for custom faction (or even for replacing the style of an existing faction). By following this guide, you will learn how to setup a ship style set which is used by the AI in the development of new ships - whether for an AI controlled faction or for the ships that automatically appear/upgrade in your shipyard as you research new techs.
Assumptions:
Overview:You will need to create ships/templates for all ships you wish to use, including shipyard and starbase designs if you want. You will also need to work with two XML files, ShipClassDefs.xml and FactionShipStyleSetDefs.xml (And FactionDefs.xml to make it work with your faction in the end)
Step by Step Instructions:
Part 1: XML Setup
Part 2: Ship DesignThis process can take some time. Having looked at the FactionShipStyleSetDefs file, you know that there are quite a few ships and bases to design if you want a complete custom set. Not every entry requires a unique ship, since some are simply variations on the same ship. Still, it is a lot of ships.
Part 3: Putting It Together
Part 4: Clean Up Any Text Strings
(Don't think I need to post examples of this, but if you are unsure, ask below. I or someone else can help)
Part 5: Finishing Up
And there you go. The computer should now use your ship designs as the default for that faction and will auto-design your ships with new equipment as techs unlock new equipment. The way it choses equipment to upgrade is based on what is provided in the ShipBlueprintDefs.xml which defines what specific ships require and what to prioritize. You will notice that your ShipClassDefs_NEW.xml file pointed to these blueprints.
I hope this is helpful and makes sense, particularly to newer modders. If you have questions, please ask.
Thank you this is exactaly what I was looking for. This needs to be pinned
Quite helpful so far, but I am running into a snag and I'm hoping you can help. When I go to launch the game I get this message:
"C:\Users\Gauntlet\Documents\My Games\GalCiv3\Mods\Gauntlet Mod\Game\FactionShipStyleSetDefs_TS.xml(13,39): error:
value 'Sovereignty' not in enumeration"
This is clearly referring to the custom FactionShipStyle, and the opening passage:
<ShipStyleSet> <InternalName>TerranSovereigntyShipStyleSet</InternalName> <DisplayName>TerranSovereigntyShipStyleSet_Name</DisplayName> <Icon>GC3_S_Basic_Ship_Icon.png</Icon> <DisplaySampleObjGfxConfig>TS-Medium 04A_A629AD26B03748E7BD1DF418D0C114F4.objgfxcfg</DisplaySampleObjGfxConfig> <ShipStyle>Sovereignty</ShipStyle> <StartingShipyard>BasicShipyard</StartingShipyard>
I can load if I change this to a default name like "Terran".... So yeah I don't know where this is defined...but it seems to be doing no harm.
ShipStyle in this case is not the style that you are creating - as in the set of ships. Rather, it is the style set for ship parts. For example, when you go into your shipyard, unless you set it to show all, by default the ship designer will show you ship parts that fit into a certain style. In my case, for my faction mod, I used the Iconian style for most of my designs. That is, the ship parts are based off of the iconian part set.
In the ship designer, in options, you can chose to show all parts. But still, the default parts set is determined by this entry that you bolded.
For this, it has to be one of the pre-existing styles. I'll clarify that in the instructions.
That is indeed a great help - thanks!
im sure I'll have more questions once I actually get down to the nitty gritty but for now just 2 things -
1- some of the file directories include 'Steam', are you assuming that one would have downloaded the game from Steam, and if so, is this the preferable outlet to download the game from?
2- a question for this and all modding - is there an equivalent to a 'restore to original' for the entire game? It would be good to have a fail safe in place in case I totally screw the game up while I'm learning to mod!!
1) While some will disagree, I would say yes. Steam will eventually have the Steam Workshop enabled which will allow for a centralized location to manage and obtain mods. Many gamers also use Steam as their primary communication and sharing center.
2) If your game uses Steam there is a tool within whereby Steam analyzes your game files and repairs/replaces any that differ from the current version. If you buy the game through some other method, one presume you could always uninstall/reinstall. So short answer yes.
THANK YOU DUMHED! I can't believe how obvious an answer that was lol.
If any of you have more wisdom to share I have a couple other questions:
1) I presume I can exclude the ship entries marked as "CAMPAIGN" for my custom shipdef file?
2) Is there any harm in re-organizing the order of ship entries in the shipdef file. For example, I find there are multiple survey ships spread throughout the list, generally they would all use the same models so for updating the file it would be convenient if they were all in a row. Yes?
Thanks so much to everyone!
@Gauntlet
1) Yes, you can exclude those as well as the wones marked Tutorial, since your style is not use in the tutorial either.
2) There is no harm in reorganizing.
Thanks Gauntlet03, think I'll get it through Steam when the time comes - can't wait!
For my custom race that will steal ships and crew from other races I have used many different styles.
I have used <ShipStyle>All</ShipStyle> as "All" is also an allowed value.
This will start the game without any issues, however in the ship designer no hulls at all will be shown and no new ship design can be created for this faction.
So it looks like "All" should be avoided in the XML file and only be activated ingame
Dumhed,
once you have finalized your ship designs you could use the shortshipnames command, which will create design files without the GUID. This allows you to update the ship designs without having to change the xml files.
Note however that with the shortshipnames active, while it is supposed to work, when you edit a design and save it with the same name it will not properly do that. The workaround for this is to edit your design, save it under a different name, delete the original, and open and re-save it with the original name.
Oh lords of Kobal hear my questions...
1) What are the L and P designs in the shipdef file? They are AI only... but what are they? Example: "FrigateLBlueprint"
2) Anyone know in what order the ship designer organizes ships? Is it in the order of Ship Def? Kinda seems like, but then not to me...
3) If I were to copy the entry for Assault Carrier (huge) but change the hull size to Medium, what would happen? I noticed there were no medium sized carriers?
4) Anyone feel like spelling out which designs are the various Fighters/Drones used by Shipdef? I'm not 100%
You're super helpfulness will be rewarded in this life...
1) They designate different variations of the same design, the difference are the usage of augmentations. E.g. FrigateLBlueprint uses KineticAugment1 which gives RapidReload.
2) I assume you mean the ship list in the shipyard. The order is the Auto design order: obsolete designs are removed from the list and newer versions are added on the bottom. So the order is influenced by the order in which you research techs.
3) Assuming you mean a copy of the ShipClass and you understand that you must modify the internalname to be unique. Then you must also copy the AssaultCarrierBlueprint in ShipBlueprintDefs.xml and give that a new internalname (which you must refer in the newly created ShipClass entry). In the new ShipBlueprint entry you must also then specify the correct hull size - which must match the hull size in the ShipClass entry. And the hull size must match the hull size of the linked template (as specified in the ShipDesign tag).
Then assuming that you develop sufficient tech during the game so that all the RequiredComponent fit, on that moment the auto designer will generate a medium carrier for you.
4) In the FactionShipStyleSetDefs.xml you find the InitialAssaultFighter, InitialInterceptorFighter, InitialEscortFighter, InitialGuardianFighter tags, those define which fighters are used for the various carrier modules.
1) If that is the case, then should I not see those variants in my design list when I start a game with this ship set and use the "unlock" command? For example, I kept the L, P, D letters in the internal names and only the D sets are showing?
2) Got it. Thanks
3) Good to know. Thanks
Thank you again!
1) The AI shipsclasses are supposed to be hidden from the player, but apparently some do not have the AIOnly tag.
For example the Frigates:
TerranFrigate is a player ship class so it should not have the tag (and it doesn't);TerranFrigateL has <AIOnly>true</AIOnly>;TerranFrigateP no <AIOnly>true</AIOnly>, but should have.
The different ships all have a set of code that describes what components they need to have, and what they'll fill up with when there's spare space onboard, it's ShipBlueprintDefs.xml under \data\game.
For example, the basic tiny beam ship is this:
Compare that to the experimental beam carrying version of same:
They'll become available as soon as the relevant BeamWeapon is unlocked, and will add a shield, then two more beam weapons, then the other defenses, then lifesupport and a hyperdrive to its design, hull capacity permitting.
What if you haven't unlocked defenses? Then the design will have its first three beams, then life support and hyperdrive, then fill its remaining hull space with beam weapons. That's what 'FillerComponentType' is about.
Every time you research space-saving tech or a new weapon, ships are re-designed, attempting to follow the order in the relevant blueprint.
Staring to put this guide to use: https://forums.galciv3.com/466720/page/1/
hi dumhead! I'm a beginner at modding and I'm following this guide. TY for it.
Can I ask a question? How do I fix the errors:
Im kind of new. TY in advance
@TurialID
thanks for replying. cant post much more since it is already the limit for new accounts
uhm. I get these errors at the debug.err
when I try to launch a new game with the custom ships. it says these things.
the game would then be at an eternal loading where in the "WARNING: SpawnStarter......." would just be spammed at the debug.err.
oh yeah. as a note. I have only 3 ships with custom designs. the rest are using the basic terran design
When are you seeing those error reports? I'm just getting a bunch of no-shows when I do something wrong with a ship >.<
As for the static upgrade, the starting survey ship, colony ship etc look to a file called ShipStaticBlueprintDefs.xml, which contains just a few dozen ships. I missed that one at first and got confused when I wanted it to refer to the regular ShipBlueprintDefs.xml - I'd only replaced 'terran' with my faction name, hadn't taken away the 'static' part.
@j31254 Would it be possible for you pastebin our code and pm me? I can look at what you have and see if I can id the problem. (Or PM me, and you can email me your code)
Did you create your own blueprints or are you pointing your ShipClassDefs entries to the existing blueprints?
In your FactionDefs file, are your <StartingShips> pointing to the static blueprints, or are you pointing to your custom ship?
Hey Dumhed, while you're at it: any idea what might be wrong with this:
the code compiles OK, but when I refer my starting survey ship to this the game hangs on galaxy creation. It is an exact copy of the normal SurveyStaticBlueprint, except for the InternalName.
How can I create a XMl? I tried poking around on google but I havent quite figured it out. It would be very helpful if you/someone would be willing to do a video walk through for someone like me who has no idea how to get started.
I would really like to create a custom set of ships for some of my custom races.
Thanks!
Create a text-file, then rename it .xml instead of .txt
Alternatively, download the example files in the OP, and overwrite what's n there - that's what I've done!
@Turiel, I will try to get to your question soon. I haven't worked much with new blueprints. In my experience, the game does not like to start with custom blueprints.
@titanmike, Since you are new to XML, I would highly recommend that you begin modding something simpler, for example, trying to create a custom race with XML. This requires really only one xml file and maybe some custom png images if you are so inclined. This really would be to familiarize yourself with how XML tags work in the context of this game, how "variables" work, etc. Making a custom ship set in the fashion described here is a little more complicated only because it requires the use of multiple files referring to each other. Getting your feet wet with a simpler xml project would not take long and will pay serious dividends in the long run. As for a creator/editor, for free programs, I would recommend Notepad++ found here: https://notepad-plus-plus.org/.
well dem! I fixed my problem thakns to TurielD! (You're the man bro!). It seems my problem was that I renamed the ship design's name and therefore omitting the long code after the name. didn't know that it played a part :3 . Now the ships work.
On a side note. Now that the ships are working, and the components/modules (life support, hyper drive) are in place/attached, I can't seem to see their design on the ship. (E.g. Constructor module not appearing on the ship)Is this completely normal? How can I fix this? Ty in advance
Guide added to master list, again, Well Done
There are many great features available to you once you register, including:
Sign in or Create Account