Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How to display player-inputted text in-game?

I'm not looking for any kind of step-by-step on this (though I wouldn't be opposed to it), just where I should begin with implementing this feature. The idea is that the player could "Use" a terminal/computer in-game, at which point movement would be disabled and any letter or number typed by the player on the keyboard would display on the terminal screen in-game, as if they were typing into it directly.

How can I best go about getting player input to display in this way? I would prefer to stay in the realm of Blueprints, if possible. Thank you.

Product Version: UE 4.16
more ▼

asked Jul 21 '17 at 02:50 AM in Blueprint Scripting

avatar image

39 5 9 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You should start by creating a widget blueprint. In there, add a Text Box.alt text In your character widget, with whatever button you'd like to start displaying the widget with, create the widget and add it to the viewport as focus. Ignore your character's move and look inputs. The text box should automatically be in focus and you should be able to type in it. Is this what you were looking to do? alt text

textboxwidget.png (124.5 kB)
leftctrl.png (157.1 kB)
more ▼

answered Jul 21 '17 at 03:18 AM

avatar image

729 10 8 13

avatar image Drgy55 Jul 21 '17 at 08:13 PM

Hey vivalabugz, thanks for the response! You know the terminals in the Fallout series, where you can access them and then select options from a series of menus or select individual words to hack them? Example: https://www.youtube.com/watch?v=Sa4RUpXgzT4.

I'm creating something like that, except instead of selecting pre-determined options, the Player is able type into that in-game terminal to do things.

avatar image vivalabugz Jul 22 '17 at 12:18 AM

Its pretty much the same widget setup. I've updated it to look a little more similar now. alt text The player controller's BP is the same. You just have to make sure you set the focus to be the text box you want your player to type in. alt text There's a function OnTextCommitted in the widget you can use. When the player hits enter it will take what they typed and add it to another text boxalt textalt text

commandline.png (167.5 kB)
commandlinebp.png (232.8 kB)
giphy (3).gif (388.1 kB)
avatar image capitjeff211 Jul 27 '18 at 03:09 PM

I have been looking into this as well, is there any way that this is possible and for the system to check if it is one of a list of certain words? This way the game could react depending on what is typed.

avatar image vivalabugz Sep 13 '18 at 06:45 PM

Hey capitjeff211,

Sorry for the late response. Sure thats totally possible. After getting the input string from the user you can use the "Parse into Array" node with your source string as the user input and the delimiter could be a space(for this instance). Then you can use a for loop to iterate through the array that the "Parse into Array" outputs and compare each to a string with your word or words

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question