Changing Resource Type

Thorburne

Centurion
Joined
Aug 21, 2005
Messages
1,449
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?
 
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.
 
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.
 
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.
 
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?
 
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.
 
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
 
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.

When I update multiple Fields as above, do I have to set each one or just use commas?
 
The quoted SQLite code should work as written.

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>
 
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.
 
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.
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?
 
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?
 
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.
 
Top Bottom