How do I add content browser file in the array field when that object is derived from Object class not Actor class? See image

I’ve created a blueprint file in the content browser that derives from the Object class NOT from the Actor.

I’ve then created an Array which has the variable type of that file/blueprint, it let me do this just fine, but it doesn’t appear to find the file in the content browser so I’m not able to select it.

How this works and how do I work with Object base classes?

I want to have these types of Objects without them being actually Actors with transforms and the rest. For example i want to have a ring that will be kept in an inventory.

I can construct an object from class at runtime, and they work fine, but I need these objects to be set before starting the game, in the editor. Just to set various characters with various items.

What I’m missing here?

Edit: I’ve worked with Data Assets and those worked fine, but in this case I need access to the functions to calculate some values, Data Assets doesn’t have them

never mind probably this is something stupid I’m doing, i will stick with data assets. go figure why this doesn’t work :frowning: :roll_eyes:

Are you using an array of references there? Because then you have to add references that are somewhat present BUT if you are using an inventory, did you have a look at tutorials about inventories? So you do not use references, you “just” say “I have these IDs with this amount in my inventory” where the IDs can be from a DataTable to get the connected Item if you want to drop it or something else.

Well, I’m trying to create a turn based rpg where the units are not spawned in the game world, they don’t have a “physical” representation in the 3D world. So having them as Actors it will be pointless.

Now bear with me, this is just some way of me on trying to figure out how to create various blueprints and logic and inheritance and the rest in this situation.

It all worked fine with creating a blueprint class derived from the base Object class.

So I have a blueprint that represent a basic unit. Derived from Object class. This unit has various variables, level, strength, dexterity, you get the idea. Most importantly it has the logic, functions to calculate various unit attributes like the health based on various items from inventory, skills, this stuff.

Then I create a child blueprint, and we call this Rat. It inherits all the variables of the blueprint above and i can set the values to be custom for the Rat enemy.

Good,

now same concept for items, as above, we end with an item called Ring of Health.

I want the Rat character to have an inventory variable and i want to assign this Ring of Health (and others items) to this variable.

Weeeeelll, it doesn’t work, the Ring of Health that is a child of BaseItem which is child of Object, this one doesn’t show in the interface. :face_with_hand_over_mouth:

So, tables,

tables I find them a bit difficult to work with, and they have this crazy reset behavior if you want to change the struct they are based on. And they can even get corrupted for some reason. Since I don’t have everything planned before I may end up wanting some sort of skill or attribute down the line and I can lose the work on a table that contains various enemies or items.

Tables also don’t have any functions support.

In the end, because I need to get myself a programmer duck, instead of posting on forums, I’ve managed to make this work by using Primary Assets and Data Assets. A primary asset have places for variables and functions, and I can select the derived Data Assets in the editor UI.

Downside is that you can’t override the Primary Data assets functions if you want to change how something is calculated.

But probably I’m just thinking all this wrong :man_shrugging: