Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Theme on Thu 20/10/2005 00:22:18

Title: Another question bout importing variables
Post by: Theme on Thu 20/10/2005 00:22:18
I'm trying to import a variable declared in the global script to a module
but im getting error  >:(

// Script header for module 'WalkToInteraction'
import int chargoing;


// main global script file
int chargoing = 0;

export chargoing;


o/
Title: Re: Another question bout importing variables
Post by: strazer on Thu 20/10/2005 01:02:02
You can't do that. Modules are loaded before the global script so in modules, you can only import stuff from preceding modules.

What you could do is define and export the variable in the module, then import it in the global script header.
Did you know that you can use rep_ex, on_mouse_click etc. in modules as well?
Title: Re: Another question bout importing variables
Post by: Theme on Thu 20/10/2005 01:37:30
thanks again!
I didnt know that

o/