Page 1 of 1

Looping Effect? (Some LUA involved)

Posted: Mon Apr 13, 2015 9:59 pm
by jedimoose32
Hi everyone.

I've just finished making a custom effect in Particle Editor - it's just the defense buff effect, but orange, and it's Particle instead of Billboard. Anyway, the 'animation' or behaviour of the effect is essentially the same as the defense buff, so in essence the rings spawn and expand outwards, then disappear. That's it. Here's where it gets interesting...

I'm loading the effect through a custom ingame.lvl and having it spawn on certain units under specific conditions (code excerpt below). That part works great, and the effect plays... once. However, I'd like it to loop until I want to turn it off... is there a way to do that using LUA? Or would I have to do it manually and just make the effect animation repeat itself for a very long time using the Particle Editor? I tried looking at the Tantive turbine effect prop for reference but it looks like they just made the lightning stuff a damage effect (from 100% to 80% health range), which is hard-coded to loop anyway.

Any ideas?

(Excerpt from AssassinMode.lua)
Hidden/Spoiler:
[code]
if isEntryDup == false then
self:PrintMe("\tDOESN'T EXIST!")
table.insert(quicktable, member)
AttachEffectToObject(CreateEffect("assn_sfx_alert"), unit)
end
[/code]

Re: Looping Effect? (Some LUA involved)

Posted: Tue Apr 14, 2015 12:57 am
by THEWULFMAN
Why not just make the effect itself loop, and use RemoveEffect when you don't need it anymore?

Re: Looping Effect? (Some LUA involved)

Posted: Tue Apr 14, 2015 1:04 am
by jedimoose32
Okay, I just did a little more reading on how Particle Editor works. It sounds like I change MaxParticles to -1 and that will make it infinite. But when I tried that it crashed PE. I guess I could just make this change manually by opening the .fx file in N++? Or am I going about this the wrong way?

Also, I'm going to have several of the same effect spawned in the same way. If I use RemoveEffect("assn_sfx_alert") will that remove all effects of the same type or is there some way that each instance of the effect is identified? (I actually do want to remove all of them simultaneously so that would work fine)

Edit: Ah, never mind. I'm an idiot. "MaxParticles(-1.0000,-1.0000);" worked fine. My question about RemoveEffect stands though. I used it as mentioned above (with the effect name as the argument) and it did nothing.