Conditions

Version

Please help with verifying or updating older sections of this article. At least some were last verified for version 3.6.

This article is for the PC version of Stellaris only.

## Logical boolean operators

Operators allow **conditions** and **triggers** to be manipulated in order to return a simple **true** or **false** statement to be processed.

They appear:

* In condition blocks (`trigger` section of events, or equivalent: `mult_modifier`, `can_use_…`, `potential`, `allow`, …).
* In the `limit` clause of command blocks.
* In scripted blocks: as scripted triggers (or scripted effects), which can be used to group conditions into re-usable **macro**.
* At the root of events for pre-triggers used to improve performances (actually only on planets).

 owner = {
 has\_ethic = ethic\_fanatic\_xenophile
 }
 }
 …
} else\_if = { limit = { … }
 …
 AND
 has\_ethic = ethic\_fanatic\_xenophile
 has\_ethic = ethic\_egalitarian
 OR
 has\_ethic = ethic\_fanatic\_xenophile
 has\_ethic = ethic\_egalitarian
 NOT
 has\_ethic = ethic\_fanatic\_xenophile
 NOR
 has\_ethic = ethic\_fanatic\_xenophile
 has\_ethic = ethic\_fanatic\_militarist
 NAND
 has\_ethic = ethic\_fanatic\_xenophile
 has\_technology = "tech\_zero\_point\_power"
 calc\_true\_if
 amount >= 3
 leader\_class = scientist
 is\_researching\_area = society
 gender = female
 has\_level > 2
 leader\_age < 85
}

It is important to remember De Morgan's laws to use NOR and NAND correctly:

```
 NAND = { A B } <=> NOT = { AND = { A B } } <=> OR = { NOT = { A } NOT = { B } }
 NOR = { A B } <=> NOT = { OR = { A B } } <=> AND = { NOT = { A } NOT = { B } }

```

So this means a list of NOTs in an AND can be simplified:

```
 trigger = {
 NOT = { A }
 NOT = { B }
 NOT = { C }
 }

```

Is the same as:

```
 trigger = {
 NOR = { A B C }
 }

```

Conversely, a list of NOTs in an OR can be simplified:

```
 trigger = {
 OR = {
 NOT = { A }
 NOT = { B }
 NOT = { C }
 }
 }

```

Is the same as:

```
 trigger = {
 NAND = { A B C }
 }

```

If you need XOR logic, you can use `calc_true_if` or something like this:

```
 trigger = {
 OR = { A B }
 NAND = { A B }
 }

```

Is the same as:

```
 trigger = {
 calc\_true\_if = { amount = 1 A B }
 }

```

Or this for 3 input XOR logic:

```
 trigger = {
 OR = {
 AND = {
 OR = { A B C }
 NOR = {
 AND = { A B }
 AND = { A C }
 AND = { B C }
 }
 }
 AND = { A B C }
 }
 }

```

Is the same as:

```
 trigger = {
 OR = {
 AND = { A B C }
 calc\_true\_if = { amount = 1 A B C }
 }
 }

```

## Scopes

*Main article: Scopes*

Scopes specify the target of the trigger or condition in question. They allow for variables to be checked on other objects that the trigger script is not attached to. Currently, Stellaris recognises a set of keywords as valid scopes. The most commonly used are outlined in the table below. An empire or nation scope is referred to as country scope.

## Trigger list

The vanilla game has many scripted triggers defined you can use, though they don't show here, as this list is only the triggers built-in to the engine. In addition, you can write your own scripted triggers. Scripted Triggers are stored in the `./common/scripted_triggers/` directory. Current built-in triggers can be also found in the ***triggers.log*** file in your local data folder's `script_documentation`.

Note: For comparing different game **versions** of Stellaris triggers (modifiers and effects) since launch, you can use the GitHub file history feature here  (created by OldEnt).
## Scripted Triggers

There are more than singular Conditions can be used for a Condition. See dynamic modding for details.

## References

1. ↑ Default `"%USERPROFILE%\Documents\Paradox Interactive\Stellaris\**logs\script\_documentation\**"`. This list is dumped and formatted with this regexp.

**Modding**