can i add a ShipBluprint component by NAME vs TYPE
in a ship blueprint can i add a component by NAME vs <componenttype> so it dosent upgrade as tech advances? Sounds dumb but there is a method to my madness
in a ship blueprint can i add a component by NAME vs <componenttype> so it dosent upgrade as tech advances? Sounds dumb but there is a method to my madness
No.
Well that was shot and sweet
. So can i create a new component and component type?
What i am trying to do is make a blue print with a StructuralEnhancementField thet will not upgrade to RepairDrons which require a resource
Also no. The fields are defined in the schema.
You see at the top of the file, in the XML blurb? There's a line like this:
This tells the game which Schema file is used to determine what's allowed in the table. If we go to GC3/data/schema/ShipBlueprintDefs.xsd and open it (you can use a text editor, I recommend notepad++), then it will have something like this:
<xs:include schemaLocation="Lib/CustomTypes.xsd"/>
<xs:include schemaLocation="Enums/ShipHullTypes.xsd"/>
<xs:include schemaLocation="Enums/ShipComponentTypes.xsd"/>
<xs:include schemaLocation="Enums/ShipRoleTypes.xsd"/>
This is other schema files which are used in this one. So, for example, ship hull types are defined in the shiphullstypes.xsd file. This is important for the next bit.
Below the referenced files, you'll find something like this:
<xs:complexType name="ShipBlueprintDef">
<xs:sequence>
<xs:element name="InternalName" type="xs:string"/>
<xs:element name="ShipHullType" type="ShipHullTypes"/>
<xs:element name="Role" type="ShipRoleTypes"/>
<xs:element name="CanBeBuilt" type="xs:boolean" minOccurs="0" default="true"/>
<xs:element name="HideFunctionalComponents" type="xs:boolean" minOccurs="0" default="false"/>
<xs:element name="RequiredComponentType" type="ShipComponentTypes" maxOccurs="16"/>
<xs:element name="ComponentType" type="ShipComponentTypes" maxOccurs="unbounded"/>
<xs:element name="FillerComponentType" type="ShipComponentTypes" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="AllRequiredMustFit" type="xs:boolean" minOccurs="0" default="false" />
</xs:sequence>
</xs:complexType>
This outlines what can be included in a blueprint - note how each maps directly onto a field in the standard BP table. Also, note how some of them have 'type' fields which match the referenced file names.
If a field has a referenced file as it's type, then an entry in that field MUST be something that exists in that referenced file. These are typically in the schema/Enums folder, as they're enumerations. So, for component types, if we open up the ShipComponentTypes.xsd file, we see the following valid types:
<xs:simpleType name="ShipComponentTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="InterstellarDrive"/>
<xs:enumeration value="SublightDrive"/>
<xs:enumeration value="LifeSupport"/>
<xs:enumeration value="Sensor"/>
<xs:enumeration value="Targeting"/>
<xs:enumeration value="Jamming"/>
<xs:enumeration value="BeamSupport3"/>
<xs:enumeration value="MissileSupport3"/>
<xs:enumeration value="Repair"/>
<xs:enumeration value="Armor"/>
<xs:enumeration value="Shields"/>
<xs:enumeration value="PointDefense"/>
<xs:enumeration value="BeamWeapon"/>
<xs:enumeration value="MissileWeapon"/>
<xs:enumeration value="KineticWeapon"/>
<xs:enumeration value="BeamAugment1"/>
<xs:enumeration value="BeamAugment2"/>
<xs:enumeration value="BeamAugment3"/>
<xs:enumeration value="MissileAugment1"/>
<xs:enumeration value="MissileAugment2"/>
<xs:enumeration value="MissileAugment3"/>
<xs:enumeration value="KineticAugment1"/>
<xs:enumeration value="KineticAugment2"/>
<xs:enumeration value="KineticAugment3"/>
<xs:enumeration value="InterceptorCarrierModule"/>
<xs:enumeration value="GuardianCarrierModule"/>
<xs:enumeration value="AssaultCarrierModule"/>
<xs:enumeration value="EscortCarrierModule"/>
<xs:enumeration value="ColonyModule"/>
<xs:enumeration value="ConstructionModule"/>
<xs:enumeration value="CargoModule"/>
<xs:enumeration value="TransportModule"/>
<xs:enumeration value="SurveyModuleEnhanced"/>
<xs:enumeration value="SurveyModule"/>
<xs:enumeration value="RecoveryModule"/>
<xs:enumeration value="SupportModule"/>
<xs:enumeration value="ShieldProjection"/>
<xs:enumeration value="ShieldSupport"/>
<xs:enumeration value="ShieldDegradation"/>
<xs:enumeration value="PointProjection"/>
<xs:enumeration value="PointSupport"/>
<xs:enumeration value="PointDegradation"/>
<xs:enumeration value="ArmorSupport"/>
<xs:enumeration value="ArmorDegradation"/>
<xs:enumeration value="RepairSupport"/>
<xs:enumeration value="BeamSupport1"/>
<xs:enumeration value="BeamSupport2"/>
<xs:enumeration value="MissileSupport1"/>
<xs:enumeration value="MissileSupport2"/>
<xs:enumeration value="KineticSupport1"/>
<xs:enumeration value="KineticSupport2"/>
<xs:enumeration value="TargetingSupport"/>
<xs:enumeration value="JammingSupport"/>
<xs:enumeration value="SublightSupport"/>
<xs:enumeration value="SublightSuppression"/>
<xs:enumeration value="MovesSupport"/>
<xs:enumeration value="RangeSupport"/>
<xs:enumeration value="Cosmetic"/>
<xs:enumeration value="InterstellarDriveAugment"/>
<xs:enumeration value="HitPointAugment"/>
<xs:enumeration value="BeamWeaponEnhanced"/>
<xs:enumeration value="MissileWeaponEnhanced"/>
<xs:enumeration value="KineticWeaponEnhanced"/>
<xs:enumeration value="HitPointSupport"/>
<xs:enumeration value="BestDefense"/>
</xs:restriction>
Anything on this list is a valid thing to use in any field which ShipBlueprintDefs.xsd lists as type=ShipComponentTypes. Anything not on this list is not.
This is pretty much the case for everything. You can check the Schema location in the xml file, then use the schema file to find what can and cannot be used in whichever place.
Oh, and DO NOT EDIT THE SCHEMA. It will just break your game horribly, and you can't use schema edits in the mod folder.
Thanks for the modding lesson buddy. Its both simple and complicated at the same time
. I do recall Paul saying DO NOT modify schema files, but thanks for the reminder.
Si if i could pick your brain one more time. Say i found something in the schema type list that was not CURRENTLY used, it looks like i could create a new component by modding; ShipComponentDefs & ComponentClassDefs xml's (and others) and then use it in a blue print. Purely academically speaking.
Obviously the easiest solution to my original quest is just to remove the resource requirement form the upgrade component.
thanks again for taking the time, very informative.
Yes, if there's one not in use then it can be used for anything you like, so long as it's listed in the Enums. Or if you re-purpose one that does something you don't need, i.e. if you dumped missile weapons and point defense then you could use those two code tags for more or less anything.
Welcome Guest! Please take the time to register with us.