Hi each time you press to open the journal is a new one because you’re always recreate the widget. And you should store the text in a variable and edit the variable to add the new text in, so you’ll be able to show the text.
Hi, thanks for your comment! I have the two variables already. The “Journal Entry” is the text box widget itself, and “Journal Text” is the text variable. You can see them in the 3rd blueprint link i sent you. In that link you can see i use GetText then save it to the journal text variable.
when you create the “jornal widget” you set the “text widget” to “journaltext” but the problem is that you get the text from the “jornalwidget” that you’ve just created, so the text you’ve put before closing isn’t there anymore because this is a variable from another instance of the same class, you have 2 options: don’t close the journal, just hide it, so the player can’t see, but don’t delete the instance, so when the player click to open the journal again he will get the text from the variable from the same instance of the journal class, so the text you’ve saved will still be there, another option is store the text somewhere else, i recommend you actually saving it in HD, so you save before closing the widget and load it when opening the widget. I Believe a Static variable would also work, static variables have the same value for every instance of a class, but as far as i know you can’t use static variables in BP
exactly as Denis said, i answered the same thing then i’ve noticed someone answered while i was typing, your problem is that you get the “Journal Entry” and Journal Text from the Journal Widget you’ve just created, you will just find the “default value” from “journal text” there.
After playing around i had changed it to this but the journal still starts fresh every time its open. I have used a print string to see if the variable is saving correctly and it is.
Okay so I am doing something wrong. I am having the same problem. The journal wont add the text correctly. I think im putting the create widget in the wrong place. here’s my umg BP
Okay, where would I cast to save game? In the journal blueprint, or the thirdpersoncharacter blueprint? How do i save in one blue print then load in another?
yeah if you just want to hide it you could create in event begin play, if you want to save it you can create a BP that inherits from “SaveGame” like this
then add a public text variable in it
then you create your save game this way in the event fired by the close journal button
PS.: i created this code just to show it how it works, but i created it in a normal actor, so i couldn’t get/set a text box, but i let you a reference to where you should put the get/set text box nodes, if you still have any question, just ask
Wow, thank you for the effort you put into this answer. I really appreciate it. I will try to use this to run it, and ill come back if i cant get it to work. Thanks again!
maybe i’ve not understood you correctly, what you mean by “get slot name in third person blue print”? you actually don’t need to get it from anywhere, you can just type the slot name in the “load/save game from slote” node, you can as an example type “JournalTextSlot” there, as i said you just need to be sure you’re going to use “JournalTextSlot” to load and to save, if it don’t help try to send a ss of what node exactly you are using.