how to mod stealth bomber evasion

sobrano

Chieftain
Joined
Nov 8, 2005
Messages
9
hello everyone,
After a climbing I am now playing the higher civilization 5 lvl (divinity). I am using the roman empire.
I disbled the manhattan project in some file in order to force everyone (me and AI) to conquest the world without nuclear spamming which always occours at late game.
I am now about in 2050 and in the world there is only me and the babylonian empire.

I noticed that the AI makes a large use of stealth bomber as me...

At this lvl me and the babylonians suffer about 20 stealth bombing attacks each turn but it seems impossible destroy these bombers...

the AI has the same problem with my bombers, when i launch a stealth bomber attack i am pretty sure that my bomber will return at home even though in the enemy city there are 10 jet fighters in interception mission...

After more than 100 turns (it means after more than 2000 stealth bomber attacks) I saw only 2 times a stealth bomber go down and crash!
I think it is not so realistic and not so funny as with normal bomber and normal fighter was during the moder age...

I would like to modify some files in the game directory in order to change some value to reduce a little bit the stealth bomber evasion in order to make possible its destruction if intercepted by a jet.

I was looking for this file but i wasnt able to find it.
Is it possible to mod some file to reduce a bit the stealth bomber evasion?

ty everyone
 
Moderator Action: Moved to Creation & Customization
 
The Stealth Bomber has such high 'evasion' because it is given PROMOTION_EVASION_II as integral ability of the unit. This promotion increases the unit's evasion chances by 100%.

In order to alter this in the game's base files, you would need to either change the
Code:
<EvasionChange>100</EvasionChange>
that PROMOTION_EVASION_II has to a lower number, or you would have to remove the promotion as a free promotion the unit gets.

I'm not really a fan of fiddling with the game's base files, but the files you want to look at are CIV5Units.xml and CIV5UnitPromotions.xml. But you need to edit the file for the correct expansion you have:

  1. Vanilla files are at:
    C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\Gameplay\XML
  2. G&K files are at:
    C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion\Gameplay\XML
  3. BNW files are at:
    C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Gameplay\XML
The beginning portion of your file path might be slightly different depending on whether you have Win7, Win10, etc.
 
Hello,
Before Civ 6 comes out I want to have the last EPIC play through in Civ 5. I am going to play with all the victory conditions turned off so I could play some time using the most modern units until I basically get bored (or what is unlikely &#8211; conquer whole world). But before that I want to mod a little bit either stealth bomber or evasion ability. I need your help here with answering few questions.

Basically I want to change the stealth member&#8230; what I already managed to change is the range from 20 to 30, and the resource cost from 1 to 2 aluminium. I also almost doubled the amount of hammers required to produce it.
Now I would like to make it possible to kill those planes&#8230; so what options do I have&#8230;


1 Change from evasion II to evasion I But I don&#8217;t like it, I wanted it to be something like evasion 80 or 90 NOT 50 :/ also&#8230; Does the evasion promotion available after siege II or bombardment II stack with the basic promotion evasion I ?
The game either uses the ability with the highest amount of evasion or it stacks all acquired witch sucks again.


2 I noticed that according the post above if I change evasion II &#8220;<EvasionChange>100</EvasionChange>&#8221; to something else then nukes and guided missiles will suffer because they use the same promotion.


3 So I was wondering if maybe I can make something like evasion III which will have value of 85 for example and I add it to stealth bomber while removing evasion II and it would be great. However I&#8217;m not sure if I know how to do it&#8230; ;p


4 If evasion promotions stack&#8230; How can I remove it from the game?


I tried something like this&#8230; but it doesn&#8217;t work.
<GameData>
<Unit_FreePromotions>
<Row>
<Delete UnitType="STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/>
</Row>
<Row>
<UnitType>UNIT_STEALTH_BOMBER</UnitType>
<PromotionType>PROMOTION_EVASION_III</PromotionType>
</Row>
</Unit_FreePromotions>

<UnitPromotions>
<Row>
<Type>PROMOTION_EVASION_III</Type>
<Description>TXT_KEY_PROMOTION_EVASION_III</Description>
<Help>TXT_KEY_PROMOTION_EVASION_III</Help>
<Sound>AS2D_IF_LEVELUP</Sound>
<EvasionChange>85</EvasionChange>
<PortraitIndex>59</PortraitIndex>
<IconAtlas>ABILITY_ATLAS</IconAtlas>
<PediaType>PEDIA_ATTRIBUTES</PediaType>
<PediaEntry>TXT_KEY_PEDIA_PROMOTION_EVASION_III</PediaEntry>
</Row>
</UnitPromotions>
</GameData>
 
Hello,
Before Civ 6 comes out I want to have the last EPIC play through in Civ 5. I am going to play with all the victory conditions turned off so I could play some time using the most modern units until I basically get bored (or what is unlikely – conquer whole world). But before that I want to mod a little bit either stealth bomber or evasion ability. I need your help here with answering few questions.

Basically I want to change the stealth member… what I already managed to change is the range from 20 to 30, and the resource cost from 1 to 2 aluminium. I also almost doubled the amount of hammers required to produce it.
Now I would like to make it possible to kill those planes… so what options do I have…


1 Change from evasion II to evasion I But I don’t like it, I wanted it to be something like evasion 80 or 90 NOT 50 :/ also… Does the evasion promotion available after siege II or bombardment II stack with the basic promotion evasion I ?
The game either uses the ability with the highest amount of evasion or it stacks all acquired witch sucks again.


2 I noticed that according the post above if I change evasion II “<EvasionChange>100</EvasionChange>” to something else then nukes and guided missiles will suffer because they use the same promotion.


3 So I was wondering if maybe I can make something like evasion III which will have value of 85 for example and I add it to stealth bomber while removing evasion II and it would be great. However I’m not sure if I know how to do it… ;p


4 If evasion promotions stack… How can I remove it from the game?


I tried something like this… but it doesn’t work.
Code:
<GameData>
<Unit_FreePromotions>
                  [COLOR="Red"]<Row>[/COLOR]
          	          <Delete UnitType="STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/>
                  [COLOR="red"]</Row>[/COLOR]
                  <Row>
          	         <UnitType>UNIT_STEALTH_BOMBER</UnitType>
         	         <PromotionType>PROMOTION_EVASION_III</PromotionType>
                 </Row>
</Unit_FreePromotions>

<UnitPromotions>
               <Row>
			<Type>PROMOTION_EVASION_III</Type>
			<Description>TXT_KEY_PROMOTION_EVASION_III</Description>
			<Help>TXT_KEY_PROMOTION_EVASION_III</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<EvasionChange>85</EvasionChange>
			<PortraitIndex>59</PortraitIndex>
			<IconAtlas>ABILITY_ATLAS</IconAtlas>
			<PediaType>PEDIA_ATTRIBUTES</PediaType>
			<PediaEntry>TXT_KEY_PEDIA_PROMOTION_EVASION_III</PediaEntry>
		</Row>
</UnitPromotions>
</GameData>

You code attempt failed because of a syntax error. I am assuming you were trying this as a mod. <Row> does not encapsulate <Delete> or vice versa. Correct syntax would be:
Code:
<GameData>
	<Unit_FreePromotions>
		<Delete UnitType="STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/>
		<Row>
			<UnitType>UNIT_STEALTH_BOMBER</UnitType>
			<PromotionType>PROMOTION_EVASION_III</PromotionType>
		</Row>
	</Unit_FreePromotions>

	<UnitPromotions>
		<Row>
			<Type>PROMOTION_EVASION_III</Type>
			<Description>TXT_KEY_PROMOTION_EVASION_III</Description>
			<Help>TXT_KEY_PROMOTION_EVASION_III</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<EvasionChange>85</EvasionChange>
			<PortraitIndex>59</PortraitIndex>
			<IconAtlas>ABILITY_ATLAS</IconAtlas>
			<PediaType>PEDIA_ATTRIBUTES</PediaType>
			<PediaEntry>TXT_KEY_PEDIA_PROMOTION_EVASION_III</PediaEntry>
		</Row>
      </UnitPromotions>
</GameData>
 
Well, what I did, I changed some things in files of another mod &#8220;Civ 5 Improvements Patch (v18)&#8221; somehow altering things that I can see how they were written is easier than making a mod from scratch in SDK I don&#8217;t know much about.
Anyway, I do everything based on deduction when I see <Unit_FreePromotions> I assume it&#8217;s a good space to add:

<Delete UnitType="STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/>
<Row>
<UnitType>UNIT_STEALTH_BOMBER</UnitType>
<PromotionType>PROMOTION_EVASION_III</PromotionType>
</Row>

But then I have no idea if next part of my deduction is even partly correct.
In DLC/Expansion2/Gameplay/XML/Units/CIV5UnitPromotions.xml I found
<Row>
<Type>PROMOTION_EVASION_II</Type>
<Description>TXT_KEY_PROMOTION_EVASION_II</Description>
<Help>TXT_KEY_PROMOTION_EVASION_II</Help>
<Sound>AS2D_IF_LEVELUP</Sound>
<EvasionChange>100</EvasionChange>
<PortraitIndex>59</PortraitIndex>
<IconAtlas>ABILITY_ATLAS</IconAtlas>
<PediaType>PEDIA_ATTRIBUTES</PediaType>
<PediaEntry>TXT_KEY_PEDIA_PROMOTION_EVASION_II</PediaEntry>
</Row>

So I changed <EvasionChange>100</EvasionChange> to 85 and changed everywhere evasion_II to III
And pasted all of that under <UnitPromotions> in promotions.xml of that mod.
That&#8217;s all, anyway doing as suggested: removing <Delete UnitType="STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/> from between <Row></Row> didn&#8217;t work. It didn&#8217;t removed Evasion_II from the stealth bomber and also my second part of code didn&#8217;t add new ability evasion_III to the unit.
 
without the current version of the mod "Civ 5 Improvements Patch (v18)&#8221; as you currently have it in your game's MODS folder, I cannot tell what it is you might be doing wrong.

whoward69's zip your mods and attach tutorial

Zip up and attach whatever it is you have done to the mod &#8220;Civ 5 Improvements Patch (v18)&#8221;. Zip and attach the entire mod folder from within the larger ~/MODS/ folder. Don't worry that it is someone else's original mod that you are editing.

Also, when trying to add new promotions, units, etc., to the game, you need to start a new game for them to be implemented properly.
 
I appreciate your help, thank you. In the attachment there's the modified mod and the part that doesn't work is in promotions.xml

Based on my experiences with experimenting through modifying many different variables and mechanics within that mod I was doing my testing by loading a saved game, before it worked on saved game. However, as you suggested I tested new game but still, no success.
 

Attachments

  1. You are missing the red highlighted <Row> command. This snytax error is fatal and causes the game to discard the entire content of the file called promotions.xml:
    Code:
    <GameData>
    	<Unit_FreePromotions>
    	        <Delete UnitType="STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/>
    		<Row>
    			<UnitType>UNIT_STEALTH_BOMBER</UnitType>
    			<PromotionType>PROMOTION_EVASION_III</PromotionType>
    		</Row>
     	       	[color="red"]<Row>[/color]
    			<UnitType>UNIT_HELICOPTER_GUNSHIP</UnitType>
    			<PromotionType>PROMOTION_CAN_MOVE_AFTER_ATTACKING</PromotionType>
    		</Row>
  2. Enable logging and after fully following the procedures outlined in the tutorial for understanding what errors reported are 'normal' for file Database.log, check the contents of Database.log before checking anything esle when a mod does not behave as desired. whoward69's enable error logging tutorial
 
I feel a little bit stupid right now, but I finally made it work! There were 2 essential mistakes, the one you pointed out (missing <Row>) and second that I had "STEALTH_BOMBER" and not as I should "UNIT_STEALTH_BOMBER"

I found out about it as I compared my entry with “Stealth Bomber Nerf” mod I just found which removes Evasion_II promotion.

In Database.log I found only that my created promotion doesn’t exists in EN_US file but I don’t care about it as all the descriptions I made are correctly displayed in game.

The mod works well, I tested it, setting the evasion at 85, anti-air has 15% chances to shoot.

The mod also works in loaded game.

I like the changes now because now SB is balanced for large map IMO. It costs 850 hammers and 2 aluminium, has 32 range, has 85% to evade all damage, and also bombers can’t be upgraded into stealth bombers.

If someone was interested below is the code:

Code:
<GameData>
	<Unit_FreePromotions>
        <Delete UnitType="UNIT_STEALTH_BOMBER" PromotionType="PROMOTION_EVASION_II"/>
        <Row>
            <UnitType>UNIT_STEALTH_BOMBER</UnitType>
            <PromotionType>PROMOTION_EVASION_III</PromotionType>
        </Row>
	</Unit_FreePromotions>

	<UnitPromotions>
        <Row>
            <Type>PROMOTION_EVASION_III</Type>
            <Description>Evasion (85)</Description>
            <Help>Evasion (85)</Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <EvasionChange>85</EvasionChange>
            <PortraitIndex>59</PortraitIndex>
            <IconAtlas>ABILITY_ATLAS</IconAtlas>
            <PediaType>PEDIA_ATTRIBUTES</PediaType>
            <PediaEntry>Evasion (85)</PediaEntry>
        </Row>
	</UnitPromotions>
</GameData>

More of editing...
Code:
<GameData>
                <Row>
			<UnitType>UNIT_STEALTH_BOMBER</UnitType>
			<ResourceType>RESOURCE_ALUMINUM</ResourceType>
			<Cost>2</Cost>
		</Row>
         <Units>
		<Update>
                        <Where Type="UNIT_STEALTH_BOMBER"/>
			<Set>
				<Cost>850</Cost>
				<Range>32</Range>
			</Set>
		</Update>
         </Units>
       <Unit_ClassUpgrades>
		<Delete UnitType="UNIT_BOMBER" UnitClassType="UNITCLASS_STEALTH_BOMBER"/>
		<Delete UnitType="UNIT_AMERICAN_B17" UnitClassType="UNITCLASS_STEALTH_BOMBER"/>
		
	</Unit_ClassUpgrades>
</GameData>

Big thanks for LeeS, you saved me, probably few precious hours reading forums and guides (generally I don’t ask at forums, just search until find what I want)

.
 
Back
Top Bottom