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"

"Pre-defined" FDataTableRowHandle or how to expose a dropdown of a datatable row names

Hi !

Let's say I have a struct A, inheriting from FDataTableRowBase. In another struct B (inheriting too from FDataTableRowBase) I want to reference rows in the datatable based on A.
So In my project I have the datatables DataA and DataB, based respectively on A and B, and B reference a row in DataA.
The simplest way to do this, is to put a FDataTableRowHandle UPROPERTY() in B. But doing so I need to specify the datatable in each new row of DataB...
I there a way to have the same dropdown I have with the rows name from a datatable, without having to specify each time the datatable ?
Not sure I'm entirely clear...

For a less abstract example, in my project I basically have two datatable, one with "enemies" and another with "enemy parties" in which I would like to be able to select directly from the enemy table. Knowing that the enemy datatable is already accessible globally through a singleton class.

Product Version: UE 4.16
Tags:
more ▼

asked Jul 18 '17 at 03:05 PM in C++ Programming

avatar image

Vallantyn
3 1 2 3

avatar image Haoris Feb 07 '18 at 04:07 PM

Can we do this without c++ ?

I want my variable to be only the row handle name of a predefined datatable and not having to pick a datable and select a raw handle. Something like exposing the datatable row list itself as a variable

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

3 answers: sort voted first

Took me some digging but I figured out the solution to this. You can achieve this effect by creating a Customization Layout for your struct (IPropertyTYpeCustomization) and then registering it via FPropertyEditorModule::RegisterCustomPropertyTypeLayout.

In my case, I loaded the datatable asset in my customization layout class, bypassing the need to have it as a uproperty in my struct.

The doc pages linked below will give you some more info on what to do, but I recommend looking at DataTableCustomization.h for an example on this particular problem.

https://docs.unrealengine.com/latest/INT/Programming/Assets/ReferencingAssets/

https://wiki.unrealengine.com/Customizing_detail_panels

more ▼

answered Aug 19 '17 at 05:50 PM

avatar image

Ragekolb
26 1 2 4

avatar image Vallantyn Aug 21 '17 at 12:48 PM

Thanks ! I thought about some editor extension too, but couldn’t figure it out. I’ll look into that!

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

There's already a built in property editor for FDataTableRowHandle called FDataTableCustomizationLayout, so you shouldn't need to build your own. By default it already supports the "RowType" meta tag, which allows you to narrow the asset selector to data tables of a particular class derived from FTableRowBase. I'm not going to go into the details, but it was fairly easy for me to modify FDataTableCustomizationLayout and add another meta tag that allows you to specify an asset name and have it auto-select the asset for you. Much simpler than making an entire property editor from scratch.

more ▼

answered Oct 23 '18 at 07:58 PM

avatar image

Justin.Grant
0 2 2

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

Also would like to know the answer to this. Have tried extending FDataTableRowHandle and initializing the DataTable in the constructor, which works. However, in doing this, "RowName" no longer becomes a drop down and is simply and FName field.

more ▼

answered Aug 19 '17 at 03:16 AM

avatar image

Ragekolb
26 1 2 4

(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