"Long lasting" special effects

Started by Grayzzur, February 05, 2014, 12:05:30 PM

Previous topic - Next topic

Grayzzur

There are 3 effects from CreateEffect that just don't go away.
#12 - pulsing blue-white light
#15 - small orange torch/Terp beam tip
#16 - large blue-white swirly vortex

Most of the effects are short-lived, "fire-and-forget".

For these 3, how do you turn them off?

(And a side question, out of curiosity, what ever happened to effect #1?)
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

Clean0nion

Quote from: Grayzzur on February 05, 2014, 12:05:30 PM
There are 3 effects from CreateEffect that just don't go away.
#12 - pulsing blue-white light
#15 - small orange torch/Terp beam tip
#16 - large blue-white swirly vortex

Most of the effects are short-lived, "fire-and-forget".

For these 3, how do you turn them off?

(And a side question, out of curiosity, what ever happened to effect #1?)
I'm pretty sure that #1 is a blank effect, and the long-lasting ones are permanent.
If there's no UID for the effect, you can't turn it off.

knucracker

#1 isn't working because of a typo.  It is supposed toe he MortarShellExplosion.  Here's my switch statement:

switch (effectNum) {
case 0: name = "ShotExplosion"; break;
case 1: name = "MortarShellExplosion"; break;
case 2: name = "BerthaShellExplosion"; break;
case 3: name = "RunnerExplosion"; break;
case 4: name = "SporeExplosion"; break;
case 5: name = "TotemExplosion"; break;
case 6: name = "CreeperAAShellExplosion"; break;
case 7: name = "UnitExplosion"; break;
case 8: name = "MoveTrail"; break;
case 9: name = "ShortTrail"; break;
case 10: name = "SporeTrail"; break;
case 11: name = "SmokeRingEffect"; break;
case 12: name = "ParticleBeamDamage"; break;
case 13: name = "PulseCannonShellEffect"; break;
case 14: name = "StunnedEffect"; break;
case 15: name = "TerraModCell"; break;
case 16: name = "TotemFiring"; break;
}


I've just corrected #1 so it has the right internal object name.
As for the ones that don't quit, there are several that are set to loop on and on.  It was an animation setting when I made the effect.  I will change them stop after 30 seconds...

Crimson King

Thanks for changing the effects but would it be possible to have the listed effects' speed scalable like the other effects instead of just playing for 30 frames?

For my project I think a 15 frame speed on the Terp beam tip would look better than the 30 frame speed but I can work with the 30 frames if I have to.

Grayzzur

Be thankful he set it to 30 frames, and not 30 seconds like he said he was going to!

For those 3 effects, it would be nice to be able to control the exact duration ourselves. Perhaps a CreateRepeatingEffect that takes the same arguments, and returns an ID, and a StopRepeatingEffect to shut it off. Alternately, perhaps the "speed" parameter could be repurposed for "duration" for these 3? Although that gets a little confusing and is ultimately not as versatile as being able to shut it off. I['m rambling now, and I get the feeling this might be a little bit of an effort on your part, though.

I think what we have now is good enough for the current release candidate.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

knucracker

I just quickly added CreateEffectClipped as a command.  It is the same as CreateEffect, except it takes one more int argument on the end that specifies the max number of frames for the animation to run.  So for the effects that loop forever you can make them last however long you want.  For the effects that don't loop forever, you can clip them at some number of frames.

Adding support for manually terminating the effects was a little more work than I wanted to add (a little riskier since I would have had to provide a way to associate a UID with the effects).

Anyway, I'm going to basically put down my #2 pencil and turn in my test at this point.  It's time for a new general release so we can get the whole playing audience updated and enjoying the new features.

Crimson King

Thank you for at least looking into it. There is no rush and I can work with the 30 frames if the command proves more hassle than it is worth.

Grayzzur

Looks like he already added the new command mentioned above to version 1.78, which is now out and as the public release, not beta. So, I guess you're stuck with being able to clip it to 15 or 10 or whatever works best for your unit!

I'll get the new command added to the Wiki. Thanks, V!
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

kwinse

Hrm, seems that CreateEffectClipped can cause problems with normal effect use. A core that clips effect 15 at 15 frames will cause a regular unupgraded terp's effect to clip too. The terp's effect disappearing can and will also cut off the core's effect early.

knucracker

Yeah, looks like effects are pooled and I don't reset the abort time before pooling them....

kwinse

Ah, no problems noticed so far in 1.81. Thanks a lot!