So I seem to remember that most of the wall types have an issue with archers being able to fire over them. Which is a common defense in fortifications.
I’ve been watching Three Kingdoms. There was an ambush on Zhou Yu by Cao Ren, about midway through the series. And that made me think of a possible solution.
If possible, create a section of wall with three “murder hole” windows in it. It should be the length of three ordinary wall pieces. You interact with this and place an Archer thrall into the slot, as if it were a crafting station.
This creates the archer to patrol these openings. When an enemy is within range/sight of that particular section of wall, the archer inside goes into his firing animation at the windows, but doesn’t fire any arrows. It only looks as if he is, for the benefit of those watching on the inside.
On the outside, the arrows are launched from the section of wall itself, as if it were a siege weapon, almost. It’s something of an illusion.
You station the thrall, and it looks like he’s doing the firing, but the firing mechanic is coming from the wall itself, and only when the conditions are met.
That being 1) an archer thrall must be placed in the GUI, 2) an enemy or creature must be within the sight lines of the wall itself.
It might be too difficult to work out the coding, or too big a draw on resources, I’m not entirely sure on those counts. However it could be a rather elegant solution, and a somewhat better way to create your defenses.
You could also make it a one-to-one ratio, where it’s a single wall panel in size, with one archer per panel. But that could lead to some lag in having too many of them placed. The 3x1 method above was meant to offset this by forcing you to have a much larger building, or sacrifice the number of archer points you had overall.
A 2x1 sized wall piece could work as well. One archer could cover both openings. The wall would fire an arrow at the same rate as a single NPC archer.