Page 1 of 1
Adding and removing region icons and modifiers
Posted: Sat Jun 06, 2020 7:33 am
by kronenblatt
I'm looking at maybe creating some new region icons and modifiers to be added and removed, depending on certain circumstances.
How are these region icons (such as in the picture below) added and removed to the region's display?
And how are their modifiers, descriptions and tooltips documented script wise?
An example from the game, pointing me to some files, may suffice.

Thanks!

- Screenshot_20200606-092823_Drive.jpg (57.88 KiB) Viewed 2199 times
Re: Adding and removing region icons and modifiers
Posted: Sun Jun 07, 2020 8:50 am
by Pocus
These are region modifiers. If a region has some, then they are displayed, you don't have to bother yourself about the actual display, you can concentrate on gameplay on this part.
In Events.bsf\Events_TriggerAtStart
line 351 I'm adding an at-start modifier to the Babylon region:
Code: Select all
Region_AddModifier($ID_REG_BABYLONIA, $ID_MOD_REGION_RELIGIOUS_TROUBLES);
You can find modifiers definitions in MODIFIERS.CSV
Its parent file (which is probably not completely up to date) is modifiers.xls in \Data\Database I would advise you check the XLS first, as there are colors ... Once you get the hang on things, edit the CSV as you are sure it is up to date, by definition.
Re: Adding and removing region icons and modifiers
Posted: Sun Jun 07, 2020 1:23 pm
by kronenblatt
Excellent: thanks! I've found these things and believe I'm getting the hang on it.
Re: Adding and removing region icons and modifiers
Posted: Sun Jun 07, 2020 11:09 pm
by kronenblatt
So I've got this working with event script adding modifers for regions. Even the icons!
However, I can't get the Name and Text in place. For none of the modifiers. Two examples below.

- 20200608_010627.jpg (78.71 KiB) Viewed 2162 times

- 20200608_010700.jpg (77.76 KiB) Viewed 2162 times
What am I doing wrong in MODIFIERS.csv? Or elsewhere?
EDIT: I also copied the Text37.txt file into my mod's DATA/TEXT/ and put the information in there. Still doesn't work. Can I have it in a .txt file of its own, under DATA/TEXT/? Or should it be in Text37.txt?
Re: Adding and removing region icons and modifiers
Posted: Mon Jun 08, 2020 7:46 am
by Pocus
You know you'll put some load on the system, if you calculate, for each region, what is its distance to the nearest capital and then add a modifier. At least check reach region once and discard asap all water regions or regions controlled by world factions (they don't have a capital what's more).
You can place you text in any text from 0 to 63 but we prefer to have some reserved for a particular usage (0 is system)
Make sure your text is in a text file, any text file, in the scenario directory. Double check the identifiers you specified for your name and text in modifiers.csv, are they really the same as the ones in your text file?
Check a working modifier and find through notepad++ where is its name (most modifiers don't have a text), then see if you had the same logic for your.
Re: Adding and removing region icons and modifiers
Posted: Mon Jun 08, 2020 8:04 am
by kronenblatt
Pocus wrote: ↑Mon Jun 08, 2020 7:46 am
You know you'll put some load on the system, if you calculate, for each region, what is its distance to the nearest capital and then add a modifier. At least check reach region once and discard asap all water regions or regions controlled by world factions (they don't have a capital what's more).
Thanks. Will double check that. Maybe I should have a duration of eternity (999?) and only remove region modifiers if the situation then changes, still checking each turn?
Pocus wrote: ↑Mon Jun 08, 2020 7:46 am
You can place you text in any text from 0 to 63 but we prefer to have some reserved for a particular usage (0 is system)
Make sure your text is in a text file, any text file, in the scenario directory. Double check the identifiers you specified for your name and text in modifiers.csv, are they really the same as the ones in your text file?
Check a working modifier and find through notepad++ where is its name (most modifiers don't have a text), then see if you had the same logic for your.
Ok, may need some more guidance. Which column/position in the .csv file is the one for name and which one for text? Csv files are notoriously difficult to get an overview of and amend...
Re: Adding and removing region icons and modifiers
Posted: Mon Jun 08, 2020 8:25 am
by Pocus
indeed they are, please check the sticky and rework your mod using the good practices I advise
I believe this will amount the same, that you check the modifier must be removed or that one must be added ... For now don't bother, do your code as a first try, you can refine it later.
Usually people posting photos of their screen are not people able to code anything and are not very computer-savvy

Re: Adding and removing region icons and modifiers
Posted: Mon Jun 08, 2020 10:31 am
by kronenblatt
Pocus wrote: ↑Mon Jun 08, 2020 8:25 amUsually people posting photos of their screen are not people able to code anything and are not very computer-savvy
Ha ha, point taken...

But my reason is valid, since I'm away and my computer doesn't have any WiFi connection so could make any screenshot, thus my photos with my mobil...

Re: Adding and removing region icons and modifiers
Posted: Mon Jun 08, 2020 5:16 pm
by kronenblatt
Pocus wrote: ↑Mon Jun 08, 2020 7:46 am
You can place you text in any text from 0 to 63 but we prefer to have some reserved for a particular usage (0 is system) Make sure your text is in a text file, any text file,
DIRECTLY in the scenario directory.
EDIT: Finally got the text to work for my region modifiers! Put it in
TEXT1.txt, directly within my mod folder under SCENARIOS.

So text files should be located there, it seems, and not under DATA/TEXT/.
Re: Adding and removing region icons and modifiers
Posted: Tue Jun 09, 2020 7:38 am
by Pocus
indeed!