
We deleted has_non_swapped_tradition and has_tradition_swap, and consolidated them into has_active_tradition.This will support any trigger checking a number and just a number, with no now.

And as you can see, you can also refer to triggers, with trigger. So you can do dot scoping, which saves a lot of ugliness, and is a big improvement as it is. Value = from.capital_igger:num_pops #gets the number of pops in from’s capital Value = trigger:num_pops #gets the number of pops in the current scope Value = from.capital_scope.my_var #gets the value of the my_var variable set on from’s capital Value = my_var #gets the value of my_var variable set on the current scope First of all, the format: previously, when you wanted to get the value of a variable, you had to refer to… well, the variable itself, and that was all. With 3.1, we have greatly increased the power of variables. Also, the syntax for using them was not quite ideal, in many cases. You also were still quite limited in where you could use variables, especially compared to PDS’ newer games like CK3.

In the last patch, several more ways to save various bits of information in the game were added, but the biggest missing one was an easy way to get trigger values, like for example the number of pops on a planet. I mentioned last time that we have been looking to do more with variables. But today, the main focus will lie on variables. I can also confirm that you can, for instance, now script in tradition trees that only become available if you make certain decisions during the game. We have already mentioned that Traditions are considerably more moddable now with the new system, with far less heavy lifting needed in the gui and loc files.

Welcome to another Stellaris Modding Dev Diary! Today, I’ll be talking you through some of the new scripting language features in the upcoming 3.1 patch.
