string Name	= "TEST";
int Model =	1;
int Weapon = 48;
int Weapon2 = 0;
int Team = 2;
int View = 1000;
int Think = 100;
int	Attack1	= 30;
int Attack2 = 30;
int Attack3 = 30;
int	Guard =	10;
int	Dodge =	20;
int Jump = 30;
int Look = 50;
int Burst = 30;
int Aim = 100;
int GetItem = 30;
int Spawn = 0;
int HP = 1000;	

// init function
int g_selfAddr;
int g_self;
OnInit(int this)
{
	g_selfAddr = this;
}


OnStart()
{
	g_self = GetSelf(g_selfAddr);
	ChangeBehavior(g_self, "run");
}

int timer = 0;
int var1 = 10;
int var2 = 20;
int data[10];

Save()
{
	int f = OpenFile("level\npctest.sav", "w");
	
	WriteFile(f, var1);
	WriteFile(f, var2);
	WriteFile(f, data[0]);
	WriteFile(f, data[1]);
	
	CloseFile(f);
}

Load()
{
	int f = OpenFile("level\npctest.sav", "r");
	
	var1 = ReadFile(f);
	var2 = ReadFile(f);
	data[0] = ReadFile(f);
	data[1] = ReadFile(f);
	
	CloseFile(f);
}



OnUpdate()
{
	timer++;
	
	var1 = var1 + 1;
	var2 = var2 + 2;
	data[0] = data[0] + 3;
	data[1] = data[1] + 4;
	
	if (timer == 10)
	{
		Say(g_self, "save ", var1, " ", var2, " ", data[0], " ", data[1]);
		Save();
	}
	
	if (timer == 20)
	{
		Load();
		Say(g_self, "load ", var1, " ", var2, " ", data[0], " ", data[1]);
	}
}