Defend the Artillery

Defend the Artillery (displayed as Defend the Artillery at (Location Name)) is a Minutemen radiant quest $$

Detailed walkthrough
After building an artillery piece at a settlement and becoming hostile with the Brotherhood of Steel, this quest can be periodically obtained when talking to Preston Garvey or listening to Radio Freedom. The Sole Survivor is informed that the artillery at an allied settlement is under threat of a Brotherhood attack. Alternatively, the quest may be obtained directly from a settler at a settlement with active artillery.

To proceed with the quest the Sole Survivor must travel to the settlement and talk to their leader, who will give the details: a Brotherhood vertibird has been spotted near the settlement, scoping out the artillery. They will ask the Sole Survivor to help build up the settlement's defenses to protect against the upcoming attack.

After reaching the settlement, the Sole Survivor has 30 (in-game) minutes to prepare for the attack. Regardless of any defenses built, a squad of Brotherhood soldiers will spawn after the 30 minutes have expired and begin attacking the settlement. The Sole Survivor can help eliminate the attackers or let the settlement's defenses handle it. Either way, if the artillery is destroyed the quest will fail.

With the threat neutralized, the Sole Survivor can talk to the settler from before to receive thanks and a reward of ~100 caps. If the quest was given by Preston Garvey, the Sole Survivor must report back to him to turn in the quest; it will be completed immediately upon receiving the reward otherwise.

Bugs
In certain locations, NPCs might spawn in inaccessible locations (for instance, Roger Warwick at Warwick homestead might spawn inside the water cistern). This bug is shared with the other settlement quests.
 * This can be resolved by using the console command to teleport the NPC in question.
 * The Warwick homestead example can be resolved by building stairs into the cistern and a bell outside of it. Using the bell and waiting for an in-game hour (using the Wait option) will cause the NPCs to spawn near the bell.