Game Development Community

load variable from a other script

by Martin Edmaier · in Torque Game Engine · 07/26/2002 (1:05 pm) · 2 replies

I want to load a variable from an other script.
Thanks a lot.

#1
07/26/2002 (1:08 pm)
Just exec() the script that contains the variable. (Make sure it's defined as something like $var because the '$' makes it global.)
#2
07/26/2002 (1:09 pm)
not quite sure what you mean, but you can put the variable into a global which will be available to all functions in any script file loaded into Tribes.

So for instance:

$global = %desired_variable;

The $ means it's global, and now you can access $global from any function.