Store Text?

Hello, I’m trying to make a simple login system and i ran into a problem. Is there anyway to have text stored in a enum or array with UMG? I tried to add text from a editable textblock to an array but im still learning blueprints so im not sure if i just did it wrong. Can someone tell me if its possible to store stuff like Usernames and passwords somehow.

Here is my attempt.

Does anyone know if i’m doing this right.?

Hello,
not sure if the best will be text or string (i personnaly would use string because of append and substrings format to set text) but i think i would use set element with a common index for both arrays to be sure to not have issue, instead of add. Troubles could happen on delete for example. but what you do is ok ( seq is not needed, you can add both one after the other.).

Ok i changed it to string. But for some reason the array is not updating with the new stuff added from the editable textblock do you know why.?

I just did a quick try :


In umg only an “editable textbox” and event “On text commited” set “on enter” to store the text. In level blueprint, create widget and add to viewport on begin play, enable mouse button (because i did this try in an opened tpp project) and event “p” to show array infos. It works (but you need to click outside of the box after each enter which needs to be fixed to be usable) A button event “On clicked” will be ok too.
Ideas to help you i have considering this :
Maybe your infos are not stored in your variables (try to print them on start to see and then check your input variables method and type).
Maybe your function is not set in the right place in your main graph.
Maybe your widget creation needs to be before or outside your function (not sure about that, but if things before don’t solve the issue this is what i would try.)
In hope it helps.

Yeah that works but its not quit how i wanted. What i want is for the stuff you enter in the two boxes to be Added into the array itself. For example When i made the two arrays i added 1234 in both of them. I would like to add the what is typed into the editable textblock to the array and have it still be inside the array even when i exit the game.

I think you have to save your content like in A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums , i am not sure about the best way but with something near what i did, infos are stored in array then if you add array to saved content on quit and load it on load, it would work.

I was wondering about it if it was not possible to read / write a text file like : Read and Write data from text file - Programming & Scripting - Unreal Engine Forums
Maybe a way to solve it.