//no conditions
String[] conditions=new String[0];

//found the letter
String[] conditions=new String[1];
conditions[0]="HAVELETTER";

//have the pilot's pass
String[] conditions=new String[2];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";

//after first dialog
String[] conditions=new String[3];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";

//after second dialog
String[] conditions=new String[4];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";
conditions[3]="DIALOG2";

//after learing the plot
String[] conditions=new String[5];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";
conditions[3]="DIALOG2";
conditions[4]="LEARNPLOT";

//after the third dialog
String[] conditions=new String[6];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";
conditions[3]="DIALOG2";
conditions[4]="LEARNPLOT";
conditions[5]="DIALOG3";

//after the fourth dialog
String[] conditions=new String[7];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";
conditions[3]="DIALOG2";
conditions[4]="LEARNPLOT";
conditions[5]="DIALOG3";
conditions[6]="DIALOG4";

//after nightfall
String[] conditions=new String[8];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";
conditions[3]="DIALOG2";
conditions[4]="LEARNPLOT";
conditions[5]="DIALOG3";
conditions[6]="DIALOG4";
conditions[7]="NIGHT";

//at the end of the game
String[] conditions=new String[9];
conditions[0]="HAVELETTER";
conditions[1]="HAVEPASS";
conditions[2]="DIALOG1";
conditions[3]="DIALOG2";
conditions[4]="LEARNPLOT";
conditions[5]="DIALOG3";
conditions[6]="DIALOG4";
conditions[7]="NIGHT";
conditions[8]="GAMEOVER";


********************************************************************************

Camineet-Northeast	Enter Warehouse         Warehouse-Entrance
Camineet-Northeast	Enter Alis’ House       Camineet-AlisHouse
Camineet-Northeast	West			Camineet-Central

Camineet-AlisHouse	Exit			Camineet-Northeast

Camineet-North		South			Camineet-Central
Crovin

Camineet-Central		North			Camineet-North
Camineet-Central		East			Camineet-Northeast
Camineet-Central		West			Camineet-Northwest
Camineet-Central		South			Camineet-BusinessDistrict
Caci

Camineet-Northwest	East			Camineet-Central
Camineet-Northwest	South			Camineet-West
Camineet-Northwest	Enter Nekise’s House	Camineet-NekiseHouse

Camineet-NekiseHouse	Exit			Camineet-Northwest
Nekise

Camineet-BusinessDistrict	North			Camineet-Central
Camineet-BusinessDistrict East			Camineet-East
Camineet-BusinessDistrict West			Camineet-West
Camineet-BusinessDistrict	South			Camineet-South
Camineet-BusinessDistrict Enter Armory		Camineet-Armory
Camineet-BusinessDistrict Enter Second Hand	Camineet-SecondHand
Camineet-BusinessDistrict Enter First Food		Camineet-FirstFood

Camineet-Armory		Exit			Camineet-BusinessDistrict
Cerin

Camineet-SecondHand	Exit			Camineet-BusinessDistrict
Tulley

Camineet-FirstFood	Exit			Camineet-BusinessDistrict
Iomar

Camineet-East		West			Camineet-BusinessDistrict
Camineet-East		Enter Suelo’s House	Camineet-SueloHouse
Camineet-East		Enter Church		Camineet-Church
Camineet-East		East			Camineet-EastExit

Camineet-South		North		Camineet-BusinessDistrict
Camineet-South		West		Camineet-SouthExit
Camineet-South		Enter House01	Camineet-House01

Camineet-West		East		Camineet-BusinessDistrict
Camineet-West		South		Camineet-SouthExit
Camineet-West		West		Camineet-WestExit
Camineet-West		Enter House02	Camineet-House02

Camineet-SouthExit	East		Camineet-South
Camineet-SouthExit	North		Camineet-West
Camineet-SouthExit	Exit		Outside
Laider

Camineet-WestExit	East		Camineet-West
Camineet-WestExit	Exit		Spaceport-EastExit
Cronan

Camineet-EastExit	West			Camineet-East
Camineet-EastExit	Exit			Outside
Dermod

Camineet-House02	Exit		Camineet-West
Gearald

Camineet-Church		Exit			Camineet-East
Rafferty

Warehouse-Entrance	South		Camineet-Northeast
Warehouse-Entrance	North		Warehouse-NECorner

Warehouse-Fork		East		Warehouse-NECorner
Warehouse-Fork		West		Warehouse-DeadEnd
Warehouse-Fork		South		Warehouse-SCorner

Warehouse-SCorner	North		Warehouse-Fork
Warehouse-SCorner	West		Warehouse-Door

Warehouse-Door		East		Warehouse-SCorner
Warehouse-Door		West		Warehouse-Room

Warehouse-DeadEnd	East		Warehouse-Fork

Spaceport-EastExit	East		Camineet-WestExit
Spaceport-EastExit	West		Spaceport-Shopping
Carraig

Spaceport-SouthExit	North		Spaceport-Central
Spaceport-SouthExit	South		Parolit-NorthExit
Tormod

Spaceport-NorthExit	South		Spaceport-West
Dhuinn

Spaceport-Shopping	East		Spaceport-EastExit
Spaceport-Shopping	South		Spaceport-Central
Spaceport-Shopping	Enter First Food	Spaceport-FirstFood
Spaceport-Shopping	Enter Passport	Spaceport-Passport

Spaceport-West		East		Spaceport-Central
Spaceport-West		North		Spaceport-NorthExit
Spaceport-West		West		Spaceport-Alley

Spaceport-Alley		East		Spaceport-West
Spaceport-Alley		Enter Tunnel	Tunnel-North

Spaceport-Central	North		Spaceport-Shopping
Spaceport-Central	West		Spaceport-West
Spaceport-Central	South		Spaceport-SouthExit
Gaylan

Spaceport-FirstFood	Exit		Spaceport-Shopping
Donia

Spaceport-Passport	Exit		Spaceport-Shopping
Janel

Parolit-NorthExit		North		Spaceport-SouthExit
Parolit-NorthExit		East		Parolit-Northeast
Parolit-NorthExit		West		Parolit-Northwest
Risteard

Parolit-Northwest		East		Parolit-NorthExit
Parolit-Northwest		South		Parolit-BusinessDistrict
Parolit-Northwest		Enter House01	Parolit-House01
Baran

Parolit-Northeast		West		Parolit-NorthExit
Parolit-Northeast		South		Parolit-Southeast
Parolit-Northeast		Enter House02	Parolit-House02

Parolit-Southeast		North		Parolit-Northeast
Parolit-Southeast		West		Parolit-BusinessDistrict
Parolit-Southeast		South		Parolit-SouthExit
Parolit-Southeast		Enter House03	Parolit-House03
Parolit-Southeast		Enter Hospital	Parolit-Hospital

Parolit-BusinessDistrict	North		Parolit-Northwest
Parolit-BusinessDistrict	East		Parolit-Southeast
Parolit-BusinessDistrict	Enter First Food	Parolit-FirstFood
Parolit-BusinessDistrict	Enter Armory	Parolit-Armory
Parolit-BusinessDistrict	Enter 2nd Hand	Parolit-SecondHand

Parolit-SouthExit		North		Parolit-Southeast
Parolit-SouthExit		Exit		Outside
Uisdean

Parolit-House01		Exit		Parolit-Northwest
Neala

Parolit-House02		Exit		Parolit-Northeast
Neacal

Parolit-House03		Exit		Parolit-Southeast
Narvla

Parolit-Hospital		Exit		Parolit-Southeast
Ciarda

Parolit-FirstFood		Exit		Parolit-BusinessDistrict
Cuilean

Parolit-Armory		Exit		Parolit-BusinessDistrict
Airleas

Parolit-SecondHand	Exit		Parolit-BusinessDistrict
Gabhan

Tunnel-North	North		Parolit-Alley
Tunnel-North	South		Tunnel-Junction

Tunnel-South	South		Gothic-Northeast
Tunnel-South	North		Tunnel-Junction

Tunnel-Junction	North		Tunnel-North
Tunnel-Junction	South		Tunnel-South
Tunnel-Junction	East		Tunnel-Lab

Tunnel-Lab	West		Tunnel-Junction
Assistant

Gothic-Northeast		Enter Ruined House	Tunnel-South
Gothic-Northeast		West			Gothic-Northwest
Gothic-Northeast		South			Gothic-East

Gothic-Northwest		East			Gothic-Northeast
Gothic-Northwest		South			Gothic-Central
Gothic-Northwest		Enter Second Hand	Gothic-SecondHand

Gothic-Central		North			Gothic-Northwest
Gothic-Central		West			Gothic-WestExit
Gothic-Central		South			Gothic-South
Gothic-Central		Enter House01		Gothic-House01
Gothic-Central		Enter House02		Gothic-House02

Gothic-East		North			Gothic-Northeast
Gothic-East		West			Gothic-South
Gothic-East		Enter Hospital		Gothic-Hospital
Gothic-East		Enter Church		Gothic-Church
Gothic-East		East			Gothic-EastExit

Gothic-South		North			Gothic-Central
Gothic-South		Enter Ruined House	Gothic-RuinedHouse
Gothic-South		East			Gothic-East
Batair

Gothic-EastExit		West			Gothic-East
Gothic-EastExit		East			Outside
Balfour

Gothic-WestExit		West			Outside
Gothic-WestExit		East			Gothic-Central
Mannis

Gothic-RuinedHouse	Exit			Gothic-South

Gothic-House01		Exit			Gothic-Central
Nathalie

Gothic-House02		Exit			Gothic-Central
Calum

Gothic-SecondHand	Exit			Gothic-Northwest
Aherin

Gothic-Church		Exit			Gothic-East
Cowley

Gothic-Hospital		Exit			Gothic-East
Dacey

--------------------------------------------------------------------------------

//        //lets create an area here
//        CDArea area=new CDArea();
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            area.setAbsoluteDir("D:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\areas\\");
//            //set the images
//            area.setBgImagePath("..\\..\\images\\areas\\gothic\\ruins-day.gif");
//            //area.setOverlayImagePath("..\\..\\images\\areas\\parolit\\overlay-secondhand.gif");
//            //set the music
//            area.setBgMusicPath("..\\..\\midi\\PS1Shop2.mid");
//            //add characters
//            area.addCharacter("..\\characters\\Dacey.character.xml",formatter);
///*
//Gothic-Hospital		Exit			Gothic-East
//Dacey
// */
// 
//            //add exits
//            AreaExit[] exits=new AreaExit[1];
//            exits[0]=new AreaExit("Exit","Gothic-East");
//            //exits[1]=new AreaExit("West","Outside");
//            //exits[2]=new AreaExit("Enter Ruined House","Gothic-RuinedHouse");
//            //exits[3]=new AreaExit("Enter Hospital","Gothic-Hospital");
//            //exits[4]=new AreaExit("Enter Church","Gothic-Church");
//            //exits[5]=new AreaExit("Enter Second Hand","Camineet-SecondHand");
//            //exits[6]=new AreaExit("Enter First Food","Camineet-FirstFood");
//            area.setExits(exits);
//            //now save
//            formatter.saveTo(area,"D:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\areas\\Gothic-Hospital.area.xml");
//        } catch(StorageException x){
//            x.printStackTrace();
//        }
//        //lets create an area here
//        CDArea area=new CDArea();
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            area.setAbsoluteDir("D:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\areas\\");
//            //set the images
//            area.setBgImagePath("..\\..\\images\\areas\\warehouse\\end.gif");
//            area.setOverlayImagePath("..\\..\\images\\areas\\warehouse\\overlay-chest.gif");
//            //set the music
//            area.setBgMusicPath("..\\..\\midi\\PS1DungeonI3.mid");
//            //add items
//            Item item=new Item("Letter","The letter you found in the warehouse. It is written in a script you can't read.");
//            ItemListEntry entry=new ItemListEntry(0,0,true,item);
//            ItemListEntry[] itemList=new ItemListEntry[1];
//            itemList[0]=entry;
//            area.setItemList(itemList);
//            
//            
//            
//            //add exits
//            AreaExit[] exits=new AreaExit[1];
//            exits[0]=new AreaExit("East","Warehouse-Fork");
//            area.setExits(exits);
//            //now save
//            formatter.saveTo(area,"D:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\areas\\Warehouse-DeadEnd.area.xml");
//        } catch(StorageException x){
//            x.printStackTrace();
//        }
//        
//        //lets create the configuration file here
//        StringTable temp=new StringTable();
//        temp.set("ui.fontdir",".\\fonts\\");
//        temp.set("ui.fontpath",".\\fonts\\VeraBold.ttf");
//        temp.set("ui.theme",".\\main.theme.xml");
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            formatter.saveTo(temp,devConfigFilePath);
//        } catch(StorageException x){
//            x.printStackTrace();
//        }
//        //add characters to game data
//        GameData data=new GameData();
//        data.setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\");
//        File dir=new File("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\characters\\");
//        File[] all=dir.listFiles();
//        int length=all.length;
//        String[] characters=new String[length];
//        for(int index=0;index<length;index++){
//            characters[index]=new String(".\\characters\\"+all[index].getName());
//        }
//        XmlFormatter formatter=new XmlFormatter();
//        data.setCharacters(characters,formatter);
//        try{
//            formatter.saveTo(data,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.data.xml");
//        } catch(Exception x){
//            x.printStackTrace();
//        }
//        //add items to game data
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            GameData data=(GameData)formatter.loadFrom("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.data.xml");
//            data.onDeserialize(formatter,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\");
//            Item[] items=new Item[6];
//            items[0]=new Item("Letter","The letter you found in the warehouse. It is written in a script you can't read.");
//            items[1]=new Item("Sapphire","A large blue sapphire.");
//            items[2]=new Item("Pass","A pilot's pass, allows you to come and go from the spaceport freely.");
//            items[3]=new Item("Flash","A flashlight with several hours of battery life left.");
//            items[4]=new Item("Cannon","A prototype weapon known as the 'Heaven Punisher'.");
//            items[5]=new Item("Cola","A cola from the first food shop.");
//            ItemCollection collection=new ItemCollection(items);
//            data.setAvailableItems(collection);
//            formatter.saveTo(data,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.data.xml");
//        } catch(Exception x){
//            x.printStackTrace();
//        }
//        //add script to game data
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            GameData data=(GameData)formatter.loadFrom("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.data.xml");
//            data.onDeserialize(formatter,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\");
////            data.setScript(".\\camineet.script.xml",formatter);
////            formatter.saveTo(data,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.data.xml");
//        } catch(Exception x){
//            x.printStackTrace();
//        }        

        //create the game script
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            GameScript script=(GameScript)formatter.loadFrom("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.script.xml");
//            StringTable inParameters=new StringTable();
//            inParameters.set("area","Gothic-RuinedHouse"); /* always set this */
////            inParameters.set("target","exit:exit"); /* look event (exit) */
////            inParameters.set("target","character:Assassins"); /* talk, look event (character) */
////            inParameters.set("target","area"); /* look event (area) */
//            inParameters.set("target","area:Gothic-South"); /* move event */
////            inParameters.set("item","Heaven Punisher"); /* use, take event */
//            Event event=new Event("move",inParameters); /* move event */
////            Event event=new Event("look",inParameters); /* look event */
////            Event event=new Event("talk",inParameters); /* talk event */
////            Event event=new Event("use",inParameters); /* use event */
////            Event event=new Event("take",inParameters); /* take event */
//            String[] conditions=new String[0];
//            int count=1; /* how many return events */
//            Event[] returnEvents=new Event[count];
//            StringTable[] outParameters=new StringTable[count];
//            outParameters[0]=new StringTable();
//            outParameters[0].set("location","Gothic-South"); /* move event */
//            returnEvents[0]=new Event("move-player",outParameters[0]); /* move event */
////            outParameters[0].set("item","Heaven Punisher"); /* drop item event */
////            returnEvents[0]=new Event("drop-item",outParameters[0]); /* drop item event */
////            outParameters[0].set("text","The door exits back to the street."); /* look, talk event */
////            returnEvents[0]=new Event("draw-text",outParameters[0]); /* look, talk event */
////            outParameters[0].set("sequence","GameOver"); /* run sequence event */
////            returnEvents[0]=new Event("run-sequence",outParameters[0]); /* run sequence event */
////            outParameters[1]=new StringTable();
////            outParameters[1].set("condition","GAMEOVER"); /* add condition event */
////            returnEvents[1]=new Event("add-condition",outParameters[1]); /* add condition event */
////            outParameters[2]=new StringTable();
////            outParameters[2].set("item","Note"); /* add item event */
////            returnEvents[2]=new Event("add-item",outParameters[2]); /* add item event */
////            outParameters[2]=new StringTable();
////            outParameters[2].set("old-location","Warehouse-DeadEnd"); /* move item event */
////            returnEvents[2]=new Event("move-item",outParameters[2]); /* move item event */
////            outParameters[2]=new StringTable();
////            outParameters[2].set("character","Assistant"); /* move character event */
////            outParameters[2].set("old-location","Tunnel-Lab"); /* move character event */
////            returnEvents[2]=new Event("move-character",outParameters[2]); /* move character event */
////            outParameters[3]=new StringTable();
////            outParameters[3].set("item","Sapphire"); /* drop item event */
////            returnEvents[3]=new Event("drop-item",outParameters[3]); /* drop item event */
////            outParameters[3]=new StringTable();
////            outParameters[3].set("location","Gothic-Hospital"); /* move event */
////            returnEvents[3]=new Event("move-player",outParameters[3]); /* move event */
////            outParameters[4]=new StringTable();
////            outParameters[4].set("sequence","Dream"); /* run sequence event */
////            returnEvents[4]=new Event("run-sequence",outParameters[4]); /* run sequence event */
//            script.add(event,conditions,returnEvents);
//            formatter.saveTo(script,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\camineet.script.xml");
//            System.out.println("Saved script");
//        } catch(Exception x){
//            x.printStackTrace();
//        }        

        

        //create a sequence
//        int count=2;
//        SequenceFrame[] frames=new SequenceFrame[count];
//        frames[0]=new SequenceFrame();
//        frames[0].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\");
//        frames[0].setBgImagePath("\\images\\sequences\\camineet.gif");
//        frames[0].setBgMusicPath("\\midi\\PS1Opening2.mid");
//        String text=
//            "Space Century 342\n" +
//            "Camineet on Palma\n\n" +
//            "The usually quiet city is abuzz with fears about Lassic's growing power. " +
//            "The recent murder of Nero has incited a secret group of rebels to plot against Lassic. " +
//            "Nero's sister Alis is rumored to have left on a mission to discover why he was killed.";
//        frames[0].setText(text);
//        frames[1]=new SequenceFrame();
//        frames[1].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\");
//        frames[1].setBgImagePath("\\images\\sequences\\camineet.gif");
//        frames[1].setBgMusicPath("\\midi\\PS1Opening2.mid");
//        text=
//            "You are Evynn Thompson, a student at the Camineet academy. " +
//            "Another semester has come to a close and you find yourself interested in the recent developments. " +
//            "Sometimes you wish you could leave town on an adventure like Alis.. but you're just a student. ";
//        frames[1].setText(text);
//        
//        Event[] exitEvents=new Event[1];
//        StringTable[] outParameters=new StringTable[1];
//        outParameters[0]=new StringTable();
//        outParameters[0].set("location","Camineet-Northeast"); 
//        exitEvents[0]=new Event("move-player",outParameters[0]);
//        
//        Sequence sequence=new Sequence(frames,exitEvents);
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            formatter.saveTo(sequence,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\intro.sequence.xml");
//            System.out.println("Saved sequence");
//        } catch(Exception x){
//            x.printStackTrace();
//        }     

//        //create a sequence
//        int count=5;
//        SequenceFrame[] frames=new SequenceFrame[count];
//        frames[0]=new SequenceFrame();
//        frames[0].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\");
//        frames[0].setBgImagePath("..\\..\\images\\sequences\\end1.gif");
//        frames[0].setBgMusicPath("..\\..\\midi\\PStar1Battle.mid");
//        String text=
//            "The pair of assassins look puzzled as you draw the weapon. Nothing about your appearance suggests you would be armed.\n\n" +
//            "Before they can react, you fire the device.";
//        frames[0].setText(text);
//
//        frames[1]=new SequenceFrame();
//        frames[1].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\");
//        frames[1].setBgImagePath("..\\..\\images\\sequences\\end2.gif");
//        frames[1].setBgMusicPath("..\\..\\midi\\PStar1Battle.mid");
//        text=
//            "The weapon emits an intense light that engulfs the entire house, it burns brighter than anything you have ever seen.";
//        frames[1].setText(text);
//        
//        frames[2]=new SequenceFrame();
//        frames[2].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\");
//        frames[2].setBgImagePath("..\\..\\images\\sequences\\end3.gif");
//        frames[2].setBgMusicPath("..\\..\\midi\\PStar1Battle.mid");
//        text=
//            "Your body grows weak under the weight of the blast. You try your best to hold on to consciousness but can not..";
//        frames[2].setText(text);
//
//        frames[3]=new SequenceFrame();
//        frames[3].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\");
//        frames[3].setBgImagePath("..\\..\\images\\sequences\\dream.gif");
//        frames[3].setBgMusicPath("..\\..\\midi\\PS2Mystery.mid");
//        text=
//            "A vision fills your head. You see a man whom you vaguely resemble. " +
//            "He's being attacked by an army of men in strange robes. " +
//            "There are others fighting with him, but you can't see their faces. " +
//            "Despite the overwhelming odds, he does not look afraid. " +
//            "The battle grows increasingly chaotic and it becomes difficult to follow.";
//        frames[3].setText(text);
//        
//        frames[4]=new SequenceFrame();
//        frames[4].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\");
//        frames[4].setBgImagePath("..\\..\\images\\sequences\\dream.gif");
//        frames[4].setBgMusicPath("..\\..\\midi\\PS2Mystery.mid");
//        text=
//            "You begin to awake before the dream ends. You have no idea what happened to the man or his companions.";
//        frames[4].setText(text);
//
//        Event[] exitEvents=new Event[1];
//        StringTable[] outParameters=new StringTable[1];
//        outParameters[0]=new StringTable();
//        outParameters[0].set("location","Gothic-Hospital"); 
//        exitEvents[0]=new Event("move-player",outParameters[0]);
//        
//        Sequence sequence=new Sequence(frames,exitEvents);
//        XmlFormatter formatter=new XmlFormatter();
//        try{
//            formatter.saveTo(sequence,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\dream.sequence.xml");
//            System.out.println("Saved sequence");
//        } catch(Exception x){
//            x.printStackTrace();
//        }   

//        <events>
//          <com.huguesjohnson.tiamat.demos.Camineet.Event>
//            <action>add-item</action>
//            <parameters>
//              <table>
//                <property name="item" value="Heaven Punisher"/>
//              </table>
//            </parameters>
//          </com.huguesjohnson.tiamat.demos.Camineet.Event>
//          <com.huguesjohnson.tiamat.demos.Camineet.Event>
//            <action>move-character</action>
//            <parameters>
//              <table>
//                <property name="old-location" value="Tunnel-Lab"/>
//                <property name="character" value="Assistant"/>
//              </table>
//            </parameters>
//          </com.huguesjohnson.tiamat.demos.Camineet.Event>
//          <com.huguesjohnson.tiamat.demos.Camineet.Event>
//            <action>draw-text</action>
//            <parameters>
//              <table>
//                <property name="text" value="Alright, I'm done. This weapon is very powerful, it should knock-out anyone  in its path. Although it will also be difficult to control."/>
//              </table>
//            </parameters>
//          </com.huguesjohnson.tiamat.demos.Camineet.Event>
//        </events>
//      </com.huguesjohnson.tiamat.demos.Camineet.GameScript-ScriptTableValue>
//    </entry>
        
        
        
        int count=2;
        SequenceFrame[] frames=new SequenceFrame[count];
        frames[0]=new SequenceFrame();
        frames[0].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\");
        frames[0].setBgImagePath("\\images\\sequences\\lab.gif");
        frames[0].setBgMusicPath("\\midi\\PStar1_Conversations.mid");
        String text="Alright, I'm done. This weapon is very powerful, it should knock-out anyone  in its path. Although it will also be difficult to control.";
        frames[0].setText(text);
        frames[1]=new SequenceFrame();
        frames[1].setAbsoluteDir("d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\");
        frames[1].setBgImagePath("\\images\\sequences\\lab.gif");
        frames[1].setBgMusicPath("\\midi\\PStar1_Conversations.mid");
        frames[1].setText("I have to go now, please be careful.");
        
        Event[] exitEvents=new Event[3];
        StringTable[] outParameters=new StringTable[3];
        outParameters[0]=new StringTable();
        outParameters[0].set("item","Heaven Punisher"); 
        exitEvents[0]=new Event("add-item",outParameters[0]);
        outParameters[1]=new StringTable();
        outParameters[1].set("old-location","Tunnel-Lab"); 
        outParameters[1].set("character","Assistant"); 
        exitEvents[1]=new Event("move-character",outParameters[1]);
        outParameters[2]=new StringTable();
        outParameters[2].set("location","Tunnel-Junction"); 
        exitEvents[2]=new Event("move-player",outParameters[2]);

        
        Sequence sequence=new Sequence(frames,exitEvents);
        XmlFormatter formatter=new XmlFormatter();
        try{
            formatter.saveTo(sequence,"d:\\Projects\\com\\huguesjohnson\\tiamat\\demos\\Camineet\\data\\sequences\\lab.sequence.xml");
            System.out.println("Saved sequence");
        } catch(Exception x){
            x.printStackTrace();
        }     

//            //hack for debugging
//            this.gameState.addCondition("HAVELETTER");
//            this.gameState.addCondition("HAVEPASS");
//            this.gameState.addCondition("DIALOG1");
//            this.gameState.addCondition("DIALOG2");
//            this.gameState.addCondition("LEARNPLOT");
//            this.gameState.addCondition("DIALOG3");
//            this.gameState.addCondition("DIALOG4");
//            this.gameState.addCondition("NIGHT");
//            StringTable parameters=new StringTable();
//            parameters.set("new-location","Gothic-RuinedHouse"); 
//            parameters.set("character","Assassins"); 
//            Event event=new Event("move-character",parameters);
//            this.processGameEvent(event);
//            this.gameState.setTimeOfDay(CDGameState.TIME_NIGHT);
//            this.loadArea("Tunnel-Junction");
