ID:142022
 
Hi, I was unsure how to label this issue, but I do receive errors referring to code. I am working on a Final Fantasy 4 game. When I am hosting it after about a hour it tell me I am out of resources...
I need to know how to fix this.
Code:
proc/Victory(list/Winners,exp_reward,gp_reward)
Winners<<sound(MUSIC_VICTORY,1)
for(var/mob/PC/p in Winners)
if(p&&p.client)
p.inmenu="panel"
for(var/obj/onscreen/curser/C in p.client.screen) del(C)
p.close_screen("battle_item");p.close_screen("battle_dart");p.close_screen("battle_askills");p.close_screen("battle_askills_cost")
p.close_screen("battle_left_menu");p.close_screen("battle_right_menu");p.close_screen("battle_menu")
p.close_screen("left_battle_attack_message");p.close_screen("right_battle_attack_message")
//This is where the parties experience is calculated...
var/plength
for(var/mob/PC/p in Winners) if(p&&p.client&&p.HP>0&&!p.Stone) plength++
if(plength>1)
exp_reward = round(exp_reward + (((exp_reward*5)/100)*plength))
gp_reward = round(gp_reward + (((exp_reward*5)/100)*plength)/plength)
//dancin'!
for(var/i,i<=20,i++)
switch(i)
if(0) for(var/mob/PC/p in Winners) if(p&&p.client&&p.HP>0){p.battle_screen("battle_message","Received [exp_reward] EXP!");p.exp+=exp_reward}
if(6) for(var/mob/PC/p in Winners) if(p&&p.client&&p.HP>0){p.battle_screen("battle_message","Received [gp_reward] GP!");p.gold+=gp_reward;if(p.gold>GPLimit) p.gold=GPLimit}
if(12) for(var/mob/PC/p in Winners) if(p&&p.client&&p.level_up()){p.battle_screen("battle_message","You gained a level!")}
if(5,11,17) for(var/mob/PC/p in Winners) if(p&&p.client&&p.HP>0) p.close_screen("battle_message")
for(var/mob/PC/p in Winners) if(p&&p.client&&!p.Stone) p.BtlFrm("battle_item")
sleep(3)
for(var/mob/PC/p in Winners) if(p&&p.client&&!p.Stone) p.BtlFrm("battle_walk")
sleep(3)
//monster's drop..
var/turf/battle/location/BLoc = locate(/turf/battle/location) in view()
if(BLoc && length(BLoc.obj_reward))
for(var/mob/PC/p in Winners) if(!p.Stone) p.battle_screen("monster_drop")
Drop_Loop
var/drop_done = length(Winners)
for(var/mob/PC/p in Winners) if(p.inmenu == "panel"&&!p.Stone) drop_done--
if(drop_done){sleep(10);goto Drop_Loop}
//distributing
for(var/obj/O in BLoc.obj_reward)
if(BLoc.obj_reward[O])
var/mob/PC/p = BLoc.obj_reward[O]
if(istype(O,/obj/Ability/Basic/Item))
var/obj/Ability/Basic/Item/I = locate(O.type) in p.contents
if(I) if(text2num(I.suffix)<max_grouped_item) I.suffix="[(text2num(I.suffix)) + 1]"
else if(length(p.contents)<inventory_size){p.contents += O;O.suffix=num2text(1)}
else if(length(p.contents)<inventory_size) p.contents += O
//ending the scene
for(var/mob/PC/p in Winners)
if(p&&p.client)
p.close_allscreen()
p.client.lazy_eye=0
p.menupos=null
p.BtlFrm("normal")
p<<sound(p.sound,1)
p.client.eye=p
p.inbattle=0
p.gauge=0
p.parry=0
p.escape=0
p.btl_action=null
p.btl_target=null
Status_Counter_Null(p)
Full_Status_Null(p)
if(p.inbossbattle) p.inbossbattle=null
if(p.addboss) {p.boss_fight += p.addboss;p.addboss=null}
if(p.HP<1) p.HP=1
if(p.inparty==1) p.density=0
p.loc = locate(p.XLoc,p.YLoc,p.ZLoc)
if(p.inparty==1) p.density=1
p.dir=SOUTH


Problem description:


runtime error: Out of resources!
proc name: Victory (/proc/Victory)
source file: nbattle.dm,772
usr: Nez (/mob/PC/mcaller)
src: null
call stack:
Victory(/list (/list), 176, 32)
Battle(the cave (104,118,3) (/turf/battle/location/cave), 0, /list (/list), /list (/list))
Nez (/mob/PC/mcaller): StartBattle(the ground (30,132,2) (/turf/cave/floor/ground))
the ground (30,132,2) (/turf/cave/floor/ground): Entered(Nez (/mob/PC/mcaller), the ground (30,133,2) (/turf/cave/floor/ground))
runtime error: Out of resources!
proc name: battle screen (/mob/PC/proc/battle_screen)
source file: nbattle.dm,2775
usr: Palom (/mob/PC/btwin)
src: Palom (/mob/PC/btwin)
call stack:
You're creating more than:

2^16-1:
objects
mobs
user-defined lists (contents, etc. don't count)

16 million:
areas
turfs
datums

Search "Out of resources". I had the same problem previously, and I fixed it by 1) Removing a list initialized under every turf (stupidity on my part) and 2) Placing the list under some areas; the ones I would need.