#gameplay abilities and data assets connection issue

1 messages · Page 1 of 1 (latest)

proud tusk
#

@daring flame okay, its more of what you said about good practices, ive been trying to figure out a way to do this differently but i ran into issues with the asset manager, thought using primary assets could work instead of data tables. i still need some kind of information inside GAs though. but i thought having a soft reference to the ability data asset should be fine for what im trying to achieve.

I kind of wanted to know how would you approach something like this.

#

but turns out asset manager doesnt give ids to data assets made only in blueprints.

#

idk im kinda stuck with this haha

daring flame
#

look at the primary data asset section

#

having a soft ref is OK, you can always async load it (recommended)

#

and they store a real pointer to it to avoid GC

#

Another example here

#

Assets can be made directly in the editor. Could be as BPs or DAs

#

DAs can't have functions etc in BP

proud tusk
#

Okay i will look into it thanks

proud tusk
#

hey @daring flame I read through the links you sent, and tried everything but no matter what i cant get the blueprint node GetPrimaryAssetIdList to work. i made a base primary data asset class, and weapon data derives from it. but this just never works. I saw i dont need to do much in the c++ class but even if its empty it doesnt work. I saw ue4 videos that had this working with no issue, maybe its a ue5 thing? im completely lost at this point nothing i tried works.

daring flame
#

Also, change the name to OLWeaponDataAsset or WeaponDataAsset and try again

proud tusk
#
// Neoeon Interactive 2026

#pragma once

#include "CoreMinimal.h"
#include "GameplayTagContainer.h"
#include "Engine/DataAsset.h"
#include "OLBase/CoreEnumerations.h"
#include "OLPrimaryDataAssetBase.generated.h"

/**
 * 
 */
UCLASS(Abstract, Blueprintable)
class PROJECTOTHERLIGHT_API UOLPrimaryDataAssetBase : public UPrimaryDataAsset
{
    GENERATED_BODY()

public:
    // --- Identification ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Identity")
    FString AssetID;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "UI")
    FText DisplayName;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "UI")
    FText Description;

    // --- Rarity ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Gameplay")
    EItemRarity Rarity = EItemRarity::Common;

    // --- Flexible Tags ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Gameplay")
    FGameplayTagContainer Tags;

    // --- Generic Inventory Info ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Inventory", meta=(ClampMin="1"))
    int32 MaxStack = 1;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Inventory")
    float Weight = 1.0f;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Inventory")
    bool bIsConsumable = false;

    // --- Runtime / Inventory Instance ID ---
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Transient, Category = "Runtime")
    FString InstanceID;
    
};
daring flame
#

do you an S ? if yes: add it to the name too

proud tusk
#

this is my base class

daring flame
#

FYI
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Identity") FString AssetID;
AssetID are unique in the whole game

#

you could use the asset id as a global ID

#

renaming will have an impact though

proud tusk
#

oh okay

daring flame
#

You can create a data asset as:

  • a dataasset (red)
  • A blueprint data asset (blue)
proud tusk
#

i mean there really shouldnt matter what i have in them, its the asset registry not adding them to the asset manager for some reason

#

they are data assets yeah

daring flame
#

if using BP data asset, this needs to be checked on

proud tusk
#

i know

#

its just GetPrimaryAssetIdList never works

daring flame
#

Change this name to match the class name

proud tusk
#

i change it to DA_Weapon? or OLWeaponDataAsset

#

either way doesnt work though

#

:( i am clueless as to why this happens

daring flame
#

OLWeaponDataAsset is inheriting from UOLPrimaryDataAssetBase?

proud tusk
#

yes

#
UCLASS(BlueprintType)
class PROJECTOTHERLIGHT_API UOLWeaponDataAsset : public UOLPrimaryDataAssetBase
{
    GENERATED_BODY()

public:
    // --- Weapon Type ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Weapon")
    EWeaponType WeaponType = EWeaponType::OneHanded;

    // --- Weight Class ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Weapon")
    EWeightClass WeightClass = EWeightClass::Medium;

    // --- Base Stats ---
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats", meta=(ClampMin="0.0"))
    float BaseAttackPower = 10.0f;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats", meta=(ClampMin="0.0"))
    float BaseAttackSpeed = 1.0f;

    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stats", meta=(ClampMin="0.0"))
    float Reach = 100.0f;

    // --- Abilities ---
    // GameplayTags of abilities this weapon unlocks
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Abilities")
    FGameplayTagContainer AllowedAbilityTags;

    // --- Optional Animation Blueprint Reference ---
    // Typically AnimBP uses WeaponType to drive poses, so this can be optional
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Animation")
    TSoftObjectPtr<UAnimBlueprint> AnimBPOverride;

};
#

is there an issue with the class itself? or some override im missing? idk

daring flame
#

Assets are stored in ?

proud tusk
#

yes

daring flame
#

wondering where this S is coming from

proud tusk
#

oh

#

yeah thats weird

daring flame
#

the main issues that I had was with this

#

the data type name had to be EXACTLY the same as the asset.

proud tusk
#

OH

#

omg

#

i had to reselect the asset type

daring flame
proud tusk
daring flame
proud tusk
#

im braindead

daring flame
#

does it work now ?

proud tusk
#

yeah i probably had it as assets before

#

yeah

#

it works

daring flame
#

Sweet 🙂

#

Glad it is resolved!

proud tusk
#

but it has to be OLWeaponDataAsset any other name wont work

#

so its the name of the class

#

gotcha

proud tusk
#

thank you so much

daring flame
#

We provide a field to put a name, but you don't have any choice in the name. You can thank us now

daring flame
#

I had the exact same issues, and took me too much time to figure it was JUST THAT

proud tusk
#

yeah holy shit ive been slamming my head on the desk for the past 2 days

daring flame
#

Hate to say this, but as a temp fix, you could have listed the weapon DA explicitly here 😄

proud tusk
#

yeah its fine, i believe it should work as i wanted it now, so i can actually do the gas thing. i wanted to use this so i dont have to keep abilities in a data table and stuff, adding them manually kinda defeats the purpose haha

proud tusk
daring flame
#

Erf.

proud tusk
#

yeah lmao

daring flame
#

Btw @proud tusk I don't know if you have levels in your game

#

if you ever think you'll have some, or you are interested of having CSV to drive your values, here's an interesting thought:

#

CSV can be a source for Curve table, updated automatically in editor / cook whenever the CSV is changed.

#

This, in turn, can be used in any scalable floats, from the GEs to any class WITH a scalable float

#

And those Curve tables can be parsed etc etc

#

Ex:

  • We have enemy profiles in our game, as DAs.
  • We also have enemy stats as CSV entries Enemy1.Health,10,20,30 ...
  • And we have a EditorButton (which is a function actually) that will read the main curve table for enemies, and assign ALL of our scalable floats with the right entries
#

meaning, if my profile has FScalableFloat MaxHealth, then we'll map it with the curve table X.MaxHealth where X is the name of the enemy

#

So, that could be a way of defining your stats, with levels (or not), and easy to handle and maintain as CSVs to change.

proud tusk
#

so damage scaling using curve tables¿? i used curve tables before to increase GEs yeah. im not sure im doing levels yet in my game, since it might not have enemy scaling but i will look into it as well

daring flame
#

Overall, even without levels, Scalable Floats are pretty awesome, vs floats

#

They can be static floats (just a value) or connect to a curve table with a coefficient, and be parsed etc

#

so that's cool

#

your CSV can be myvalue,1, which is no level at all

#

const value all the way

proud tusk
#

oh okay thats cool

#

im still very new to c++ but this past week i had to restart my project to make it c++ only and making my own GAS classes so i can have more control over abilities and the rest, I really want to get this big system mechanic i have planned before doing the rest of the game hahah

daring flame
#

for the future

#

you don't have to restart anything to be able to do cpp

#

if you started as bp, just get in the editor, make a c++ class from there. done. C++ project now

#

and you can always reparent to a cpp class anything

proud tusk
#

true, i just kinda wanted the template character and all that to also be in cpp so i could modify it easily. my ocd kinda kicks in if i leave template folders just laying there with bps and stuff

#

lol

daring flame
#

no worries 🙂

#

I started my own game on Lyra ... and now it will be very hard to update it to anything past 5.0

#

so I might to restart it toooooooooooooooooooooooooo, probably without lyra, which means MORE WORKKKKKKKKKKKK

proud tusk
#

oh damn, i barely understand most of lyra systems lol

daring flame
#

don't tell me

#

it's really a mess. A nice mess, but a mess

proud tusk
#

hahaha

daring flame
#

Once you've understood some stuff and it works it's like "oh sweet"

#

but it's just so fk hard to get there

#

And I ... changed the lyra base code ... soooooooooooooooooo

#

can't merge easily anymore

proud tusk
#

oof

daring flame
#

it's alright 🙂 I'll probably never finish it anyway

proud tusk
#

lmao

#

i believe in you

#

once you migrate everything, itll probably be a whole lot easier