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

Tutorial: How to add a new Resource

Discussion in 'Civ5 - Modding Tutorials & Reference' started by Kyoss, Oct 8, 2010.

  1. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    Hi everyone, i'm finally home from work and wanted to share what i found out so far
    in the process of adding a new resource.

    Step 1: Setting up Modbuddy
    Open Modbuddy and start a new Project. Name it what you like. Now lets set up the Project. Add the following Folder Structure: Art, Lua, XML (see attached Image 1).

    Step 2: The Resources XML
    Now lets add the XML Information for the new Copper Resource. Add a File to XML/Terrain and name it "Copper.xml".
    For a reference you can open "Assets/GamePlay/XML/CIV5Resources.xml" from your Civ5 Installation folder.


    Here's the full content of the file, but i will explain each section as good as i can below:
    Spoiler :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameData>
        <Resources>
            <Row>
                <Type>RESOURCE_COPPER</Type>
                <TechReveal>TECH_MINING</TechReveal>
                <TechCityTrade>TECH_MINING</TechCityTrade>
                <AIStopTradingEra>ERA_INDUSTRIAL</AIStopTradingEra>
                <Description>TXT_KEY_RESOURCE_COPPER</Description>
                <Civilopedia>TXT_KEY_CIV5_RESOURCE_COPPER_TEXT</Civilopedia>
                <Help>TXT_KEY_RESOURCE_COPPER_HELP</Help>
                <ResourceClassType>RESOURCECLASS_RUSH</ResourceClassType>
                <ArtDefineTag>ART_DEF_RESOURCE_IRON</ArtDefineTag>
                <ArtDefineTagHeavy>ART_DEF_RESOURCE_IRON_HEAVY</ArtDefineTagHeavy>
                <AltArtDefineTag>ART_DEF_RESOURCE_IRON_MARSH</AltArtDefineTag>
                <AltArtDefineTagHeavy>ART_DEF_RESOURCE_IRON_HEAVY_MARSH</AltArtDefineTagHeavy>
                <AITradeModifier>10</AITradeModifier>
                <ResourceUsage>1</ResourceUsage>
                <PlacementOrder>1</PlacementOrder>
                <AIObjective>1</AIObjective>
                <ConstAppearance>100</ConstAppearance>
                <MinAreaSize>3</MinAreaSize>
                <MaxLatitude>90</MaxLatitude>
                <RandApp1>10</RandApp1>
                <RandApp2>10</RandApp2>
                <Player>100</Player>
                <Hills>true</Hills>
                <Flatlands>true</Flatlands>
                <NoRiverSide>true</NoRiverSide>
                <IconString>[ICON_RES_COPPER]</IconString>
                <PortraitIndex>0</PortraitIndex>
                <IconAtlas>CUSTOM_RESOURCE_ATLAS</IconAtlas>
            </Row>
        </Resources>
        <Resource_YieldChanges>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <YieldType>YIELD_PRODUCTION</YieldType>
                <Yield>1</Yield>
            </Row>
        </Resource_YieldChanges>
        <Resource_Flavors>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <FlavorType>FLAVOR_OFFENSE</FlavorType>
                <Flavor>10</Flavor>
            </Row>
        </Resource_Flavors>
        <Resource_TerrainBooleans>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <TerrainType>TERRAIN_GRASS</TerrainType>
            </Row>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <TerrainType>TERRAIN_PLAINS</TerrainType>
            </Row>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <TerrainType>TERRAIN_DESERT</TerrainType>
            </Row>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <TerrainType>TERRAIN_TUNDRA</TerrainType>
            </Row>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <TerrainType>TERRAIN_SNOW</TerrainType>
            </Row>
        </Resource_TerrainBooleans>
        <Resource_QuantityTypes>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <Quantity>3</Quantity>
            </Row>
            <Row>
                <ResourceType>RESOURCE_COPPER</ResourceType>
                <Quantity>2</Quantity>
            </Row>
        </Resource_QuantityTypes>
        <Language_en_US>
            <Row Tag="TXT_KEY_RESOURCE_COPPER">
                <Text>Copper</Text>
                <Gender>neuter:an</Gender>
            </Row>
            <Row Tag="TXT_KEY_RESOURCE_COPPER_HELP">
                <Text>Used for Units.</Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER">
                <Text>Copper</Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER_TEXT">
                <Text>
                    Copper, as native copper, is one of the few metals to occur naturally as an un-compounded mineral. Copper was known to some of the oldest civilizations on record, and has a history of use that is at least 10,000 years old. 
                </Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER_TITLE1">
                <Text>Technology Required to See</Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER_TITLE2">
                <Text>Location</Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER_TITLE3">
                <Text>Improvement</Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER_TITLE4">
                <Text>Yield Bonus</Text>
            </Row>
            <Row Tag="TXT_KEY_CIV5_RESOURCE_COPPER_TITLE5">
                <Text>Allows</Text>
            </Row>
        </Language_en_US>
        <Improvement_ResourceTypes>
            <Row>
                <ImprovementType>IMPROVEMENT_MINE</ImprovementType>
                <ResourceType>RESOURCE_COPPER</ResourceType>
            </Row>
        </Improvement_ResourceTypes>
        <IconFontMapping>
            <Row>
                <IconName>ICON_RES_COPPER</IconName>
                <IconMapping>10</IconMapping>
            </Row>
        </IconFontMapping>
    </GameData>


    2.1) The <Resources> Block
    Thats pretty much copied from one of the standard resources ingame. Some Parameters here explained:

    <Type>RESOURCE_COPPER</Type>
    Thats our reference for the new resource, and we will use this several times

    <TechReveal>TECH_MINING</TechReveal>
    Self-explanatory, this is the Technology you need to see the Resource on the Map

    <TechCityTrade>TECH_MINING</TechCityTrade>
    This is the Technology from which on you will see the Resource in the TopPanel.

    <ResourceClassType>RESOURCECLASS_RUSH</ResourceClassType>
    Strategic Resources have either RESOURCECLASS_RUSH or RESOURCECLASS_MODERN here, i haven't figured out the real difference. I would guess the AI will try to settle immediately near a RESOURCECLASS_RUSH if possible.

    <IconString>[ICON_RES_COPPER]</IconString>
    The String you can use in CivPedia entries to reference this Resource and show a tiny icon next to the text (see part 6).

    <IconAtlas>CUSTOM_RESOURCE_ATLAS</IconAtlas>
    The IconAtlas the game should use (a bunch of icons) when trying to display this resource. Since we won't use the basic IconAtlas, we reference a new one.

    <PortraitIndex>0</PortraitIndex>
    The index of the Icon in the IconAtlas of this Resource.

    And last but not least <ResourceUsage>1</ResourceUsage>
    None of the standard Resources have this set, but a Strategic Resource needs "1" here. Haven't tried adding luxury resources, but i think they need 4. Everything else is just a Bonus Resource (as Sheep).


    2.2) The <Resource_YieldChanges> Block
    Here we specify, what additonal Yields a plot gets, when this resource is added. We add 1 Production for Copper.


    2.3) The <Resource_Flavors> Block
    Here we specify the Flavor of the Resource. Not sure if this is used ingame, but lets just add the same flavor that Iron has.


    2.4) The <Resource_TerrainBooleans> Block
    This specifies on which Terrains the Resource can appear. Currently the game totally ignores those values, but please add them anyway, cause a modular approach (which will surely come soon), will need those values.


    2.5) The <Resource_QuantityTypes> Block
    Same as 2.4 -> Ignored by the game so far. This should specify in which quantities the Resource Can Appear on the Map (depending on your settings "Abundant", "Balanced" or "Sparse" in the Advanced Game Options when starting a game). Only Strategic Resources need this block.

    This ends our <Resources> Block. I added the following blocks into the "Copper.xml" for easier reference. I also like when all parts of one added element can be put in one file.


    2.6) The <Language_en_US> Block
    Here we define the Text Keys for the ingame reference. You might want to add translations for other languages here, e.g. Language_de_DE or even more, so more people can use the mod.


    2.7) The <Improvement_ResourceTypes> Block
    This is an excerpt from /Assets/Gameplay/XML/Terrain/Improvements.xml and specifies which Improvement can be built on our Resource. For Copper we choose a mine.

    2.8) The <IconFontMapping> Block
    This specifies, which Icon in the FontMapping should be used, whenever we enter [ICON_RES_COPPER] into Text Keys, so the game knows which Icon it should use. Lets set this to 10, which is the Iron Icon (see Step 6 for more info)

    Thats for the XML Part, but dont forget:

    2.9) Add the newly added XML to the Mod Properties
    In Modbuddy Rightclick on "CopperMod" in the Solution Explorer and select "Properties". We now have to tell the game to use the new XML file when the Mod gets loaded.

    In the properties, go to the Tab "Actions" and add the following:
    OnModActivated | UpdateDatabase | XML/Terrain/Copper.xml
    (you probably know this from Kaeels guide, look it up there to see how it works)


    Step 3: The Icon Files
    Now lets generate the Icon File. The readme.txt in "Sid Meiers Civilization 5 SDK/Art/" says we need four dds files for a Resource. 256, 80, 64 and 45.

    How to create a dds with Adobe Photoshop
    Spoiler :
    If you have Adobe Photoshop go to http://developer.nvidia.com/object/photoshop_dds_plugins.html and download the plugin. Install it, and run Photoshop (but not in 64bit mode, the dds plugin doesnt work in 64bit).

    Now create a new image in 256x256 and draw your new Icon, press CTRL+a (to select it). Open the IconAtlas256.psd with Photoshop and copy (CTRL+v) it onto the stage. Drag it in the top left slot.
    It doesnt matter if you drag it ON the black circle-raster. Try to align it to the middle of the cut-out circle in the top left.

    Merge the Topmost Layer (your image) with the next one (Rightclick on your Layer and Select -> Merge Down). Now use "File->Save As" and save it as .dds file.
    A Nvidia Window will pop up: Select DXT3 in the topmost Dropdown, "2D Texture" below and "No Mipmaps" on the right side. Save it.

    Repeat those steps for all 4 IconAtlases until you have 4 dds file.


    When you have your 4 dds-files, drag&drop them into ModBuddy in our /Art/IconAtlas Folder. I named them ResourceAtlas256.dds, ResourceAtlas80.dds, ResourceAtlas64.dds and ResourceAtlas45.dds

    I know the Icon doesnt really look that good, i'm no real artist.. It was more of a proof-of-concept than real Art.

    Step 4: The IconAtlas File
    Now add a new XML File to our XML Folder and call it CopperIconAtlas.xml

    Here's the contents:
    Spoiler :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <GameData>
        <IconTextureAtlases>
            <Row>
                <Atlas>CUSTOM_RESOURCE_ATLAS</Atlas>
                <IconSize>256</IconSize>
                <Filename>ResourceAtlas256.dds</Filename>
                <IconsPerRow>8</IconsPerRow>
                <IconsPerColumn>8</IconsPerColumn>
            </Row>
            <Row>
                <Atlas>CUSTOM_RESOURCE_ATLAS</Atlas>
                <IconSize>80</IconSize>
                <Filename>ResourceAtlas80.dds</Filename>
                <IconsPerRow>8</IconsPerRow>
                <IconsPerColumn>8</IconsPerColumn>
            </Row>
            <Row>
                <Atlas>CUSTOM_RESOURCE_ATLAS</Atlas>
                <IconSize>64</IconSize>
                <Filename>ResourceAtlas64.dds</Filename>
                <IconsPerRow>8</IconsPerRow>
                <IconsPerColumn>8</IconsPerColumn>
            </Row>
            <Row>
                <Atlas>CUSTOM_RESOURCE_ATLAS</Atlas>
                <IconSize>45</IconSize>
                <Filename>ResourceAtlas45.dds</Filename>
                <IconsPerRow>8</IconsPerRow>
                <IconsPerColumn>8</IconsPerColumn>
            </Row>
        </IconTextureAtlases>
    </GameData>

    Its quite self-explanatory too. We tell the game which dds Files it should use for the different Icon sizes. An IconAtlas (usually) exists of 8 Rows of 8 Icons each, making a total of 64 Icons possible per Atlas.


    4.1) Add the newly added XML to the Mod Properties
    As in 2.9 add a new Action to your Mods properties:
    OnModActivated | UpdateDatabase | XML/CopperIconAtlas.xml


    Step 5: The Lua Files
    5.1): AssignStartingPlots.lua
    So far we would have the Resource Ingame, and the Resource plus correct Icons shown in the CivPedia, but the Resource will not be distributed on the map... so ... we have to change AssignStartingPlots.lua.
    In this file the resources get scattered on the map. Sadly this is hardcoded in Lua, does not reference to anything we set in our XML file and cannot be modded via XML.
    For now, just download the attached "AssignStartingPlots.lua" file and add it to our "Lua" folder. If you want to know what i changed in there, compare the new File to the original one.

    (I hope SamBC wil come up with a modular solution, or someone else for that matter, because if things stay as they are, Resource-Mods will NOT be compatible with each other).

    Now our Resource gets scattered on the Map. But whats that? The description does say "Copper" but it has the Icon of Iron on the worldmap....lets fix that.

    5.2): ResourceIconManager.lua
    Again this file is not modular, but i found out how to make it so. Hardcoded they all use the same texture, which means we can't load our Custom IconAtlas and thats bad.

    Below is the code explained, but you can download the ResourceIconManager.lua in the attachement.
    Spoiler :
    Code:
    -- Added by Kyoss
    if GameInfo.Resources[ResourceType].IconAtlas ~= "RESOURCE_ATLAS" then 
    [COLOR="DarkGreen"]-- means if the Resource is NOT using the default IconAtlas, then[/COLOR]
       --get right Texture Atlas
       local customAtlas = false;
       for iTA in GameInfo.IconTextureAtlases() do
    [COLOR="DarkGreen"]     --do this for each IconAtlas:[/COLOR]
           local iconAtlasRef, iconAtlasIconSize = iTA.Atlas, iTA.IconSize;
           if iconAtlasRef == GameInfo.Resources[ResourceType].IconAtlas and iconAtlasIconSize == 64 then
        [COLOR="DarkGreen"]   -- if this Atlas is the Atlas we specified for the current Resource and has a width of 64 (WorldMap icons are 64x64px). then[/COLOR]
                customAtlas = iTA.Filename;
                [COLOR="DarkGreen"]-- YAY, we found the Atlas for our custom resource[/COLOR]
                instance.ResourceIcon:SetTexture(customAtlas);
               [COLOR="DarkGreen"] -- set the background Image of the IconResource to the IconAtlas we found[/COLOR]
                break;
           end
       end
     end
     -- End: Added by Kyoss


    Step 6): The TopPanel
    Since we have added a Strategic Resource, it will automatically show in the top panel after <TechReveal> was researched by the player. Sadly, i have found no way yet, to display the correct Icon in that panel. Civ5 is not really modular, and i found no way to override the IconFontMapping. You can read more about the problem here.


    I hope this guide isnt too confusing and helps you to add new resources. There's still several things to figure out, but still i'm quite happy with the result.

    The added resource also instantly shows up in the "AgS - Resource Info Panel (v 1)" mod without any changes :)

    If you have any questions feel free to post them
    Kyoss

    PS: I did not have time yet to run the attached mod. There might be some changes needed, i just copied most of the stuff out of the mod i'm currently developing.
     

    Attached Files:

  2. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    Reserved.

    On a side note: Our Copper still uses the 3d-Art of Iron. This would be Step7 of the Tutorial, but sadly i'm still a newb at modelling and those .fsxml files don't tell me anything :p Hopefully someone will figure that part out...
     
  3. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    Wow! That _much_ feedback.
     
  4. NoiZe

    NoiZe Chieftain

    Joined:
    Oct 6, 2010
    Messages:
    9
    I like it ;)
    I think the (Pro) Modders already know most of the Stuff and Starters are still busy with Kael's Beginners Guide and getting Civ's workin.
    Beside that u need to add a lot more Stuff to make use of ur new Resource.
    So when time goes on u will get more feedback i guess :)
     
  5. SamBC

    SamBC Emperor

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    Just to note, I am working on the modular solution. For now, I'm using Lua callbacks, rather than a new DB table, just because... it's easier to change the data structures involved as I go. I may or may not then replace it with one that uses the DB, depending on the opinions I receive on usefulness.

    If anyone wants to collaborate on the nitty-gritty, I could put it in a SVN repo and give them access. It's not even ready for a regression test with no extra resources yet, though, as I decided to start right away covering Bonus and Luxury resources as well, and that makes the coding a tad longer. There is enough to know how to write the callbacks, though, if people want to 'get ready'. It'll be subject to change, but quite trivial changes to adapt to.
     
  6. RandomPete

    RandomPete Chieftain

    Joined:
    Oct 8, 2010
    Messages:
    34
    Small correction to the tutorial: the path in Step 2 should be "Assets/GamePlay/XML/Terrain/CIV5Resources.xml".

    From everything I've seen so far, it will be nigh impossible to add new resources effectively in a modular way along with 3D art. There are two files that need replacing in their entirety if you want to add new art. The first one is civ5artdefines_landmarks.xml, the second one is civ5artdefines_sv_resources.xml (I think that's just for Strategic View art). These are both in the resources directory after unpacking with Nexus. It's a real shame the modularity just completely falls apart here, and will be a major barrier to the potential of modding!

    However, all is not lost - the modular resources solution will still make it much easier to add resource distributions, and as long as two mods are both using it, we'd still be able to manually combine the xml files and arts. Perhaps tools will turn up to assist with editing and combining art defs.

    Another idea occurred to me, I'm wondering whether it's possible to add pixel shaders into the game using mods. If a custom shader could be applied to a particular art def, we could at least use a color filter to create different types of resource. This would be pretty limited, but it would for instance allow you to recolor the Iron art to make copper! (And make quite a few new possibilities with units etc.) In fact I'm wondering if there are any built-in shaders we could manipulate to achieve anything like this, I just haven't dug deep enough yet.

    I'd like to help if I can, it sounds pretty tough and I think it's important it works in the right way. I also wanted to work on a modular system for adding new action buttons - I think it'd be good if both projects approached things in a consistent way. I have a dedicated server running SVN for my own dev work, I can easily set up a new repo there if you'd like.
     
  7. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    Hi SamBC. If possible I'd like to get a first look on what you're doing there. It sure sounds promising.
    I wonder how you solve getting all the new vars we would need into the game? There's a lot in the XMLs which is ignored at the moment, but could be used.
    But other variables the current lua uses arent defined in the XMLs at all.

    e.g. You can set if a Resource can be placed on a hill, but then in lua there's a chance defined for every resource for appearing on a hill.

    I'm also not entirely sure what your callbacks will do.
     
  8. SamBC

    SamBC Emperor

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    I'm using callbacks just to gather information, actually, but they're quicker to update for development while it's not settled; once I know for sure what data is needed, I can change one function in the lua and it will gather the data from the game DB instead; however, the data in the DB as-is isn't actually enough; I haven't checked if the variables that are defined in both match, but there are plenty in the Lua that aren't in the DB, so a new table would be needed and it would be easier (and cleaner design) to use just that, and not the seemingly-deprecated fields from the existing tables.
     
  9. SamBC

    SamBC Emperor

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    That's another annoyance...
    We can only hope.
    I have my own server as well (low bandwidth, but totally mine), and I'll probably use that. Once I get a little further, I'll set up a repo, import, and let people at least see it. Simultaneous work works as long as we're working on different parts of the file :)
     
  10. JeBuS27

    JeBuS27 Heretic

    Joined:
    Sep 21, 2005
    Messages:
    321
    SamBC, I'm also interested in seeing how you're handling changing AssignStartPlots. I've spent hours digging through the mess that it is, and I can't see a way to separate the data and the functionality that Firaxis decided to jumble together in there.
     
  11. RandomPete

    RandomPete Chieftain

    Joined:
    Oct 8, 2010
    Messages:
    34
    Well, I'm pretty used to looking at conflicts in SVN, so it doesn't matter for me if someone works even on the same part of a file :) Would be great to have a look at the code and at least see how you're implementing the callbacks, let us know when you're ready to open it up!
     
  12. Tarkeel

    Tarkeel Imperial

    Joined:
    Jun 27, 2003
    Messages:
    756
    Location:
    Norway
    Thanks for the good work so far; Two questions:

    1)
    Is there any way to make an improvement built on a resource stronger?

    Like making a mine built on the copper give an extra hammer? So the tile would be +1 for copper, +1 for mine and +1 for a mine on copper? Think back to how mines on gems worked in Civ IV :)

    2)
    The "TXT_KEY_CIV5_RESOURCE_COPPER_TITLE1" (and so on) parts of the language file; are the titles here implicitly derived? Or are you just not using them in the example?
     
  13. Landiron

    Landiron Chieftain

    Joined:
    Aug 9, 2010
    Messages:
    30
    It's possible and quite easy. You can find it in your CIV5Improvements.xml, the Table is called <Improvement_ResourceType_Yields>
     
  14. Tarkeel

    Tarkeel Imperial

    Joined:
    Jun 27, 2003
    Messages:
    756
    Location:
    Norway
    Ah, ofcourse! Putting it in a completely different part makes so much sense :p
    Thanks for the help :)
     
  15. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    Yeah sure, i should include that in the future release.

    I'm not entirely sure if those are used anywhere. Just copied them over as Iron had those too.

    On a sidenote:
    I tried adding a resource through a building yesterday. I set a Building_ResourceQuantityRequirement (or something like that) to -1, but it didnt work. Thats majorly bad. Anyone has an idea how to give a building an output of a resource?

    There's really lots and lots of basic stuff missing in Civ5 which has to be implemented by us... I had higher expectations
     
  16. SamBC

    SamBC Emperor

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    I had a thought on how to do it with Lua event hooks, if there were suitable hooks. There dont seem to be - most of those that there are appear to be largely UI-based, and the thought that went into selecting them is largely UI-based. For example, there'd be a kludgy but reasonable way to do it if there were event hooks for each time a building was gained (taken or built) or lost (provided there were also functions that would change the number of resources a civ had) - this appears to match how trade treaties are implemented, hence the bug leading to hundreds of horses...
    Well, they did encourage those expectations... it's a shame, really. Here's hoping they improve it in patch versions, or at least with an expansion. My plans for my recent modern/near future rely on buildings that produce/convert resources, as I want to implement industrial bases for unit productions. Maybe as far as having to produce munitions even for basic modern troops, but certainly as far as producing a couple of key resources for key units (my current thought is Fuel Cells).
     
  17. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    Yeah SAM, had the same idea with lua events, but if you already looked into that... another hope gone. Is there already a list anywhere, where things modders need - but aren't possible yet - are listed?

    It might be useful to compile such a list and send it in several intervals to the Firaxis devs for feedback.
     
  18. JamesCivFan

    JamesCivFan King

    Joined:
    Jun 18, 2010
    Messages:
    604
    Location:
    Greece
    I have a question. How easy is it to edit the copper file you include and make it Rubber or Gunpowder resourse for example, then make it as requirement for Musketmen/ Infantry etc etc?
     
  19. Kyoss

    Kyoss Chieftain

    Joined:
    Jun 21, 2008
    Messages:
    50
    Location:
    Germany
    @JamesCivFan:
    If you have a basic knowledge of XML that can be accomplishes pretty easily. The easiest way would be to rename just the text-references of "Copper" to "Rubber" and change the icon.
     
  20. JamesCivFan

    JamesCivFan King

    Joined:
    Jun 18, 2010
    Messages:
    604
    Location:
    Greece
    Can you help me a bit more? Because I can't seem to find what exactly should I change so the Gunpowder is needed for Musketmen and Cannons for example. I presume that you have made Spearmen being associated with copper but I can't find that anywhere either.

    Also, there is a line in the XML file saying

    <AIStopTradingEra>ERA_INDUSTRIAL</AIStopTradingEra>

    Does this mean that I have to delete that line so the ai will be able to trade gunpowder (and later rubber since i am planning to create 2 edit mods based on yours) even when we both are in the future era?
     

Share This Page