Blueprint structure, rules, general

Hi all,

I am a 3d artist with some basic knowledge of coding. I have been studying UE blueprint and making my own stuff quite successfully and am now getting to grips with it. I do have some questions that are probably so simple and stupid that much of the documentation and videos don’t mention. At present I am writing lots of functions in my character bp but feel that this will bite me along the line as I will end up repeating nodes in other bp’s etc. For example I watched a tutorial on making floating item name text over objects, but it was done by creating a widget for each object and calling the same var many times… Int his example I didn’t want to do it because I knew that there must be a way to cut down a lot of time and repeating of variables - and widgets for each item. Surely one widget to drive the text, which gets the obj’s name from a var (in the obj bp) and just prints it. And this is my problem, I am aware of clean coding in the limited languages that I know, yet can’t seem to grasp BPs order. Some people put some stuff in CBP, others in Level BP, other make a new bp and other make classes ----argg. I would appreciate if anyone could explain a good structure to me so that i might understand where things are better going, I don’t want a massive character bp hehe…

cheers,

I cannot explain exactly what was done in the tutorial you seen. But my guess is, he he just use class instance to define the widget, & bot make a BP class for every objects.

Maybe some explanation on BP. BP is base on C++/Unrealscript.

a class blueprint is like a class in C++. It define the characteristic of an object, but itself is not an ‘object’

an hypothetical example.
A supermarket-> You have many products

You define a class called ClassProduct, under ClassProduct, you have information of its price tag & location in the store. See, ClassProduct define characteristic of Objects, but itself not an Object

Now objects for ClassProduct will be
Oreo, NestleCoffeepowder, Canned Mushroom soup.

These are also called instance in C++, and BP, the one you actually place in the game world. Each of them have a pricetag & location define.

Now I said I want to defines some item further, for instance, expired date. Expired date apply to only certain products, daily’s, fruits, cans, so itz make sense to create a sub class of ClassProduct to extend this. Also know as a child class in C++/Blueprint

Lets call it ClassProductwithExpireDate.

Now you can add expired date as a unique parameter ‘expired date’ for this child class. Price-tag & location are inherited (from CProduct) & do not need to be defined again.
object instance of ClassProductwithExpireDate. e,g, banana, canned mushroom soup,

Now you can place Banana, canned soup to the store, & define unique price-tag, expired date, & location.

Now you hopefully know what is a Classblueprint.

What about level blueprint. In a simplify explanation, It is used for interaction between ** INSTANCEs** of classes & objects.

Back to class, while you can define another class as a variable in an class
e.g ClassProduct in your new class called ClassStore
you are however unable to talk directly (or have reference) to an instance (like Class product instance AppleNumber21 in this case) of a class. Exception when you can have reference to all instances of the class, or unique instance of a class e.g Playercontroller, Gamemode (where only one of its instance will exist)

So if you need functionality between 2 instances in the game world, normally, you do it via level blueprint, A classical example is a a SwitchBlueprint (in game level), to activate an a lampBlueprint/lightcomponent (in the level) in a scene.

e.g BP_SwitchRoom21 use to control on/off of LampA_room21 & LampB_Room21. This is an example you will use a level blueprint.