Reading Dialog Data Table into the widget: Works, but needs a few tweaks

Got an issue I’ve run into.

The For loop index is set to 0-12
The interger in range is also set to 0-12

Now The data text table I’m trying to read the text from has 6,190 rows of text in it.

The text I want it to display in the widget is at row 6,172.

The Problem: When I put this number in the for Loop Index or in the Interger in range, I get no text showing.

Possible cause Integers might only allow up to 255 range. But for dialog I need it to go from 0-all the way up to 20,000
to read the dialog in from the data text table through the on overlap trigger when talking to an NPC character.

How do i get it to read in row numbers that is past the 255 range WITHIN a for loop array?.

For I’m using a for loop array to read in the row numbers directly in from the data text table but the array is only working at the moment on only displaying text that is within the 255 range. I need to make the array read in rows that are outside this range.

As far as I know, Int in blueprints are signed 32-bit integers; that’s +/- 2147483647 or thereabouts. You can definitely go a bit further than 256 in a loop.

here’s the code.

There’s something strange going on here because It seems to me the engine is not even
reading the data text table correctly and I’m left wondering why…

For example, If I set the Index range to 0 to 600 and the same also for the Random Integer in Range. then it is only displaying the text at random in the widget only on row entries that are lower than 255.

That is very strange. Is this some kind of bug ?

For Its not displaying any row entires that are higher up than 255 because I checked
the dialog data table each time that the text did show up in the widget in the game and it was always from rows lower than 255 in the data table and anything higher up it just leaves the widget all black with no input showing…

Hmmmm… puzzling indeed… Does this mean that the Array Index or Interger only works up to 255 in an Array?

so what’s going on here. ? ??

This is no good if it can only display up to 255 rows of text and can’t go to 20,000 like
Mass Effect did…

And if I can get past this 255 row problem. Then how am I going to get it to ever read in rows
5120-5125 for an npc from my dialog data table if the index and random integer
only wants to displays the text starting the index from ZERO and only up to 255 !!!

You are unnecessarily converting int to byte, that’s why you are capping the value at 255.

Try like this:

I did not know the get commands for bringing those 4 nodes up that I had. I need to know
what the commands are to bring those two nodes up you showed me in the screenshot. but because i didn’t know the get command for bringing up those nodes, because those nodes
have no name on them like the other nodes do with the exe pins so I copied those nodes out instead from another blueprint that had them inside a for loop. That’s how I got those 4 nodes to show even though it only allowed 255 rows of text to show up in the widget because I didn’t know the other 2 extra nodes were causing the 255 cap.

So I made the change to remove the cap from the for loop in the code. Now
the text is no longer displaying at all. because the nodes in the for loop
have stopped working as soon as i deleted those 2 extra nodes from inside the for loop.

Suspecting that Data corruption could be the cause because I had removed the 2 nodes from inside a For Loop. I reversed back the changes and restored back the 4 nodes again in the For Loop and sure enough. The text won’t display anymore in the widget when reversing back the changes. And that to me means that the For Loop has now become Corrupted because the text display has stopped working and the widget remains all black now with no text at all…

So it looks like to me when you put copied nodes from inside a for loop to copy them inside
your for loop and later on try to tweak those nodes, it causes data corruption in the
for loop.

I might beable to restore the array back if I can link up the index with the array name using
the get command but I need to know the commands for linking those two nodes.

If that don’t work to restore it back, then I may have to delete all the code and link it
all back up again. or delete the blueprint object containing the onoverlap trigger and
redo the blueprint again.

No, there is most likely no corruption going on. It simply does not find the row name. Put a print string after the “row not found” pin to be notified when it is not working correctly.

You can’t convert an Int to a Name. You can however convert a *String *to a Name. And you can convert an *Int *to a String.
So, drag off the Int pin on the loop, make sure context is checked , type “to string”, choose “int to string”.
Then drag the string to the name pin on the data table row node and it will automatically add a conversion node. If it does not, type “to name”.

Thanks Stelnar, that worked, but now I’ve run into a strange Phenomenon.

I had the Hidden in Game Trigger checkbox on because I didn’t want to see the collision box trigger in the game. But as long as I had that checked, the trigger wouldn’t function properly. So the text would not display.

Now I turned Hidden in Game off to make the trigger visible in the game, lo behold the code now works past the 255 cap so its now showing all my dialog from the table but there’s another problem. The code at the moment is NOT YET COMPLETE because I can’t adjust the start position of the row data table even though i can adjust the end position in the table. But the Two Values, index 0 and Integer Range 0 can’t be adjusted because if I change those numbers, the code then stops reading in from the data table…

So now I have a problem, how can I adjust the start row position in the table if the index and integer start position have to both stay at 0 in order to read from the data table?

I do not know how to solve this kind of problem. I know there’s some missing code that needs to be added in place in this code to allow me to adjust the start row position number because this code at the moment is only allowing me to adjust only the end position but not the start.

I can’t know what’s causing the issue but here’s a speculation:
If you use integer range say 4003-4006 for example, do you first forloop 4003-4006 and then random int 4003-4006?
That does not work, because the array size would only be 3. Whatever you randomize would be an invalid index, or have a chance to be invalid.

You have to understand what this algorithm is doing.

  1. For each int between A and B…
  2. Convert it to a name to get the data table row name.
  3. Add that data from the data table to an array.
  4. When the loop is done, choose a random index of the array you created.

So the random range would always start at 0 and end at the last index.

Or you could make this algorithm simpler. If you know the range to pull from the data table, A and B in my example, you could just pick a random int in that range, and pull directly from the data table. No loop or array would be needed.

  1. For each int between A and B…
  2. Convert it to a name to get the data table row name.
  3. Add that data from the data table to an array.
  4. When the loop is done, choose a random index of the array you created.

I’ve already done that. And the result is, the array only reads the data table if you leave the index and also the int start range at 0. But what I want is to beable to change the start row position in the array so I can adjust the range within the data table but if I can’t do that then I cannot set the range on what data I want to draw from out of the table into the array.

Or you could make this algorithm simpler. If you know the range to pull from the data table, A and B in my example, you could just pick a random int in that range, and pull directly from the data table. No loop or array would be needed.

Ok let’s say the range in the dialog table is from 6172-6196 for the petstore owner of Telos
to give back his random moods responses each time that you walk into his trigger area.

So each time you walk into his trigger area he gives you different emotions and moods.

Yeah, what do you want? I’m busy
Another victim, er customer, so what can i do for you?
Would you be Interested in buying a fangercrawler?
Gee, what happened to all my customers?.
Have you seen our latest range of pets?


No loop or array necessary? So you can call up these rows with a random int from the table without using a array or loop?

I will need to see this piece of code. .

The other way I can think of is using the Array Elements list but that means retyping all the dialog all over again into those array slots which means doing twice the work. I was trying to avoid that because I didn’t want to clutter up my blueprints with tons of array structs and lists, that’s why I wanted to use the main data table file instead to draw all the data out from.

But my code has not evolved to the point of adding in speaker id pictures and audio
files with the text yet.

The key with your issue is how you select the element to use from the array. But that may not be needed if you can get the following to work.

Thanks for helping me find a solution to that issue, the code is working, i can adjust the start range now.

Now I just need to get the code to display also the portrait picture up now with the dialog text. But when I do open up the row editor and select the speaker pic according to the id number , it only shows the pic up in the dialog row editor but not show it up in the actual game widget with the text… Hmmmmm… Well that was rather disappointing I thought it would just display the pic in the widget for me, but with Unreal, things that look like they working in the editor well, often you need to go the second mile with this engine to actually get it well… working in the game… So I need to get the portrait picture of the speaker showing up now in the widget with the text.