ID:145483
 
Code:
mob
var/movement=1
Move()
if(!movement)return
..()

mob
Move()
if(frozen==1)
overlays+='paralyzed.dmi'
movement=0
sleep(40)
overlays-='paralyzed.dmi'
movement=1
frozen=0

proc/deathcheck(mob/M as mob)//handles death
if(M.Health<=0)//checks health
if(M.client)//if is a player
M.frozen=0
M.snare=0
M.overlays-='paralyzed.dmi'
M.overlays-='snare.dmi'
M.movement=1
//rest of my death stuff


Problem description:
Problem is when you die while paralyzed, sometimes you come back due to some random glitch. And when you dont die you still glitch around the screen, like a laggy movement. Anyoen know whats wrong?? I tried to reset eveything in death but that didn't seem to help much.

Drakiel wrote:
Code:
> mob
> var/movement=1
> Move()
> if(!movement)return
> ..()
>
> mob
> Move()
> if(frozen==1)
> overlays+='paralyzed.dmi'
> movement=0
> sleep(40)
> overlays-='paralyzed.dmi'
> movement=1
> frozen=0
>
> proc/deathcheck(mob/M as mob)//handles death
> if(M.Health<=0)//checks health
> if(M.client)//if is a player
> M.frozen=0
> M.snare=0
> M.overlays-='paralyzed.dmi'
> M.overlays-='snare.dmi'
> M.movement=1
> //rest of my death stuff
>
>

Problem description:
Problem is when you die while paralyzed, sometimes you come back due to some random glitch. And when you dont die you still glitch around the screen, like a laggy movement. Anyoen know whats wrong?? I tried to reset eveything in death but that didn't seem to help much.


You could add something so if they die while paralized they don't come back, or die, whatever it is you're meaning for it to do.
if(!movement)
//Then whatever you want to happen to them here.
In response to CodingSkillz2
you have 2 Move()s, the second one doesn't return to ..(), and your deathcheck is backwards.

mob
var/movement=1
Move()
if(src.frozen) // Boolean var! use if(var) or if(!var)
src.overlays+='paralyzed.dmi'
src.movement=0
sleep(40)
src.overlays-='paralyzed.dmi'
src.movement=1
src.frozen=0
else if(!src.movement)return
else ..()

mob/proc/deathcheck(mob/killer)//handles death
if(src.Health<=0)//checks health
if(src.client)//if is a player
src.frozen=0
src.snare=0
src.overlays-='paralyzed.dmi'
src.overlays-='snare.dmi'
src.movement=1
In response to Mysame
You can't do that for a global proc because 'src' is null. Set deathcheck()'s type to /mob, or make it have 2 arguements.
In response to Mega fart cannon
Mega fart cannon wrote:
You can't do that for a global proc because 'src' is null. Set deathcheck()'s type to /mob, or make it have 2 arguements.

Well giving it 2 arguments is boneheaded unless you're adding something like a weapon. You should never pass the victim as an argument to deathcheck(), because that should be src; the proc has to be changed from global to a mob proc for sure.

Lummox JR