Author Topic: Emitter problems?  (Read 892 times)

Code: [Select]
datablock ParticleData(LightLightAmbientParticle)
{
dragCoefficient = 1;
windCoefficient = 0;
gravityCoefficient = 0;
inheritedVelFactor = 0;
constantAcceleration = 0;
lifetimeMS = 400;
lifetimeVarianceMS = 100;
textureName = "base/data/particles/dot";
spinSpeed = 0;
//spinRandomMin = 0;
//spinRandomMax = 0;
useInvAlpha = false;

colors[0] = "1 1 0 1";
colors[1] = "1 1 0 0.8";
colors[2] = "1 1 0 0";
sizes[0] = 0.2;
sizes[1] = 0.2;
sizes[2] = 0.2;
times[0] = 0;
times[1] = 0.2;
times[2] = 1;
};
datablock ParticleEmitterData(LightLightAmbientEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1;
velocityVariance = 0.5;
ejectionOffset = 0.3;
thetaMin = 0;
thetaMax = 360; //360
phiReferenceVel = 0; //360
phiVariance = 1;
overrideAdvance = false;
particles = LightLightAmbientParticle;
uiName = "LightLight Ambient";
};
I enter thetamax as 360 and load the add-on, and it only goes in half a circle, but when I set it to 360 using the console, it works fine in a complete circle? What?

Well you know, that makes complete sense!
See, you got...

No, that is very odd indeed.

Try looking it up in the Torque Appendix. I've never been good at Emitters.

That is pretty loving quirky.

The script looks fine, nothing seems to be causing it

Try looking it up in the Torque Appendix. I've never been good at Emitters.
I hardly work with them. :P

After doing some tests, I believe I have found a solution and an explanation.

You see, there is really no way to make the emitter make a sideways circle with the emitter brick facing up. This may be a bit confusing, but Theta degrees do not run all the way to 360.

Let me explain: Phi units go up from 0 to 360. In a three dimensional space where you are looking along the X-Axis, phi units control and rotate around the Y-Axis. Theoretically, you should not be able to see the phi units from the X-Axis, but it might be easier to think of it ass you just seeing a line. Theta degrees control part rotation around the X-Axis. What I mean by part rotation is this: Theta degrees only go up to 180 degrees. Any value above 180 will return a single line in the console and work as 180 anyway. Think of phi and theta like how the Blockhead moves. He can turn one direction and eventually end up where he started, while he cannot look down and eventually come back to where he started without changing direction.

Now to the actual fix. There is really no great way to spawn an emitter so that you can see it all from your position on the X-Axis, when the emitter direction is 'up'. Instead, a ring should be made with phi units and then rotated whatever direction using Blockland's built-in method. In fact, the way you were doing it would have eventually failed, because when you try to make it point north it would point down or somewhere else. Picture is below



And the winning script is:
Code: [Select]
datablock ParticleEmitterData(LightLightAmbientEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1;
velocityVariance = 0.5;
ejectionOffset = 0.3;
thetaMin = 89.7;
thetaMax = 90.3;
phiReferenceVel = 0; //360
phiVariance = 360;
overrideAdvance = false;
particles = LightLightAmbientParticle;
uiName = "LightLight Ambient";
};
This script will work 100% of the time, but you will have to set the direction.

One final note:
I have absolutely no idea as to why setting the values within the console would suddenly cause it to work. As I just showed, your entire method was wrong. So why would setting the thetamax value to a number it already is, and that number being redundant, fix anything at all?

Yea but i'm using it as an emitter mounted to the player's hand, like a light ring around the player's hand.

Yea but i'm using it as an emitter mounted to the player's hand, like a light ring around the player's hand.
This, again, is present in ZAPT coding.

Code: [Select]
if(!isObject(ZombieSmokeImage))
{
datablock ShapeBaseImageData(ZombieSmokeImage)
{
shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = $BackSlot;
offset = "0.00 -1.00 0.50";
rotation = "1 0 0 0";

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

stateName[1] = "FireA";
stateEmitter[1] = ZombieSmokerTrailEmitter;
stateEmitterTime[1] = 0.9;
stateTimeoutValue[1] = 0.9;
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = true;

stateName[2] = "Done";
stateTimeoutValue[2] = 0.01;
stateTransitionOnTimeout[2] = "FireA";
};
}

Change it to something you'd need, like this.

Code: [Select]
if(!isObject(FistHaloImage))
{
datablock ShapeBaseImageData(FistHaloImage)
{
shapeFile = "base/data/shapes/empty.dts";
emap = false;

mountPoint = $RightHandSlot;
offset = "0.00 0.00 0.00";
rotation = "1 0 0 0";

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

stateName[1] = "FireA";
stateEmitter[1] = FistHaloEmitter;
stateEmitterTime[1] = 0.9;
stateTimeoutValue[1] = 0.9;
stateTransitionOnTimeout[1] = "Done";
stateWaitForTimeout[1] = true;

stateName[2] = "Done";
stateTimeoutValue[2] = 0.01;
stateTransitionOnTimeout[2] = "FireA";
};
}

Yea but i'm using it as an emitter mounted to the player's hand, like a light ring around the player's hand.
There is no way to do this in the manner that you were doing.

I didn't fully understand Iban's post, but you will probably have to set the emitter direction in the scripts.

There is no way to do this in the manner that you were doing.
What.

All he was trying to do up until the post I just quoted was to get it spin in the way he wanted. I just gave him the code for mounting particle effects to the player.

What.

All he was trying to do up until the post I just quoted was to get it spin in the way he wanted. I just gave him the code for mounting particle effects to the player.
I was talking about how he wanted to have a full circle in theta degrees, which is not advisable. Sorry for the confusion.

I already have particle effects mounted to the player. I need to get it to spin 360 degrees in a circle vertically.

I already have particle effects mounted to the player. I need to get it to spin 360 degrees in a circle vertically.
You're going to have to set the emitter direction in the script, because theta degrees are not going to work like you want them to.