Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-13-2014, 03:15 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Level Directory or Folderconfig via script?

Hello all, I was recently using the Pix level editor on my server when I discovered a problem. The script only works with levels in the "levels/" folder. The problem was, I was using "levels/overworld/". So this brings me to a question. Is there a way to return the directory path of the level file? I would like to add this support, if possible, to the editor but for now I just hard coded it to "levels/overworld/".

If not, then what I will have to do is loop thru a list of possible directory configurations. So this brings me to the second part, is it possible to read the folder config, via script?
Reply With Quote
  #2  
Old 08-13-2014, 06:48 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,057
Torankusu has a spectacular aura aboutTorankusu has a spectacular aura about
Can you define what you mean by "it only works with..."

What part or feature does not work?

On Delteria we are using his editor (surprise), and every group of levels is stored in a specific folder location within the levels/ folder.

example: levels/deltlite , levels/events , levels/kaljun , levels/dungeons etc.

Make sure you and your NPC servers rights match the folder config (or if you are trustworthy enough, you can give it the rights rw levels/*/*/*, or another form of it....rw levels/*/*)

It's important to note that rights are odd like this, typing out rw WEAPONS/* will not let you edit any weapons that take this format of their name, example: Staff/Tools or Staff/Editors, you need rw WEAPONS/*/* , or subsequently, rw WEAPONS/Staff/*

Hope this helps.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #3  
Old 08-13-2014, 08:39 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
I was having the exact same problem as Johnny Chimpo.. I did just now notice my rw rights on npc server were messed up saying

rw levels/levels/*

It seems the external rc has been extremely buggy for me lately.

http://forums.graalonline.com/forums...+editor&page=2
Reply With Quote
  #4  
Old 08-13-2014, 11:21 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,057
Torankusu has a spectacular aura aboutTorankusu has a spectacular aura about
Johnny and I share a personal dev server (testbed for us both so to speak..), so his workaround would have been my next suggestion.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #5  
Old 08-13-2014, 03:48 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Thats why I was wondering if it's possible to read the folder config automatically so you dont have to hardcode the directories. anything with a "level" type in the folder config should show a level that u can warp to. So in theory if you can read it, you can get a list of all directories to test.

Alternatively if I could get the full file path of the file via script that would be even better.
Reply With Quote
  #6  
Old 08-21-2014, 03:41 AM
Restraint Restraint is offline
NaS
Join Date: Jan 2014
Posts: 21
Restraint will become famous soon enough
Quote:
Originally Posted by scriptless View Post
Thats why I was wondering if it's possible to read the folder config automatically so you dont have to hardcode the directories. anything with a "level" type in the folder config should show a level that u can warp to. So in theory if you can read it, you can get a list of all directories to test.

Alternatively if I could get the full file path of the file via script that would be even better.
There is a way to do this:

Graal Script Code:
extractFilePath(filename
For the other thing you wanted: a list of all directories to test, there's a way to do that as well!

You use loadFolder(folder, bool) to load the contents of a folder (starting with levels/) and follow up via fileisfolder(file) to recursively check for and build a directory until you find it.

That'd be disgustingly inefficient compared to extractFilePath(), but you did ask.
Reply With Quote
Reply

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 10:31 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.