I'm creating an Xbox application and I have this problem with the content pipeline. Loading .xnb files is not a problem but I can't seem to find any helpful tutorials on writing via the content pipeline. I want to write an XML whenever the user presses a custom made "save" button. I've searched the web for "saving game sate" etc. but so far I haven't found a solution for my case.

So, summarized: is there a way to write data (in XML format) via the content pipeline, if my Save() method is called?




You can't save data on the xbox via the content pipeline.

You can however use other methods (standard .net once you've got a file stream). See here for an example: https://stackoverflow.com/questions/3723287/good-example-of-xna-4-0-to-save-game-data

See also: http://robotfootgames.com/xna-tutorials/92-xna-tutorial-savingloading-on-xbox-360-40

The content pipeline is for build time files (they are compiled).
See What is the content pipeline (MSDN).

It works well when you want to perform a lot of pre-processing to go from your original file (maybe an image file) to your runtime class (like a Texture2D with mipmap levels), but that's not the only way to load files on the xbox (so you don't have to save to the XNB format).

| improve this answer | |
  • \$\begingroup\$ Thank you very much for your fast response. I didn't know that it was impossible to write via the content pipeline, I could have been searching for ever for an answer. I will try it with the code on stackoverflow your link provided, Thanks! \$\endgroup\$ – DenEddy Mar 16 '12 at 9:27
  • \$\begingroup\$ A small note - you can write via the content pipeline on windows providing you have Game Studio Express installed (i.e. for developers, but not players). People often use this for creating level editors. \$\endgroup\$ – George Duckett Mar 16 '12 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.