So i've been trying to get some info on GalCiv modding, which i presume is based strongly if not entirely on galciv3's modding, as the instructions there work, but I wanted to know if you do an XML merge as there's no mention of it. Copying an entire file to change one value means constantly having to replace the changed values on a new copy of the XML on every update, when a simple XML merge should work, even if you have to do it with a manual iteration of the XML data because you're not embedding ID attributes.
So if i create a file, like say ShipHullStatDefs.xml in my user / mods directory and only enter the XML object i want to modify will that work ok? I understand it'd need to be a full XML object from a first level child object like <ShipComponent>. is the InternalName your soft ID?
If it doesn't currently work like this are you able to do that merge? that'd be heaps good to avoid constant deprecation of mods that continue to retain the XML values from the static mod file.
Thanks!
Note that all xml data needs to correspond to the folder structure where the existing data is, or it won't be used.
As in GC3, if you only want to add new items, you need to create a unique filename and then just add the new xml objects.
Also as in GC3, you can replace an entire file (like for total conversions) by creating a file with the same name in the same relative folder structure.
If you want to modify just one item, you can add a ModDataDefList (see ModifyDataDef.xsd in Data\Schema) and it will replace data of the same type with the same internal name. At this time, all the fields that are required in the normal def are required when replacing data in the ModDataDefList.
If you want to remove specific items, you can use a RemoveDef (See RemoveDef.xsd in Data\Schema\Lib).
Thanks! sounds like ModDataDefList is what i want. Where might i find those docs?Can't find that ModifyDataDef.xsd file in Data\Schema, in either GalCiv3 or GalCiv4 ? are you able to provide me that file please so i have a basis to work from?
Cheers!
Oops, it's in Data\Schema\Generated.
Thanks!, I'm looking at this file but i can't figure out how you'd use this to make an alteration.
It just seems to be a list of rows like this;
<xs:element name="StarbaseDef" type="StarbaseDef" minOccurs="0" maxOccurs="unbounded"/>
As an example how would i alter the the parameter EngineTrailWidth value defined in Data\Gameplay\ShipHullStatDefs.xml with InternalName=Small, changing the value from 3 to 2 for example?
Thanks!Brad.
Folks -
This time around, can we PLEASE get a publicly-accessible *authoritative* source repository for the XML files? With all the branching included?
It makes it MUCH easier for the community to submit patch fixes (and, hey, maybe even directly to the source repository, you know, via a Pull/Merge Request or the like?). It's also much simpler to see the differences between the various releases of the game and expansions.
Please? It's not giving up ANY control, nor giving away ANY proprietary secrets or the like.
Heck, you can even manage it on GitHub or Bitbucket.
This REALLY, REALLY would be a HUGE benefit to both the mod community AND StarDock. You know, saving you folks a lot of time and money?
You will find this helpful if you are making xml mods for GC3/4:
https://www.w3schools.com/xml/schema_intro.asp
For your example, it would look like this (you have to add all the existing values even the ones that you don't have to change, because I don't currently have a way to make it ignore the minOccurs field for this type):
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><ModifyDataListxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="../Schema/ModifyDataDef.xsd">
<ShipHullStats> <InternalName>Small</InternalName> <ShipHullType>Small</ShipHullType> <DisplayName>Small_Name</DisplayName> <Description>Small_Dec</Description> <Icon>gfx/NoImage.png</Icon> <MovementSFXDefine> <IdleLoopSFXDefine>SMALL_IDLE</IdleLoopSFXDefine> <MovingLoopSFXDefine>SMALL_TRAVEL</MovingLoopSFXDefine> <StartMovingSFXDefine>SMALL_THRUST_ON</StartMovingSFXDefine> <EndMovingSFXDefine>SMALL_TRAVEL_END</EndMovingSFXDefine> </MovementSFXDefine> <EngineTrailWidth>2</EngineTrailWidth> <Stats> <EffectType>ManufacturingCost</EffectType> <Scope>Queue</Scope> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>12</Value> </Stats> <Stats> <EffectType>Maintenance</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>0</Value> </Stats> <Stats> <EffectType>HitPointsCap</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>16</Value> </Stats> <Stats> <EffectType>MassCap</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>4</Value> </Stats> <Stats> <EffectType>Logistics</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>2</Value> </Stats> <Stats> <EffectType>Crew</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>10</Value> </Stats> <Stats> <EffectType>MovesCap</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>8</Value> </Stats> <Stats> <EffectType>SensorRange</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>6</Value> </Stats> <Stats> <EffectType>ShipRange</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>24</Value> </Stats> <Stats> <EffectType>Fortitude</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>1</Value> </Stats> <Stats> <EffectType>ExpValue</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>6</Value> </Stats> <Stats> <EffectType>DefenseRange</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>400</Value> </Stats> <Stats> <EffectType>TacticalSpeed</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Multiplier</BonusType> <Value>0.2</Value> </Stats> <Stats> <EffectType>Acceleration</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Multiplier</BonusType> <Value>0.4</Value> </Stats> <Stats> <EffectType>AOERange</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>3</Value> </Stats> <LevelEffectStats> <EffectType>HitPointsCap</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Multiplier</BonusType> <Value>0.1</Value> </LevelEffectStats> <Prerequ> <Techs> <Option>Tech_OrbitalManufacturing</Option> </Techs> </Prerequ> </ShipHullStats> </ModifyDataList>
Howdy there, just playing around with this again. I think i'm missing something, when i create the file ShipHullStats_Tiny.xml and put it in the modName/Gameplay/ directory it throws an error.
>>>>>>>
E:\Documents\My Games\GalCiv4\Mods\BradsMod\Gameplay\ShipHullStatDefs_Tiny.xml(6,16): error: no declaration found for element 'ShipHullStats'E:\Documents\My Games\GalCiv4\Mods\BradsMod\Gameplay\ShipHullStatDefs_Tiny.xml(147,20): error: element 'ShipHullStats' is not allowed for content model '(AdvisorRecommendationDef*,AIStrategyDef*,AITechGovernorDef*,AnomalyArtDef*,AnomalyDef*,AnomalyGroupDef*,ArtifactArtDef*,ArtifactDef*,ArtifactPowerDef*,AsteroidArtDef*,AsteroidDef*,BattleActionDef*,BattleBehaviorDef*,BattlefieldDef*,BattleTacticDef*,BattleTitleDef*,BlackHoleArtDef*,BlackHoleDef*,BorderArtDef*,PresetGameSettingsDef*,ScenarioObjectiveDef*,ScenarioDef*,CampaignDef*,CinematicCameraDef*,CitizenRaceDef*,PlanetTraitDef*,ContinentDef*,FlavorTextDef*,DiplomacyMoodDisplayDef*,ConversationResponseDef*,ConversationTopicDef*,CreditsSequenceDef*,CultureTraitDef*,CultureTierDef*,CulturePyramidDef*,CustomConversationFilterDef*,CutsceneDef*,DiplomacyDisplayDef*,EncounterDef*,EnvironmentDef*,EventTriggerListDef*,ExecutiveOrderDef*,FactionCommanderShipSetDef*,FactionDef*,FactionMapColorsDef*,FactionMoviesBGDef*,FactionMoviesFGDef*,FactionMusicDef*,FactionOverrideDef*,FactionShipStyleSetDef*,FormationDef*,KeyValueDictionaryType*,FXElementConfig*,FXOverrideConfig*,GalacticNewsDef*,ShipComponentDef*,GalCivGraphicsDef*,GameEventDef*,GameSetupDef*,GCAppearanceDef*,GCMaterialDef*,GCSurfaceDef*,GCTextureSetDef*,GovernmentDef*,GovernmentTierDef*,GovernorDef*,HypergateDef*,HyperlaneDef*,ImprovementDef*,InvasionTacticDef*,LeaseDef*,MainGameMusicDef*,MapSetupDef*,MapSizeDef*,MarketPlaceDef*,MegaEventDef*,MercenaryDef*,MercenaryTierDef*,MiningBaseArtDef*,NebulaDef*,NebulaGroupDef*,ObjectAbilityDef*,PacingGroupDef*,EmitterDef*,AffectorDef*,ParticleScriptDef*,PathLineType*,PlanetArtDef*,PlanetaryProjectDef*,PlanetClassDistributionWeightsDef*,PlanetDef*,PlanetFeatureDef*,PlanetSurfaceLayoutAtlasDef*,PlanetTerrainDef*,PlanetUpgradeArtDef*,PolicyDef*,PresetMapSettingsDef*,PrestigeVictoryDef*,QuestDisplayDef*,RaceTraitDef*,RaceTraitSliderGroupDef*,RadialIconHUDDef*,RepeatingFXStateDef*,ResourceDef*,ScenarioConversationDef*,ScenarioTriggerDef*,ScenarioTriggerSetDef*,SceneLightingDef*,ScreenShakeDef*,ShipBlueprintDef*,ShipClassDef*,ShipComponentArtDef*,ShipDef*,ShipHullDef*,Sh<<<<<<<
Do i have to include a reference to this file from another central build file or something? "Note that all xml data needs to correspond to the folder structure where the existing data is, or it won't be used."What is intended by "correspond to the folder structure", do you mean the XML ModifyDataList file must exist in the directory the original definitions reside in? or that the filename has to correspond like Gameplay_ShipHullStatsDefs.xml ? I called the file ShipHullStatsDefs_Tiny.xml because i thought this was the correct naming convention. A working example would be the bees knees, honestly Thanks for your time Cari Brad.
Trial and horror and finally made this make sense.
Here's an example of how you modify only a single item, in this case 2 single items, without using an entire XML file and basically blocking updates from the game. For some insane reason you won't find a reference to this _anywhere_, i'm not sure why.
~\Documents\My Games\GalCiv4\Mods\<ModName>\Data\Gameplay\ModDefsList.xml
Had some problems with this due to throwing errors numerous times, it's not as fluid as it's made out to be, for example i had to use ShipComponentDef rather than ShipComponent, i think you can ignore the XSD reference paths as they're probably all pre loaded into a collection for reference, it didn't seem to mind, and the refs you'll find are all over the place anyway.
This example will increase the BoostEngine to 12 movements points and and the second ShipComponentDef will increase the fleet moves by 12.
<?xml version="1.0" encoding="utf-8" standalone="yes" ?><ModifyDataList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Schema/ModifyDataDef.xsd"> <ShipComponentDef> <InternalName>Component_BoostEngine</InternalName> <DisplayName>Component_BoostEngine_Name</DisplayName> <Description>Component_BoostEngine_Dec</Description> <ArtDefine>IonDrive_01</ArtDefine> <Category>Engines</Category> <Type>InterstellarDrive</Type> <SupportType>InterstellarDrive</SupportType> <PlacementType>Support</PlacementType> <Stats> <EffectType>ManufacturingCost</EffectType> <Scope>Queue</Scope> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>12</Value> </Stats> <Stats> <EffectType>Mass</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <ValueType>Special</ValueType> <SpecialValue> <Special>HullMassScaleMod</Special> <ValueParam>1</ValueParam> <ValueParam>0</ValueParam> </SpecialValue> </Stats> <Stats> <EffectType>MovesCap</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>12</Value> </Stats> </ShipComponentDef> <ShipComponentDef> <InternalName>Component_FleetMoves</InternalName> <DisplayName>Component_FleetMoves_Name</DisplayName> <Description>Component_FleetMoves_Dec</Description> <ArtDefine>MercModel_14</ArtDefine> <Category>Engines</Category> <Type>InterstellarDrive</Type> <SupportType>InterstellarDrive</SupportType> <PlacementType>Support</PlacementType> <Stats> <EffectType>ManufacturingCost</EffectType> <Scope>Queue</Scope> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>32</Value> </Stats> <Stats> <EffectType>Mass</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <ValueType>Special</ValueType> <SpecialValue> <Special>HullMassScaleMod</Special> <ValueParam>1</ValueParam> <ValueParam>0</ValueParam> </SpecialValue> </Stats> <Stats> <EffectType>MovesCap</EffectType> <Scope>Fleet</Scope> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>Flat</BonusType> <Value>12</Value> </Stats> <Stats> <EffectType>PromethionCost</EffectType> <Target> <TargetType>Ship</TargetType> </Target> <BonusType>OneTime</BonusType> <Value>1</Value> </Stats> </ShipComponentDef></ModifyDataList>
The post i made 15 months prior, above, could probably be saved by adding "Def" to the end of that, but without knowing that you may as well have no information at all.
There are many great features available to you once you register, including:
Sign in or Create Account