Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Loading Folders? (https://forums.graalonline.com/forums/showthread.php?t=69697)

KuJi 10-27-2006 09:05 PM

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?

Chompy 10-27-2006 09:20 PM

PHP Code:

temp.levels.loadfolder("levels/*.nw"0);
for(
temp.filetemp.levels

can be one example

Admins 10-27-2006 09:27 PM

And temp.levels.loadfolder("levels/*.nw", true); for recursively checking all sub folders (what you wanted I guess)

KuJi 10-27-2006 09:29 PM

Quote:

Originally Posted by Chompy (Post 1236717)
PHP Code:

temp.levels.loadfolder("levels/*.nw"0);
for(
temp.filetemp.levels

can be one example

Wrong

Quote:

Originally Posted by Stefan (Post 1236723)
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?

Chompy 10-27-2006 09:43 PM

Quote:

Originally Posted by KuJi (Post 1236725)
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

xAndrewx 10-27-2006 09:46 PM

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?

KuJi 10-27-2006 10:47 PM

Quote:

Originally Posted by Chompy (Post 1236736)
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

Chompy 10-28-2006 04:05 PM

ah :P


All times are GMT +2. The time now is 06:22 AM.

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