Virtual CMD Console Commands

Hello !

Im trying to create a virtual console Main Menu, something like the windows CMD prompt but way simpler.

The idea is that the player can type some specific commands and get specific results based on the typed command.

I already have the interface setup where the player can type a command and the “pc” can give answers like : “error”, or “command confirmed”

I would like this system to do a lot of things, for example :

PLAY_ANIM_00 > play the idle animation on the character
PLAY_ANIM_01 > play the walking forward animation on character

PLAY_LVL_00 > load and open the first level of the game

PLAY_DISC_14 > Play a music track

INFO_PLAYER > display a list of commands for the player

SETUP_PLAYER_BINDS > open a config screen to change the game’s inputs

.. and so on ..

But i would also like to have some Easter Eggs commands that give you some jokes as an answer :

FORMAT_C > terminal replies : “no way bro”

But if you type something that is not in the valid commands list :

ZHHGDI_DFEWIUZG > Terminal replies : Error

You get the idea, i need a lot of commands, all will have a specific answer from the terminal, the answers need to have a specific color

  • So i need an input Text (what the player typed)
  • An Answer Text
  • A color assigned to each answer

I guess i should use a DataTable with a structure and then check if my input Text is present in the DataTable and if true, then get its related pc answer but im not sure if its the best solution.

How would you set up something like that if you keep in mind that i need a lot of commands (100-300 ) ?

For your simple approach, you can use a string table, yes, but console commands usually have arguments, so the format is [ <-command> [ <argument [<value> … ] ] …

I wouldn’t want to do that in Blueprints; it’s easier in C++.

Use a command line parser library, parse the command line, and then create a corresponding function for each command.

1 Like

Im sorry, maybe i was not precise enough.

  • I have no clues about C++
  • I need to do it in blueprint only
  • I dont need a realistic console system

My system should just work when you type the entire command, i wont do any kind of shortcuts or suggestion to finish the command.

I also dont need any kind of folder exploration like “C>Data>Something”.

I think doing it with a Struct + DataTable would work, but im asking here in case there is a better solution or if there are issues i could have with this system.