UE4 's blueprint is conceptually very similar to programming languages such as C + +. In the blueprint you can define variables, functions, macros, and so on, which can also be inherited by advanced points. This does not count, we can also define the blueprint interface to standardize the behavior of subclasses. Basically C + + can be done, the blueprint can also be done, and is WYSIWYG, drag-and-drop, instant compilation, immediately effective.
As a general rule, programmers do the function modules in C + +, level designers, and blueprints to create the logic of the game, the level master does not need to program, can create their own logic, at least in the logic of this layer does not require the programmer to cooperate. This is much more efficient, and there is no scripting language like Lua to participate, and designers have a much lower threshold.
Here's how you'll use the custom events in the Blueprint:
On the Blueprint's toolbar, we can see 5 buttons through which we can create elements of multiple blueprints, respectively.
You can create a custom event by adding a custom event to the right-click, add Event-in the blueprint. Custom events can specify input parameters, and can also specify whether the event can be synchronized on the client and server side.
Replication has four options, which are not replicated by default, can be selected for multiplexing, run on the server, run on the client to which it belongs, and can be selected if the event needs to be routed over the network.
Enter a value column to add parameters, the same type as the variable type.
Let's do an example of how to trigger this custom event when the K button is pressed to print a hello.
Triggers a custom event, just like a function call, and, if there are arguments, you can specify the parameters like a function.
We can also bind events to different schedulers in a dynamic bind, just like delegate in a high-level programming language. For example, we press K, bind myevent for the scheduler, press F, bind MyEvent1 for the scheduler, and invoke the same scheduler, triggering behavior is different.
Unreal Engine 4 Blueprint Custom Events