How do you restrict techs and civics by civ?

jefmart1

Prince
Joined
Aug 16, 2005
Messages
463
If you wanted to have a civ or civs that had different civics and technology from the rest of the civs, how would do that?

ie a separate tech tree and resulting civics.
 
If you wanted to have a civ or civs that had different civics and technology from the rest of the civs, how would do that?

ie a separate tech tree and resulting civics.

There are a few ways you can do it. The easiest way is just to add them as 'DisableTechs' attributes in the CIV4CivilizationInfos.xml file.
 
There are a few ways you can do it. The easiest way is just to add them as 'DisableTechs' attributes in the CIV4CivilizationInfos.xml file.


I had a similar question -- but I am terrible at modding so I need (if at all possible) a more step-by-step outline to do this.

For example, all I really do with mods is play on the Earth 18 Civ map, but change up which Civs are present (in the notepad file) at the start of the game and do some monkeying around with the World Builder from time to time.

What I'd love to be able to do is put in the Native American tribes, but restrict their ability to advance past a certain point (to make it more historically accurate and harder if you play as one of those).

Is there a way to do this for someone with as little modding skill as I possess? :)

If so, how? Thanks!
 
Code:
		<DisableTechs>
				<DisableTech>
					<TechType>TECH_THING_LAW</TechType>
					<bDisableTech>1</bDisableTech>
				</DisableTech>
				<DisableTech>
				<TechType>TECH_ETRUSCAN_HERITAGE</TechType>
					<bDisableTech>1</bDisableTech>
				</DisableTech>
			</DisableTechs>

Each civ will have a <DisableTechs> section. Just add in the ones you want disabled similar to the example above.

If it worked those techs will show up with a red background in the tech tree.

For civics the approach I used was to give civs certain free techs, which cannot be researched by others, and use that as the <techprereq>. You can download the RFRE alpha mod if you want to see all of the code.
 
Code:
		<DisableTechs>
				<DisableTech>
					<TechType>TECH_THING_LAW</TechType>
					<bDisableTech>1</bDisableTech>
				</DisableTech>
				<DisableTech>
				<TechType>TECH_ETRUSCAN_HERITAGE</TechType>
					<bDisableTech>1</bDisableTech>
				</DisableTech>
			</DisableTechs>

Each civ will have a <DisableTechs> section. Just add in the ones you want disabled similar to the example above.

If it worked those techs will show up with a red background in the tech tree.

For civics the approach I used was to give civs certain free techs, which cannot be researched by others, and use that as the <techprereq>. You can download the RFRE alpha mod if you want to see all of the code.


Thanks for the response:)

Just one question...when you say "Each Civ will have a <DisableTechs> section", does that mean in the Notepad file of the scenario? Or is it in another folder/world builder?

Thanks again!
 
Actually, the best method for disabling civics by civ would be do use the CannotDoCivic function in python. Just a thought.

Aussie_Lurker.
 
What I've done is have a set of base techs that are disabled making so you have to inherit that tech. Then you can add the base tech as a And prereq. Hope that makes sence. If it dosent I'll go into more detail.
 
Just one question...when you say "Each Civ will have a <DisableTechs> section", does that mean in the Notepad file of the scenario? Or is it in another folder/world builder?

Thanks again!

in assets/xml/civilizations/civ4civilizationsinfo.xml

AFAIK techs can only be given in the worldbuilder. There is nothing in there which could disable them.

XML is friendlier to edit. Map problems almost always result in the game bombing, and then you are left to try to figure out what is wrong.. If you do edit the map outside of worldbuilder, keep successful copies and use some sort of "diff" program to debug problems.
 
What I've done is have a set of base techs that are disabled making so you have to inherit that tech. Then you can add the base tech as a And prereq. Hope that makes sence. If it dosent I'll go into more detail.

Thank you all for the help...I'm starting to get somewhere with this. Sorry I'm so newbish with the modding questions, I appreciate all your help and patience.

I like your idea Thunder. If I'm understanding this right...If I disable a couple key techs early in the game, that will prevent the civs from branching out to new technologies in the future unless they are given the banned techs in trades? This might be what I'm looking for since I'm playing on the 18 Civ earth map (though I modified it so there are only 9 civs or so at a time) and I'd like to keep the Native American tribes behind technilogically while Europe, Asia and Africa develop.

If I'm understanding everyone right, if I go into the notepad file of the scenario (not sure if that is XML?) and put under the Native American Civ's <DisableTech>XYZ (whatever techs I choose -- this will work.

My last question (hopefully) is: where in the line of code do I enter that info? For example, right now I have this for the Egyptians:

BeginPlayer
Team=0
LeaderType=LEADER_HATSHEPSUT
LeaderName=Hatshepsut
CivDesc=Egyptian Empire
CivShortDesc=Egypt
CivAdjective=Egyptian
FlagDecal=Art/Interface/TeamColor/FlagDECAL_EyeOfRa.dds
WhiteFlag=0
CivType=CIVILIZATION_EGYPT
Color=PLAYERCOLOR_YELLOW
ArtStyle=ARTSTYLE_MIDDLE_EAST
PlayableCiv=1
MinorNationStatus=0
StartingGold=0
StartingX=69, StartingY=37
StateReligion=
StartingEra=ERA_ANCIENT
CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_DESPOTISM
CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_BARBARISM
CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_TRIBALISM
CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_PAGANISM
Handicap=HANDICAP_NOBLE
EndPlayer

Where would I enter the disabled techs? Or, would it be entered in the lines of code above this detailing each civ's starting techs? (This is the one for the Egyptians):

BeginTeam
Tech=TECH_THE_WHEEL
Tech=TECH_AGRICULTURE
ContactWithTeam=0
RevealMap=0
EndTeam

Thanks again to everyone for helping me understand this:)
 
Why not just download a mod that does it and see where they put them? For example, I know the European Empires 3 mod (EE3) does this. It's probably on the second page of the "Modpacks" forum. Sorry I don't actually know the answer, but this will get you there.
 
Another alternative might be to simply create a new Trait that gives a massive research hit or Commerce hit (-75%) or something like that. This would keep them very backwards tecnologicaly and could be assigned to specific Civs. It also dosn't require any modifications outside of XML and is very easily tweaked.
 
Thank you all for the help...I'm starting to get somewhere with this. Sorry I'm so newbish with the modding questions, I appreciate all your help and patience.

I like your idea Thunder. If I'm understanding this right...If I disable a couple key techs early in the game, that will prevent the civs from branching out to new technologies in the future unless they are given the banned techs in trades? This might be what I'm looking for since I'm playing on the 18 Civ earth map (though I modified it so there are only 9 civs or so at a time) and I'd like to keep the Native American tribes behind technilogically while Europe, Asia and Africa develop.

If I'm understanding everyone right, if I go into the notepad file of the scenario (not sure if that is XML?) and put under the Native American Civ's <DisableTech>XYZ (whatever techs I choose -- this will work.

My last question (hopefully) is: where in the line of code do I enter that info? For example, right now I have this for the Egyptians:

BeginPlayer
Team=0
LeaderType=LEADER_HATSHEPSUT
LeaderName=Hatshepsut
CivDesc=Egyptian Empire
CivShortDesc=Egypt
CivAdjective=Egyptian
FlagDecal=Art/Interface/TeamColor/FlagDECAL_EyeOfRa.dds
WhiteFlag=0
CivType=CIVILIZATION_EGYPT
Color=PLAYERCOLOR_YELLOW
ArtStyle=ARTSTYLE_MIDDLE_EAST
PlayableCiv=1
MinorNationStatus=0
StartingGold=0
StartingX=69, StartingY=37
StateReligion=
StartingEra=ERA_ANCIENT
CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_DESPOTISM
CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_BARBARISM
CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_TRIBALISM
CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_PAGANISM
Handicap=HANDICAP_NOBLE
EndPlayer

Where would I enter the disabled techs? Or, would it be entered in the lines of code above this detailing each civ's starting techs? (This is the one for the Egyptians):

BeginTeam
Tech=TECH_THE_WHEEL
Tech=TECH_AGRICULTURE
ContactWithTeam=0
RevealMap=0
EndTeam

Thanks again to everyone for helping me understand this:)

There is no way to block techs in the scenario file alone. You will need to create a mod to do what you want. The easiest way to do it would be in the Civ4CivilizationInfos.xml file as Mr Stew recommendaed.
 
Another possibility-as I suggested above-might be to do the following in the python file CvGameInterface.py:

Code:
def cannotResearch(argsList):
                ePlayer = argsList[0]
	        eTech = argsList[1]
	        pPlayer = gc.getPlayer(ePlayer)

	if eTech == gc.getInfoTypeForString('TECH_FEUDALISM'):
		if (pPlayer.getCivilizationType() != gc.getInfoTypeForString('CIVILIZATION_EGYPT'):
			return True

Oh, and if this is the best way to do it, then please don't thank me for the info-as it all comes from Kael's truly elegant Python code (I'm suprised you didn't suggest it Kael ;) ).

Aussie_Lurker.
 
Back
Top Bottom