This thread contains both a CvGameCoreDLL ModComp (CivCounter) and a python/XML ModComp that requires it (Grigori Adventurer Counter). Both are described in this post.
CivCounter
CivCounter is a ModComp created by Valkrionn for the Rise from Erebus ModMod. This CvGameCoreDLL ModComp adds the following methods to CyPlayer: getCivCounter, changeCivCounter, setCivCounter, getCivCounterMod, changeCivCounterMod and setCivCounterMod. These methods can be used to consult and modify an internal counter associated to each player. These methods are exposed to Python.
This number can be used for things like triggering a certain event for a specific civilization when the value reaches a certain point. You can check the Rise from Erebus ModMod to check some examples of its usage, but I ported it to More Naval AI because I also wanted to adapt Rise from Erebus' Grigori Adventurer mechanic to it.
Grigori Adventurer Counter
With this ModComp, Grigori Adventurers are no longer generated by the Great Person Point mechanic. This prevents the "Great Person Point" pollution issue that Grigori always had with Adventurers. This mechanic was designed and implemented for Rise from Erebus, this is just an adaptation to More Naval AI. Check these pages for more details about the original implementation: Grigori Overhaul and Grigori Adventurers. How my adaptation works is described below:
Adventurers are created in the Grigori capital when the Adventurer counter (shown at the upper left part of the screen) reaches a certain value. Whenever the player gets a new adventurer, the value required to get the next adventurer will increase.
All cities can increase the global counter, depending on their buildings. The Grigori Palace gives the highest increase (40 points each turn), while the Adventurers' Guild, the National Epic and the Heroic Epic increase the counter by 20 each turn. Command Posts increase the counter in 6 each turn. Buildings that allow to build units allowed as upgrades for Adventurers (Archery Ranges, Hunting Lodges, Infirmaries, Mage Guilds, Stables and Training Yards) increase the counter only by 1 each, but many of them can be built on every city.
The Grigori get a Courthouse replacement, called the Citizen's forum. In addition to the regular Courthouse effects, the Citizen's Forum allows each one of the Specialists of the city it has been built in to increase the Adventurer Counter in 1 every turn. The Citizen's forum can be built faster by Philosophical leaders. The Grigori Tavern no longer has any special abilities, but it increases the adventurer counter in 10 each turn.
Finally, certain civics such as Republic and Pacifism multiply the rate at which the Adventurer counter increases each turn by 1.10. The Grigori world spell, Ardor, now allows to reset both the Great Person count and the Adventurer Counter. Note that all of these values are specified for Normal game speed, and they will scale if a different game speed is chosen.
Download
This download includes both ModComps. To get CivCounter you only need the CvGameCoreDLL files; the rest are for the Grigori Adventurer Counter. The DLL has been compiled with r1281 of More Naval AI, and therefore it should be compatible with MNAI 2.41. Feedback is welcome
EDIT: The download attached to this post is outdated, both because of the version of More Naval AI that it was made for and that it does not include more recent changes. My most recent version of CivCounter is included in ExtraModMod, which is available here. If you only want to get Civcounter or AdventurerCounter to use them in other mods, you can extract its source code following these steps:
1) Download ExtraModMod source code, which is always bundled with ExtraModMod releases found here: ExtraModMod downloads page. If you want the latest development version, you can also click on "Download repository".
2) Once you have the source code downloaded and uncompressed, the first step would be extracting the CivCounter changes and moving them to your mod. You can find them searching by CivCounter in the CvGameCoreDLL. All code related to CivCounter is between tags like these ones:
3) If you only want CivCounter, you can stop here. For AdventurerCounter, you can search by AdventurerCounter in the XML and python folder. For python, the changes are between tags like these:
In XML, the related code is between tags like the following ones:
CivCounter
CivCounter is a ModComp created by Valkrionn for the Rise from Erebus ModMod. This CvGameCoreDLL ModComp adds the following methods to CyPlayer: getCivCounter, changeCivCounter, setCivCounter, getCivCounterMod, changeCivCounterMod and setCivCounterMod. These methods can be used to consult and modify an internal counter associated to each player. These methods are exposed to Python.
This number can be used for things like triggering a certain event for a specific civilization when the value reaches a certain point. You can check the Rise from Erebus ModMod to check some examples of its usage, but I ported it to More Naval AI because I also wanted to adapt Rise from Erebus' Grigori Adventurer mechanic to it.
Grigori Adventurer Counter
With this ModComp, Grigori Adventurers are no longer generated by the Great Person Point mechanic. This prevents the "Great Person Point" pollution issue that Grigori always had with Adventurers. This mechanic was designed and implemented for Rise from Erebus, this is just an adaptation to More Naval AI. Check these pages for more details about the original implementation: Grigori Overhaul and Grigori Adventurers. How my adaptation works is described below:
Adventurers are created in the Grigori capital when the Adventurer counter (shown at the upper left part of the screen) reaches a certain value. Whenever the player gets a new adventurer, the value required to get the next adventurer will increase.
All cities can increase the global counter, depending on their buildings. The Grigori Palace gives the highest increase (40 points each turn), while the Adventurers' Guild, the National Epic and the Heroic Epic increase the counter by 20 each turn. Command Posts increase the counter in 6 each turn. Buildings that allow to build units allowed as upgrades for Adventurers (Archery Ranges, Hunting Lodges, Infirmaries, Mage Guilds, Stables and Training Yards) increase the counter only by 1 each, but many of them can be built on every city.
The Grigori get a Courthouse replacement, called the Citizen's forum. In addition to the regular Courthouse effects, the Citizen's Forum allows each one of the Specialists of the city it has been built in to increase the Adventurer Counter in 1 every turn. The Citizen's forum can be built faster by Philosophical leaders. The Grigori Tavern no longer has any special abilities, but it increases the adventurer counter in 10 each turn.
Finally, certain civics such as Republic and Pacifism multiply the rate at which the Adventurer counter increases each turn by 1.10. The Grigori world spell, Ardor, now allows to reset both the Great Person count and the Adventurer Counter. Note that all of these values are specified for Normal game speed, and they will scale if a different game speed is chosen.
Download
This download includes both ModComps. To get CivCounter you only need the CvGameCoreDLL files; the rest are for the Grigori Adventurer Counter. The DLL has been compiled with r1281 of More Naval AI, and therefore it should be compatible with MNAI 2.41. Feedback is welcome
EDIT: The download attached to this post is outdated, both because of the version of More Naval AI that it was made for and that it does not include more recent changes. My most recent version of CivCounter is included in ExtraModMod, which is available here. If you only want to get Civcounter or AdventurerCounter to use them in other mods, you can extract its source code following these steps:
1) Download ExtraModMod source code, which is always bundled with ExtraModMod releases found here: ExtraModMod downloads page. If you want the latest development version, you can also click on "Download repository".
2) Once you have the source code downloaded and uncompressed, the first step would be extracting the CivCounter changes and moving them to your mod. You can find them searching by CivCounter in the CvGameCoreDLL. All code related to CivCounter is between tags like these ones:
Code:
/*************************************************************************************************/
/** CivCounter 10/27/09 Valkrionn **/
/** Stores Spawn Information **/
/*************************************************************************************************/
Code:
/*************************************************************************************************/
/** CivCounter END **/
/*************************************************************************************************/
3) If you only want CivCounter, you can stop here. For AdventurerCounter, you can search by AdventurerCounter in the XML and python folder. For python, the changes are between tags like these:
Code:
#AdventurerCounter Start (Imported from Rise from Erebus, modified by Terkhen)
Code:
#AdventurerCounter End
In XML, the related code is between tags like the following ones:
Code:
<!-- AdventurerCounter Start (Imported from Rise from Erebus, modified by Terkhen) -->
Code:
<!-- AdventurerCounter End -->