lvjtn wrote: ↑2019-11-10 16:57, Sunday
randowe wrote: ↑2019-11-10 13:53, Sunday
Is it possible to have no-read lines in the names.txt?
...
So i want to ask if it is possible to divide the nations with no-read lines like in the other text files. Something like:
***1***Slovakia***********
***8***Germany***********
it seems it's not possible, though the idea is great!
Currently the leader name is assigned when a leader is raised by this formula (inherit from Pg2):
Code: Select all
leader->id = unit->country*31+RollDice(0,30);
leader->name = text of the leader->id line of names.txt
That is: the first 31 entries are not used at all.
Names.txt is opened whenever a new leader is raised to load the line according the "leader->id" assigned and then is closed.
That "leader->id" is stored in the savegames, so when a savegame is reloaded, names.txt is opened again and the the "leader->name" is retrieved from the line pointed by the "leader->id" stored.
btw. i always thought the first 31 lines are the generic names what opengen use for the nations not having leader names. but now i made a quick test files with only 62 lines, and opengen doesn't use the first 31 lines for nation #10. is it a bug, or the role of the first 31 lines is something else?
Names.txt is the same than used by PG2 ... and first 31 entries was not used by PG2 either.
Once said this ...
To remove the unused 31 entries, names.txt should be converted to NamesEx.txt
To allow inserting comments at start of country's names entries in names.txt or namesEx.txt, by using starting tokens in lines to be skipped (like *** or whatever) I'd only need to tweak the code to figure the random leader->id inside the function in charge of reading the text file (names/namesEx).
The only drawback could be that leaders' names in existing savegames (xsav, xcsv, xeml) will load a different leader name if their efile's name/namesEx text file is modified to include commented (***) lines.
![Howdy :howdy](./images/smilies/em_howdy.gif)