Adding and removing region icons and modifiers

Moderator: Pocus

Post Reply
kronenblatt
General - Carrier
General - Carrier
Posts: 4779
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Adding and removing region icons and modifiers

Post 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
Screenshot_20200606-092823_Drive.jpg (57.88 KiB) Viewed 2201 times
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Pocus
Ageod
Ageod
Posts: 7704
Joined: Tue Oct 02, 2012 3:05 pm

Re: Adding and removing region icons and modifiers

Post 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.
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
kronenblatt
General - Carrier
General - Carrier
Posts: 4779
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Adding and removing region icons and modifiers

Post by kronenblatt »

Excellent: thanks! I've found these things and believe I'm getting the hang on it.
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
kronenblatt
General - Carrier
General - Carrier
Posts: 4779
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Adding and removing region icons and modifiers

Post 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
20200608_010627.jpg (78.71 KiB) Viewed 2164 times
20200608_010700.jpg
20200608_010700.jpg (77.76 KiB) Viewed 2164 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?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Pocus
Ageod
Ageod
Posts: 7704
Joined: Tue Oct 02, 2012 3:05 pm

Re: Adding and removing region icons and modifiers

Post 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.
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
kronenblatt
General - Carrier
General - Carrier
Posts: 4779
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Adding and removing region icons and modifiers

Post 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...
Last edited by kronenblatt on Mon Jun 08, 2020 9:38 am, edited 1 time in total.
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Pocus
Ageod
Ageod
Posts: 7704
Joined: Tue Oct 02, 2012 3:05 pm

Re: Adding and removing region icons and modifiers

Post by Pocus »

indeed they are, please check the sticky and rework your mod using the good practices I advise :wink:

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 :mrgreen:
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
kronenblatt
General - Carrier
General - Carrier
Posts: 4779
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Adding and removing region icons and modifiers

Post 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 :mrgreen:
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... :)
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
kronenblatt
General - Carrier
General - Carrier
Posts: 4779
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Adding and removing region icons and modifiers

Post 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/.
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Pocus
Ageod
Ageod
Posts: 7704
Joined: Tue Oct 02, 2012 3:05 pm

Re: Adding and removing region icons and modifiers

Post by Pocus »

indeed!
AGEOD Team - Makers of Kingdoms, Empires, ACW2, WON, EAW, PON, AJE, RUS, ROP, WIA.
Post Reply

Return to “MOD”