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 09-18-2003, 03:36 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
_indexof2

Make a second version of all the _indexof functions such that they are CaSE seNsItIVE.
__________________


Help me keep scripting
Reply With Quote
  #2  
Old 09-18-2003, 09:00 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Hmm. I'm sure it has many uses, but I can't seem to think of any...
__________________
Reply With Quote
  #3  
Old 09-18-2003, 06:38 PM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Well, the base 64 system Stefan created to deal with storing tiles is case sensitive.
__________________


Help me keep scripting
Reply With Quote
  #4  
Old 09-19-2003, 04:30 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
Well, the base 64 system Stefan created to deal with storing tiles is case sensitive.
So?
__________________
Reply With Quote
  #5  
Old 09-19-2003, 05:02 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by Kaimetsu
Hmm. I'm sure it has many uses, but I can't seem to think of any...
The only thing I can think of is maybe a password system thing or some sort of tile editor type deal, may be wrong but hey I think outside the box.
__________________
Reply With Quote
  #6  
Old 09-19-2003, 06:15 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Quote:
Originally posted by Kaimetsu


So?
So Jagen asked me to script the conversion for him, and the most efficient way I could think of included indexof to calculate the values of the letters.
__________________


Help me keep scripting
Reply With Quote
  #7  
Old 09-19-2003, 06:42 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by Kaimetsu
Hmm. I'm sure it has many uses, but I can't seem to think of any...
It could be quite useful for the upcoming 3.1 that has editboxes and things.
__________________
Kat
Reply With Quote
  #8  
Old 09-19-2003, 07:08 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
So Jagen asked me to script the conversion for him, and the most efficient way I could think of included indexof to calculate the values of the letters.
That's the most efficient way you could think of? Shame on you.
__________________
Reply With Quote
  #9  
Old 09-19-2003, 08:01 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
I am positive indexof is a far cry more efficient that a ton of ifs trying to figure out the decimal value of the letter.
__________________


Help me keep scripting
Reply With Quote
  #10  
Old 09-19-2003, 08:13 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
I am positive indexof is a far cry more efficient that a ton of ifs trying to figure out the decimal value of the letter.
You wouldn't need 'a ton' if you coded it correctly.
__________________
Reply With Quote
  #11  
Old 09-20-2003, 06:37 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Still, far better 1 line as opposed to 64 virtually identical if clauses

I can create a string, call it this.values, and arrange all the characters such that their position in the string is their decimal value. However, for this to work right, indexof needs to differentiate between G and g.

Since I don't have access to v3 engine, I can't do a switch statement, which would still be quite a bit longer. So, I am stuck with
NPC Code:

if (strequals(A,#e(blah)))
{
this.decimal+=blah;
}


over and over again
__________________


Help me keep scripting
Reply With Quote
  #12  
Old 09-20-2003, 06:47 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
Still, far better 1 line as opposed to 64 virtually identical if clauses
I already said you wouldn't need many. Three, perhaps? Maybe four.

Quote:
I can create a string, call it this.values, and arrange all the characters such that their position in the string is their decimal value. However, for this to work right, indexof needs to differentiate between G and g.
Yes, or you could use an efficient method.
__________________
Reply With Quote
  #13  
Old 09-21-2003, 03:17 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
Would you care to explain how three to four ifs could allow me to convert one of 64 characters into their decimal equivalents?

Secondly, how is it at all inefficient to condense those ifs into a single indexof?
__________________


Help me keep scripting
Reply With Quote
  #14  
Old 09-21-2003, 03:36 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by TribulationStaff
Would you care to explain how three to four ifs could allow me to convert one of 64 characters into their decimal equivalents?
You'd obviously need a little more code as well; the if-statements would merely divide the characters into ranges. After that, it would be a simple matter of arithmatic.

Quote:
Secondly, how is it at all inefficient to condense those ifs into a single indexof?
Please tell me you're not one of those people who thinks that shortness of script == efficiency.
__________________
Reply With Quote
  #15  
Old 09-21-2003, 03:45 AM
TribulationStaff TribulationStaff is offline
Registered User
Join Date: Jul 2003
Location: Pennsylvania
Posts: 368
TribulationStaff is on a distinguished road
Send a message via AIM to TribulationStaff
So, you admit, you just aren't adding three ifs, you are adding other things. And these "ranges" how would you define them?

As for the length of the script, no, I think it is a lot more efficient to say "where is it located?" than several "is it this? No? Well is it that?"

indexof may start to be a less efficient piece of code when used 10000 times; but, from what I have seen of differences in efficiency at this level of iteration, I doubt that it's going to be a problem.
__________________


Help me keep scripting
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 05:35 PM.


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