[AoE] Few question, modifying py-files

Teskal

Chieftain
Joined
May 13, 2013
Messages
43
I found this mod few days ago.
First thanks for every modder who ever did work on this FFH2 and later versions and to the modders who still do it!


I'm checking in the moment how to modify the game, myself. Mostly to make it little less difficult.
1. I love the ancient city ruins, dungeons, graveyards which can be searched and destroyed. Could someone tell me how I can modify the PY-files so they get destroyed with a smaller chance?

2. If I do understand it correct, the spell handled in CvSpellInterface.py and what is in the spoiler does handle it, now.
(The script in the spoiler I do not understand in the moment)

Can I still change the chances what effect will happen if I explore a lair?
I would prefer less negative effects. :)

Spoiler :


##### MARNOK LAIRS

### Replaces the original spell req (was heavy python)
def reqExploreLair(caster):

gc = CyGlobalContext()
if caster.isOnlyDefensive(): return False
if caster.getUnitCombatType() == getInfoType('UNITCOMBAT_SIEGE'): return False
if caster.isBarbarian(): return False
if not caster.getMasterUnit().isNone(): return False
if caster.getSpecialUnitType() == getInfoType('SPECIALUNIT_SPELL'): return False
if caster.getSpecialUnitType() == getInfoType('SPECIALUNIT_BIRD'): return False
pPlot = caster.plot()
pPlayer = gc.getPlayer(caster.getOwner())
if not pPlayer.isHuman():
eBarbCiv = gc.getImprovementInfo(pPlot.getImprovementType()).getSpawnUnitCiv()
eBarbTeam = -1
if (eBarbCiv == Civ["Barbarian (Demon)"] and not CyGame().isOption(GameOptionTypes.GAMEOPTION_NO_DEMONS)):
eBarbTeam = gc.getDEMON_TEAM()
elif (eBarbCiv == Civ["Barbarian (Animal)"] and not CyGame().isOption(GameOptionTypes.GAMEOPTION_NO_ANIMALS)):
eBarbTeam = gc.getANIMAL_TEAM()
elif (eBarbCiv == Civ["Barbarian (Orc)"] and not CyGame().isOption(GameOptionTypes.GAMEOPTION_NO_BARBARIANS)):
eBarbTeam = gc.getORC_TEAM()
if not pPlot.isWater():
pCapital = pPlayer.getCapitalCity()
if pCapital.isNone():
return False
elif (plotDistance(caster.getX(), caster.getY(), pCapital.getX(), pCapital.getY()) < 20):
if (pCapital.plot().getNumDefenders(caster.getOwner()) < 6):
return False
else:
pNearestCity = CyMap().findCity(caster.getX(), caster.getY(), -1, caster.getTeam(), False, False, -1, -1, pCapital, False)
if not pNearestCity.isNone():
if (plotDistance(caster.getX(), caster.getY(), pNearestCity.getX(), pNearestCity.getY()) < 20):
if (pNearestCity.plot().getNumDefenders(caster.getOwner()) < 4):
return False
if not (eBarbTeam == -1):
if not gc.getTeam(pPlayer.getTeam()).isAtWar(eBarbTeam):
return False
return True

I tried also other changing settings in CustomFunctions.py and CvSpellInterface.py, but was not really succesful.

3. Is there a technology necessary to use money to speed up the production of a building or unit? I can't find out how to do it. (Black Imperator mentioned in another thread it would be civ specific if it is possible...)
 
Well, in AoE (in Rife more exactly), we moved the lair system from python to xml.
Everything you want is in the GoodyInfo.xml file in Assets/XML/GameInfo

You'll get a list of Lair results looking like this :

Spoiler :
<GoodyInfo>
<Type>GOODY_MARNOK_EARTHMANA</Type>
<GoodyClasses>
<GoodyClass>
<GoodyClassType>GOODYCLASS_BIG_GOOD</GoodyClassType>
<bGoodyClass>1</bGoodyClass>
</GoodyClass>
</GoodyClasses>
<iWeight>1</iWeight>
<Description>TXT_KEY_GOODY_MARNOK_MANA</Description>
<Sound/>
<iDestroyLairChance>90</iDestroyLairChance>
<iGold>0</iGold>
<iGoldRand1>0</iGoldRand1>
<iGoldRand2>0</iGoldRand2>
<iMapOffset>0</iMapOffset>
<iMapRange>0</iMapRange>
<iMapProb>0</iMapProb>
<BonusType>BONUS_MANA_EARTH</BonusType>
<iExperience>0</iExperience>
<PromotionAdds>
<Promotion>PROMOTION_EARTH1</Promotion>
</PromotionAdds>
<bAnyPromotion>1</bAnyPromotion>
<iHealing>0</iHealing>
<iDamagePrereq>0</iDamagePrereq>
<bTech>0</bTech>
<bBad>0</bBad>
<UnitClass>NONE</UnitClass>
<BarbarianClass>UNITCLASS_EARTH_ELEMENTAL</BarbarianClass>
<BarbarianCivilization>CIVILIZATION_DEMON</BarbarianCivilization>
<iBarbarianUnitProb>10</iBarbarianUnitProb>
<iMinBarbarians>1</iMinBarbarians>
<PrereqEra>ERA_CLASSICAL</PrereqEra>
</GoodyInfo>


To decrease the chance of a lair being destroyed, just decrease the value of iDestroyLairChance (keep it between 0 and 100).

To decrease the chance of a given result, decrease the value of iWeight ( same thing, keep it between 0 and 100).
 
Thanks, I will test it. Do I need only to restart Civ4 or even start a new game?

There is a promotion I do not understand: Promote Unit (Forfeit promotion for level)
If I do understand it correct I get a new Level but no new 'skills', but if so, I'm not sure why it is good.
 
i think restarting will be enough, it's not something that's in the save files

as for the forfeit promotion, in a few cases, you have a unit that requires a certain level for something but has no promotion to get (and thus cannot get to the level, as the unit levels up after taking a promo, not when getting the required xp). The Forfeit promotion is to allow units with no available promos to level up
 
I just got the ability to catch animals. In previous games I could never kill a Pegasus. I have just found out, I cannot catch it, too. It always fled aways. But I can catch or kill it, or not?

I transformed elephants into war elephants, they can also build terrain enhancements like camps, is this an error (needed to report)? Interesting it is that I got no message that the camp will also give me a bonus for the arctic deer, which I normally get if I hold my mouse over such a square with normal workers.

What does the promotion 'spirit guide' do exactly? The short description is sadly not helping.
 
Pegasi have a high widrawal chance but can be caught.
As for the elephant thing, it is a bug, i'm looking into it at the moment.

Spirit guide doesn't do anything for the unit that gets it, but when a unit with the promo dies, some of its xp will be given to another unit of the player ( becoming an actual spirit guiding the new unit)
 
Top Bottom