Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-13-2010, 05:22 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Renaming mass amount of levels?

ok i wanted to rename my current gmap to gevo. how would i do this? i am using
LINK
for it.
or
PHP Code:
function onCreated()
{
  
this.searchid 0;
  
scheduleevent(0.25"renameFiles"NULLNULL);
}
function 
onrenameFiles() 

  
temp.folderName "levels/overworld/*.nw";
  
temp.copyFolder "levels/overworld/";
  
temp.newName "gevo";
  
temp.oldName "express";  
  
temp.levelList.loadfolder(temp.folderName0);
   
  if ((
this.searchid 50) >= temp.levelList.size()) 
  {   
    echo(
"All finished...");
    return 
true;
  }
  
  for (
temp.= (this.searchid 50); temp.< ((this.searchid 1) * 50); temp.s++) 
  {    
      
    
temp.curLinec 0;
    
temp.curLevel temp.levelList[temp.s];
    if (!
temp.curLevel.starts(temp.oldName))
    {
      continue;
    }
    
temp.levelDetails.loadlines(temp.folderName.substring(0, (temp.folderName.length() - 4)) @ temp.curLevel);     
    for (
temp.curLinetemp.levelDetails)
    {
      if (
temp.curLine.starts("LINK " temp.oldName))
      {
        
temp.newLine "LINK" SPC temp.newName temp.curLine.substring(temp.oldName.length());
        
temp.levelDetails[temp.curLinec] = temp.newLine;
      }
      
temp.curLinec++;
    }
    
temp.levelName temp.newName temp.curLevel.substring(temp.oldName.length());
    
temp.levelDetails.savelines(temp.copyFolder temp.levelName0); 
    echo(
"NC: Copied" SPC temp.curLevel SPC "to" SPC temp.levelName);
  }
  
  
this.searchid++; 
  
scheduleevent(0.25"renameFiles"NULLNULL); 

nothing seems to work?
Reply With Quote
  #2  
Old 08-13-2010, 10:21 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
(npcserver) needs the folder rights to change the levels.

PHP Code:
rw levels/overworld/* 
__________________
Quote:
Reply With Quote
  #3  
Old 08-14-2010, 09:59 AM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
I wish I still had the P/W for Chandler, to add that to the post.

Yeah, fowlplay4 is right
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


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:44 AM.


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