Hey all!
Just a question, how can I access functions in the GlobalScript.asc which themselves are in the GlobalScript.asc (in other words, both calling and responding functions are in the GlobalScript.asc). For easy purpose, suppose the function I am currently in is Function 1, and the one I am trying to call is function 2. When I try to run the script, AGS complains that function 2 is an 'unidentified token'. No problemo, I thought, I'll just import it into GlobalScript.ash. Unfortunately, AGS now complains that: 'Already referenced name as import'.
So now I'm a bit stuck., how can I call that function 2?
Thanks in advance for your help.
Geork
Functions can only be used below their declaration.
Simply move function 2 above function 1.
thanks for the info, but unfortunately it seems not to work. maybe I am calling the function wrong, can you simply call:
function2(type);
or something more specific?
thanks
Geork
It should look something like this:
function function2(int param) {
// .. do some stuff here ..
}
function function1(int param) {
// .. do some stuff here ..
function2(param); // call function2
// .. do some more stuff ..
}
If you need both functions to be able to call each other it's possible using a helper function with recursion.
oh whoops! I put below, not above :-\
Anyhoo, thanks for your help! ;D