{
	saved_StopBomb [0]
	saved_MeetFoley [0]
	saved_ObjMinefield [0]
	saved_ObjDocs [0]
	saved_ObjBunker [0]
	saved_BunkerA [0]
	saved_BunkerB [0]

	saved_OnGun01 [0]
	saved_OnGun02 [0]

	saved_NumObjectives [6]
	saved_CurObjective [0]
	saved_CurDocs [0]

	saved_Document01 [0]
	saved_Document02 [0]

	saved_Briefed01 [0]
	saved_Briefed02 [0]

	saved_firsttime [1]
	saved_also [0]

	OnLevelLoad[()
	{
		PlayAmbient(83);
		
		
		if (saved_also = 0)
		{
			saved_also = 1;
			
			CapFoley=GetEntity("Foley");
			CapFoley.Delay(1,0);
			
			GetEntity("panz01").MakeInfinitePickup();
			GetEntity("panz02").MakeInfinitePickup();

			tankTwo = GetEntity("tank02");
			tankTwo.SetInvulnerable(true);
			tankTwo.ShowEntity(false);

			SetMessage("NE Bastogne, Belgium",75,35);
			SetMessage2(535,75,50);
			SetMessage3(505,75,65);
		}
		GetPlayer().ScreenShake( 256 );
	}]

	Init[ (s)
	{
		if(saved_firsttime = 1)
		{
			saved_firsttime = 0;

			AddObjective( 133, 25197, 31889);
			SetObjectiveActive(0, true);

			AddObjective( 134, 27008, 26276);
			SetObjectiveActive(1, false);

			AddObjective( 135, 21909, 30016);
			SetObjectiveActive(2, false);

			AddObjective( 136, 11200, 31680);
			SetObjectiveActive(3, false);

			AddObjective( 137, 6034, 36955);
			SetObjectiveActive(4, false);

			AddObjective( 138, 27757, 36772);
			SetObjectiveActive(5, false);

			GetPlayer().SetNationality(0);
			GetPlayer().GiveWeapon(41, 5);
			GetPlayer().GiveWeapon(43, 5);
			GetPlayer().GiveWeapon(40, 5);
			GetPlayer().GiveWeapon(42, 8);
			GetPlayer().SetInvulnerable(false);

			AutoSave();
		}
	}]

	AdvanceObjectives[ (hideLast)
	{
		if( saved_CurObjective < saved_NumObjectives )
		{
			NextObj = (saved_CurObjective+1);
			DropObj = (saved_CurObjective-2);

			ObjectiveComplete( saved_CurObjective );

			if( NextObj < saved_NumObjectives )
			{
				if( hideLast = 1 )
				{
					SetObjectiveActive( saved_CurObjective, false );
				}

				SetObjectiveActive( NextObj, true );

				if( Level.saved_CurObjective > 1 )
				{
					Level.SetObjectiveActive( NextObj, true );
					if( hideLast = 0 )
					{
						Level.SetObjectiveActive( DropObj, false );
					}
				}
			}
			saved_CurObjective = NextObj;
		}
	}]

	EnterZone[ (zone)
	{
		CapFoley=GetEntity("Foley");

		if (zone = "stopzone" )
		{
			if (saved_MeetFoley = 0)
			{
				saved_StopBomb = 1;
				saved_MeetFoley = 1;
//				Run01 = GetEntity("run01");
//				Run01.GoWalking(25325, 18139, 5);
				AdvanceObjectives(0);
			}
		}

		if (zone = "gunzone01" )
		{

			if (saved_OnGun01 = 0)
			{
				saved_OnGun01 = 1;
				GunDude1 = GetEntity("gunman1");
				GunDude1.SetState_MG42( GetEntity("mg42-01"));
				GunDude2 = GetEntity("gunman2");
				GunDude2.SetState_MG42( GetEntity("mg42-02"));
			}

			if (saved_ObjBunker < 1)
			{
				saved_ObjBunker = (saved_ObjBunker +1);
				saved_BunkerA = 1;
				AdvanceObjectives(0);
//				NewObjectiveXY( 2, 21668, 30006 );
//				SetObjectiveActive(1,false);
				Level.GetPlayer().PlaySound(80);
			}

			else
			{

				if (saved_BunkerA = 0)
				{
					if (saved_CurDocs > 0)
					{
						saved_BunkerA = 1;
//						CapFoley.PlaySound(91);
						Level.GetPlayer().PlaySound(94);
					}
				}
			}
		}

		if (zone = "gunzone02")
		{

			if (saved_OnGun02 = 0)
			{
				saved_OnGun02 = 1;
				GunDude3 = GetEntity("gunman3");
				GunDude3.SetState_MG42( GetEntity("mg42-03"));
				GunDude4 = GetEntity("gunman4");
				GunDude4.SetState_MG42( GetEntity("mg42-04"));
			}

			if (saved_ObjBunker < 1)
			{
				saved_ObjBunker = (saved_ObjBunker +1);
				saved_BunkerA = 1;
				AdvanceObjectives(0);
//				NewObjectiveXY( 2, 11245, 31945 );
//				SetObjectiveActive(1,false);
				Level.GetPlayer().PlaySound(80);
			}

			else
			{

				if (saved_BunkerB = 0)
				{
					if (saved_CurDocs > 0)
					{
						saved_BunkerB = 1;
//						CapFoley.PlaySound(91);
						Level.GetPlayer().PlaySound(94);
					}
				}
			}
		}

		if (zone = "briefzone01")
		{
			if (saved_Document01 = 1)
			{
				if (saved_Briefed01 = 0)
				{
					saved_Briefed01 = 1;
					CapFoley.FollowPath("foley04");
					CapFoley.FollowPathCallback(127,"GoPatrol");
				}
			}
		}

		if (zone = "briefzone02")
		{
			if (saved_Document02 = 1)
			{
				if (saved_Briefed02 = 0)
				{
					saved_Briefed02 = 1;
					GetPlayer().PlaySound(79);
				}
			}
		}

		if (zone = "flakzone")
		{
			if (saved_Briefed02 = 1)
			{
				Tank01 = GetEntity("tank01");
				Tank01.ShowEntity(true);
				Tank01.FollowPath("tank01",0);
	
//				Player = GetPlayer();
//				Tank01.FollowPathCallback( 127, "TurnToEntity", Player );
//				Tank01.FollowPathCallback( 127, "TurretShootAt", Player );
				Tank01.FollowPathCallback( 127, "TankFireAtPlayer" );
			}
			
			return;
		}
		
		if (zone = "bunker1")
		{
			MrFoley = GetEntity("Foley");
			MrFoley.NextPath(2);
		}
	}]

	ActorKilled[(who)
	{
		if (who = "gunman1")
		{
			GetEntity("gunman1").SetState_Idle();

		}

		if (who = "gunman2")
		{
			GetEntity("gunman2").SetState_Idle();

		}

		if (who = "gunman3")
		{
			GetEntity("gunman3").SetState_Idle();

		}

		if (who = "gunman4")
		{
			GetEntity("gunman4").SetState_Idle();

		}

		if (who = "tank01")
		{
			ObjectiveComplete(4);
			SetObjectiveActive(4,false);
			SetObjectiveActive(5,true);

			Tank01 = GetEntity("tank01");
			Tank01.SetInvulnerable(true);
			Tank01.SetPassable(true);
			Tank01.Delay(5,10);
			Tank01.Delay(10,30);
		}

		if (who = "tank02")
		{
			ObjectiveComplete(5);
			SetObjectiveActive(5,false);
			Tank02 = GetEntity("tank02");
			Tank02.Delay(3,20);
//			AdvanceObjectives(0);
		}
	}]

}