Advertisement
Dekita

save data req

Nov 28th, 2012
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #
  2. # SNIPPET TO SAVE CUSTOM ACTOR DATA INTO SAVE FILES .
  3. # This is HIGHLY reccommended to use if using any of the following scripts...
  4. #
  5. # Evolutions,
  6. # Pokémon Capture,
  7. #
  8. # If you choose to N0T use this then the chances of your save games remembering
  9. # your party members is very very slim (e.g no fucking chance) ^_^
  10. #
  11. #==============================================================================
  12. module DataManager
  13. #==============================================================================
  14.  
  15. def self.save_game_without_rescue(index)
  16. File.open(make_filename(index), "wb") do |file|
  17. $game_system.on_before_save
  18. Marshal.dump(make_save_header, file)
  19. Marshal.dump(make_save_contents, file)
  20. Marshal.dump($data_actors, file)
  21. @last_savefile_index = index
  22. end
  23. return true
  24. end
  25.  
  26. def self.load_game_without_rescue(index)
  27. File.open(make_filename(index), "rb") do |file|
  28. Marshal.load(file)
  29. extract_save_contents(Marshal.load(file))
  30. $data_actors = Marshal.load(file)
  31. reload_map_if_updated
  32. @last_savefile_index = index
  33. end
  34. return true
  35. end
  36.  
  37. end # DataManager
  38.  
  39. #===============================================================================#
  40. # http://dekitarpg.wordpress.com/ #
  41. #===============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement