Game Development Community

Mounting a Particle Emitter

by Thomas Shaw · in Torque Game Engine · 06/27/2005 (2:08 am) · 15 replies

Okay, I want to mount a particle emitter that I created to a DTS shape.

I just learned about mount points, but couldn't figure out how to create them. Eventually I pulled up the .max file of the "orc guy" that comes with TGE and saw that they were just dummy objects placed into the hierarchy named Mount0, Mount1, Mount2, est.

Now, I created a dummy object in my scene and parented it to base01, but when I go into the show tool and look at my exported shape the mount point does not show up.

So my first question is: How do I create mount points, place them in the hierarchy, and have them export?

My other question is: Once I successfully place a mount point in my DTS file how do I create a Shape that mounts my particle to that mount-point in the engine?

Thanks

#1
06/28/2005 (7:26 am)
Okay well I got a mount dummy to export, but the only way that I could do it was to put some bones in my model and skin it. So can you only have Mount objects on skinned meshes?
#2
06/28/2005 (8:05 am)
You can mount an emitter by simply placing a node (dummy object or bone, depending on your modelling app) in the appropriate location and assigning it a proper name.

You'll have to look into the *.dts documentation to ascertain what names are specific to what node types, i.e. particle emitters, mount points, etc.

You can assign the particles in the object scripts - I suggest taking a look at player.cs (specifically the foot puffs) to see how this is done.

As for whether or not you must skin the mesh, well, I've exported from MS3D with simple materials before and had success, but onyl for prototyping purposes.
#3
06/28/2005 (12:51 pm)
Thanks, I was able to finaly get my mount points to export so I think I have overcome that part of the problem. However, I am having a really tough time with the scripts.

From what i have gathered I need to create an "ImageClass" that defines the particle and then do an ::onAdd command that states that I have to mount that image class.

It sounds simple enough but I have yet to get it to work. If somone could post a bit of code on here to clarify things that would be great.

Thanks
#4
06/28/2005 (4:00 pm)
Well, I read just about all the posts I could find on this subject. There apears to be three different conclusions:

1) Use a fake or "empty" weapon DTS with a particle atached and then mount the empty_weapon:

http://www.garagegames.com/mg/forums/result.thread.php?qt=21220

(top of the thread)

http://www.garagegames.com/mg/forums/result.thread.php?qt=13394



2) Spawn Emmiters using a script:
www.garagegames.com/mg/forums/result.thread.php?qt=17707

3) Modify the Engine Code:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6387

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4096


As of right now, I can get none of these to work. I have heard from several posts that the "fake weapon" solution doesn't work. I guess really what needs to happen is that I will need to modify the engine code, but I would need specific instructions on what to do.

There really should be a compreshensive easy to follow reasource for this sort of thing since it is so closly linked to the work that digital artists are doing the engine. If somone would be willing to help me we could turn this thread into somthing that others with this problem could follow even if they don't come from a programming background.

(Side Note: I was able to get the crossbow to mount to my object so I don't have any problems with actualy mounting an image. Its just mount a particle)

Thanks
#5
06/29/2005 (6:51 am)
I mount my emitters on staticshapes using mountimage(image,slot).
So what i do is
Make a dummy object or a shape with a mountpoint.
make a really simple script simular to a weaponimage , but i only use the shapebaseimageData part .
And using the preactivate state to start the emitter with a really long emittertime.
This was the only way i could get the emitter animate with the staticshape without coding some new stuff in the engine.
#6
06/29/2005 (7:09 am)
Sorry to hear that you're having such difficulty with this.

1st, I suggest taking a look at this resource for information on naming conventions that the engine will recognize.

I have been working with the hovervehicle class for what seems like an eternity. IIRC (and it's been a while) I got the dust particle emitter working by A) Definining a valid dust particle and emitter datablock in the script and B) Assigning the emitter to a strategically placed smoke node in the datablock.

From there it was only a matter of adjusting the trigger height to my liking.

I work with MS3D, so I can only tell you that in Milkshape a node is simply a dummy bone - it can be attached to a skeleton or just floating off all by it's lonesome.

Look into just about ny vehicle script to see how the particle and emitter datablocks are defined. I'm at work so I don't have access to my own files right now, but there should be several on the forums.

~ Hope this helps.
#7
06/30/2005 (8:10 pm)
I just finished coding up a mounted Particle emitter... It uses scripts only. I am going to post it as a resource shortly. I will post a link to it here.
#9
07/17/2005 (12:41 am)
I am having a new problem. I want to have more than 4 (0-3) mount points on my character. Yet, every time I add a fifth mount point (mount4) it will not work. Using my existing scripts I have easily been able to mount my particle on mount points 0-3 but every time I try to mount to "mount4" nothing happens in the engine.

In the show tool it's a different story, I can mount any dts object to mount for using the mount tool but it is not working the engine. I have triple checked to make sure I am not making any typos (which I am sure I am not because I can easily get mount points 0-3 working).

I was under the impression that the maximum number of mount points that can be on a player is 32.

Again, I am sure that my dummy object "mount4" is exporting. I have it parented to a bone just like all my other mount dummy objects and I can mount anything I want to that point in the show tool, but it will not work in the engine. I also tried this with a "mount5" point and got the exact same results.

Any idea what's going on?

Thanks.
#10
07/17/2005 (1:06 am)
You need to up the ShapeBase MaxImageEmitters limit. That's how I got this to work. ;)
www.godallman.com/gg/shelled86.jpg
#11
07/17/2005 (1:41 am)
How do I "up the ShapeBase MaxImageEmitters limit"? I tried editing the values in shapbase.h and then recompiling but that didn't work...

And I also can't mount any normal shape objects that don't have particles such as the crossbow. It mounts to everything but my "mount4" point.

I just found this reasource www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6723 but it talkes about version 1.2.2 and the code seams different now in 1.3.
#12
07/17/2005 (2:53 am)
I GOT IT TO MOUNT! Here is how:

Okay in shapeBase.h you will find the lines of code bellow starting at line 548. There was a reply post made by David Russell at the end of the reasource I talked about above (www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6723) where he stated you could increase the "MaxMountedImage" to 8. I did this and after I recmompiled I was able to mount my object to mount4.

// The thread and image limits should not be changed without
      // also changing the ShapeBaseMasks enum values declared
      // further down.
      MaxSoundThreads =  4,            ///< Should be a power of 2
      MaxScriptThreads = 4,            ///< Should be a power of 2
      MaxMountedImages = 4,            ///< Should be a power of 2
      MaxImageEmitters = 3,
      NumImageBits = 3,
      ShieldNormalBits = 8,
      CollisionTimeoutValue = 250      ///< Timeout in ms.
   };

However, I will need to have more than eight mountpoints on my object. In fact I would like to enable all 32. Is there an updated reasouces about how to do this, or could someone please post and explain? I am not a coder by trade so I could use some help here.

Thanks
#13
07/18/2005 (6:37 am)
Thomas... There is a resource that will tell you how to up it to 32. Just search for the resource.
#14
07/18/2005 (7:19 am)
Chris,

He already mentioned the resource in a previous post, but was having problems with the fact that it was for 1.2.2.

Thomas,

I have updated the resource as I have tested it on 1.3 and for multiplayer.

Thanks.
#15
07/22/2005 (7:26 am)
Awsome, thanks allot. This has been a major help.