Game Development Community

Particle System on player When achieving something.

by Michael S · in Torque 3D Professional · 03/31/2012 (8:16 am) · 9 replies

Hey everyone, I made an experience / level up script and I am looking for a way to load particles on the player upon leveling, so, for example, if($playerLevel + 1){LOAD PARTICLE!}.So how do I load a particle system upon leveling? Thanks in advance.

#1
03/31/2012 (12:14 pm)
Nevermind, after some research, I found a solution to the problem. For any others in need of help with this, use this link http://docs.garagegames.com/torque-3d/reference/classSFXSource.html
#2
03/31/2012 (12:27 pm)
Oops, wrong problem, sorry for double post, but I still need help with this one.
#3
03/31/2012 (5:00 pm)
Can anyone help?
#4
03/31/2012 (6:36 pm)
THIS SHOULD LEAD YOU IN THE RIGHT DIRECTION

http://www.garagegames.com/community/forums/viewthread/129323
#5
03/31/2012 (9:19 pm)
Simple process here.

1) Create your particle effects, or any other effects you want to add.

2) Add a handle to you function, Experience gain, w/e and when the player levels up call a separate function.

3) Have the separate function obtain the player's position and play the particle effects, sounds, ect. at the position.
#6
04/01/2012 (7:26 am)
3. is what I am having trouble with, how do I get them to play at the player. I need to know both of those, not just how to get it at the player. I may eventually figure out the particles though thanks to Tom. However, I need to figure out how to play @ position.
#7
04/01/2012 (10:43 am)
In step 3 as outlined by Robert you simply get the position and use the "new" command to create a new particle system (consisting of a node (for positioning), emitter, and particles).
%particles = new ParticleEmitterNode() 
{
   position = %position; 
   rotation = "1 0 0 0";
   scale = "1 1 1";
   dataBlock = "DefaultEmitterNode"; 
   emitter = "LevelUpPE";
   velocity = "1";
};
MissionCleanup.add(%particles);
#8
04/01/2012 (10:50 am)
function Armor::if($playerLevel + 1)
//add effectFX for here...

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

THIS IS WITH OUT KNOWING YOUR LEVEL UP CODE BUT SHOULD GET YOU THERE


OPPS the great MH beat me to hitting post

#9
04/01/2012 (11:06 am)
Thanks, got it now, appreciate the help :)