Need help debugging my crafting system (Pics included)
Hey everyone, I currently have an issue with my crafting system and its been preventing me from moving on with my game for 2 days now, so I'm hoping someone can help me solve this.
Basically, how it works is I have an array filled with all the recipes that I want to have appear in the crafting menu. The array is stored in a crafting component, so each player can have different amounts of recipes unlocked, and then using that crafting component, I create a crafting menu widget. The function I use to call my widget is pictured below.
The next picture is inside the menu widget, which spawns a grid of clickable "slots" with each slot being a different recipe. The print node is just for debugging purposes to see if the array is working properly (which it's not).
This third picture is a function in my crafting component, that resets the crafting slot amount to the amount of recipes the player currently has access to, and SHOULD fill the array with the correct information (material costs/widget icon/name) based on the class of the item it's making (the item has all the information for the recipe structure in it) but unfortunately, my (class != empty) node always returns as false except for the first item in the array.
Here is a picture of the CraftingComponent defaults that I set inside my player character. I don't need to set all of the different variables here because I set the class of the item here, which then calls all the correct information in the function I made in picture 3. BUT, again, it only works for the first item in the array, and the other 5 elements that I set here don't show up at all in any of my functions.
This last picture is what happens when I pull up the crafting tab in game. As you can see from both the screen and the text on the top right, only the stone axe (the first element in my array) show up properly, and the other 5 that I clearly set in picture 4 are not being seen at all.
So, to conclude, my issue is that only the first element in my RecipeList array is showing up in any of my functions, and anything after that doesn't seem to be getting stored in my array. I'm new to game development, so sorry if its something stupid I'm missing but I'd really like to move on with my game and no matter what I seem to try, I can't get it working. Thanks for your time.
asked Oct 11 '18 at 01:48 AM in Blueprint Scripting
I think I finally fixed it. For some reason my game was creating two thirdpersoncharacters when I ran the game, and the 2nd one had a bunch of wierd defaults set that was messing up the real one.
answered Oct 11 '18 at 11:32 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here