Unique Civics

Well found that the pedia and advisor both don't display favorite civics (+favorite religion in pedia) anymore. I'll check later to see what I've messed up, quickly made a civic up for babylon and they happy adopted it (copied a civic but changed tech require, added text + added to civ) and no errors so everything seems to be ok other than the display bug.
 
Fixed the Bug fail error on game start, got it displayng favorite civics. Well kind of as it crashs on meeting a civ sometimes (i think only the civs with a UC but have to check)
 
Crashs happened in normal BTS just after that last post but a reboot fixed it, not had anymore crashs since then. The pedia still only shows this

Spoiler :


Any ideas on where I've missed something?
 
I had and checked the pythonErr log and found the bug error. Now it displaying everything but the civics shown are wrong. In fact it seems to just show a random civic as even unique civics are shown (and not one the Leaders can always use)
 
Fixed everything but in doing so I've some how made it so the new unique civics i made don't show up for the civs (the old ones still do). Checked the xml files and can't tell what i've missed doing (esp since one of them worked pre-fixing the pedia, added the last one after fixing it and thats when i noticed it had broken the other one I added)

*edit*

They show up in the pedia fine, but for some reason aren't linked to the civs they should be.
Spoiler :

PHP:
		<CivilizationInfo>
			<Type>CIVILIZATION_AZTEC</Type>
			<Description>TXT_KEY_CIV_AZTEC_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_AZTEC_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_AZTEC_ADJECTIVE</Adjective>
			<Civilopedia>TXT_KEY_CIV_AZTEC_PEDIA</Civilopedia>
			<DefaultPlayerColor>PLAYERCOLOR_GREEN</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_AZTEC</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_SOUTH_AMERICA</ArtStyleType>
			<UnitArtStyleType>UNIT_ARTSTYLE_SOUTH_AMERICA</UnitArtStyleType>
			<bPlayable>1</bPlayable>
			<bAIPlayable>1</bAIPlayable>
			<Cities>
				<City>TXT_KEY_CITY_NAME_TENOCHTITLAN</City>
				<City>TXT_KEY_CITY_NAME_TEOTIHUACAN</City>
				<City>TXT_KEY_CITY_NAME_TLATELOLCO</City>
				<City>TXT_KEY_CITY_NAME_TEXCOCO</City>
				<City>TXT_KEY_CITY_NAME_TLAXCALA</City>
				<City>TXT_KEY_CITY_NAME_CALIXTLAHUACA</City>
				<City>TXT_KEY_CITY_NAME_XOCHICALCO</City>
				<City>TXT_KEY_CITY_NAME_TLACOPAN</City>
				<City>TXT_KEY_CITY_NAME_ATZCAPOTZALCO</City>
				<City>TXT_KEY_CITY_NAME_TZINTZUNTZEN</City>
				<City>TXT_KEY_CITY_NAME_MALINALCO</City>
				<City>TXT_KEY_CITY_NAME_TULA</City>
				<City>TXT_KEY_CITY_NAME_TAMUIN</City>
				<City>TXT_KEY_CITY_NAME_TEAYO</City>
				<City>TXT_KEY_CITY_NAME_CEMPOALA</City>
				<City>TXT_KEY_CITY_NAME_CHALCO</City>
				<City>TXT_KEY_CITY_NAME_TLALMANALCO</City>
				<City>TXT_KEY_CITY_NAME_IXTAPALUCA</City>
				<City>TXT_KEY_CITY_NAME_HUEXOTLA</City>
				<City>TXT_KEY_CITY_NAME_TEPEXPAN</City>
				<City>TXT_KEY_CITY_NAME_TEPETLAOXTOC</City>
				<City>TXT_KEY_CITY_NAME_CHICONAUTLA</City>
				<City>TXT_KEY_CITY_NAME_ZITLALTEPEC</City>
				<City>TXT_KEY_CITY_NAME_COYOTEPEC</City>
				<City>TXT_KEY_CITY_NAME_TEQUIXQUIAC</City>
				<City>TXT_KEY_CITY_NAME_JILOTZINGO</City>
				<City>TXT_KEY_CITY_NAME_TLAPANALOYA</City>
				<City>TXT_KEY_CITY_NAME_TULTITAN</City>
				<City>TXT_KEY_CITY_NAME_ECATEPEC</City>
				<City>TXT_KEY_CITY_NAME_COATEPEC</City>
				<City>TXT_KEY_CITY_NAME_CHALCHIUITES</City>
				<City>TXT_KEY_CITY_NAME_CHIAUHITA</City>
				<City>TXT_KEY_CITY_NAME_CHAPULTEPEC</City>
				<City>TXT_KEY_CITY_NAME_ITZAPALAPA</City>
				<City>TXT_KEY_CITY_NAME_AYOTZINCO</City>
				<City>TXT_KEY_CITY_NAME_IZTAPAM</City>
			</Cities>
			<Buildings>
				<Building>
					<BuildingClassType>BUILDINGCLASS_COURTHOUSE</BuildingClassType>
					<BuildingType>BUILDING_AZTEC_SACRIFICIAL_ALTAR</BuildingType>
				</Building>
			</Buildings>
			<Units>
				<Unit>
					<UnitClassType>UNITCLASS_SWORDSMAN</UnitClassType>
					<UnitType>UNIT_AZTEC_JAGUAR</UnitType>
				</Unit>
			</Units>
			<Civics>
				<Civic>
					<CivicClassType>CIVICCLASS_SLAVERY</CivicClassType>
					<CivicType>CIVIC_RITUAL_SACRIFICE</CivicType>
				</Civic>
			</Civics>
			<FreeUnitClasses>
				<FreeUnitClass>
					<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
					<iFreeUnits>1</iFreeUnits>
				</FreeUnitClass>
			</FreeUnitClasses>
			<FreeBuildingClasses>
				<FreeBuildingClass>
					<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
					<bFreeBuildingClass>1</bFreeBuildingClass>
				</FreeBuildingClass>
			</FreeBuildingClasses>
			<FreeTechs>
				<FreeTech>
					<TechType>TECH_MYSTICISM</TechType>
					<bFreeTech>1</bFreeTech>
				</FreeTech>
				<FreeTech>
					<TechType>TECH_HUNTING</TechType>
					<bFreeTech>1</bFreeTech>
				</FreeTech>
			</FreeTechs>
			<DisableTechs/>
			<InitialCivics>
				<CivicType>CIVIC_DESPOTISM</CivicType>
				<CivicType>CIVIC_BARBARISM</CivicType>
				<CivicType>CIVIC_TRIBALISM</CivicType>
				<CivicType>CIVIC_DECENTRALIZATION</CivicType>
				<CivicType>CIVIC_PAGANISM</CivicType>
			</InitialCivics>
			<Leaders>
				<Leader>
					<LeaderName>LEADER_MONTEZUMA</LeaderName>
					<bLeaderAvailability>1</bLeaderAvailability>
				</Leader>
			</Leaders>
			<DerivativeCiv>CIVILIZATION_AMERICA</DerivativeCiv>
			<CivilizationSelectionSound>AS3D_AZTEC_SELECT</CivilizationSelectionSound>
			<CivilizationActionSound>AS3D_AZTEC_ORDER</CivilizationActionSound>
		</CivilizationInfo>
		<CivilizationInfo>
			<Type>CIVILIZATION_BABYLON</Type>
			<Description>TXT_KEY_CIV_BABYLON_DESC</Description>
			<ShortDescription>TXT_KEY_CIV_BABYLON_SHORT_DESC</ShortDescription>
			<Adjective>TXT_KEY_CIV_BABYLON_ADJECTIVE</Adjective>
			<Civilopedia>TXT_KEY_CIV_BABYLON_PEDIA</Civilopedia>
			<DefaultPlayerColor>PLAYERCOLOR_MIDDLE_PURPLE</DefaultPlayerColor>
			<ArtDefineTag>ART_DEF_CIVILIZATION_BABYLON</ArtDefineTag>
			<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
			<UnitArtStyleType>UNIT_ARTSTYLE_MIDDLE_EAST</UnitArtStyleType>
			<bPlayable>1</bPlayable>
			<bAIPlayable>1</bAIPlayable>
			<Cities>
				<City>TXT_KEY_CITY_NAME_BABYLON</City>
				<City>TXT_KEY_CITY_NAME_AKKAD</City>
				<City>TXT_KEY_CITY_NAME_DUR_KURIGALZU</City>
				<City>TXT_KEY_CITY_NAME_NIPPUR</City>
				<City>TXT_KEY_CITY_NAME_BORSIPPA</City>
				<City>TXT_KEY_CITY_NAME_SIPPAR</City>
				<City>TXT_KEY_CITY_NAME_OPIS</City>
				<City>TXT_KEY_CITY_NAME_MARI</City>
				<City>TXT_KEY_CITY_NAME_SHUSHAN</City>
				<City>TXT_KEY_CITY_NAME_ESHNUNNA</City>
				<City>TXT_KEY_CITY_NAME_ELLASAR</City>
				<City>TXT_KEY_CITY_NAME_ERECH</City>
				<City>TXT_KEY_CITY_NAME_KUTHA</City>
				<City>TXT_KEY_CITY_NAME_SIRPURLA</City>
				<City>TXT_KEY_CITY_NAME_NERIBTUM</City>
				<City>TXT_KEY_CITY_NAME_ASHUR</City>
				<City>TXT_KEY_CITY_NAME_NINEVEH</City>
				<City>TXT_KEY_CITY_NAME_NIMRUD</City>
				<City>TXT_KEY_CITY_NAME_ARBELA</City>
				<City>TXT_KEY_CITY_NAME_NUZI</City>
				<City>TXT_KEY_CITY_NAME_TUTUB</City>
				<City>TXT_KEY_CITY_NAME_ARRAPKHA</City>
				<City>TXT_KEY_CITY_NAME_SHADUPPUM</City>
				<City>TXT_KEY_CITY_NAME_RAPIQUM</City>
				<City>TXT_KEY_CITY_NAME_MASHKAN_SHAPIR</City>
				<City>TXT_KEY_CITY_NAME_TUTTUL</City>
				<City>TXT_KEY_CITY_NAME_RAMADI</City>
				<City>TXT_KEY_CITY_NAME_ANA</City>
				<City>TXT_KEY_CITY_NAME_HARADUM</City>
				<City>TXT_KEY_CITY_NAME_AGRAB</City>
				<City>TXT_KEY_CITY_NAME_UQAIR</City>
				<City>TXT_KEY_CITY_NAME_GUBBA</City>
				<City>TXT_KEY_CITY_NAME_HAFRIYAT</City>
				<City>TXT_KEY_CITY_NAME_NAGAR</City>
				<City>TXT_KEY_CITY_NAME_SHUBAT_ENLIL</City>
				<City>TXT_KEY_CITY_NAME_URHAI</City>
				<City>TXT_KEY_CITY_NAME_URKESH</City>
				<City>TXT_KEY_CITY_NAME_AWAN</City>
				<City>TXT_KEY_CITY_NAME_RIBLAH</City>
				<City>TXT_KEY_CITY_NAME_TAYMA</City>
			</Cities>
			<Buildings>
				<Building>
					<BuildingClassType>BUILDINGCLASS_COLOSSEUM</BuildingClassType>
					<BuildingType>BUILDING_BABYLON_GARDEN</BuildingType>
				</Building>
			</Buildings>
			<Units>
				<Unit>
					<UnitClassType>UNITCLASS_ARCHER</UnitClassType>
					<UnitType>UNIT_BABYLON_BOWMAN</UnitType>
				</Unit>
			</Units>
			<Civics>
				<Civic>
					<CivicClassType>CIVICCLASS_BUREAUCRACY</CivicClassType>
					<CivicType>CIVIC_CODE_OF_HAMMURABI</CivicType>
				</Civic>
			</Civics>
			<FreeUnitClasses>
				<FreeUnitClass>
					<UnitClassType>UNITCLASS_SETTLER</UnitClassType>
					<iFreeUnits>1</iFreeUnits>
				</FreeUnitClass>
			</FreeUnitClasses>
			<FreeBuildingClasses>
				<FreeBuildingClass>
					<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
					<bFreeBuildingClass>1</bFreeBuildingClass>
				</FreeBuildingClass>
			</FreeBuildingClasses>
			<FreeTechs>
				<FreeTech>
					<TechType>TECH_AGRICULTURE</TechType>
					<bFreeTech>1</bFreeTech>
				</FreeTech>
				<FreeTech>
					<TechType>TECH_THE_WHEEL</TechType>
					<bFreeTech>1</bFreeTech>
				</FreeTech>
			</FreeTechs>
			<DisableTechs/>
			<InitialCivics>
				<CivicType>CIVIC_DESPOTISM</CivicType>
				<CivicType>CIVIC_BARBARISM</CivicType>
				<CivicType>CIVIC_TRIBALISM</CivicType>
				<CivicType>CIVIC_DECENTRALIZATION</CivicType>
				<CivicType>CIVIC_PAGANISM</CivicType>
			</InitialCivics>
			<Leaders>
				<Leader>
					<LeaderName>LEADER_HAMMURABI</LeaderName>
					<bLeaderAvailability>1</bLeaderAvailability>
				</Leader>
			</Leaders>
			<DerivativeCiv>CIVILIZATION_PERSIA</DerivativeCiv>
			<CivilizationSelectionSound>AS3D_BABYLON_SELECT</CivilizationSelectionSound>
			<CivilizationActionSound>AS3D_BABYLON_ORDER</CivilizationActionSound>
		</CivilizationInfo>

Thats the civilizaationinfos.xml entry, hopefully you can spot what i've missed since other than being linked to the right civ everything is fine. I even copy+pasted from the civicinfo.xml to make sure i wasn't a typo or something :)
 
Found the problem, for some reason ModularLoading messes it up, going to see if i can see why :) I just happened not to have any new leaders for America and England for it to screw them up :)

*EDIT*

Able to fix it by making the Civics module themselves (by adding them to the civilizationinfo file in the modules subfolder)
 
Could someone please, please compile (if that's the right verb) this with the latest RevDCM mod?
 
Found the problem, for some reason ModularLoading messes it up, going to see if i can see why :) I just happened not to have any new leaders for America and England for it to screw them up :)

*EDIT*

Able to fix it by making the Civics module themselves (by adding them to the civilizationinfo file in the modules subfolder)

I've been trying lately to do it myself, but as a total beginner at any modding, especially SDK, I am slowly giving up. I re-read this thread for help, then noticed I had been blind previously because I could have asked you if you could please upload your merge of UniqueCivics mod and RevDCM. So, please, could you upload it for me, and many others I bet? And did your merge work indeed in the end?
 
Hi Asaf,

I am trying to merge the Unique civics to Orbis. Have altered the XML and am working on the python and SDK stuff. I have a few questions.

1. In working with the CvTechChooser.py you have this code
Spoiler :
# Civic options
## Unique Civics (Asaf) - Start ##
for k in range( gc.getNumCivicClassInfos() ):
j = gc.getCivilizationInfo(gc.getGame().getActiveCivilizationType()).getCivilizationCivics(k)
#for j in range( gc.getNumCivicInfos() ):
## Unique Civics (Asaf) - End ##
if (gc.getCivicInfo(j).getTechPrereq() == i):
szCivicReveal = "CivicRevealButton" + str( ( i * 1000 ) + j )
screen.addDDSGFCAt( szCivicReveal, szTechRecord, gc.getCivicInfo(j).getButton(), iX + fX, iY + Y_ROW, TEXTURE_SIZE, TEXTURE_SIZE, WidgetTypes.WIDGET_HELP_CIVIC_REVEAL, i, j, False )
fX += X_INCREMENT

j = 0
k = 0


While Kael has written:
Spoiler :
# Civic options
for j in range( gc.getNumCivicInfos() ):
if (gc.getCivicInfo(j).getTechPrereq() == i):

#FfH: Modified by Kael 07/03/2009
# szCivicReveal = "CivicRevealButton" + str( ( i * 1000 ) + j )
# screen.addDDSGFCAt( szCivicReveal, szTechRecord, gc.getCivicInfo(j).getButton(), iX + fX, iY + Y_ROW, TEXTURE_SIZE, TEXTURE_SIZE, WidgetTypes.WIDGET_HELP_CIVIC_REVEAL, i, j, False )
# fX += X_INCREMENT
if (gc.getCivicInfo(j).getPrereqCivilization() == -1 or gc.getCivicInfo(j).getPrereqCivilization() == gc.getGame().getActiveCivilizationType()):
szCivicReveal = "CivicRevealButton" + str( ( i * 1000 ) + j )
screen.addDDSGFCAt( szCivicReveal, szTechRecord, gc.getCivicInfo(j).getButton(), iX + fX, iY + Y_ROW, TEXTURE_SIZE, TEXTURE_SIZE, WidgetTypes.WIDGET_HELP_CIVIC_REVEAL, i, j, False )
fX += X_INCREMENT
#FfH: End Modify

j = 0
k = 0


Am I new to this stuff, so am asking your advice. I realize some things will depend on the screen layout and stuff and am willing to experiment with it as long as someone can guide me through the decisions.

2. For the RandomEventInterface, can I just hold off on that and run in debug mode (no events) until I decide which events I want to add?

3. The Python files you mention in the spoiler below....am I correct in understanding that each of them has been changed as you describe and I would have to change the same files in my modmod GameCoreDLL folder?

Python
Spoiler :

Note that the random events functions now use civic classes instead of civics, in case you add new events.

These are the changes I made in the exposed methods to Python (I added updated Python files from the original BTS files when needed):

CyGame:
- CyGame.getForceCivicCount(CivicTypes eIndex) was replaced by CyGame.getForceCivicClassCount(CivicClassTypes eIndex)
- CyGame.isForceCivic(CivicTypes eIndex) was replaced by CyGame.isForceCivicClass(CivicClassTypes eIndex)

CyGlobalContext:
- Added CyGlobalContext.getNumCivicClassInfos()
- Added CyGlobalContext.getCivicClassInfo(CivicClassTypes eIndex)

CvCivicClassInfo (new class):
- int CvCivicClassInfo.getCivicOptionType()
- int CvCivicClassInfo.getDefaultCivicIndex()
- void CvCivicClassInfo.setDefaultCivicIndex(int i)
- int CvCivicClassInfo.getCivicPercentAnger()

CvCivicInfo:
- Added CvCivicInfo.getCivicClassType()
- Note that CvCivicInfo.getCivicPercentAnger() still exists, but its value is taken from the class info on startup.

CvCivilizationInfo:
- Added int CvCivilizationInfo.getCivilizationCivics(int i)

CvLeaderHeadInfo:
- CvLeaderHeadInfo.getFavoriteCivic() was replaced by CvLeaderHeadInfo.getFavoriteCivicClass()

CvVoteInfo:
- CvVoteInfo.isForceCivic(CivicTypes eIndex) was replaced by CvVoteInfo.isForceCivicClass(CivicClassTypes eIndex)

CvEventTriggerInfo:
- CvEventTriggerInfo.getCivic() was replaced by CvEventTriggerInfo.getCivicClass()

CvVoteSourceInfo:
- CvVoteSourceInfo.getCivic() was replaced by CvVoteSourceInfo.getCivicClass()

CyPlayer:
- Added CyPlayer.isSameCivicClassSelected(CivicTypes eCivic) - returns True if the given civic has the same class as one of the current civics
- Added CyPlayer.getCivicClassPercentAnger(CivicClassTypes eCivic) - returns percent anger for given civic class
- Added CyPlayer.getCivilizationCivicForClass(CivicClassTypes eCivic) - returns the civic type used by this player's civilization for this civic (usually will be the default civic, unless there's a UC)
- Added CyPlayer.isCivilizationCivic(CivicTypes eCivic) - returns True if the given civic is the one used by this player's civilization (not necessarily the current civic).

Do I need to add your code to the CvGame files as well? Your files have that, but you only mention the CyGame files. What is the difference between the Cv and the Cy files again?

Also...I can only find in your folder, the Game, Globalcontext and Player files. I cannot find any of the *Info files mentioned above

EDIT: I assume I do both the .h and .cpp files as well?


Thanks to anyone who can help me out.
 
Tried compiling having added the code to the .h and .app files...I figured out that the Info files were all in the same Info file...unless I missed something.

I figure the conflict I described in #1 is the cause or the event triggers. Maybe someone could take a look and let me know where to go from here? :confused:
 

Attachments

  • log.txt
    101.8 KB · Views: 89
Last two days I was busy with merging myself, thought I was doing well...
in the end many mistakes I don't know how to fix.

Although I am able to make and use a debug dll now due to the tutorial in your signature :)

But it's way too hard for me, I'd rather invest my time working so that I can pay someone else to do it for me (because nobody seemed to be interested to do it for free). I am just saying, if you can 100% succesfully merge RevDCM with this Mod, from SDK to python to XML, I am ready to reward.
 
Well I managed to do a lot of pre-work. Anyone interested in my RevDCM + UC merge? It has one major bug (the unit interface is gone, something with the Action buttons that causes an error) that I bet can be fixed by real SDK-modders - although I already am really proud that I came this far just with Asaf's guide and a lot of time/trying.
There is a lot of extra stuff in 'my RevDCM', but I never changed its SDK nor python (exception: Sevopedia interface, but nothing that affects the game) until now, so that doesn't matter if you just look over that.
Basically, I managed to merge it, I just need someone's help to fix the mistakes I made.

Send me a PM/a message here if I should upload it so that we finally have this merge with just some small extra work from an expert:)

P:S: If I look at the AIautoplay and the Sevopedia, it works totally fine already, just this interface is gone. The only other thing I expect to cause errors is if a Revolution asks you to change civics - to Free Speech for example - and you have a UC replacing Free Speech. Why? Because I only merged, I didn't edit much, so all the stuff about civics in the Revolution files is probably still about Civics instead of Civic classes.
 
Well, after quite some time I got (very close) to succesfully merging RevDCM and UC with some great help :)

If anyone is interested, here is my mod:
http://atomicgamer.com/file.php?id=103895

It has quite a few extra things added to it, but no game-altering additions (just new civs, leaders, etc.) that are easy to remove if you don't like them ;)
I will make a 'plain version' of this mod once it works perfectly; now it would be a waste of time. This merge is already playable regarding the XML and SDK, it just needs some python work. There are two documents in the zip archive that should provide some help with finding the places where some extra programming needs to be done.
So I'm not really presenting the final merge here, I'm asking for the last bit of help that is needed - after fixing the 2 bugs that are left it will work! :)

For some more information see this post/thread:
http://forums.civfanatics.com/showpost.php?p=12382857&postcount=15
 
Top Bottom