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 04-22-2011, 12:05 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Read from graal Directory

I'm new to savelines/loadlines so an example of such would be nice, few other forum posts Ive looked at aren't helping. But is it possible to read from the Graal Directory, eg, loading the readme.txt file?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #2  
Old 04-22-2011, 07:09 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
The root/default folder is:

graaldir/scriptfiles/yourservername/

You can also load/save files in the levels folder:

levels/path/to/file

But no you can't read things in the root of the graaldir with the functions available.
__________________
Quote:
Reply With Quote
  #3  
Old 04-25-2011, 05:58 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
would I be able to read the files in tileobjects/

this doesn't seem to work.

loadlines( "graaldir/tileobjects/objectsHouse Inside.txt");
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #4  
Old 04-25-2011, 06:02 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by MrOmega View Post
would I be able to read the files in tileobjects/

this doesn't seem to work.

loadlines( "graaldir/tileobjects/objectsHouse Inside.txt");
The "tileobjects" folder is in the root directory and not the levels one, so it probably won't work.
__________________
Reply With Quote
  #5  
Old 04-25-2011, 06:18 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
This works just fine (in V6):

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
temp.files.loadfolder("tileobjects/*"1);
  for (
temp.filetemp.files) {
    
temp.str.loadstring("tileobjects/" temp.file);
    echo(
temp.file SPC "size: " temp.str.length());
  }

outputs...

objectscastle.txt size: 2862
objectshouse inside.txt size: 2742
objectssnow.txt size: 5679
objectsstandard.txt size: 11183
objectsvolcano.txt size: 5345
__________________
Quote:
Reply With Quote
  #6  
Old 05-14-2011, 05:38 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
Access to tileobjects folder has been added in v6 to make it easier to write a scripted level editor.
Reply With Quote
  #7  
Old 06-28-2013, 10:40 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Does fileexist(str) read from scriptfiles/ or levels/? cant seem to get it to work for either of them as its always returning false.

edit: nevermind i realized i apparently pulled a ravej and lost any knowledge of the english language.
I was using fileexist instead of fileexists and did not realize it until i checked /scripthelp
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 02:33 PM.


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