ACC.exe: #import ignores #included files?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
AFADoomer
Posts: 1326
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

ACC.exe: #import ignores #included files?

Post by AFADoomer »

Not 100% sure where to post this...

I have a script library that includes a bunch of other files for organization's sake. When compiled as-is and included in LOADACS, everything works fine and as expected in game.

If I try to import the library into a map's ACS (e.g, '#import "source/whatever.acs"'), everything will compile fine if I only use functions or variables that are directly in the top-level library file. If I try to reference a variable that is in one of the #included files, then ACC throws an error.

Example Library:

Code: Select all

#library "TEST"
#include "zcommon.acs"
#include "otherfile.acs" //(where otherfile.acs declares function testfunc and int testvar2).

int testvar1;
Example map ACS:

Code: Select all

#import "source/test.acs"
#include "zcommon.acs"

script 100 (void) { testvar1 = 5; } // This compiles fine
script 200 (void) { testvar2 = 5; } // This throws an error
script 300 (void) { testfunc(); } // This throws an error
Is this expected or normal behavior? Am I doing something wrong?

EDIT: For reference, here's the actual library script from Blade of Agony that is behind the question.
Post Reply

Return to “Scripting”