Problems Getting Custom Improvement To Appear Visually

Zetal

Chieftain
Joined
Oct 19, 2008
Messages
25
So I've added a new improvement that is civilization specific in nature.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
	<Improvements>
		<Row>
			<Type>IMPROVEMENT_HAIDA_HUNTING_CAMP</Type>
			<Description>TXT_KEY_IMPROVEMENT_HAIDA_HUNTING_CAMP</Description>
			<Civilopedia>TXT_KEY_CIV5_IMPROVEMENTS_HAIDA_HUNTING_CAMP_TEXT</Civilopedia>
			<ArtDefineTag>ART_DEF_IMPROVEMENT_CAMP</ArtDefineTag>
			<SpecificCivRequired>true</SpecificCivRequired>
			<CivilizationType>CIVILIZATION_SKIDEGATE</CivilizationType>
			<PillageGold>15</PillageGold>
			<PortraitIndex>19</PortraitIndex>
			<IconAtlas>TERRAIN_ATLAS</IconAtlas>
		</Row>
	</Improvements>
	<Improvement_Yields>
		<Row>
			<ImprovementType>IMPROVEMENT_HAIDA_HUNTING_CAMP</ImprovementType>
			<YieldType>YIELD_FOOD</YieldType>
			<Yield>1</Yield>
		</Row>
		<Row>
			<ImprovementType>IMPROVEMENT_HAIDA_HUNTING_CAMP</ImprovementType>
			<YieldType>YIELD_PRODUCTION</YieldType>
			<Yield>1</Yield>
		</Row>
	</Improvement_Yields>
	<Improvement_ValidTerrains>
		<Row>
			<ImprovementType>IMPROVEMENT_HAIDA_HUNTING_CAMP</ImprovementType>
			<TerrainType>TERRAIN_SNOW</TerrainType>
		</Row>
	</Improvement_ValidTerrains>
</GameData>

It functions exactly how I want it to, and even in-game can be built and works fine etc, but the models are just not visible. I want it to look like the default camp, but for some reason there's just... nothing. :( Does anyone know what could be causing this?

Thanks!

Edit: Also, for some reason the free promotion I try to give to all combat units of this civilization works fine for all but naval units, who doesn't even get the promotion at all. What gives??
 
what do the logs say?

I would have suggested spelling mistake but it seems everything is fine. In my mod I recent ly put in a new improvement with the fort art define and it worked. perhaps try and use a different art define and see where it gets you
 
Would be oh so much easier to trouble shoot if the actual mod was attached and not just snippets of code that may or may not contain errors ...
 
Code:
<ArtDefineTag>ART_DEF_IMPROVEMENT_CAMP</ArtDefineTag>

The camp graphics is only visible on some resources, as defined in ArtDefine_Landmarks table. That's why it's invisible when you place your new improvement on a hex without any of these resources.
 
Just tested the same code using the POLDER art define and lo and behold that works, so I'm inclined to believe PawelS. Do you know how I can change that to work with any resource, PawelS?

Thanks :)
 
Just tested the same code using the POLDER art define and lo and behold that works, so I'm inclined to believe PawelS. Do you know how I can change that to work with any resource, PawelS?

Thanks :)

The problem is that there is no graphics for "resourceless" camp in the game, so even if you add a new row to the ArtDefine_Landmarks table, you'll have to use a camp that looks like there are deer, furs, ivory or truffles in it.

In my mod I had the same problem - I wanted camps to be buildable on any forest or jungle hex. I decided to use enlarged farm graphics without the fields for this purpose. I can post detailed instructions how to do so if you're interested :)
 
OK, so you need the following things:

1. Unzip the attached .zip file, and put the three .fxsxml files from it into your mod, with VFS set to true.

2. Add the following SQL code to your mod (it must be in OnModActivated -> UpdateDatabase):

Code:
INSERT INTO ArtDefine_Landmarks VALUES ('Any', 'UnderConstruction', 1.5, 'ART_DEF_IMPROVEMENT_CAMP', 'SNAPSHOT', 'ART_DEF_RESOURCE_NONE', 'hb_coa_camp.fxsxml', 1, NULL);
INSERT INTO ArtDefine_Landmarks VALUES ('Any', 'Constructed',       1.5, 'ART_DEF_IMPROVEMENT_CAMP', 'SNAPSHOT', 'ART_DEF_RESOURCE_NONE',    'coa_camp.fxsxml', 1, NULL);
INSERT INTO ArtDefine_Landmarks VALUES ('Any', 'Pillaged',          1.5, 'ART_DEF_IMPROVEMENT_CAMP', 'SNAPSHOT', 'ART_DEF_RESOURCE_NONE', 'pl_coa_camp.fxsxml', 1, NULL);

3. In the mod properties, Reload Landmark System must be enabled.

Then you'll be able to use ART_DEF_IMPROVEMENT_CAMP on resourceless tiles. The graphics is perhaps not very interesting, but I think it's quite good as a resourceless camp. If you want to change the scale of the improvement, change 1.5 in all 3 SQL lines to a different value.

Edit: About your second problem: can you post the code that you use to give that free promotion to units? (or the entire mod, as whoward69 suggested)
 

Attachments

  • coa_camp.zip
    740 bytes · Views: 33
The promotion:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/18/2012 1:20:05 AM -->
<GameData>
	<UnitPromotions>
		<Row>
			<Type>PROMOTION_LIFE_OF_SNOW</Type>
			<Description>TXT_KEY_TRAIT_LIFE_OF_SNOW</Description>
			<Help>TXT_KEY_TRAIT_LIFE_OF_SNOW_HELP</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<OrderPriority>7</OrderPriority>
			<CannotBeChosen>true</CannotBeChosen>
			<PortraitIndex>59</PortraitIndex>
			<IconAtlas>PROMOTION_ATLAS</IconAtlas>
			<PediaType>PEDIA_SHARED</PediaType>
			<PediaEntry>TXT_KEY_TRAIT_LIFE_OF_SNOW</PediaEntry>
		</Row>
		<Row>
			<Type>PROMOTION_LIFE_OF_ICE</Type>
			<Description>TXT_KEY_TRAIT_LIFE_OF_ICE</Description>
			<Help>TXT_KEY_TRAIT_LIFE_OF_ICE_HELP</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<OrderPriority>7</OrderPriority>
			<CannotBeChosen>true</CannotBeChosen>
			<PortraitIndex>59</PortraitIndex>
			<IconAtlas>PROMOTION_ATLAS</IconAtlas>
			<PediaType>PEDIA_SHARED</PediaType>
			<PediaEntry>TXT_KEY_TRAIT_LIFE_OF_ICE</PediaEntry>
		</Row>
	</UnitPromotions>
	<UnitPromotions_Features>
		<Row>
			<PromotionType>PROMOTION_LIFE_OF_ICE</PromotionType>
			<FeatureType>FEATURE_ICE</FeatureType>
			<Impassable>false</Impassable>
		</Row>
	</UnitPromotions_Features>
	<UnitPromotions_Terrains>
		<Row>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
			<TerrainType>TERRAIN_TUNDRA</TerrainType>
			<Attack>15</Attack>
			<Defense>15</Defense>
			<DoubleMove>true</DoubleMove>
		</Row>
		<Row>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
			<TerrainType>TERRAIN_SNOW</TerrainType>
			<Attack>15</Attack>
			<Defense>15</Defense>
			<DoubleMove>true</DoubleMove>
		</Row>
		<Row>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
			<TerrainType>TERRAIN_DESERT</TerrainType>
			<Impassable>true</Impassable>
		</Row>
	</UnitPromotions_Terrains>
</GameData>

The Trait XML:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 6/18/2012 12:59:15 AM -->
<GameData>
	<Traits>
		<Row>
			<Type>TRAIT_ARCTIC_ADAPTATION</Type>
			<Description>TXT_KEY_TRAIT_ARCTIC_ADAPTATION</Description>
			<ShortDescription>TXT_KEY_TRAIT_ARCTIC_ADAPTATION_SHORT</ShortDescription>
		</Row>
	</Traits>
	<Trait_FreePromotionUnitCombats>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_GUN</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_ICE</PromotionType>
		</Row>
		<Row>
			<TraitType>TRAIT_ARCTIC_ADAPTATION</TraitType>
			<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
			<PromotionType>PROMOTION_LIFE_OF_SNOW</PromotionType>
		</Row>
	</Trait_FreePromotionUnitCombats>
</GameData>
 
Not at my actual computer right now (remote controlling) so I can't test anything else yet, but I'll be back tomorrow. Thanks a bunch for your help! :D
 
Since G&K, there is no UNITCOMBAT_NAVAL - you should give the promotion to UNITCOMBAT_NAVALMELEE and UNITCOMBAT_NAVALRANGED.
 
I just tested setting the UNITCOMBAT type to NAVALMELEE and NAVALRANGED and the naval units have the promotion now, but they still can't move through ice tiles for some reason. :( Is this another hard limit of the game? I'll be trying the improvement stuff when I have more free time. Thanks!!!
 
Awesome! The new model stuff worked like a charm as well. :D Adding you to the credits thing, for if I ever release this. Thank you sooo so much!
 
Top Bottom