Data Realms Fan Forums

Error message
Page 1 of 1

Author:  4zK [ Sat Jan 07, 2017 7:35 pm ]
Post subject:  Error message

What exactly causes this message to appear in the lua console?

ERROR: Tried to add a Particle that already exists in the simulation!

Author:  Asklar [ Sun Jan 08, 2017 2:42 am ]
Post subject:  Re: Error message

If I'm not mistaken I think it's when you create something and then you somehow end up doing the MovableMan:AddParticle(stuff) for a second time of the same object.

I think it was something like that because I recall facing that error once and having fixed it by renaming some variables.

Author:  CaveCricket48 [ Sun Jan 08, 2017 8:16 am ]
Post subject:  Re: Error message

I've encountered this error when trying to create particles in the destroy() function of objects, I believe specifically in for blocks?

If the pointer mismatch bug is still around (when an MO is destroyed, Lua pointers can get scrambled and change what MO they're referencing), that might be related to this bug. An MO being destroyed, and MOs spawning in the same frame, might be some weird stuff going on.

Author:  4zK [ Sun Jan 08, 2017 1:33 pm ]
Post subject:  Re: Error message

I've had the same message pop up when doing stuff on function(destroy), but currently it appears when I go through all weapons in every actor's inventory every frame, spawning visual copies of the weapons with the lifetime of one frame.

The script goes something like this;
   for mo in MovableMan.Actors do
      if mo.Health > 0 and IsAHuman(mo) and mo:IsInventoryEmpty() == false then

         local actor = ToAHuman(mo);
         for i = 1, actor.InventorySize do

            local item = actor:Inventory();
            if item then
               -- spawn <item> --


The script is completely functional as of now but the error spam in the console is still annoying.

EDIT: The message only occurs when it's a global script. Attaching the script straight to the actor (HumanAI.lua) doesn't seem to produce the error message.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group