XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Game needs to read from text file

Last post 11/25/2008 8:52 PM by DrAsik100. 2 replies.
  • 11/25/2008 8:17 PM

    Game needs to read from text file

    Hello, my game at initialisation needs to read from a text file. I cannot add it to the Content Manager because it doesn't recognize that file format. I used to put it in the Content directory nonetheless and refer to it as /../../../Content/File.txt or something like that. However, when I publish and install the project, the game crashes when I select "New Game", which leads me to think that it's not finding this text file where it thinks it is. I found that I can add the text file to the solution, however how do I refer to it within my code so that paths do not get messed up upon publication ? Thanks.
  • 11/25/2008 8:22 PM In reply to

    Re: Game needs to read from text file

    Add the file to your content project. Open up the properties pane on that item and make sure you set Build Action to None and the Copy property to Copy if Newer. Now the path your game should use is "Content/File.txt".
  • 11/25/2008 8:52 PM In reply to

    Re: Game needs to read from text file

    You are my hero.
Page 1 of 1 (3 items) Previous Next