.txt file or .csv file in unity ?! IMPORTANT

hello , i am in a way of creating an rpg game , what i am trying to do is the conversation of each npc and the info of the items
and i got an idea but i dont know if it works in unity here’s my idea .

lets say we got an npc and when u click on it , a window pop up

so what we wanna do is lets say i want to have a dialog in this window so for faster to write and that stuff i put the text i want to show in a .txt file and name it as a number for example 123456.txt or any other name like conv.txt then inside it let’s say we want to have
something like this :

1236312--52465--$Untitled.jpg

so this 0
so the dialog knows witch file is that so this file number is 0
then code 0 is the dialog we want to show there .
so what we write in this dialog is
0,0 and after we write this , it will automaticly will go searrch for file name 0 and dialog num 0 then show wts inside
so when u press on this npc it will show
“what do you want ?”

please help me or give me anyidea if something like that can make it work

thank you

You can use System.IO for that. Here’s some reference:
Help me about reading .TXT File - Questions & Answers - Unity Discussions

Google gives you more results as well.

My suggestion is to put your text content into a hashtable on load and then define a logic which will display the needed text in the right place.

ok and what about a .csv file , lets say we want a npc so in the .csv file we got for example something like this :

so the first one with the random lang is the Index of this npc the number of him , and then the Name ,
skip the shape , let’s go to Desc its the conv number so this npc gets this number from .txt file then show it .
then the job type let’s say we want joptype number 1 it will be for example sell spicific items or armor
jobtype number 2 sells weapons , the jobcount is how many things this npc can offer or show or do .
is it hard to create something like that in unity ?!

Nope, I’ve created a translation system using csv files, yet I assigned it directly in the inspector as a text resource and used the System.Text.RegularExpressions class to split the contents as needed based on the language chosen in the game. You will just need to split the lines per separator as well, not only split the file per line.

Remember that a csv file basically is a text file which just contains indicators on where to split the contents. As I mentioned you can put that into a Hashtable or Dictionary and do whatever you need - the logic behind that, the contents in the file and so on is fully up to you.

can u show me how that works ? or how to do that ?!

I have also a .csv file that is created online and I want to use its data in unity as it is created. You said it can be assigned directly in the inspector as a text resource. But when I want to choose it in TextAsset it does not show .csv file only .txt file is shown. Would you pls help me how can I do that.
Thx