Game Development Community

Looking to add a emiter to a static object

by Donny Wilbanks · in Torque Game Engine · 04/08/2004 (2:44 pm) · 10 replies

Here's a question, I am looking for a tut dealing with emitters and adding them to a static object (other than just using the toolset and droping the emmiter on the object). I would like it to spawn with the object.

Would I have to a design the model with some sort of joint of some sort? (like the hubs on a the car)? Look at more examples.

This question can also cross over into how to mount a object on a object type thing

such as truck with a changeable cargo pod (with corisponding model)...

Maybe I am looking for a mounting tutorial.. not 100% for sure,..

Just throwing a bone and seing what pulls.

#1
04/10/2004 (11:37 am)
Well here is what I am trying. I am using just the Torque Demo for the platform and the Code Sampleirs tuts as base...

datablock ItemData(SignPower)
{
   // The category variable determins where the item
   // shows up in the mission editor's creator tree.
   // Path is relative to where the script is executed from.

   category = "Misc";
   shapeFile = "~/data/shapes/signs/signs/signpower.dts";
};

function ItemData::create( %data )
{
	echo( "ItemData::create for SuperBomb called --------------------------" );

	%obj = new Item()
	{
		dataBlock = %data;
		rotate = true; // All Super Bomb power-ups will rotate.
		static = true;
        hasLight = true;
        lightRadius = 25;
        lightColor = "0.5 0.5 0.25"
     };


	return %obj;
}

Am I barking up the wrong tree again?
#2
04/10/2004 (11:40 am)
Then maybe again what are legal addons for a static structure, what can you do to them within the scripting options..
#3
04/10/2004 (7:29 pm)
I don't quite understand what you're asking...?
#4
04/10/2004 (7:34 pm)
It may be a moot qestion, and looking at what I had posted above the code (opps) that was a emmter. Sorry. After trying to add a little sparkly emmiter to the new object (and failed) , I treid adding a "Light" to the object. So when it was placed onto the field it would light up the surrounding area (like when a rocket flys past you, save it's stays in one location)...
#5
04/10/2004 (11:07 pm)
Wait, so are you trying to attach an emitter to a node on an object? Or make a light? Or does the emitter have to track with the object? or...?
#6
04/11/2004 (6:50 am)
Does the object have to have a node modeled onto it?

"Wait, so are you trying to attach an emitter to a node on an object?"

Yes! Does the object have to have a node modeled onto it?

"Or make a light?"

Evtually both (well different objects).

"Or does the emitter have to track with the object?"

I am just trying to attach it to a object, so when spawned (created) it comes with the oringal object. I more than likely going about it the wrong way as this is the first time I have treid it... thanks happy easter.
#7
04/11/2004 (7:08 am)
Well if the object doesn't have to move, IE a static object like a fountain or something, then you could just spawn the object, and spawn an emitter at the same place (maybe with a scriptable offset). It wouldn't technicaly be attached, but they would be done at the same time.
#8
04/13/2004 (11:08 am)
I think that maybe what I am trying out, that could work fine also.
#9
02/24/2006 (6:40 am)
I am trying to spawn a static object with a camera mounted to it. I have the static object moving in a path and would like to have this camera move as an attatched camera. Is this possible ???
#10
02/25/2006 (4:51 pm)
Hmm not for sure how to do that, this thread is a year or so out of date. I just started playing with the system again. May repost your question as a new thread.

"I am trying to spawn a static object with a camera mounted to it. I have the static object moving in a path ad would like to have this camera move as an attatched camera. Is this possible ???"

That's more than likely possible, I hope so..