Quick Modding Questions Thread

If you knew how to add the civs successfully into your mod, then isnt it just as simple to remove what you don't want?
Simply delete all those entries you do not want in the same files where you add them, unless you are using modules.

Just make sure you are editing the files in your mod folder, and not the original BTS folder.
 
Just remove the ones you don't want from the Civ4CivilizationInfos.xml. Probably best to just disable them, rather than actually deleting the entries (so you don't have to hunt down possible death references). Turning <bPlayable> off should do it.
 
You can still put a copy of the full, non modular xml file in the appropriate folder of your mod and then edit it.
 
The ranking of a civilization like what is shown on the demographics screen is calculated for that purpose in the Python for the screen.

Oddly, CvCity has rank related functions like findCommerceRateRank. CvPlayer does not, as far as I know.

So if you want to know the rankings for current science output, you should do something like:
1) loop over all civilizations and store their current output as gotten from CvPlayer::getCommerceRate(CommerceTypes eIndex) in an array
2) sort the array
3) bingo

Well, technically that is not all there is to it. You have to maintain the association between the player and the rating so there is some extra stuff to do in the sort - either store, and sort, data structures (perhaps each element in the array is itself a 2 element array of the output and player ID, for example) or sort 2 arrays in parallel, or some such thing.

If you don't need a full list of ranks, just one specific player's rank then you don't need to sort the array at all. Or, for that matter, create it in the first place. You can just look up that player's output and then loop over all the players who are not that player and count how many have a higher output. Add one to the count and that is the rank for that civ. (This will treat ties as the higher rank, so if you have 10, 9, 8, 8, 7 they will be rank 1, 2, 3, 3, 5; some ranking systems would call them 1, 2, 4, 4, 5 in which case you should count how many are higher or the same.)
 
Does anyone know how I can change the A.D. on the calender to S.A.?
(Second Age from Middle-earth, if you must know :p)
 
Does anyone know how I can change the A.D. on the calender to S.A.?
(Second Age from Middle-earth, if you must know :p)
In CIV4GameTextInfos.xml, you'll find TXT_KEY_TIME_AD and TXT_KEY_TIME_BC, and some other related strings. That's probably the best way to change it to what you want. (ie. don't change the tag names, but just change the english text to say SA instead of AD.)
 
Does anyone know how the iNukeModifier in buildingsinfos works? ie. if I set it to 100, does that mean 1 in 100 chance of blowing up?
 
Does anyone know how the iNukeModifier in buildingsinfos works? ie. if I set it to 100, does that mean 1 in 100 chance of blowing up?

iNukeModifier refers to the damage done to units in the city, and to the population lost in the city. For example, if a city is nuked and NukeModifier == -100, then units in the city will take no damager and no population will be lost. -- but the probability of buildings being destroyed is unaltered.
 
So then how do you do a nuclear meltdown from a building? Because that is what I'm trying to do.

That would be the very next tag: iNukeExplosionRand

That is the chance out of 1000 each turn that the thing will have a meltdown. Setting it higher than 1 would make the building not worth building. Even at 1, which is what the regular Nuclear Powerplant in BtS is, a lot of people won't build it (unless the benefit was huge I wouldn't, and even then probably almost never).

I assume this is for your ST mod. The current/older ST mod has a building like this. The effects are devastating, even more so than a meltdown in regular BtS. The entire planet where the building was located is permanently wiped out (just as if a Doomsday Missile was used in regular FF). The planet is rendered uninhabitable: its population max is set to 0. The graphic is even changed to be one of the star types. In theory you can still have buildings on it if they have bNukeImmune set to 1 since they are not removed if it is set, and I think it would let you build such buildings there if you could pick it as the current build planet (which you might not be able to do).
 
EDIT: It seems that the problem is, that I´ve added to many improvements. When I delete 4 other of the new improvements, it works... Any idea why that is like that and if the number can be increased?

Hi,

I´ve a strange problem that I can´t really solve. I´ve added some new improvements in my mod in a new module called "Terrain". It seems that all of them are working fine, but now I have the problem, that cottages, villages and so on are not updating anymore. Even the text in the Sevopedia, that they will update, is missing.

I found out, that, when I delete all the seabridges that I´ve added (4 at all) in the Civ4ImprovementInfos.xml, the cottages behave normal. But when I add one of the seabridges again it´s not working. Here is one example:

Code:
<ImprovementInfo>
			<Type>IMPROVEMENT_SEA_BRIDGE_NS</Type>
			<Description>TXT_KEY_IMPROVEMENT_SEA_BRIDGE</Description>
			<Civilopedia>TXT_KEY_IMPROVEMENT_SEA_BRIDGE_PEDIA</Civilopedia>
			<ArtDefineTag>ART_DEF_IMPROVEMENT_SEA_BRIDGE_NS</ArtDefineTag>
			<YieldChanges>
				  <iYieldChange>0</iYieldChange>
				  <iYieldChange>0</iYieldChange>
				  <iYieldChange>0</iYieldChange>
			</YieldChanges>
			<bActsAsCity>0</bActsAsCity>
			[COLOR="Red"]<bSeaBridge>1</bSeaBridge>[/COLOR]
			<bHillsMakesValid>0</bHillsMakesValid>
			<bFreshWaterMakesValid>0</bFreshWaterMakesValid>
			<bRiverSideMakesValid>0</bRiverSideMakesValid>
			<bNoFreshWater>0</bNoFreshWater>
			<bRequiresFlatlands>0</bRequiresFlatlands>
			<bRequiresRiverSide>0</bRequiresRiverSide>
			<bRequiresIrrigation>0</bRequiresIrrigation>
			<bCarriesIrrigation>0</bCarriesIrrigation>
			<bRequiresFeature>0</bRequiresFeature>
			<bWater>1</bWater>
			<bGoody>0</bGoody>
			<bPermanent>0</bPermanent>
			<iAdvancedStartCost>30</iAdvancedStartCost>
			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
			<iTilesPerGoody>0</iTilesPerGoody>
			<iGoodyRange>0</iGoodyRange>
			<iFeatureGrowth>0</iFeatureGrowth>
			<iUpgradeTime>0</iUpgradeTime>
			<iAirBombDefense>5</iAirBombDefense>
			<iDefenseModifier>0</iDefenseModifier>
			<iHappiness>0</iHappiness>
			<iPillageGold>15</iPillageGold>
			<bOutsideBorders>1</bOutsideBorders>
			<TerrainMakesValids>
				  <TerrainMakesValid>
					    <TerrainType>TERRAIN_COAST</TerrainType>
					    <bMakesValid>1</bMakesValid>
				  </TerrainMakesValid>
			</TerrainMakesValids>
			<FeatureMakesValids/>
			<ImprovementPillage/>
			<ImprovementUpgrade/>
			<TechYieldChanges/>
			<RouteYieldChanges/>
			<bGraphicalOnly>0</bGraphicalOnly>
</ImprovementInfo>

The red line is a new tag. The needed SDK-files are merged with the ones of my mod and the new dll seems to work fine. When I deleted the seabridges, I use the same dll and everything is ok. So I don´t think, that the dll is the problem.

I´ve also added some screenshots of the Sevopedia.

Has anyone an idea what´s wrong with the improvements?
 

Attachments

  • Civ4ScreenShot0048.JPG
    Civ4ScreenShot0048.JPG
    305.4 KB · Views: 51
  • Civ4ScreenShot0049.JPG
    Civ4ScreenShot0049.JPG
    302.9 KB · Views: 80
How do i rename the apostolic palace and the UN? I just want to change the names in the mod im making... Also rename barbarians?
 
I thought when you do music for leaders you can choose the era to be all? i did ERA_ALL and it gives me errors - maybe im misremembering?

I'm pretty sure ERA_ALL only works with the LSystem.
 
If I want to add new features to appear on the map, can I simply add the art, and xml files for it? Or do the map scripts have to be modified to add those features?
 
Zlatko said it recently somewhere: As long as the XML definitions are valid, the features should be placed on the map.
(does not apply for new terrain types)

Great! I'll give it a try tonight. Thanks for the quick reply. :)
 
Back
Top Bottom