1. I am recording my users' answers using the script field in dialogue they select. It usually looks like this:
Code: Select all
Variable["EarthquakeAnswers"] = Variable["EarthquakeAnswers"] .. "1a,";
Code: Select all
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using PixelCrushers.DialogueSystem;
using UnityEngine;
public class WriteCSV : MonoBehaviour {
public void ExportAnswers ()
{
string strPath2 = System.Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory);
strPath2 = strPath2 + "/earthquake.txt";
FileStream fs2 = new FileStream(strPath2, FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter sw2 = new StreamWriter(fs2);
sw2.BaseStream.Seek(0, SeekOrigin.End);
string answers2 = DialogueLua.GetVariable("EarthquakeAnswers").AsString;
sw2.WriteLine(answers2);
sw2.Flush();
sw2.Close();
}
}