- For each int between A and B…
- Convert it to a name to get the data table row name.
- Add that data from the data table to an array.
- 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.