Content example project

Hey everyone. I’ve been trying to get into the basics and looking through the content example project. It mentions the green question marks, but this only appears on the first level.
Beyond that, there’s only the examples themselves.

Is there a resource that talks about the individual examples?
I was looking at the mouse_interaction level and the cube which moves after you click on it. I’m a bit lost, since the cube actor itself has no blueprint, so not sure where to look for how the interaction happens.

There’s several other moments like this throughout. Like how the multi-size batteries are configured since they link to the same blueprint but are distinct actors.

Thanks.

To anyone coming for additional info, please also check out Rokenrock’s second response which describes how to create a child actor and what such a thing entails.

The green question mark icons refer to the official documentation- meaning generic things rather than specific examples. It seems the green question mark specifically only points to the official page for this, with extremely brief explanations of what the level goes over

I don’t think there is a resource that talks about the individual examples, unfortunately.
Your best bet is to go into all the actors and see if you can follow their logic. You can do this by clicking edit next to the object in the outliner

Took a minute to track it down, but the cube logic is in the level blueprint.


It’s using a sequence player rather than moving the cube directly



The batteries work by something called inheritance.
All the batteries (Battery, Battery_Small, & Battery_Large) are batteries. They all either inherit from BP_Battery, or are BP_Battery.
In the children (Battery_Small & Battery_Large) we override the mesh and electricity value (it’s by default set to 10 in BP_Battery, with Large and Small overriding to 25 & 4 respectively)


Since all battery classes are, somewhere along the line, BP_Battery, we can just cast to that.

We can’t call any child-class specific functions or properties, but any we can call are their overridden counterparts.
Meaning when we get the Electricity Value from BP_Battery, we’re actually getting the overridden value from whatever class it specifically is (which could actually be BP_Battery, in which case it’s not overridden, but we treat it the same).




Feel free to ask if you’re confused by any other example, or by one of my explanations

Thanks @rokenrock !

This is really helpful. A lot of the screenshots still on the docs are also very outdated, so been having trouble finding the shortest route to simple stuff like the level BP.

Regarding the inheritance. That makes sense and I could see that it was referencing off of the generic BP_Battery, but don’t understand how they created such an inheritance since i’m assuming it’s part of the creation process?

That’s what’s often missing when going through these. I see the result, but don’t know what menus they went through to make them present.

Yup- it’s part of the creation process. You can also modify it after creating the asset, though you should keep in mind that changing an asset’s parent class will break any references it has to its old parent class.

Whenever creating a blueprint class, you get this screen:
image


This is where you pick the parent class of the thing you’re creating. The common classes are at the top with easy to reach buttons, but every blueprintable class will be under all classes (including c++ classes).

You can see the hierarchy of classes here, too. Note that BP_Battery_Big_Child and BP_Battery_Small_Child are under BP_Battery. That means BP_Battery is the parent class of those classes- they inherit from BP_Battery (likewise BP_Battery inherits from Actor and Actor from Object, meaning BP_Battery_Small_Child is a BP_Battery, Actor, and Object simultaneously).
You then simply click it, click select, and boom- new child of BP_Battery.

Opening BP_Battery_Big_Child or BP_Battery_Small_Child, you’ll be greeted by something like this:


It’s all data, everywhere- no event graph, no nodes- why? This is what happens if a class doesn’t have any custom logic- meaning no custom events and no overridden functions. That’s the case with the battery children since the only thing they’re changing are the values of “Electricity Value” & “Battery Mesh”
You can open the proper editor by clicking “Open Full Blueprint Editor” at the top:



As I mentioned earlier, you can also change the parent class after creating it. This can be done under Class Settings → Parent Class.


The top right, highlighted in green, red, and purple, shows the parent class. You can click the magnifying glass to show the class in the content browser or click the pencil to open that blueprint.

Okay! After reading this I think I saw this somewhere else before, but couldn’t make the link to it here.
So this system is great for having a generic set of actions and assigning those when you create children. This way all you have to do is modify a few variables and the mesh itself. Makes sense.
Thanks again!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.