Yes.
if your modding, try to go in the code of powder toy and copy gel's code and then paste it and make some changes so it has the same thing as gel but it has a different name, a different color and whatnot
@thepowderizer1337 it's lua, but thanks.
@thepowderizer1337 (View Post)
How do I get the gel code?
thanks but is possible to turn the code into lua code?
if I were to check if this partical was not touching any other partical then It's selve, and freeze it if not. how would I do that or would I have to loop through every partical execpt for this? or is this a better way?
The update function is something like this:
local function update(i, x, y, s, nt)
some code here... do whatever you want.
end
There are two arguments here that can help you: "s" and "nt". "s" is surround_space, it tells the update function how many empty spaces there are around a particle. Minimum is 0 (the particle is completely surrounded by other particles) and the maximum is 8 (the particle is alone). "nt" is the number of spaces around a particle that are not occupied by the same element. This includes empty spaces, so nt is always greater than or equal to s.
For example, if a GOLD particle was surrounded by these particles:
[INSL][NONE][INSL]
[GOLD][*GOLD][GOLD]
[INSL][INSL][INSL]
then nt would be 6 (5 particles of INSL and one empty space) and s would be 1 (one empty space).
So nt - s would be the number of spaces around a particle that are occupied by different particles. In your example:
if nt - s > 0 then
freeze
else
act like a liquid
end