Can AGS create and read text files?

Started by Guyserman82, Tue 31/08/2010 22:16:27

Previous topic - Next topic

Guyserman82

I'm thinking about making a RPG trilogy, and I want the character that the player creates to be usable through all three games. The simplest way I can think to do this is to have AGS create and read a text document. Is this possible?

Dualnames

Of course it is. Below some examples. Depends on what you want really. A more specific question, would create a more specific answer.

CREATION
Code: ags

if (!File.Exists("temp.txt")){
  File *output = File.Open("temp.txt", eFileWrite);
  output.WriteString("A");
  output.Close();
}



Read
Code: ags

File *input = File.Open("temp.txt", eFileRead);
listbox.Clear();
if (input != null) {
  while (!input.EOF) {
    String line = input.ReadRawLineBack();
   listbox.AddItem(line);
   }
  input.Close();
}

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk