So I've written up the basics of a dejure territory or planet culture system, which will track current owners + former owner of a world (and if I can work this out for 3.0 upto the last 5 owners of a world) + their holding period
Essentially I can say something like:
We see my empire (UCID = 2) founded this colony on month 151, which is when it took control of it too. It is also the current and only known owner of it.
colony founded date in human form = 151/12+2200 = 2212.58 = 05.2212 -- the maths for 151 > 05.2212 can be done in a scripted localisation.
These can be used to compute planet loyalty to one empire or another, so after you annex a world
And this all works - more or less, its a bit hackish with the 2.8x scripts (cant wait for those variable scripts in 3.0, even if it means rewriting the 5 pages ive written today).
My real issue is in presenting this in the UI.
I know, with a bit of work, I could create an event window that fires whenever you activate a planet decision ("GIVE ME PLANET INFO NAO") and prints this out for the player to read (Get Former Owner UCID, Search all countries till you find the empire that matches up with the code, print its name - fallback = "A lost Empire" if that country is dead).
But using a popup is clunky and means doing "Decisions > GIVE INFO" regularly for updates. A better way would be to contain this all in a special tooltip in a planet modifier on the main planet screen, so you just mouse over the "Planet Info" modifier and read the tooltip.
There is only one planet modifier I know of that can read another nation's name (or even get its flag) and print it in a tooltip. The occupation modifier. I also know its possible to make custom tooltips for events
So there must be a way to do this... I'm trying to copy how the planet occupation code works, but it doesnt seem to exist anywhere in the game files?
Literally all I find on it is a "Country" Variable [ $ |Y$ just sets the font colour to yellow] in the localisation files (and a static modifier that isnt useful to me).
But no scripts or files that say how it figures out that country or scopes to it? Or even how it dynamically grabs its flag?
Does anyone know how to create dynamic scripted tooltips ON Planet Modifier Icons to reference other scopes/ countries? (Essentially running an event IN a tooltip) I have a feeling the occupation modifier is hardcoded which lets it do this, but wanted to check if anyone knew first, before falling back on making a planet decision/popup menu.
Essentially I can say something like:
- Empire X colonised this world in 2209.03,
- Empire X2 annexed it in 2246.11,
- Empire X reclaimed it in 2301.02,
- Empire X4 annexed it in 2400.12
- Empire X5 was gifted it as part of a vassalisation in 2555.04
- And a bunch of other variables (like the relative control period between 2209.03 and 2246.11, or the number of times a planet changed hands in X years)
- This is handled by giving every empire its own Unique Country ID (UCID) and tracking this globally - along with a serial dating system - basically my own implementation of country IDs, as, when modding, you cant really do anything with coutntry IDs directly.
We see my empire (UCID = 2) founded this colony on month 151, which is when it took control of it too. It is also the current and only known owner of it.
colony founded date in human form = 151/12+2200 = 2212.58 = 05.2212 -- the maths for 151 > 05.2212 can be done in a scripted localisation.
These can be used to compute planet loyalty to one empire or another, so after you annex a world
- its population are openly hostile to you, causing debuffs (like primitive culture shock)
- its population Will remember its former owner AND is still loyal to its former owner (the degree to which scales with size of planet population + length of former owners control over the planet)
And this all works - more or less, its a bit hackish with the 2.8x scripts (cant wait for those variable scripts in 3.0, even if it means rewriting the 5 pages ive written today).
My real issue is in presenting this in the UI.
I know, with a bit of work, I could create an event window that fires whenever you activate a planet decision ("GIVE ME PLANET INFO NAO") and prints this out for the player to read (Get Former Owner UCID, Search all countries till you find the empire that matches up with the code, print its name - fallback = "A lost Empire" if that country is dead).
But using a popup is clunky and means doing "Decisions > GIVE INFO" regularly for updates. A better way would be to contain this all in a special tooltip in a planet modifier on the main planet screen, so you just mouse over the "Planet Info" modifier and read the tooltip.
There is only one planet modifier I know of that can read another nation's name (or even get its flag) and print it in a tooltip. The occupation modifier. I also know its possible to make custom tooltips for events
Code:
custom_tooltip_with_params - Displays a specific localization string with parameters in tooltip
custom_tooltip_with_params = {
description = <loc key>
description_parameters = {
<value key> = <string/int/num/bool>
}
}
Supported Scopes: all
country_list_tooltip - Prints a list of the countries that match the limit triggers in a tooltip, each separated by a line break.
country_list_tooltip = { limit = { <triggers> } }
Supported Scopes: all
owned_planet_list_tooltip - Prints a list of the country's planets that match the limit triggers in a tooltip, each separated by a line break.
owned_planet_list_tooltip = { limit = { <triggers> } }
Supported Scopes: country
Literally all I find on it is a "Country" Variable [ $ |Y$ just sets the font colour to yellow] in the localisation files (and a static modifier that isnt useful to me).
But no scripts or files that say how it figures out that country or scopes to it? Or even how it dynamically grabs its flag?
Does anyone know how to create dynamic scripted tooltips ON Planet Modifier Icons to reference other scopes/ countries? (Essentially running an event IN a tooltip) I have a feeling the occupation modifier is hardcoded which lets it do this, but wanted to check if anyone knew first, before falling back on making a planet decision/popup menu.
Last edited:
- 2