Quote Originally Posted by Duke John
BI introduces factionwide checks for traits. So instead of checking each spy just see if an agent has the Has-seen-stone-walls trait exists and if so allow stone walls to be built by building the "invisible" building in all provinces (not exactly invisible since you will have a blank space, which really shows if it's inbetween visible buildings).

The option suggested by apalca works very neat for humans, but the AI does nothing with it so you are probably better off making it more automatic.
Yes, I like Alpaca's approach for humans and in the same time for AI this should be automatic.

Here's how I'd do it (he, he, I might even do it for Imperium: TW, in which case both Monkwarrior and Alpaca will show up on the credits list).

1. Build a trigger for "stonewall bulider" ancillary, based on the EndedInSettlement and BuildingPresent conditions. We need an ancillary because BI comes with the FactionwideAncillaryExists condition;
2. Write a piece of code like: monitor_condition FactionwideAncillaryExists stonewall_builder ... end_monitor. If the stonewall builder exists the code takes every city on the map, checks if belongs to the current faction (SettlementIsLocal), if the "invisible building" is not yet present (not BuildingPresent) and if the faction has enough money to pay for the services of the "stonewall builder" (Treasury). If all the conditions are met the "invisible building" is built and the cash is subtracted fromt the treasury.

To do the same piece of work in RTW automaticly would be a major pain in the butt because each character name would need to be checked to see if he is a spy and has that particular ancillary. Not to mention that if by bad luck we have 2 spies with the same name, the code would check only one of them so it might miss the "stonewall builder".