Index: trunk/src/scriptbuilder/structures/SimulationScript.java
===================================================================
--- trunk/src/scriptbuilder/structures/SimulationScript.java	(revision 158)
+++ trunk/src/scriptbuilder/structures/SimulationScript.java	(revision 169)
@@ -85,5 +85,5 @@
     
     public boolean saved;
-
+    
     //TODO: Pretty much everything in this constructor is dummy data.
     //Replace all of it.
@@ -273,4 +273,9 @@
         saved = true;
     }
+    
+    /**
+     * Creates the proper audio directory using the I_AudioEvent types.
+     * @param path of audio directory root
+     */
     private void createAudioDirectory(Path path){
         File f = new File(path.toString()+"/audio");
@@ -278,5 +283,5 @@
         {
             f.mkdir();
-            //scan through to see what is already there and then make changes accordingly.
+            //scan through to see what is already there and if there is no existing audio directory, create it.
         }
         for(ScriptIncident i : incidents)
@@ -286,47 +291,43 @@
                 String name = ((Integer) i.number).toString();
                 File incidentFolder = new File(path.toString()+"/audio/"+name);
-                if(incidentFolder.exists())
+                if(!incidentFolder.exists())
                 {
-                    //check to see if there are already files for the given incidents
-                    //not sure how the ordering of the files should be.
-                    //check to see if folder needs filling
-                }else
-                {
-
                     //create an incidentfolder since one does not already exist
                     incidentFolder.mkdir();
-                    int fileCount = 1;
-                    for(TimeSlice slice : i.getSlices())
+                }
+
+                
+                for(TimeSlice slice : i.getSlices())
+                {
+                    for(I_ScriptEvent event : slice.events)
                     {
-                        for(I_ScriptEvent event : slice.events)
+                        if(event instanceof I_AudioEvent)
                         {
-                            if(event.getScriptEventType().equals(ScriptEvent.ScriptEventType.CHP_RADIO_EVENT))
+                            //if the event is a chp radio event
+                            //then add the dummy file to the subdirectory created
+                            //CURRENTLY this ONLY is implemented for CHPRadioEvent, so it will need to be changed later.
+                            CHPRadioEvent radioEvent = (CHPRadioEvent) event;
+
+                            String output = radioEvent.toScriptFile();
+                            //optimally, this line should use the ID, but to account for files being read in, it needs to be the radiofile name
+                            File newAudioScript = new File(path.toString()+"/audio/"+name+"/"+radioEvent.radioFile.replaceAll(".mp3","")+".txt");
+                            
+                            try
                             {
-                                //if the event is a chp radio event
-                                //then add the dummy file to the subdirectory created
-                                CHPRadioEvent radioEvent = (CHPRadioEvent) event;
-                                
-                                String output = radioEvent.toScriptFile();
-                                
-                                File newAudioScript = new File(path.toString()+"/audio/"+name+"/"+name+fileCount+".txt");
-                                
-                                fileCount++;
-                                try
-                                {
-                                    newAudioScript.createNewFile();
-                                    BufferedWriter bw = new BufferedWriter(new FileWriter(newAudioScript));
-                                    bw.write(output);
-                                    bw.flush();
-                                    bw.close();
-                                }catch(Exception e)
-                                {
-                                    System.err.println("there was a problem creating your text files");
-                                }
-
+                                newAudioScript.createNewFile();
+                                BufferedWriter bw = new BufferedWriter(new FileWriter(newAudioScript));
+                                bw.write(output);
+                                bw.flush();
+                                bw.close();
+                            }catch(Exception e)
+                            {
+                                System.err.println("there was a problem creating your text files");
                             }
+
                         }
                     }
-
                 }
+
+                
             }
 
