Hello everyone, I am writing this to know if it is possible a script that writes from a txt file to a specific variable.
I will explain it better.
there are variables that you can put text, example:
and there are scripts/codes that allow you to create and read txt files, such as:
the command "a" and "w" I understand that it is for write to the file.
and the command "r" is for read the file.
With this in mind, I would like to see if when reading a file, the same text of the file that is being read (the text that it has) can be transferred in a variable.
that is, if one writes in the txt, and what is written there, it is transferred to the game by variable.
that can be possible?
PS: I don't know if the script to read the txt could read lines separately or it will read everything together.
I will explain it better.
there are variables that you can put text, example:
Code:
$game_variables[6] = "Text of Variable"
and there are scripts/codes that allow you to create and read txt files, such as:
Code:
File.open ("filename.txt", "a") {| f | f.write ("File text \ nThe second line.")}
the command "a" and "w" I understand that it is for write to the file.
and the command "r" is for read the file.
With this in mind, I would like to see if when reading a file, the same text of the file that is being read (the text that it has) can be transferred in a variable.
that is, if one writes in the txt, and what is written there, it is transferred to the game by variable.
that can be possible?
PS: I don't know if the script to read the txt could read lines separately or it will read everything together.