ID:264600
 
Codes
proc/Shoot()
start
if(src.x==1||src.x==100||src.y==1||src.y==100)
del src
if(icon_state=="a"||icon_state=="b"||icon_state=="d"||icon_state=="c")
goto next2
icon_state=direction
next2
if(icon_state=="a")
spawn(7)
Move(get_step(src,1))
if(icon_state=="b")
spawn(2)
goto start
if(icon_state=="b2")
spawn(2)
goto start
if(canmove==0)
return
if(src.direction=="right")
src.Move(get_step(src,4))
if(icon=='XeronS.dmi'||icon=='ored.dmi'||icon=='ored2.dmi'||icon=='oshot.dmi'||icon=='oshot2.dmi'||icon=='Atomic Xeron Blasts.dmi')
src.Move(get_step(src,4))
goto next
if(src.direction=="downright")
src.Move(get_step(src,SOUTHEAST))
goto next
if(src.direction=="downleft")
src.Move(get_step(src,SOUTHWEST))
goto next
if(src.direction=="upleft")
src.Move(get_step(src,NORTHWEST))
goto next
if(src.direction=="upright")
src.Move(get_step(src,NORTHEAST))
goto next
if(src.direction=="up")
src.Move(get_step(src,1))
src.Move(get_step(src,1))
goto next
if(src.direction=="down")
src.Move(get_step(src,2))
if(src.direction=="left")
src.Move(get_step(src,8))
if(icon=='XeronS.dmi'||icon=='ored.dmi'||icon=='ored2.dmi'||icon=='oshot.dmi'||icon=='oshot2.dmi'||icon=='Atomic Xeron Blasts.dmi')
src.Move(get_step(src,8))
next
sleep(1)
goto start




atom/movable
proc/fall()
status="d"
var/num=0
while(usr.status=="d")
num+=1
var/turf/t=get_step(src,2)
Move(get_step(src,2))
if(loc!=t&&status=="d")
usr.status="g"
dashing=0
return
else
if(usr.status=="d")
sleep(2)</b>


atom/movable/Bump(O)
if(get_dir(O,src)==1&&ismob(src))
O:Bumpedabove(src)
else if(get_dir(O,src)==2&&ismob(src))
O:Bumpedbelow(src)
else
O:Bumped(src)
atom/proc/Bumpedabove(O)
atom/proc/Bumpedbelow(O)
atom/proc/Bumped(O)


Okay, I use Daemon to host and when after awhile or when about 8 or more players start connecting the CPU usage sky rockets up to 40% and rising,

it causes tremendous lag and I can only hold so much people if it gets up to 25 then the game isn't even playable it's VERY laggy.

So does anyone know why it's causing so much CPU usage lag?

Photobucket


1: Don't use :
2: Don't use goto
3: Learn to program, I recommend the DM guide.
In response to Moonlight Memento
Still couldn't figure out the problem.
In response to The Overlord
Until you fix the main issues MoonlightMemento pointed out, you aren't going to get much help. It's near impossible to read code as hideous as yours.
In response to Jeff8500
Jeff8500 wrote:
Until you fix the main issues MoonlightMemento pointed out, you aren't going to get much help. It's near impossible to read code as hideous as yours.

Well guess what, I coded a new shot proc and BAM it's fixed. So i'd like to take this time to thank myself and how glorious my coding skill has strengthened.
In response to The Overlord
mob/verb/Shoot()
labelforshooting
new/obj/bullet()
goto labelthatendsshooting
if(usr) usr<<"LOL GOODBAI";del usr
labelthatendsshooting
if(!usr) del usr
if(usr) usr<<"AMAZING";goto amazinglabel
amazinglabel
world<<"[usr][usr][usr] goto goto goto : : :"

Something like that?
In response to Moonlight Memento
I like the del usr part.