AGS 3.2 RC3 import function in global script [SOLVED - FALSE ALARM]

Started by SpacePaw, Sat 27/02/2010 01:27:16

Previous topic - Next topic

SpacePaw

I think the import function doesn't work for the global script in RC3.

Added in global script asc:

function Foo()
{
 //EMPTY
}

Added in global script ash:

import function Foo();

Added in new script asc:

function CallingFunction()
{
 Foo();
}

Result:

NewScript.asc(4): Error (line 4): Undefined token 'Foo'

Moving import line to new script .ash doesn't help - Script link error when running the compiled game...

Maybe you do things differently now? I didn't use AGS extensively for quite a long time now...

Joe

Functions in AGS must be defined from top to down so you won't be able to create a function in global script to be used in other scripts (the will be accesible from room scripts though) because AFAIK global script is always at the bottom of scripts list.
Copinstar © Oficial Site

RickJ

Quote
Added in new script ...
What is new script, module or room?

Module scripts can't import functions from the global script, room scripts can as JNoe Carl explains. 

SpacePaw

Ah god right -.- thanks I'm so dumb I totally forgot that

SMF spam blocked by CleanTalk