function play(entity_number)
{
my.emask |= ENABLE_ENTITY;
my.event = pause_event;
STRING* rec_str = " "; // stores the name of the recorded data file
STRING* temp_str = " "; // just a temporary string
var filehandle;
str_cpy(rec_str, str_for_num(temp_str, entity_number)); // create the name of the data file depending on entity's number
str_cat(rec_str, ".txt"); // and then add it the ".txt" extension
filehandle = file_open_read(rec_str); // now we can try to open the file
var temp = 0;
VECTOR tempStore;
VECTOR tempStorePan;
VECTOR tempVector;
var spaceFind;
var totalSpaces=0;
var count=0;
//file=file_open_read(filename);
//if(!file) return(-1); //ERROR, file not found
while(file_find(filehandle, " ")>=0) count++;
globalTester = count;//to watch the variable
while(temp < count)
{
tempStore.x=file_var_read(filehandle);
tempStore.y=file_var_read(filehandle);
tempStore.z=file_var_read(filehandle);
tempStorePan.x=file_var_read(filehandle);
tempStorePan.y=file_var_read(filehandle);
tempStorePan.z=file_var_read(filehandle);
my.frame = file_var_read(filehandle); // and put them inside the array
// rotate towards target
vec_set(tempVector, tempStore.x);
vec_sub(tempVector, my.x);
vec_to_angle(my.pan, tempVector);
//move to it with collision
c_move(my, vector(5 * time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);
temp +=1;
wait(1);
}
file_close(filehandle); // close the file
beep();
}