Save user edited text boxes?

If I place an editable text box then type something into it, how do I get the text to stay when I save then reload the save? When I try to save and reload, the text box will remain, but the text inside it will disappear. I tried switching the edited text out for a standard string, and that saved fine, it just won’t work when I’m typing something in.

You need to save the data that is entered into the text box into a property of that class which can then be saved. When the game is reloaded, you would then use that variable to set the initial value of the textbox.

You need to save the data that is
entered into the text box into a
property of that class which can then
be saved.

Technically this.

But you can omit this step and have the Save Game object query widgets’ text fields for their content directly, pulling data out of them and pushing it into (an array, perhaps) the save game. When the game starts, check whether a save game exists, load the values, push them into the editable boxes.

Saving and loading in BPs:

Ok that makes sense, I’ll try it out!

Alright so the save function itself is working, the issue I’m having with getting it to work with my user edited text is with how I’m creating and editing the text boxes themselves. So what’s happening is I have two different BPs, one is an actor BP which makes up the text box that I’m placing in the world, and the other is a BaseCommandComponent BP, which is what I’m using to actually place the text boxes(the actor BP) into the world. The issue I’m having is I am trying to enter the data into the text box from the BaseCommandComponent BP, but whatever I type won’t get pushed to the text box I’m placing in the world. However the text does get pushed to the array I’m using to store the data for the save game process (the opposite happens when I try to do this from the actor BP, which is what I was originally doing).

345586-ingametext.png

First Image is from actor BP where I try to enter text as well as push text to array for saving, and the second pic is where I try it in BaseCommandComponent BP. I’m pretty sure the issue I’m having while doing this in the BaseCommandComponent is with not being able to call the widgetSize component and the textRender component from the actor BP properly, and I think the same is happening when I try to call the textComponent array when trying this in the actor BP, however I’m not sure how to fix either of these issues so at least one of these methods works properly. The third image is just what I’m trying to accomplish in game, so when I place the text box in the world(actor BP), the text box on the hud will appear, and whatever I type in there will get pushed to the text box in the world.

Sorry that was a mouthful I hope that all made sense.

Alright so I tested out the save game function to make sure it’s working properly, but I’m having an issue that’s causing it not to work with my text boxes. What’s happening is I have two different BPs, an actor BP where the text box is created, and a basecommandcomponent BP to actually place each text box(actor BP) in the world during runtime (this is also where my save game functions are located and are being called). Originally the function I was using to type and push data to each editable text box were located in the actor BP, and the entered data pushed to the text boxes just fine, however when I try to save the data to my array for the save game process from here, the text won’t push to the array. I tried doing this in the basecommandcomponent BP instead, and the opposite happens, where the entered data will save to my array for the save game, but the data won’t be pushed to the text box I just placed in the world.

345586-ingametext.png

The first image is where I’m trying to type and save the text in the actor BP, and the second pic I’m trying to do the same thing but in the BaseCommandComponent BP. The third image is just to show what I’m trying to accomplish, when I place my text box(actor BP) in the world, the text box on the hud appears, and what I type there will be pushed to the text box in the world, as well as to the array for saving the game.

I believe the issue I’m having is when I try to push the entered data to the text box I just created, I’m not referencing the widgetSize and TextRender variables properly(which come from the actorBP).

I know that was a mouthful I just vomited out and I hope it all makes sense, but if you could help me with this that would be amazing. I feel like the issue is just a small fix I need to make somewhere, I’m just not sure what.