Print Whole Array to Screen or Append String on Trigger

Hello all,

I will be running some upcoming research trials, and I have a question that is fairly basic, I think. I will be recording people’s choices of left or right doors as they adventure through an environment, and I’d like to be able to print their choices to screen once they’ve completed the task, so that I can screen shot them and code them at a later point. This seems like a very basic thing to do, but I’ve hit a couple of bumps along the road.
First, I tried to just append all choices as L or R to a string, which I then print out at the end of the trial. However, there does not seem to be a way to set the append to string to occur only when the player enters a trigger.

You can do this with an array though. However, it does not appear that there is a way to print the whole array to the screen, and I’d need all of this information.

TLDR: how would you set up strings to append to another string only when the player enters the trigger. OR how can you print an entire array to the screen.

Is this something I should tackle through a HUD?

PS. How do you make text that has been printed to screen stay on the screen permanently?

Thank you for any help you can provide.

If it’s just debug information you can just use “Print String”. This also saves it in the logs so you don’t have to screenshot it but just look through those. Ideally use some unique string because those logs can become quite large. Something like "Debug choice string: " so you can easily search through the log with CTRL+F (simple text file located by default at “Documents/Unreal Projects/“YourProjectName”/Saved/Logs”.

To print the whole array you have to loop through the array with a for each. In pseudo code (python because I love that language):

outputString = ""

for element in choiceArray:
    outputString += element

In BP this roughly translates to:

outputString = String
choiceArray = String Array

"Set outputString" = 

outputString -> "Append"

"For Each" choiceArray -> Element -> In the second input of the "Append" you created above.

The elements in quotation marks are node names. “->” means a line between those.

I’ll post a picture soonish… Epic Games Launcher needs an update and with my current connection that takes another 2 hours or so ._.

http://i.imgur.com/WGc2H1x.png

That is perfect! Just having them in the output log is really a solution all in itself, and saves me a bunch of hassle later on. The solution you provided will work really well. Thank you so much!

I’ll add it to my custom functions/Macros Library!