ID:177879
 
obj/proc//Begining the proc...
Explosion()//Naming the Proc...
oview() << "<big> \red BOOM!"
view() << sound('explosio.wav')
for (var/turf/X in range(src,1))//If it is withing 1 tile of the "Explosion"...
X.overlays+= /obj/boom//Overlay the Explosion icon
spawn(5)//Wait a little bit
X.overlays.Cut()//Delete the explosion, not all things last forever :)
..()
for(var/obj/hideable/T in range(src,1))
var/oldicon = T.icon
T.icon = null
T.density = 0
T.verbs -= /obj/hideable/verb/Hide
sleep(rand(300,600))
T.icon = oldicon
T.density = 1
T.verbs += /obj/hideable/verb/Hide
..()
for(var/mob/smiley/M in range(src,1))
M.SetHealthIconState()
M << "<big> \red BOOM!"
M.damage(10,M,"explode")
..()


This is the code that I am using. I think it might be my code instead of a bug that I mentioned in ID:110588 .

It leaves a Barrel....just look at the link I gave ya, please ;)


-ST
Sariat wrote:
obj/proc//Begining the proc...
Explosion()//Naming the Proc...
oview() << "<big> \red BOOM!"
view() << sound('explosio.wav')
for (var/turf/X in range(src,1))//If it is withing 1 tile of the "Explosion"...

First problem: You have the order of arguments wrong. That should be range(1,src), not the other way around.
            X.overlays+= /obj/boom//Overlay the Explosion icon
spawn(5)//Wait a little bit
X.overlays.Cut()//Delete the explosion, not all things last forever :)

Second problem: You didn't indent that line under spawn(), so you're spawning out nothing at all.
        ..()

Third problem: Why are you calling ..() if you only just defined the proc? There's no previous proc to fall back on, and even if there was, you probably wouldn't want to call it 3 times.
        for(var/obj/hideable/T in range(src,1))
var/oldicon = T.icon
T.icon = null
T.density = 0
T.verbs -= /obj/hideable/verb/Hide
sleep(rand(300,600))
T.icon = oldicon
T.density = 1
T.verbs += /obj/hideable/verb/Hide

Potential problem: Your hideable objects need some way of knowing they're alreayd hiding, and how long they'll be hiding. Otherwise a second stick of dynamite could foul the works.
        ..()
for(var/mob/smiley/M in range(src,1))
M.SetHealthIconState()
M << "<big> \red BOOM!"
M.damage(10,M,"explode")
..()

Last problem: There's no "O" in "dynamite".

Lummox JR
In response to Lummox JR
Thats funny, all those made me luagh. LOL!


Thanks Lummox.
Hmm... made the changes, still having the same problem...
In response to Sariat
Sariat wrote:
Hmm... made the changes, still having the same problem...

Can you show me the revised code?

Lummox JR
In response to Lummox JR
obj/proc//Begining the proc...
Explosion()//Naming the Proc...
oview() << "<big> \red BOOM!"
view() << sound('explosio.wav')
for (var/turf/X in range(1,src))//If it is withing 1 tile of the "Explosion"...
X.overlays+= /obj/boom//Overlay the Explosion icon
spawn(5)//Wait a little bit
X.overlays.Cut()//Delete the explosion, not all things last forever :)
for(var/obj/hideable/T in range(1,src))
var/oldicon = T.icon
T.icon = null
T.density = 0
T.verbs -= /obj/hideable/verb/Hide
sleep(rand(300,600))
T.icon = oldicon
T.density = 1
T.verbs += /obj/hideable/verb/Hide
for(var/mob/smiley/M in range(1,src))
M.SetHealthIconState()
M << "<big> \red BOOM!"
M.damage(10,usr,"explode")



Thanks,

-ST
In response to Sariat
The sleep() call in that one loop worries me. That's going to go through and hide each object one at a time, moving one by one to the next.
What you should probably do here is spawn() out a call to the obj's Hide() proc (which you'd write yourself) that would do the same thing: Hide for a short period of time, then reappear.

Lummox JR