Hi there, for the last couple days I’ve been working on a system for my game where the player explores map quadrants to get resources. This entire system works off of a random item generation from an array and adds a random amount of that item into the players inventory. This all works as intended so no help needed on this part, just to give background on what’s going on.
What won’t quite work, is the blurb page that pops up after you click on a map quadrant. In the full stage this will have an illustration of the scene, a short description of where you are, and finally a list of the items you collected.
Here’s the section of the blueprint that gives the items to the player, where I set the “Item_ID” and “Random Item Number”, which is basically the item name and what number that randomizer spit out on this cycle.
This is the result when testing, the text does come up in the format I want, but for some reason it doesn’t seem to add the item amount or name, even though the items get added to my inventory as intended.
Is WB Cartography a map quadrant widget or is it a widget that holds the quadrants? How many instances are there in the scene?
If it’s quadrants then are you sure you defiantly want item zero of the array and not the clicked quadrant? Maybe you are accessing the wrong widget from the array, that doesn’t hold the new random data.
If there is one instance then I would suggest caching it to a variable instead of calling get all widgets of class each time.
The cartography map is a widget, and when I say quadrants it’s really just to describe a button that covers a visual section of the map for players to click on to generate a random amount of a random item.
I’m not having the text read out what quadrant you clicked, just the amount of the item the randomizer generated from the button press, I am accessing the correct widget class as well and am receiving no errors in my code compiler or in the log when testing in game mode on that count so I’m fairly certain it’s the intended widget.
Hey again, I have tried to save a reference to my Cartography widget into the widget that has the text info I’m trying to make, but I now get the “Accessed None trying to read property WB Cartography” and I have no idea how to fix this.
I’ve also gone through and made sure both variables (Random item number and item ID) are exposed on spawn and public as well on a side note.
WB Cartography needs a spawned reference to be passed in to populate the variable. Right now if it’s in the variables panel it’s just an empty variable of type “Cartography Widget”
You have to at some point when spawn the widget pass in this information to the variable of the existing widget.