ModModder's Guide

Okay, here Imma, this ought to work. The corresponding promos for iron and mithril are left as an exercise for the reader. =)

You might try reducing the promotionduration to 0. That might give Bronze Weapons immediately or it might have the same effect as 1, or it might wipe out life as we know it. Only one way to find out.

Code:
		<PromotionInfo>		<!-- Forging Bronze Weapons -->
			<Type>PROMOTION_FORGING_BRONZE_WEAPONS</Type>
			<Description>TXT_KEY_PROMOTION_FORGING_BRONZE_WEAPONS</Description>
			<bAutoAcquire>1</bAutoAcquire>
			<bNoXP>1</bNoXP>
			<iPromotionDuration>1</iPromotionDuration>
			<BonusPrereq>BONUS_COPPER</BonusPrereq>
			<UnitCombats>
				<UnitCombat>
					<UnitCombatType>UNITCOMBAT_COMMANDER</UnitCombatType>
					<bUnitCombat>1</bUnitCombat>
				</UnitCombat>
			</UnitCombats>
			<PromotionDegradesTo>
				<Promotion>PROMOTION_BRONZE_WEAPONS</Promotion>
			</PromotionDegradesTo>
		</PromotionInfo>	

		<PromotionInfo>		<!-- Bronze Weapons -->
			<Type>PROMOTION_BRONZE_WEAPONS</Type>
			<PromotionExcludes>
				<Promotion>PROMOTION_FORGING_BRONZE_WEAPONS</Promotion>
			</PromotionExcludes>
		</PromotionInfo>

Edit: noticed this was on a new page. Make sure you read my last post too, Imma.
http://forums.civfanatics.com/showthread.php?p=9561128#post9561128

Edit again: Also, this will probably work for Great Commanders, allowing them to promote weapons in the field, which is an unintended consequence. If you wanted, you could also make this promo require the Influence promo, so it would be limited to Fort Commanders.
 
thx for help :)

but i've solved the problem a diferent (and perhaps more complicated) way.
I've given the Fort Commanders <iTier>4 and <iWeaponTiermax>3 and I've changed("forceOverwriten") the <PrereqInCity> in the Bronze,Iron and Mithrilpromotions with <PrereqInBorders>. It works, but I dont know whether it causes Problems
 
Actually, it probably would allow the weapons. It does not bypass Resource/Building/Feature/Terrain/Etc requirements, but it does bypass unitcombat, civ, unit, etc requirements. I'm fairly sure that weapon tier would be amongst the second group, that is bypassed.

Also, your "Fort Commanders can't attack" line will be wrong soon. :p They are being leashed with a range of 0; Can't move, but they WILL be able to attack one tile out.
 
Actually, it probably would allow the weapons. It does not bypass Resource/Building/Feature/Terrain/Etc requirements, but it does bypass unitcombat, civ, unit, etc requirements. I'm fairly sure that weapon tier would be amongst the second group, that is bypassed.

Also, your "Fort Commanders can't attack" line will be wrong soon. :p They are being leashed with a range of 0; Can't move, but they WILL be able to attack one tile out.

Not to mention that you can give bannor's fort commanders mobility. :mischief: But that's probably an exploitive bug.
 
First off: Didn't notice the new page. :p

Okay, here Imma, this ought to work. The corresponding promos for iron and mithril are left as an exercise for the reader. =)

You might try reducing the promotionduration to 0. That might give Bronze Weapons immediately or it might have the same effect as 1, or it might wipe out life as we know it. Only one way to find out.

Code:
		<PromotionInfo>		<!-- Forging Bronze Weapons -->
			<Type>PROMOTION_FORGING_BRONZE_WEAPONS</Type>
			<Description>TXT_KEY_PROMOTION_FORGING_BRONZE_WEAPONS</Description>
			<bAutoAcquire>1</bAutoAcquire>
			<bNoXP>1</bNoXP>
			<iPromotionDuration>1</iPromotionDuration>
			<BonusPrereq>BONUS_COPPER</BonusPrereq>
			<UnitCombats>
				<UnitCombat>
					<UnitCombatType>UNITCOMBAT_COMMANDER</UnitCombatType>
					<bUnitCombat>1</bUnitCombat>
				</UnitCombat>
			</UnitCombats>
			<PromotionDegradesTo>
				<Promotion>PROMOTION_BRONZE_WEAPONS</Promotion>
			</PromotionDegradesTo>
		</PromotionInfo>	

		<PromotionInfo>		<!-- Bronze Weapons -->
			<Type>PROMOTION_BRONZE_WEAPONS</Type>
			<PromotionExcludes>
				<Promotion>PROMOTION_FORGING_BRONZE_WEAPONS</Promotion>
			</PromotionExcludes>
		</PromotionInfo>

Edit: noticed this was on a new page. Make sure you read my last post too, Imma.
http://forums.civfanatics.com/showthread.php?p=9561128#post9561128

Edit again: Also, this will probably work for Great Commanders, allowing them to promote weapons in the field, which is an unintended consequence. If you wanted, you could also make this promo require the Influence promo, so it would be limited to Fort Commanders.

That won't work at all, actually, as Fort Commanders are typically SIEGE, not COMMANDER. :p

Far simpler to open it to all unitcombats (there are siege, arcane, a single commander) and have it require Influence.

I tried but I can't wrap my head around it sadly. I know what I want it to look like but there is just no manual answering the all important question: What do the numbers stand for?

Those numbers are weightings, how much they like the terrain/feature/whatever.

Typically, keep values between -2 and 2 is good; Keep higher values for special things, usually.
 
That won't work at all, actually, as Fort Commanders are typically SIEGE, not COMMANDER. :p

Far simpler to open it to all unitcombats (there are siege, arcane, a single commander) and have it require Influence.

A simple change. Should work with that change and I would think it's far preferrable to force-overwriting the weapon promotions, but I guess that's just me.
 
Those numbers are weightings, how much they like the terrain/feature/whatever.

Typically, keep values between -2 and 2 is good; Keep higher values for special things, usually.
So if I wanted to say: Absolutely not near the coast I would say: COASTAL_START, -10?
And that would work?

In that case I guess it is something like this:
Code:
if gc.getInfoTypeForString("CIVILIZATION_PPQ") != -1:
		pCivFlavourInfo = CivFlavourInfo("CIVILIZATION_PPQ")
		pCivFlavourInfo.addPreference("COASTAL_START", -10)
		pCivFlavourInfo.addPreference("TERRAIN_GRASS", 3)
		pCivFlavourInfo.addPreference("TERRAIN_PLAINS", 1)
		pCivFlavourInfo.addPreference("TERRAIN_DESERT", -4)
		pCivFlavourInfo.addPreference("TERRAIN_TUNDRA", -4)
		pCivFlavourInfo.addPreference("FEATURE_FOREST", 1)
		pCivFlavourInfo.addPreference("PLOT_HILLS", 1)
		pCivFlavourInfo.addPreference("BONUS_MANA", 1)
		pCivFlavourInfo.addPreference("BONUS_CORN", 1)
		pCivFlavourInfo.addPreference("BONUS_RICE", 1)
		pCivFlavourInfo.addPreference("BONUS_WHEAT", 1)
		pCivFlavourInfo.addPreference("RIVERSIDE", 1)
		civFlavourInfos[pCivFlavourInfo.civ] = pCivFlavourInfo

Now correct me if I am wrong but this should be equal to:

1. Not coastal
2. A high preference for grasslands (so I expect them to start on mostly grassland tiles)
3. A slight preference for plains (a lesser substitute for grasslands but still preferred)
4. Extremely high dislike for Tundra and Desert (low yield tiles are a no)
5. A slight increase in nearby forests (What does 1 stand for? 20%, 50%? 10000%? Ideally we are talking just about 10-20% more forested. Much less than the elves but still more than ordinary civs.)
6. A slight increase in nearby hills (What does 1 stand for? 20%, 50%? 10000%? Ideally we are talking just about 10-20% more hills. Much less than the dwarves but still more than ordinary civs.)
7. Chance of starting near Mana, Wheat, Corn or Rice (Does this mean that there is a chance to start with all 3? Or one of the 3? Or, well what?)
6. A slight preference for rivers (What does 1 stand for? 20%, 50%? 10000%? Ideally we are talking just a bit more rivers, sort of like the perfect food start. Much less than the Lizards but still more than ordinary civs.)

Now that sounds good in theory but with no way of testing it.
For example, I don't know if +1 on the hills and forests is too much. I don't want to make them mountain/forest dwellers, just ensure that they don't start in an empty plane with no hammers. Or is the dislike for Tundra and Desert needed or do all normal civs have it by default already?

If not, I am going to make it from scratch again.
 
So if I wanted to say: Absolutely not near the coast I would say: COASTAL_START, -10?
And that would work?

In that case I guess it is something like this:
Code:
if gc.getInfoTypeForString("CIVILIZATION_PPQ") != -1:
		pCivFlavourInfo = CivFlavourInfo("CIVILIZATION_PPQ")
		pCivFlavourInfo.addPreference("COASTAL_START", -10)
		pCivFlavourInfo.addPreference("TERRAIN_GRASS", 3)
		pCivFlavourInfo.addPreference("TERRAIN_PLAINS", 1)
		pCivFlavourInfo.addPreference("TERRAIN_DESERT", -4)
		pCivFlavourInfo.addPreference("TERRAIN_TUNDRA", -4)
		pCivFlavourInfo.addPreference("FEATURE_FOREST", 1)
		pCivFlavourInfo.addPreference("PLOT_HILLS", 1)
		pCivFlavourInfo.addPreference("BONUS_MANA", 1)
		pCivFlavourInfo.addPreference("BONUS_CORN", 1)
		pCivFlavourInfo.addPreference("BONUS_RICE", 1)
		pCivFlavourInfo.addPreference("BONUS_WHEAT", 1)
		pCivFlavourInfo.addPreference("RIVERSIDE", 1)
		civFlavourInfos[pCivFlavourInfo.civ] = pCivFlavourInfo

Now correct me if I am wrong but this should be equal to:

1. Not coastal
2. A high preference for grasslands (so I expect them to start on mostly grassland tiles)
3. A slight preference for plains (a lesser substitute for grasslands but still preferred)
4. Extremely high dislike for Tundra and Desert (low yield tiles are a no)
5. A slight increase in nearby forests (What does 1 stand for? 20%, 50%? 10000%? Ideally we are talking just about 10-20% more forested. Much less than the elves but still more than ordinary civs.)
6. A slight increase in nearby hills (What does 1 stand for? 20%, 50%? 10000%? Ideally we are talking just about 10-20% more hills. Much less than the dwarves but still more than ordinary civs.)
7. Chance of starting near Mana, Wheat, Corn or Rice (Does this mean that there is a chance to start with all 3? Or one of the 3? Or, well what?)
6. A slight preference for rivers (What does 1 stand for? 20%, 50%? 10000%? Ideally we are talking just a bit more rivers, sort of like the perfect food start. Much less than the Lizards but still more than ordinary civs.)

But I don't know if +1 on the hills and forests is too much. I don't want to make them mountain/forest dwellers, just ensure that they don't start in an empty plane with no hammers.

Yes, that would work. You seem to not quite understand how it works though... It does not change terrain. It does not change features. It does not change resources.

It simply evaluates each start based on what's there, and then picks the civ based on how it fits their preferences. So your questions on #5,6,7,8 are completely off; They'll simply prefer to start near that item. If they do or not depends on the starts available.

As for your #4... Unless there is a specific reason to avoid Tundra and Desert, do not add that malus. Simply saying "Low yield is bad" is not enough, as it is also bad for other civs but they do not avoid it.
 
Yes, that would work. You seem to not quite understand how it works though... It does not change terrain. It does not change features. It does not change resources.

It simply evaluates each start based on what's there, and then picks the civ based on how it fits their preferences. So your questions on #5,6,7,8 are completely off; They'll simply prefer to start near that item. If they do or not depends on the starts available.
I know, but it is easier for me to picture it as creating a new field with the ideal preferences, than matching it to existing ones and selecting the closest match. And it's way easier to describe it like that.

So I was essentially asking the question:
What does this ideal field look like? And did I get it right. As in, does the description match the code.


As for your #4... Unless there is a specific reason to avoid Tundra and Desert, do not add that malus. Simply saying "Low yield is bad" is not enough, as it is also bad for other civs but they do not avoid it.
The desert thing is simply because I don't want them to be placed dead center in pangeatic maps. And the fact that I find it hard to imagine creating a society of men made of straw in an environment where each and every one of them will be a fire waiting to happen. And the fact that deserts generally don't hold grain resources.


The tundra thing will be removed.
 
So like this:
Code:
if gc.getInfoTypeForString("CIVILIZATION_PPQ") != -1:
		pCivFlavourInfo = CivFlavourInfo("CIVILIZATION_PPQ")
		pCivFlavourInfo.addPreference("COASTAL_START", -10)
		pCivFlavourInfo.addPreference("TERRAIN_GRASS", 3)
		pCivFlavourInfo.addPreference("TERRAIN_PLAINS", 1)
		pCivFlavourInfo.addPreference("TERRAIN_DESERT", -1)
		pCivFlavourInfo.addPreference("FEATURE_FOREST", 1)
		pCivFlavourInfo.addPreference("PLOT_HILLS", 1)
		pCivFlavourInfo.addPreference("BONUS_MANA", 1)
		pCivFlavourInfo.addPreference("BONUS_CORN", 1)
		pCivFlavourInfo.addPreference("BONUS_RICE", 1)
		pCivFlavourInfo.addPreference("BONUS_WHEAT", 1)
		pCivFlavourInfo.addPreference("RIVERSIDE", 1)
		civFlavourInfos[pCivFlavourInfo.civ] = pCivFlavourInfo
 
Thanks. I can't wait to play my first game with the race. And you have just put me a huge step forward.

PS. Has anyone noticed I am yet to reveal the name of the race?
 
Wasn't sure if you wanted these kept out of the thread, but you don't seem to be too upset with Purple Cube Guy posting it here, so if you don't mind I'll do the same:

Code:
if gc.getInfoTypeForString("CIVILIZATION_MYU") != -1:
	pCivFlavourInfo = CivFlavourInfo("CIVILIZATION_MYU")
	pCivFlavourInfo.addPreference("BONUS_GEMS", 4)
	pCivFlavourInfo.addPreference("PLOT_HILLS", 2)
	pCivFlavourInfo.addPreference("BONUS_MANA", 1)
	pCivFlavourInfo.addPreference("FEATURE_JUNGLE", -1)
	pCivFlavourInfo.addPreference("BONUS_HORSE", -1)
	civFlavourInfos[pCivFlavourInfo.civ] = pCivFlavourInfo
 
Is there any good guide on the CIV4LeaderHeadInfos? I am currently making my leaders and the file seems to control all their behavior. So I would not want to end up with someone psychotic.
 
I'm trying to convert a python mod with py popups to be modular.
For the popups I have to change the CvScreensInterface.py file.
Is this file modular or can it be made modular?
 
No screen file is modular, and they cannot be made modular.

Rather, they probably could be, given enough work at it (very different from the current modular python), but they will not be. I have no interest in making those files modular, far too easy to screw them up.

So in your case, you'll have to modify the core file.
 
ok, that means i have to make the popup via event - i did it bevore but then the mod couldnt be enabled and disabled (for the same save) without problems, but it would be modular at least...
 
Top Bottom