[GS] Yield for river adjacent tiles

Slater

Chieftain
Joined
Jan 1, 2021
Messages
21
I'm looking for a way to add yield to a tiles if there is a river on it & Similarely if it is a coast.

Do anyone know how I could do that in the DB ?

Thanks for your help :)
 
Tiles don't have Rivers ON them. The Rivers are between the Tiles.
You can use this requirement for River: "PLOT_ADJACENT_TO_RIVER_REQUIREMENTS".
and for Coast: "PLOT_HAS_COAST_REQUIREMENTS".
 
that's what i thought. thanks for the pointers about the two requirement. Can you point me on how I can use thoose two requirement to actually modify the yields for the map ? ( Ideally i would love to have the yield showing directly at the beginning of the game instead of when a player build a city or something )

I looked into the way they use the DB to modify yield around a natural wonder but that's not possible with the requirement approach as far as I know.


Thanks :)
 
Last edited:
Sure, but first, you need to know what would trigger the effect (Trait, Building, Policy Card, Governor...etc)? that would be helpful
 
Alright : My idea is basically to grant 1 food to tiles on a river. at the beginning of the game. for everyone. ( that's why i'm confuse with the use of the word trigger x) , maybe : world created trigger , if anything like that exist ?

I'm exploring the DB to see if there is anything that I can use. But if you have and idea lemme know :)
 
i'm reading in the modding guide that there is this part :
GameModifiers●Attaches a specified Modifier to the game.●As examples, Firaxis has used this table to add the effect to the game for extra unit healingfrom the Dead Sea Natural Wonder and the Mount Everest Natural Wonder unit ability. They'vealso used it in the Vikings DLC to add the effect to the game of the Giant's Causeway and theLyfesJordan Natural Wonders. Firaxis does not use a table called FeatureModifiers, they useGameModifiersinstead

Can't we use that type of modifier to do it ?
 
For Oceans it's easy to do. It already has +1 Gold and +1 Food, so do you want to change this or add another Yield(s)?
But Rivers are their own Entity, we can't make them grant Yields for the Tiles adjacent to them from the beginning of the Game. So we have to use Modifiers. And you name it: GameModifiers would be the optimal choice here. But I've never used it before, I guess we just have to try it.
 
For Oceans it's easy to do. It already has +1 Gold and +1 Food, so do you want to change this or add another Yield(s)?

That I already know how to do , the idea is more to add more food to tiles next to lakes , coastal tiles ( so plains , grassland, desert etc .. that are on the coast line ) and on a river ( basically using freshwater indication to add more food to the yield when the map is loaded )


So i Guess I have to figure out how to add my own modifier to do the job. Any example I can look into to be able to do it ?
 
I like your Idea. That's better than to have Buildings that would trigger the bonuses (like Shipyard). I would gladly help you with that, but I've to go and get some rest now. I will help you Tomorrow with that (if you haven't figured it out yourself by then).
 
Sure , I'm trying to figure it out on my own but if you don't see any message with the solution on that post it's that I still need your help about it :D If I find a solution i'll post it here ;)
 
INSERT OR IGNORE INTO GameModifiers
(ModifierId)
VALUES ('RIVER_ADDFOOD');
INSERT OR IGNORE INTO Modifiers
(ModifierId, ModifierType,SubjectRequirementSetId)
VALUES ('RIVER_ADDFOOD', 'MODIFIER_GAME_ADJUST_PLOT_YIELD', 'PLOT_ADJACENT_TO_RIVER_REQUIREMENTS');
INSERT OR IGNORE INTO GameModifiers
(ModifierId, Name, Value)
VALUES ('RIVER_ADDFOOD',Amount, 5),
('RIVER_ADDFOOD',YieldType, YIELD_GOLD);

That code is not working but that's what i think could have work.
I checked how the eye of sahara is working , bc it use a game modifier. so i'm not sure what's wrong here


I'm going to sleep, lemme know if you find anything :)
 
Last edited:
The last one must be ModifierArguments, not GameModifiers :mischief:.

Always check the Database for Errors, as a simple "," can cause the code to not work.
 
Last edited:
Alright ,


INSERT OR IGNORE INTO GameModifiers
(ModifierId)
VALUES ('RIVER_ADDFOOD');
INSERT OR IGNORE INTO Modifiers
(ModifierId, ModifierType,SubjectRequirementSetId)
VALUES ('RIVER_ADDFOOD', 'MODIFIER_GAME_ADJUST_PLOT_YIELD', 'PLOT_ADJACENT_TO_RIVER_REQUIREMENTS');
INSERT OR IGNORE INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('RIVER_ADDFOOD', 'Amount' , 5),
('RIVER_ADDFOOD', 'YieldType' , 'YIELD_GOLD');


That add the yield on the river tiles BUT , only on a city tiles. Any idea how to make it so it's showing on the base yield of all the tiles of the map even before the player settle ?
 
Last edited:
I don't believe so in this specific use of the GameModifiers table. The reason that Natural Wonders show their YieldEffects for adjacent tiles is because those that add to adjacent tiles use table Feature_AdjacentYields which makes the effect not the result of a Modifier but rather an inherent property of the adjacent tiles. This is how it is done for the Vanilla Natural Wonders
Code:
	<Feature_AdjacentYields>
		<Row FeatureType="FEATURE_EVEREST" YieldType="YIELD_FAITH" YieldChange="1"/>
		<Row FeatureType="FEATURE_GALAPAGOS" YieldType="YIELD_SCIENCE" YieldChange="2"/>
		<Row FeatureType="FEATURE_KILIMANJARO" YieldType="YIELD_FOOD" YieldChange="2"/>
		<Row FeatureType="FEATURE_TSINGY" YieldType="YIELD_CULTURE" YieldChange="1"/>
		<Row FeatureType="FEATURE_TSINGY" YieldType="YIELD_SCIENCE" YieldChange="1"/>
		<Row FeatureType="FEATURE_PIOPIOTAHI" YieldType="YIELD_CULTURE" YieldChange="1"/>
		<Row FeatureType="FEATURE_PIOPIOTAHI" YieldType="YIELD_GOLD" YieldChange="1"/>
		<Row FeatureType="FEATURE_YOSEMITE" YieldType="YIELD_GOLD" YieldChange="1"/>
		<Row FeatureType="FEATURE_YOSEMITE" YieldType="YIELD_SCIENCE" YieldChange="1"/>
	</Feature_AdjacentYields>
The use of GameModifiers for NaturalWonder effects are tied to Modifiers that are applied to objects that come adjacent as the game plays out (like the Hills Movement effect for KILIMANJARO I think it is). The effect of teleporting for Bermuda Triangle is also done via GameModifiers so is not seen by the game as an actual change upon the tile itself but as an effect of satisfying the Modifier's Requirements.

The effects of Modifiers on tile yields in general are not implemented until the tile comes under a player's ownership. St Basil's Cathedral works the same way. A tile the city that built St Basil's could own but does not yet own does not reflect the alterations to the tile yields that will be implemented by St' Basils.
 
So if i get it right , you are telling me that because River and coastal land are requirementSets and not features ( that can use the Feature_AdjacentYields table to adjust ) there is absolutely no way of doing what i'm trying to do ? with any kind of modifer ? or any kind of way ?


IF yes that's kinda frustrating, I managed to get the yield bonus that I wanted for thoose 2 specifics tiles types ... but can't make them in a way that it's applied globaly.

Lemme know guys if you have any idea :) Anything
 
@LeeS Would this modifier work: "MODIFIER_GAME_ADJUST_PLOT_YIELD"? it has CollectionType: "COLLECTION_ALL_PLOT_YIELDS", so it should affect all the Tiles of a Map. (Use by Eye of the Sahara Natural Wonder, only 2 requiremetns: Plot is eye of sahara and Era at least Atomic)
 
That's what i'm already using , and it's not applying on the map , but on the tiles that have ownership apparenty.
I based the script on the eye of sahara too ^^
Have no Idea what else to use for that... :confused:.

Tbh it isn't that big Issue if the Tiles don't get the Yields from the start of the Game, as long as Cities get the Yields (It's not like if they gonna be worked by Barbarians or something). It's the Citizens who make use of the Yields and the ones who should bring out the Yields in the first place IMO.
 
Yeah but it's more of a QOL stuff, like : i'm planning to add multiples yield modifications like that , I don't really want to calculate by head the yield after modification ... It would be wayyyyy better to have it BEFORE placing a city

ISn't there a way to trigger that with Lua on the map maybe ?
 
Because when you go from :
upload_2021-1-2_20-45-53.png


To that :

upload_2021-1-2_20-46-37.png


Because you have modifiers stacking together from the river , the coast ( +1 food each ) & the mountain ( +1 prod around ) ( and multiple other in the future ) it's confusing for the player.
 
Back
Top Bottom