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 10-27-2006, 09:05 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Loading Folders?

It'd be cool if you can get a full list of folders that exist already.

Anyway, how can I get loadfolder to display the full directory to the file?

How would I get loadfolder to find every file from levels/* and levels/*/* (etc)

that is .nw =O?
Reply With Quote
  #2  
Old 10-27-2006, 09:20 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
temp.levels.loadfolder("levels/*.nw"0);
for(
temp.filetemp.levels
can be one example
__________________
Reply With Quote
  #3  
Old 10-27-2006, 09:27 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
And temp.levels.loadfolder("levels/*.nw", true); for recursively checking all sub folders (what you wanted I guess)
Reply With Quote
  #4  
Old 10-27-2006, 09:29 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Chompy View Post
PHP Code:
temp.levels.loadfolder("levels/*.nw"0);
for(
temp.filetemp.levels
can be one example
Wrong

Quote:
Originally Posted by Stefan View Post
And temp.levels.loadfolder("levels/*.nw", true); for recursively checking all sub folders (what you wanted I guess)
Right. Thanks =D.. read pm

*Edit*
PHP Code:
// NPC made by Joey
function onActionGrab()
{
  echo(
"TOUCHED");
  
temp.lines.loadlines("scripts/signs.txt");

  for (
temp.var: temp.lines) echo(temp.var);

loadlines doesn't work on levels?
Reply With Quote
  #5  
Old 10-27-2006, 09:43 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by KuJi View Post
Wrong



Right. Thanks =D.. read pm

*Edit*
PHP Code:
// NPC made by Joey
function onActionGrab()
{
  echo(
"TOUCHED");
  
temp.lines.loadlines("scripts/signs.txt");

  for (
temp.var: temp.lines) echo(temp.var);

loadlines doesn't work on levels?
Was it wrong? It was an example though, just wanted to help,
but why you want too use loadlines for that?
And I hope that script is serverside :o
__________________
Reply With Quote
  #6  
Old 10-27-2006, 09:46 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
for (temp.curObject: temp.allObjects)
{
  if (!(extractFileExt(temp.curObject) in {".nw", ".graal"}))
  {
     continue;
  }
  temp.allLevels.add(temp.curObject);
}
Do something like this just for the levels?
__________________
Reply With Quote
  #7  
Old 10-27-2006, 10:47 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Chompy View Post
Was it wrong? It was an example though, just wanted to help,
but why you want too use loadlines for that?
And I hope that script is serverside :o
You weren't wrong, I was trying to find ways to go as deep as I can, that's what the second param is for I guess. (where you put 0, would be either 1 / true).

Anyway, yeah, of course thats serverside. I was testing if you can load files/save files from a regular level-script =p
Reply With Quote
  #8  
Old 10-28-2006, 04:05 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
ah :P
__________________
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 09:19 AM.


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