Quick Modding Questions Thread

If what you want is just for a team to be able to found on water.
Then codes only need to be done under canFoundCitiesOnWater.

Not needed to use the other section.
 
Another quickie:
I have added 25 new leaders to my mod of bts. Now, annoyingly, the civilopedia "leaders" screen has become scrollable because of 2 leaders not fitting into view.
The "leaders" screen has the leaders in 3 columns, the "units" screen has units in 4 columns. The leaders would all fit into view with 4 columns

The question: What file do I need to edit in order to alter "leaders" view in civilopedia into 4 columns?
 
I think it is:
Python/Screens\CvPediaLeader

Then try looking for a 3 and fiddle till you find the right one..

If anyone cares, cvpediamain was the droid I was looking for. Lib.Spi't gave me good general direction to look at, and then it was easy to find.
 
Where do you find the great person tech bulbing preferences? I would like to edit them for my custom technologies.
 
xml/units/CIV4unitinfo.xml


This bit for great people buildings:
</GreatPeoples>
<Buildings>
<Building>
<BuildingType>BUILDING_CORPORATION_2</BuildingType>
<bBuilding>1</bBuilding>
</Building>
<Building>
<BuildingType>BUILDING_ACADEMY</BuildingType>
<bBuilding>1</bBuilding>
</Building>
<Building>
<BuildingType>BUILDING_ACADEMYV</BuildingType>
<bBuilding>1</bBuilding>
</Building>
</Buildings>
 
BUMP!

Hello and a new questions of the day.
I know how to make a unit change art based on the era (like worker changes from ancient to modern). Is there a similar way to do this for a city building? If yes - which file?
Thanks!

Anyone? If its not possible, then its not, so I will move on to other things then. =)
Thanks!
 
It is probably possible using the CIV4CityLSystem.xml file, which you can find in the Assets\XML\Buildings folder. There are a few buildings that change appearance via things in there, like the lighthouse and harbor.

Note that this is one of the two most evil XML files in the game. Any slight mistake can cause the game to crash, and it is far from clear what all the things in it do. The XML itself is also a bit more complex, making it look different.

So, for example, there is a part where the lighthouse appearance changes - it has one appearance for ancient, classical, medieval, and renaisance and then changes when you hit industrial (staying with that through the moderan and future eras too). That section looks like this:
Code:
		<ArtRef Name="building:LSYSTEM_LIGHTHOUSE">
			<Attribute Class="Era">ERA_ANCIENT,ERA_CLASSICAL,ERA_MEDIEVAL,ERA_RENAISSANCE</Attribute>
			<Attribute Class="Scalar">bNoWaterTest:1</Attribute>
			<!-- this bypasses water testing -->
			<Attribute Class="Scalar">szSpecialLayout:Water</Attribute>
			<Scale>1.5</Scale>
		</ArtRef>
		<ArtRef Name="building:LSYSTEM_LIGHTHOUSE">
			<Attribute Class="Scalar">szNIF:Art/Structures/Buildings/Lighthouse/LighthouseModern.nif</Attribute>
			<Attribute Class="Era">ERA_INDUSTRIAL,ERA_MODERN,ERA_FUTURE</Attribute>
			<Attribute Class="Scalar">bNoWaterTest:1</Attribute>
			<!-- this bypasses water testing -->
			<Attribute Class="Scalar">szSpecialLayout:Water</Attribute>
			<Scale>1.5</Scale>
		</ArtRef>
Note that the first entry does not specify a NIF, so it uses the one in the building's BuildingArtInfo entry. The second ArtRef specifies a NIF to override the appearance.

The only other specific building that uses this is the harbor. Two examples are not a lot to go on.

Some mods use this, so you can get more examples from there - they seem to mostly use it to give the buildings different appearances based on the civilization art styles rather than changing over time but there is some of that too. The "szNIF" string appears 394 times in C2C's version of Civ4CityLSystem.xml, for example.
 
I have one question about SDK, file CvUnitAl.cpp, i understand code, but int iValue, Is that help AI to choose promotion, I am look around and I think that is true, AI will choose promotion with higher iValue ?

Code:
// XXX make sure we include any new UnitAITypes...
int CvUnitAI::AI_promotionValue(PromotionTypes ePromotion)
{
	[COLOR="Red"]int iValue;[/COLOR]
	int iTemp;
	int iExtra;
	int iI;

	iValue = 0;

	if (GC.getPromotionInfo(ePromotion).isLeader())
	{
		// Don't consume the leader as a regular promotion
		return 0;
	}

	if (GC.getPromotionInfo(ePromotion).isBlitz())
	{
		if ((AI_getUnitAIType() == UNITAI_RESERVE  && baseMoves() > 1) || 
			AI_getUnitAIType() == UNITAI_PARADROP)
		{
			iValue += 10;
		}
		else
		{
			iValue += 2;
		}
	}

	if (GC.getPromotionInfo(ePromotion).isAmphib())
	{
		if ((AI_getUnitAIType() == UNITAI_ATTACK) ||
			  (AI_getUnitAIType() == UNITAI_ATTACK_CITY))
		{
			iValue += 5;
		}
		else
		{
			iValue++;
		}
	}

	if (GC.getPromotionInfo(ePromotion).isRiver())
	{
		if ((AI_getUnitAIType() == UNITAI_ATTACK) ||
			  (AI_getUnitAIType() == UNITAI_ATTACK_CITY))
		{
			iValue += 5;
		}
		else
		{
			iValue++;
		}
	}

	if (GC.getPromotionInfo(ePromotion).isEnemyRoute())
	{
		if (AI_getUnitAIType() == UNITAI_PILLAGE)
		{
			iValue += 40;
		}
		else if ((AI_getUnitAIType() == UNITAI_ATTACK) ||
			       (AI_getUnitAIType() == UNITAI_ATTACK_CITY))
		{
			iValue += 20;
		}
		else if (AI_getUnitAIType() == UNITAI_PARADROP)
		{
			iValue += 10;
		}
		else
		{
			iValue += 4;
		}
	}
...
...
...
	if (iValue > 0)
	{
		iValue += GC.getGameINLINE().getSorenRandNum(15, "AI Promote");
	}

	return iValue;
}
 
Is there a way to change the ai so that they would accept a bribe to declare war on another ai, at "pleased" relations and not requiring "friendly" relations, by the player?
 
Is there a way to change the ai so that they would accept a bribe to declare war on another ai, at "pleased" relations and not requiring "friendly" relations, by the player?

Code:
			<NoWarAttitudeProbs>
				<NoWarAttitudeProb>
					<AttitudeType>ATTITUDE_ANNOYED</AttitudeType>
					<iNoWarProb>10</iNoWarProb>
				</NoWarAttitudeProb>
				<NoWarAttitudeProb>
					<AttitudeType>ATTITUDE_CAUTIOUS</AttitudeType>
					<iNoWarProb>60</iNoWarProb>
				</NoWarAttitudeProb>
				<NoWarAttitudeProb>
					<AttitudeType>ATTITUDE_PLEASED</AttitudeType>
					<iNoWarProb>90</iNoWarProb>
				</NoWarAttitudeProb>
				<NoWarAttitudeProb>
					<AttitudeType>ATTITUDE_FRIENDLY</AttitudeType>
					<iNoWarProb>100</iNoWarProb>
				</NoWarAttitudeProb>
			</NoWarAttitudeProbs>

LeaderHeadsInfos.xml

Annoyed - 10% that AI will not declare war, Cautious - 60% that AI will not declare war, Pleased - 90% that AI will not declare war, Friendly - AI never declare war. In this case.
Just reduce value for PLEASED and FRIENDLY.

All info about modding you can see here:
http://modiki.civfanatics.com/index.php/Main_Page
 
I have one question about SDK, file CvUnitAl.cpp, i understand code, but int iValue, Is that help AI to choose promotion, I am look around and I think that is true, AI will choose promotion with higher iValue ?
Technically all this code is doing is assigning a value to promotions. It is the code that calls it that interprets the returned value and determines what to do.

Having said that the only place where this is called, in my mod anyway :), is in CVUnitAI::AI_promote, which does indeed try and add the promotion with the highest value to the unit.
 
Couple of questions (sorry if they have been asked before or are common knowledge):

1) Can I make it so Future Technology (1) is required to launch a spaceship?

2) Can I make it so any player who researches Future Technology (1) enters into a Permanent Alliance with any other player who has researched Future Technology (1)?

I've located CIV4TechInfos.xml, but I'm thinking the changes need Python changes (in addition)? The extent of my modding so far has been to make the AP and UN available without Diplomatic Victory.
- :blush:
 
Couple of questions (sorry if they have been asked before or are common knowledge):

1) Can I make it so Future Technology (1) is required to launch a spaceship?

2) Can I make it so any player who researches Future Technology (1) enters into a Permanent Alliance with any other player who has researched Future Technology (1)?

I've located CIV4TechInfos.xml, but I'm thinking the changes need Python changes (in addition)? The extent of my modding so far has been to make the AP and UN available without Diplomatic Victory.
- :blush:

Future Technology is a repeating tech which means that when you have it you still have to research it so you don't actually have it.:D If you want to use it for anything you want to happen it can't be a repeating tech, so you need to add a tech before it which is the one you add things to.
 
Future Technology is a repeating tech which means that when you have it you still have to research it so you don't actually have it.:D If you want to use it for anything you want to happen it can't be a repeating tech, so you need to add a tech before it which is the one you add things to.

Thanks for answering! :) Ah...how does it add +1 Happiness/+1 Health when researched then?
 
I think those bonuses are awarded upon researching the tech, not necessarily having the tech.
 
Technically, you can use python to check how many copies of Future Tech you have, so you do own the tech. Thus, both can be done via python.
 
Top Bottom