Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Dungeon Generator (https://forums.graalonline.com/forums/showthread.php?t=73571)

Chandler 04-20-2007 08:58 AM

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.0temp.10temp.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.currentLinetemp.levelDetails)
      {
        if (
temp.currentLine.starts("LINK"))
        { 
          
temp.newLine "LINK" SPC temp.currentLine.substring(512) @ this.levelLetter temp.currentLine.substring(17);
          
temp.levelDetails[temp.currentLine] = temp.newLine;   
        }
        
temp.currentLine++;
      }
      
temp.levelName temp.currentFile.substring(012) @ this.levelLetter temp.currentFile.substring(12);
      
temp.levelDetails.savelines("levels/world/gsanddungeon/" temp.levelName0);
    }
      else
    {
      echo(
"Not a level" SPC temp.currentFile);
    }
  }


Thanks

Rapidwolve 04-20-2007 09:55 AM

Why not just use copy level?

godofwarares 04-20-2007 12:28 PM

Quote:

Originally Posted by Rapidwolve (Post 1301354)
Why not just use copy level?

Because then the links wouldn't exist. He's trying to save the links together.

--

At Chandler: Try saving it in another array, or get rid of the temp. prefix and clear it once you're over (levelDetails.clear(), levelDetails = null;).

Chandler 04-20-2007 07:24 PM

Found the problem!
[I used a var over again] thanks


All times are GMT +2. The time now is 07:28 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.