Jump to content

Emitters going crazy?


Marcousik
 Share

Recommended Posts

Hello and thx for answer. I made more tests.

And it is clear that it happens after a long time of loading vegetation models on the map but not edited with the vegetation tool whereas generated with script.

Disabling the script-loaded vegetation make the map load quicker and emitters are back normal.

Edit

you mean thishttps://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Emitter_SetReleaseQuantity

 

Edit2: Solutions

Seems to be solved if  the emitters are created with a script running after the world is rendered, so a few second after start() finished is enough to let the emitters run normal - as expected.

Editor created emitters and emitters scripted in start function seem to be disturbed through a longer map loading time...

> Or add this little script to the editor-created emitters - it will solve the bug and will have almost no performances cost:

Quote


function Script:Start()
    self.emitter = tolua.cast(self.entity,"Emitter")
    self.Timer=Time:GetCurrent() 
    self.korrigiert=false
end

function Script:UpdateWorld()

    if Time:GetCurrent()-self.Timer>50000 and self.korrigiert==false then    --//--- 50000 or more depends on loading map time !! --//---
        self.emitter:SetReleaseQuantity(1) self.korrigiert=true
    elseif self.korrigiert==true then System:Print("Bye bug! ") self.entity:SetScript(nil)
    end

end

Here on the video see the bug be solved ^^ on the flames and red smoke

 

 

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...