Keyboard Input to Table not saving. Am I missing some logic?

Hello!

I'm new here, thanks for your patience. =)

I'm working with a Table (text data only in column 1) and am trying to allow my user to input text into a New row/cell at the top of the table (into 1,1). Then I save the Table.

I have an actor which when Touch is Pressed, the following is supposed to occur:

Keyboard Input
Change the following attribute: game.New Entrée name
using the console, which prompts the user with: Add this entrée to the wheel

Add/Remove Row
Table: Meals
Action: Add Row At Beginning

Change Table Value
Table: Meals
Row: 1
Column: 1 Value: game.New Entrée Name

(end "when pressed" rule)

Save Table
Table: Meals
(I've also tried Save Table inside the "when pressed" rule)

The issue is that it doesn't seem to be saving the text into that location. I tried a Display Text test. It showed the original text in 1,1 but then showed blank after I entered the new text. It seems to be adding the new row but not getting the new text in there.

If you notice an error, I sure would appreciate any help. I noticed that one of GameSalad Guru's recent YouTube videos addresses a Table refresh/saving error. I'm hoping I've messed something up though and that I'm not experiencing the error, lol.

Thank you in advance for any comments or suggestions!!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    The Add, Change, and Save Table behaviors have to be in a rule that says If attribute game.New Entree Name is not [blank]

    Keyboard Input does not pause an app so without that rule, the behaviors that follow will fire immediately after the Keyboard Input window appears rather than waiting for input to be completed.

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

  • Ok, thanks SO much, that makes sense. I need to get all of that straight in my head.
    I'll have to figure out the right rule for Add, Change, and Save though. Ideally they would happen after the submit button on the Keyboard Input is pressed (which I don't think is possible to reference). The text in 1,1 could be anything so I can't tie it to a particular word. At least I understand the problem now though. If you have any other thoughts on what that rule could be I'd appreciate it. Thanks so much!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Right, there's no way to make a rule condition for the submit button. I wish there was. So you either have to determine if it's not blank or if it doesn't equal the current value of the attribute in order to see if it has been changed.

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

  • Ok thanks. I like the idea of comparing it to see if it's changed. Thanks again!

  • Got it to work!! Woohoo!! =) Thank you!!!

  • romit123romit123 Member, PRO Posts: 3

    Hi betahny, could you post your working rule ? I'm trying the same thing and haven't quite gotten there.

    My current rules are:

    • Touch is pressed
      -- Keyboard input (change attribute: game.user)
      -- when game.user is not empty
      --- change table value with game.user

    I am testing this with two displays:

    • display game.user
    • display tableCellValue

    The steps are:
    1. click the keyboard actor, input text, click done
    2. the display game.user shows the value
    3. click the keyboard actor again, not changing the text, click done
    4. the display tableCellValue also works

    I want both the displays working in step 2. Any help ? Thanks !

Sign In or Register to comment.