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

Trying to mod Trading Posts

Discussion in 'Civ5 - Creation & Customization' started by Grunthex, Sep 26, 2010.

  1. Grunthex

    Grunthex Chieftain

    Joined:
    Oct 21, 2001
    Messages:
    366
    Location:
    Calgary, Canada
    Looking for a bit of advice. Seems to me my logic is solid, but I can't make it work in practice.

    I'm trying to make trading posts so they can only be built on a road or railroad, or on a riverside.

    Using the Lumbermill as inspiration, I dove into Terrain\Civ5Improvements.xml

    In that file, Lumbermills are not defined anywhere in Improvement_ValidTerrains, but they are defined in Improvement_ValidFeatures. As we know, in practice lumbermills get to be built on any forest, regardless of the terrain underneath.

    So in the Improvement_ValidFeatures table, I've tried adding the following:
    Code:
    <Row>
    			<ImprovementType>IMPROVEMENT_TRADING_POST</ImprovementType>
    			<FeatureType>ROUTE_ROAD</FeatureType>
    		</Row>
    I've also tried:
    Code:
    <Row>
    			<ImprovementType>IMPROVEMENT_TRADING_POST</ImprovementType>
    			<FeatureType>FEATURE_RIVER</FeatureType>
    		</Row>
    And just for kicks I tried both. None of it seems to work. All I've accomplished is to disable trading posts entirely. Anyone have any thoughts?
     
  2. grafflyes

    grafflyes Chieftain

    Joined:
    Sep 25, 2010
    Messages:
    3
    I hope you get it to work, I hate trading posts! why couldn't we have hamlets? WHY?!
     
  3. Cheshiremythos

    Cheshiremythos Chieftain

    Joined:
    Sep 9, 2006
    Messages:
    54
    *Disclaimer little modding skills*

    Is there a way to specify an improvement type instead of a "feature" type? Roads aren't technically features and the "featuretype" might only refer to terrain features. That being said why rivers don't work is beyond me.
     
  4. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    did you also add this;
    Code:
                    <Row>
    			<Type>IMPROVEMENT_TRADING_POST</Type>
    			<Description>TXT_KEY_IMPROVEMENT_TRADING_POST</Description>
    			<Civilopedia>TXT_KEY_CIV5_IMPROVEMENTS_TRADING_POST_TEXT</Civilopedia>
    			<ArtDefineTag>ART_DEF_IMPROVEMENT_TRADING_POST</ArtDefineTag>
                            [COLOR="Blue"]<RequiresFeature>true</RequiresFeature>[/COLOR]
    			<PillageGold>20</PillageGold>
    			<PortraitIndex>32</PortraitIndex>
    			<IconAtlas>TERRAIN_ATLAS</IconAtlas>
    		</Row>
    ?? its in the improvements.xml, the lumbermill has the same, optional tag
     
  5. Paasky

    Paasky Good News Everyone!

    Joined:
    Nov 19, 2003
    Messages:
    2,062
    Location:
    Vantaa, Finland
    ROUTE_ROAD is not a feature, so that might not work. FEATURE_RIVER is not on a tile, but between tiles, so it might not work.

    Just a hunch on what could be the problem.
     
  6. Grunthex

    Grunthex Chieftain

    Joined:
    Oct 21, 2001
    Messages:
    366
    Location:
    Calgary, Canada
    I hadn't added that, thanks for the idea! But unfortunately it didn't work.

    In the interest of trying everything, and based on the point by Paasky that roads may not be considered a feature (as they're defined as Routes), I tried creating a Table called Improvement_ValidRoutes and putting the road stuff there, but still no go.

    I also looked in some of the other tags, and found one in the farm entry called <FreshWaterMakesValid> ... that didn't work either.

    Still stumped!
     
  7. Cheshiremythos

    Cheshiremythos Chieftain

    Joined:
    Sep 9, 2006
    Messages:
    54
    Did you look at the valid terrain section of the xml? Line 385. Or the valid features section at 571? It looks like, because of the new database system (I guess?), some of the information is set up. So you might have to mark "featuremakesvalid" as true in the main trade post area and then go down to 571 to specify the feature that actually makes it valid.

    On that note I see no way of making the trade posts run along roads because there is no "improvementmakesvalid" in the code as far as I can see. Might have to wait until ModBuddy comes out to mess with lau or C++ to make that.
     
  8. Doskias51

    Doskias51 Chieftain

    Joined:
    Aug 18, 2010
    Messages:
    63
    Location:
    VIDOR, TX, USA
    I know one of the building you can build in a city requires there to be a tile adjacent to a river, maybe you can see what it has in its tags. I want to say it is a watermill building IIRC. In the meantime I will try to find it and post if I find it to help ya out.

    Well I found it pretty fast.

     
  9. Cheshiremythos

    Cheshiremythos Chieftain

    Joined:
    Sep 9, 2006
    Messages:
    54
    "RiverSideMakesValid". Make that true and see what it does. (Line 16 of civ5 improvements) Should be able to just stick that under trade post and it will be river only.

    Im not sure that the marker from buildings would work since buildings and improvements have different schemas. At least I hope they do, be really weird if they didn't.
     
  10. Aussie_Lurker

    Aussie_Lurker Warlord

    Joined:
    Jul 21, 2003
    Messages:
    7,674
    Location:
    Adelaide, South Australia
    Once the SDK is out, it should be pretty easy to add new tags like what you want.

    Speaking of which, I wonder if it will be possible to add a tag that allows improvements to *Grow*, like Cottages did in Civ4?

    Aussie.
     
  11. Baleur

    Baleur Chieftain

    Joined:
    Jul 9, 2010
    Messages:
    526
    Location:
    Qingdao, China
    Please release this on the ingame thingy if you get it to work properly, i'd LOVE it :)
    Small mini-mods like these are gems.

    I also hate how the AI builds trading posts everywhere, like the hamlets in civ4, so having them be limited to rivers or/and roads would help. (as long as the ai doesnt build roads in every tile now to support it, LOL side effect disaster)
     
  12. Cheshiremythos

    Cheshiremythos Chieftain

    Joined:
    Sep 9, 2006
    Messages:
    54
    Aussie_Lurker, I think they already have a tag for growth they just didn't use it in their own works. "Featuregrowth". Im going to try and mess with it and the improvement upgrade tag to see if I can't recreate the cottages of civ 4. Just a test of theory as I like the trade posts better anyways.
     

Share This Page