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"

Cannot Create Data Table From C++ Struct

Currently I am trying to create another data table based off of a struct created in one of my C++ actor classes. However, when I select to create a new data table, I only get the default option "Gameplay Row" option. The code compiles without issue.

Included the .h file containing the struct in question.

 #pragma once
 
 #include "Interactable.h"
 #include "EngineGlobals.h"
 #include "Runtime/Engine/Classes/Engine/Engine.h"
 #include "Engine/DataTable.h"
 #include "CraftingStation.generated.h"
 
 /**
  * 
  */
 
 
 USTRUCT(BlueprintType)
 struct FCraftingInfo
 {
     GENERATED_BODY()
 
 public:
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName ComponentID;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName ProductID;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         bool bDestroyComponentA;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         bool bDestroyComponentB;
 
 
 
 };
 
 USTRUCT(BlueprintType)
 struct FCraftedItem
 {
     GENERATED_BODY()
 
 public:
 
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName ItemID;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName Name;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FText Action;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FText Description;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         bool CanBePlaced;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         int32 Value;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         UTexture2D* Thumbnail;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         TArray<FCraftingInfo> CraftingCombinations;
 
 
 };
 
 
 
 
 
 UCLASS()
 class CRAFTINGGAME_API ACraftingStation : public AInteractable
 {
     GENERATED_BODY()
 
 public:
     ACraftingStation();
 
     UPROPERTY(EditAnywhere)
         UStaticMeshComponent* StationMesh;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName ItemID;
 
 protected:
 
 
 
 
 };
Product Version: UE 4.15
Tags:
more ▼

asked Jun 20 '17 at 06:34 PM in C++ Programming

avatar image

Ronin Inc
18 1 3 7

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

1 answer: sort voted first

Hi.

Your struct need to inherit FTableRowBase.

Example:

 USTRUCT(Blueprintable)
 struct FYourDataTableStruct : public FTableRowBase

More info here: Wiki about using data tables

more ▼

answered Jun 20 '17 at 07:07 PM

avatar image

hubacek.jakub
239 14 19 19

avatar image Ronin Inc Jun 20 '17 at 07:49 PM

That was it, thank you kindly.

(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