There are a number of conditions you could use to define when the AI would or could gain additional money. It comes down to personal preference on how you write the script. If you wanted the AI to gain money dependant on number of settlements it owns then something like...
Code:
monitor_event FactionTurnStart not FactionIsLocal
and FactionType spain
and LosingMoney
and Treasury < 0
if I_NumberOfSettlements spain = 1
add_money spain 2000
end_if
if I_NumberOfSettlements spain = 2
add_money spain 4000
end_if
if I_NumberOfSettlements spain = 3
add_money spain 6000
end_if
if I_NumberOfSettlements spain = 4
add_money spain 8000
end_if
end_monitor
would suffice... The above code would give spain 2000 florins for every settlement it owned.
ofcourse, that script would end up being rather long and may slow your turn timing down, so setting the number of settlements to >, < would help in shortening it. Such as...
Code:
monitor_event FactionTurnStart not FactionIsLocal
and FactionType spain
and LosingMoney
and Treasury < 0
if I_NumberOfSettlements spain < 6
add_money spain 5000
end_if
if I_NumberOfSettlements spain > 5
and I_NumberOfSettlements spain < 11
add_money spain 10000
end_if
if I_NumberOfSettlements spain > 10
and I_NumberOfSettlements spain < 16
add_money spain 15000
end_if
if I_NumberOfSettlements spain > 15
and I_NumberOfSettlements spain < 21
add_money spain 20000
end_if
end_monitor
Which would cover more settlements and shorten the script. Every 5 settlements would gain thew AI 5000.
You could also base the entire script on how many settlements the player has and give each AI faction money dependant on how powerful the player is. Which would in itself make the AI challenging even when the player has 30+ settlements. You would just need the first part of the script to track which faction is the local faction.