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:
error message:
script:
%explosion.setEffectLifeMode("Kill");error message:
t2dParticleEffect::setEffectLifeMode() - Missing 'time' parameter for selected mode!
About the author
#2
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.
03/02/2008 (5:42 am)
Thanks. Fixing the particle effect parameter wasn't too hard fixbased 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.
Torque Owner Wenceslao Villanueva Jr.
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