New condition
I_SettlementUnderSiege <settlement|local> is true while the settlement is besieged. not works.
if I_SettlementUnderSiege Capua
console_command rtwr_log Capua is under siege
end_ifWithout the DLL the script stops at this line.
A fixed condition
not I_CompareCounter does nothing in the base game. To make it negate, set this:
[script_fixes]
not_compare_counter=1It's off by default because old scripts rely on the bug.
Town numbers from counters
Store these on a settlement. The game uses them everywhere: riots, growth, the treasury, the AI and the window.
store_counter po_law_add settlement l_ten ; +10% public order
store_counter po_squalor_set settlement l_zero ; no squalor
store_counter growth_total_set settlement l_six ; exactly +3% growth (0.5% steps)
store_counter income_total_add settlement l_500 ; +500 denarii a turn| Prefix | Unit | Factors |
|---|---|---|
po_<factor>_add, _set | percent | garrison law happiness governor tax_bonus triumph wonder boom entertained health squalor distance culture no_governance tax_penalty turmoil underpopulation besieged blockaded recession governor_unrest leader_unrest total |
growth_<factor>_add, _set | 0.5% steps | farming farms imports health buildings tax_bonus disbands slavery squalor plague tax_penalty disasters recruits total |
income_<type>_add, _set | denarii | farms taxes mining trade buildings admin merchants corruption games devastation total |
They apply the next time the settlement is worked out, or at once with rtwr_settlement_refresh <settlement|all>.
Hordes
A persistent counter gives a horde a target region. The highest value wins, and 0 turns it off.
declare_persistent_counter horde_target_huns_Dacia
set_counter horde_target_huns_Dacia 20AI generals
ai_army_target <general> <settlement> is stored on the general as the counter ai_target_<settlement>, so a script can set it too.
Banner icons
A counter on a general draws data/ui/banner_pips/<name>.tga above his stars. Needs [banner_pips] enabled=1.
store_counter pip_veteran character l_oneSet by Aqueduct
| Counter | Where | What |
|---|---|---|
rtwr_ui_selected | settlement | 1 on the settlement whose button was pressed |
<decision>_taken | persistent | a once decision was taken |
res_<resource>, trade_income | settlement | goods and trade, with rtwr_trade.txt |
res_total_<resource>, res_group_<n>_<resource>, trade_income_total | persistent, once declared | |
cu_<culture>, cg_<group> | settlement | culture and group shares, in tenths of a percent |
stks_<good> | settlement | turns in a row its region went short |
crown_level, crown_authority, ... | persistent, declared by you | see A crown and its satraps |
Conditions in data files
rtwr_ui.txt, rtwr_economy.txt, rtwr_stock.txt, rtwr_villages.txt and rtwr_needs.txt share these. Up to 8, all must hold. In the economy, stock and needs files, join them with when a and b.
| Condition | Holds when |
|---|---|
owner, not_owner | the settlement is the player's |
faction a b, not_faction a b | the faction is one of these |
player, not_player | the faction is human |
capital, not_capital | it's the owner's capital |
settlement <name> | it's this settlement |
settlement_min town, settlement_max city | by size: village town large_town city large_city huge_city |
building <level>, no_building <level> | that level or higher |
resource <name>, no_resource <name> | the region has it, hidden ones too |
my_counter > 0, s:label = 1, treasury >= 500 | a counter, a stored counter, money; = != < <= > >= |
turn >= 10 | the campaign's turn |
owner_towns > 5 | the owner's settlements |
seat_distance > 3 | regions from the owner's seat |
province_whole, not_province_whole, province_held > 1, province_share >= 50 | with provinces |
stock grain >= 100, stock_here grain >= 10, stock_short grain, not_stock_short grain | with rtwr_stock.txt |
pops slaves > 20 | with rtwr_pops.txt |
satisfaction * < 30, satisfaction_of gallic * < 30, supplied x, unsupplied x | with rtwr_needs.txt |
districts > 1, districts_used > 1, districts_free > 0 | with rtwr_slots.txt |
In texts
{my_counter}, {s:label}, {treasury}, {turn}, {owner_towns}, {province}, {province_name}, {province_held}, {province_total}, {province_share}, {stock:grain}, {stock_net:grain}, {stock_here:grain}, {districts}, {districts_used}, {districts_free}.
{province} also works inside counter names and events: show_if edict_{province} > 0.