Effect Idle Timeout Exclusion?
Home › Forums › TimelineFX Module › Effect Idle Timeout Exclusion?
- This topic has 7 replies, 2 voices, and was last updated 14 years, 2 months ago by imported_peterigz.
-
AuthorPosts
-
October 7, 2010 at 6:11 pm #3193
wiebowParticipantI have a problem, which could be a bug or reason for a feature request 😀
Here’s the situation: I have an emitter which produces the engine effect on my space ship. I use tlEffect.SetAmount() to vary the amount of particles it emits. If the ship is not accelerating, this value is 0. Leaving the ship alone for too long will have the engine effect be deleted from the manager, as there is an effects idle timeout, set by tlParticleManager.SetIdleTimeLimit(). I’ve tried setting this value to 500000 or something, but the effect still diss-apears. So maybe something is wrong with this method.
Still, I think it would be very handy if effects could be used like I am trying: throttling them because of acceleration, speed, or whatever. What would a solution for these situations is an ability to exclude an effect from this timeout. Maybe something like tlEntity.ExcludeFromManagerTimeout()
Having this timeout forced is a really good default, but manually excluding an effect could be great in these situations.For those interested: Here is a screenshot btw of the particle engine working in my game (warning, largely empy) : http://dl.dropbox.com/u/12644619/TimeLineFX_working3.png
October 7, 2010 at 6:45 pm #3763
imported_peterigzParticipantI wrote an article for maxcoder about making an asteroids game using TimelineFX, which had a ship with a thruster. Can’t remember for the life of me what I did but I’ll go check 🙂
I’m sure it had the same kind of thing you’re trying to do…
October 7, 2010 at 6:54 pm #3764
imported_peterigzParticipantI see, in that I just made a new effect each time and killed it (using effect.SoftKill) when you stopped thrusting.
But forget all that because I just thought of the ideal solution: In your thruster effect create a new emitter and make it a single particle (on the Particle tab) and set its size to 0, that way they’ll always be a particle within the effect so it won’t time out, as single particles do not expire until you destroy the effect.
By the way, it’s looking good 😀 Always nice to see how people are making use of it.
I will check out the time out issue too, as it certainly shouldn’t have been timing out anyway.
October 7, 2010 at 6:59 pm #3765
wiebowParticipantOK, I will add a new emitter.. That’s a good enough workaround.
I could add a new effect every time I start thrusting, but doing it this way the thrust effect scales up or down as I manipulate the acceleration stick (it’s an analogue control). It looks really cool.
As for the look: these are the basic emitters I changed a bit to suit me. I will create other effects once I have this groundwork done. Right now, I have the game working with a virtual camera to simulate scrolling, which can track any object in the game world, and the particle manager screen moves along with it. It’s really smooth looking!
October 7, 2010 at 7:06 pm #3766
wiebowParticipantOne question though. How can I make the particle from that dummy emitter NOT die? 🙂
October 7, 2010 at 7:24 pm #3767
imported_peterigzParticipantBy making it a single particle (Single check box on the particle tab). Single particles do not die, they just spawn 1 particle and loop over their lifetime graphs forever.
Having said all that though I’ve just added effect.DoNotTimeout() to achieve what you want now anyway 🙂
Seemed to be doing its job in the small test I made, available via SVN.
October 7, 2010 at 7:25 pm #3768
wiebowParticipantHaHa! Checking out the SVN now. I like your service 🙂
But you know, I think it’s better to be able to do this in code anyway. This way, you KNOW which effects behave like this without having to refer to the .eff file.
edit: I tested it and the effect now stays around even when it is not spawning particles… Excellent stuff.
October 7, 2010 at 7:47 pm #3769
imported_peterigzParticipantCool 😎
I agree it’s always better to go for the cleaner solution 🙂
-
AuthorPosts
You must be logged in to reply to this topic.