Snapshot

Snapshot


Intro
Ever wanted to take screenies or snapshots ingame? While there are other methods of doing that, this one is by far the easiest. With a simple button press or script call, it'll take a screenshot of the game for you and save it in a folder.
Also useful for beta testing. Your testers can snapshot bugs or errors in mapping or stuff like that.

Features
  • Take picture with button press or script call
  • Customizable Button to press
Screenshots
Here's how well the pictures come out. No windows borders or anything.
Content Hidden Spoiler
Image


Demo
Download

Script
You'll also need the screenshot.dll for this script to function correctly.
  1.  
  2. #===============================================================================
  3. # Snapshot
  4. # Author game_guy
  5. # Version 1.0
  6. #-------------------------------------------------------------------------------
  7. # Intro:
  8. # Ever wanted to take screenies or snapshots ingame? While there are other
  9. # methods of doing that, this one is by far the easiest. With a simple button
  10. # press or script call, it'll take a screenshot of the game for you and
  11. # save it in a folder.
  12. # Also useful for beta testing. Your testers can snapshot bugs or errors in
  13. # mapping or stuff like that.
  14. #
  15. # Features:
  16. # Take picture with button press or script call
  17. # Customizable Button to press
  18. #
  19. # Instructions:
  20. # Place screenshot.dll in your projects folder.
  21. # Get the dll here if you need it
  22. # http://decisive-games.com/ggp/scripts/screenshot.dll
  23. # Make a folder in your projects folder called Snapshots
  24. #
  25. # Go down to the line where it says SnapShot_Key = Input::A
  26. # You can change Input::A to any of the following
  27. # Input::A - Usually the Shift Key
  28. # Input::B - Usually the X or Escape key
  29. # Input::C - Usually C, Enter, or Space
  30. # Input::X - Usually the A Key
  31. # Input::Y - Usually the S Key
  32. # Input::Z - Usually the D Key
  33. # Input::L - Usually the Q Key
  34. # Input::R - Usually the W Key
  35. # Input::SHIFT
  36. # Input::CTRL
  37. # Input::ALT
  38. # Input::F5
  39. # Input::F6
  40. # Input::F7
  41. # Input::F8
  42. # Input::F9
  43. #
  44. # To take a snapshot with a script call use this
  45. # GameGuy.snap thats it!
  46. #
  47. # Compatibility:
  48. # Not tested with SDK. (Should work though)
  49. # Will work with anything.
  50. #
  51. # Credits:
  52. # game_guy ~ For making it
  53. # Google ~ Searching up Win32Api tutorials
  54. # Screenshot.dll ~ Whoever made this, made this script possible
  55. #===============================================================================
  56. module GameGuy
  57.   SnapShot_Key = Input::A # Shift Key
  58.   def self.snap
  59.     snp = Win32API.new('screenshot.dll', 'Screenshot', %w(l l l l p l l), '')
  60.     window = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
  61.     ini = (Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p),
  62.       'l')
  63.     game_name = "\0" * 256
  64.     ini.call('Game', 'Title', '', game_name, 255, '.\Game.ini')
  65.     game_name.delete!('\0')
  66.     win = window.call('RGSS Player', game_name)
  67.     dir = Dir.new("Snapshots/")
  68.     count = 0
  69.     dir.entries.each {|i| count += 1}
  70.     file_name = "Snapshots/snap_#{count}.png"
  71.     snp.call(0, 0, 640, 480, file_name, win, 2)
  72.   end
  73. end
  74. module Input
  75.   class << self
  76.     alias gg_update_input_snapshot_lat update
  77.   end
  78.   def self.update
  79.     if Input.trigger?(GameGuy::SnapShot_Key)
  80.       GameGuy.snap
  81.     end
  82.     gg_update_input_snapshot_lat
  83.   end
  84. end
  85.  
Expand to see the code.

Instructions
In the script. Its recommended to place this above main but below everything else. It shouldn't cause issues with anything.

Compatibility
Not tested with SDK. (Should work anyways)
Should work with everything.

Credits
  • game_guy ~ For making it
  • Google ~ Searching up Win32Api tutorials
  • Screenshot.dll ~ Whoever made this, made this script possible

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=71269