 |
|
Co-Owner/ Administrator (Reasonable One)
Lord of the Ferrets
|
Nov 1999 time: 12:44
| |
|
|
Or if the barbs take out the other two civs, it might kill the fun of it. But at least you'd get an early victory.
|
|
|  |
 |
|
Prince
|
Oct 2002 time: 19:44
| |
|
|
Could be a mod. No Great Wall but you'll get XP and Great General points as normal.
|
|
|  |
 |
|
Prince
|
Oct 2002 time: 19:44
| |
|
|
And.... Voilą!
I quote Snoopy's solution in there:
quote: Originally posted by snoopy369
Hmm, it's not directly in python ... here's where it's defined in the code:
code: if (isDead() || pDefender->isDead())
{
if (isDead())
{
iExperience = defenseXPValue();
iExperience = ((iExperience * iAttackerStrength) / iDefenderStrength);
iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));
pDefender->changeExperience(iExperience, maxXPValue(), !isBarbarian(), pPlot->getOwnerINLINE() == pDefender->getOwnerINLINE());
}
else
{
iExperience = pDefender->attackXPValue();
iExperience = ((iExperience * iDefenderStrength) / iAttackerStrength);
iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));
changeExperience(iExperience, pDefender->maxXPValue(), !pDefender->isBarbarian(), pPlot->getOwnerINLINE() == getOwnerINLINE());
}
break;
}
The !pDefender->isBarbarian() returns FALSE if it's a barbarian and TRUE if it's not; this determines if XP is given to the GG or not.
If you were to change the !pDefender->isBarbarian (and the !isBarbarian) to TRUE or 1 or whatever, it would always give GG experience. This is separate from the max XP issue which is easier to fix in the XML. As a side note, it looks like setting the max XP to -1 will make it maxint automatically, according to setExperience() later on.
The changeExperience is exposed to python:code:
CyUnit::changeExperience(int iChange, int iMax, bool bFromCombat, bool bInBorders)
This gives a unit experience iChange, up to a maximum xp level iMax, and applies that to the GG experience if bFromCombat is true, and applies the Great Wall bonus if bInBorders is true (or any other Border related bonus to GG points).
More directly, you have:
code:
void CyPlayer::changeCombatExperience(int iChange)
void CyPlayer::setCombatExperience(int iExperience)
The first adds (or subtracts!) GG experience points by amount iChange (but does not affect a particular unit); the latter sets the XP to a particular level. This is used extensively in the Genghis Khan mod in Warlords if you want to see some examples of how it's used, just search for it in the events file in that mod's python folder. |
I haven't tried it myself yet even I should have a looong time ago
|
|
|  |
 |
|
Technical Assistant
Of the Peanuts Gallery
|
Apr 2004 time: 12:44
| |
|
|
They are limited in the units, definitely; it is set in the XML files (in the UNITCLASS file). They have to be set to be allowed as barbs, and they have to be set to a particular AI option (I don't recall which).
Back before Barbs were allowed Spearmen, I modded spearmen in as barbs, but it's been a while...
|
|
|  |
 |
|
Technical Assistant
Of the Peanuts Gallery
|
Apr 2004 time: 12:44
| |
|
|
quote: Originally posted by Jaybe
Barb units are restricted in the file Civilizations/CIV4CivilizationInfos.xml.
The l |
| |
|
|