ID:1908386
 
Alright so the player powers up, and while he does that I want the particle effects to spawn in different locations near him in his view(). The way I coded this, they just spawn as overlays on his left side, up, down and left. The problem with this is that when he moves the particles also move and that's just a no-no.

So what I'm trying to do is spawn these particle effects in random locations around him.


var/powerup_on

mob/verb/PowerUp()
set category = "Skills"
name = "Power Up"
powerup_on = !powerup_on
if(powerup_on)
src << "You begin powering up your energy"
usr.underlays += /obj/Auras/aura_tall
usr.overlays += /obj/Particles/rising_particles_left
usr.overlays += /obj/Particles/rising_particles_up
usr.overlays += /obj/Particles/rising_particles_down
usr.overlays += /obj/Particles/rising_particles_right
else
src << "You stop powering up"
usr.underlays -= /obj/Auras/aura_tall

obj/Auras
aura_tall
icon = 'PowerUp.dmi'
icon_state = "2"
pixel_x = -32
aura_normal
icon = 'PowerUp.dmi'
icon_state = "1"
pixel_x = -32

obj/Particles
rising_particles_left
icon = 'Particles.dmi'
pixel_x = -30

rising_particles_up
icon = 'Particles.dmi'
pixel_y = 30

rising_particles_down
icon = 'Particles.dmi'
pixel_y = -30

rising_particles_right
icon = 'Particles.dmi'
pixel_x = 30

Don't use overlays if you don't want them to move with the player. Instead just move the object to the player's loc.