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 03-11-2007, 06:14 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Scripts can't read INI files?

For some reason, when I try to use loadlines to read an INI file, It doesn't seem to work!

PHP Code:
test.loadlines("newplayer.ini");
echo(
test); 
That only returns 0, Even with test.size();...

And yes it is downloadable:
Quote:
Originally Posted by RC
newplayer.ini: downloadable, 466 byte, 2007-03-11 18:49:37
And the NPC Server has the rights:
Quote:
Originally Posted by (npcserver) rights
rw */*
rw */*/*
rw */*/*/*
rw */*/*/*/*
But for some reason the script won't work.
When I change the format, it does, but I want .ini support
__________________
What signature? I see no signature?
Reply With Quote
  #2  
Old 03-11-2007, 06:22 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
Scripts are restricted to certain file extensions to avoid someone writing exes or similar
Reply With Quote
  #3  
Old 03-11-2007, 06:27 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Aw man, I wanted to use .ini files for my MUD library

Ah well. Restricted to .arc x-x
__________________
What signature? I see no signature?
Reply With Quote
  #4  
Old 03-11-2007, 06:42 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by godofwarares View Post
Aw man, I wanted to use .ini files for my MUD library

Ah well. Restricted to .arc x-x
The file extension doesn't make any difference about what the file contains. Why not just put an .ini file's structure inside a .txt file or so?
__________________
Skyld
Reply With Quote
  #5  
Old 03-11-2007, 06:55 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
INI looks good, Lol.
Oh well no more use for this thread.
Off to ASCII art thread ;
__________________
What signature? I see no signature?
Reply With Quote
  #6  
Old 03-11-2007, 07:22 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
hmm, are .xml files usable?
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #7  
Old 03-11-2007, 07:25 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by JkWhoSaysNi View Post
hmm, are .xml files usable?
I believe so theres a XML parser out there somewhere.
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 03-11-2007, 07:49 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Angel_Light View Post
I believe so theres a XML parser out there somewhere.
They are just talking about the extensions, they wont actually use XML format -_-

btw I use a DAT file
Reply With Quote
  #9  
Old 03-11-2007, 08:00 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Actually i intended to use XML to store objects, XML would easily allow storing of complex objects.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #10  
Old 03-11-2007, 08:26 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
I would assume XML files are allowed considering:

TGraalVar.loadxml(str)
TGraalVar.loadxmlfromstring(str)
TGraalVar.savexml(str, int)
TGraalVar.savexmltostring() - returns string
Reply With Quote
  #11  
Old 03-11-2007, 10:57 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Riot View Post
I would assume XML files are allowed considering:

TGraalVar.loadxml(str)
TGraalVar.loadxmlfromstring(str)
TGraalVar.savexml(str, int)
TGraalVar.savexmltostring() - returns string
That doesn't necessarily mean that the files are '-.xml'.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #12  
Old 03-12-2007, 04:30 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
Ok added .ini to the allowed file extensions, it will not work before the next update of npcserver or client though.

XML files are supported, you can ready and write them and also use the built-in functions (also use obj.addnamedstring(name,value)). It requires some more functions to be more usuable though, also on clientside it is very simple right now.
Reply With Quote
  #13  
Old 03-12-2007, 08:10 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Alright, Thanks
__________________
What signature? I see no signature?
Reply With Quote
  #14  
Old 03-13-2007, 07:49 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Ini does sound cool, and I like that as an extension.
...
I have had a revelation!
Ini files would be nice way of storing multiple archetypes.
PHP Code:
[Archetype1]
Variable1=value1
Variable2
=value2
[Archetype2]
Variable1=Value1
Variable2
=Value2 
And so on, ahh.
__________________
Reply With Quote
  #15  
Old 03-13-2007, 07:57 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Inverness View Post
Ini files would be nice way of storing multiple archetypes.
Like the Command and Conquer ini files I work with . Check rules.ini, they do
PHP Code:
[NBUGGY]
vars
[/NBUGGY]
[
GDISTANK]
vars
[/GDISTANK]
[
9MM]
vars
[/9MM
Not sure what will be the go in Command and Conquer 3 but like...omg...Command and Conquer 3!! omg...like....omg.... I guess you'd read all lines starting with a [ and see if it matches what you need .

The downside to such a thing is that the .ini file can become massive and confusing. It could also become faster to load indivudual files in the end.

p.s. omg...like...C&C3!!...like...omg

Last edited by Twinny; 03-13-2007 at 08:04 AM.. Reason: like...omg...C&C3!!....omg
Reply With Quote
  #16  
Old 03-13-2007, 08:22 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Ini files don't use the slashes at the end of each block, it just switches to the new one, the normal kind anyways.
__________________
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 01:20 AM.


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