Game Development Community

particle emitter in mission

by AIDan · in Torque Game Engine · 12/02/2001 (3:15 am) · 8 replies

Hi

How to add a particle emitter directly to a mission??

greetings
Daniel

#1
12/02/2001 (5:58 am)
you mean to have particles emitting from the map? One thing you mgiht try is making an inivisible box (a box with all alpha textures) and place it on the ground like you would a weapon. Make sure it has no collisions. Then just have the particle effects pour from the box. However this is more from theory not practice....
#2
12/02/2001 (11:36 am)
This does not work. Any idea why??
function CreateParticleEmitter(%name, %data, %pos, %rot)
{
	%obj= new ParticleEmitterData(%name)
	{
		position= %pos;
		rotation= %rot;
		dataBlock= %data;
		static= true;
		rotate= false;
	};
}

CreateParticleEmitter("testemitter", RifleSmokeEmitter, "-512 -512 100", "0 0 0");

the datablock is from the rifle, came with torque 1.1

greetings
Daniel
#3
12/02/2001 (1:55 pm)
Particle emitters are not stand alone objects. They must be attached, and controlled by another object. The player, vehicles and mounted items all have particle emitter "slots" to attached too. These objects then activate the emitter based on their state: wheel spin, image state, player footpuffs, etc.

Seems like there should be a simple place-holder object that only has a particle emitter, ie. no dts shape, or collision. I don't know of any, it wouldn't be hard to write one though. If there's some interest, I an add it to my list.
#4
12/02/2001 (2:00 pm)
Of course. Think about vulcans, waterfalls, dust and wind, etc.
#5
12/02/2001 (2:32 pm)
I'd use it. OUr game requires a lot of particle effects.


Dark
#6
12/02/2001 (2:50 pm)
Ok, then :) Let me think about it a little, the simplest would be to derive off of ShapeBase, but that makes a pretty heavy weight object... be scriptable though.
#7
12/03/2001 (6:40 pm)
Thought there might be something already... there is a class called ParticleEmitterNode (which I renamed from ParticleEmissionDummy). You'll need to get the latest build. I haven't actually tested it, but it looks pretty straight forward, just create a datablock & declare the new object. You can check the code out in engine/game/fx/particleEmitter.cc (and .h) to see what the properties are.
#8
12/31/2001 (6:36 am)
Now, I took myself the time (can you say this in english??)and it was no problem.

This is for your mission:
new ParticleEmitterNode(Test) {
			position = "-462.4 -366.791 5.12867";
			rotation = "1 0 0 0";
			scale = "1 1 1";
			dataBlock = "defaultParticleEmitterNode";
			emitter = "RifleFireEmitter";
			velocity = "1";
	};

This is for your game data:
datablock ParticleEmitterNodeData(defaultParticleEmitterNode)
{
	timeMultiple= 1.0;
};

datablock ParticleEmitterNodeData(halftimeParticleEmitterNode)
{
	timeMultiple= 0.5;
};

datablock ParticleEmitterNodeData(doubleTimeParticleEmitterNode)
{
	timeMultiple= 2.0;
};

greetings
Daniel