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"

How to use a string from a data table to update image in UMG

Ok this is an interesting one because I found a lot of varied ways to do this in a round about way but a lot of them required C++ and I just don't feel competent with coding and I feel like there must be a blueprint way to do this.

I have a data table for my AI guys. Among the things it tracks by levels, is a class icon. In my AI UMG file, I have The AI level, name, health bar and class icon. I have a default icon set but I want to know how to use the file location set in the data table to show the appropriate icon.

alt text alt text alt text

Product Version: UE 4.16
Tags:
more ▼

asked May 28 '17 at 07:32 PM in Blueprint Scripting

avatar image

mikezteh69
37 8 12 16

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

2 answers: sort voted first

I think this should work. First by setting the table asset, you'll get the rows. Then by determining the row index, it will return the corresponding row. Then by breaking it, you will be able to get the specific row element. From there you can get all data you want.

alt text

Regards.

capture.png (59.2 kB)
more ▼

answered May 28 '17 at 09:02 PM

avatar image

navid100
956 28 12 46

avatar image mikezteh69 May 28 '17 at 10:23 PM

Well I added a trace. The data is getting pulled but I am unable to figure out the part where the image component in UMG gets the string location and places the correct image. I also noticed one of my above screenshots was useless...

alt text alt text

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

I think that shouldn't be a string type in the datatable, rather a TAssetPtr type (if I remember well). That way you should be able to just set it.

more ▼

answered May 29 '17 at 07:27 AM

avatar image

Milkazar
41 2 2

(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