Game Development Community

Schedule / Unknown Command

by Jeremy Easoz · in Torque Game Builder · 10/13/2008 (9:20 am) · 3 replies

I have a simple block of code that creates a particle effect.

function playStarBurst(%pos)
{
   %starburst = new t2dParticleEffect() { scenegraph = pmascenegraph; };
   %starburst.loadEffect("~/data/particles/starburst.eff");
   %starburst.setPosition(%pos);
   %starburst.playEffect(%pos);
}

I'm trying to add a line after .playEffect that
calls stop effect after 250ms.

schedule(250, 0, stopEffect, false, true);
schedule(250, %startburst, stopEffect, false, true);

no matter how I combine it, stopEffect is always unknown command.

a straight call to %starburst.stopEffect(false, true) works fine though.

#1
10/13/2008 (9:35 am)
Try
%starburst.schedule(250, stopeffect, false, true);
#2
10/13/2008 (9:45 am)
Use "%starburst.schedule(250,stopEffect,false,true);"
#3
10/13/2008 (10:04 am)
Worked, thanks.