1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    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.
     
  2. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    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.
     
  3. meatwad4289

    meatwad4289 Prince

    Joined:
    Dec 2, 2005
    Messages:
    595
    what do you do if you are using modules?
     
  4. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    You can still put a copy of the full, non modular xml file in the appropriate folder of your mod and then edit it.
     
  5. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    I need a .cpp function to tell rank of a civ in science ranking but I found only:
    Code:
    int CvGame::getPlayerRank(PlayerTypes ePlayer) const
    Any ideas where should I look for other rankings?
     
  6. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    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.)
     
  7. topsecret

    topsecret Believer

    Joined:
    Feb 11, 2010
    Messages:
    5,633
    Gender:
    Male
    Location:
    At the Foot of the Cross
    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)
     
  8. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    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.)
     
  9. cpt.tripps.2012

    cpt.tripps.2012 Warlord

    Joined:
    May 25, 2012
    Messages:
    176
    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?
     
  10. karadoc

    karadoc AI programmer

    Joined:
    Oct 3, 2005
    Messages:
    1,568
    Location:
    Australia
    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.
     
  11. cpt.tripps.2012

    cpt.tripps.2012 Warlord

    Joined:
    May 25, 2012
    Messages:
    176
    So then how do you do a nuclear meltdown from a building? Because that is what I'm trying to do.
     
  12. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    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).
     
  13. Alrik2002

    Alrik2002 Warlord

    Joined:
    May 24, 2012
    Messages:
    214
    Location:
    Berlin, Germany
    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?
     

    Attached Files:

  14. meatwad4289

    meatwad4289 Prince

    Joined:
    Dec 2, 2005
    Messages:
    595
    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?
     
  15. dacubz145

    dacubz145 Deity

    Joined:
    Jun 21, 2010
    Messages:
    3,730
    Location:
    Windy City
    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?
     
  16. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    I'm pretty sure ERA_ALL only works with the LSystem.
     
  17. RPG

    RPG King

    Joined:
    Jan 17, 2007
    Messages:
    658
    Location:
    Cambridge
    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?
     
  18. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    32,168
    Location:
    DE/NL/FR
    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)
     
  19. RPG

    RPG King

    Joined:
    Jan 17, 2007
    Messages:
    658
    Location:
    Cambridge
    Great! I'll give it a try tonight. Thanks for the quick reply. :)
     
  20. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    I may be wrong, but when I added new features they did not appear on the map. I used Great Plains and Pangea Scripts...
     

Share This Page