Attribute mechanism for Actors

Hi all.

I am writing because I am encountering this problem and have not been able to solve it for 3 days. I have made a simple structure for attributes (as in the attached screenshot). I am using it as a common container (as in the screenshot) and I want to be able to edit it in my Enemy BP instance (as in the screenshot). The problem is that the Attribute node doesn’t have any getter (as in the screenshot). Can you help me with this? Maybe instead of using struct I should use some class inheriting from the Engine built-in class, I don’t know, ActorComponent.

Any help will be appreciated.

Best regards, Damian

image
image
image

Structs don’t get individual getters/setters – you need to Break Struct and Make Struct to update them.

If you want the individual attributes to be editable, you need to make your Attributes object be a UObject. For this case, you probably actually want to make it an UActorComponent.

And, honestly, if you want to go deep into attributes, and are already OK with using C++, then you might want to look into the Gameplay Ability System. It takes a couple of hours to “grok” what it’s all about, and how it’s put together, but it’s a solution that solves a lot of problems, has a lot of features, and even works with networking.

Hi.
Thanks for response. Can you provide some useful tutorial? I tried to find something on my own, but I always ended up with tutorials that didn’t use the Gameplay Ability System.

Best regard.

Hey @Draqun,
I’ve attached a link that goes pretty in-depth into the Gameplay Ability System. I’ve sent the link to start where the good stuff begins:

I hope this can help!
-Zen

My favorite 40-minute quickstart for the GAS:

Thanks guys for the content. I’m off to watch.

Ok, I have a question. I have looked at the content you have posted. My goal is to create a game similar to the Might and Magic or Wizardry series. Will the aforementioned GAS be able to be used in a simple way on player containing several characters? The important word is ‘simple’. For what I want to achieve GAS is overengineering, but I realize that writing a system that exactly meets my expectations will distance me from what the EU provides.

@Draqun ,
I believe it can be! There are a few, more simple options though, but I’d say with simplicity + the ability to later get in-depth, GAS is a pretty good system to use as a framework.
But, if you’re looking for something easy + cheap, here’s another good system that may work:

I hope this can help!
-Zen :vulcan_salute:

@ZenLeviathan @jwatte I checked all possibilities and using GAS system (with help from book Unreal Engine 4.x Scripting with C++ Cookbook) I implemented basic attributes system. Thanks a lot!

2 Likes