Unique Units - Great Generals

Liath

Chieftain
Joined
Mar 7, 2014
Messages
3
Location
Weimar, Germany
I have a question concerning the replacement of Great Generals through unique units for each nation.

I successfully managed to to do so for all the other Great People (Artists, Spies, Scientists, ect.) so that the show unique unit graphics and nation-specific names for each nation (Da Vinci, Michelangelo = Rome, Goethe, Schiller = Germany, etc.) but I don't succeed to do so for the Great Generals.

Any ideas?

Thanks!
 
Firaxis apparently did not expect people to create unique Great Generals, so they just give you the base unit without checking for unique replacements. Unfortunately, you have to edit the DLL to fix this.

This is the fix by edead I am using, it goes into CvPlayer::setCombatExperience():
Code:
                    // edead: start unit class fix for Great Generals
					int iI;
					for (iI = 0; iI < GC.getNumUnitInfos(); iI++)
					{
						if (GC.getUnitInfo((UnitTypes)iI).getLeaderExperience() > 0 || GC.getUnitInfo((UnitTypes)iI).getLeaderPromotion() != NO_PROMOTION)
						{
							break;
						}
					}
					UnitTypes eGreatGeneralType = ((UnitTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits((UnitClassTypes)(GC.getUnitInfo((UnitTypes)iI).getUnitClassType()))));
					pBestCity->createGreatPeople(eGreatGeneralType, false, true);
					setCombatExperience(getCombatExperience() - iExperienceThreshold);
					/* Leoreth: original code, replaced by edead's adjustment to achieve unique GGs
					int iRandOffset = GC.getGameINLINE().getSorenRandNum(GC.getNumUnitInfos(), "Warlord Unit Generation");
					for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
					{
						UnitTypes eLoopUnit = (UnitTypes)((iI + iRandOffset) % GC.getNumUnitInfos());
						if (GC.getUnitInfo(eLoopUnit).getLeaderExperience() > 0 || GC.getUnitInfo(eLoopUnit).getLeaderPromotion() != NO_PROMOTION)
						{
							pBestCity->createGreatPeople(eLoopUnit, false, true);
							setCombatExperience(getCombatExperience() - iExperienceThreshold);
							break;
						}
					}*/
 
You're welcome!

You will have to familiarize yourself with compiling the DLL which is certainly the greatest hurdle for any beginning modder. There are some guides in the tutorials section. Other than that, it's just copy and paste :)
 
If you are not able to modify the dll, I think that there is an alternative method.

For that, you would have to:

1) use the UnitArtStyleTypeInfo to have the different unit graphic instead of creating a new unit

2) use Platyping's mod component "Civ Specific Great People Name" to have their specific names
 
Just type some codes when GG born to replace it...
 
I think it is better to make use of the naming mechanism already present in the DLL if at all possible. Keeping track of already used names is kind of tedious in Python.
 
There's no problem of that kind with the "Civ Specific Great People Name" mod component.
 
Back
Top Bottom