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

Changing Resource Type

Discussion in 'Civ5 - Creation & Customization' started by Thorburne, Jan 15, 2014.

  1. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    Is there a way to easily change the resource type for a given resource. I want to make Ivory a Strategic resource. I figure that I can just update, but I was reading somewhere that the Quantity settings in the XML are useless. How could those be set for the new or changed resource?
     
  2. JFD

    JFD Kathigitarkh

    Joined:
    Oct 19, 2010
    Messages:
    9,117
    Location:
    The Kingdom of New Zealand
    Code:
    UPDATE Resources 
    SET  Happiness = 0,
    	ResourceClassType = 'RESOURCECLASS_RUSH', 
    	AIObjective = 1, 
    	ConstAppearance = 100,
    	RandApp1 = 25,
    	RandApp2 = 25,
    	Player = 100,
    	NoRiverSide = 1
    WHERE Type = 'RESOURCE_IVORY';
    
    INSERT INTO Resource_QuantityTypes 
    	(ResourceType, 		Quantity)
    VALUES	('RESOURCE_IVORY', 	X);
    
    I've had no problems with Quantity settings, as far as I'm aware.
     
  3. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    OK... thanks. I'll have to try that out the next time I get some time to work on it. After the big mess that I went through with the last issue I had, it is time to get some sleep.

    Thanks again for the input and I look forward to putting it to the test.
     
  4. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
    Quantity settings for strategics are coded in AssignStartingPlots.lua, which also has hard-coded entries for what are lux/bonus/strategics as well. IIRC the UI determines if a resource is a lux by its Happiness value. ResourceClass only seems to be used consistently by the strategic map view.
     
  5. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,232
    The game also uses the "ResourceClassType" XML tag to determine resource type.
     
  6. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    I remember back when Civ V first came out there was a tutorial for making a wood resource. I thought that it was Kael's guide, but I don't see it in there. Anyway, what if I delete Ivory than make a new resource called Elephant?
     
  7. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
    There was, but the AssignStartingPlots.lua script will not look anything like it did back then so even if you find it, it will probably be more hindrance than help.

    CCTP add loads of resources, why not see how they do it.
     
  8. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    I was looking for the CCTP download but seem to be having a hard time finding it, so I have been unable to check there logs. Can a link be provided? Maybe I am just rying to download the wrong file.

    Also, I was unaware of the CCTP mod until you mentioned it. Is there anywhere to get a look at the full list of changes and features? Looking through the forums for the mod, all I see is bits and peices here and there. I couldn't find anything that gives the full breakdown.

    Sent from my T-Mobile myTouch Q using Tapatalk 2
     
  9. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,399
    Location:
    Near Portsmouth, UK
  10. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    When I update multiple Fields as above, do I have to set each one or just use commas?
     
  11. Nutty

    Nutty Deity

    Joined:
    Mar 9, 2011
    Messages:
    3,171
    Gender:
    Male
    Location:
    Orange County, California, U.S.A.
    The quoted SQLite code should work as written.
     
  12. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    So that should go into SQL Lite... not XML?

    Well, I tried deleting Ivory and creating a new entry for an "Elephant" Resource. I first put in both Iron and Ivory and changed the settings in Ivory to reflect a strategic resource (basically melding the two entries). I then deleted the Iron entry, and changed the type to "RESOURCE_ELEPHANT". I made appropriate changes and added the description text. When I tested the mod, the first thing that I noticed was that the Elephant is listed in the Bonus category in the Civilopedia. I then noticed that I don't have any improvements for the resource. I am about to look into fixing that.

    Should I change the Yield to Production? How do I make it a Strategic resource?

    Code:
    <GameData>
    	<Resources>
    		<Delete Type="RESOURCE_IVORY"/> 
    		<Row>
    			<Type>RESOURCE_ELEPHANT</Type>
    			<TechReveal>TECH_TRAPPING</TechReveal>
    			<TechCityTrade>TECH_TRAPPING</TechCityTrade>
    			<AIStopTradingEra>ERA_MODERN</AIStopTradingEra>
    			<Description>TXT_KEY_RESOURCE_ELEPHANT</Description>
    			<Civilopedia>TXT_KEY_CIV5_RESOURCE_IVORY_TEXT</Civilopedia>
    			<ResourceClassType>RESOURCECLASS_RUSH</ResourceClassType>
    			<ArtDefineTag>ART_DEF_RESOURCE_IVORY</ArtDefineTag>
    			<AITradeModifier>10</AITradeModifier>
    			<AIObjective>1</AIObjective>
    			<ConstAppearance>50</ConstAppearance>
    			<MinAreaSize>3</MinAreaSize>
    			<MaxLatitude>90</MaxLatitude>
    			<RandApp1>25</RandApp1>
    			<RandApp2>25</RandApp2>
    			<Player>100</Player>
    			<Flatlands>true</Flatlands>
    			<IconString>[ICON_RES_IVORY]</IconString>
    			<PortraitIndex>15</PortraitIndex>
    			<IconAtlas>RESOURCE_ATLAS</IconAtlas>
    		</Row>
    	</Resources>
    	<Resource_YieldChanges>
    		<Row>
    			<ResourceType>RESOURCE_ELEPHANT</ResourceType>
    			<YieldType>YIELD_GOLD</YieldType>
    			<Yield>2</Yield>
    		</Row>
    	</Resource_YieldChanges>
    	<Resource_Flavors>
    		<Row>
    			<ResourceType>RESOURCE_ELEPHANT</ResourceType>
    			<FlavorType>FLAVOR_MOBILE</FlavorType>
    			<Flavor>10</Flavor>
    		</Row>
    	</Resource_Flavors>
    	<Resource_TerrainBooleans>
    		<Row>
    			<ResourceType>RESOURCE_ELEPHANT</ResourceType>
    			<TerrainType>TERRAIN_PLAINS</TerrainType>
    		</Row>
    	</Resource_TerrainBooleans>
    	<Resource_QuantityTypes>
    		<Row>
    			<ResourceType>RESOURCE_ELEPHANT</ResourceType>
    			<Quantity>3</Quantity>
    		</Row>
    	</Resource_QuantityTypes>
    	
    	<Language_en_US>
    		<Row Tag="TXT_KEY_RESOURCE_ELEPHANT">
    			<Text>Elephant</Text>
    		</Row>
    	</Language_en_US>
    </GameData>
     
  13. Thorburne

    Thorburne Centurion

    Joined:
    Aug 21, 2005
    Messages:
    1,449
    Gender:
    Male
    Location:
    Carney, MD
    Well, digging a bit deeper, I see that just adding a resource is a lot more hassle than I realized. So I think I am going to shelf that part of my mod for the time being. I was just tired of seeing elephant units running around where no Ivory is even in sight. I'm sure that I'll come back to it at some point. Other than that, I am proud of my little mod and was able to figure out a few things that I could find no answers for. Maybe after some playtesting and some map-making, I'll even post it to the community.

    Still, if anybody has any clear input on how to get my "Elephants" resource to work, I am all ears.
     
    meRlinX_AT likes this.
  14. TheSexyMartian

    TheSexyMartian Chieftain

    Joined:
    Mar 6, 2019
    Messages:
    6
    if i wanted a building to modify the luxury resource class, say...
    </update>
    where: RESOURCECLASS_LUXURY
    SET Faith <1>
    <\update>
    with proper syntax, would this work?
     
  15. TheSexyMartian

    TheSexyMartian Chieftain

    Joined:
    Mar 6, 2019
    Messages:
    6
    if i wanted a building to modify the luxury resource class, say...
    </update>
    where: RESOURCECLASS_LUXURY
    SET Faith <1>
    <\update>
    with proper syntax, would this work?
     
  16. TheSexyMartian

    TheSexyMartian Chieftain

    Joined:
    Mar 6, 2019
    Messages:
    6
    Code:
    <Building_ResourceClassYieldChanges>
            <Row>
                <BuildingType>BUILDING_PERISTYLE</BuildingType>
                <ResourceClassType>RESOURCECLASS_LUXURY</ResourceClassType>
                <YieldType>YIELD_FAITH</YieldType>
                <Yield>1</Yield>
            </Row>
        </Building_ResourceClassYieldChanges>
    
    would this work?
     
  17. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    6,756
    Location:
    Illinois, USA
    No. Because there is no such table as "Building_ResourceClassYieldChanges" in the non-modded game.

    Vox Populi may add such a table, but if so you would need to be running the CP mod in order to use such a table.
     

Share This Page