View Full Version : Promotion Problems!


Ehrenia
Apr 02, 2008, 03:02 AM
Hey everyone!

I thought I'd have a fiddle with the promotions to make some a bit more worthwhile, but one in particular is giving me problems. I made it so Combat VI has it's normal effect and blitz. This works fine on units that can have blitz in the first place, but now units that cannot (like anyone on foot) do not have the option of taking this as a promotion. I thought this may be to do with the actual blitz promo, so I changed that so that any unit can take it, but that didn't fix the problem or work in itself. If I give them the promo through the Worldbuilder it's all good, so the problem is solely that they aren't allowed to take it. Any ideas? Have I missed a file?
[I'm only dealing with XMLs. Yes, I do realise that without taking the Morale promo, the blitz effect is redundant ;) Oh, and, if it matters, Combat VI still requires the unit to be led by a Great General.]

Thanks in advance, (hope this was the right place to post)
Ehrenia

Refar
Apr 02, 2008, 03:53 AM
I never tried myself. But obviously blitz will only make sense on a unit that has more than one move... Perhaps it's why it gets diabled on 1 Move units.

Ehrenia
Apr 02, 2008, 04:11 AM
Yeah, I mentioned at the end that unless you take Morale (+1 movement), then blitz is useless. But if I give them Morale and then Combat VI through the Worldbuilder, then it does work. It's just that the game won't let them take it.

Refar
Apr 02, 2008, 06:09 AM
There is a CanAquirePromotion() method in CvUnit (and some other related). If those are exposed to python - which i dont know - you could try to change them, to drop the check for having multiple moves...

Ambreville
Apr 02, 2008, 08:32 AM
I had the same problem with a promo giving multiple attacks to air units. The promo just isn't available to units that are eligible. Never figured out why.

Ehrenia
Apr 02, 2008, 12:49 PM
Refar: Sorry, I've never modded this game before and so far it is just guesswork :P How would I change this? Do I need to be able to code in Python?

Refar
Apr 02, 2008, 01:53 PM
I just took a quick look at the sdk code - never messed around with promotions myself. But...

The offending method is within CVGameCoreUtils.Cpp : bool isPromotionValid(PromotionTypes ePromotion, UnitTypes eUnit, bool bLeader)
[...]
if (GC.getUnitInfo(eUnit).getMoves() == 1)
{
if (GC.getPromotionInfo(ePromotion).isBlitz())
{
return false;
}
} It's a easy fix - just kick out that one condition. But it will require to rebuild the dll, making your mod incompartible with any other dll mod (or you will need to merge the sources and rebuild again).

From what i see, nothing helpful is exposed to python (tho i might be mistaken here).

Ehrenia
Apr 03, 2008, 01:04 PM
So I just comment out or delete that section?
How do I rebuild a dll? (Or take one apart for that matter...)

Refar
Apr 03, 2008, 02:25 PM
It's already unbuilt - the source files are within the BeyondTheSword\CvGameCoreDLL\ folder.

You can comment out the "return false" line, or the whole if block.

Rebuilding it is somewhat tricky, unless you are lucky and happen to have the same version of the MS Visual C++ Civ4 was written for (i think it's 2003) - in which case it should be quite simple...
Otherwise... Its described here...
http://forums.civfanatics.com/showthread.php?t=196283

Ehrenia
Apr 07, 2008, 02:25 AM
Well, unfortunately my computer decided to jump off a cliff, so I'll have to try this out when it's back from repairs. Grr...