function InitGame(levelTime, randomSeed, restart)
	local ent;
	game.Print("Initializing Lua Map Upgrade ...");
	game.Print("....Adding Transporter with UI ...");
	ent = entity.FindBModel(169);
	ent:SetKeyValue("target", "tr_ui");
	entity.CallSpawn(ent);
	ent = entity.Spawn();
	mover.SetPosition(ent.GetNumber(ent), -1532, -826, 87);
	ent.SetupTrigger(ent, 128, 128, 128);
	ent.SetKeyValue(ent, "classname", "trigger_transporter");
	ent.SetKeyValue(ent, "wait", "5");
	ent.SetKeyValue(ent, "targetname", "tr_trigger");
	entity.CallSpawn(ent);
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "ui_transporter");
	ent.SetKeyValue(ent, "targetname", "tr_ui");
	ent.SetKeyValue(ent, "target", "tr_trigger");
	entity.CallSpawn(ent);
	game.Print("....Turbolift Setup ...");
	game.Print("........Removing unused entities ...");
	ent = entity.FindBModel(155);
	entity.Remove(ent);
	ent = entity.FindBModel(149);
	entity.Remove(ent);
	ent = entity.FindBModel(147);
	entity.Remove(ent);
	ent = entity.FindBModel(206);
	entity.Remove(ent);
	ent = entity.FindBModel(212);
	entity.Remove(ent);
	ent = entity.FindBModel(214);
	entity.Remove(ent);
	ent = entity.FindBModel(65);
	entity.Remove(ent);
	ent = entity.FindBModel(59);
	entity.Remove(ent);
	ent = entity.FindBModel(57);
	entity.Remove(ent);
	ent = entity.FindBModel(87);
	entity.Remove(ent);
	ent = entity.FindBModel(93);
	entity.Remove(ent);
	ent = entity.FindBModel(95);
	entity.Remove(ent);
	ent = entity.FindBModel(55);
	entity.Remove(ent);
	ent = entity.FindBModel(58);
	entity.Remove(ent);
	ent = entity.FindBModel(61);
	entity.Remove(ent);
	ent = entity.FindBModel(64);
	entity.Remove(ent);
	ent = entity.FindBModel(88);
	entity.Remove(ent);
	ent = entity.FindBModel(91);
	entity.Remove(ent);
	ent = entity.FindBModel(94);
	entity.Remove(ent);
	ent = entity.FindBModel(97);
	entity.Remove(ent);
	ent = entity.FindBModel(145);
	entity.Remove(ent);
	ent = entity.FindBModel(148);
	entity.Remove(ent);
	ent = entity.FindBModel(151);
	entity.Remove(ent);
	ent = entity.FindBModel(154);
	entity.Remove(ent);
	ent = entity.FindBModel(207);
	entity.Remove(ent);
	ent = entity.FindBModel(210);
	entity.Remove(ent);
	ent = entity.FindBModel(213);
	entity.Remove(ent);
	ent = entity.FindBModel(216);
	entity.Remove(ent);
	game.Print("........Adding turbolifts ...");
	ent = entity.FindBModel(89);
	ent.SetKeyValue(ent, "target", "tlD22");
	ent = entity.FindBModel(100);
	ent.SetKeyValue(ent, "targetname", "tl1D22Doors");
	ent = entity.FindBModel(99);
	ent.SetKeyValue(ent, "targetname", "tl1D22Doors");
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "target_turbolift");
	ent.SetKeyValue(ent, "targetname", "tlD22");
	ent.SetKeyValue(ent, "target", "tl1D22Doors");
	ent.SetKeyValue(ent, "health", 22);
	ent.SetKeyValue(ent, "wait", 3000);
	ent.SetupTrigger(ent, 40, 40, 40);
	entity.CallSpawn(ent);
	mover.SetPosition(ent.GetNumber(ent), 2669, 2166, 76);
	mover.SetAngles(ent.GetNumber(ent), 0, 180, 0);
	ent = entity.FindBModel(208);
	ent.SetKeyValue(ent, "target", "tlD1");
	ent = entity.FindBModel(205);
	ent.SetKeyValue(ent, "targetname", "turbo1");
	ent = entity.FindBModel(204);
	ent.SetKeyValue(ent, "targetname", "turbo1");
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "target_turbolift");
	ent.SetKeyValue(ent, "targetname", "tlD1");
	ent.SetKeyValue(ent, "target", "turbo1");
	ent.SetKeyValue(ent, "health", 1);
	ent.SetKeyValue(ent, "wait", 3000);
	ent.SetupTrigger(ent, 40, 40, 40);
	entity.CallSpawn(ent);
	mover.SetPosition(ent.GetNumber(ent), -3373, 29, -452);
	mover.SetAngles(ent.GetNumber(ent), 0, 350, 0);
	ent = entity.FindBModel(153);
	ent.SetKeyValue(ent, "target", "tlD3");
	ent = entity.FindBModel(142);
	ent.SetKeyValue(ent, "targetname", "tlD3Doors");
	ent = entity.FindBModel(143);
	ent.SetKeyValue(ent, "targetname", "tlD3Doors");
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "target_turbolift");
	ent.SetKeyValue(ent, "targetname", "tlD3");
	ent.SetKeyValue(ent, "target", "tlD3Doors");
	ent.SetKeyValue(ent, "health", 3);
	ent.SetKeyValue(ent, "wait", 3000);
	ent.SetupTrigger(ent, 49, 49, 38);
	entity.CallSpawn(ent);
	mover.SetPosition(ent.GetNumber(ent), -1450, -609, 75);
	mover.SetAngles(ent.GetNumber(ent), 0, 90, 0);
	ent = entity.FindBModel(63);
	ent.SetKeyValue(ent, "target", "tlD14");
	ent = entity.FindBModel(52);
	ent.SetKeyValue(ent, "targetname", "tlD14Doors");
	ent = entity.FindBModel(53);
	ent.SetKeyValue(ent, "targetname", "tlD14Doors");
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "target_turbolift");
	ent.SetKeyValue(ent, "targetname", "tlD14");
	ent.SetKeyValue(ent, "target", "tlD14Doors");
	ent.SetKeyValue(ent, "health", 14);
	ent.SetKeyValue(ent, "wait", 3000);
	ent.SetupTrigger(ent, 40, 40, 40);
	entity.CallSpawn(ent);
	mover.SetPosition(ent.GetNumber(ent), -1523, 1339, 75);
	mover.SetAngles(ent.GetNumber(ent), 0, 90, 0);
	game.Print("....Setting up force fields ...");
	ent = entity.FindBModel(116);
	entity.Remove(ent);
	ent = entity.FindBModel(115);
	entity.Remove(ent);
	ent = entity.FindBModel(103);
	ent.SetKeyValue(ent, "classname", "func_forcefield");
	entity.CallSpawn(ent);
	ent = entity.FindBModel(114);
	ent.SetKeyValue(ent, "classname", "func_forcefield");
	entity.CallSpawn(ent);
	ent = entity.FindBModel(3);
	ent.SetKeyValue(ent, "classname", "func_forcefield");
	entity.CallSpawn(ent);
	ent = entity.FindBModel(2);
	ent.SetKeyValue(ent, "classname", "func_forcefield");
	entity.CallSpawn(ent);
	ent = entity.FindBModel(73);
	ent.SetKeyValue(ent, "classname", "func_forcefield");
	entity.CallSpawn(ent);
	game.Print("....Adding weapon FX ...");
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "info_notnull");
	ent.SetKeyValue(ent, "targetname", "weapTrg");
	mover.SetPosition(ent.GetNumber(ent), -3079, -735, -430);
	entity.CallSpawn(ent);
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "fx_phaser");
	ent.SetKeyValue(ent, "target", "weapTrg");
	ent.SetKeyValue(ent, "targetname", "phaser");
	ent.SetKeyValue(ent, "wait", "3");
	ent.SetKeyValue(ent, "spawnflags", "1");
	mover.SetAngles(ent.GetNumber(ent), 20, 1000, 0);
	mover.SetPosition(ent.GetNumber(ent), -3079, 55, -610);
	entity.CallSpawn(ent);
	ent = entity.Spawn();
	ent.SetKeyValue(ent, "classname", "fx_torpedo");
	ent.SetKeyValue(ent, "target", "weapTrg");
	ent.SetKeyValue(ent, "wait", "1");
	ent.SetKeyValue(ent, "count", "85");
	ent.SetKeyValue(ent, "targetname", "torpedo");
	ent.SetKeyValue(ent, "spawnflags", "2");
	mover.SetPosition(ent.GetNumber(ent), -3079, 55, -650);
	entity.CallSpawn(ent);
end 