I know, I know, there are a bizillion threads talking about this error, but I couldn't find any that applies to my situation or with a solution that works for me. I've also checked the Wiki on scripting. So...
First, what I want to do is access a variable from a script (NOT a room script) that is declared in the global script. So I did this:
Code: ags
Code: ags
Code: ags
Code: ags
The script order is:
AnotherScript
GlobalScript
The code compiles without any errors, but when I run the game, it crashes with the dialog "Script link failed: Runtime error: unresolved import 'THING'"
What I'm doing wrong?
PD: I'm using AGS 3.3.3.0
First, what I want to do is access a variable from a script (NOT a room script) that is declared in the global script. So I did this:
// GlobalScript.asc
int THING = 1;
export THING;
// GlobalScript.ash
// empty (I don't want to access THING from room scripts, so I don't have to import it here, right?
// AnotherScript.ash
import int THING;
// AnotherScript.asc
// ... some code ...
THING = 2;
// ... more code ...
The script order is:
AnotherScript
GlobalScript
The code compiles without any errors, but when I run the game, it crashes with the dialog "Script link failed: Runtime error: unresolved import 'THING'"
What I'm doing wrong?
PD: I'm using AGS 3.3.3.0