[help] Graphical and SV Icon issues when adding a resource

kaspergm

Deity
Joined
Aug 19, 2012
Messages
5,577
I've been working on adding a new resource (Rice) to the game, as a bonus resource. I've struggled with getting the game to place the resource correctly, but that is now under control. The resource is added on the correct tiles and the basic resource on-map artwork appears correctly:
Spoiler :

I have two problems, however:

1) I found another mod that also adds Rice, so I tried to use this as a basis to add the improvement (Plantation) artwork, however this is not working properly. As mentioned the basic on-map artwork does appear, but when I build a plantation, nothing changes on the map, it just looks the same. I've added the info through an SQL-file because that was how it was done in the original mod, but edited some things. My current file looks like this (the code looks messy here, so I'll attach the SQL-file also convertet to .txt to allow attachment):
Spoiler :
Code:
--------------------------------------------------------------------------------------------------
--Table Adds
--------------------------------------------------------------------------------------------------
ALTER TABLE Resources ADD COLUMN Rivers boolean default 0;

--------------------------------------------------------------------------------------------------
--Resources
--------------------------------------------------------------------------------------------------
INSERT INTO Resources (Type,	ResourceClassType,		Rivers,	Hills,	Flatlands,	MaxLatitude,	TechReveal,		TechCityTrade,			IconAtlas,				PortraitIndex,	ArtDefineTag,					IconString,					Description,					Civilopedia,								Help,									AITradeModifier,	ResourceUsage,	AIObjective,	PlacementOrder,	ConstAppearance,	MinAreaSize,	Player,		Normalize)
SELECT 'RESOURCE_RICE',			'RESOURCECLASS_BONUS',	0,		0,		0,			50,				NULL,			NULL,					'RICE_ICON',			0,				'ART_DEF_RESOURCE_RICE',		'[ICON_RES_RICE]',			'TXT_KEY_RESOURCE_RICE',		'TXT_KEY_CIV5_RESOURCE_RICE_TEXT',			'TXT_KEY_RESOURCE_RICE_HELP',			0,					0,				0,				3,				50,					3,				0,			1;
--------------------------------------------------------------------------------------------------
--Resource Yield Changes
--------------------------------------------------------------------------------------------------
INSERT INTO Resource_YieldChanges (ResourceType,	YieldType,			Yield)
SELECT 'RESOURCE_RICE',								'YIELD_FOOD',		2;

--------------------------------------------------------------------------------------------------
--Resource Flavors
--------------------------------------------------------------------------------------------------
INSERT INTO Resource_Flavors (ResourceType,	FlavorType,				Flavor)
SELECT 'RESOURCE_RICE',						'FLAVOR_GROWTH',		10;

--------------------------------------------------------------------------------------------------
--Resource Terrains
--------------------------------------------------------------------------------------------------
INSERT INTO Resource_TerrainBooleans (ResourceType,	TerrainType)
SELECT 'RESOURCE_RICE',								'TERRAIN_GRASS';

--------------------------------------------------------------------------------------------------
--Resource Features
--------------------------------------------------------------------------------------------------
INSERT INTO Resource_FeatureBooleans (ResourceType,	FeatureType)
SELECT 'RESOURCE_RICE',								'FEATURE_MARSH';

--------------------------------------------------------------------------------------------------
--Resource Feature Terrains
--------------------------------------------------------------------------------------------------
INSERT INTO Resource_FeatureTerrainBooleans (ResourceType,	TerrainType)
SELECT 'RESOURCE_RICE',										'TERRAIN_GRASS';

--------------------------------------------------------------------------------------------------
--Resource Improvements
--------------------------------------------------------------------------------------------------
INSERT INTO Improvement_ResourceTypes (ResourceType,	ImprovementType)
SELECT 'RESOURCE_RICE',									'IMPROVEMENT_PLANTATION';

--------------------------------------------------------------------------------------------------
--Resource Improvement Yields
--------------------------------------------------------------------------------------------------
INSERT INTO Improvement_ResourceType_Yields (ResourceType,	ImprovementType,			YieldType,			Yield)
SELECT 'RESOURCE_RICE',										'IMPROVEMENT_PLANTATION',	'YIELD_FOOD',		1;

--------------------------------------------------------------------------------------------------
--Icon Atlas 
--------------------------------------------------------------------------------------------------
INSERT INTO IconTextureAtlases (Atlas,	IconSize,	IconsPerRow,	IconsPerColumn,	Filename)
SELECT 'RICE_ICON',						256,		1,				1,				'RiceIcon_256.dds';
SELECT 'RICE_ICON',						80,			1,				1,				'RiceIcon_80.dds';
SELECT 'RICE_ICON',						64,			1,				1,				'RiceIcon_64.dds';
SELECT 'RICE_ICON',						45,			1,				1,				'RiceIcon_45.dds';

--------------------------------------------------------------------------------------------------
--Font Textures
-------------------------------------------------------------------------------------------------- 
INSERT INTO IconFontTextures (IconFontTexture,	IconFontTextureFile) 
SELECT 'ICON_FONT_TEXTURE_RICE',				'rice-fonticons';

--------------------------------------------------------------------------------------------------
--Font Mapping
-------------------------------------------------------------------------------------------------- 
INSERT INTO IconFontMapping (IconName,	IconFontTexture,					IconMapping) 
SELECT 'ICON_RES_RICE',					'ICON_FONT_TEXTURE_RICE',			1;

--------------------------------------------------------------------------------------------------
--SV Icons
-------------------------------------------------------------------------------------------------- 
INSERT INTO ArtDefine_StrategicView (StrategicViewType, TileType,		Asset)
SELECT 'ART_DEF_RESOURCE_RICE',							'Resource',		'SV_Rice.dds';

--------------------------------------------------------------------------------------------------
--Artdefines
-------------------------------------------------------------------------------------------------- 
INSERT INTO ArtDefine_LandmarkTypes (Type,	LandmarkType,	FriendlyName)
SELECT 'ART_DEF_RESOURCE_RICE',				'Resource',		'Rice';

INSERT INTO ArtDefine_Landmarks (ResourceType,	ImprovementType,					Model,								Era,			State,					Scale,				LayoutHandler,	TerrainContour)
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_NONE',			'resource_rice.fxsxml',				'Any',			'Any',					0.9399999976158142,	'SNAPSHOT',		1;
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_PLANTATION',	'hb_plantation_ind_rice.fxsxml',	'Ancient',		'UnderConstruction',	0.9599999785423279,	'SNAPSHOT',		1;
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_PLANTATION',	'plantation_ind_rice.fxsxml',		'Ancient',		'Constructed',			0.9599999785423279,	'SNAPSHOT',		1;
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_PLANTATION',	'pl_plantation_ind_rice.fxsxml',	'Ancient',		'Pillaged',				0.9599999785423279,	'SNAPSHOT',		1;
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_PLANTATION',	'hb_plantation_ind_rice.fxsxml',	'Industrial',	'UnderConstruction',	0.9599999785423279,	'SNAPSHOT',		1;
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_PLANTATION',	'plantation_ind_rice.fxsxml',		'Industrial',	'Constructed',			0.9599999785423279,	'SNAPSHOT',		1;
SELECT 'ART_DEF_RESOURCE_RICE',					'ART_DEF_IMPROVEMENT_PLANTATION',	'pl_plantation_ind_rice.fxsxml',	'Industrial',	'Pillaged',				0.9599999785423279,	'SNAPSHOT',		1;
It looks a bit messed in the layout here, but can anybody figure out what might be the mistake? The fact that the basic graphic information does work tells me that the entire file can't be wrong, so it has to be something with the Plantation specific information. I have set my mod to "Update Landmarks", as I first thought that was the problem, but that hasn't made it work.

2) The resource icon in on map doesn't appear correctly, but turns up instead as Iron, as can be seen in the screenshot above. I looked around to find a solution to this and try to follow the guide in step 5.2 of this thread but without succes - when I included the new ResourceIconManager.lua I still didn't get the correct icon, and furthermore the G&K-specifik Icons didn't appear correctly (see at the Truffles):
Spoiler :

Does anybody have a G&K-compatible guilde to get the SV-icons to appear correctly?
 

Attachments

  • RiceMod.txt
    6.7 KB · Views: 71
Yay, got this to work at last, turns out the problem was the multiple entries in the SQL file under both icons and landmarks. Changing it so that each line was proceded by their own "insert into" line made it all work. Don't know if that is a general issue, or if I did something wrong when copying the text.
 
Top Bottom