• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

rafek

First Lieutenant
37 Badges
Oct 21, 2011
295
4
  • Stellaris: Nemesis
  • Stellaris: Distant Stars
  • A Game of Dwarves
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Galaxy Edition
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Stellaris: Galaxy Edition
  • Europa Universalis IV
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: Pre-order
  • Stellaris
  • Age of Wonders III
  • Cities: Skylines - Parklife
  • Cities: Skylines
Hello Dear Modders,

While planning chain of events to my mod, I have run into strange problem, that firstly look easy to solve. It is probably caused by the lack of my modding/logical skills or inability to fine proper trigger question. Here it is:

I would like to check if all vassals (of tier count or higher) of my liege have positive opinion of him, or none of them has negative opinion of said liege. I have tried:

Code:
    [...]
              liege = {    
                    any_vassal = { limit = { tier = count
                                  NOT = { opinion = { who = LIEGE value = 0  }}}}}}
                                  [...]

it returns nicely as false if all of them have positive opinion, the problem is I need something that will check the same, but return the truth (1).
I was thinking in adding NOT = { in front but it simply moves into recognizing the next value (TIER = COUNT), that normally would result in checking if there is no vassal that has negative opinion of liege and return the truth if not.

Therefore, I wanted to ask if there is some function similar to any_vassal, but works like all_vassals? So it would check the argument against them all? Any tips would be greatly appreciated.

I am total into humanities, so please forgive me any obvious mistakes here.

Kind regards and thank you in advance for any help.
 
Hello Sir,

Tank you for your solution, it is indeed wonderful, but I would need one that would return as true i.e. There are no such vassals that have negative opinion with this liege = returns true, so my event may trigger.

The one proposed by you ask for the exsistance of negative opinion vassals, and if none, it returns false.

Basically something that would return the little green dot (*) in the console as fulfilled.
In the event that will only trigger if all the vassals have positive opinion of the exact liege.

Would be super grateful if you have anything in mind. I was trying to NOT = { in front so it would ask for non-exitance of the condition but it does not work, like for example NOT = { trait = honest }.
 
Last edited:
Are you sure this :
Code:
		liege = { 
			NOT = {
				any_vassal = { 
					tier = count 
					NOT = { opinion = { who = LIEGE value = 0  } }
				}
			}
		}
Doesn't work ? (if you tested with the "limit" it has reason to fail)
 
Thank you for your time.

Yes just did the test again, it shows as NOT Count -> basically recognizing NOT as being assigned to tier = count.

Tried also moving the NOT = { before the liege section in various different places always not working as expected.

Was also looking in any function to check like all_vassals, but is seems there is none :(

not.png

It basically applies NOT to Tier and opinion once again, instead to the whole sentence.

What is also interesting, I found this in the succession laws as a condition, but cannot locate it in any of the succession game files:

not2.png
 
Last edited:
Thank you.

Yes it seems so, I found in the localisation file: "SUCC_CHANGE_OPINION" - that relates to the text displayed at the condition. Tried putting it in but its not being recognized.
 
Last edited:
I believe this should work:

Code:
		liege = {
			NOT = {
				any_vassal = { 
					higher_tier_than = baron
					NOT = { opinion = { who = PREV value = 0  } }
				}
			}
		}

Using LIEGE as you did in your example is a special case that only works in very few places. Use the previous scope (prev) instead. And tier = X, unlike other triggers, does not mean >= but just equal to. Use the higher_tier_than instead.
 
Hello Captain, thank you kindly.

Unfortunately, the game still applies NOT to the higher_tier_than, instead to the whole sentence, this is what I got:
not3.png


What I would like to get is simply to check if all vassals have positive opinion with liege or if there is no single vassal of negative opinion with the said liege, so to recieve true in the end.
Thx once again for your help.
 
Last edited:
Hello Captain, thank you kindly.

Unfortunately, the game still applies NOT to the higher_tier_than, instead to the whole sentence, this is what I got:
not3.png
The tooltips don't always properly reflect what the code is doing behind-the-scenes. I'm 99% sure that Gars' code will, in fact, accomplish what you want, regardless of what the tooltip says.

Try getting all the vassals to like you, and see if that red dot turns green.
 
Hello,
I did that, way before posting, also suspecting the display might be wrong. It does not change as well as the trigger does not seem satisfied even when the conditions are met.

For now I found the different conditions that seem ok for my event, but will monitor here to see if this changes.

Have a nice evening everyone.
 
Hey Guys,

I have decided to clean up the code and make the events from scratch to perform the in-depth :) investigation of how the console behaves in showing the status of the condition (true/false) and the tooltip.

I have used to testing the code proposed by the Captain Gars. Here is what I have found out:
  1. The Status icon of the console (*) and (x) shows the correct values. (I have tested this when conditions were met and when false)
  2. The tooltip text next to it is wrong not undestanding the NOT statement before some commands (i.e. any_vassal)

Conclusion:

You can still use the console to see how the events conditions are listed and met, but ignore the tooltip text in some cases of the NOT statement used before some of the triggers.

Thank you to everyone for their ideas!
 
Here is another example of the code I also decided to test in practice:


Code:
  [...]
liege = { any_vassal = { higher_tier_than = BARON NOT = { character = ROOT } opinion = { who= ROOT value = 10}}}
liege = { NOT = { any_vassal = { higher_tier_than = BARON NOT = { character = ROOT } NOT = { opinion = { who = ROOT value = 10}}}}}
  [...]

It makes sure that (1) the vassal of the liege (of tier at least count) has opinion with benefactor of the event for at least 10 and (2) ensures there are no such vassal that has an opinion with the benefactor of the event below 10 and that is the part that tooltip of the console does not understand while the status icon is still showing the correct values.

Situation I)

Conditions of the point (2) not met. Vassals with negative opinion to the benefactor and below 10: (take a note of the console tooltip not interpreting the NOT statement before the any_vassal correctly.

not6.png


Situation II)

Conditions of the point (2) met. No Count Vassals with negative opinion to the benefactor and below 10 but some vassals of lower rank with below 10 and negative:

not5.png


Conclusion:

As in the post above. I have marked correct areas of the console window with Yellow lines and not correct ones with Red. Staus icons are showing correct info, while tooltip text in case some negative statements, move NOT to the next statement. - not correct. In most cases tooltip will be ok too. It fails when it does not allow NOT statement - seems to be the case with some statements - like any_vassal in that example.

not4.png
 
Last edited:
I think you're just confused with how to read the conditions above.
Code:
liege = {
     NOT = { 
          any_vassal = { 
               higher_tier_than = BARON #still wrapped in a NOT, so the tooltip saying "Title Rank is NOT higher than 'Baron'" is correct.
               NOT = { character = ROOT }
               NOT = { opinion = { who = ROOT value = 10} } #still wrapped in the previous NOT, so it cancels out the other NOT, so this reads correctly in the tooltip.
          }
     }
}

This logically reads exactly as the tooltip displays it. Also who's liege IS the root, where in your first example it reads who's liege is NOT the root.