requires contact

thomas.berubeg

Wandering the World
Joined
Aug 21, 2006
Messages
9,080
Location
Ft. Lauderdale
Is it possible for a building requirment to be that you have contact with a specific civ?
(if not, how would i go about doing this simply)
 
Is it possible for a building requirment to be that you have contact with a specific civ?
(if not, how would i go about doing this simply)

Easiest option is a Python block to stop anyone from building it unless they have met that civ. The "hasMet" python is something along the lines of;

Code:
if (team.isHasMet(rivalPlayer.getTeam()):

where "team" is the team of the civ trying to build the building and "rivalPlayer" is the player who controls the civilization you want to be a prereq.

"CannotConstruct" is in CvGameUtils.py.

EDIT: The whole thing is (roughly)

Code:
		if eBuilding == gc.getInfoTypeForString('BUILDING_BANNOR_EMBASSY'):
			iTeam = pPlayer.getTeam();
			iRivalTeam = -1 
			iContactCiv = gc.getInfoTypeForString('CIVILIZATION_BANNOR')
			bMet = false
			
			for iPlayer2 in range(gc.getMAX_PLAYERS()):
				pPlayer2 = gc.getPlayer(iPlayer2)
				if pPlayer2.getCivilizationType() == iContactCiv:
					if (iTeam.isHasMet(pPlayer2.getTeam()):	
						bMet = true
			
			if (!bMet):
				return True

That'll cover all cases where you've met at least one player of the civilization you set in iContactCiv.
 
I"m sorry, i don"t really know what to do after i do this... do (and how do) i need to add an XML tag? (i presume i need to modify the schema and add a tag to buildinginfo.xml
 
Vehem is talking about doing it with just Python, so no need to touch the XML. Works decently if you are only worried about doing this limit with a single building. You could add a new XML field to handle it, and that would require modification to the DLL.
 
So how would i make the building only available to one civ? (and would i need to do this repeatedly for each building i want to make Dependant?)
 
You could either put the civ specific block in C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2 032\Assets\python\CvGameUtils.py allong with the code Vehem provided (He didn't specify, but this code clearly belongs in the def cannotConstruct(self,argsList): function of this file), or you could just make it a UB like every other UB, which would mean either creating replacements for other civs or setting
Code:
<Building>
                    <BuildingClassType>BUILDINGCLASS_BANNOR_EMBASSY</BuildingClassType>
                    <BuildingType>NONE</BuildingType>
                </Building>
for all of the other civs in C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Fall from Heaven 2 032\Assets\XML\Civilizations\CIV4CivilizationInfos.xml
 
So how would i make the building only available to one civ? (and would i need to do this repeatedly for each building i want to make Dependant?)

Aye - that would work for one building requiring contact with one civ - the same thing could be repeated or possibly tidied up a little depending on what you're aiming for.

If you wanted it to be always available to just one civ, then add it as a unique building to that civ. If it's supposed to be a unique building, making it a "Wonder" will restrict it in that respect.

===

If you're wanting to do a series of buildings for each civ that other civs can build after meeting them (Carnivals requiring meeting the Balseraphs, Forges requiring meeting the Dwarves etc) then you can do it by repeating, but a DLL approach would be better.

Python is good for a one shot effect, DLL is better for anything you could feasibly reuse for something else.
 
If you're wanting to do a series of buildings for each civ that other civs can build after meeting them (Carnivals requiring meeting the Balseraphs, Forges requiring meeting the Dwarves etc) then you can do it by repeating, but a DLL approach would be better.

Python is good for a one shot effect, DLL is better for anything you could feasibly reuse for something else.


that's what i"m aiming for... but i would have no idea where to start with the DLL (not being able to do much more than xml...)

guess i"ll have to give that up, as i have no time... :sad:

unless xienwolf added that tag to his modcomp:mischief:
 
that's what i"m aiming for... but i would have no idea where to start with the DLL (not being able to do much more than xml...)

guess i"ll have to give that up, as i have no time... :sad:

unless xienwolf added that tag to his modcomp:mischief:

It could definitely be done entirely in Python, but DLL/XML would be better.

As far as the tag is concerned, it'd be best served as a "must have a relationship of +X", where that relationship is only possible after meeting them.

A tag along the lines of

Code:
<PrereqForeignRelations>
	<PrereqForeignRelation>
		<Civilization>CIVILIZATION_BALSERAPH</Civilization>
		<MinRelation>3</MinRelation>
	</PrereqForeignRelation>
	<PrereqForeignRelation>
		<Civilization>CIVILIZATION_BANNOR</Civilization>
		<MinRelation>3</MinRelation>
	</PrereqForeignRelation>
</PrereqForeignRelations>

would allow for a "Festival of Arms" - a martial competition/spectacle inspired by elements the Balseraph and Bannor cultures.


More simply, having just one PrereqForeignRelation would cover things like you originally suggested.

Interesting idea - just needs a bit of thought to develop.
 
the reason i was asking was for a civ composed of merchants.they would not be able to build most units, the only one being a trade caravan, a unit that has the Hero promotion, and can complete a trade mission (like the great merchant). the amount of caravans would be limited.

however, when they meet a civ, they can build an embassy of that civ, and through that embassy, they can build a certain amount of Units that are unique to the embassy's civ (monks for elohim, chanters for amurite, etc...)
 
Hmmm, this reminds me... is there a simple way to shut off messages pertaining to Civs you haven't met yet? For example, seeing "A player has cast Revelry" and "Lucian has been killed" early on in the game sort of ruins a lot of the suspense regarding what nasty AI civs are lurking on that other continent.
 
Hmmm, this reminds me... is there a simple way to shut off messages pertaining to Civs you haven't met yet? For example, seeing "A player has cast Revelry" and "Lucian has been killed" early on in the game sort of ruins a lot of the suspense regarding what nasty AI civs are lurking on that other continent.

It'd be a DLL check - a fairly simple one, but still involves DLL work.
 
Top Bottom