About packages
by Manuel F. Lara · in Torque Game Builder · 06/02/2006 (7:22 am) · 4 replies
Is there a way to access the current stack of packages? I mean, being able to pop the last pushed package without knowing its name, and stuff like that?
#2
06/06/2006 (5:05 pm)
$packages = new SimSet(LoadedPackages){
packages = "";
count="0";
};
function AddPackages(%this,%packageName)
{
//Increment Package Count
%this.packages[%this.count] = %packageName;
activatePackage(%packageName);
%this.count++;
}
function RemovePackages(%this,%val)
{
deactivatePackage(%this.packages[%val]);
%this.packages[%val] = "";
}
AddPackages($packages,"myPackage");
//Pop off Most Recent
RemovePackages($packages.count - 1);Something like this is what I'm using, but a bit cleaner....
#3
06/06/2006 (10:53 pm)
Thanks Rodney, very helpful :)
#4
Glad it helped...
06/06/2006 (11:50 pm)
Welcome, you'll want to do some error checking and the counts should be reordered probably.. this was mostly a psuedo example at best ... Glad it helped...
Torque Owner Michael Woerister