Hello Everyone, have a nice day, my game which consists of a visual novel read the dialogues to be displayed in a text file that I created and put in a folder to the program, previously when I exported the game for Windows and run the game did not show absolutely nothing, when I open the text file output_log.txt get an error saying
IsolatedStorageException: Could not find a part of the path “C:\Users\exito\Desktop\textbox\Assets\Data\Dialogue1.txt”.
apparently wherever the game is exported searches for the Assets, Data folders, and the text file Dialogue1.txt
if not found, does not work, however the problem lies in this game is designed for android and naturally when opening in a mobile as not find the folders mentioned above the game does not run, also if I pass my game to another computer than mine would not be executed by not find the address of those folders
This is the script and let me know if I can set the address and folders so already come included when anyone download the game on any platform
If you’re just trying to read in data from a text file, you may consider using the Resource folder and read the file from there. Otherwise, if you’re wanting it somewhere else, looking into the Application calls
This will use the proper path based on what your build target is.
Sorry, I’m not sure what you mean with used unity editor and exported the game.
The links I gave you are for saving data to a path based on build target. Unity will choose the proper path based on what device you build to. If you hard code in a path, it’s not always going to be right based on your device, so it’s best to use one of those unity paths.
Resource.load is good if you just need to load in a textasset and read the data from it. Depending on what you are doing, you could have a template data file in the resource folder and then save it out to one of the Application paths.
The UnityEditor namespace is used for editor scripts, if that is what you are trying to write, you’ll need to read up on that.
I needed convert textasset to string so as you can see i did it this way string file = mydata.text; but when the game is running an error appears in that line saying NullReferenceException: Object reference not set to an instance of an object, the dialogue is in a Assets/Resources so I do not know whats is wrong
One thing to note you don’t have to do (TextAsset) and As TextAsset. Just do the as TextAsset.
As for the “Dialogue”. I believe it is cap sensitive. Can’t remember off hand.