Need help with saving text to table cell.

I am using a table to keep track of user profiles (up to 30) for a game. I am able to use the keyboard function to enter the profile name as a text variable. However, I am unable to save the text variable into a cell. Is there a special way to do this? I have been able to save integer and boolean variables to the table without problems.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Make sure the table colum is set to text. And what you need to do is save the info in the text variable to the table. You can't do it straight from a keyboard entery.
  • GS_TMP2GS_TMP2 Member Posts: 5
    edited June 2013
    Thanks for the suggestion. I tried a few scenarios, and I think my problem is relying on the GS keyboard. I can use it to save the entry to a text variable, but after that I can only reliably display the variable data. I cannot save the variable data to another variable or to a table. I have heard the GS keyboard is a little buggy. I guess I will have to do what everyone else is doing and create a custom keyboard.
  • GS_TMP2GS_TMP2 Member Posts: 5
    Yes. I am using version 10.3
  • GS_TMP2GS_TMP2 Member Posts: 5
    I just figured out a workaround and will post it in case anyone else has runs into the same problem. I created a test file using the different methods to enter text into a text variable and then save the variable into a table cell. It seems the only problem occurs when a keyboard entry for a text variable is followed by saving that variable into a table cell. I set up a self.counter integer variable in the actor with a starting value of 0. When the actor is touched, open up the keyboard entry, then increase the counter/flag value to 1. Below the touch actor/open up keyboard entry rule (NOT WITHIN since it will not work), I used a rule and a timer (0.02 seconds) to save the name into the table cell three times times. This seems to work. Will try the adhoc build with this this weekend.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yeah well remember things happen based on code cycles so maybe that what you were doing wrong the first time. You need to enter with keyboard and allow a code cycle for the variable to fill then one the variable is filled write it to the table then give a code cycle .02 then save it. This is how I always do it.
  • GS_TMP2GS_TMP2 Member Posts: 5
    edited June 2013
    That makes a lot of sense. I just tried using a delay timer of .03 seconds before saving to the table cell value which worked great. Thanks for the advice.
  • Jrob256Jrob256 Member, PRO Posts: 12

    I Hate to revive this old discussion but I am having a really hard time saving text to a table. If someone could explain this to me that would be great. I know it is probably right in front of my face but I am just not getting it. Thanks...

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    In GameSalad there is really no such thing as 'saving text to a table'. That phrase does not have any meaning.

    But you can change a table cell's value to something (including a string of text). To do that you use a "Change Table Value" behavior. (The behavior is kind of misnamed. You are not really changing the table value. Instead you are changing the value of a cell in the table.)

  • Jrob256Jrob256 Member, PRO Posts: 12

    Thanks @RThurman, I will try this out.

Sign In or Register to comment.