Jump to content

Emitter


Rick
 Share

Recommended Posts

So in one of my model entities I'm trying to create an emitter and place it at the model's location but I don't see any particle effects. Wondering what I am missing? I used the firepit as an example.

 

function class:CreateObject(model)
local object=self.super:CreateObject(model)
       object.model = model

       object.iceEmitter = CreateEmitter(200, 1, EntityPosition(object.model, 1), 0, nil)
       object.iceEmitter:Paint(LoadMaterial("abstract::smoke.mat"), 0)
       object.iceEmitter:SetRadius(.1, 1)
       object.iceEmitter:SetColorf(112/255, 254/255, 236/255, 1)
       object.iceEmitter:SetWaver(2.0)
       object.iceEmitter:SetRotationSpeed(2.6)
       object.iceEmitter:SetVelocity(Vec3(0, 4, 0), Vec3(0, 0, 0))
       object.iceEmitter:SetArea(Vec3(2.0, 2.0, 2.0))
end

Link to comment
Share on other sites

:) I didn't overlook it I left it out on purpose because I didn't think it was needed. I just added the code to change worlds and I'm still not seeing anything.

 

       SetWorld(fw.transparency.world)
object.iceEmitter = CreateEmitter(200, 1, EntityPosition(object.model, 1), 0, nil)
object.iceEmitter:Paint(LoadMaterial("abstract::smoke.mat"), 0)
object.iceEmitter:SetRadius(.1, 1)
object.iceEmitter:SetColorf(112/255, 254/255, 236/255, 1)
object.iceEmitter:SetWaver(2.0)
object.iceEmitter:SetRotationSpeed(2.6)
object.iceEmitter:SetVelocity(Vec3(0, 4, 0), Vec3(0, 0, 0))
object.iceEmitter:SetArea(Vec3(2.0, 2.0, 2.0))
SetWorld(fw.main.world)

Link to comment
Share on other sites

you need to look at the parameters for CreateEmitter()... specifically the 3rd parameter... thats velocity, not position. Use PositionEntity() for setting the location of the emitter.

 

AND the second parameter is time in milliseconds... which you have set to 1... i assume you want 1 second which would be 1000...

 

are you sure you looked at the firepit example? :)

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

you need to look at the parameters for CreateEmitter()... specifically the 3rd parameter... thats velocity, not position.

 

Dang docs say position for 3rd param

http://www.leadwerks.com/wiki/index.php?title=Emitters#CreateEmitter

 

 

AND the second parameter is time in milliseconds... which you have set to 1... i assume you want 1 second which would be 1000...

 

I want it to be .2 actually but yeah missed that. I set my parameters in the editor first to get the look I'm after and trying to translate it to code.

 

 

are you sure you looked at the firepit example?

 

If you haven't figured it out by now I'm not very good at following directions :)

 

 

This is the look in the editor and settings I'm generally going for. Just made this quick so not all settings like rotation are what I was looking for but it's the basic idea.

 

http://dl.dropbox.com/u/1293842/EmitterTest.png

 

So I must be missing something else because it's still not working when I make your changes.

Link to comment
Share on other sites

yes for C its wrong... but for the other 3 languages, LUA being one of them, it shows the correct syntax. unfortunately everyone has been locked out of the wiki so it cannot be fixed by anyone other than josh... but the forum documentation should be fixed as well since it appears it was just copied and pasted without actually reviewing...

 

I want it to be .2 actually but yeah missed that. I set my parameters in the editor first to get the look I'm after and trying to translate it to code.

then use 200 for the second parameter...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...