Reading text files in blueprints

I am using rama’s amazing Victory BP Library (because I am not good with C++) on engine version 4.12.5 and trying to read multiple text files (in a single folder). I can write out the text files just fine but I am having trouble reading them. I am not sure which node(s) to use to read all the text files and what node(s) to use following up on that so that something happens when it says something specific.

My current goal is to have UE4 write and read text files and depending on what the text files say will determine the state an object is in.

I just need help with reading the text files.

You want to use the top one. From the return value you want to make a branch. If it is true, and ArraySize > 0, get the first element from String Array, cast it to a bool, and I imagine you are using this value to set Flipper R.

the top picture is storing the value of flipper R in a text file yes and i was wondering how can i access that or any other text document using the 2 Victory BP nodes in picture 2.

Like I said use the top one only. The bottom one gets all files in a directory which is not what you want. You essentially do the opposite that you did for writing.

What I am trying to do is when event X happens set all objects in array to stop or “pause” when they read Y. I am trying to link UE4 to a visual basic program and the form of communication is through text documents.

I might just be over thinking this but I just need unreal to write to a text document so the VB program can read is change it and send it back to UE4 and something happens in UE4 based on that change.

Example: say the VB program is reading data from unreal and sending it to a usb device if that device is unplugged the VB program will write an error and unreal will read that error and stop/pause the game.

thank you for your help

Ah, I understand. Try this (conceptually). You will need to replace the read/write nodes with the actual nodes and data, but the principle here is to show you that you want to start up an event that constantly reads from the file (given a delay between reading) and compare the contents of the file to previously stored contents. If the contents have changed, process the change, set the change to the current contents, and read again.

I forgot to wire up the “process your array” node back up to the CheckNewContents event. You’ll need to do that.

They are empty. Replace them with yours.

What are in your custom functions?