Train Sim World PC editor Audio Blueprint Creation - Newbie questions

Hi, I’m using editor 4.27 that’s built for the game Train Sim World, I’m familiar with the simple pre-built assets for train sim world, but i’m attempting to build a new blueprint that essentially plays audio segments, it is possible, i’ve got a text “how to” guide for UE AI, but I’ve no experience building blueprints. Basically it should work like this script calls Audio from Datatable & structure to construct a sentence for example “The next train is TIME to DESTINATION calling at CALLING POINTS and FINAL DESTINATION”, Capitalized words are Variables from the Game via a data feed that displays information on the platform (which is already in the game, called a PIS) , in theory they can all talk to each other to provide the correct output, but i’m struggling to understand the instructions on how to connect blueprints in the event graph, specifically :

• Clear Array: Start by calling Clear on the CurrentQueue (blueprint user defined variable).
•
• Add Prefix: GetDataTableRow (RowName: “Msg_The”) → Add to CurrentQueue??? how ???
•
• Add Time: Break the “Time” variable into Hours and Minutes. GetDataTableRow (RowName: “Num_10”) → Add to CurrentQueue.
•
• Add Platform: GetDataTableRow (RowName: “Msg_Platform”) → GetDataTableRow (RowName: “Num_01”).
•
• Add Calling Points: Use a ForEachLoop on your CallingPoints array. Inside the loop, GetDataTableRow using the station name as the key.

Could anyone help me on how to connect these variables, preferably in pictures rather than words so I can see what’s required ?

this is the original question i asked AI engine to get the response i’ve been working on

Can you show me how to create train sim world audio blueprint that utilizes Datatable & Structure asset’s to define Audio segments which can be joined together in a specific pre-defined string, the Passenger information Display data is to be used to supply variables such as “Platform,Time, Desination, Calling Points”. location need to be definable for example Derby station. This Blueprint should be created with train sim world PC editor UE 4.27

many thanks,

You do not need a Train Sim specific node for this. It is a normal array of sounds built from data-table rows, then played in order. This assumes each row’s struct has a Sound Base or Sound Cue field, called Audio below. 4.27 has the same nodes.

  1. Clear. From CurrentQueue drag off and add Clear. Run that first, when the announcement starts.

  2. Add one clip. Add Get Data Table Row. Data Table is your announcement table. Row Name is the name Msg_The, a Name pin, not a String. Use a Name literal or String to Name. Wire execution into the node, and continue from the Row Found pin, not from the white Out Row. Break the struct, drag off Audio, and Add (the array node). Target Array = CurrentQueue, New Item = that sound.

  3. Time, platform, and the other fixed words are the same pair of nodes, chained in execution order off the previous Row Found. Break your Time into hours and minutes (integers). Append the string Num_ with the number, String to Name, and feed that Name into the next Get Data Table Row’s Row Name. Then Break, then Add to CurrentQueue. Do Msg_Platform, then Num_01, the same way. The array order is the sentence order, so the execution wires have to run in that order. Do not branch them all off one pin or the adds race.

  4. Calling points. ForEachLoop on CallingPoints. If Array Element is a String, String to Name. Inside the loop body, Get Data Table Row with that Name, Row Found, Break, Add to CurrentQueue. Start playback from the loop’s Completed pin, not from inside the body.

  5. Play the queue. Make an int QueueIndex, default 0, and a custom event PlayNext. If QueueIndex is greater or equal to the length of CurrentQueue, stop. Otherwise Get (a copy) from CurrentQueue at QueueIndex, Play Sound 2D, and on the Audio Component that Play Sound 2D returns, Bind Event to On Audio Finished. In that event add 1 to QueueIndex and call PlayNext again. Do not Delay by a guessed length. On Audio Finished is what joins the clips.

Row Not Found means the Name does not match the row exactly: case, a trailing space, or Num_1 versus Num_01. Print the Name you built on that pin.

I cannot attach a graph screenshot from here, but each sentence chunk is the same three nodes in a row: Get Data Table Row, Break, Add. Once one of those works, duplicate it for the rest.