Game Development Community

Quick particle question

by D B · in Torque Game Engine · 10/24/2005 (3:40 pm) · 13 replies

I've been messing around with particles for a bit, and when I looked at the particle PNGs that came with the starter.fps, I have noticed that they are all white (obviously, for RGB purposes).

However, I'm unsure as to what the transparency colour would be for particles. Does anyone know what it would be? Thanks.

#1
10/24/2005 (4:27 pm)
Sorry, I got a second question, as well (this one to do more with coding).

I want to attach a fire particle effect to a mesh I've made (i.e. the mesh is on fire). I have tried attaching it to mount points with mountImage, but that doesn't seem to work too well. The particle effect works when I call it from the particle editor, so I know that the particle effect itself isn't the problem, it's the way I'm trying to code it.

Does anyone have any suggestions for what I might do here?

EDIT: Just to add, I have searched over the forums, but I've had no success in finding out how to attach particle effects to meshes; that's why I ask this question now.
#2
10/24/2005 (6:22 pm)
Transparency is handled via the alpha channel..
#3
10/24/2005 (6:34 pm)
I don't beleive there is currently a setup to mount particles to a mesh without modifying the engine. If there is a way, I don't know of it. :/
#4
10/25/2005 (5:52 am)
There's a mounted particles resource out there.
#5
10/25/2005 (6:42 am)
[url =http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8156]Here[/url] is Chris' resource for mounting particle emitters.
#6
10/25/2005 (2:44 pm)
Thanks, everyone. I'll give Chris' resource a try. :D

@Kevin: I'm a little confused as to how the transparency/alpha channel stuff works when it comes to the PNGs; was it established in the 3d art program or in the engine?

When I look at the chimney fire data, for example, it makes reference to the texture from the particle folder, but there are only PNGs in there. Also, in chimneyfire.cs, the only thing I see that looks to be alpha channel-related is the useInvAlpha = false; line.

My apologies if this sounds like a simple question, but I am new to particles.
#7
10/25/2005 (7:08 pm)
Success! Chris' resource worked! Thanks everyone. =P

EDIT: Actually, I do have one small problem still (not with the resource, but my own particle emitter).

The fire is attached to the mesh, but when it moves, the gaps between the flames are quite large, and the fire isn't even "attached" to the mesh as he runs. I have tried shortening the lifetime while increasing the ejectionPeriods, and though it has helped slightly, it is still not producing the desired effect.

What would be a good way to get a steady stream of flames to follow the mesh, while still appearing to come from the emitter's origin?
#8
10/28/2005 (3:41 am)
Chris' trick is a hack by mounting an effiring image to a slot, pretty neat for script. You'll have to go into the engine and see how things like projectiles emit particles, then you could add that as an option to have a player's mount point emit particles perhaps.
#9
10/28/2005 (3:21 pm)
I do have the particles coming out of the correct mount point; however, it's that as the mesh with the fire attached to it runs, the fire comes out in gaps as opposed to a constant stream (regardless of the emission period length) and it looks kinda messy.

I'm just wondering what sorts of things I might be able to do to fix that.
#10
10/28/2005 (11:08 pm)
Maybe aim the emitter upward and forward and transfer the player's momentum to the particles.
#11
10/29/2005 (9:02 pm)
I have tried cutting the player speed in half, but that didnt help much either; the gaps are too large whenever it moves from its current position.
#12
06/23/2006 (1:38 am)
Had someone get it to work? Or any idea how to manage this?

Have this problem too, need a constant trail, but the Ressource produces too large gaps...
#13
11/21/2006 (6:49 pm)
This may be a little off topic, but I'm not sure where to post this. Is it possible to mount a particle effect to any object? For Example, if I had a burning barrel and I knocked the barrell over, I would like the particle emitter to follow that barrell's position. Also how do you go about rotating particle emitters. I would like to have some sort of particle effect circling an object. Is this possible in scripting or will the enigine have to be modified?

Thanks for any help.