I have a struct for my data table row.
USTRUCT(Blueprintable)
struct FKObjectDefinitionStruct : public FTableRowBase
{
GENERATED_USTRUCT_BODY()
/**
* @brief The object icon.
*
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ObjectDefinition)
TAssetPtr<UTexture> Icon;
/**
* @brief The object title.
*
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ObjectDefinition)
FText Title;
/**
* @brief The object description.
*
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ObjectDefinition)
FText Description;
/**
* @brief The AKPickupObject.
*
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ObjectDefinition)
TAssetPtr<AKPickupObject> Object;
/**
* @brief Default struct constructor.
*
*/
FKObjectDefinitionStruct()
{
}
};
For FText and UTexture data type, no problem it works.
But for the TAssetPtr Object, it doesn’t work.
The AKPickupObject is a class derived from several classes
UObject
– AActor
– AKBasicObject
– AKPickupObject
I have several class implementing the AKPickupObject :
AKPickupObject
– AKEquipObject
– AKWeapon
– AKWeapon_Bullet
– AKWeapon_Projectile
In my csv file I’ve tried to specify the class type for loading automatically the object.
For the Texture2D type it works but not for AKPickupObject type.
Name,Icon,Title,Description,Object
000001,"""Texture2d'/Game/GameObjects/Weapons/Guns/Icons/WeaponGun'""","Weapon Gun","This is a gun","""KPickupObject'/Game/GameObjects/Weapons/Guns/Blueprints/WeaponGun'"""
000002,"""Texture2d'/Game/GameObjects/Weapons/Guns/Icons/WeaponLauncher'""","Weapon Launcher","This is a launcher","""KPickupObject'/Game/GameObjects/Weapons/Guns/Blueprints/WeaponLauncher'"""
000003,"""Texture2d'/Game/GameObjects/Weapons/Guns/Icons/WeaponGun'""","Weapon Gun","This is a gun","""KWeapon_Bullet'/Game/GameObjects/Weapons/Guns/Blueprints/WeaponGun'"""
000004,"""Texture2d'/Game/GameObjects/Weapons/Guns/Icons/WeaponLauncher'""","Weapon Launcher","This is a launcher","""KWeapon_Projectile'/Game/GameObjects/Weapons/Guns/Blueprints/WeaponLauncher'"""
I’ve tried specifying the base class KPickupObject or the final class for the object AKWeapon_Bullet / AKWeapon_Projectile.
It doesn’t load the object.
Therefore, is it possible to load object based on specific class, or only ue4 classes are supported ?
Txs if you have an idea.
D.