Author Topic: Emitter not mounting in the right position.  (Read 2077 times)

So I am trying to mount the emitter to the engine.  Whatever I put for the mount point, it always goes to the origin.



Code: [Select]
mountPoint = NUMBERHERE;
How do I put it in the right spot?

I'm pretty sure you need to provide the name of the bone for special emitters.

I named the bone there "mountpoint", so?...

Code: [Select]
   mountpoint = mountpoint;

Post more code, I need context.

Code: [Select]
datablock ShapeBaseImageData(ArbitratorEngineImage1)
{
   shapeFile = "./empty.dts";
emap = false;

mountPoint = "engine";
   rotation = "1 0 0 180";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = ArbitratorEngineEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function ArbitratorEngineImage1::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}

datablock ShapeBaseImageData(ArbitratorEngineImage2)
{
   shapeFile = "./empty.dts";
emap = false;

mountPoint = "engine";
   rotation = "1 0 0 180";

stateName[0] = "Ready";
stateTransitionOnTimeout[0] = "FireA";
stateTimeoutValue[0] = 0.01;

stateName[1] = "FireA";
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = True;
stateTimeoutValue[1] = 10000;
stateEmitter[1] = ArbitratorEngineSmokeEmitter;
stateEmitterTime[1] = 10000;

stateName[2] = "Done";
stateScript[2] = "onDone";
};
function ArbitratorEngineImage2::onDone(%this,%obj,%slot)
{
%obj.unMountImage(%slot);
}

function ArbitratorEngineCheck(%obj)
{
// return;
if(!isObject(%obj))
return;

%speed = vectorLen(%obj.getVelocity());
if(%speed < %obj.dataBlock.ArbitratorEngineSpeed)
{
if(%obj.getMountedImage(0) !$= "")
{
%obj.unMountImage(0);
// %obj.unMountImage(3);
}
}
else
{
if(%obj.getMountedImage(0) $= 0)
{
%obj.mountImage(ArbitratorEngineImage2,0);
// %obj.mountImage(contrailImage2,3);
}
}

if(%obj.getMountedObject(0))
{
if(%obj.getMountedImage(1) $= 0)
{
%obj.mountImage(ArbitratorEngineImage1,1);
}
}
else
{
if(%obj.getMountedImage(1) !$= "")
{
%obj.unMountImage(1);
}
}

schedule(2000,0,"ArbitratorEngineCheck",%obj);
}

This is the mount point.  The joint name for the location for the emitter is named "engine", but It seems to want to mount to the player seat instead.
Code: [Select]
mountpoint = engine;

Remove the mountPoint line, and in state[1], add this:

Code: [Select]
stateEmitterNode[1] = "engine";

Remove the mountPoint line, and in state[1], add this:

Code: [Select]
stateEmitterNode[1] = "engine";
Side question here; If I were to have multiple emitters, how would I do that? Because I can't name them all the same thing, and I don't think I can add more EmitterNodes to the script.

It shows how in SWAT's script. Each emitter needs it's own image.

No dice.  Still going to the seat.

Hmm... When you named the bones in Blender (assuming that's what you used), did you name the bone in edit mode (TAB and then hit N to name), or did you name the armature? Also, are they children of detail32?


Ah. In that case, I'd simply suggest looking at the stunt plane's script (or one similar) and see how it is handled. It's possible you might just need to offset it, if it continues to fail. But definitely look at another script first. Observing others (and their work) is often an efficient way of learning.

Well, I tried working with combinations of offsets and Emitter Nodes.  Nothing really works.  It only seems to want to mount mount0 or the origin.

For mounting stuff they strictly have to be called as "mount#", I think. The stunt plane has two mount points by the tip of the wings called "mount3" and "mount4".

For mounting stuff they strictly have to be called as "mount#", I think. The stunt plane has two mount points by the tip of the wings called "mount3" and "mount4".
Barnabas, if this works, you're a life-saver. I am having problems with this too at the moment. XD