CerealPencil

Mod events txt file

Jul 4th, 2026
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.04 KB | None | 0 0
  1. namespace = tbop
  2.  
  3. country_event = {
  4. #tbop_threat: base threat from this country to others ((tbop_fl / tbop_rival_fl*1.5) * tbop_threat_modifier)
  5. #tbop_threat_modifier: modifiers to the base value (1 + tbop_fdev_ratio)
  6.  
  7. #tbop_fl: FL of the country and its non colonial subjects
  8. #tbop_rival_fl: FL of biggest rival and its non colonial subjects
  9. #tbop_twice_fl: 2x tbop_fl, determining the maximum size for someone to feel threatened
  10.  
  11. #tbop_development: development, discounted heathen TC of the country and its non colonial subjects
  12. #tbop_foreign_dev: foreign development, discounted heathen TC of the country and its non colonial subjects
  13. #tbop_fdev_ratio: foreign dev ratio (tbop_foreign_dev / tbop_development)
  14. #tbop_fdev_ratio_percent: foreign dev in % (tbop_fdev_ratio * 100)
  15.  
  16. #tbop_threat_limit: value used for AI to not be expansionist anymore (unused)
  17.  
  18. id = tbop.01
  19.  
  20. hidden = yes
  21.  
  22. trigger = {
  23. OR = {
  24. AND = {
  25. is_month = 0
  26. NOT = { is_month = 1 }
  27. NOT = { has_country_flag = tbop_tick }
  28. }
  29. NOT = { has_country_flag = tbop_set }
  30. }
  31. }
  32.  
  33. mean_time_to_happen = {
  34. days = 0
  35. }
  36.  
  37. immediate = {
  38. set_country_flag = tbop_tick
  39.  
  40. #country development and FL
  41. set_variable = {
  42. which = tbop_development
  43. value = 0
  44. }
  45. set_variable = {
  46. which = tbop_foreign_dev
  47. value = 0
  48. }
  49. export_to_variable = {
  50. which = tbop_fl
  51. value = land_forcelimit
  52. who = ROOT
  53. }
  54.  
  55. #add development and foreing dev
  56. every_owned_province = {
  57. limit = {
  58. OR = {
  59. NOT = { is_owned_by_trade_company = yes }
  60. religion_group = ROOT
  61. }
  62. }
  63.  
  64. export_to_variable = {
  65. which = tbop_development
  66. value = development
  67. }
  68.  
  69. if = {
  70. limit = { culture_group = owner }
  71.  
  72. set_variable = {
  73. which = tbop_foreign_dev
  74. value = 0
  75. }
  76. }
  77. else = {
  78. export_to_variable = {
  79. which = tbop_foreign_dev
  80. value = development
  81. }
  82. }
  83.  
  84. ROOT = {
  85. change_variable = {
  86. which = tbop_development
  87. which = PREV
  88. }
  89.  
  90. change_variable = {
  91. which = tbop_foreign_dev
  92. which = PREV
  93. }
  94. }
  95. }
  96.  
  97. #add non colonial or tributary subject dev
  98. every_country = {
  99. limit = {
  100. is_subject_of = ROOT
  101. NOT = { is_subject_of_type = colony }
  102. NOT = { is_subject_of_type = tributary_state }
  103. has_country_flag = tbop_set
  104. }
  105.  
  106. ROOT = {
  107. change_variable = {
  108. which = tbop_development
  109. which = PREV
  110. }
  111.  
  112. change_variable = {
  113. which = tbop_foreign_dev
  114. which = PREV
  115. }
  116.  
  117. change_variable = {
  118. which = tbop_fl
  119. which = PREV
  120. }
  121. }
  122. }
  123.  
  124. set_country_flag = tbop_set
  125.  
  126. #rivals development
  127. set_variable = {
  128. which = tbop_rival_fl
  129. value = 0
  130. }
  131.  
  132. # while = {
  133. # limit = {
  134. # any_country = {
  135. # is_rival = ROOT
  136. # NOT = { has_country_flag = checked_by@ROOT }
  137. # has_country_flag = tbop_set
  138. # }
  139. # }
  140.  
  141. tbop_rival_calculation = yes
  142. # }
  143.  
  144. # every_country = {
  145. # limit = { has_country_flag = checked_by@ROOT }
  146.  
  147. # clr_country_flag = checked_by@ROOT
  148. # }
  149.  
  150. #calculate foreign development ratio
  151. set_variable = { which = tbop_fdev_ratio value = 0 }
  152. change_variable = { which = tbop_fdev_ratio which = tbop_foreign_dev }
  153. divide_variable = { which = tbop_fdev_ratio which = tbop_development }
  154.  
  155. #calculate foreign development %
  156. set_variable = { which = tbop_fdev_ratio_percent value = 0 }
  157. change_variable = { which = tbop_fdev_ratio_percent which = tbop_fdev_ratio }
  158. multiply_variable = { which = tbop_fdev_ratio_percent value = 100 }
  159.  
  160. #calculate threat modifier from foreign development
  161. set_variable = { which = tbop_threat_modifier value = 1 }
  162. change_variable = { which = tbop_threat_modifier which = tbop_fdev_ratio }
  163.  
  164. #calculate threat
  165. set_variable = { which = tbop_threat value = 0 }
  166. if = {
  167. limit = {
  168. check_variable = { which = tbop_rival_fl value = 1 }
  169. }
  170.  
  171. change_variable = { which = tbop_threat which = tbop_fl }
  172. divide_variable = { which = tbop_threat which = tbop_rival_fl }
  173. multiply_variable = { which = tbop_threat value = 25 } # previously it was at 150%, now it's 200%
  174. #divide_variable = { which = tbop_threat value = 3 }
  175. multiply_variable = { which = tbop_threat which = tbop_threat_modifier }
  176. }
  177.  
  178. #set 2x FL for AE calculation
  179. set_variable = { which = tbop_twice_fl value = 0 }
  180. change_variable = { which = tbop_twice_fl which = tbop_fl }
  181.  
  182. if = {
  183. limit = {
  184. check_variable = { which = tbop_threat value = 1 }
  185. }
  186.  
  187. tbop_AE_from_threat = yes
  188.  
  189. }
  190. }
  191.  
  192. option = {
  193. custom_tooltip = tbop_test2
  194. ai_chance = { factor = 100 }
  195. }
  196. }
  197.  
  198. country_event = {
  199.  
  200. id = tbop.02
  201.  
  202. hidden = yes
  203.  
  204. is_triggered_only = yes
  205.  
  206. mean_time_to_happen = {
  207. days = 0
  208. }
  209.  
  210. immediate = {
  211. #get a value for AE
  212. set_variable = { which = tbop_current_AE value = 0 }
  213. get_AE = yes
  214. # multiply_variable = { which = tbop_current_AE value = -1 }
  215.  
  216. #get threat value
  217. set_variable = { which = tbop_actual_threat value = 0 }
  218. change_variable = { which = tbop_actual_threat which = FROM }
  219.  
  220. if = {
  221. limit = { NOT = { is_rival = FROM } }
  222.  
  223. divide_variable = { which = tbop_actual_threat value = 2 }
  224.  
  225. set_variable = { which = tbop_dist_op_modifier value = 1 } #total modifier
  226. FROM = {
  227. export_to_variable = { #opinion is from +25% at -200 to -25% at +200
  228. which = temp
  229. value = opinion
  230. who = ROOT
  231. }
  232. }
  233. set_variable = { which = tbop_opinion value = 0 }
  234. set_variable = { which = temp value = 0 }
  235. change_variable = { which = temp which = FROM }
  236. change_variable = { which = tbop_opinion which = temp }
  237. #change_variable = { which = tbop_opinion which = tbop_current_AE }
  238. divide_variable = { which = tbop_opinion value = 800 }
  239. export_to_variable = { #distance is up to -50% at 400
  240. which = tbop_distance
  241. value = border_distance
  242. who = FROM
  243. }
  244. divide_variable = { which = tbop_distance value = 800 }
  245. subtract_variable = { which = tbop_dist_op_modifier which = tbop_opinion } # 1 - opinion
  246. subtract_variable = { which = tbop_dist_op_modifier which = tbop_distance } # - distance
  247.  
  248.  
  249. #conditions for christian, hindu, muslim and chinaware
  250. # if = {
  251. # limit = {
  252. # religion_group = christian
  253. # ROOT = { NOT = { religion_group = christian } }
  254. # }
  255. # change_variable = { which = tbop_dist_op_modifier value = 0.25 }
  256. # }
  257. if = {
  258. limit = {
  259. religion = FROM
  260. FROM = {
  261. religion_group = muslim
  262. government_rank = 3
  263. }
  264. }
  265. change_variable = { which = tbop_dist_op_modifier value = -0.5 }
  266. }
  267. if = {
  268. limit = { religion_group = dharmic }
  269. change_variable = { which = tbop_dist_op_modifier value = -0.5 }
  270. }
  271. if = {
  272. limit = {
  273. religion_group = eastern
  274. ROOT = { is_emperor_of_china = yes }
  275. }
  276. change_variable = { which = tbop_dist_op_modifier value = -0.5 }
  277. }
  278.  
  279. #if >2x FROM's FLs, multiply by (this_fl / from_fl)
  280. FROM = {
  281. set_variable = { which = temp value = 0 }
  282. change_variable = { which = temp which = tbop_fl }
  283. }
  284. set_variable = { which = temp value = 0 }
  285. change_variable = { which = temp which = FROM }
  286. multiply_variable = { which = temp value = 2 }
  287. if = {
  288. limit = { NOT = { check_variable = { which = temp which = tbop_fl } } }
  289. change_variable = { which = tbop_dist_op_modifier which = -1 }
  290. #set_variable = { which = tbop_dist_op_modifier value = 0 }
  291. }
  292.  
  293.  
  294. multiply_variable = { which = tbop_actual_threat which = tbop_dist_op_modifier }
  295. }
  296. else = {
  297. multiply_variable = { which = tbop_actual_threat value = 1.25 }
  298. }
  299.  
  300. set_variable = { which = tbop_count value = 0 }
  301. while = {
  302. limit = {
  303. # has_global_flag = tbop_all_set
  304. # threat > AE
  305. check_variable = {
  306. which = tbop_actual_threat
  307. which = tbop_current_AE
  308. }
  309.  
  310. #count < 10
  311. NOT = {
  312. check_variable = {
  313. which = tbop_count
  314. value = 10
  315. }
  316. }
  317. }
  318.  
  319. add_opinion = {
  320. who = FROM
  321. modifier = aggressive_expansion
  322. }
  323.  
  324. #AE++, count++
  325. change_variable = { which = tbop_current_AE value = 1 }
  326. change_variable = { which = tbop_count value = 1 }
  327. }
  328.  
  329. # give_AE = yes
  330. # give_AE = yes
  331. # give_AE = yes
  332. # give_AE = yes
  333. # give_AE = yes
  334. # give_AE = yes
  335. # give_AE = yes
  336. # give_AE = yes
  337. # give_AE = yes
  338. # give_AE = yes
  339.  
  340. FROM = {
  341. divide_variable = { which = tbop_twice_fl value = 2 }
  342. }
  343. }
  344.  
  345. option = {
  346. ai_chance = { factor = 100 }
  347. }
  348. }
  349.  
  350. # country_event = {
  351.  
  352. # id = tbop.03
  353.  
  354. # is_triggered_only = yes
  355.  
  356. # mean_time_to_happen = {
  357. # days = 0
  358. # }
  359.  
  360. # immediate = {
  361. # export_to_variable = {
  362. # which = opinion_1
  363. # value = opinion
  364. # who = BUR
  365. # }
  366.  
  367. # BUR = {
  368. # export_to_variable = {
  369. # which = opinion_2
  370. # value = opinion
  371. # who = ROOT
  372. # }
  373. # }
  374.  
  375.  
  376. # FROM = {
  377. # add_treasury = 100000
  378. # }
  379. # }
  380.  
  381. # option = {
  382. # ai_chance = { factor = 100 }
  383. # }
  384. # }
  385.  
  386. country_event = {
  387.  
  388. id = tbop.03
  389. # id = tbop.04
  390. title = tbop.03.t
  391. desc = tbop.03.d
  392. picture = GOOD_WITH_MONARCH_eventPicture
  393.  
  394. is_triggered_only = yes
  395.  
  396. mean_time_to_happen = {
  397. days = 0
  398. }
  399.  
  400. option = {
  401. name = tbop.03.a
  402.  
  403. custom_tooltip = tbop_ev_threat #"Total Threat: §g§!\n"
  404.  
  405. custom_tooltip = tbop_ev_calc #"§gThreat sets the minimum value for Aggresstive Expansion with this nation.\nIt is calculated from the ratio of our complete Force Limit and our Rival's complete Force Limits combined (being 25 at 1:1).\nThat value is modified by the percentage of foreign development within our nation or our non tributary nor colonial subjects.\nComplete Force Limit is the value form that nation and its non tributary nor colonial subjects combined.§!"
  406. custom_tooltip = tbop_threat #"Base Threat: §g§!\nFrom:"
  407. custom_tooltip = tbop_fl #"-Our Force Limit: §g§!"
  408. custom_tooltip = tbop_rival_fl #"-Our Rival's Force Limit: §g§!"
  409. custom_tooltip = tbop_fdev_ratio_percent #"-Modified by §g§! from foreign development\n"
  410.  
  411. if = {
  412. limit = { has_country_flag = tbop_not_rival }
  413.  
  414. custom_tooltip = tbop_ev_modifier #"Since this nation is not our rival, the base value is halved to §g§! and further modified by §g§! from:"
  415. custom_tooltip = tbop_ev_opinion #"-Opinion: §g§!"
  416. custom_tooltip = tbop_ev_distance #"-Border Distance: §g§!"
  417.  
  418. if = {
  419. limit = { has_country_flag = tbop_muslim_mod }
  420. custom_tooltip = tbop_muslim_mod #"-We are a Muslim Empire of same faith: §G-50%§!"
  421. }
  422. if = {
  423. limit = { has_country_flag = tbop_indian_mod }
  424. custom_tooltip = tbop_indian_mod #"-They follow a Dharmic Religion: §G-50%§!"
  425. }
  426. if = {
  427. limit = { has_country_flag = tbop_mandate_mod }
  428. custom_tooltip = tbop_mandate_mod #"-We are The Emperor of China and their faith respect it: §G-50%§!"
  429. }
  430. if = {
  431. limit = { has_country_flag = tbop_small_mod }
  432. custom_tooltip = tbop_small_mod #"-We are too weak: §G-100%§!"
  433. }
  434. }
  435. else = {
  436. custom_tooltip = tbop_ev_rival
  437. }
  438.  
  439. clr_country_flag = tbop_not_rival
  440. clr_country_flag = tbop_muslim_mod
  441. clr_country_flag = tbop_indian_mod
  442. clr_country_flag = tbop_mandate_mod
  443. clr_country_flag = tbop_small_mod
  444.  
  445.  
  446. ai_chance = { factor = 100 }
  447. }
  448. }
  449.  
  450. # # country_event = {
  451.  
  452. # # id = tbop.03
  453.  
  454. # # hidden = yes
  455.  
  456. # # trigger = {
  457. # # always = no
  458. # # }
  459.  
  460. # # mean_time_to_happen = {
  461. # # days = 10
  462. # # }
  463.  
  464. # # immediate = {
  465. # # random_country = {
  466. # # country_event = {
  467. # # id = tbop.04
  468. # # }
  469. # # }
  470. # # }
  471.  
  472. # # option = {
  473. # # ai_chance = { factor = 100 }
  474. # # }
  475. # # }
  476.  
  477. # # country_event = {
  478.  
  479. # # id = tbop.04
  480.  
  481. # # hidden = yes
  482.  
  483. # # trigger = {
  484. # # always = no
  485. # # }
  486.  
  487. # # mean_time_to_happen = {
  488. # # days = 0
  489. # # }
  490.  
  491. # # immediate = {
  492. # # FROM = { add_treasury = 50 }
  493. # # }
  494.  
  495. # # option = {
  496. # # random_country = {
  497. # # limit = {
  498. # # NOT = {
  499. # # has_opinion_modifier = {
  500. # # who = ROOT
  501. # # modifier = aggressive_expansion
  502. # # value = 0
  503. # # }
  504. # # }
  505. # # }
  506. # # custom_tooltip = tbop_test
  507. # # }
  508. # # ai_chance = { factor = 100 }
  509. # # }
  510. # # }
  511.  
  512. # # country_event = {
  513.  
  514. # # id = tbop.05
  515.  
  516. # # hidden = yes
  517.  
  518. # # trigger = {
  519. # # always = no
  520. # # }
  521.  
  522. # # mean_time_to_happen = {
  523. # # days = 0
  524. # # }
  525.  
  526. # # immediate = {
  527. # # every_country = {
  528. # # country_event = {
  529. # # id = tbop.01
  530. # # }
  531. # # }
  532. # # }
  533.  
  534. # # option = {
  535. # # ai_chance = { factor = 100 }
  536. # # }
  537. # # }
  538.  
  539. country_event = {
  540.  
  541. id = tbop.99
  542.  
  543. hidden = yes
  544.  
  545. trigger = {
  546. is_month = 1
  547. has_country_flag = tbop_tick
  548. }
  549.  
  550. mean_time_to_happen = {
  551. days = 0
  552. }
  553.  
  554. immediate = {
  555. clr_country_flag = tbop_tick
  556. }
  557.  
  558. option = {
  559. ai_chance = { factor = 100 }
  560. }
  561. }
Advertisement
Add Comment
Please, Sign In to add comment