Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: simulacra on Tue 11/01/2005 18:56:15

Title: Problem with function call from hotspot (SOLVED)
Post by: simulacra on Tue 11/01/2005 18:56:15
I have implemented the sgs_load(); function and call it from a GUI, where it functions without problems. However, when I call the function from a hotspot (in the main menu), I get a "Undefined token" error.

What could be wrong?
Title: Re: Problem with function call from hotspot
Post by: Scorpiorus on Tue 11/01/2005 19:10:38
That's because your room script (where hotspot is) doesn't see the sgs_load() function which is in the global script.

To make it accessible from all room scripts put the following line into the script header:

import function sgs_load();
Title: Re: Problem with function call from hotspot
Post by: simulacra on Tue 11/01/2005 19:16:10
That fixed it! Thank you. I thought the global script was globally accessible.