mod files upkeep question

Think i know the answer but

If i only wate to mod one small section .. say just 1 ship component,  is there a way to just have a small new (redefined) component file in the mod directory without the entire component xml file.  Or do you always have to check and re do all your modded xml's every time a patch that changes the orignal?

4,800 views 4 replies
Reply #1 Top

Just create a new xml file with just your component in it. You only need to copy the top and bottom part of the original file to make it work. If you do it that way it should be "patch proof" :)

Reply #2 Top

Great,  Did not know about the keep "the top and bottom part of the original file" 

Appreciate your help sjaminei!

Reply #3 Top

Quoting sjaminei, reply 1

ust create a new xml file with just your component in it. You only need to copy the top and bottom part of the original file to make it work. If you do it that way it should be "patch proof"
End of sjaminei's quote

OK i did it but now i get an error

Duplicate InternalName found in type ShipBlueprintDef: ConstructorBlueprint
Duplicate InternalName found in type ShipBlueprintDef: CorvetteBlueprint

 

I modified the blue print for corvette and const.  If i do this in the orignal file and put the whole file with changes in my mod directory, it works with no errors.  If i delete everything except me changes (in the mod dir file) I get the above error and my my mod no longer works.

What am i doing wrong

 

**EDIT** Found my dear dummy error, accidentally changed the shipblueprint.xml file name in the mod directory. when i corrected it back to the original  name EVERYTHING WORKED!:D

till have the name string problem though

Reply #4 Top

If you want it "patch proof" you want to do your mod with additional data instead of replacing base game versions. Or at least as much of that as is possible.

So, instead of redoing "ConstructorBlueprint" make your own completely new constructor design and use that.

For example, I have a new file named "Mod_ShipBlueprintDefs.xml" that only contains my ship blueprints and none of the base game blueprints. This way StarDock can change the base game version as much as they want without it affecting my mod. In this file I have, among others, a new constructor blueprint:

  <ShipBlueprint>
    <InternalName>PSY_BuilderHBP</InternalName>
    <ShipHullType>Cargo</ShipHullType>
    <Role>Support</Role>
    <RequiredComponentType>ConstructionModule</RequiredComponentType>
    <RequiredComponentType>ConstructionModule</RequiredComponentType>
    <ComponentType>ConstructionModule</ComponentType>
    <ComponentType>ConstructionModule</ComponentType>
    <ComponentType>ConstructionModule</ComponentType>
    <ComponentType>ConstructionModule</ComponentType>
    <FillerComponentType>InterstellarDrive</FillerComponentType>
  </ShipBlueprint>

The above gives me a heavy-duty constructor with at least 2 constructor modules, adding a new constructor module as soon as there's enough space, and otherwise filling the remaining space with as many engines as possible. Note the new unique internal name of the constructor: "PSY_BuilderHBP". This name won't show up in the game but is used to reference it in the game and XML mechanics.

Then I have another completely new file, "Mod_ShipClassDefs.xml" that again contains nothing but my new ship classes that use the blueprints I designed. In this file I create a constructor ship class that uses the above blueprint:

  <ShipClass>
    <InternalName>PSY_TerranBuilderH</InternalName>
    <DisplayName>PSY_TerranBuilderH_Class_Name</DisplayName>
    <Description>PSY_TerranBuilderH_Dec</Description>
    <ThumbnailOverride>Terran_Constuctor_Alpha_01.png</ThumbnailOverride>
    <ShipHullType>Cargo</ShipHullType>
    <ShipRule>Constructor</ShipRule>
    <ShipDesign>Terran_Constructor_01T</ShipDesign>
    <AIShipClass>Constructor</AIShipClass>
    <StrategicIcon>Constructor</StrategicIcon>
    <BlueprintDef>PSY_BuilderHBP</BlueprintDef>
  </ShipClass>

The link to the blueprint is the value in <BlueprintDef>. Here I use the same internal name "PSY_BuilderHBP" to refer to my own blueprint. The ship class itself also has its own new unique internal name: "PSY_TerranBuilderH".

The actual name of my constructor class and its description is in the file "Mod_ShipClassText.xml" which again is a completely new file containing only names and descriptions for my own designs thus proofing it against SD updates. Note also that the Mod_ShipClassText.xml is in the directory "Text" instead of "Game". In this file I have two definitions that apply to the constructor:

  <StringTable>
    <Label>PSY_TerranBuilderH_Class_Name</Label>
    <String>Builder</String>
  </StringTable>

  <StringTable>
    <Label>PSY_TerranBuilderH_Dec</Label>
    <String>A heavy constructor ship for building starbases. The ship carries as many constructor modules as it can fit. The remaining space, if any, is allotted to drives. Good for efficient upgrading of already existing starbases when there's no hurry.</String>
  </StringTable>

The link to the above name and descriptions are in the Mod_ShipClassDefs.xml ship class definition in the XML tags <DisplayName> and <Description>. Note my usage of new internal names for the name and description: "PSY_TerranBuilderH_Class_Name" and "PSY_TerranBuilderH_Dec". The game uses these to look up the name and descriptions.

Finally, I need to add my new constructor class to the available ship classes for the factions. This means the file "FactionShipStyleDefs.xml". Here I can't use a new additional file because I need to modify an existing game faction i.e. Terrans in this case. So I must copy the base version of the file and use the same file name. Fortunately the required modification here is very small. I only need to add one line to the Terran <ShipStyleSet> block for the new constructor class to be available for the Terrans:

    ...

    <ShipClass>PSY_TerranBuilderH</ShipClass>

    ...

(And, of course, a similar line for all the other ship classes of the factions that I have added.)

Doing it this way and using new additional ship classes and blue prints keeps the dependencies to the base game files to minimum so I have less work to do when StarDock updates the game. In this case I only have to re-copy my list of ship classes for the factions and that only if StarDock has changed the FactionShipStyleDefs.xml. (And the same with FactionDefs.xml containing the starting ships.)