ID:269040
 
_>
        while(Q1.pixel_y<32&&Q2.pixel_y<32&&Q3.pixel_y<32&&Q4.pixel_y<32)
M.overlays-=Q1
M.overlays-=Q2
M.overlays-=Q3
M.overlays-=Q4
Q1.pixel_y+=5
Q2.pixel_y+=5
Q3.pixel_y+=5
Q4.pixel_y+=5
M.overlays+=Q1
M.overlays+=Q2
M.overlays+=Q3
M.overlays+=Q4
sleep(1)

[Edit]The while() proc is supposed to be back 2 tabs, the DM tags messed it up

Q1, 2, 3 & 4 are objs. M is a mob.

Whenever I call it from another proc, it makes that proc go over and over and over and over until the while statement is not met :(. How could I fix this?

[Edit]Actually, I think it's delaying spawn() procs...that's the only thing that it's delaying. :o And a few other things...This has gotten me conffuzled. :(
Thanks for reading,
~Ramen
DM code is executed one line at a time, in the order that they are read and processed. So, your proc that calls this loop will transfer it's processing over to the loop while the loop executes. Lines coming after the call to the while() loop will not execute until the processing of the loop has completed and transfered back to the original proc that called it. Only then will your following lines be executed.

~X
In response to Xooxer
Actually, I now think it's a problem with del() now that I did some more testing. :O
    Bump(atom/q)
if(ismob(q))
var/mob/Q =q
spawn()//YMI told me to put this here, yet now it deletes it (the projectile) before TakeDamage() IS called
Q.TakeDamage(src.owner,src.owner.int+rand(5,10),magic)
del(src)
mob/proc
TakeDamage(mob/Q,damage,num)
damage+=rand(-3,3)
if(damage<0)damage=0
if(num==magic)
src.magic(damage)
else if(num==physical)
if(rand(Q.lck,100)<100)
src.hit(dmg)
else
dmg*=2
src.crit(dmg)
src.hp-=damage
src.DeathCheck(Q)

mob
proc
DeathCheck(mob/Q)
if(src.hp<1)
if(!Q.client)
view(src,10)<<"\red[Q] has killed [src]."
if(Q.client&&!src.client)
view(src,10)<<"\red[Q] has killed [src]."
if(Q.client&&src.client)
world << "\red<b>[Q] has killed [src].</b>"

/*WARNING:
unreadable horrid code brought by your's truly ahead (even Wizzie said so. :D) (I changed it since yesterday a tad (very little))*/

proc
damage(atom/movable/ref,num,r,g,b)
if(!num)num=0
if(num<0)num=0
if(num>9999)num=9999
var/q = num2text(num)
var/q1 = copytext(q,1,2)
var/q2 = copytext(q,2,3)
var/q3 = copytext(q,3,4)
var/q4 = copytext(q,4,5)
var/obj/Q1 = new
Q1.pixel_x=-30
var/obj/Q2 = new
Q2.pixel_x-=20
var/obj/Q3 = new
Q3.pixel_x-=10
var/obj/Q4 = new
Q1.layer=MOB_LAYER+1337
Q2.layer=MOB_LAYER+1337
Q3.layer=MOB_LAYER+1337
Q4.layer=MOB_LAYER+1337
Q1.icon='numbers.dmi';Q1.icon_state="[q1]"
Q2.icon='numbers.dmi';Q2.icon_state="[q2]"
Q3.icon='numbers.dmi';Q3.icon_state="[q3]"
Q4.icon='numbers.dmi';Q4.icon_state="[q4]"
Q1.icon-=rgb(255,255,255)
Q2.icon-=rgb(255,255,255)
Q3.icon-=rgb(255,255,255)
Q4.icon-=rgb(255,255,255)
Q1.icon+=rgb(r,g,b)
Q2.icon+=rgb(r,g,b)
Q3.icon+=rgb(r,g,b)
Q4.icon+=rgb(r,g,b)
Q1.overlays+=image('numbers.dmi',"o[q1]")
Q2.overlays+=image('numbers.dmi',"o[q2]")
Q3.overlays+=image('numbers.dmi',"o[q3]")
Q4.overlays+=image('numbers.dmi',"o[q4]")
Q1.layer=9999999
Q2.layer=9999999
Q3.layer=9999999
Q4.layer=9999999
while(Q1.pixel_y<32&&Q2.pixel_y<32&&Q3.pixel_y<32&&Q4.pixel_y<\
32)
ref.overlays-=Q1
ref.overlays-=Q2
ref.overlays-=Q3
ref.overlays-=Q4
Q1.pixel_y+=5
Q2.pixel_y+=5
Q3.pixel_y+=5
Q4.pixel_y+=5
ref.overlays+=Q1
ref.overlays+=Q2
ref.overlays+=Q3
ref.overlays+=Q4
sleep(1)
ref.overlays-=Q1
ref.overlays-=Q2
ref.overlays-=Q3
ref.overlays-=Q4

Procs that call that:
atom/movable/proc/hit(N as num)
damage(src,N,255)
atom/movable/proc/crit(N as num)
damage(src,N,200,200,0)
atom/movable/proc/heal(N as num)
damage(src,N,0,255,0)
atom/movable/proc/magic(N as num)
damage(src,N,0,0,255)

_>
Insult me if you wish, but, meh, it almost gets the job done. =/

[Edit]I'll just take the whole piece down here out. :O Just so it doesn't cause problems. (Sorry YMI. :( )
In response to Hell Ramen
Maybe you'll have to use spawn(-1). I can't see anything else that looks like a problem, and perhaps del(src) is considered immediately pending. =\

*Edit >.>
No problem, just a miscommunication. It happens. =P
In response to YMIHere
--EDIT--
Yay! Thanks YMI, it works peachy now. :)
Thank you!