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"

Attempted to access index from array of length 0! error

I am getting errors in my blueprint where I set the style for my inventory widget. This is what the error looks like. alt text This is my blueprint. alt text alt text

It won't let me upload the last picture but it is exactly the same as the other picture where the style is being set, it is just attached to the other set style node.

The inventory I set up seems to be working fine, but I get all these errors. Does anyone know how I can fix this, or what causes this error? Also if you need more information I can get it. Thanks!

Product Version: UE 4.19
more ▼

asked Apr 18 '18 at 09:24 PM in Using UE4

avatar image

1 1 2 2

avatar image ThompsonN13 Apr 18 '18 at 10:11 PM

that is just saying that your array is empty. your script is trying to get indexes that dont exist so its causing errors. without seeing your loop its hard to say how to fix it but i would start by using a print string and getting the length of your array from within the function. that should at least give you a place to start. other than that i would need to see your loop and the array or at least have a better understanding of your overall script. it may be as simple as setting the array to have default values or a certain length from runtime.

im assuming its a slot based inventory and the errors are due to empty slots which cant receive the style modifications. or something like that

avatar image FinancedLoki Apr 18 '18 at 10:27 PM

Does this help? Also sorry about my lack of knowledge, I have only been using this engine for a few days and I have little coding experience. alt text alt text

avatar image FinancedLoki Apr 18 '18 at 11:34 PM

Nevermind, I ended up figuring it out. You pushed me in the right direction, thanks!

avatar image the1handsomeboy May 01 '18 at 02:11 PM

What was your solution? I think we're following the same tutorial here and I just ran into this road bump :)

avatar image Kmontoya May 01 '18 at 02:44 PM

It would be respectful to post your solution for others to view...

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Ok, so I figured it out. Add some is valid indexs and branches in your flow to solve the issue. I assume this was following the titanic games rpg tutorial series, so check out the UI Inventory Event graph and Set Widget Style Functions respectively if you are following that tutorial.alt text

alt text

fix1.png (302.7 kB)
fix2.png (85.0 kB)
more ▼

answered May 20 '18 at 10:47 PM

avatar image

6 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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