Haydenmango Posted November 12, 2014 Share Posted November 12, 2014 Do I need to Release() particle emitters once I am done with them or do they Release() themselves once they finish playing? It seems like I am supposed to Release() them manually and that is what I have been doing but when I look at the FPSgun.lua I can't see where the emitters being created (smoke emitter and blood emitter) are destroyed. Is this an issue with the FPSgun.lua, do particle emitters Release() themselves, or am I just missing something? Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
nick.ace Posted November 13, 2014 Share Posted November 13, 2014 If you don't plan on using them anymore, then you should release it. Otherwise, it's still a valid entity. I tested this by created an emitter and allowing it to switch between loop and non-loop mode. After it stopped emitting, I could restart it, so it's still in memory. That being said, I doubt you will encounter noticable performance issues, it's more of a good practice thing. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 13, 2014 Share Posted November 13, 2014 One-shot emitters will automatically release themselves. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Haydenmango Posted November 13, 2014 Author Share Posted November 13, 2014 One-shot emitters will automatically release themselves. Good to know! I normally put a script on all my particle emitters that will release the particle emitter after a certain time so not having to put scripts on one shot particle emitters is cool. Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
xtreampb Posted November 17, 2014 Share Posted November 17, 2014 noob question, what is a one shot emitter? Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
nick.ace Posted November 17, 2014 Share Posted November 17, 2014 Normally, an emitter plays continuously (think of the firepit in the Workshop). This means that the particles flow out indefinitely. A one-shot emitter is when a set number of particles flow out and they don't get recreated or replaced. This would be for something like a collision against a dirt road where the dust doesn't keep coming up from the ground until it is hit again. You can control this with SetLoopMode(): http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/emitter/emittersetloopmode-r93 The one thing I don't understand is that I can change this mode after the one-shot collision finishes. Is this because the Lua garbage collector hasn't cleared that spot in memory yet? Quote Link to comment Share on other sites More sharing options...
xtreampb Posted November 18, 2014 Share Posted November 18, 2014 cool so i'll use a pivot and create the emitter to play that will last long as i need it to and then recreate it every time Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.