Creating and using data classes

Merry Christmas!

I am creating a game, where characters can learn and use up to four types of attacks - think Pokemon. If I were to program this in C++, I’d either create static classes for each attack, or instantiate attacks from a base class.
However, I am using Blueprints. From what I’ve read, there are no static Blueprints available, nor can you instantiate non-Actor classes.

At this point, I’m only seeing two solutions - either storing all of that information in the Game Mode, making a massive mess, or actually going into C++ and making Blueprintable classes I want.

Are there other approaches I am missing?

Well making blueprintable class in C++ that will just hold data is no different them making normal blueprint and fact oyu will need to instaniate the class to have object. So what you trying to do won’t be diffrent from what you already can with blueprints.

I assume you want to have data avable without need to object creation. There many methods you can approach it:

For starters oyu can access class defaults with this node:

Allows to access for class properties without need of object creation, so oyu can use blueprints fully as data storage, but UE4 got more options

Lot of people definitely gonna suggest you DataTables

It’s good if you want to have a table, but it also has limited data types selection.

You can also create own asset type and hold data in assets, those are instantiated automatically as object by asset registry, i mean oyu already selecting materials and meshes in properties right? So you can create type and same as you do with materials you can do with you data

Shortcut way to create asset type is Data Asset, you extend for UDataAsset and create propeties which later can be created as a asset, don’t knwo where offical documentation went by here you go video:

But thats just tip of the ice berg as when you create your own asset class from 0 and make UFactory and also AssetTypeActions you can change the apperance of assets, program extra actions and even create your own custom editor for it

http://cairansteverink.nl/cairansteverink/blog/writing-a-custom-asset-editor-for-unreal-engine-4-part-1/

Just keep in mind some of those things require creation of separate editor code module for editor use (so it’s code don’t get in to packaged game, it would not work on it to begin with). Some of thsoe tutorials above will suggest create a plugin, but you dont need to if oyu don’t want to, you can make extra modules in project, you just do that in uproject instead of uplugin

Thank you! Using Class Defaults and passing/using Class references was exactly what I needed.