I started a thread last week where I listed all (just about) the XML files and detail (or vague guesses) on their function with the intent of eventually coming along and adding new threads for individual files where I go into some details on how to mod them to include new stuff.
The last few days, I've been giving a lot of thought about what to write a guide for first.. Finally It's come down to this grouping simply because they make a good low key first step for a would be modder. While trying to decide the best way to extend the tech tree/shipcomponents/add new hulls/etc might seem exciting to announce the results, balancing them to be fun & interesting across a wide range can be more involved from planning to testing & final implementation. a new event/UP Resolution however is much less involved with quite a bit more room for non-technical creativity to dip one's toes into the murk with.
Basics
These guys are as basic and obvious as basic & obvious can get.... Have some great idea(s) for stuff that can/should be added to the colonization events?... Here's your target!
At the top of an XML file is the scema/encoding/etc, mostly ignore everything before these two lines
<!-- Created with the Gal Civ 3 Editor -->
<!-- ColonizeEventDefs.xml -->
Playing above them could cause havoc & nothing interesting is there. The <!-- comment text goes here --> block is how you can add a comment for human readers to comment [label/describe] things you want to comment. There is one important detail there however:
<GameEventList .... stuff> then at the very tail end is </GameEventList>. Everything between those two tags should be game events. If you were to go digging right now into ColonizeEventDefs.xml, GalacticEventDefs.xml, -OR- IdeologicalGalacticEventDefs.xml... you would notice they are all the same! That sameness makes them an excellent intro to xml since it does a good job of showing how it's the coding equivalent of legos $
ColonizeEventDefs.xml, GalacticEventDefs.xml, & IdeologicalGalacticEventDefs.xml
All Three of these files are essentially the same with very minor differences Lets start with the very first colonization event (it only looks complicated)... Despite appearances, it's pretty Simple:
- <GameEvent>
- This is the opening tag for the specific GameEvent with a </GameEvent> Later to signify the end of this particular event.
- If you notice, tags are often indented to give The appearance of being nested within the parent... That's because it makes the results far more readable to a human. XML interpreters rarely care about it much however if you use a different intent style.
- <InternalName>PodsEvent</InternalName>
- What the heck is an internal name & PodsEvent? How do you know that you might be asking... Buuut if you go look in GalCivIII\data\English\Text\ColonizeEventText.xml, on the 11th line down you will see "<Label>PodsEvent_Name</Label>"... In fact, go do that now before moving on. When you do that, you will notice the text to the actual pods event along with mamy of the potentially "wtf?? inducing labels. Once upon a time, games might have had a cryptic series of gibberish where modding this type of thing would have needed a table of stuff if it was possibile at all
- <DisplayName>PodsEvent_Name</DisplayName>
- <Description>PodsEvent_Dec</Description>
- <WindowTitle>PodsEvent_Title</WindowTitle>
- <ArtDefine>Colonizing_Event_Ruins.png</ArtDefine>
- <Type>ColonizeEvent</Type>
- This is the next interesting spot in the code. Sure writing up the text for new events in ColonizeEventText.xml might be a lot of fun... If you are reading this, you probably want to know how to set the bonus's to match up with your new events! I'm getting there, but this tag is important
- The other possibility is <Type>GalacticEvent</Type>. There may even be more, but this specifies if the GameEvent is a colonization event or a GalacticEvent
- <Weight>25</Weight>
- I'kk be honest here! I don't know what this does, but... we can guess! Lets look at other GameEvents & see what they have set... Well in this case, every single colonization Event is 25 & every single IdeologicalGelacticEvent is 50 for weight... I'm going to go out on a limb & say "leave this where it is or unpredicatable results might occur". if some events had a higher/lower weight than others, I'd expect that those events were more or less likely to show up over others on the other end of the spectrum though.
- <Choice>
- OOOH... the xml says It's starting a choice
- <Type>Benevolent</Type>
- <Description>PodsEvent_Benevolent_Bonus_Name</Description>
- <BonusDescription>PodsEvent_Benevolent_Bonus_Dec</BonusDescription>
- <Trigger>
- <OnEvent>OnEventChoice</OnEvent>
- This section is going to define what happens when you make a choice.
- It looks like instant is currently our only option, maybe there will be options after so many turns, a certain population, while at war/peace, etc later.. For now,, use this one!
- <Target>
- <TargetType>Faction</TargetType>
- </Target>
- It looks like TargetType are Faction, Planet, Colony, Or starbase are the various options. The best way to decide which is right is to find an event with a target like you want & copy that as a starting point!
- <Lifetime>Instant</Lifetime>
- The Other Option appears to be Target. What's the difference?... no idea, give both a try & see which is better for your idea . If you get stuck, start a thread on it with your observations & see who comes along to help.
- <Modifier>
- <EffectType>CultureBenevolent</EffectType>
- This one might not look very exciting since it's describing an effect that simply consists of +10 benevolent points, but if you look down to the neutral choice, it gives +10 neutral points and a 0.25 +25% bonus/-25% penalty Multiplier to to research on that colony. Want to know some other options?... look at the other Game event options listed & find the bonus's that line up well with your prospectiveGameEvent
- <Target>
- <TargetType>Faction</TargetType>
- </Target>
- <BonusType>Flat</BonusType>
- This is the next interesting tag, The other option isa Multiplier. While flat simply adds that much, a multiplier adds a value determined by what the base is then adds/subtracts the result to/from the base. Sometimes, replacing a traditionally flat bonus with a Multiplier (or vice versa) can yield interesting results, sometimes it will yield little more than an error (or crash), but that's no reason not to try it when it seems like a good/interesting idea!
<Value>10</Value>
</Modifier>
</Trigger>
</Choice>
- And now it ends the first (benevolent) choice to start a new (neutral) one below
<Choice>
<Type>Neutral</Type>
<Description>PodsEvent_Neutral_Bonus_Name</Description>
<BonusDescription>PodsEvent_Neutral_Bonus_Dec</BonusDescription>
<Trigger>
<OnEvent>OnEventChoice</OnEvent>
<Target>
<TargetType>Faction</TargetType>
</Target>
<Lifetime>Instant</Lifetime>
<Modifier>
<EffectType>CultureNeutral</EffectType>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>10</Value>
</Modifier>
</Trigger>
<Trigger>
<OnEvent>OnEventChoice</OnEvent>
<Target>
<TargetType>Planet</TargetType>
</Target>
<Lifetime>Target</Lifetime>
<Modifier>
<EffectType>Research</EffectType>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.25</Value>
</Modifier>
</Trigger>
</Choice>
<Choice>
<Type>Merciless</Type>
<Description>PodsEvent_Merciless_Bonus_Name</Description>
<BonusDescription>PodsEvent_Merciless_Bonus_Dec</BonusDescription>
<Trigger>
<OnEvent>OnEventChoice</OnEvent>
<Target>
<TargetType>Faction</TargetType>
</Target>
<Lifetime>Instant</Lifetime>
<Modifier>
<EffectType>CultureMerciless</EffectType>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>10</Value>
</Modifier>
</Trigger>
<Trigger>
<OnEvent>OnEventChoice</OnEvent>
<Target>
<TargetType>Planet</TargetType>
</Target>
<Lifetime>Target</Lifetime>
<Modifier>
<EffectType>Research</EffectType>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.5</Value>
</Modifier>
</Trigger>
</Choice>
</GameEvent>
Right now I don't think there are any events with more than three choices (or more than 1 of the same ideology), but it stands to reason that making one with four or more will either display the first three, give a scroll thingy to the options... or crash the game, but I suspect that last one unlikely I don't know what would happen if you had 2-3 of the same ideology type, but I suspect the result would be exactly as the code grants regardless of if it displays the choices unexpected colors.
The best way to go about modding things is to start by copying one that's similar & making changes to it rather than trying to hope you remember all the required bits
UPResolutionDefs.xml
Since three of the four files are the same sort of formatting, lets jump over to UPResolutions.xml
Once again, this is a two part file (imagine how unwieldy it would be all in one file!). The first is GalCivIII\data\Game\UPResolutionDefs.xml where the mechanical bits & bobs are stored. The second is Ga,civIII\Data\English\Text\UP ResolutionDefsText.xml, the split is the same sort of thing as above where the "fluff" is in one file & the mechanics in a second.These are much simpler, I was not expecting the colonization events would make such long mechanical entries, but seeing just how flexible they are gives me quite a bit of curiosity since I vaguely recall them being quite a bit more restrictive in GalCivII, That change looks like a great improvement. It would be interesting if we could create race specific event files! *hint hint*...
Lets start with the first UP Resolution
<UPResolution>
<InternalName>ElectChairmanRes</InternalName>
<DisplayName>ElectChairmanRes_Name</DisplayName>
<Description>ElectChairmanRes_Dec</Description>
<Question>ElectChairmanRes_Question</Question>
<VoteType>
<VoteType>PickFaction</VoteType>
</VoteType>
<TurnDuration>104</TurnDuration>
</UPResolution>
Okay, Bad choice... chairman is sort of a hard coded thing
Lets look at a xoouple more instead....
<UPResolution>
<InternalName>UnitedPlanetsHeadquarters</InternalName>
<DisplayName>UnitedPlanetsHeadquarters_Name</DisplayName>
<Description>UnitedPlanetsHeadquarters_Dec</Description>
<Question>UnitedPlanetsHeadquarters_Question</Question>
<VoteType>
<VoteType>PickFaction</VoteType>
</VoteType>
<Behavior>UnitedPlanetsHQ</Behavior>
<TurnDuration>104</TurnDuration>
<MeetingCooldownAfter>3</MeetingCooldownAfter>
<Modifier>
<EffectType>CreditsPerTurn</EffectType>
<Scope>UPResolutionGalaxy</Scope>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>-0.01</Value>
</Modifier>
<Modifier>
<EffectType>Influence</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>0.5</Value>
</Modifier>
</UPResolution>
<InternalName>UnitedPlanetsTourismBoard</InternalName>
<DisplayName>UnitedPlanetsTourismBoard_Name</DisplayName>
<Description>UnitedPlanetsTourismBoard_Dec</Description>
<Question>UnitedPlanetsTourismBoard_Question</Question>
<VoteType>
<VoteType>YesNo</VoteType>
</VoteType>
<PersonalityTraitModifier>
<PersonalityTrait>Expansionist</PersonalityTrait>
<VoteInfluence>10</VoteInfluence>
</PersonalityTraitModifier>
<PersonalityTraitModifier>
<PersonalityTrait>Xenophobic</PersonalityTrait>
<VoteInfluence>-10</VoteInfluence>
</PersonalityTraitModifier>
<MeetingCooldownAfter>10</MeetingCooldownAfter>
<Modifier>
<EffectType>CreditsPerTurn</EffectType>
<Scope>UPResolutionGalaxy</Scope>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>-0.02</Value>
</Modifier>
<Modifier>
<EffectType>Tourism</EffectType>
<Scope>UPResolutionGalaxy</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>1</Value>
</Modifier>
<UPResolution>
<InternalName>InterstellarTradeStimulusAct</InternalName>
<DisplayName>InterstellarTradeStimulusAct_Name</DisplayName>
<Description>InterstellarTradeStimulusAct_Dec</Description>
<Question>InterstellarTradeStimulusAct_Question</Question>
<VoteType>
<VoteType>YesNo</VoteType>
</VoteType>
<PersonalityTraitModifier>
<PersonalityTrait>Trader</PersonalityTrait>
<VoteInfluence>10</VoteInfluence>
</PersonalityTraitModifier>
<PersonalityTraitModifier>
<PersonalityTrait>Xenophobic</PersonalityTrait>
<VoteInfluence>-10</VoteInfluence>
</PersonalityTraitModifier>
<Modifier>
<EffectType>CreditsPerTurn</EffectType>
<Scope>UPResolutionGalaxy</Scope>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>-0.03</Value>
</Modifier>
<Modifier>
<EffectType>TradeLicensesMax</EffectType>
<Scope>UPResolutionGalaxy</Scope>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>2</Value>
</Modifier>
</UPResolution>
<
In the three you see the different types of votes (YesNo/PickFaction), duration differences. Those with a duration have a number of rounds they remain in effect Those with no duration, last until repealed. You also get to see them giving wildly different types of bonuses, credits per turn, trade licenses max, influence per turn. You get to see how different faction traits affect voting patterns (these are configured on a race by race basis in galcivIII\data\game\FactionDefs.xml). Sadly I'm unable to find an XMl file that defines things like "UPResolutionRedistributeWealth" & some of the other hard coded <action>'s in UPResolutionDefs.xml. I suspect that modders could have a blast building new & more involved/complicated/specialized diplomatic options if the file were opened up to us in time... That right there is part of why I chose to start with these files Truth be told, another part is the number of colonization events that mention biological/non-syntheticRace things (any that do) while not a single one is tailored towards synthetic race(s) In Galactic /Civilizations III Synthetic Empires . Since modding ship parts & planetary structures is still close ebnough to where GalcivII Tutorials will get you started, I went with these