Game Development Community

Packages

by Jari · in Torque Game Engine · 08/04/2006 (4:16 am) · 0 replies

Hi,
maybe I have misunderstood how you are supposed to use the packages but this code does not do what I expected:

package testPhase1
{
 function Event::start()
 {
	error("testPhase1");
 }
};

package testPhase2
{
 function Event::start()
 {
	error("testPhase2");

 }
};

package testPhase3
{
 function Event::start()
 {
	error("testPhase3");
 }
};

function testPackage(%triggerPackage)
{
	activatePackage(%triggerPackage);
	Event::start();
	deactivatePackage(%triggerPackage);
}

function test()
{
 testPackage("testPhase2");
 testPackage("testPhase1");
 testPackage("testPhase3");
}

When you call test() it should print "testPhase2" three times.

So is this a bug or am I just trying to use packages in wrong way?

Thanks.