I scripted an energy element, NULL, which displaces DMND. The problem is that it doesn't only displace it, it also destroys some of the DMND particles.
(The velocity and reaction functions were written because they may be useful for other elements I might write in the same file. This way I don't have to repeat some things too many times)
My guess is that, under some circumstances, the fact NULL has nowhere to be reflected to doesn't only cause it to disappear, but also DMND particles somehow.
Is there any way to fix this?
Thank you for replying in advance.
PS: I don't know exactly what the nt variable of the update function actually is. All I know is that checking wether it is higher than 0 or not reduces the fps drop the element causes, so it would be nice if someone told me what it is.
Does it actually delete the DMND or does it just stack particles? (2 DMND on top of each other)? Place a circle of however many DMND, and look at the part count. After using NULL, open the console and type !set type dmnd dmnd
If the number returned is the same as the particle count at the start, but it looks like DMND is missing, you have stacking. If the number returned is lower, you have DMND being deleted.
-RCAP
That's what I did: After testing big quantities of NULL on DMND, it seemed that there was less DMND than the beginning, so I did it again and used !set life dmnd 0 to check part count before and after the NULL wave.
The results confirmed that DMND particles actually disappear (DMND parts number got reduced).
Bump, still waiting for answers.
Thank you very much for replying.
I'm currently having another problem: adding "return true" in the reaction function (inside or outside of the if_then structure) and in the main function causes NULL to not move.
NULL particles still gain an initial velocity from the "velocity" function, but they don't move accordingly to their velocities; they don't move at all, yet they retain their velocity.
nt is the number of neighbouring positions (in a 1 pixel radius) which are either empty or contain a particle of a different type to the current particle.
So if nt is 0, that means the current particle is stuck in the middle of a load of identical particles, so there won't be any DMND immediately next to it to react with.
Thank you for answering my nt question.
That worked, thank you.