Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #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.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
Reply With Quote
  #2  
Old 04-20-2007, 09:55 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Why not just use copy level?
Reply With Quote
  #3  
Old 04-20-2007, 12:28 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Rapidwolve View Post
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;).
__________________
What signature? I see no signature?
Reply With Quote
  #4  
Old 04-20-2007, 07:24 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Found the problem!
[I used a var over again] thanks
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:14 PM.


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