Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-31-2007, 07:58 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Database objects

I don't know if this, or anything akin to this, is already possible... so excuse this post if it is. I propose a new type of object, database objects. These would be much like a spreadsheet, where you create a database, and can add/remove rows and columns.

NPC Code:

items = new TstaticDB(); // sorry, I dunno how you initialize new variables

items.createrow("Image"); // Creates a row named 'Image'
items.createrow("Weaponname"); // Creates a row 'Weaponname'
items.createrow("Weight"); // Creates a row 'Weight'
items.addcolumn("Bow"["Image"="wbowi1.png","Weaponname"="-Bow","Weight"=6]]); // Adds a named Bow, specifying the rows for the Image,Weaponname, and Weight

items.deleterow("Weaponname") // Removes the row 'Weaponname'



and to access the database object:

NPC Code:

temp.test=items.column("Bow"); // would return {wbowi1.png,-Bow,6}
temp.test=items.row("Image"["Bow"]); // would return wbowi1.png
temp.test=items.row("Image"); // would return an array of all items in the Image row



I was posting this as I went, so things might be disorganized, and it might not be the best design of commands and such, but I think you get the idea. If anyone has suggestions on what to add to this, go ahead.
Reply With Quote
  #2  
Old 08-01-2007, 03:02 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
thats a good idea...
__________________
**FLIP OUT**
Reply With Quote
  #3  
Old 08-01-2007, 03:11 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Good idea but I suggest using columns for fields and rows for entries.
Reply With Quote
  #4  
Old 08-01-2007, 03:12 AM
Maniaman Maniaman is offline
Registered User
Join Date: Aug 2005
Posts: 326
Maniaman is on a distinguished road
MySQL support would be really nice.
__________________

Current Maloria Event: (click to go to it)
Reply With Quote
  #5  
Old 08-01-2007, 03:47 AM
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
Whats the point?

You can do:

items.row1.bow = "whatever";
items.row1.somethingelse = "foo";
items.row2.bow = "...";
etc.

This is LESS limited than your model because it's easier to set up and has the potential of different numbers of fields for each row.

The only thing needed in a database object is a good querying method. If XPath were implemented we could have XML "databases". (Inefficient in larger systems, but for graal sized systems with probably less than 1000 records it'd be ok).
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #6  
Old 08-01-2007, 03:51 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ya... except you have to create a different variable for every bit of information. This would contain all the information into one object.
Reply With Quote
  #7  
Old 08-01-2007, 01:05 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Graal Script Code:
items = new TStaticVar();
temp.rows 3;
for (
0temp.rows++) items.("row" i) = new TStaticVar();
items.row1.lawl "foo";
items.row3.pie "gewd";

// Try this afterwards Dusty:
echo(items.getDynamicVarNames());
for (
temp.var: items.getDynamicVarNames()) echo(temp.var @ ":" SPC items.(temp.var).getDynamicVarNames()); 
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #8  
Old 08-01-2007, 01:33 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well, the whole reason for this idea is to have one object to hold a lot of information in an organized way, and to have it easily accessible.
Instead of having a variable for every item(which gets annoying to go through), it would all be there in one easy-to-access database.
I don't really understand the objection just because there are alternatives. There have been a lot of additions to Graal made just to make things easier.
Reply With Quote
  #9  
Old 08-01-2007, 03:17 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
I'm only using ONE object - a TStaticVar.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #10  
Old 08-01-2007, 09:29 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
Quote:
Originally Posted by DustyPorViva View Post
Well, the whole reason for this idea is to have one object to hold a lot of information in an organized way, and to have it easily accessible.
Instead of having a variable for every item(which gets annoying to go through), it would all be there in one easy-to-access database.
I don't really understand the objection just because there are alternatives. There have been a lot of additions to Graal made just to make things easier.
In my example the items object holds everything.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #11  
Old 08-01-2007, 11:57 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
I designed a form database system earlier. Forms being arrays, first variable being the type so you can identify the other variables. Forms are saved automatically on change and send to clients that have them downloaded on change. This system is completely based off the one used for data in Morrowind and Oblivion. I however, decided not to use it for Val since I don't know how Graal would handle it if it gets large.
__________________
Reply With Quote
  #12  
Old 08-02-2007, 12:00 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well, I know something similar CAN be done, but that's besides the point. I think something like this would make a lot of things really simple. So why not?
Reply With Quote
  #13  
Old 08-02-2007, 12:04 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Has everyone ignored the fact that databases themselves are objects? XD
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #14  
Old 08-02-2007, 02:08 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Didn't somebody make a really complex GSSQL system? It was like a SQL database but made in GS2.

Ah found it:
http://forums.graalonline.com/forums...ighlight=GSSQL
Reply With Quote
  #15  
Old 08-09-2007, 02:45 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
There is already support for MySQL in Graal, it is not enabled for most servers though. Also the creation of tables, indices etc. cannot be done by Graal script directly.
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 05:37 AM.


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