playMaker

Author Topic: GUI: Text entry for a code.  (Read 2118 times)

Red

  • Hero Member
  • *****
  • Posts: 563
GUI: Text entry for a code.
« on: January 03, 2013, 01:17:35 PM »
So, i've got to get a gui system set up that will let the player enter in a code... i've checked out the gui actions but on run time it doesn't want to cooperate... as in, i have the gui stuff there, but when i type in the text field, nothing shows in the text area... i'd like to be able to enter text, then put that in a string variable to test against a couple variables and send the appropriate actions accordingly.

so, say you type in "unlock hydra" it'll then take that text, drop it into a string, test the string and return with the results (so, if "unlock hydra" is correct, it'll display a hydra on the screen.) and if the string doesn't match, it'll just go back to that pop up where you can try again or just hit the back button

everything is all set up afaik for the buttons and the actions i want to have it perform, i just need to figure out how to get that text field set up and how to drop the information the player enters into a string variable.

kiriri

  • Hero Member
  • *****
  • Posts: 506
Re: GUI: Text entry for a code.
« Reply #1 on: January 03, 2013, 01:56:15 PM »
well, there's always the manual approach. I once made a chat with the action in the attachments. May very well be my first action ever :D. when the text input thingy is clicked on, activate a state with the Get String (attachments) action every frame and a build string every frame. The build string has 2 input strings, the first being "Final String" and the second being "New Character". The result is then saved as "Final String" . The result of the Get string action is "New Character".

The Get string action in the attachment returns an empty string if nothing is written in that frame. It does not return 2 letters at a time, so if you can write more than 60 characters per second, this isn't for you :D

EDIT:
actually, strike this, there's a better action at http://hutonggames.com/playmakerforum/index.php?topic=487.msg1882#msg1882
Like I said, it had  been ages ago when I wrote that action, just like most newcomers I apparently lacked the skill to use the search bar :D It's nice to see we both copied the same unfitting tooltip from the original AnyKey action though xD
« Last Edit: January 03, 2013, 03:15:37 PM by kiriri »
Best,
Sven