Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sim run console command #2996

Merged
merged 12 commits into from
Sep 2, 2020
Merged

Conversation

ironclownfish
Copy link
Contributor

This allows the client to execute a command in Unreal's native console, via an API.

  • Has access to the countless built-in commands such as "stat unit", "stat fps", "open [map]", adjust any config settings, etc. etc.
  • Allows the user to create their own APIs much more easily, by adding a custom event to the level blueprint, and then calling the console command "ce MyEventName [args]". This will be very useful internally for bespoke APIs; they're faster to implement and won't clutter the AirSim interface.

@rajat2004
Copy link
Contributor

rajat2004 commented Sep 2, 2020

Just noticed that ConsoleCommand returns a FString, which I guess contains the output of the command if any. Could we perhaps return that instead of just a boolean to indicate whether the command was run?
Still, a way would be needed to indicate whether the command was executed, maybe returning something like Failed?

Also needs an unimplemented placeholder function in Unity for compilation, for some reason Travis isn't appearing in the checks

@ironclownfish
Copy link
Contributor Author

ConsoleCommand always returns the empty string. The last line of the function in the engine source is actually return TEXT("");

@rajat2004
Copy link
Contributor

Oh, wasn't aware of that, thanks!
Nothing's mentioned in the docs, very strange actually, maybe they kept it that way for some backwards compatibility?

@ironclownfish
Copy link
Contributor Author

It is very strange that the documentation for the function doesn't explain what the return value is.

@ironclownfish
Copy link
Contributor Author

Accidentally closed and reopened.

@madratman
Copy link
Contributor

madratman commented Sep 2, 2020

lgtm. It would be great to have a docstring, and an example script (for say stat fps / stat unit) as well!

@madratman madratman merged commit 8d80ccd into microsoft:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants