Checking if the table cell is empty or not
I'm working on a new game, and i'm having troubles with the tables checker.
I've to check if a table cell is empty or not, if is empty i've to put inside the cell the word that the users wrote, if it isn't i've to move to the next cell and check again; until it don't find an empty cell. Anyone have an idea on how to do it?
I've to check if a table cell is empty or not, if is empty i've to put inside the cell the word that the users wrote, if it isn't i've to move to the next cell and check again; until it don't find an empty cell. Anyone have an idea on how to do it?
Best Answers
-
tatiang Posts: 11,949
First of all, it is not possible to write data to a table cell. That being said, if you want to check if a table cell is empty, create a game attribute (text) called game.EMPTY with an initial value that is empty/blank (the default). Then, when creating a rule, check to see if game.EMPTY equals the cell value:New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949
@tshirtbooth has a great solution for this: http://forums.gamesalad.com/discussion/40189/-free-demo-dictionary-checker-600000-words-awesome-/p1. Basically he concatenates a word between two symbols in a text attribute. So change attribute game.Words to game.Words.."!"..newWord.."!"
Then, you can check whether game.Words contains "!"..newWord.."!"
The reason for the symbols is so that the word "cat" is not shown to be correct if the word "caterpillar" is already part of the list of words. His solution only counts exact matches (!cat! is not the same as !caterpillar!).New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
user type a word in the first level => in the second level user can't use the word he used in the first one, so ive to put the words that the user used, in something that can being checked.
Thanks for the answer.