View Full Version : Fixed Mercurians and Infernals


DrPepper836
Nov 01, 2008, 01:50 PM
Recently, playing a game as Basium, I got to fed up with the way that I kept declaring war on all of the good civs to get troops, and decided to change it.

Here is what I came up with: Now, whenever a good unit gets killed, if it was a Mercurian that killed it, they get no angels! However, if the Mercurians kill an evil unit, they do get an angel, so that gives them more incentive to go after bad guys. The same thing works in reverse for the Infernals. I guess you could say that the units were converted by the sight of their glorious armies. :rolleyes:

Anyway, you can either download this (http://download194.mediafire.com/y0ewzhjmnmrg/kyiqbf2nwom/CvEventManager.py) file and put in the Assets>python folder, or replace the following code:

if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS' ) or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_OCTOPUS_OVERLORD S') or unit.isHasPromotion(gc.getInfoTypeForString('PROMO TION_DEATH1')) or unit.isHasPromotion(gc.getInfoTypeForString('PROMO TION_ENTROPY1'))):
cf.giftUnit(gc.getInfoTypeForString('UNIT_MANES'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'), 0, unit.plot(), unit.getOwner())
cf.giftUnit(gc.getInfoTypeForString('UNIT_MANES'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'), 0, unit.plot(), unit.getOwner())

if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ORDER') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORP H') or pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') ):
cf.giftUnit(gc.getInfoTypeForString('UNIT_ANGEL'), gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') , unit.getExperience(), unit.plot(), unit.getOwner())


with this code:

pAttacker = gc.getPlayer(iPlayer)

if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS' ) or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_OCTOPUS_OVERLORD S') or unit.isHasPromotion(gc.getInfoTypeForString('PROMO TION_DEATH1')) or unit.isHasPromotion(gc.getInfoTypeForString('PROMO TION_ENTROPY1'))):
if (pAttacker.getCivilizationType() != gc.getInfoTypeForString('CIVILIZATION_INFERNAL')):
cf.giftUnit(gc.getInfoTypeForString('UNIT_MANES'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'), 0, unit.plot(), unit.getOwner())
cf.giftUnit(gc.getInfoTypeForString('UNIT_MANES'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'), 0, unit.plot(), unit.getOwner())

if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ORDER') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORP H') or pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') ):
if (pAttacker.getCivilizationType() != gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') ):
cf.giftUnit(gc.getInfoTypeForString('UNIT_ANGEL'), gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') , unit.getExperience(), unit.plot(), unit.getOwner())

if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ORDER') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORP H') or pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') ):
if (pAttacker.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_INFERNAL')):
cf.giftUnit(gc.getInfoTypeForString('UNIT_MANES'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'), 0, unit.plot(), unit.getOwner())
cf.giftUnit(gc.getInfoTypeForString('UNIT_MANES'), gc.getInfoTypeForString('CIVILIZATION_INFERNAL'), 0, unit.plot(), unit.getOwner())

if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS' ) or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_OCTOPUS_OVERLORD S') or unit.isHasPromotion(gc.getInfoTypeForString('PROMO TION_DEATH1')) or unit.isHasPromotion(gc.getInfoTypeForString('PROMO TION_ENTROPY1'))):
if (pAttacker.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') ):
cf.giftUnit(gc.getInfoTypeForString('UNIT_ANGEL'), gc.getInfoTypeForString('CIVILIZATION_MERCURIANS') , unit.getExperience(), unit.plot(), unit.getOwner())

[to_xp]Gekko
Nov 01, 2008, 02:55 PM
that's exactly what I suggested a short while ago, smart changes ;)

MacGyverInSpace
Nov 01, 2008, 03:12 PM
The good are separated by the bad majority, or liberated from their corrupt commanders, and the sniveling weasels in the good armies sign away their lives to a demon...

arcticnightwolf
Nov 01, 2008, 03:15 PM
That's what I missed. In my last game Hippus (controlling 1/3 of map with total 7 players) has created Basium. And declared war on me (later all civs declared war on me). Stacks of enemy units was flowing to my cities every turn, I was slowly destroying them, but because all civs was good, Mercurians was getting couple of units every turn... I solved this by casting Blight Light (Sun2) in all my cities and not attacking back... Few turns later I gived it up, because it was unplayable. (~60 enemy unit per plot around my cities and increasing ... Blighting Light rulezzzz :D ) I just regret I didn't make some screenshots and that I didn't create Air node ... :D:D:D


Edit: Yes I was good player ... but this doesn't matter, when 6 good civs are attacking you

DrPepper836
Nov 01, 2008, 03:17 PM
I assume that you were a good player then.

CyberRoadRunner
Nov 02, 2008, 01:20 AM
Will this break save games?

I've got a game as the infernals already (getting no manes at all!)

DrPepper836
Nov 02, 2008, 10:12 AM
If you're using this mod then you won't, unfortunately. I had a lot of difficulty duplicating the circumstances of the real game in the WB, but I didn't get any errors in python, so I put it up. I started a regular game to see how it would works, and it throws an error each time. Apparently you can't call:

getCivilizationType()

from the attacker object. :sad: I'm working on it though, and should have a fixed version up in a few minutes...

Edit: Ok, it won't throw any python errors now. If you aren't getting your angels or manes, or something just happens that's weird, feel free to tell me. Also, the new version won't break the saves of the bugged version, so that's good.

CyberRoadRunner
Nov 03, 2008, 09:08 AM
Wait

Is good unit something with order/rok or unit controlled by a good civilization?

Played game-attacked Arendel Phaedra (she had fellowship of leaves)- no manes!

DrPepper836
Nov 03, 2008, 05:46 PM
They have to be of the Kilmorph, Order, or Empyrean religions, or the Mercurian civilization. I was thinking about changing it to good/evil instead, but this is really just a fix to a logic falacy, not really a modmod.

Blakmane
Nov 04, 2008, 06:01 PM
very buggy i'm afraid to say. A lot of the events from CVeventsmanager no longer work. Try building the pact of the nilhorn and you'll see what I mean.

cool idea though :)

DrPepper836
Nov 04, 2008, 07:48 PM
Really? I've been playing with python errors turned on, and I haven't gotten a single message about it yet. What does the error message say exactly?

[to_xp]Gekko
Nov 05, 2008, 01:44 AM
I play without python errors so no pop-ups. I applied these changes to FiRe! manually ( i.e. replaced just the bit of code I needed, not the whole file ) but it caused all sort of whacky behaviour. I guess I did not set the correct indentation in python? another thing that I don't quite understand is that in the cveventmanager.py file you uploaded there's no "pAttacker = gc.getPlayer(iPlayer)" before all the "if (unit.getReligion()" , or so it seems. any help would be appreciated as these changes look spot on :)

DrPepper836
Nov 05, 2008, 08:40 AM
Yeah, my file host must not have re-uploaded properly. Anyway, it should be up. Oh, and I just built PotN in my game, so no errors. You must have been playing with the download.

CyberRoadRunner
Nov 05, 2008, 09:07 AM
Will this work with other mods?

DrPepper836
Nov 05, 2008, 04:47 PM
It will, unless they modded something in the SDK that would affect the above code, or seriously altered the Mercurian/Infernal civilization to the point that their basic gameplay mechanics would be unrecognizable when compared to the current version in the regular game. However, you would have to do the code insert, and not the file download to make sure that it wouldn't override any other code that had been modded.

Blakmane
Nov 05, 2008, 10:19 PM
trying the download again, thanks =)

*edit*

download PY file itself seems to be acting strangely, isn't coming up with readable python. I'll apply the fix manually cos it's an awesome fix =D but you might want to check the download again.