Game Development Community

Doc error?

by Patrick Shaw · in Torque Game Builder · 03/02/2008 (3:46 am) · 2 replies

In the docs for setEffectLifeMode, time is listed as an option parameter. However, the following script generates an error.

script:
%explosion.setEffectLifeMode("Kill");

error message:
t2dParticleEffect::setEffectLifeMode() - Missing 'time' parameter for selected mode!

#1
03/02/2008 (4:53 am)
It looks like setEffectLifeMode() takes 2 arguments if your mode isn't "Infinite"; a mode and a time. From the docs:

setEffectLifeMode(lifeMode,[time])
Description: Sets the Effect Life Mode/Time.

So add a time argument to your setEffectLifeMode call and that should work. Here's some examples from the documentation:

// Set-up some life-modes.

%effect1.setEffectLifeMode( INFINITE );

%effect2.setEffectLifeMode( CYCLE, 5.0 );

%effect3.setEffectLifeMode( KILL, 5.0 );

%effect4.setEffectLifeMode( STOP, 5.0 );

Hope that helps
#2
03/02/2008 (5:42 am)
Thanks. Fixing the particle effect parameter wasn't too hard fix
based on the error message alone. Since the [parameter] syntax usually
means that parameter is optional, it would be helpful to include
additional text in the setEffectLifeMode to explain that that its
different.