ID:2153020
 
Code:
obj
BloodParticles
icon='Effects.dmi'
icon_state="blood"
New()
..()
Dissapate(100,1)
atom
proc
Dissapate(t,delete)
set waitfor=FALSE
animate(src,alpha=100,time=300)
if(delete)
sleep(t)
del(src)


Problem description:
I have this code start on all the blood particles. Instead of slowly changing their alpha,it instantly changes their alpha.

But when I do something like this
            animate(src)
animate(alpha=100,time=300)


It works fine but occasionally will turn the players mob alpha which is weird cuz I don't have any code that runs this on the player mob.

The animate is actually suppose to transition to 0 alpha and the animate time is suppose to be set to t, but I changed it to demonstrate the code otherwise the particles would instantly go fully alpha, and time was set manually to clarify its not working correctly.
No problem on my side.


Code:

mob
clone
New()
Dissapate(100, 1)
. = ..()


and

atom
proc
Dissapate(t,delete)
set waitfor=FALSE
animate(src, alpha = 0, time=100)
if(delete)
sleep(t)
del(src)
lol.. okay. Theres an animate running when the blood translate to position which halts the previous animation I assume.
Use the ANIMATION_PARALLEL flag in the animate proc.
yeah... I got to wait to stable release.
var/angle = whatever
var/speed = whatever
var/px = speed * cos(angle)
var/py = -speed * sin(angle)

animate(src, pixel_x = px, pixel_y = py, alpha = 0, time = 100)


Or you could write 1 animate for both the pixel offsets and the alpha transition.

You should also soft del your particles and not call del on them. Just set their loc to null, that'll do the trick.