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 04-13-2003, 10:58 PM
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
Parsing array names.

this.#L[0] is the 0th index of "this.#L", not the 0th index of "this.level13.graal". I rather think it should be the other way around, such that I don't have to write up either a different section of coding for each level or swapping arrays or hashing everything into one huge array, none of which are particularly efficient if memory serves - either a waste of code space or a waste of memory (for the temp "current" array or the hash indices)...
__________________
"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
  #2  
Old 04-13-2003, 11:33 PM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Agreed.

I've had terrible trouble with things like this.
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
Reply With Quote
  #3  
Old 04-14-2003, 05:25 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
To change it would be to change the entire foundation of scripting. Allowing variable names to be specified by strings would make the engine far slower, because Graal would need to interpret the script dynamically - it would need to be converted to bytecode 20 times a second so that '#s(blah)' could reliably be converted to the correct token for 'this.somevar'. Sure, there could be optimisations, but it all amounts to one big headache for Stefan.

Perhaps it would be better to make a function, like:

var([insert string here])

Returns the variable with name equal to the string, so you could go:

var(this.#L)[4]=123;

That way it would be a special case handled by a special function, instead of the principle being applied to the entire scripting engine.
__________________
Reply With Quote
  #4  
Old 04-14-2003, 11:08 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
Wow. And I thought Stefan's solution (classic oldschool memory access - one array, table of addresses) gave me a headache...
__________________
"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
  #5  
Old 04-14-2003, 11:34 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Well, I guess I am making assumptions about how the scripting engine works. If I'm wrong about it and the change really would be quite simple then cool, no problem. I was under the impression that variable names are discarded at psuedo-compilation and thus that big changes would be needed to make it possible. Even still, though... What about basic error checking? What about conflicts?

Let's say my string list is like so:

string=this.var

In my script is the following:

showimg #s(string),somepicture.png,3,5;

Does it throw an error because the person has tried to use a string where the index should be? If not, we cut out on a large part of the static error detection process. What about this:

say2 #s(string);

In the normal interpretation this would be fine - there'd just be a box saying 'this.var'. If your changes were made then what would happen? say2 would be handed a variable instead of a string, and it wouldn't know what to do with it. Would all the functions of this type need to be altered? I don't know, but it'd be a bad thing if they did.

If strings can suddenly sometimes be variables then static error checking/compilation etc are thrown out of the window. It's much nicer if there's a function that takes a string and returns a variable - only one function needs to be written and nothing else needs to be changed.
__________________
Reply With Quote
  #6  
Old 04-14-2003, 03:24 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally posted by Tyhm
Wow. And I thought Stefan's solution (classic oldschool memory access - one array, table of addresses) gave me a headache...
>.< I do that all the time.

*then again I do the real oldschool memory thing in my digi electronics and microprocessor class*
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
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 08:32 PM.


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