Rick Posted October 19, 2011 Share Posted October 19, 2011 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 Quote Link to comment Share on other sites More sharing options...
Aily Posted October 19, 2011 Share Posted October 19, 2011 setworld maybe? Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2011 Author Share Posted October 19, 2011 The world should be set. I can have emiiters in the base world right? Quote Link to comment Share on other sites More sharing options...
Aily Posted October 19, 2011 Share Posted October 19, 2011 The world should be set. I can have emiiters in the base world right? You can, but they sprites will be turned to directional light, not to camera such funny bug. Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2011 Author Share Posted October 19, 2011 oh really? OK I'll give the transparent world a try. Quote Link to comment Share on other sites More sharing options...
DaDonik Posted October 19, 2011 Share Posted October 19, 2011 The Firepit example does set the world to the transparency world and back to normal after all emitters are created. Looks like you overlooked that Rick =) Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2011 Author Share Posted October 19, 2011 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) Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 19, 2011 Share Posted October 19, 2011 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? Quote 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 More sharing options...
Rick Posted October 19, 2011 Author Share Posted October 19, 2011 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. Quote Link to comment Share on other sites More sharing options...
macklebee Posted October 19, 2011 Share Posted October 19, 2011 Dang docs say position for 3rd param http://www.leadwerks.com/wiki/index.php?title=Emitters#CreateEmitter 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... Quote 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 More sharing options...
Rick Posted October 19, 2011 Author Share Posted October 19, 2011 Sweet that worked, thanks! Forgot the ms conversion. I'll check out the forum doc on that parameter name also if not done already. Thanks again. Quote 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.