Quick Modding Questions Thread

Has anyone ever made a mod that changed how rivers work? I'd like to try making rivers run directly on the tiles, rather than in between them.
 
You should be able to accomplish most of it by turning rivers into a feature ... your only problem would be its graphics.
 
Just a small question on Unit Classes. I know I may have asked this before, but creating a new class, does not require any SDK coding, so long as I use all the same XML elements as another class. The last time I tried to create a new Unit Class in "Road to War 1.04", the game kept crashing.
 
No, creating a new UnitClass does not require SDK, although I'm not familiar with Road to War.
 
OK .. thanks for that. I am getting ready to start coding for version 2.0 of my mod and have decided to use the framework of Giant Earth Map mod. As it seems more complete, with all the extra add-ons like BUG and RevDCM etc. Plus all the new civilizations.
 
Not really a modding question, but has anyone converted Rogerbacon's amazing mods[Assassin, Always war, Kill list, 3-square radius] for vanilla into BtS?
 
How would you go about adding new tile improvements to the game?
The easiest way is to edit the Civ4ImprovementInfos.xml file of your mod. Find a similar improvement to what you want to modify and then copy the section similar to this
Spoiler :
Code:
 <ImprovementInfo>
  <Type>[B]IMPROVEMENT_FARM_NEW[/B]</Type>
  <Description>TXT_KEY_IMPROVEMENT_FARM</Description>
  <Civilopedia>TXT_KEY_IMPROVEMENT_FARM_PEDIA</Civilopedia>
  <ArtDefineTag>[B]ART_DEF_IMPROVEMENT_FARM[/B]</ArtDefineTag>
   <PrereqNatureYields>
    <iYield>1</iYield>
    <iYield>0</iYield>
    <iYield>0</iYield>
   </PrereqNatureYields>
  <IrrigatedYieldChange>
   <iYield>1</iYield>
   <iYield>0</iYield>
   <iYield>0</iYield>
  </IrrigatedYieldChange>
  <bHillsMakesValid>0</bHillsMakesValid>
  <bFreshWaterMakesValid>1</bFreshWaterMakesValid>
  <bRiverSideMakesValid>0</bRiverSideMakesValid>
  <bNoFreshWater>0</bNoFreshWater>
  <bRequiresFlatlands>1</bRequiresFlatlands>
  <bRequiresRiverSide>0</bRequiresRiverSide>
  <bRequiresIrrigation>1</bRequiresIrrigation>
  <bCarriesIrrigation>1</bCarriesIrrigation>
  <bRequiresFeature>0</bRequiresFeature>
  <bWater>0</bWater>
  <bGoody>0</bGoody>
  <bPermanent>0</bPermanent>
  <bUseLSystem>1</bUseLSystem>
  <iTilesPerGoody>0</iTilesPerGoody>
  <iGoodyRange>0</iGoodyRange>
  <iUpgradeTime>0</iUpgradeTime>
  <iAirBombDefense>5</iAirBombDefense>
  <iDefenseModifier>0</iDefenseModifier>
  <iHappiness>0</iHappiness>
  <iPillageGold>5</iPillageGold>
  <TerrainMakesValids>
   <TerrainMakesValid>
    <TerrainType>TERRAIN_GRASS</TerrainType>
    <bMakesValid>1</bMakesValid>
   </TerrainMakesValid>
   <TerrainMakesValid>
   <TerrainType>TERRAIN_PLAINS</TerrainType>
   <bMakesValid>1</bMakesValid>
   </TerrainMakesValid>
  </TerrainMakesValids>
  <FeatureMakesValids/>
  <BonusTypeStructs>
   <BonusTypeStruct>
     <BonusType>BONUS_CORN</BonusType>
     <bBonusMakesValid>1</bBonusMakesValid>
     <bBonusTrade>1</bBonusTrade>
     <iDiscoverRand>0</iDiscoverRand>
    <YieldChanges>
     <iYieldChange>2</iYieldChange>
     <iYieldChange>0</iYieldChange>
    <iYieldChange>0</iYieldChange>
   </YieldChanges>
   </BonusTypeStruct>
  </BonusTypeStructs>
  <ImprovementPillage/>
  <ImprovementUpgrade/>
  <TechYieldChanges>
   <TechYieldChange>
    <PrereqTech>TECH_BIOLOGY</PrereqTech>
    <TechYields>
     <iYield>1</iYield>
     <iYield>0</iYield>
     <iYield>0</iYield>
    </TechYields>
   </TechYieldChange>
  </TechYieldChanges>
  <RouteYieldChanges/>
  <bGraphicalOnly>0</bGraphicalOnly>
 </ImprovementInfo>
and place it next on this list. Then make changes to it. If you require new artwork as well you will then need to edit Civ4ArtDefines_Improvement.xml and create new links to your new improvements graphics
Spoiler :
Code:
<ImprovementArtInfo>
   <Type>[B]ART_DEF_IMPROVEMENT_FARM[/B]</Type>
   <bExtraAnimations>1</bExtraAnimations>
   <fScale>1.0</fScale>
   <fInterfaceScale>1.0</fInterfaceScale>
   <NIF>Art/Structures/Improvements/Farm/an_eu_farm01.nif</NIF>
   <KFM>Art/Structures/Improvements/Farm/an_eu_farm01.kfm</KFM>
   <Button>,Art/Interface/Buttons/Builds/BuildFarm.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,3,7</Button>
</ImprovementArtInfo>

You will note I have bolded ART_DEF_IMPROVEMENT_FARM in the examples above.
 
Hmm I tried doing that to make a new kind of farm, and it just seemed to overwrite the regular farm (in the game I mean, not in the XML file).
 
You will have to change
<Type>IMPROVEMENT_FARM</Type>
to a new type.

Also, you may consider changing Assets/XML/Units/CIV4BuildInfos.XML
to have a new "build" command related to the new improvement.

Then add the new "build" command to workers in CIV4UnitInfos
 
I really like the events in BTS.....with two exceptions: Vedic Aryans and Bermuda Triangle. Is it possible to mod out individual events and how do you do it?
 
You will have to change
<Type>IMPROVEMENT_FARM</Type>
to a new type.

Also, you may consider changing Assets/XML/Units/CIV4BuildInfos.XML
to have a new "build" command related to the new improvement.

Then add the new "build" command to workers in CIV4UnitInfos

Great- thank you very much!
 
I really like the events in BTS.....with two exceptions: Vedic Aryans and Bermuda Triangle. Is it possible to mod out individual events and how do you do it?

Create a new folder in your mod folder (in C:\Program Files\Firaxis games\Civ4\Bts\mods), copy the BtS\Assets\XML\Events\EventTriggerInfos.xml into BtS\Mods\YourNewMod\Assets\XML\Events, and change the value for iPercentGamesActive for both these events to 0.
They will than appear in 0% of all your games.
 
I was just modding and when I added new diplomacy sounds, the sound stopped working altogether, even the menu music. how do I fix it?
 
It's likely that you made a mistake in one of the sound XML files which caused these not to be loaded properly. Take a look into your log files to see if that's the case.
 
Is it possible to create a unit that can carry both land units and aircraft (e.g. Marine Assault ships)
 
If you can give them all the same special unit type, it should at least load them (don't specify a cargo domain). How effective the AI will be is pretty iffy. Any air units that do end up being carried should use their own unit AI (they would normally be using UNITAI_CARRIER_AIR) to at least do something, so if the carrier unit were given the UNITAI_ASSAULT_SEA unit AI type then it should itself behave like a transport to deliver the land units. It would be lacking some special purpose stuff that the aircraft carrier unit does (finding a good position to use air units from and re-triggering a "check your moves now" type thing for the carried air units at the end of its own move if it arrived at its destination) but the air units will function normally other than that if they are loaded.

The main issue, other than each unit only being able to have one special unit type (so you'd need a new air unit to be carried on the ship, perhaps a Harrier), is that the AI only makes air units with the UNITAI_CARRIER_AIR unit AI type if there are sea units with the UNITAI_CARRIER_SEA unit AI type already in existence to carry them. Because of this, the AI would have a chronic shortage of air units to put on them and it would be more or less pure luck which type of air unit it would build (regular carrier air unit or marine assault air unit).

Another issue is that there is no way to partition the unit types so say 2 air units and 2 land units. Instead, in this example, you'd get 4 units of any mix. This would be potentially abusable in that you could carry 4 marines and on the turn they unload you could re-base 4 air units onto the thing.

All of these issues could be dealt with via DLL changes, of course.
 
I think I may have a solution. Using an Assault ship graphics, I can then have it carrying AV-8 Harriers as Gunships. Just now need to find some Graphics. I don't think that the Assault Ships were designed as Anti-Air duty, i.e. being able to do air-intercept, like real carriers, the Aircraft carried were essentially Ground Support - I believe.
 
Back
Top Bottom