Game Development Community

Question about Packages

by Steve Boris · in Torque Game Engine · 07/17/2003 (4:24 pm) · 2 replies

Ive been playing with the Particle Editor by Eric Forhan and wondering why this piece of code never gets executed.

this is the script ParticleEditorStartUp.cs

// First, load our default particle, emitter, and nodes so we can create new
// particle emitters.
exec("~/ParticleEditor/DefaultParticles.cs");
echo("Default Particles Loaded"); ---->> inserted by me for debugging
exec("./particleEditorLauncher.cs");
//This loads the editor into Torque on startup so that it will work

package particleEditorSetup {
//This function adds the Particle Editor to the Controls option screen so it can be easily rebound
function OptionsDlg::onWake( %this ) {
if($YourKeyRemap !$= "true") {
$RemapName[$RemapCount]="Toggle Particle Editor";
$RemapCmd[$RemapCount]="toggleParticleEditor";
$RemapCount++;
$YourKeyRemap = "true";
}
parent::onWake(%this);
}

//executes all custom datablocks
function DefaultGame::activatePackages(%game)
{
%fileSpec = "~/ParticleEditor/particles/*.cs";
for ( %file = findFirstFile( %fileSpec ); %file !$= ""; %file = findNextFile( %fileSpec ) )
{
exec( %file );
echo("Particle file loaded");---->> inserted by me for debugging

}
echo("No Particle Files Loaded !");---->> inserted by me for debugging

Parent::activatePackages( %game );
}

};

activatepackage( particleEditorSetup );
//This launches all of the above.

when checking the console.log i only see the echo statment at the very top of the script, which makes me believe that the function DefaultGame::activatePackages($game) never gets executed.

even tho the package is activated don't you still have to call the functions from the package.

I Could not find a call to DefualtGame::activatePackages any where in the other script files.

the other question is the Parent::activatePackages( $game ) function ,
who is the parent???

Any help would much appreciated.

#1
07/17/2003 (6:58 pm)
This would most likely be from the fact that the editor was written for Tribes 2, so uses conventions common to Tribes 2 and not Torque.
#2
07/18/2003 (6:15 am)
Thanks LabRat.
I managed to get it running.