Game Development Community

Activating packages and know its status...

by Isaac Barbosa · in Torque Game Builder · 01/23/2007 (10:58 am) · 2 replies

Ok, I know how to activate and deactivate a package. A great functionility for a game...

But I need to know if is possible to do something like this to know is a package is active or not:

if(myPackage == true (active?)
//then do this

I will try to make this possible but if somebody knows how to do this that would be great!

#1
01/23/2007 (1:13 pm)
What I have done is to create a function in each package called Package::getPackage() {...} so I can then say

if (Package::getPackage() == $PACKAGE_A)
// BLAH

#2
01/24/2007 (10:24 am)
Thanks Ben! I wil try that.


deactivatePackage($currentPackage); // deactivates current active package
$actualPackage++; //add one to actualPackage
$currentPackage = conditions @ $actualPackage; //current package is = to $actualpackage
activatePackage($currentPackage);
//this way I can deactivate actual package and activate a new one incrementing the package number.

This has nothing to do with my question, but maybe would be useful :)