How To Store Various Sets of Information

I am familiar with coding C++ by hand, but since this is my first time making a game in ue4, I prefer to use the blueprints.

Anyways, in c++, I understand you can make a Class/Object and you can store information about that class and have multiple objects using the structure of that class. However, in Ue4, I’m okay with making blueprint classes, but I have seemed to run into difficulty with trying to have indefinite objects reference the variables in the class. another method I tried was spawning in the invisible objects and assigning them to an object array, but when the object spawns, it doesn’t add a new name to it, such as “object1” then add a number “object2”.

I also attempted solving this problem through making an array that holds the values of a single object, but I cant seem to find a way to form multiple copies of it without making hundreds of the same array. Perhaps I am looking at the problem the wrong way.

My goal is to allow the player to create their own unique items without a limit of those items the player may make. The Items are seen as UI rather than a physical element. when they create a new item, I want a number to increment showing its place (I tried a data table until I leaned that its read only, otherwise that is the sort of thing I’m looking for.) I want the player to decide the various pieces of the Item such as the name, type, and other values.

For those of you who understand c++, I’m looking for something similar to this (assuming there’s a class or struct called myObject with these variables: string name, string type, int points ):
myObject obj1;
myObject obj2;
myObject obj3;
obj3. points = 17;

(the above code is just an example to the parallel I want form the blueprints, thanks)

I think you thinking too much of Blueprints as some special things, look on you trying to replicate as simple things as variable declarations

Blueprints class are same as valid as C++ class and they technically work exact same way, all blueprints you see are inherent from C++ classes and they are compatible to each other (it only matter what blueprint support and what not). Varbales you make can be public and you can access them from elsewhere. Open Class Viewer (Window->Development Tools->Class Viewer) should open you eyes a little. You can look on my old tutorial which shows how both blands in:

Blueprint can operate only with objects of UObject (a root class of most UE4 classes), which can only access only from pointers (in blueprint they called "Object Refrences"). That because UObjects have memory management system and it handles the copies of UObjects. If you want to create datasets which you can copy, you can use structures (Blueprint Structures), which also compatible with C++ structs.

Also compoinbet-less actors (“invisible actors”) are normal practice so don’t worry, Items should be tied to world so you should have them as actors, they don’t need ot be named in editor properly (you can only change name in C++) you can have different variable for the name. You can either store varbales in structure or swap varbale states in blueprint class.

My pro tip for you is, don’t be afraid to try C++ in UE4 first, you already have C++ knowledge and you only blocking yourself to use that knowledge to understand UE4 and Blueprints, you only moving backwards in that case. Again watch my video and you will understand what i mean.

Thanks, I started working with a structure and its working out nicely, (before When I tried using it, I put it into a data table which I now realize wasn’t necessary to use the struct). Thank you for your help, its certainly helping me understand how UE4 blueprints process things, and I think from here on, I’ll start using C++ more rather than blueprints (I understood exactly how it would plan out in code, but the blueprints were new to me). :slight_smile:

Sounds like making a Struct and then. Populating an array of structs will accomplish what you want.
There is also a thing called Data Asset but I dont know if that will work or not.

Thanks, that’s what I started doing, and it seems to be doing exactly what I’m looking for. :slight_smile: