Some buildings, like the Ion Cannon, look the part and do nothing. Making one actually shoot means lining up four things - the weapon, the unit, the button and the requirement. Miss any one and it quietly does not work.
Do not reuse an existing weapon. Take the Yamato Gun and you share it with the Battlecruiser's, so changing yours changes theirs. From index 117 there are unused dummy weapons - Gauss Rifle (Unused) - and that is where a new weapon goes. Copy the Yamato's appearance onto it instead.
- 1Pick an unused weapon past 117 and set its damage, cooldown, range, name and graphics.
- 2Point the building's ground and air weapon at it.
- 3Raise the building's sight range, and match its bonus range to the weapon's.
- 4In the advanced info, make it respond to combat and set its AI the way a Photon Cannon or Sunken is set.
- 5Copy the Photon Cannon's button set onto it.
Set the attack angle to 128. A building cannot turn - it always faces twelve o'clock - so a narrow angle means it only ever shoots what is directly above it.
The last one is the easy one to miss. The Attack (Building) order carries its own requirement, and that list is limited to Cannon, Sunken, Spore, Turret and the traps. Leave your building out of it and it will attack - but it will ignore the player's orders and pick its own targets.
If the requirement space runs out, free some by deleting the entries for traps you are not using. But do not rewrite the requirement table wholesale with values of your own - the order gets refused outright and the unit simply stops doing anything.
FireGraft: button sets and requirements