1. Update v2.0.5:
  2. New Defines
  3. BATTLE_COMMANDER_ESCAPE_CAPTURE
  4. If the loser army was not overrun, a random integer will do a module check against this value
  5. If the rolled value is less than the charisma of the army leader, they will charm their way out of the situation and avoid capture
  6.  
  7.  
  8. BATTLE_COMMANDER_CAPTURE_MARTIAL_CHECK
  9. This check is done if no charming out of the situation has happened before, and is only done if the winning army has a valid leader. If there are no leaders on the winning side this check is not done
  10. Mercenaries cannot be captured this way and are excluded from this check
  11. If the loser army was overrun OR if a random rolled integer with a modulo against this define is smaller than half the martial value of the highest martial winning commander, the loser commander gets captured
  12.  
  13.  
  14. BATTLE_MIN_CASUALTIES_IMPACT
  15. Casualties impact is always the difference of tactics between the armies of the countries involved
  16. This defines a minimum amount of casualties that will always happen regardless of the difference
  17.  
  18.  
  19. BATTLE_NO_POPULARITY_LOSS_IF_RATIO_AS_ATTACKER
  20. If the attacker has this many times more units than the defender and loses, there is no popularity loss
  21.  
  22.  
  23. BATTLE_NO_POPULARITY_LOSS_IF_RATIO_AS_DEFENDER
  24. If the defender has this many times more units than the attacker and loses, there is no popularity loss
  25.  
  26.  
  27. END_OF_COMBAT_STRENGTH_RATIO_MODIFIER
  28. This amplifies the strength ratio by the given define, so it increases or decreases the impact that the ratio has for end of combat morale boost
  29.  
  30.  
  31. END_OF_COMBAT_MORALE_BOOST_MAX
  32. This defines up to how much of the total morale a unit can regain at the end of combat
  33.  
  34.  
  35. MINIMUM_LOSS_RATIO_THRESHOLD_FOR_BATTLE_RESULT
  36. The battle result is only stored if this number is surpassed for losses in combat
  37.  
  38.  
  39. OVERRUN_FACTOR_FOR_INITIAL_CHECK
  40. This is checked once at the start of combat, if the difference is equal to or bigger than this the enemy army is instantly overrun
  41.  
  42.  
  43. TAG_LIMIT
  44. This controls how many countries can be created at maximum during a session. It allows each mod to customize the amount based on their needs. This does impact performance
  45.  
  46.  
  47. These defines were previously hardcoded and inaccessible to be changed. They have now been exposed for you to play around with. The explanations for this are also present as comments in 00_defines.txt
  48.  
  49. New Effects
  50. Scope: Character
  51.  
  52. set_can_inherit = bool
  53. The game plays as usual when this is set to true for a character. However when set to false the character cannot inherit anything anymore unless it is set to true again. This includes worldly possessions as well as leadership of a country. When this is set to false successors for the country are instantly recalculated.
  54.  
  55.  
  56. set_can_marry = bool
  57. The game plays as usual when this is set to true for a character. However this allows modders to play around with marriage, as setting this to false means the character can never marry, unless it is set to true again.
  58.  
  59.  
  60. Scope: Country
  61. allow_trade_goods = goods
  62. disallow_trade_goods = goods
  63. These two allow/disallow the AI from trading away the goods specified. This allows modders to add more interesting gameplay elements around trade.
  64.  
  65. Trade goods can be found in common/trade_goods. A valid example is grain
  66.  
  67. call_omen = deity_category
  68. This instantly calls an omen for the given deity category. The same way a player would do it from the UI, but there is no cost associated with it.
  69.  
  70. Deity categories can be found in common/deity_categories. A valid example is economy
  71.  
  72. end_truce = country
  73. This instantly ends the truce that the scope country has with the target country. Truces are unilateral in nature, so both countries may have a truce with one another or it is possible for only one if the countries involved to have a truce with the other.
  74.  
  75.  
  76. start_character_interaction = { type = character_interaction, character = character }
  77. This allows you to start an interaction with the target character, as a player usually would via the UI. This allows mods to further customize the experience without necessarily having to touch the UI, or by making actions available that were previously only available through UI or with cumbersome scripts.
  78.  
  79. Character interactions can be found in common/character_interactions. A valid example is adopt_to_family
  80.  
  81. Scope: CountryCulture
  82.  
  83. set_levy_template = template
  84. This allows you to change the levy template for a culture in a specific country without touching the same culture in other countries, allowing you to reward players for specific behavior. It is important to note here that there are various tooltips in the game that show a culture´s composition that will not properly reflect changes from this, as they have no context for which country the composition is being displayed. The Raise Levy tooltip will always reflect the proper value.
  85.  
  86. Levy templates can be found in common/levy_templates. A valid example is levy_anatolian
  87.  
  88. Scope: Province
  89.  
  90. start_building_construction = building
  91. cancel_building_construction = building
  92. These two start/cancel the construction of a building in the given province.
  93.  
  94. Buildings can be found in common\buildings. A valid example is fortress_building
  95.  
  96. change_climate = climate
  97. You can change the climate of the province to one of the following: mild_winter, normal_winter, severe_winter, arid and none
  98.  
  99.  
  100. Scope: War
  101.  
  102. war_score_value = { target = country, local_var = name }
  103. This will save the war score of the target country that is a participant in the war scope that you are in to the local variable with the name provided. The variable does not have to exist yet. So if you are ROM, fighting against TRE, and you fetch the war score value of TRE, it will save their war score against the enemy war leader (ROM in this case if you are the war leader). So it will be the inverse of what you see as a player of ROM.
  104.  
  105.  
  106. New Triggers
  107. Scope: Character
  108.  
  109. can_inherit = bool
  110. Simple trigger that returns the value previously set by can_inherit. It returns true by default.
  111.  
  112.  
  113. can_marry = bool
  114. This checks against the value that has previously been set by set_can_marry, but it also checks the default marriage conditions. This has allowed us to improve some of the script for the game, to simplify the marriage checks and unify them. To make it easier for modders to adopt the changes, here is a document that has all of the relevant script changes from the base game:
  115. https://docs.google.com/document/d/1Ft_BPHm-dWB-IuJ9o8UG4cAutb79tP7jzsVffxvsCXA
  116.  
  117.  
  118.  
  119. Scope: Country
  120.  
  121. has_claim = province
  122. Checks if the country has a claim on the given province.
  123.  
  124.  
  125. is_trade_goods_allowed = goods
  126. Checks if the given trade goods are allowed to be traded away by the scope country. This can be modified with the effects listed above.
  127.  
  128. Trade goods can be found in common/trade_goods. A valid example is grain
  129.  
  130.  
  131. Scope: Province
  132.  
  133. is_holy_site_of_deity = deity
  134. Checks if the given province is a holy site for the given deity.
  135.  
  136. Deities can be found in common/deities. A valid example is deity_alilat
  137.  
  138. is_holy_site_of_religion = religion
  139. Checks if the given province is a holy site for the given religion.
  140.  
  141. Religions can be found in common/religions. A valid example is roman_pantheon
  142.  
  143. General Modding
  144.  
  145. Added modifier script access, on the scopes that have modifiers: country, character & province. Accessible via modifier:modifier_name
  146. Added MakeScopeBool, MakeScopeFlag, MakeScopeValue
  147. Added SetVariableIf, SetOrToggle, ClearVariableIf, ClearMultipleVariables to the VariableSystem
  148. Added support for optional exists equality operator ?=
  149. Added support for save_scope_value_as and save_temporary_scope_value_as
  150. Added script list region_governorship
  151. The automatic legacy character setup conversion has been moved to a console command: legacy_character_setup_conversion
  152. The setup editor no longer automatically saves every time a province is selected. It now uses the console command only.
  153. Made religion_category customizable, so mods can add new categories. Also made it localizable: religion_category_X and religion_pantheon_X where X is the category name
  154. Religions can now also be customized with is_monotheistic
  155. Added error logs to the set_party_leader effect
  156. Fixed every_province, random_province and any_province: they now work properly
  157. Updated script_docs to report the proper modifier categories, and this also supports showing multiple categories now that they are used for
  158. Omen and construction costs have been removed when called from script, so that custom costs may be assigned
  159. Added GetLevyTemplate to CountryCulture promote
  160.  
  161.  
  162.  
  163. GUI
  164. SetHighlightGovernorship = governorship and SetHighlightState = state have been added
  165. PdxGuiWidget.CountVisibleChildren and PdxGuiWidget.GetChildrenCount have been added
  166. GetGlobalVariable and GetGlobalList have been added
  167. AddList has been added
  168. Added GetLevyTemplate to CountryCulture, as unlike the one from a country, this takes into account the one set via set_levy_template
  169. Other
  170. has_culture_group and set_country_religion now support more than just hardcoded values, they now have scope support
  171. Added Log.ClearAll & Log.ClearErrorLog console commands
  172. Overlords can now construct buildings in certain subject types, set with can_build in the subject type
  173.  
  174.  
  175.  
  176. The Rest
  177.  
  178. AI
  179. The AI now disbands units created via create_unit effect and will no longer keep them around forever and unnecessarily hurt its own economy
  180.  
  181.  
  182. Multiplayer
  183. Moving pops too quickly, like mass moving slaves would previously cause you to pay for the move but not actually move any pops. This has been fixed, it will now always move the pop if it can, and if it cannot, like if the player clicked more often than pops are available to move, then no cost will be deducted
  184.  
  185.  
  186. Combat Simulator
  187. Fixed up combat simulator crashes. Also enhanced functionality:
  188. location = province has moved to being defined once per simulation instead of per unit.
  189. is_player_attacker = bool has been added so choosing a battle side is now possible that way.
  190. enemy = country has been added. This means you can simulate combat against other nations. If those are non-barbarian nations and no war exists, a war will be declared automatically.
  191.  
  192.  
  193. GUI
  194. The Find dialog will now also return governorships and states in addition to the previous result types
  195. Added climate map mode
  196.  
  197.  
  198. Other
  199. Overlords can now construct buildings in certain subject types
  200. Holdings are now removed properly when characters move countries or the province changes owners. This fixes an issue where third party country provinces are dragged into an unrelated war. Also only owner-controlled provinces join civil wars now.
  201. Fixed location of Sparta so that it does not visually disappear when a road is built through the province
  202. Various script fixes related to marriage checks, and adjusted to the new can_marry trigger
  203. Arrange marriage now available in countries with custom ruler setups, it is now allowed for the ruler family instead of just close relatives
  204. Mercenaries can no longer be marriage targets
  205. Fixed a crash that would occur for players using mods that do not have certain gfx assets available, for example from the free DLC
  206. Revolt countries now instantly recalculate their cached data, this fixes various issues like integrated cultures and levies now being correct instead of only being at the right value at the next monthly tick
  207. Fixed tooltip that stated achievements would only work with no mods enabled. The tooltips now represent the correct state, which was changed with 2.0.4, as they can be gained with mods
  208. Fixed 3D map objects like forts and ports not being removed when a province is decolonized. Also now instantly recalculates province dominant culture, religion and modifiers when pops are removed
  209. Fixed governor policies script bug with country cultures
  210. Fixed befriending script bug not being removed properly on ruler change
  211. Fixed DECLWAROTHER_MAP being displayed unlocalized on the map, this only worked correctly in the French language before
  212. When switching from a government with a co-ruler to a government without one. The existing co-ruler is now removed properly, and will no longer stick around forever causing issues
  213. Fixed crash on peace offer, when the country to receive a state was not the same as the one making the offer, and the offering country had no province in the area
  214. Secondary war participants now also see peace deals as popups
  215. Prevented the game from crashing when exceeding tag limit
  216. Fixed most issues with the formable Crete tag because the tag started with an invalid character