I made the chili framework communicate with a text file, so that depending on the text, eg. "1" will move the character to the right, "2" down, etc... And it works! Even if I have it open, change the text and quickly hit crtl + s. The problem comes with VB. I tried to make this control interface with buttons where the framework would be the "screen" like the pipboy in fallout 3, and have control buttons on the VB form around it.
Thing is, c++ stops looking for the file as soon as I edit it through VB, as VB, I believe, edits text files so that it deletes them and remakes it.
So my question is; how will I make c++ look for the text file again?
This is the code:
Code: Select all
//Begin load info
int readline[100];
readline[0] = 0;
int readx = 1;
fstream textfile;
textfile.open("data.txt");
textfile >> readline[readx];
if (readline[1] == 1)
{x += 1;}
else if (readline[1] == 2)
{y += 1;}
else if (readline[1] == 3)
{x -= 1;}
else if (readline[1] == 4)
{y -= 1;}
textfile.close();
//End load info
DrawDude(x, y);