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 08-14-2007, 05:36 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
Variable Handling Revision

Variables in Graal are handled weirdly and I would like a server option available to change them into a form I think is better.

For the first thing, when you're trying to reference a variable without a prefix, I think there should be 4 places it looks.

#1. temp. variables
#2. this. static variables
#3. this. dynamic variables
#4. global variables

It would be returning the first one it finds.

Also when you're declaring variables without a prefix, I believe it should look for an existing variable in that same order, and if it can't find one, it should default to temp. not a global variable.

Of course that leaves the question, how are you going to declare global variables if the no-prefix defaults to temp.? Well in the function profiler and certain unusual scripting error messages, I noticed the prefix universe. I believe that prefix would be a good choice for declaring new global variables. Of course they could still be referenced without the universe. prefix if there are no temp. or this. variables of the same name.

Also note that dynamic variables are case-sensitive when static variables aren't, from my limited observations that is.

Edit: Would also be nice if there was some way to list the global dynamic variables. (Object names and things) Do I know if I'm overwriting something or not by using a global reference.
__________________
Reply With Quote
  #2  
Old 08-14-2007, 05:37 AM
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
second this. ;]
__________________
Deep into the Darkness peering...
Reply With Quote
  #3  
Old 08-14-2007, 06:53 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Then every script would have to be changed. You could somewhat avoid this by making it so the use of new skips the "temp." stage but it still could mess a ton of scripts up that declare global variables.
__________________
Do it with a DON!
Reply With Quote
  #4  
Old 08-14-2007, 04:39 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
Quote:
Originally Posted by zokemon View Post
Then every script would have to be changed. You could somewhat avoid this by making it so the use of new skips the "temp." stage but it still could mess a ton of scripts up that declare global variables.
Quote:
Originally Posted by Inverness View Post
Variables in Graal are handled weirdly and I would like a server option available to change them into a form I think is better.
Way ahead of you dude.

I know that it could mess things up so thats why it would be a server option (requireng an npcserver restart on change) to people can switch to that format if they wish.

If such an option deals with the compiler then I suppose it wouldn't require a restart to set it, the compiler would just need to check the option on each compile.
__________________
Reply With Quote
  #5  
Old 08-14-2007, 08:53 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
I totally second this
__________________
Reply With Quote
  #6  
Old 08-15-2007, 01:12 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Inverness View Post
Way ahead of you dude.

I know that it could mess things up so thats why it would be a server option (requireng an npcserver restart on change) to people can switch to that format if they wish.

If such an option deals with the compiler then I suppose it wouldn't require a restart to set it, the compiler would just need to check the option on each compile.
Ahh my bad, must have missed that. Good idea, yes!
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 08-16-2007, 03:50 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I doubt he will be able to add this soon though since he is very busy with other updates for the client (like the playerlist lag bug).
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 08-17-2007, 06:33 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
We have a lot of issues like this: This or That would be better, but require completely rewriting the language...and thus completely rewriting every script on every server...I say do it, but release a Converter. A couple years after the release of Serverside we figured out there was a potential algorythm to convert it all...but Classic was already dead...really, priorities ought to go the other way around...
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #9  
Old 08-17-2007, 06:10 PM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is a jewel in the roughMysticalDragon is a jewel in the rough
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
10thed
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #10  
Old 08-17-2007, 09:31 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
It could be interesting to add options to change the variable lookup, it wouldn't need to restart the server, but it would also need something to tell the client to change the variable lookup as well, at least for the local scripts. A disadvantage could be that scripts wouldn't be compatible between servers and it would be confusing if people post script examples which have different variable lookup. May be there should be a script line //#VARIABLEPREFIX2 or so at the start of the script.
Reply With Quote
  #11  
Old 08-17-2007, 09:49 PM
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
It would also be awesome if you implemented private variables.... atleast for the serverside portion.
Reply With Quote
  #12  
Old 08-18-2007, 02:21 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 Stefan View Post
It could be interesting to add options to change the variable lookup, it wouldn't need to restart the server, but it would also need something to tell the client to change the variable lookup as well, at least for the local scripts. A disadvantage could be that scripts wouldn't be compatible between servers and it would be confusing if people post script examples which have different variable lookup. May be there should be a script line //#VARIABLEPREFIX2 or so at the start of the script.
Ah, that looks like a better idea than the server options. Would you be able to implement it? I'd really love to have variables default to temp and not global
__________________
Reply With Quote
  #13  
Old 08-26-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
Bump?
__________________
Reply With Quote
  #14  
Old 08-26-2007, 09:01 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
Bump?
Why bump? It seems he considered it.
Reply With Quote
  #15  
Old 08-26-2007, 05:00 PM
Horrified Horrified is offline
Rediculously inactive
Join Date: Jul 2007
Posts: 961
Horrified is on a distinguished road
Send a message via ICQ to Horrified Send a message via AIM to Horrified Send a message via MSN to Horrified Send a message via Yahoo to Horrified
Quote:
Originally Posted by Twinny View Post
Why bump? It seems he considered it.
I guess he wants more opinions.
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 11:12 PM.


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