What is the proper way to give a building an attack so it will work properly? (I am posting this on behalf of my spanish modding friend).
None.
Give the building a weapon and attack animations (in iscript.bin). You might have to mess around with AI actions a bit, I'm not sure.
None.
To be more specific, you essentially have to give the building's iscript all of the attack animations that a regular attacking unit has. For instance, you'll need to create/assign animations for the following headers: gndattkinit, gndattkrpt, gndattktoidle. If you want your thingy to attack air separately you'll also need to do stuff for the airattk... headers. Take a look at a simple unit like the vulture or the marine.
None.
Make sure to change the "Attack Angle" of the weapons.dat entry you use to 128. If you don't, there will be a crash unless your building's graphic turns.
None.
Well, that's not the only way to do it (but probably the easiest). You can also give it proper settings in flingy.dat so that it can turn (the graphic itself doesn't need turning frames, only if you check the box in images.dat). In my experience, I haven't seen it crash from having too small of an attack angle, but it does make it so the building can only fire at things north of it if the building cannot turn and the angle is too small.
None.