dirty bombs in Middle Ages?

sirrogue2

Chieftain
Joined
Jul 25, 2013
Messages
17
Just had this happen during a long game - see screenshot for details.

Basically, it appears that a spy destroyed one of my improvements. Not a big deal, it happens. But then I see that the area has been contaminated by nuclear fallout! How does a spy use a dirty bomb in the Middle Ages? Is this just a bugged description? Can it be fixed?

Current running SVN build 8358.
 

Attachments

  • WTF dirty bomb in middle ages.jpg
    WTF dirty bomb in middle ages.jpg
    446.9 KB · Views: 151
It's possible that the nuclear spy promotion isn't set properly regarding the tech prereqs. And then again, its possible that there's a whole hose of other explanations. It MIGHT help to see the savegame... I'd have to lock onto the spy that causes this effect and really evaluate the heck out of him and if I could do that I might have a shot. So if you find this would happen the same round reliably and you have a save where I could hit the button and this effect always takes place, then I might be able to zero in on the issue.
 
I found a problem like this and fixed it in R2R for patch 0.4.

The issue I found was caused by a combination of 2 things:
1) The "dirty bomb" effect is enabled by the "bAmphib" being set to 1 in a promotion since the advanced espionage mod that was incorporated re-uses promotion tags for other things when the spy has the promotion.
2) Spys can not normally get the regualr Amphibious promotion since it is not available to their unitcombat. But promotions can be given to a unit in Python regardless of whether or not they are normally allowed for that unit. The Amphibious promotion is given out as one of the possible free promotions in the Python\DancingHoskuld\InitMilitaryPromos.py file's onUnitBuilt function. The only restrictions it applies are a check for the domain type (land, water, air) and a check for a list of unit types that doesn't get any free promotions in there (things in a list of settler and worker types or a hero type unit). Any other unit can get any promotion that it gives out.

So a spy can, at random, get some promotions that it is not supposed to have, giving it the ability to do a variety of missions long before they are supposed to be available due to the way they re-use tags for thigns other than the original effect.

So the fix is to modify Python\DancingHoskuld\InitMilitaryPromos.py such that it will not give out any promotions to units that have a unitcombat of UNITCOMBAT_SPY. The C2C version of this file already switched to checking against a list of unitcombat types instead of a list of unit types, so you can just add the spy unitcombat to the list.
 
A check for canAcquirePromotion would always be the easiest way to make rules like this unbreakable. It's how its done in the dll and should be reflected in Python. Pretty sure canAcquirePromotion should be available there.

Thanks for the spot GE!

@DH: I believe this is in your court when you return from hiatus.
 
There is an canAcquirePromotion method available in python. This is probably better than the exclusion list I added when converting this mod to C2C. I look when I get back.
 
Top Bottom