What's compiled is the main() (or startingConditional...) routine. As long as you only have one such in the namespace of the file you are compiling then it gets compiled into an executable script. If you don't have main or startingconditional then nothing is compiled. But the compiler needs to read the file (and any include files and any include files in those files...) before it can know if there's a main or not.
There is nothing per se that indicates a given file is an "include" file or not.
@Funky: what happens when building the module gets to that include script of yours though? It will try to compile it and since there are no bodies for all those routines which are supposed to be defined by the including script it will
fail. Do you limit your compilation to specific scripts or is that what skywings compile somehow helps out with?
Building the module? Heh. We haven't been able to do that since...2007, I think? If you use NWNTX you can use Skywings compiler in the toolset. We have no need to build the entire module each time we update, though we do compile all scripts before upping a build to our live servers, just as good practice. Aside from the last time we added custom factions, which was a couple years back, all we do is compile, really. Using the default compiler, our module would crash half a thousand different ways at least. We use nonstandard for loops, which it doesn't allow (think for(oItem = GetFirstItemInInventory(oPC);GetIsObjectValid(oItem);GetNextItemInInventory(oPC)) {//dostuff} ), #pragmas (the examples above), thousands more identifiers than it allows...the list goes on and on. Long story short: use Skywings compiler. Being able to compile in prefixed batches (think all scripts beginning with fky_chat, for example) is a huge advantage in its own right. It also catches all kinds of coding errors the vanilla compiler doesn't, which can create stack over- and under-flows and all sorts of zanyness. Skywing is the man. Use his compiler. Use.. it... @.@
Hell, we can't even use the erf'er anymore. Copy out of temp0, is how we do exports. Though we were doing that since well before we couldn't use the erf'er, anyway, so I suppose it doesn't matter.
As far as your specific question, about lacking 'bodies', look at the code I posted. Each of those persisten aoe scripts compiles its own ncs, because each has its own group of functions with a void main(). The subfunctions in that void main differ from script to script, is all. Think of how the scripts would look if the include was inserted at the top of each. Like so:
////
function declarations
void main, using those functions
function implementations
////
The declarations and void main are in the include;the implementations are in the individual aoe scripts.
Funky