Code:
#include <acknex.h>
#include <default.c>


ENTITY* plane_player;


#define TEXT_HANDLE skill73
#define ALIVE skill90


PANEL* main_menu_pan =
{
	pos_x = 520;
	pos_y = 500;

	layer = 2;
	alpha = 100;
}

TEXT* comm_speech_txt =
{
	pos_x = 100;
	pos_y = 150;
	
	string("");
	
	layer = 10;
	alpha = 100;
}


function set_text(TEXT *text, int ncol, STRING* s)
{
	str_cpy((text.pstring)[0], s);
}


action player_action()
{
	me.ALIVE = 1;
	
	player = me;
	
	wait(1);
	while(me.ALIVE)
	{
		wait(1);
	}
}

action enemy_action()
{
	me.ALIVE = 1;
	
	TEXT* comm_speech_npc_txt = txt_create(1,10);
	me.TEXT_HANDLE = handle(comm_speech_npc_txt);
	
	comm_speech_npc_txt.red = 135;
	comm_speech_npc_txt.green = 155;
	comm_speech_npc_txt.blue = 253;
	comm_speech_npc_txt.alpha = 70;
	comm_speech_npc_txt.flags = VISIBLE | TRANSLUCENT | SHADOW;
	
	wait(1);
	
	while (me.ALIVE)
	{
		wait(1);
	}
}


function conversation_01(ENTITY* air1, ENTITY* air2, ENTITY* air3)
{
	TEXT* text1 = ptr_for_handle(air1.TEXT_HANDLE);
	TEXT* text2 = ptr_for_handle(air2.TEXT_HANDLE);
	TEXT* text3 = ptr_for_handle(air3.TEXT_HANDLE);
	
	comm_speech_txt.red = 255; comm_speech_txt.green = 255; comm_speech_txt.blue = 255;
	comm_speech_txt.flags = VISIBLE | TRANSLUCENT | SHADOW;
	set_text(comm_speech_txt, 35, "blah1");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 0; comm_speech_txt.blue = 0;
	set_text(comm_speech_txt, 35, "...");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 255; comm_speech_txt.blue = 255;
	set_text(comm_speech_txt, 35, "blah2");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 0; comm_speech_txt.blue = 0;
	set_text(comm_speech_txt, 35, "...");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 255; comm_speech_txt.blue = 255;
	set_text(comm_speech_txt, 35, "blah3");
	wait(-1);
	text2.red = 150; text2.green = 150; text2.blue = 150;
	set_text(text2, 35, "blah4");
	wait(-5);
	set_text(comm_speech_txt, 35, "blah5");
	wait(-1);
	text3.red = 150; text3.green = 150; text3.blue = 150;
	set_text(text2, 35, "");
	set_text(text3, 35, "blah6");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 0; comm_speech_txt.blue = 0; // Osavolk
	set_text(comm_speech_txt, 35, "blah7");
	wait(-1);
	text1.red = 150; text1.green = 150; text1.blue = 150;
	set_text(text3, 35, "");
	set_text(text1, 35, "...");
	wait(-5);
	comm_speech_txt.flags = 0;
	set_text(text1, 35, "blah8");
	wait(-5);
	set_text(text1, 35, "blah9");
	wait(-5);
	set_text(text1, 35, "");
	set_text(text2, 35, "blah10");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 0; comm_speech_txt.blue = 0;
	comm_speech_txt.flags = VISIBLE | TRANSLUCENT | SHADOW;
	set_text(text2, 35, "");
	set_text(comm_speech_txt, 35, "blah11");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 255; comm_speech_txt.blue = 255;
	set_text(comm_speech_txt, 35, "blah12");
	wait(-5);
	set_text(comm_speech_txt, 35, "blah13");
	wait(-5);
	comm_speech_txt.red = 255; comm_speech_txt.green = 0; comm_speech_txt.blue = 0;
	set_text(comm_speech_txt, 35, "blah14");
	wait(-3);
	set_text(comm_speech_txt, 35, "blah15");
	wait(-5);
	comm_speech_txt.flags = 0;
}


function level_01()
{
	level_load ("");
	
	ENTITY* air1; ENTITY* air2; ENTITY* air3;
	
	air1 = ent_create(CUBE_MDL, vector(camera.x + 200, camera.y + 1400, camera.z + 200), enemy_action);
	air2 = ent_create(CUBE_MDL, vector(camera.x + 250, camera.y + 2200, camera.z - 100), enemy_action);
	air3 = ent_create(CUBE_MDL, vector(camera.x + 200, camera.y + 600, camera.z - 100), enemy_action);
	
	plane_player = ent_create(CUBE_MDL, vector(0, 0, 9800), player_action);
	plane_player.skin = 2;
	plane_player.pan = 180;
	
	wait(-4);
	
	conversation_01(air1, air2, air3);
	wait_for(conversation_01);
}


function main()
{
	video_mode = 9;
	video_screen = 1;
	wait(1);
	
	level_01();
}



Can anyone tell why this program is not working?
It crashes after "blah3" sentance with message:

"Error E1513
Crash in set_text"

If I remove PANEL* main_menu_pan it does work, but that is obviously not a fix. (This is a reduced segment from a much bigger program, took me some time to narrow down the problem.)

I am working in version 7.82, but I tried 7.85 too and I get the same error.