Hello.
I have an struct which have some methods on it and it can be used from any room of the game.
struct Actions{
import static void Restablecer();
};
But now I am trying to call one of this method from another method not included in a room (in an external script) but AGS don't recognize it. And it says Error (linex): Undefined token 'Actions'
function HangUpPhone() {
Actions.Restablecer();
}
How can resolve this?
In AGS a struct or function is only seen in script where it is declared, or in scripts which are below in the list.
Dialog scripts and room scripts are considered to be below everything else, but do not see each other.
The solution is to reorganize your scripts in an order of dependency, or pick certain structs/functions out into a new script and move it above ones where you have to use these.
Oh great. Now I understand.