ID:2301396   Oct 3 2017, 1:22 pm (Edited on Oct 3 2017, 6:26 pm) (See the best response by Klogaum.) Code: ``` proc BurnEffect() var/GAME_MOB/P = usr usr << "TESTTTT!" src.overlays += 'Art/Jutsus/BurnEffect.dmi' src << "Only a test!." burn_dmg = round(25) + round(P.ninjutsu/1.255) src.health -= burn_dmg spawn(100) src.overlays -='Art/Jutsus/BurnEffect.dmi' ``` Problem description: Im trying to make a burn effect when i shout my technique the overlays work fine but the damage and the text doesnt work can you help me so i can learn from my error. (i want that the effect do like exemple 25 damage each 4 second and when the spawn(100) come the effect stop. )
 <-> Oct 3 2017, 8:18 pm (Edited on Oct 3 2017, 8:30 pm) Best response ```proc/Burn(mob/A,mob/B,TIME=0,hittime=5) spawn(-1) A << "[B] HIT YOU";B << "YOU HIT [A]!" A.overlays += 'Art/Jutsus/BurnEffect.dmi' for(var/a=1 to TIME) if(a%hittime==0) var/burn_dmg=round(25) + round(B.ninjutsu/1.255) A.health-=burn_dmg sleep(1) A.overlays -='Art/Jutsus/BurnEffect.dmi' ``` ```proc/Burn(mob/A,mob/B,TIME=0,hittime=5,enterhit=0) spawn(-1) A << "[B] HIT YOU" B << "YOU HIT [A]!" A.overlays += 'Art/Jutsus/BurnEffect.dmi' if(enterhit){sleep(enterhit);var/dmg=round(25)+round(B.ninjutsu/1.255);A.health-=dmg} for(var/a=1 to TIME) if(a%hittime==0) var/dmg=round(25) + round(B.ninjutsu/1.255);A.health-=dmg sleep(1) A.overlays -='Art/Jutsus/BurnEffect.dmi' ``` ```proc/Burn(mob/A,mob/B,TIME=0,hittime=5,enterhit=0)spawn(-1){ A<<"[B] HIT YOU";B<<"YOU HIT [A]!" A.overlays+='Art/Jutsus/BurnEffect.dmi' if(enterhit){sleep(enterwithhit);var/dmg=round(25)+round(B.ninjutsu/1.255);A.health-=dmg} for(var/a=1 to TIME) if(a%hittime==0)var/dmg=round(25)+round(B.ninjutsu/1.255);A.health-=dmg; sleep(1) A.overlays -='Art/Jutsus/BurnEffect.dmi'} ```
 <-> Oct 4 2017, 5:19 am For the second code I got B and A unrefined car so I just need to create a var?
 <-> Oct 4 2017, 12:23 pm I do not understand abbreviated English You have many ways to the end Confirm the doubt again ```mob/verb/Flames() for(var/mob/M in get_step(usr,dir))Burn(M,usr) ``` ```mob/verb/Flames() var/mob/M=locate(/mob/) in get_step(usr,dir) if(M)Burn(M,usr) ```
 <-> Oct 4 2017, 1:00 pm Sorry it my auto corrector I mean I got error. B.ninjutsu undefined var and A.ninjutsu undefined var
 <-> Oct 4 2017, 2:18 pm Check out Effectlib. It's a much cleaner, safer way to do this. http://www.byond.com/developer/Ter13/EffectLib You just need to follow the documentation for implementation of new temporary combat effects. In this case, we want a ticker effect, so we set a duration and a tick_delay. We also need it to show the overlay when the effect is added, and remove the overlay when removed. Last, we need to have the user take damage every few seconds. Effectlib includes easy hooks functions you can override. ```effect burn duration = 300 tick_delay = 40 var power = 0 Added(mob/target,time) target.overlays += 'Art/Jutsus/BurnEffect.dmi' Removed(mob/target,time) target.overlays -= 'Art/Jutsus/BurnEffect.dmi' Ticked(mob/target,tick,time) target.health -= power ``` Last, we just need to actually create the effect we just defined and add it to a target. You'll want to do something like this in your code. ```var/effect/burn/e = new/effect/burne.power = round(25 + user.ninjutsu/1.255)e.Add(target) ``` Check out this thread for further documentation on how to use EffectLib. It was written exactly for this kind of thing. http://www.byond.com/forum/?post=2286256
 <-> Oct 4 2017, 2:18 pm It may happen that your variable is something beyond ```mob/var health=10mob/Player/var taijutsu=10 nin=10 gen=10mob/Monster/var Dmg1=10 Dmg2=10 ```
 <-> Oct 4 2017, 2:22 pm Ter after use it deletes itself, right? del e <- you do not need that
 <-> Oct 4 2017, 2:26 pm In response to Klogaum Klogaum wrote: Ter after use it deletes itself, right? del e <- you do not need that I rely on garbage collection. My references should be managed properly. If you don't manage your references, that's on you. I'd prefer not to call del unless it's totally unavoidable.
 <-> Oct 4 2017, 4:29 pm Thanks you for the help it really appreciate:) !!
 <-> Oct 4 2017, 6:34 pm Garbage collection. I always knew it existed, but now I'm sure it was worth it.