How to dynamically add items to a combo box widget using a custom data asset?

I am trying to make a Combo Box widget, that when loaded(opened), gets items from a custom data asset’s texture2d array, and adds the file names of the textures as strings to the combo box options list. Unfortunately I seem to be stuck on how to actually make the options show up in the list, as I am still only getting my default test values.

Additionally I would like this to be extremely modular. I want the combo box to be able to check and see which character is loaded, and get the assigned data asset from that specific character’s blueprint.

The reason I go about it this way is because I am making a “multi-class” character customization system. I am using the data assets to differentiate between the character types and their available texture options, as they all use different UV maps and Skeletal meshes.

I have gotten as far as getting the Combo Box widget to be clickable, but I want to get it to a point where I can see a list of texture options on the Combo box, and be able to select the texture’s name to apply the associated Texture2D asset onto my character, regardless of what character type it is.

It is a lot harder for me than it should be, as right now I am getting a lot of “accessed none” blueprint errors when I test play my game so far.

I can provide my very messy current blueprint code. Hopefully the flaws are apparent!

What are the accessed node errors that you are getting?

It’s something about one of my variables’ values being none when accessed by the script. (but i can’t assign a default value to it). It’s a variable of a value in another blueprint. “character”. Idk if that’s even possible or if i am doing it right or wrong. I can provide a screenshot soon.

I run into the “None” problem quite often. It’s mostly because I don’t really know what I am doing though. I have managed to determine that the reference to another blueprint is basically wrong. Quite often it is because I have simply created a variable then given it the BluePrint type that I want. That doesn’t produce errors but in fact it creates a NEW version without any data in it (hence the None). You need to get the BP that already exists in game rather than creating a new one.

As as example, I was knocking my head against the wall trying to figure out how to get event dispatchers to work and part of that is binding the EvenDispatcher of one blueprint to an event on the second blueprint. The example I found showed what I described above - create a variable and make i the blueprint type. Of course FAIL every time. What I actually needed to do was get the existing BP and use that to bind

In my case the dispatchers are in children blueprints so it was easy to get the references. On other cases where they are not direct children I am not sure. Perhaps you need to create a variable of that type then actually CAST it to that type to get the existing data.

What would i do if i need my system to read any blueprint that is a child of the base character blueprint then? I want to add multiple character classes, and each character has its own child blueprint

Nothing to do with what I was talking about. Once you create the child class just set a variable to that INSTANCE (object - not class). From then on you get that variable and type whatever you want to know. It’s basically the same thing as being in the blueprint itself but you just have to use the variable you set first.

You might want to read/watch some videos on inheritance. It will explain the difference between a class and an instance of that class.

This one is pretty good https://www.youtube.com/watch?v=k92eaGP4pss

I already have a Base character blueprint. I am trying to get my combo box to read the value of any character blueprint that is a child of the base character.

For instance if I have a human character loaded, then my combo box only selects customization options for the human BP, and if I switch to orc, then I only get orc options. I used a custom data asset class to get these values. Each character race has a different child instance of this data asset, which lists all the different texture options as well as variable and tag values per character race… i.e. the orc might have more health and the human has more attack accuracy…

What you are trying to explain to me using the long video tutorial is things I already did… but I know there is something besides that, that I am doing wrong, because as it stands, my widget cannot get the value of my child actor BP through the character variable. It sees NONE, even though I assigned a value to it, which is to get the currently selected child character BP, through its base. So for instance, I select the orc race. I want the blueprint to say “oh you have the orc loaded. I will go get the orc BP for you!” Instead, I am getting NONE. The reason I am experiencing this error, is not because I do not have the base character BP and the children Orc and Human BPs that are derived from the Base character BP… it’s that I have absolutely no idea how to get my widget to FIND and USE these BPs. I ended up making a character variable in the widget itself that is the Character BP as its value, but I know that is wrong, because I already have the character variable in the character BP, and I want to get the Character variable FROM the Character BP instead of making a new variable that goes in the widget and only works for the widget. I just want one character variable in the Base BP that is used across all BPs that need it, but I just do not know how to send that variable out to the other BPs that need it.

The long tutorial video did not explain to me at all how to grab a variable from a diff blueprint without having to make a variable that has that blueprint in it. That is my actual issue, is what do I do instead of creating the same variable for every bp that needs it? how do I just have one variable in the BASE BP that can be seen by ALL the other BPs when I try to get that variable? Either I didn’t find the answer or my ADHD got in the way again because the video was too long for me.

I just need to somehow figure out how to properly use GLOBAL variables…


Here’s what I mean. I have too many variables that have been created in order to assign the values of other variables in other BPs. I want to fix THIS.

There are only three ways that I can think of Datatables, Data Assets, or blueprints.

Is your data
for the character unique to ONLY that particular instance of that character or is is the same for all the characters of that child class? If all children of that class use the same data then use a datatable containing data for all the classes (IE Ranger, Druid, Etc) then just access the database for the data you want.

If the data is unique per character (like an rpg) you can still use a database but it will just be much bigger with a row per player instead of just a row per class.

Ok just for the heck of it I mocked up a database and UI for this. Basically you choose a class from a combobox and it displays all the characters of that class. I only have three classes and four characters (two fighters just to show t looks at all characters). Once you choose a class it displays the name and class of characters that match.

My data table is quite simple, just a character name and a class enum. Three classes in the enum: Fighter, Mage, Healer. This is the widget I use for displaying them

There is probably a much nicer way of creating the scrollbox and items but I’m not an expert so this is what you get.

The really nice thing about databases is that they are globally accessible (AFAIK) You can have lots and lots of data but not have a full variables list in your blueprint!

1 Like

Thank you so much for the example pictures!!!

I am not using my data table at all I do not think, and I went with Data assets instead.

I am really interested in making a Database using an actor blueprint placed in the world as well, to store and share all my essential variables I would need.

Unsure how it would work for a multiplayer game actually… but I am one of those people who figures out things as I go! I am going to provide a few pictures of what I have at the moment. I know my blueprint codes are messy and really weird logic-wise… I managed to make my combo box items show on my character, but selecting them at this point does not send the event to my character customization actor component blueprint, which would hopefully relay the sent information to my selected character’s blueprint.

So I have a Structure containing customization defaults such as colors and selected textures, as well as gender. I also have a data asset that has the character race traits, and also contains a reference to the character’s Blueprint itself. The Data asset also lists all the available texture customizations I can use for the selected race, the character’s class tags (for example Warrior, Aquatic, Carnivore, etc.), and the boolean variable that designates if the race is a starter character.


This is the Structure^ (Edit because I accidentally sent the wrong image before)


This is the Data Asset^

So… what I want my combo box to do, is to get the texture list, from my selected race’s data asset, which I have managed to successfully do, but then I want the selected combo box item to somehow edit the structure values in the appropriate spot, which then this new value will be sent to an Actor Component Blueprint that my character blueprint contains. This value will be assigned inside the event in my Actor Component Blueprint, then assign this value to the character’s dynamic material.

IDK if I am going about this in a very convoluted way, or if there’s something else I can do that is more efficient though!!!

Thank you very much again, for the help so far! Though I might have to make a new thread if I am straying too far from the initial question?

I haven’t used Data assets mostly because as an amateur relational database programmer I recognized that the assets don’t seem to be relatable in game - they are basically just single items. In a database they are relatable though it is a flat database and not relational. If I end up making inventories and require saving them then I will probably buy the PostGres plugin so I can handle far more complex relations than the default UE5 one.

Making a database in the default setup is increadibly easy. Just create a structure blueprint, add all the fields you want (Can contain classes, objects, basically almost anything a blueprint can hold). Once you have the structure just create a datatable (blueprints: Miscellaneous/Datatable) and select the structure and BOOM, empty database created. If you want to add/delete/Modify a field just change it in the structure and the next time you open the table it is done.