PDA

View Full Version : Variable access question


Yorick
30th May 2008, 01:56 PM
Say I have 2 custom packages – customtools.u and customplayer.u.

In customplayer there is customplayercontroller.uc that needs to access a variable declared (within a class) inside customtools.

I’ve tried using the full path (i.e. customtools.toolclass.variablename) within customplayercontroller.uc, but that gives a compiler error saying that it isn’t recognized.

Is there a way to do this I'm missing? I’d rather not combine customtools and customplayer into one package so that they can access each other’s methods and global variables.

Thanks,
Ian

Wormbo
30th May 2008, 02:05 PM
If you want two classes to share their variables, they must be in the same package. Packages may only form a dependency tree, cyclic dependencies are not possible.

Yorick
2nd Jun 2008, 12:43 PM
Thanks for your help!

-Ian