Download

Get Data Column as String outputs more than just that column

Hey guys, I am setting up a dialogue system using data tables and while I’ve done this before, for some reason I’m getting a weird result. Rather than getting the specified column, I’m getting the address of the row of the column. Now I did try running a loop to get the elements of the array but the result was the same.

What are you doing with the array it returns?
/ could the data be part of that array by mistake?

And last but def. Not least. Why not use a custom struct for it so that the data is always in a precise format?

The only reason for the data table is having more flexibility on the dialogue. I have to create a struct for the table anyway so in most cases I prefer to skip tables but in this case I figured it would be easier to manage all of the characters. The downside to using just a struct is all of the dialogue (which is a lot) must be kept in memory. The advantage of the data table is only what is needed gets loaded.

I’ve used this same method in another game and I looked at my old code thinking maybe I did something wrong but they’re identical and the old one works. The only thing I haven’t tried is copy/pasting it in.

The array that is returned gets passed to the dialogue manager I wrote. Each NPC looks in the data table for their name and which line of dialogue they need given situations/chapters.

I solved the issue. I had the data type in the struct for my data table set to text instead of string. The function “Get Data Table Column as String” requires a string (obviously) :wink:

1 Like

I was suggesting looking at the struct of the data table, not holding all dialogue in a struct as that would be insane :stuck_out_tongue:

Holy buckets did it take me forever to find this post. It worked for me, the issue was having the struct var set to my desired output instead of just outputting the string which was adding all the serialized junk I didn’t want.