1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Making Roads Produce Commerce

Discussion in 'Civ4 - Creation & Customization' started by Rodman49, Dec 29, 2009.

  1. Rodman49

    Rodman49 Chieftain

    Joined:
    Nov 3, 2005
    Messages:
    80
    So I've made my own tiny earth map with 16 civs. Problem is the starting points are not balanced at all. America, India, China, and Mongolia starting points always seem to dominate.

    To lessen their dominance I want to do the following:
    - Make the Road Improvement provide one additional commerce.
    - Make the Railroad Improvement provide an additional hammer.

    I only want this happen when I play my map. I figure that means I will need to make it a mod unless such a change can be made in the Worldbuilder save. This is for Beyond the Sword 3.19

    Thanks in advance.
    Oh yeah, here is a link for reference about the map:
    http://www.nexus-studios.org/conflict_earth/
    (Its the one in the ZIP)
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,622
    Location:
    Germany / Netherlands
    Yes, that needs a mod, because XML changes are done globally, not map dependend.

    For the route changes:
    I think it's Assets\XML\GameInfo\RouteInfo.xml.
     
  3. Rodman49

    Rodman49 Chieftain

    Joined:
    Nov 3, 2005
    Messages:
    80
    Thanks, its actually in:

    \Assets\XML\Misc\Civ4RouteInfos.xml

    Can I actually just add this:

    <YieldChanges>
    <iYieldChange>0</iYieldChange>
    <iYieldChange>0</iYieldChange>
    <iYieldChange>1</iYieldChange>
    </YieldChanges>

    And it will work?
     
  4. Rodman49

    Rodman49 Chieftain

    Joined:
    Nov 3, 2005
    Messages:
    80
    Wow, I tried doing that and Civ freaked out (testing via custom XML).

    Here is the code I used.
    Code:
    <?xml version="1.0"?>
    <!-- edited for CONFLICT EARTH -->
    <!-- edited by Paul Street on 29DEC09 -->
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <!-- Route Infos -->
    <Civ4RouteInfos xmlns="x-schema:CIV4MiscSchema.xml">
    	<RouteInfos>
    		<RouteInfo>
    			<Type>ROUTE_ROAD</Type>
    			<Description>TXT_KEY_ROUTE_ROAD</Description>
    			<iValue>1</iValue>
    			<iAdvancedStartCost>12</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMovement>30</iMovement>
    			<iFlatMovement>30</iFlatMovement>
    			<BonusType>NONE</BonusType>
    <!-- CHANGE HERE -->
    			<YieldChanges>
    				<iYieldChange>0</iYieldChange>
    				<iYieldChange>0</iYieldChange>
    				<iYieldChange>1</iYieldChange>
    			</YieldChanges>
    <!-- CHANGE HERE -->
    			<PrereqOrBonuses/>
    			<Yields/>
    			<TechMovementChanges>
    				<TechMovementChange>
    					<PrereqTech>TECH_ENGINEERING</PrereqTech>
    					<iMovementChange>-10</iMovementChange>
    				</TechMovementChange>
    			</TechMovementChanges>
    			<Button>Art/Interface/Buttons/Builds/BuildRoad.dds</Button>
    		</RouteInfo>
    		<RouteInfo>
    			<Type>ROUTE_RAILROAD</Type>
    			<Description>TXT_KEY_ROUTE_RAILROAD</Description>
    			<iValue>2</iValue>
    			<iAdvancedStartCost>18</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMovement>20</iMovement>
    			<iFlatMovement>6</iFlatMovement>
    			<BonusType>NONE</BonusType>
    <!-- CHANGE HERE -->
    			<YieldChanges>
    				<iYieldChange>0</iYieldChange>
    				<iYieldChange>1</iYieldChange>
    				<iYieldChange>1</iYieldChange>
    			</YieldChanges>
    <!-- CHANGE HERE -->			
    			<PrereqOrBonuses>
    				<PrereqOrBonus>
    					<BonusType>BONUS_COAL</BonusType>
    				</PrereqOrBonus>
    				<PrereqOrBonus>
    					<BonusType>BONUS_OIL</BonusType>
    				</PrereqOrBonus>
    			</PrereqOrBonuses>
    			<Yields/>
    			<TechMovementChanges/>
    			<Button>Art/Interface/Buttons/Builds/BuildRailroad.dds</Button>
    		</RouteInfo>
    	</RouteInfos>
    </Civ4RouteInfos>
    Any ideas?
     
  5. Jaroth

    Jaroth Chieftain

    Joined:
    Feb 6, 2009
    Messages:
    249
    Location:
    USA
    I'm not very familiar with XML, but I don't think you can just add your own tag like that.

    Especially since there is no reference to "YieldChanges" within the schema file, CIV4MiscSchema... only "Yields".

    Perhaps changing the Yields tag will add the bonus. But as The J said, it would work globally on all maps.

    Also, there are "RouteYieldChanges" tags associated with all the different terrain improvements within CIV4ImprovementInfos. You can look up the one for mines to see an example using the railroad. Maybe those will be useful to you as well.

    Also, unless you want railroads to yield 2 hammers, you should probably edit CIV4ImprovementInfos if you're adding it to CIV4RouteInfos instead.
     
  6. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,622
    Location:
    Germany / Netherlands
    Yes, it doesn't work in that way.
    But you didn't see this entry ;):
    PHP:
    <Yields/>
    I guess, if you change it to:
    PHP:
    <Yields>
        <
    iYield>0</iYield>
        <
    iYield>0</iYield>
        <
    iYield>1</iYield>
    </
    Yields>
    it should work.
    But i'm not sure, i'm not at my civ PC, can't test it, can't look at the schema.
     
  7. Tholish

    Tholish Chieftain

    Joined:
    Jul 5, 2002
    Messages:
    1,344
    Location:
    Japan
    In fact I do that in my mod

    Spoiler :
    Code:
    		<RouteInfo>
    			<Type>ROUTE_GRAVTUBE</Type>
    			<Description>GRAVTUBE</Description>
    			<iValue>6</iValue>
    			<iAdvancedStartCost>10</iAdvancedStartCost>
    			<iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
    			<iMovement>10</iMovement>
    			<iFlatMovement>3</iFlatMovement>
    			<BonusType>BONUS_COPPER</BonusType>
    			<PrereqOrBonuses>
    				<PrereqOrBonus>
    					<BonusType>BONUS_COPPER</BonusType>
    				</PrereqOrBonus>
    				<PrereqOrBonus>
    					<BonusType>BONUS_DURALLOY</BonusType>
    				</PrereqOrBonus>
    			</PrereqOrBonuses>
    			<Yields>
    				<iYield>0</iYield>
    				<iYield>0</iYield>
    				<iYield>1</iYield>
    			</Yields>
    			<TechMovementChanges/>
    			<Button>,Art/Interface/Buttons/Units/Transport.dds,Art/Interface/Buttons/FinalFrontier2_Atlas.dds,1,3</Button>
    		</RouteInfo>


    However, I prefer to make improvements more productive with routes rather than making routes directly productive. A railroad in the middle of nowhere isn't productive, even if there are lots of people around. However, if it goes through a farming region, the farms can effectively ship more grain. For this you use something like this

    Spoiler :
    Code:
    			<RouteYieldChanges>
    				<RouteYieldChange>
    					<RouteType>ROUTE_TRACK</RouteType>
    					<RouteYields>
    						<iYield>1</iYield>
    						<iYield>0</iYield>
    						<iYield>0</iYield>
    					</RouteYields>
    				</RouteYieldChange>
    				<RouteYieldChange>
    					<RouteType>ROUTE_PAVED</RouteType>
    					<RouteYields>
    						<iYield>1</iYield>
    						<iYield>0</iYield>
    						<iYield>0</iYield>
    					</RouteYields>
    				</RouteYieldChange>
    			</RouteYieldChanges>
    			<bGraphicalOnly>0</bGraphicalOnly>
    		</ImprovementInfo>
     
  8. Rodman49

    Rodman49 Chieftain

    Joined:
    Nov 3, 2005
    Messages:
    80
    Wow, awesome replies guys! Tholish and The_J - your stuff hit it right on the head!

    Jaroth I see what you mean about railroads; mines, lumbermills, and quarries would get an additional +1 hammers. I'll edit them out (just change those values to 0).

    Next question is somewhat related to this. Where do I change the text for when you highlight roads and railroads (the pop-up in the bottom left) to say that it increases commerce or hammers by one?
     
  9. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,622
    Location:
    Germany / Netherlands
    If you do that change, then it should automatically appear.
    Or do you want to change that text?
     
  10. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    The yield changes for any worker action isn't displayed, as far as I can remember. You'd have to add this functionality through the SDK. It's way more of a PITA then it would be worth IMHO. Actually you could probably bring this up in the BUG forums, and the BUG team might like the idea and implement it for you :mischief:
     
  11. Rodman49

    Rodman49 Chieftain

    Joined:
    Nov 3, 2005
    Messages:
    80
    I'm talking about when: I select a worker, and lets say I want to build a farm. So I highlight farm on the action bar at the bottom. Then in the bottom left a pop-up text with transparent background pops up and says +1:food: and -1:hammers:

    Now I want +1:commerce: to pop up when a person tries to build a road. Any ideas?

    If this requires changing an SDK then its probably too much work for something so small. I can probably just add a Civlopedia entry for it.

    Additionally is there any page with a step by step guide for making this a modular mod?
     
  12. phungus420

    phungus420 Chieftain

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Generally if it already gets displayed, as is the case with the farm building option you say, it should happen automatically, if the changes you make are in the XML, which is the case here. If not, it may not take SDK work to fix, but probably will. I know at this point I'd be looking in GameTextMgr.cpp regardless to to figure out what's going on. Though the worker action buttons could very well be part of the Python interface, I just don't know. If this were my project I'd probably start a thread on it in the BUG forums, as those guys know alot more about getting values to display in the interface then anyone else, they even know more about it then the firaxis devs at this point.
     
  13. brandon1965

    brandon1965 Chieftain

    Joined:
    May 5, 2008
    Messages:
    33
    I have the same question as the original poster. I don't understand enough about modding all the files to make this work but I would like to be able to add commerce to roads and production to railroads. If anyone has successfully done this and could upload the needed files I would greatly appreciate it. Thank you.
     
  14. Tholish

    Tholish Chieftain

    Joined:
    Jul 5, 2002
    Messages:
    1,344
    Location:
    Japan
    Here it is in mod form.
     

    Attached Files:

  15. brandon1965

    brandon1965 Chieftain

    Joined:
    May 5, 2008
    Messages:
    33
    Thank you.
     

Share This Page