So, I found out what was causing the pop-up error with game_save(). I had this code in my player_code:

Code:
action player_code()
{
   ...

   my.shadow = 1; // THIS CAUSED THE game_save SCRIPT CRASH

   ...
}




The "my.shadow = 1" code caused the script crash when I used the SV_ALL flag for game_save, as shown below:

Code:
game_save("test", 7, SV_ALL);



Now that I commented "my.shadow = 1" code out, I am no longer getting a pop-up error when I game_save using only the SV_ALL flag.

Now however, I am getting some new errors, particularly when I have entities in my level that use the ent_movepath() command to travel a preset route. After saving the game (seemingly successfully), restarting the game, and pressing the LOAD GAME button, I get a pop-up error that states:

Code:
Malfunction W1508
Can't load test7.SAV
OK          Cancel



Once I click OK on this pop-up bug, another pop-up bug comes up saying:

Code:
Error E1515
Invalid function arguments in ent_placefloor
OK                   Cancel



When I press OK on this bug, I get another bug that immediately pops up as shown:

Code:
Error E1515
Invalid function arguments in ent_movepath
OK               Cancel



When I click OK on this pop-up bug, the first "ent_placefloor" error repeats itself, and these two pop-up bugs (mentioned above) alternatively repeat themselves over and over forever when I keep clicking the OK button.

Every time I click OK on these pop-up bugs, everything in the level, like moving entities, move a tiny increment in their movement pattern, in between every bug that I press the OK button on.

I only get these two pop-up bugs when an entity is using the ent_movepath() command, in the level that I save the game in. If I comment out the ent_movepath() command from whatever entity in the level is using it, the load seems to work fine.

As of now, I have a knight and ogre in my level that use the ent_movepath() command. Here are their code:

Code:
action ogre_action()
{
	
   ...

	
   if(ogre_dead == 0)
   {
      ent_movepath(me, "path_003", 2, 1+2); // IF I COMMENT 
         //    THIS OUT, THE game_load LOADS FINE.
   }
	
   ...
}	

action knight_action() 
{
   ...
	
   if(knight_dead == 0)
   {
      my.STATE = 1;
      ent_movepath(me, "path_003", 2, 1+2); // IF I COMMENT
         //    THIS OUT, THE game_load WORKS FINE.
   }
   if(knight_dead == 1)
   {
      my.STATE = 4;
      ent_movepath(me, NULL, NULL, NULL); // IF I COMMENT
         //    THIS OUT, THE game_load WORKS FINE.
   }
	
   while (1)
   { 
      knight_loc();
      knight_health();

      // state 1: wait until player comes close enough ////// 
      if(my.STATE == 1) 
      {
         my.tilt = 0;
         my.z = -544;
			
         my.ANIMATION += 3*time_step;
			
         ent_animate(me,"walk",my.ANIMATION,ANM_CYCLE);
			
         // detect all FLAG2 entities within 750 
         //    quants 	
		
         c_scan(my.x,my.pan,vector(360,0,750),SCAN_ENTS | SCAN_FLAG2 | IGNORE_ME);
			
         if (you) // player detected?
         {  
            my.tilt = 0;
	    my.z = -544;
				
	    ent_movepath(my,NULL,0,0); // IF I COMMENT
               //    THIS OUT, THE game_load WORKS FINE.
	    snd_stop ( songHandle );
	    songHandle = snd_loop ( sndObBtl, 80, 0 );
			
	    my.STATE = 2; 
	    enemy = your.CREATOR;
	 }				
      }
	
      ...
   }
}		

void temple_ogre()
{
	if(ogre_dead == 0)
	{
		ogre = ent_create ( "ogre.mdl", vector(-693,-36,-567), ogre_action );
   
		...

                // CREATES PATH THAT OGRE WALKS ON.
	
		path_create(ogre, 3, 3);
		path_setnode(ogre, 1, vector(-692, -36, -567), NULL);
		path_setnode(ogre, 2, vector(-269, -140, -567), NULL);
		path_setnode(ogre, 3, vector(-773, 739, -567), NULL);
	 
		vec_set(ogre.min_x,vector(-9,-9,0)); // set bounding box to individual values
		vec_set(ogre.max_x,vector(9,9,75));
	}	
	else if(ogre_dead == 1)
	{
		ogre = ent_create ( "ogre.mdl", vector(ogre_x_loc,ogre_y_loc,ogre_z_loc), ogre_action );
		ogre.scale_x = 0.23; // TEMPLE LEVEL OGRE SCALE
		ogre.scale_y = 0.23;
		ogre.scale_z = 0.23;
	}
}

void temple_knight()
{
	if(knight_dead == 0)
	{
	
		knight = ent_create ( "a_knight.mdl", vector(-879,-1744,-550), knight_action );

                // CREATES PATH THAT KNIGHT WALKS ON.

		path_create(knight, 3, 3);
		path_setnode(knight, 1, vector(-1061, -1335, -567), NULL);
		path_setnode(knight, 2, vector(-1224, -177, -567), NULL);
		path_setnode(knight, 3, vector(-1964, -304, -567), NULL);
	
		vec_set(knight.min_x,vector(-9,-9,-25)); // set bounding box to individual values
		vec_set(knight.max_x,vector(9,9,35));
	}
	else if(knight_dead == 1)
	{
		knight = ent_create ( "a_knight.mdl", vector(knight_x_loc,knight_y_loc,knight_z_loc), knight_action );
	}
	
}

function to_STemple_door_f() // ENTERING THE SOUTH DOOR OF TEMPLE ROOM
{
	if(event_type == EVENT_IMPACT) // TOUCHING THE DOOR THAT LEADS INTO
                                       //    SOUTH ENTRANCE OF TEMPLE ROOM
                                       //    LOADS CODE BELOW.
	{
		...
		
                temple_knight();
                temple_ogre();
     
                ...
      
	}
}



Can a game be saved when an entity in the level being saved in uses the ent_movepath() function to travel a certain route?

Last edited by Ruben; 07/25/15 06:56.