Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-07-2010, 11:49 PM
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
OpenDocument spreadsheet (.ods) reader

Request: A function that can read the specified spreadsheet file and return a two-dimensional array of cell values for each sheet in the file.

Rationale: Many servers use different formats of text files for storing static read-only data like item archetypes. This often requires using a text editor that doesn't allow for much flexibility as far as comments and readability goes. Using spreadsheets allows a wide variety of sophisticated techniques to be used to generate the values of the cells, such as macros and formulas. It also makes editing much easier since the columns can be annotated and formatted in helpful ways, and multiple related worksheets can be grouped into one file. Additionally, these files can be read and written by either OpenOffice Calc or Microsoft Excel. ODS files are ZIP files containing XML files. In most languages this is something that could be done by script, but not with Graal unforunately, unless something has changed.

Source: The source of this feature request is this wiki article explaining its extensive use in Dragon Age: Origins by BioWare. Most of the previous paragraph was quoted from the article: http://social.bioware.com/wiki/datoolset/index.php/2DA

I'm quite used to having to make do with what Graal has though, so not expecting implementation, but figured I should get it out there anyways.
__________________
Reply With Quote
  #2  
Old 02-08-2010, 12:16 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by Inverness View Post
ODS files are ZIP files containing XML files.
You could try decompressfile and loadxml.
Reply With Quote
  #3  
Old 02-08-2010, 12: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
Quote:
Originally Posted by WhiteDragon View Post
You could try decompressfile and loadxml.
I can't get decompressfile() to work. The NPC-Server has folder rights and stuff, but no go.
__________________
Reply With Quote
  #4  
Old 02-08-2010, 12:58 AM
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
Quote:
Originally Posted by Inverness View Post
I can't get decompressfile() to work. The NPC-Server has folder rights and stuff, but no go.
Are you extracting a .zip file or the .oda? For whatever reason unapproved extensions just don't work with File I/O functions. I.e: The .db thing that cbk ran into.
__________________
Quote:
Reply With Quote
  #5  
Old 02-08-2010, 01:14 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
Quote:
Originally Posted by fowlplay4 View Post
Are you extracting a .zip file or the .oda? For whatever reason unapproved extensions just don't work with File I/O functions. I.e: The .db thing that cbk ran into.
I know, I accounted for that, no luck.
__________________
Reply With Quote
  #6  
Old 02-08-2010, 01:37 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Well, if it's possible to just write your own parser, why not just ask Stefan to enable the .ods and .xls extensions?
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #7  
Old 02-08-2010, 01: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
Quote:
Originally Posted by LoneAngelIbesu View Post
Well, if it's possible to just write your own parser, why not just ask Stefan to enable the .ods and .xls extensions?
Firstly, xls is a binary format, not going to bother with it. Secondly, xlsx is only supported by Excel 2007. Thirdly, ods can be read and written by both Excel and OpenOffice Calc, as I said in the first post.

And it isn't possible to write my own until I decompressfile will work properly.
__________________
Reply With Quote
  #8  
Old 02-08-2010, 01:56 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Inverness View Post
SAnd it isn't possible to write my own until I decompressfile will work properly.
And doesn't it not work properly, because file I/O doesn't work with unapproved extensions? My suggestion was to ask Stefan to add those extensions, so that you COULD write it.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #9  
Old 02-08-2010, 02:46 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
Quote:
Originally Posted by LoneAngelIbesu View Post
And doesn't it not work properly, because file I/O doesn't work with unapproved extensions? My suggestion was to ask Stefan to add those extensions, so that you COULD write it.
Tried renaming to .txt, didn't work. I'd think Stefan would make .zip workable if that function exists.
__________________
Reply With Quote
  #10  
Old 02-08-2010, 05:21 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Inverness View Post
Source: The source of this feature request is this wiki article explaining its extensive use in Dragon Age: Origins by BioWare. Most of the previous paragraph was quoted from the article: http://social.bioware.com/wiki/datoolset/index.php/2DA
"Before they can be used by the toolset or the game, 2DAs must be converted from Excel files into a more efficient form."

Integrating a spreadsheet processor into Graal that understands macros and formula seems a bit overkill, at least convert it to a CSV text file or something before uploading. :I
Reply With Quote
  #11  
Old 02-08-2010, 05:28 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by Loriel View Post
"Before they can be used by the toolset or the game, 2DAs must be converted from Excel files into a more efficient form."

Integrating a spreadsheet processor into Graal that understands macros and formula seems a bit overkill, at least convert it to a CSV text file or something before uploading. :I
This is what I told Inverness, but he seemed to think CSV wasn't powerful enough.
Reply With Quote
  #12  
Old 02-08-2010, 05:31 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by WhiteDragon View Post
This is what I told Inverness, but he seemed to think CSV wasn't powerful enough.
He is supposed to do his fancy formula magic in Excel or whatever, then just convert it to a CSV to feed it to the server. Or, hell, write a Excel macro that spits out a gs2 array definition.

What I was trying to get at is that as I understand it, this Dragon Age thing does not have Excel inside the actual engine either.
Reply With Quote
  #13  
Old 02-08-2010, 05:46 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 Loriel View Post
He is supposed to do his fancy formula magic in Excel or whatever, then just convert it to a CSV to feed it to the server. Or, hell, write a Excel macro that spits out a gs2 array definition.

What I was trying to get at is that as I understand it, this Dragon Age thing does not have Excel inside the actual engine either.
This is what I thought when I read,
PHP Code:
2DAs must be converted from Excel files into a more efficient form
Reply With Quote
  #14  
Old 02-08-2010, 06:14 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
I'm thinking that Inverness would find more ideal to be able to just edit the OpenDocument spreadsheet and upload it to have changes take effect, instead of having to run some macro every time and update an array in a script somewhere.

I'm not sure that, in the scope of Graal, that doing all this is completely worth while, though...unless you're planning some huge server on the scale of Dragon Age lol
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #15  
Old 02-08-2010, 06:15 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
Quote:
Originally Posted by Loriel View Post
"Before they can be used by the toolset or the game, 2DAs must be converted from Excel files into a more efficient form."

Integrating a spreadsheet processor into Graal that understands macros and formula seems a bit overkill, at least convert it to a CSV text file or something before uploading. :I
No, Graal would only read the text values of the cells. You can get cell values--which are entered manually or results of formulas--by parsing the XML, formulas used to produce the values are stored elsewhere and are ignored. Everything else is only for the benefit of the person editing the spreadsheet.

Quote:
Originally Posted by WhiteDragon View Post
This is what I told Inverness, but he seemed to think CSV wasn't powerful enough.
Things like comments, formulas, and color coding would need to be preserved, that is the whole point. You can't do that with CSV. Having to produce a new CSV file every time you edit the spreadsheet seems troublesome to me, it would just save a lot of time for a function to be able to read the spreadsheet file and covert it into a format usable for scripting.
Quote:
Originally Posted by coreys View Post
I'm thinking that Inverness would find more ideal to be able to just edit the OpenDocument spreadsheet and upload it to have changes take effect, instead of having to run some macro every time and update an array in a script somewhere.
Exactly.
Quote:
Originally Posted by coreys View Post
I'm not sure that, in the scope of Graal, that doing all this is completely worth while, though...unless you're planning some huge server on the scale of Dragon Age lol
Considering how relatively easy it is to open a ZIP file and parse some XML it is not time-consuming to implement.
__________________
Reply With Quote
  #16  
Old 02-08-2010, 09:13 AM
benpoke103 benpoke103 is offline
Zvarri!
benpoke103's Avatar
Join Date: Jun 2002
Posts: 332
benpoke103 will become famous soon enough
Isn't there a way you could convert it from To/From SQL?
__________________
Need support? Here's how to reach me.

Forum PM (Preferred)
#graaldt @ Freenode
Reply With Quote
  #17  
Old 02-08-2010, 09:40 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
Quote:
Originally Posted by benpoke103 View Post
Isn't there a way you could convert it from To/From SQL?
Of course the data from the spreadsheet could be converted into an SQL table if some find it useful in that format.
__________________
Reply With Quote
  #18  
Old 02-08-2010, 11:26 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
I think I can see his point. In essence a spreadsheet is basically a more visual form of an SQL table (and much easier to work with, not that SQL is difficult). While there is the SQL Explorer readily available, it is just much easier and a much more viable solution to use a spreadsheet.

You have to think about development as something involving more than just yourself. Just because you are easily able to use the tools already available to us doesn't mean that others on your team are. Spreadsheets would make it trivial to have just about anybody with a good idea to be able to tweak stats and create items, characters, and such, so that you don't have to. That's the real value I see in this, because I, much like many of the people in this thread, am perfectly able to edit an ini file or manipulate SQL. But I know people on projects I'm on who get a lot more done and make better content if they could manipulate the data too.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #19  
Old 02-09-2010, 03:43 AM
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
Well if this isn't added there's Excel 2003 XML Format (works in OpenOffice too), which looks pretty easy to parse and doesn't require any decompression.
__________________
Quote:
Reply With Quote
  #20  
Old 02-10-2010, 05:03 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by fowlplay4 View Post
Well if this isn't added there's Excel 2003 XML Format (works in OpenOffice too), which looks pretty easy to parse and doesn't require any decompression.
It's not valid XML
That or any XML parser I've seen on Graal doesn't consider it valid xml
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #21  
Old 02-10-2010, 11:26 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
I think at this point in time people should stop suggesting new ways of doing things and should actually do things. By saying you need these kind of additions isn't really enabling anything but is limiting yourself. Common theme lately seems to be putting wrappers around wrappers for what could be simple tasks with mass levels of obfuscation yet nothing ever comes out of it.
Reply With Quote
  #22  
Old 02-18-2010, 03:25 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
Extracting zips is not working on server-side yet because the folder-access rights check is not working for the npcserver yet. XML should work fine though, it's using the standard libxml2.
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 01:53 AM.


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