Game Development Community

Boombot triggers a particle

by Jeff C. Huff · in · 10/07/2008 (7:36 pm) · 4 replies

Somebody help me out please...

I have the particles as described on page 278 functioning and would like the trigger found on pages 285-287 to sense the entry of boombot into the trigger and begin the particle cycle. Specifically, I would like suggestions for coding of the "enter trigger code" as requested on page 287.

Thanks in advance!
Jeff

#1
10/10/2008 (9:26 am)
Jeff, are you looking for conceptual suggestions or an example for coding the collision delegate? I'll try to put together an example over the weekend. In general, I would have an object (like "typeBoombot" ) type set to the boombot's TorqueObject. Then in the onCollision delegate method, check for that type with TorqueObject.TestObjectType() to see if it is "typeBoombot" and if so, call the particle creation code.

John K.
#2
10/10/2008 (3:40 pm)
John, I was looking for suggestions or example code to follow. I think that I have that now from Scott G. Once I have a chance to test it I'll post the result.
Thanks,
Jeff
#3
10/28/2008 (9:03 am)
Okay, trying to get this to work after a few hours of poking! I need some basic help understanding how and when to "call" the particle effect. I'm primarily an artist trying to implement John's text suggestions.

To summarize what I'm trying to do....

I have the particle effects as described on page 279 working

I have the code for triggers as described on page 285-286 entered and am ready to implement the reaction code from page 287. What I want is for the reaction code to "call" the particle effect when triggered and have the particle effect cease on exit.

It appears that I'm not understanding methods, because everything I try fails! For example... if I took the last statement in the Particle Effects entry

//register the particle emitter
TorqueObjectDatabase.Instance.Register(objParticleEffect);
return;

and plugged it into the area of the reaction code on page 287 where John has stated ...
//perform enter trigger code here

I get an error telling me that the instance does not exist in this context.

I thought that the problem was that I needed an instance of the particle effect to be called but I haven't had any success with that route either.

Can anyone suggest some sample code for making this work?
#4
10/31/2008 (11:05 am)
Okay, I'm making progress! I have the trigger working but now I need help with how to PLAY the particle effect.

public static void ProcessEnter(T3DTriggerComponent trigger, T3DRigidComponent obj)
{
// perform the enter trigger code here
{
TorqueObject objPlayer = TorqueObjectDatabase.Instance.FindObject("PlayerObject");
T3DParticleEffectComponent objParticleEffect = TorqueObjectDatabase.Instance.FindObject("ParticleEffect");
//if (objPlayer != null && objParticleEffect != null)

//perform the enter trigger code here or play the particle effect
objParticleEffect.PlayEffect(true);
}
}

The problem is that when I trip the trigger I get a error stating "object reference not set to an instance of an object"

Any ideas here?
Thanks,
Jeff