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.
ID:266308
Dec 2 2001, 8:47 am
|
|
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.
|
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! |
-James