ID:266308
 
When somone casts the FireWall on themselves, they are surrounded by, you guessed it, A WALL OF FIRE!. The problem is, if somone logs out when they have the wall of fire around them, when they log back in, the fire wall overlay...is there to stay....forever! :(.

mob
verb
FireWall()
usr.overlays += /obj/FireWall
usr.Defense += 100
sleep(200)
usr.overlays -= /obj/FireWall
usr.Defense -= 100

obj/FireWall
icon = 'FireWall.dmi'

I know that I dont have it take away any magic points or anything, I jsut want to know why this is happening, and how to fix it.
I suggest that instead of making the firewall part of the usr, you create a new turf or obj or something at the target's loc and do damage to any mob that Enters it or maybe do periodic damage to all mobs within a range of it. If you set the wall's layer to MOB_LAYER+1 it will appear over any mob icons as well.

-James
Philipe The Bard wrote:
When somone casts the FireWall on themselves, they are surrounded by, you guessed it, A WALL OF FIRE!. The problem is, if somone logs out when they have the wall of fire around them, when they log back in, the fire wall overlay...is there to stay....forever! :(.

When you save a mob, you save its overlays too.

The thing to do here is make the fire effect part of a list of effects on the mob, and when the player logs out, go through that list and remove all the effects from the mob's overlays.
In response to Jmurph
You could put
mob
Logout()
usr.overlays-=obj/overlay/firewall
try that
In response to Deadron
Im not too familiar with lists Deadron, could you give me a small example of a list type situation like this? It doesn't have to be about this, just anything that would be of some help.
That's a reason to remove certain overlays apon mob/Logout()
I know that I dont have it take away any magic points or anything, I jsut want to know why this is happening, and how to fix it.

It happens because the proc is suddenly halted right about here:

sleep(200)

And then, when the game is restarted, the proc doesn't resume from where it left off (since saving never has and never will keep track of where the code is running).

It's an age-old problem... and there is no real solution unless you either resort to extremely complex and low-level BYOND programming, or simply keep track of all modifications you've done and remove them at logout, which is also difficult.

Your best bet would probably be James' approach -- to create an object in the location -- then, if someone hits you, check to see if a firewall object is there, and if there is, modify the defense score of the damage roll appropriately.

Good luck!