I want to ask two questions:

1) If I use "#include" instruction to add a script to the main one, how can I make the variables, pointers...etc. defined in the main including script able to be used in the included script (if that is possible)?

2)Here is my code of a script included in the main script (I intend to make cut scenes and at first I want to write the word "Location: China" with an effect such that every 0.5 second, a letter is written without using animated sprites):


Code:
VIEW* movie_camera1 =
{
	layer = 5;
	pos_x = 0;
	pos_y = 0;
	size_x = screen_size.x;
	size_y = screen_size.y;
	arc = 60;
	x = 5800;
	y = 0;
	z = 2036;
	tilt = -20;
	pan = 181;
	genius = NULL;
	flags = UNTOUCHABLE;
} 
/////////////////////////////////////////

TEXT* location_info =
{
	pos_x = (screen_size.x/2)-50;
	pos_y = screen_size.y-10;
	layer = 0;
	font = "arial#16b";
	blue = 255;
	green = 20;
	red = 25;
	string("L");
	flags = 0;
}

///////////////////////////////////////

function play_movie1 (a)
{
	var CamPanStore;
	var time_passed = 0;
	
	if (a == 0)
	{
		set(camera,0);
		set(movie_camera1,SHOW);
   }
   CamPanStore = movie_camera1.pan;
   while(time_passed < 20)
   {
   	movie_camera1.pan -= 0.5*time_step;
   	time_passed += time_step/16;
   	if (time_passed == 0.5) str_cat(location_info.pstring[0],"o");

   	if (time_passed == 1) str_cat(location_info.pstring[0],"c");

   	if (time_passed == 1.5) str_cat(location_info.pstring[0],"a");

   	if (time_passed == 2) str_cat(location_info.pstring[0],"t");

   	if (time_passed == 2.5) str_cat(location_info.pstring[0],"i");

   	if (time_passed == 3) str_cat(location_info.pstring[0],"o");

   	if (time_passed == 3.5) str_cat(location_info.pstring[0],"n");

   	if (time_passed == 4) str_cat(location_info.pstring[0],":");

   	if (time_passed == 4.5) str_cat(location_info.pstring[0]," ");

   	if (time_passed == 5) str_cat(location_info.pstring[0],"C");

   	if (time_passed == 5.5) str_cat(location_info.pstring[0],"h");

   	if (time_passed == 6) str_cat(location_info.pstring[0],"i");

   	if (time_passed == 6.5) str_cat(location_info.pstring[0],"n");

   	if (time_passed == 7) str_cat(location_info.pstring[0],"a");
   	wait(1);
   }

}




The problem is:
when I run the main (not the included above) script, the engine says, "subscript requires array or pointer type <if (time_passed >= 0.5) str_cat(location_info.pstring[0],"o");>"


Thank you for reading

Last edited by The_KING; 06/19/13 09:56.