Jump to content

Recommended Posts

Posted

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?

Check out my game Rogue Snowboarding- 

https://haydenmango.itch.io/roguesnowboarding

Posted

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.

Posted

noob question, what is a one shot emitter?

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!

Posted

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?

Posted

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

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!

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...