I’m making a quest system where when you click on a quest it will show it on the side fully. Basically what is happening is that the first time I use the quest system, it works. When I keep on playing, then go back in, the quests are there but when I click on them it doesn’t work. I’ve done some debugging, and I found that as soon as the variable is set, it gets set back to null.
Can you provide some more images with actual logic behind it? You can upload images directly from your computer on to the answer hub. It’s the icon next to the paperclip.
This is not helping. This, on its own, would, of course, work - clearly indicating that the issue lays elsewhere.
What is firing that event and when? How do you know the value is not set? Do you use the variable anywhere else? Is the widget on screen? How is it created? I could ask 100s of questions and list twice as many reasons as to why it may not work. It’s the same as saying, “Print String is not printing, why?”
Consider describing what you’re trying to do and how you’re approaching it.
This one does run, but for some reason the moment it is set, it gets set to nothing (only when you continue playing then go back in to the quest system)
Soo, this is a really weird setup. I am having trouble figuring out what exactly is going on. You use “get all actors of class” twice to pull the same data First in the initial widget construct, the at each iteration of your for loop. You could easily pass in both this reference and the “quest names” array to the function that is supposed to be setting the variable “OG Text”. Second, I am assuming you only have one “quest and inventory” actor. It would be helpful to see inside that as well to see exactly how you are creating this quest name array. Also, the widget could likely be given a reference to this actor without using “get all actors” node but that is a separate issue entirely. Also, just realizing this…is the “quest and inventory” actor also a widget? I have never used “get all actors” to find widgets…certainly there is a better way to do that. I see you use “get all actors” initially, then in another screen shot (on clicked one) you are using “get all widgets of class” to pull the same widget?? Just not sure you are going about this system properly…it is very hard to figure out where you are creating, receiving and transmitting your text data. And unfortunately, you didn’t tell us what blueprints these functions are part of although I think I can piece most of it together but still, just makes troubleshooting this issue all the more challenging. Can you tell us where these screen shots are pulled from and also show us the quest and inventory blueprint?
Hope this helps. Just saying, the only thing that happens related to the quest and inventory blueprint is calling it for a reference from the code I use, and storing a text array. Also, every time the ‘Selected Quest Title’ variable does set, as I tested it with string printing. Only, the moment it sets, it insets once all the code is run.
If “Quest and Inventory” is a child component of the third person character, simplify this code by using the following method: cast to third person character → quest and inventory → text array…instead of “get all actors”
Is your text using a binding? If so this is set on tick and likely is causing the issue. I would suggest removing the binding and creating a function to “set text”. This way it only gets called after a click on a quest sub widget and it will only be called once (until another quest/widget is selected)
Thanks for that, I followed step 1. The only thing is that it is not the text box causing the problem, it is when I set Selected Quest Title. (Image 4)
Also, I did some more testing/debugging and it turns out that it is actually something related to the text box (the one that does its stuff in the last picture). I found that that text box actually sets itself to null and what ever it trying to set it. e.g. sets itself to null when ‘Hello World’ is trying to set it to ‘Hello World’, and sets the input to null. This I found was incredibly strange
Any way you can share the project files? I feel like this bug runs deeper than I can see or understand based on screen shots. And if not can you recreate just the inventory system in a blank project and share that?
I’ve made a small duplicate project. How can I send this to you? The project file is bigger than 5.2MB.
Also, the glitch is still happening in both projects so it must be an actual bug.
You will need to upload it somewhere where you can place bigger files, maybe google drive or just google a random site. You can package your project like this:
Your setup looks okay. I made small changes, images below.
I’m not 100% sure but I don’t believe you want to create and destroy your widget every time you use it, instead just hide it and bring it back on screen later. It’s good practice to set a reference to your widget as variable, that way you can check if it’s already valid (widget already exists in the game). If it’s not then you create widget (1st time you open the quest widget) and then you just toggle visibility.