Checking tables for Values quickly
Hi folks,
So I hit a snag that has left me a little amused and befuddled. So I've been creating a word game and had been using @t-shirtbooth's method of word checking which used a LOT of text attributes for the word list. Now I needed to deviate from his word list mostly because I need a much a bigger one, roughly 5 times the size that he had - the Scrabble SOWPODS list. This meant using a table. Now my problem is, how do I constrain it that whatever I am typing is automatically being looked for in the table and doing it quickly? I tried using string expressions but I think I am mangling them. I am finding that table searches are slower than looking in attributes, significantly so, which os problematic since you want the word to be accepted or denied pretty much instantaneously rather than waiting 5 seconds for it to run the search. Speaking of said tables, should I maintain just one column and an odd 300000 rows or split it into multiple columns- which should reduce search time I think, unless there is an advantage of a single column?
Thanks muchly!
Comments
A lot of @tshirtbooth's tutorials are out of date now since the introduction of the extra table and string functions. Which tutorial did you use?
Sounds like you need to use tableSearch(), though. It's pretty much instant.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline I realised that but when I was learning and now still, his tutorials where like the only stuff on word related games. I started with his word checker tutorial which led to boggle. I figured table search is it and I'm just mangling the rules. Using tablesearch in string expression as a condition seems not to be the way since that give you an integer and would not have a "contain", unless I do a "does not contain: = 0? I off course cant treat the table as an attribute like I did the text attributes with the word list. hmm. Frankly, I'm clueless. face palm
I'm really not sure what you're trying to do. Perhaps break it down to one problem, outline it clearly, and see if people can help with that.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
I have a word list, SOWPODS, in a table. I want to type words, which changes a text attribute and have that text attribute be searched for in the table as I type it. example- If I write the word 'top' it is searched for in the table. if found it displayed in green. If I continued to 'topp' that would not be green because it wouldn't be found. But if I continued to 'topping' it would be green again. Before I had all the words in a text attribute so my code read:
if 'game.wordlist' contains 'game.typedword'
etc.
Now I need to convert that to a tablesearch parameter.
You have a custom keyboard and text entry method set up?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Here is an example that might help:
Yes, I do. That custom keyboard changes the value of the text attribute "game.typedword". So I need to find that.
@RThurman right on the money!! Thanks!!
Annoyingly I had to make a keyboard in order to demo this properly, but perhaps someone will find my 1 actor keyboard handy (Uses one prototype, needs 1 instance placed on the scene, then keyboard out of nowhere.)
Highlights a word found in the • WORDS • table green, and words not found are red. The actual part you need is pretty straightforward.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Love it, @Armelline! The only thing better is this:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
That's actually awesome!!! I'm going to use it too for another thing.
Magic!
Nice work @Armelline !
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com