View Single Post
  #1  
Old 04-20-2007, 08:58 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Dungeon Generator

It's loading the level fine and editing the link fine too! However, it isn't saving the new edited line, I don't suppose anyone can figure out why?

PHP Code:
public function onCopyDungeon()
{
  
temp.filePath = "world/sanddungeon/";
  
temp.levelList.loadFolder("levels/" @ temp.filePath @ "*", 0);

  
this.newName();  
  
  for (
temp.i = 0; temp.i < 10; temp.i++)
  {
    
temp.currentFile = temp.levelList[temp.i];
    if (
extractFileExt(temp.currentFile) == ".nw")
    {
      
temp.currentLine = 0;
      
temp.levelDetails.loadlines("levels/" @ temp.filePath @ temp.currentFile);     
      for (
temp.currentLine: temp.levelDetails)
      {
        if (
temp.currentLine.starts("LINK"))
        { 
          
temp.newLine = "LINK" SPC temp.currentLine.substring(5, 12) @ this.levelLetter @ temp.currentLine.substring(17);
          
temp.levelDetails[temp.currentLine] = temp.newLine;   
        }
        
temp.currentLine++;
      }
      
temp.levelName = temp.currentFile.substring(0, 12) @ this.levelLetter @ temp.currentFile.substring(12);
      
temp.levelDetails.savelines("levels/world/gsanddungeon/" @ temp.levelName, 0);
    }
      else
    {
      echo(
"Not a level" SPC temp.currentFile);
    }
  }
} 
Thanks
Reply With Quote