var/WorldName=""
var
SomeoneChoosing=0
proc
SaveWorld()
world<<"World saving in progress..."
var/savefile/F = new("Worlds/[WorldName] World.sav")
var/list/L = new
L+=genlayer
for(var/Blocks/O in world)
if(!istype(O,/HUD))
if(O.name!="Black")
O.saved_x = O.x
O.saved_y = O.y
O.saved_z = O.z
L += O
else
if(O.owner!=null)
O.saved_x = O.x
O.saved_y = O.y
O.saved_z = O.z
L += O
F[""] << L
world<<"World saved."
Player
verb //Make where once world is opened you automatically go to world as a new player or loaded player.
Save_World()
SaveWorld()
Save_Player()
var/savefile/F = new ("Players/[src.key] [WorldName] World Player")
src<<"<b>Game Saved"
src.xco = src.x
src.yco = src.y
src.zco = src.z
Write(F)
NewWorld()
set hidden = 1
WorldName=input("What do you wish to name this world?") as text
winshow(usr, "Title", 0)
winshow(usr, "Wait",1)
sleep(5)
Generation()
sleep(15)
winshow(usr,"Wait",0)
src.loc=locate(1,1,1)
src.pixel_z=(genlayer*16) // Puts you on top of generated map.
src.icon='Mob.dmi'
src.layer=12
src.client.screen += screen_objects
winshow(usr,"default",1)
LoadWorld()
set hidden = 1
var/list/saveFiles=flist("Worlds/")
var/list/save_display=list()
for(var/v in saveFiles)
save_display+="[v]"
var/choice=input("Welcome to [world.name]! What would you like to do?\n\nSavefiles Used: ","Login") in saveFiles
winshow(src, "Title", 0)
winshow(src, "Wait",1)
sleep(5)
var/savefile/F = new("Worlds/[choice]")
var/list/L = new
F[""] >> L
if(!L)
alert("World Corrupted.")
return
genlayer = L[1]
for(var/Blocks/O in L)
O.loc = locate(O.saved_x,O.saved_y,O.saved_z)
if(fexists("Players/[src.key] [choice] Player"))
var/savefile/D = new("Players/[src.key] [choice] Player")
Read(D)
world << "<font color = blue>[src] has logged in!"
src.loc = locate(src.xco,src.yco,src.zco)
src.pixel_z=(genlayer*16)
src.layer=12
src.client.screen+=screen_objects
else
src.loc=locate(1,1,1)
src.icon='Mob.dmi'
src.layer=12
src.client.screen += screen_objects
for(var/Blocks/B in src)
if(src.pixel_z<B.pixel_z)
src.pixel_z=B.pixel_z
src.pixel_z+=src.pixel_z+16
winshow(src, "Wait",0)
winshow(src,"default",1)
Problem description:
I have searched all over the forums, looked through the help guide, and I've been staring at this for 2 hours now and I can get a single thing to work. How do I get rid of this bad client?
runtime error: Cannot read null.screen
proc name: LoadWorld (/Player/verb/LoadWorld)
source file: World.dm,83
usr: Ganing (/Player)
src: Ganing (/Player)
call stack:
Ganing (/Player): LoadWorld()
FYI 83 is: src.client.screen += screen_objects.
I've tried creating a mob for the client but I just can't get anything to work. It happens when I'm loading a world I've created. The character save system has really nothing to do with it as without it I still get the error. Please help :/
Do you set client.mob anywhere (or mob.client)?
Have you output the client.mob information to make sure it's expected?