Trigger + setActive

There are no stupid questions, just stupid answers.
3 posts Page 1 of 1
criskegler
Posts: 2
Joined: Sun Aug 20, 2017 7:51 am
  by criskegler » Sun Aug 20, 2017 8:11 am
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..
Duion
Posts: 812
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Aug 20, 2017 10:33 am
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:

Code: Select all

   %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.
criskegler
Posts: 2
Joined: Sun Aug 20, 2017 7:51 am
by criskegler » Sun Aug 20, 2017 11:41 am
User avatar
Duion



Thanks for the help!! :D
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests