I was trying to find a way to be able to check if AI has any ships, and if not, spawn them new ones, which is of course more effective than just giving them ships time from time. As for some factions it may be essential for their AI to have some. And in case they are also bankrupted fir example, they are done for.
I think, this is the only way? (I tested it, works)
Code:
;------------------------------------------
Trigger naval_gunner_vnv_trigger2
WhenToTest AgentCreated
Condition IsAdmiral
AcquireAncillary naval_navigator chance 100
;------------------------------------------
Trigger naval_gunner_vnv_trigger2
WhenToTest CharacterTurnEnd
Condition IsAdmiral
AcquireAncillary naval_navigator chance 100
;------------------------------------------
Trigger shipwright_vnv_trigger3
WhenToTest NewAdmiralCreated
Condition IsAdmiral
AcquireAncillary naval_navigator chance 100
(one of them may be redundant)
And script
Code:
monitor_event CharacterTurnStart not CharacterIsLocal
and FactionType england
and not FactionwideAncillaryExists naval_navigator
;and RandomPercent > 75
campaign_wait 0.1
spawn_army
faction england
character random_name, admiral, age 38, x 230, y 142
traits Sailor 1
unit galleass exp 3 armour 0 weapon_lvl 0
end
end_monitor
So all admirals receive an ancillary, and if the ancillary doesnt exist, the factions gets new ships.
( I havent seen anything similar to this used in any mod, hence Im posting it)
BTW, while at this, it seems that vanilla anc trigger "naval_gunner_vnv_trigger" is broken (it never comes true) tho "shipwright_vnv_trigger" works fine.