Blueprint node to return string from console

Hi,

I’m trying to query several variables from the console and although I can do this manually I cannot use them within a blueprint. Being fairly new to C++ I’m having difficulty understanding how I can return anything from the console.
I have set up a .h file and .cpp file for a new blueprint node by following the documentation here but I don’t know how to return the value.
This may be something that’s already possible with current blueprint nodes so please tell me if I’m going about this the wrong way.
Any help with the creation would be much appreciated.

Thanks in advance,

Matt

Hello,

In your h you will need (besides the class definition, etc) for each function

UFUNCTION(BlueprintCallable, Category = "Maincat:Subcat",
	meta = (DisplayName = "My Awesome Blueprint Node",
		Keywords = "My Awesome Node"))
	static void OneHeckOfABlueprintNode(
		AActor* AnActor,
		int32& AnIntReturnValue
		);

So

  1. Blueprintcallable - is the keyword that gets you the exec pins on the node
  2. Blueprintpure - has no exec pins on the node
  3. Category - well yeah, that’s the catagories for the popup menu
  4. Keywords - The searchable keywords in the popup menu

Static - will always be required, the function may be void or not void, that’s your choice. most are void and pass back all the data explicity, rather than a simple return.

When you look at the int32, it’s the “&” following int32, that tells the build tool, that the value is going to be returned to the Blueprint VM.

Hope this helps.

.

Hi ,

Thanks for the reply.
I think I understand creating the node it’s just returning the value from the console command that I’m having difficulty with.
If I type ‘sg.AntiAliasingQuality’ in the UE console it returns ‘sg.AntiAliasingQuality = “3”’
If I create a node with a string input and input ‘sg.AntiAliasingQuality’ i’d like to have a node with a string output that would output the result, whether it be ‘3’ or ‘sg.AntiAliasingQuality = “3”’.
Is this possible? Is the API capable of querying the console using a string in c++?

Thanks,

Matt

Matt,

My apologies, I went down the wrong path with ya.

I cannot think of a reason, that you could not find access to the console. When your C++ code is entered, you can have the Blueprint VM pass you a WorldContextObject, from which you can get the UWorld object. If you pass in a actor as one of the parms for the blueprint node, every AActor has a pointer to the UWorld as well now (this was not always true). You also have access to the core of the engine, by using “GEngine”

i.e.
UWorld* myLIttleWorld = GEngine->GetWorld();;

It also looks like, there are some Console under the Hal, actually a lot of places, but understand, they may not all relate to how your thinking of console. So honestly this is going to be a search and destroy mission on your part, in order to find exactly what your looking for.

.