• Crusader Kings II Expansion Subscription

    Subscribe to the CK II Expansion and enjoy unlimited access to 13 major expansions and more!


  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning
Hi all! I’m Caligula, our resident scripting language magician. As someone who works with our scripting language - both using it and improving it - on a daily basis, I’m very happy to be able to show off some of the new stuff that modders (and us inhouse) will be able to use going forwards, once the upcoming patch hits.

I’ll begin with a rundown of the new features:
  • Espionage: modders can add new operations, much like arc sites
  • First Contact: script driven, so modders can change much of the system, but all first contact is now technically one long event chain, so overwriting could be an issue. Luckily we have a new effect, “fire_on_action”, which has been inserted into various places that should alleviate this
  • Become the Crisis: code features e.g. the interface are all activated by script. So in theory, one could overwrite the whole feature to be whatever sort of progression to a goal you happen to want to mod in.
  • Emperor/Custodian: feature designed by the most experienced Content Designer at PDS. Brought with it many collateral scripting improvements, such as far more flexibility with galcom resolutions and the ability to spawn federation / community fleets via script.

Now, it’ll be exciting to see what modders do with this, but there’s so much more that we’ve done since 2.8 hit, so...

General improvements and standardisations

It would be fair to say that the Stellaris scripting language has grown incrementally according to the game's needs. This is not unexpected - Stellaris itself has grown incrementally. But it has had the side effect that a lot of different people have contributed to it, and so inconsistencies between different implementations have arisen. On the user side, this would show itself in, for example, things which work in one place but do not work in other, equivalent places.

For the upcoming patch, we had time to take a holistic view of certain things and implement some general improvements and standardisations.

A quick win in this regard is what is known internally as "script lists". These are a code system which generates random/every/any/count_whatever_object from a single section of code - guaranteeing that the way that array is built is the same between them, i.e. any_owned_pop checks exactly the same pops as every_owned_pop would execute on. We have been using these for quite a while, but there were still some very old implementations for certain scopes that predated them. The result of this was in some cases confusion - for example, x_pop and x_planet did sometimes radically different things depending on whether you used every, random, any or count (e.g. working in different scopes, sometimes referring to all the objects in the game and sometimes all of those belonging to the current scope...). Disturbingly, it was found that any_ship referred to "any ship in the game" and was in fact used wrong 100% of the time in our scripts. Another result was that in some cases one of the versions (usually the "count" version) was simply missing.

With the next patch, nearly all of the pre-script list implementations have been removed and replaced with script lists. In some cases, the opportunity was taken to clarify what the script list did, e.g. the "planet" script list is now split between "galaxy_planet" and "system_planet". (This will break some mods, for which I am a bit sorry, but not very :D It was worth it, and the patch notes will give details on what changed. In most cases, a batch-replace will suffice. Also, because of script lists, a fair few count_x triggers have changed names to lose an "s" at the end, which is slightly regrettable from a grammatical point of view). Some have also had some functionalities expanded, e.g. owned_pop, owned_planet and system_within_border now all work in sector scope.

A further area singled out for improvement was references to scopes in effects and triggers, e.g. create_pop = { species = <whatever> }. It turned out that there were quite significant variations as to what <whatever> in that example could be, depending on the effect or trigger. In some cases, only the species was allowed; in others, perhaps species or leader or country or pop; in others, the same but not pops… In some cases, we even used something called “owner_main_species”, which worked in just those places (unlike “owner_species”, which was the same but worked everywhere…). Our solution was to go through each and every trigger and effect and enforce standardisation - with the same code functions used in each case - for any script call to a species, country, planet, leader, or solar system location. No more shall we be confused that something works in one place but not in another!

This also lets us make sure that errors are correctly (and usefully) logged each time a scripter gets one of these wrong. (N.B. for modders not in the know: the error log can be found in Documents/Paradox Interactive/Stellaris/logs/error.log). In a similar vein, error logging has generally been improved across the whole scripting language. A large number of error messages lacking essential information (e.g. file location) have been updated to include that - as guardian of our overnight testing error logs, I have gone on a personal crusade against useless error log messages. Furthermore, we have fixed a disturbing number of cases where something didn't work but didn't warn you - e.g. doing something wrong in a trigger so it is always false, or messing up an effect so it did nothing. I'm not going to promise that this will never happen anymore, but a concerted effort has been made to eliminate such cases. Modders should expect the error log to warn them of a lot more issues both during startup and during the campaign. This has also made us somewhat more effective in fixing script bugs, since many more are now caught in the aforementioned overnight tests.

Variables

Onto something a bit different. On Stellaris, inhouse scripters and modders alike have long looked with envy upon the capabilities of the newer PDS game engines, compared to our own ability to do maths in script. We did have variables, but their functionality has been a bit more limited than we may have desired. In fact, I’ve seen some of the ways that modders get around their limitations, which have been incredibly motivating to make such horrible scripts no longer be necessary!

In 2.8, the following was possible with variables:
  • You can check, set, add, subtract, divide or multiply variables against values, other variables on the same scope, or the same variable on other scopes
  • You can export various galaxy generation settings as variables
  • You can refer to variables in localisations, but if the variable’s value is 0, it will show as blank because the variable is cleared
  • Variables can be used as a parameter in a handful of places, such as the count in a “while” effect

Quite a lot of improvements have been made since then, and further ones are planned for the near future. In the upcoming patch:
  • You can also check, set, add, subtract, divide or multiply variables against different variables on other scopes
  • There are new effects to modulo (% operator), round up, round down and round to the closest full number
  • A new trigger check_variable_arithmetic checks the value of a variable if you’d perform some arithmetic to it in a certain way, e.g. multiply it by another value or variable (add, subtract, multiply, divide and modulo all work)
  • New effects to export various game values to variables have been added. These are: export_modifier_to_variable (check_modifier_value trigger also exists now), export_resource_stockpile_to_variable, export_resource_income_to_variable
  • add_modifier, add_resource, resource_stockpile_compare now have “mult” parameters where a variable is accepted. So you can scale resource costs and bonuses in effects by a variable now.
  • Variables are no longer cleared when they are 0, but instead when you use the clear_variable effect, so they can be reliably used in localisations.
  • Certain usages of variables now have error logging, in case you try and use one that hasn’t been set.

Additionally, we have started making it possible to use variables way more widely. The idea is that we want to change how simple numerical effects and triggers (i.e. ones which accept a number as the right hand side parameter and do not have any “{ }”) work:
  • Effects should allow you to use a variable, and should grab the number from that variable
  • Triggers should also let you use a variable, and should check themselves against the value of that variable
  • Triggers should by default also let you check them against another scope for which that trigger would work. So “num_pops > from” should check if the current object has more pops than “from” does
  • It should be possible to export the current value of a trigger to a variable via an effect, i.e. “export_trigger_value_to_variable = { trigger = num_pops variable = my_var }” => sets the my_var variable to the number of pops the current scope has.

Unfortunately, it only recently became possible for us to pursue these changes, and while the groundwork has been set for them, they are not yet fully implemented - finishing the Nemesis expansion and accompanying patch has rightly taken priority (the changes are not without danger: it’s a lot of lines of code that have to be modified for it). So consider this a preview for how it will look in the hopefully near future, and in the meantime, the fleet_power trigger already works in the way specified, and export_trigger_value_to_variable is in the patch, albeit working with only that trigger.

Button Effects

Inhouse, we made the UI by assigning a function to buttons in the source code. But there’s also support for interface buttons that you mod into the game. In previous versions, these did not take the scope of the object that they were attached to, so if you added a button to a planet, it would still execute the effect on your country rather than that planet. We have fixed that for a bunch of cases: they will now be able to deduce their interface's planet, fleet, ship, system, ambient object, megastructure, federation, archaeology site, first contact site, spy network or espionage operation. (Incidentally, debug console commands like “effect …” and “trigger …” now work in those same scopes)

Disclaimer: The way it works is a tad hacky and it may be possible to confuse it by opening multiple interfaces at once. I recommend checking “is_scope_type = planet/whatever” in the allow and/or effect sections of the button effect. But the signs are that it should work with no problem in most cases, which is better than none!

More nice things
  • In most places where you could previously use logical operators such as >, >=, =<, <, you can now use != for “is not equal” too.
  • Message types now have their own folder, so mods can add to them without overwriting the file (great for intermod compatibility, and also for modders being able to add QoL without overwriting each other)
  • Messages spawned by the create_message effect now support using loc commands such as [This.GetName] (where “This” is the specified target of the message).
  • Also, since we had to fix a large number of cases where there were references to the “Galactic Community” rather than the “Galactic Imperium”, [ ] locs now work in quite a variety of extra places.
  • The effects “add_victory_score = <number>” and “win = yes” now exist. I’m sure no one will misuse them.
  • Added new event types: leader_event, system_event, starbase_event, first_contact_event, and espionage_operation_event. Though mean time to happen does not work for any of them at the moment - fixing that wasn’t a priority, as it is generally better to avoid mean time to happen anyway.
  • Hardcoded juggernaut behaviour is now tied to a ship size being a starbase that is mobile, rather than the “juggernaut” key. I.e. mod-made juggernauts are now possible without crippling bugs
  • It’s now possible to hide a static modifier from the list of country modifiers
  • You can check the distance of objects within the same solar system now by adding “same_system = yes” to the distance trigger
  • There’s quite a lot of new on_actions, and you can make your own ones with fire_on_action effect
  • And a lot more.

Finally, I'll leave you with the new trigger docs (as of today), which are now found in their own file called trigger_docs.log, and which really speak for themselves. Also, don't forget Paradox Insider will premier this Saturday at 8 PM CET (7 PM UK, 2 PM ET, 11 AM PT) on http://twitch.tv/twitchgaming
 

Attachments

  • trigger_docs.log
    253,4 KB · Views: 0

Pancakelord

General
42 Badges
Apr 7, 2018
1.818
5.534
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Imperator: Rome
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Death or Dishonor
  • Imperator: Rome Deluxe Edition
  • Cities: Skylines - Green Cities
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Cities: Skylines Industries
  • Pillars of Eternity
  • Stellaris: Necroids
  • Europa Universalis IV
  • Crusader Kings III
  • Stellaris: Federations
  • War of the Roses
  • Cities: Skylines
  • Stellaris: Lithoids
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Ancient Relics
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Sword of the Stars II
  • March of the Eagles
  • Darkest Hour
New effects to export various game values to variables have been added. These are: export_modifier_to_variable (check_modifier_value trigger also exists now), export_resource_stockpile_to_variable, export_resource_income_to_variable
To make sure i'm not jumping to conclusions... does this now mean we can read in game variables (e.g. current mineral production) and convert those in to named variables for use in maths operations? Like export_resource_income_to_variable will read in my "unity income = +43" and update my variable to read "mymod_unity_var = 43" Big if true.

In previous versions, these did not take the scope of the object that they were attached to, so if you added a button to a planet, it would still execute the effect on your country rather than that planet. We have fixed that for a bunch of cases: they will now be able to deduce their interface's planet, fleet, ship, system, ambient object, megastructure, federation, archaeology site, first contact site, spy network or espionage operation. (Incidentally, debug console commands like “effect …” and “trigger …” now work in those same scopes)
This sounds interesting

Become the Crisis: code features e.g. the interface are all activated by script. So in theory, one could overwrite the whole feature to be whatever sort of progression to a goal you happen to want to mod in.
To clarify this, could we duplicate the object container & tab in the UI to make multiple trees? without overwriting the Nemesis tree?
Lets say I want the Nemesis crisis to be a thing, but I also want to have a separate ... skill tree, that does other things, like specialising your fleet (E.g. You could invest a point in to Kinetic/Missile/Strikecraft/Energy and flesh out a fleet doctrine that way, earning points for winning wars. A "warmongers" tree, if you will.).

In some cases, the opportunity was taken to clarify what the script list did, e.g. the "planet" script list is now split between "galaxy_planet" and "system_planet".
I made a suggestion recently to add scopes or effects for the galaxy map to let us spawn entities or ambient objects, pegged to stars' XYZ Coordinates, as part of a wormhole drive mod i've been working on. The aim being to spawn pre-2.0 style radial effects on the galaxy map (or show a radius of effect for megastructures affects etc).
I've not had a chance to trawl that attached trigger list heavily yet, but would this separation of galaxy/system planet open up a possible method for spawning sprites/ambient objects on the gal map? (i'm assuming "galaxy_planet" means a star-system object on the galaxy map?)
 
  • 5
  • 1Like
Reactions:

Tech Noir Synth

Lt. General
23 Badges
Dec 15, 2018
1.371
1.914
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris: Necroids
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Crusader Kings II: Holy Fury
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Age of Wonders III
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sword of Islam
In what ways does this improve the game? For example, does this improve some of the AI ship movements?

Since many of us cannot enjoy the game without proper AI mods like Starnet anymore, but Starnet itself cannot make the AI smarter in terms of some hard-coded fleet movement, is this going to improve the game? Also is this going to improve the Crisis AI to the level it should be? And is this going to teach the Crisis AI how to not fly their construction ships from one end of the galaxy to another, spending ingame years and not expanding at all?

Edit: Wow 20 of you had time to click disagree, yet no one wanted to spend time and actually comment and answer my Questions?
 
Last edited:
  • 26
  • 2Like
  • 1Haha
Reactions:

Mealya

Second Lieutenant
13 Badges
Mar 18, 2020
103
450
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
  • Stellaris: Synthetic Dawn
Since we are talking about scripts... I think it is the moment to talk about the "upgrades_to" (unique value possible here) that cause problems notably with starbases...

It should be great to have this upgrades_to = { "LARGE_DARK_MATTER_DEFLECTOR", "LARGE_PSI_SHIELD" } to be able to create forks in the tech tree...
 
  • 4
  • 1Like
Reactions:

Wewius

Sergeant
38 Badges
Sep 24, 2016
57
29
  • Stellaris: Synthetic Dawn
  • Cities: Skylines Deluxe Edition
  • Magicka
  • Age of Wonders III
  • Stellaris
  • Cities: Skylines Industries
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Stellaris: Galaxy Edition
  • Cities: Skylines
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2
  • Cities: Skylines - After Dark
  • Magicka 2: Ice, Death and Fury
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Megacorp
  • Stellaris - Path to Destruction bundle
I'm not up to date will all information. Did we get a release date for Nemesis? A rough estimate?
 

DrNukeLear

Colonel
80 Badges
Jan 27, 2019
933
1.076
  • Stellaris: Necroids
  • Stellaris: Ancient Relics
  • Stellaris: Federations
  • Europa Universalis IV
  • Hearts of Iron IV: Expansion Pass
  • BATTLETECH: Flashpoint
  • Shadowrun: Hong Kong
  • BATTLETECH
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Surviving Mars
  • Cities: Skylines - Parklife
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Megacorp
  • Crusader Kings II: Reapers Due
  • BATTLETECH - Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Crusader Kings II: Holy Fury
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Cities: Skylines - Campus
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Prison Architect: Psych Ward
  • Island Bound
  • Teleglitch: Die More Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Victoria 2
  • Cities: Skylines - Snowfall
  • War of the Roses
  • Crusader Kings II: Conclave
  • Magicka 2: Ice, Death and Fury
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
prerequisites = {
OR = {
tech_basic_industry
tech_some_alternatives
}
}
would be nice where it's looking for an array of techs.
 
  • 3
  • 2Like
Reactions:

Miles Invictus

Second Lieutenant
44 Badges
Aug 15, 2014
101
108
  • Europa Universalis III
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Stellaris: Distant Stars Pre-Order
  • Imperator: Rome
  • Stellaris: Megacorp
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV
  • Stellaris: Galaxy Edition
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Pre-order
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
So does the fix to the Juggernaut mean that modded Juggernauts (e.g. the Warbarge from ACOT/AOT) will have their proper ingame icons register, rather than be blank and/or missing entirely?
 

GnoSIS

Major
20 Badges
Jan 27, 2009
573
915
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Warlock 2: Wrath of the Nagas
  • Victoria: Revolutions
  • Stellaris - Path to Destruction bundle
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Warlock 2: The Exiled
  • Victoria 2
  • Stellaris: Synthetic Dawn
Great changes!

Can we please have some more updated documentation?
 
  • 2
Reactions:

James Fire

Lt. General
51 Badges
Jan 30, 2018
1.441
632
  • Crusader Kings II
  • Magicka 2
  • Stellaris: Synthetic Dawn
  • Stellaris: Humanoids Species Pack
  • Stellaris
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Conclave
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun: Dragonfall
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis III: Collection
  • Cities: Skylines
  • Semper Fi
  • Cities: Skylines - Snowfall
  • Majesty 2 Collection
  • Crusader Kings II: The Old Gods
  • Europa Universalis III
  • Divine Wind
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Heir to the Throne
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Legacy of Rome
  • New effects to export various game values to variables have been added. These are: export_modifier_to_variable (check_modifier_value trigger also exists now), export_resource_stockpile_to_variable, export_resource_income_to_variable
You could have done just this change, and so any modders would have worshipped you.
 
  • 2
  • 1Like
Reactions:

Irbynx

Private
74 Badges
May 23, 2019
10
56
  • Europa Universalis IV: Rights of Man
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Conclave
  • Shadowrun: Dragonfall
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Green Cities
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Lithoids
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Stellaris: Ancient Relics
  • Cities: Skylines - Parklife Pre-Order
  • Europa Universalis IV: Rule Britannia
  • Imperator: Rome
  • Crusader Kings III
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Dharma
  • Cities: Skylines - Campus
  • Imperator: Rome - Magna Graecia
  • Stellaris: Federations
  • Teleglitch: Die More Edition
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Legacy of Rome
This is all pretty solid. One question/request though - are bilateral/unilateral diplomatic actions (such as Open Borders, Propose Trade deal, etc) going to be more moddable? If not, you should really consider changing that, because I thought it'd be possible since Federations dropped. I would love to be able to actually add more of those.

Also, since the question of framework for nemesis was raised, is it possible to *not* replace the Nemesis system and instead make your own sort of nemesis? Without overwriting the existing nemesis?
 
  • 4Like
Reactions:

Caligula Caesar

Stellaris Technical Scripter
64 Badges
Nov 1, 2014
703
873
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Third Rome
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III
  • Europa Universalis IV: Pre-order
  • Hearts of Iron IV: Cadet
  • Stellaris: Lithoids
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Common Sense
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings III
  • Stellaris: Federations
  • Age of Wonders: Planetfall
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
If you can fix the fact that when checking for an undefined scripted trigger, it always returns true, this would help a lot for cross-mods scripting. :)

I'm not sure I know what you mean, would that be like saying "my_trigger = yes" where "my_trigger" does not exist?

To make sure i'm not jumping to conclusions... does this now mean we can read in game variables (e.g. current mineral production) and convert those in to named variables for use in maths operations? Like export_resource_income_to_variable will read in my "unity income = +43" and update my variable to read "mymod_unity_var = 43" Big if true.
Yep, you can do exactly that.

To clarify this, could we duplicate the object container & tab in the UI to make multiple trees? without overwriting the Nemesis tree?
Lets say I want the Nemesis crisis to be a thing, but I also want to have a separate ... skill tree, that does other things, like specialising your fleet (E.g. You could invest a point in to Kinetic/Missile/Strikecraft/Energy and flesh out a fleet doctrine that way, earning points for winning wars. A "warmongers" tree, if you will.).
You can only have one at once for a country, but it would not be beyond the realms of possibility to make different ones for different countries. Certain UI aspects probably won't accept triggered text at the moment, though, so they'd probably have to be fairly similar.

I made a suggestion recently to add scopes or effects for the galaxy map to let us spawn entities or ambient objects, pegged to stars' XYZ Coordinates, as part of a wormhole drive mod i've been working on. The aim being to spawn pre-2.0 style radial effects on the galaxy map (or show a radius of effect for megastructures affects etc).
I've not had a chance to trawl that attached trigger list heavily yet, but would this separation of galaxy/system planet open up a possible method for spawning sprites/ambient objects on the gal map? (i'm assuming "galaxy_planet" means a star-system object on the galaxy map?)
galaxy_planet = any planet in the galaxy

In what ways does this improve the game? For example, does this improve some of the AI ship movements?

Since many of us cannot enjoy the game without proper AI mods like Starnet anymore, but Starnet itself cannot make the AI smarter in terms of some hard-coded fleet movement, is this going to improve the game? Also is this going to improve the Crisis AI to the level it should be? And is this going to teach the Crisis AI how to not fly their construction ships from one end of the galaxy to another, spending ingame years and not expanding at all?
In many ways. Script is how many of the more visible bits of the game (e.g. all event popups you see) work, so doing improvements to it allows us (and modders) to generally be able to produce stuff of a higher quality.
 
  • 22
  • 3Like
  • 1Love
Reactions:

Caligula Caesar

Stellaris Technical Scripter
64 Badges
Nov 1, 2014
703
873
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Third Rome
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III
  • Europa Universalis IV: Pre-order
  • Hearts of Iron IV: Cadet
  • Stellaris: Lithoids
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Common Sense
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings III
  • Stellaris: Federations
  • Age of Wonders: Planetfall
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • 7Like
  • 6Haha
  • 4
Reactions:

Caligula Caesar

Stellaris Technical Scripter
64 Badges
Nov 1, 2014
703
873
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Third Rome
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Europa Universalis III
  • Europa Universalis IV: Pre-order
  • Hearts of Iron IV: Cadet
  • Stellaris: Lithoids
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Common Sense
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Crusader Kings III
  • Stellaris: Federations
  • Age of Wonders: Planetfall
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
So does the fix to the Juggernaut mean that modded Juggernauts (e.g. the Warbarge from ACOT/AOT) will have their proper ingame icons register, rather than be blank and/or missing entirely?
Yes
 
  • 15Like
  • 1
Reactions:

OldEnt

First Lieutenant
44 Badges
Aug 12, 2019
245
325
  • Magicka
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Dharma
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Golden Century
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Pre-order
  • Stellaris: Megacorp
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
Last edited:
  • 5
Reactions:

Dark_wing

Sergeant
32 Badges
Jun 19, 2016
58
48
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • Stellaris: Distant Stars
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Age of Wonders III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Leviathans Story Pack
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Europa Universalis IV
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
These are very interesting changes, thanks a lot!
Could you elaborate on fire_on_action a little bit more?

Does this allow for arbitary scripted on actions like CK3s scripted on_actions?
 
Last edited:
  • 1Like
Reactions:

RafaelRamus

Corporal
22 Badges
Dec 10, 2020
25
37
  • Stellaris: Synthetic Dawn
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Steel Division: Normandy 44 -  Back to Hell
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Steel Division: Normand 44 - Second Wave
  • Dungeonland
  • Steel Division: Normandy 44
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Sword of the Stars II
  • Sword of the Stars
This has got to be the most underappreciated dev diary I have ever come across.

Great stuff, I'm positively impressed!
 
  • 5
  • 4Like
Reactions:

Guilliman88

Planet Modifier Guy
41 Badges
Mar 21, 2015
538
350
  • Magicka
  • Stellaris
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Apocalypse
  • BATTLETECH - Digital Deluxe Edition
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • BATTLETECH: Season pass
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • BATTLETECH: Heavy Metal
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • BATTLETECH
  • Surviving Mars
  • Age of Wonders III
  • Stellaris: Ancient Relics
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Age of Wonders: Planetfall - Revelations
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
I see I will be doing a lot of

CTRL + F
replace all

:)

Very much deep thanks for the massive work Caligula! The variable changes in particular are an amazing addition! I know a lot of fellow modders are eagerly waiting for those!
 
  • 8Like
Reactions:

OldEnt

First Lieutenant
44 Badges
Aug 12, 2019
245
325
  • Magicka
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Dharma
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Golden Century
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Crusader Kings III
  • Stellaris: Necroids
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Pre-order
  • Stellaris: Megacorp
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
Will these script changes positively affect performance?
Yes, since any/random/every_planet effect/trigger cannot be used on a whole galaxy scale now, as it is now its own, separate thing. This means content creators and modders won't be able to execute a check on a whole galaxy by accident.
 
  • 3
Reactions: