How to tell if a civ is at war with a Requirement

isau

Deity
Joined
Jan 15, 2007
Messages
3,071
I've been beating my head into the keyboard over this for what seems like too long over something that seems pretty simple. In the context of ATTACH_ALL broadcast Modifiers, like the ones used by City States to broadcast a Modifier to all other players, is there a way to tell if a Civ is at War with a specific civ in the same way you can tell they are friends or allies?

With Friends, its very simple. The RequirementType REQUIRES_PLAYER_DECLARED_FRIEND returns true if the civ broadcasting the Modifier is Friends with the civ receiving it. Easy.

I would expect there to be something similar for War. But I haven't found anything yet. There are some requirements that trigger the exact turn war is declared, there are some that indicate the civ is at war in general (ie with at least one civ) but no persistent RequirementType I have found that says "This civ is at war with this specific other civ."

What's annoying is there seems to be a setting like this for peace. REQUIREMENT_PLAYER_IS_AT_PEACE returns true if there is Peace between civs. Normally you can invert a RequirementType with the Invert field in the Requirements table. But that doesn't seem to work for REQUIREMENT_PLAYER_IS_AT_PEACE, unless I don't understand how it works. When inverted it still seems to return true even for civs who are not at war. Grr.

Anyone got a solution?
 
PLAYER_AT_WAR_AND_HAS_MET or PLAYER_DECLARED_WAR not working?


They don't seem to trigger specific to a civ unfortunately. They both seem to mean something more like 'this civ is at war with anyone.'

That said I may have figured out the problem with inverting REQUIREMENT_PLAYER_IS_AT_PEACE. I added a second condition to the requirement set, REQUIRES_PLAYERS_HAVE_MET, and that may have fixed it. I'm still testing to be sure. I just noticed a lot of the AT_PEACE conditionals also included REQUIRES_PLAYERS_HAVE_MET. Hopefully that will solve it.


Meanwhile, another question. Anyone familiar with how to get Diplomacy text to actually show up as a Modifier in the leader interaction screens using SIMPLE_MODIFIER? I am obviously missing something. I thought adding SimpleModifierDescription and a StatementKey would be enough, but its not showing in game, although the -6 InitialValue is showing.


Notice the -6 in Wilhelmina's attitude showing the custom Diplomacy condition triggered, but the associated text is not there.

upload_2018-2-25_22-49-14.png



Here's a view of what the mod code is injecting into the database. Black is a Firaxis-created agenda simple modifier. Green is my attempt to replicate the effects in a new modifier. The -6 is working, but the SimpleModifierDescription comes up blank even though LOC_QUO_SECRET_ANNOYED_DESCRIPTION exists in the text files (and even if it didn't this still shouldnt come up blank right?).

upload_2018-2-25_22-52-19.png
 
Ooh I just answered my own question. :)

The reason it didn't work is I didn't do an insert into ModifierStrings. For some reason you need to inject a basic ModifierString that just has a value of LOC_TOOLTIP_SAMPLE_DIPLOMACY_ALL. Did that and now the text shows as expected. :)

upload_2018-2-25_23-2-50.png
 
Top Bottom