Jump to content

Trigger + setActive


criskegler

Recommended Posts

It's my first day with T3D and i'm tryng to make a command to set a "flare"(PArticleEmitterNode) active using the trigger notepad.


I have been reading the manual for hours and i cant figure out how to use "void ParticleEmitterNode::setActive(bool active)".


Sorry for bad english..

Link to comment
Share on other sites

I would just create the particle on trigger and then delete it again.


Here is some example code I once usede to create blood spatter effect on player hit:

 

   %particles = new ParticleEmitterNode()   
 {
     position = %position;  
     rotation = "1 0 0 0";  
     scale = "1 1 1";  
     dataBlock = "SmokeEmitterNode";  
     emitter = "bloodBulletDirtSprayEmitter";  
     velocity = "1";  
  };  
  MissionCleanup.add(%particles);  
  %particles.schedule(1000, "delete");

 

It is created on player damage, but you can just move it into your trigger function and then it is deleted after 1 second, works fine. You may have to add location data where you want it to appear, since in my case the location is automatically set to where it hits the player. Of course you need to set the dataBlock and emitter to use your existint particle datablocks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...