Very basic question on Blueprint events

Hi,

I try to learn unreal engine (working with 4.14.3) making different tutorials and now I tried to get some further experience with epics sample projects.
For this I have downloaded EpicGames “StrategyGame” sample project.
I read and follow the Blueprints trying to understand how they spawn and managing waves etc., but if I tried to add an additional spawn within a wave I run into some troubles I do not understand yet.
If I copy OnWaveSpawned(Brewery5) it inserts a CustomEvent instead. If I add it from mousemenu it does not add something and selects an existing object instead.

Hopefully someone can help me to understand what I am making wrong. Thanks in advance.

Hope this video works (is my first try with youtube).

Events are kinda “triggers” that define actions or assign values. An event is “when something happened”. There are standard events like “player pressed left mouse button” and there are custom events like “OnWaveSpawned”. Every event is unique in a means that there can only be one event for clicking the left mouse button or one event for “the wave at brewery5 has just spawned”.

Blueprints are powerful but working with them can be complicated in the first few minutes (or hours) for absolute beginners. I suggest you start with some very basic tutorials from epic - they are for sure much more boring than a strategyGame, but you will learn many valuable basics that will otherwise make you think like “huh why did this happen? What is this doing?”. Most of us started looking at some very complicated game templates, didn’t understand much and then went back to field one and started the tutorials.

Thanks for your reply,
but in this level blueprint this specific event is used 11 times (4 pieces can be seen in the editor) and I am not able to add at least one more.

I worked with basic blueprints. For e.g. doors that can be opened …
Now I try to understand how blueprints are used in such projects. The Wave calls the function to spawn a definable amount of enemies (e.g. “SpawNormalMacro”). They are spwan from brewery object (in this case from enemy brewery). In my understanding it waits until the amount of enemies are spawned and this is followed by a Delay to spawn next type of enemies.

The OnWaveSpawnedEvent is actually an Event Dispatcher Event from an Object (Brewery5) in the Level.

To create a new WaveSpawner, dublicate one of the Brewery. Then select the new one and go into your level blueprint. Right click somewhere and you’ll see that you can “Add Event from Brewery”. There you’ll find “OnWaveSpawned” :slight_smile:

If you want to add functionality to the Spawn, you need to extend the existing OnWaveSpawned Event in your Level Blueprint.
You can only delegate an Event once in your Level Blueprint.

Thanks Raildex_ for you answer.

I am not fully sure if I made an mistake on the video. I selected brewery 5 and try to add the event dispatcher from the list i get by right clicking the blueprintvisual editor. But instead of adding the selected event dispatcher “OnWaveSpawned” to the visual editor the editor only selects one of the existing event dispatchers in the level blueprint, like you can see in the video (2nd try).

You can’t add the same Event twice :slight_smile:

So what it seems like what’s going on is that you’re trying to call the function, but you cannot find it. Correct?

Think of the functions kind of like telephones. Making a custom function (red box, only has connector on the right, none on the left) is like establishing a new number. These events can only be “firsts” and usually have something to call them, whether you do it manually (like with custom events) or whether it’s done automatically (like Construction, and BeginPlay). But - - if I’m understanding correctly, you want to call the function? Right click on an empty space and type in the name. That will make a blue (or green) box to call the functions (green tend to be pure and have no execution input/output). Blue/green functions are the ones making the “calls” to the ones that have a start, and can never be the start of a function, they can only be the middle/end.

Have you tried changing the “Number” in the “SpawnNormalMacro” from the video from 2 to 3? I haven’t taken a look at that project, so I’m unaware if that “Number” input for the macro is the number to spawn.

Thanks Raildex_

And what is the difference between the 11 event dispatchers added to this level blueprint. The brewery5 is in the level once. There can I find different references? What I see in the righclick menu is that there it allwos me ta add a event from brewery C 0.

Can you please explain how this works in this specific level blueprint? In the visual editor I cannot see a difference between this event dispatchers.

Thanks in advance.

First thank you for watching the video so i am sure it is available for others also with private setting :-).
The number of SpawnNormalMacro defines the number of enemies that is spawned with this action.

As I hopefully uploaded this screen from next wave there they use 6 fast enemies, afterwards 6 normal enemies and the next are (last one) are 8 normal enemies.
Problem for me is that I am not able to add the event to the visual editor that seems to tell us that the enemies are fully spawned (e.g. 6 fast ones). So it can be that all OnWaveSpawned are diffent but I do not know this difference only from this blueprint.

Thanks in advance.

114573a450914b31774f302e444b23d5998a7d03.jpeg

Found the problem. As it turns out, the OnWaveSpawned (Brewery5) is some of the C++ in the project. That is why there are multiple of the same type, and it seems they (potentially) all fire off simultaneously. When you right-click and click “Find references” it calls it “Wave Spawned Delegate Delegate Signature”, and when I right-click on it and click “Find actor in level”, it selects it in the viewport. But the blueprint of that actor actually doesn’t contain any said function.

This project is blueprint/c++ hybrid. Probably not the best starting point if you don’t know any C++.

Thanks for your help so far GageCornelius

I know C++ coding, but I use Borland C++ and there is a big differnence to .net and Microsoft provided classes and functions. In Unreal Engine I have to learn to understand how the interfacing between is working and how the workflows are.
But for the first time in unreal i try to come over without c++.

Looking further to the Spawn macros, the OnWaveSpawned is used here in the DoOnce. The functions here only presetting enemy unit properties…

97225ee05eae6b57281fb0bc9854ff45ca0bf23d.jpeg

Well Borland C++ is “similar enough” to understand most parts of the “What is going on here” part. Some older tutorials use a lot of C++. I am currently rewriting a part of the old shooter example. The original was mostly made in C++ and I recreate my version in Blueprint. At first i thought Blueprint was weaker, clumsier and slower than C++, but once you get used to it I think you can do like 99% of what you can do in C++. For the remaining 1% you can build a work-around.

I can really recommend the shootertutorial.com website as this guy is not just giving you a dull youtube video where you copy all steps, but leaves out enough details so you are forced to experiment and discover the functions of Blueprint on your own.

The sample games from epic - some older ones like the shooter example or the strategy game are quite good on their own as a base for a game, but not that great for learning. There’s some “pure blueprint” examples with better documentation if you wanna get into Blueprint.

Thanks Fronzelneekburm,

Yes I think so too after seeing some work done with blueprints. In Unreal I like to focus on Blueprints. I do not mix up Pascal and C++ so why mixing here :slight_smile:

I was very impressed of the StrategyGame caus for a sample it have cool features and is funny to play with. But now I liked to extand it and make it harder to have more fun with it.

It is my first thread here and I am happy to see that there is community. If you search for german tutorials I do not find much stuff. So community seems to much smaller as in unity.

But I like Unreal and the workflows it uses. So I go forward to invest my little spare time to learn/ get ahndy with Unreal :slight_smile: