I need help displaying a text varable in a text widget

I Have Been Spending the past few hours trying to figure out how to get a “text” variable to display in a text box in a widget. ive looked up to see if there were any videos on how to do it but i cant find any so ive come here for help.

ive tried doing this but it still has an error i cant figure out

  1. your last 2 images are repeated
  2. You have to “set text” of the “text variable” called “night”. So drag out from “text block” (your un-named text widget (also make sure it is set to “variable” check the box in the upper right hand corner, yours isn’t because I don’t see it in the event graph as a variable) in the event graph of the widget and say “set text” and then drag your text variable “night” into the “input pin” of the “set text” node.

I made a tutorial for a much more complicated system of writing text to the screen but you can check it out starting at 15:30 that is where I do exactly what you are trying to do. Hope it helps.

On second thought you are not creating the variable in the widget…so “save file” is that actual saved game data? If so you need to use the node “Load Game From Slot” and use that output pin as the input object in the cast to your “save file” class then pull out the “night” text variable and THEN you need to do what I did in the tutorial inside your widget to get it to set the text.

I’m still having the problem, so i tried testing out your full tutorial to try the typewriter i changed it to a variable but it wont change the text. i cant figure out a solution and its extremely annoying, hopefully i can fix it sometime later. but thank you for your help

CF5

Hmm, can you screen shot how you are “setting the text”? Where the variable is and what you are trying to set it to and how you are actually calling the “set” function? Shouldn’t be hard to at least get a text widget “set” to something you want. Once we have that working we can try and figure out how to actually do what you want.

what i’m trying to do is save a text variable so that it can be used as to which level the game is currently on, and the changing text thing is trying to display which level on the main menu widget. i feel like this might work better if i tried from scratch on the whole widget which shouldn’t take to much time, just the act i would have to still figure out how to do it instead of trying to work around what i tried

So do you need help “displaying” that saved text variable or do you now need help “saving” a variable?

I need help displaying. i have the save file set up with the variable(text variable) i want to load it in the “text” in my widget

what details do you need if i take a few screen shots to help explain?

is there something i’m supposed to do with the save file? could that be why its not working?

Yea you need to load the “data” from the save file and then set the text to whatever the save file data is if you want the text to be the same as the saved data.

How do you load your saved text?

Just trying to figure out where the issue is. So you have a text variable you save it you quit the game come back and can’t get the text loaded as before? Yes I need to see screen shots of how you save this variable, how you load it and how you try and set the text variable once it is loaded.

I saw that image already. I asked where you actually “save” and “load" the data. You’re not doing anything there in any of the screen shots you have posted so far you have saved nothing, you loaded nothing, you set nothing which is why I was thinking there was more to it. Watch the video I made and you will see what I mean when I say where do you save and load your data.

im a bit confused cause i loaded the save file in the widget do i do the same in the save file?

i loaded the data in the widget*

Where is the screen shot of you “loading” the data and “setting” the text variable to the saved game data value?

Here is a tutorial I made a while back on Save/Load mechanics. I don’t see any screen shot so far where you actually “save” data, or “load and SET” the widget text variable FROM the “Saved data”. You just have a “save game actor” with a text variable in it. But you never “set” that variable to anything, and when you “load” you never “set” the text on your widget to the “save game variable value”. There are time stamps in the description so you can go to exactly where I save and load game data and see if you have anything like that implemented.