Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #20  
Old 09-16-2013, 12:40 AM
JohnnyChimpo JohnnyChimpo is offline
Registered User
JohnnyChimpo's Avatar
Join Date: Jun 2004
Posts: 105
JohnnyChimpo is on a distinguished road
After further analysis it seems the loadfolder() function is not working properly anymore. I have made a very simple work around for those whos pixel editors are malfunctioning.

1. Add this line to configurations.
PHP Code:
//FOLDER CONFIG
this.levelFolders = {"YourLevelFolder1","YourLevelFolder2"}; 
Add the folders that contain your levels in the array.
2. Replace the function
PHP Code:
function getLevelFilePath(temp.levelName) {
  if(
this.levelFolders.size()>0){
    for(
temp.i=0i<this.levelFolders.size(); i++){
      
temp.fileList = {};
      
temp.fileList.loadfolder("levels/"@this.levelFolders[i]@"/*"1);
        for (
temp.fileNametemp.fileList) {
          if (
temp.fileName == temp.levelName) {
              
temp.filePath this.levelFolders[i]@ "/" temp.fileName;
           return 
temp.filePath;
          }
       }
    } 
  }
  
temp.fileList  = {};
  
temp.fileList.loadfolder("levels/*.nw"1);
  for (
temp.fileNametemp.fileList) {
    if (
temp.fileName == temp.levelName) {
       return 
temp.fileName;
    }
  }
  return 
NULL;


Thats it! Hopefully that solves some headaches.
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:04 PM.


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