UMG Keypad System

So I am wanting to build a keypad system (nothing incredible just a simple 4 digit code input)

So i have been looking around and I haven’t really found anything useful (there are some tutriols but they use images and line tracing etc)

Heres what I am trying to build

A simple UMG Widget (with 0 to 9 (Buttons) an enter and clear button)

If there user, enters the right 4 digit code it plays a matinee (which in this case will open a door)

Heres What I can do so far

I can play a matinee from inside a widget

Heres What I need help with

I need some help with the widget setup (not to familar with all the inputs etc)

And setting up the correct code input

Any help you can provide would be great

Your quastion is very general, so i will do summery what you need to do

  • 1.Start by making keypad visually
  • 2.Make string varable
  • 3.On click event of number buttons add specific digit to the string
  • 4.On “OK” button or when 4th digit is entered (make a function that check
    length of string and call it on every
    number press) check if string is
    correct or not, play matinne if it’s
    correct.
  • 5.Reset empty the string

Ok so, I started

I made a keypad in umg with 9 buttons and 4 textfeilds to display the buttons presses

and I set the variables like so !

[alt text][1]

So one am I on the right track and second can u give me a little help with the next steps not to sure how to store or check the buttons strings against the require string, or how to set and new string using mutiple buttons

Hmmm make a single string varable for code, and use Append node to add numbers to it

this ndoes let you combine strings in to one, on first pin plug varable and on another the number you want to add and then result of that node you set back to string varable

So I have been working on the system and have been able to develop the following

The first image shows the numbers begin assigned on button click

The second shows how they are then tested to check if they are the write code etc

But the problem I am having is say I have a code that is 5432

regardless of which order the user presses the string will always be 2345

Any idea’s how I can fix that ?

I said “make a single string varable for code” and you still have multiple strings for some reason, why? :stuck_out_tongue: make single string for code, other wise you only over complicate things, if this is related to fact you want each digit to show as a invidual text widget (aka the presentation), format code string in that way to be presented, not make it fundament of whole mechanism. Use “Append” node to add digits to code string

Ok, dude let me explain something, im not in any way sure what you mean or how to about implementing your way ?

Make a single string variable and just append to it when each button is pressed. There’s no need for so many variables.

How would that work tho ? could u show me an example of what you mean ?

Late to this thread, but it came up in a search for a similar issue.

The thing the others were trying to say was you make just one variable that has the password attempt input from the user. You were trying to recreate the digits every time, when all you need to do is just add or “append” a character to the end of the existing text block.

So, you have a variable for the “code”. Set it to blank. The 1 key will append 1 to blank, so you get 1. Press 2 next, and it takes your new “code” which was just set to 1 and add a 2 to the end. So…12. And there you go. You have to set the individual keys to be assigned to a specific value. I think this is where you got stuck.

Anyways, hope this helps.

Strings are really annoying to deal with. Anyone who knows .mel script from maya hates this crap. Don’t even get me started about strcmp. This, , is why everyone loves python. :slight_smile:

Here’s my overly commented version.