- CurrentWorld = 0 ;
- //Set the two arrays up
- // Each World array holds a room_index
- //Fire Worlds
- FireWorld[0] = rm_fire_one ;
- FireWorld[1] = rm_fire_two ;
- FireWorld[2] = -5 ;
- //Ice Worlds
- IceWorld[0] = rm_ice_one;
- IceWorld[1] = rm_ice_two;
- IceWorld[2] = -5 ;
- //Create The Grids
- //These grids hold where it is safe to switch too in there respective worlds
- FireGrid[0] = ds_grid_create(room_width/32,room_height/32) ;
- IceGrid[0] = ds_grid_create(room_width/32,room_height/32) ;
- FireGrid[1] = ds_grid_create(room_width/32,room_height/32) ;
- IceGrid[1] = ds_grid_create(room_width/32,room_height/32) ;
- FileName = "ProjectSolomon.wgd" ;
- if(file_exists(FileName)) // Read the contents
- {
- /*
- ** Format
- ** Fire World Grid (String)
- ** Ice World Grid (String)
- ** And So On
- */
- File = file_text_open_read(FileName) ;
- var i ; i = 0 ;
- do
- {
- switch(i mod 2)
- {
- case 0 :
- {
- FireGrid[floor(i/2)] = ds_grid_read(FireGrid[floor(i/2)],file_text_read_string(File)) ;
- }
- ;break;
- case 1 :
- {
- IceGrid[floor(i/2)] = ds_grid_read(IceGrid[floor(i/2)],file_text_read_string(File)) ;
- }
- ;break;
- }
- file_text_readln(File) ;
- i+=1 ;
- }
- until(file_text_eof(File) || i > 10000)
- }
- else // Create the file and its contents
- {
- File = file_text_open_write(FileName) ;
- var i ; i = 0 ;
- // Basically just flick between rooms and survey the level
- do
- {
- room_goto(FireWorld[i]) ;
- show_message(string(room) + " || " + string(FireWorld[i]))
- FireGrid[i] = WorldGridSetUp(FireGrid[i]) ;
- room_goto(IceWorld[i]);
- IceGrid[i] = WorldGridSetUp(IceGrid[i]) ;
- show_message(string(room) + " || " + string(IceWorld[i]))
- //Write the Grids
- file_text_write_string(File,ds_grid_write(FireGrid[i])) ;
- file_text_writeln(File) ;
- file_text_write_string(File,ds_grid_write(IceGrid[i])) ;
- file_text_writeln(File) ;
- i+=1 ;
- }
- until(FireWorld[i] == -5 || i > 10000)
- room_goto(IceWorld[0]) ;
- }