Problem deleting a promotion from Unit

BARBEERIAN

Prince
Joined
Jul 21, 2006
Messages
503
Location
Ottawa, ON, Canada
Hey, I'm having a problem trying to remove a free promotion from a unit. Specifically, I'm trying to tweak the Keshik so it can melee attack, and still range attack as well. I just can't figure out how to 'properly' remove the promotion from the Keshik class.

[Note: I know I can just edit the core file and comment out the free promotion 'PROMOTION_ONLY_DEFENSIVE', but I'd prefer to do it properly as a mod so it's easier to turn on/off]
 
so it can melee attack, and still range attack as well

This sounds like a non-trivial modification. I don't think there is a single unit that behaves this way in base civ5 (?). Have you thought about how the interface will work? Right now, when you right click on an enemy unit then you get an "either-or" effect: ranged units do a ranged attack; non-ranged units close in and do a melee attack. If you want units to be able to do both, then you can't use the simple right-click method. I guess you would have to do all attacks by first pressing a "ranged" or "non-ranged" attack button for the unit, then right-click on enemy. (That would seem kind of cumbersome.)
 
I've tested via just commenting it out (the part where it gives the Keshik the 'only defensive' promo), and it simply has both the Attack and Ranged Attack icons available on the sidebar. It defaults to a ranged attack if you right click, gotta hit Ctrl-A or click the icon to manually attack.
 
Fantastic! Sorry to be so pessimistic on you...

Commenting out the line is the same as setting that line to default value (look in the schema at the top to see the default -- it's probably "NULL"). To do this properly as a mod, you can set that value to null using either XML or SQL command. Read Kael's tutorial to see how. It's a steep learning curve to do anything at first, but your change is minor and you've basically already tested it and know it should work.
 
I believe the following should work but I'm not in a position to test it right now.

Code:
<GameData>
	<Unit_FreePromotions>
		<Update>
			<Set PromotionType="NULL"/>
			<Where PromotionType="PROMOTION_ONLY_DEFENSIVE" UnitType="UNIT_MONGOLIAN_KESHIK"/>
		</Update>
	</Unit_FreePromotions>
</GameData>
 
Back
Top Bottom