Difference between revisions of "Xbox 360 Storage"
Jump to navigation
Jump to search
(Created page with "* Storage (saving and loading) works by mounting files on physical media (HDD and memory card) as virtual drives. Calling X360Storage.CreateSaveGame or X360SaveGame.Open will...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
# Write to the save game file using either X360Storage.WriteBuffer or X360Storage.WritePlayerPrefs | # Write to the save game file using either X360Storage.WriteBuffer or X360Storage.WritePlayerPrefs | ||
# Close the save game file using X360Storage.Unmount | # Close the save game file using X360Storage.Unmount | ||
+ | |||
+ | ==Create Save Game== | ||
+ | <small>public static bool CreateSaveGame(uint userIndex, string displayName, string fileName, string mountName, X360Storage.DelegateResult onComplete);</small> | ||
+ | |||
+ | |||
+ | displayName is the save file name shown on the dashboard. fileName is the save file name on disc. This name must be unique on every physical media. mountName is the name of the virtual drive the save file is mounted to. i.e. specifying "name" will create a drive accessible via "name:\". Call Unmount with the same mount name once saving/loading is finished. Returns false if a storage operation is already active by checking IsStorageOpActive or if the selected user is not signed-in and Ready. onComplete is never called if this function returns false. |
Latest revision as of 16:20, 11 August 2020
- Storage (saving and loading) works by mounting files on physical media (HDD and memory card) as virtual drives. Calling X360Storage.CreateSaveGame or X360SaveGame.Open will mount the saved file as a drive at "mountName:" i.e. on success X360SaveGame.Open("save", onComplete) you will be able to access files inside the save via "save:\" Mounts should be unmounted using X360Storage.Unmount once they are not required anymore.
Game load/save checklist
- Set up a valid project title id
- Sign-in a user using X360Core.RequestSignIn
- Have that user select a storage device using X360Storage.SelectSaveGameStorageDeviceForUser
- Create and open a save game file using X360Storage.CreateSaveGame
- Write to the save game file using either X360Storage.WriteBuffer or X360Storage.WritePlayerPrefs
- Close the save game file using X360Storage.Unmount
Create Save Game
public static bool CreateSaveGame(uint userIndex, string displayName, string fileName, string mountName, X360Storage.DelegateResult onComplete);
displayName is the save file name shown on the dashboard. fileName is the save file name on disc. This name must be unique on every physical media. mountName is the name of the virtual drive the save file is mounted to. i.e. specifying "name" will create a drive accessible via "name:\". Call Unmount with the same mount name once saving/loading is finished. Returns false if a storage operation is already active by checking IsStorageOpActive or if the selected user is not signed-in and Ready. onComplete is never called if this function returns false.