This line is used in some of the buildings:
Code:
docklands city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and building_present_min_level port port
.
.
All of the EDB should work the same, since you can use hidden_resource and event_counter in both unit and building within the EDB. Then again, stranger things have been possible and simpler things have been impossible. But I'd try using that after the unit. The first one is the building tree and the second is the level of the building.
Alternatively if that doesn't work, you need to set up a long script for every settlement or for specific regions which makes an event_counter trigger. Like:
Code:
monitor_event SettlementTurnEnd SettlementIsLocal
and IsRegionOneOf 1
and SettlementBuildingExists > armory
set_event_counter armory_X(settlement name) 1
end_monitor
Didn't check all of that for accuracy, but you get the general idea.
I intend to use a similar effect to circumvent the need for a castle and city version of recruitment structures by just checking for if there is a castle or city in the settlement, thus eliminating a building tree wasted.