x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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. alt text

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). alt text

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. alt text

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. alt text

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. alt text

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.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 11 '18 at 01:48 AM in Blueprint Scripting

avatar image

Grandpa J0nny
7 4 2 5

avatar image Grandpa J0nny Oct 11 '18 at 03:18 AM

I can show more pictures if needed or if you need me to clarify something I can do that,

avatar image Grandpa J0nny Oct 11 '18 at 10:20 PM

Update: I just went in to the ThirdPersonCharacter blueprint where I call the function to open the window and created a quick function to check the contents of my inventory array. It seems that this is where the issue is, I'm just not sure why it's happening. alt text

As you can see in my PlayerCraftingComponent I have clearly set 6 elements in my array, but when I call the array only the first element is getting passed through. Maybe this will make the answer easier for you guys?

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Oct 11 '18 at 11:32 PM

avatar image

Grandpa J0nny
7 4 2 5

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question