keyboard input

stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
hello everyone..
I m making a game where the user enters a 'answer' in a text box using the keyboard input rule..
However how would i make it so the 'asnwer' is NOT case sensative..

e.g.

if the answer is KANYE WEST

the user types either of:
Kanye west
kanye West
Kanye West
kanye west
kAnYe WeSt

etc

how can i make sure ALL these possibilities are correct??

(the method i am doing now is long and boring, my rule is)
IF
self.answer2 = self.ACTUALANSWER
self.answer3 = self.ACTUALANSWER
self.answer4 = self.ACTUALANSWER

self.asnwers are basiccally the many different ways to write KANYE WEST...

so is there a simplier way.. sorry for the lengthy post!!

Sydney Swans 2014!!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    The only way to avoid this problem is to make a custom keyboard (an actor for each letter of the alphabet). Then you control (via rules) which case is used and checked in your rules.

    Without a custom keyboard, a better way than what you explained is to make a single text attribute with all possible answers separated by a character:

    self.KanyeText: #Kanye west#kanye West#Kanye West#kanye west#kAnYe WeSt#

    And then use this rule:
    When attribute self.KanyeText contains "#"..self.KeyboardInput.."#"
    .....[rules for correct answer]

    *The .."#" prevents someone from typing "West" or "kan" or other partial strings.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Benjamin_m5Benjamin_m5 Member Posts: 646
    @brendanzh926 answer for your post in the PRO-forum (i answer here because i am not a PRO)

    i think you can display that with this.

    Display Text: TableCellValue(row,1,table)..TableCellValue(row,2,table)..TableCellValue(row,3,table)..TableCellValue(row,4,table)

    This should help also:

    ---
    Benjamin
Sign In or Register to comment.