Does anyone know of a way to bind blueprint events to console commands, mainly so I can debug a fairly complex blueprint without binding keys for each individual variable and such? Ideally I’d like to avoid using C++ at this point, but if its inevitable, so be it.
For example, I can enter a command into the console:
dock_load 1, 4
And my blueprint will run a certain event with a the arguments I supply?
I’m just getting started in Unreal, but I’m looking to do the same thing. With the help of another forum user I’ve tracked down where to look at in the C++ sources, and so right now I’m getting the hang of making blueprint nodes. If you’re interested I can let you know when I have a blueprint node’s sources figured out. Not promising anything but I want to look into making plugins as well, so if I can figure out how to do that I’ll be able to help others avoid having to compile.
If you add an event in the level script, you can actually call it directly in the console with “ce EventName OptionalParamValue” etc.
As an example, if this were in my level script:
I could call it on the console with “ce TestConsoleEvent 25” and it would output 25 to the screen.
If you want an event in a blueprint for an actor in the world, you can use a similar setup, except you also have to specify which actor (and it uses “ke” instead of “ce”):
“ke ActorName EventName ParamValue”
If you don’t know the actor name, you can use “*” and it will try to call it on **every **actor in the world:
“ke * TestConsoleEvent 25”
i used " ke * " commands a bit to do various things, not print strings, and they dont seem to work. so i am wondering, are ke * left out from shipping builds? and so i have to find another way for my blueprints to communicate?
AFAICT, “ce” works shipped, but “ke” doesn’t. Rather than mess with console commands, you can go directly to the eventual destination, “CallFunctionByNameWithArguments.” This was my first time working with C++ in any capacity, much less in Unreal, but here’s the custom blueprint I came up with. It seems to work (only tested in UE 5.0.3), but I’m sure I’ve done things in the stupidest way possible… so if someone smarter can suggest improvements, please do.
Create these files, and after changing “TEMP22” to your project name, place them in /Source/ProjectName in your project folder. Then open the solution in VS and build your project.
TestBFL.h
#pragma once
include “CoreMinimal.h” include “Kismet/BlueprintFunctionLibrary.h” include “TestBFL.generated.h”
//Change “TEMP22” to your project name
UCLASS()
class TEMP22_API UTestBFL : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = “Development”, meta = (CallableWithoutWorldContext))
static bool DoCallFunctionByName(FString Target, FString Command, FString Arguments);
};
hey, folks, there is official documentation about calling your custom event in your blueprint at here: Custom Events | Unreal Engine 4.27 Documentation, which I think is a very clear and useful instruction!