[GS] Trait help, procs 5 times

Peep the Toad

Chieftain
Joined
Feb 6, 2019
Messages
22
For part of my mod, I wanted the civ to get bonus production and gold from cliffs, but as cliffs are not a feature or terrain type, I had to define cliff HAS_CLIFF myself, with REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES, and defining a new modifier for each type of hill. For reasons I cannot understand, in game, the bonus is applied 5 times, as if each condition was being met, despite only being adjacent to a single hill.
Sorry in advance for the block of code, the most relevant code can be found in Corwall_Traits_Cliff.xml
 

Attachments

I think the issue could that you use MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER. I think the default subjects of cities are districts. And you check for plots, which is probably ignored hence you have 5 of them attached always.
Try something that is dedicated for PLOT_YIELDS, e.g. modifier for PLAYER_PLOT_YIELDS. Could even probably get rid of attach modifier thing. Just Trait -> PLAYER_PLOT_YIELDS -> reqs for subjects.
 
I couldn't find PLAYER_PLOT_YIELDS in the DB, so I went with MODIFIER_PLAYER_ADJUST_PLOT_YIELD, with and without attaching the modifier, sadly neither worked.
 
for whatever reason I can't open the attachment so can't help

But I've never had any trouble with an original modifier attached directly to a trait that is MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER so long as the attached modifier that is added to each player city is using MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD for the sort of thing you are going after.

Unfortunately Cliffs and Rivers are odd ducks so far as being map objects go. Much of the modifiers related to them are just boolean column stuff where the modifier-type and its effect is buried in the DLL and is just if it's a cliff or a river then do this rather than being numerically mod-able for example.
 
Last edited:
Hmm, well I still can't open that with 7Z, which usually easily opens any .rar file.
You might try zipping it into an actual zip folder with the windows built-in zip utility.
Really strange but for me 7z just does not recognize your rar file as an archive.
 
Hmmmm, I was using WinRAR, but here it is using the built-in windows one. Also, I think I was playing around with traits, so that isn't entirely correct, but Traiits_Cliff still has the original XML in it
 

Attachments

This is not logical
Code:
	<Requirements>
		<Row RequirementId="KN_PLOT_ADJACENT_TUNDRA_HILL_REQUIRMEMENT" RequirementType="REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES"/>
		<Row RequirementId="KN_PLOT_ADJACENT_DESERT_HILL_REQUIRMEMENT" RequirementType="REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES"/>
		<Row RequirementId="KN_PLOT_ADJACENT_SNOW_HILL_REQUIRMEMENT" RequirementType="REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES"/>
		<Row RequirementId="KN_PLOT_ADJACENT_PLAINS_HILL_REQUIRMEMENT" RequirementType="REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES"/>
		<Row RequirementId="KN_PLOT_ADJACENT_GRASS_HILL_REQUIRMEMENT" RequirementType="REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES"/>
	</Requirements>
	<RequirementArguments>
		<Row RequirementId="KN_PLOT_ADJACENT_GRASS_HILL_REQUIRMEMENT" Name="TerrainType" Value="TERRAIN_GRASS_HILLS"/>
		<Row RequirementId="KN_PLOT_ADJACENT_PLAINS_HILL_REQUIRMEMENT" Name="TerrainType" Value="TERRAIN_PLAINS_HILLS"/>
		<Row RequirementId="KN_PLOT_ADJACENT_DESERT_HILL_REQUIRMEMENT" Name="TerrainType" Value="TERRAIN_DESERT_HILLS"/>
		<Row RequirementId="KN_PLOT_ADJACENT_TUNDRA_HILL_REQUIRMEMENT" Name="TerrainType" Value="TERRAIN_TUNDRA_HILLS"/>
		<Row RequirementId="KN_PLOT_ADJACENT_SNOW_HILL_REQUIRMEMENT" Name="TerrainType" Value="TERRAIN_SNOW_HILLS"/>
	</RequirementArguments>
Terrains are not features, therefore the game cannot use nor properly implement
Code:
Name="TerrainType"
as an argument for a Requirement whose RequirementType = "REQUIREMENT_PLOT_ADJACENT_FEATURE_TYPE_MATCHES".
 
REQUIREMENT_PLOT_ADJACENT_TERRAIN_TYPE_MATCHES instead of the Feature-Type one you were using. Not sure if it's valid for all three expansion-levels, though. It's the closest I think you can get since there really doesn't seem to be anything dynamic regarding cliffs. The melee unit thing with the cliffs is just essentially a boolean.
 
strange because I pulled it directly from the database as it was configured by GS, and I don't remember seeing it when I copied out all the RequirementTypes for Vanilla and stored them in an rtf file for future reference.
 
Back
Top Bottom