Hi guys,
I hve a problem.
So I have a text document, and I want to write stuff in it. The idea is to add some new text in the file, under some conditions. This text will be read later.
So in one entity's script I have this code:
on "LeftClick"
{
UserDescFile.OpenAsText(2);
UserDescFile.SetPosition(0);
UserDescFile.WriteText("1");
UserDescFile.Close();
}
and in another's entity's script, this code:
on "LeftClick"
{
UserDescFile.OpenAsText(2);
UserDescFile.SetPosition(2);
UserDescFile.WriteText("2");
UserDescFile.Close();
}
My problem is the following: I click on one entity, close the game and check the text file. Sure enough, there's a number at the specified position. Then I open the game, click the other entity, and while there is the new number at the correct position, the old number is deleted. Is this correct behaviour? Is there any way to make all the text remain in the text document, without being deleted after a new left click?
Thanks guys!