I´m searching a script that shuts screenshots with a event (for example: call script: screenshot("picture1")). That screenshot should be stored in the matrialbase of the game (Graphics/Pictures) so you may show it with the event command "Show picture". (hope the explanation was clear)
Do somebody know if there is allready such a script? If not, is it possible to make one or is it to much work?
You can use a slightly modified version of the screen capture method in the Transition Effects script to actually create the pic. Have it store in the Graphics/Pictures directory. It can then be loaded using a picture command. Be careful making too many. They will probably be about 1 MB each, so the can start adding up quick in total disk space, and RAM once they are cached using the pic command.
Can't you reload the cache with scripts, and then also reload the needed things?
Images stay in the cache until they are disposed. Disposing the sprite that is using the bitmap will not free it. Your best bet would be not to use the cache at all, depending on how often you plan on using the image. Disposing images from the cache is a pain in the ass, unless you use RPG::Cache.clear, but that will clear everything, which usually will be something you do want to do.
I've tried using RPG::Cache.clear, but it broke my game. It was between switching of scenes so there couldn't be any references to the bitmaps left, yet it caused problems so I refrained from using it in the end.
The custom resolution script I just wrote is the first time that I have ever felt the need to use it, and that is only in DEBUG after the cached data files have been created, and it just iterated through every map and autotile used in the game. It probably wasn't even needed there, since the user can simply exit the game and start it back up without the pre-caching on.
How bout game guy's snapshot script? Get the pic then move it to pictures game folder
screenshot.dll needed for script (http://'http://decisive-games.com/ggp/scripts/screenshot.dll')
#===============================================================================
# Snapshot
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# 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
#
# Instructions:
# Place screenshot.dll in your projects folder.
# Get the dll here if you need it
# http://decisive-games.com/ggp/scripts/screenshot.dll
# Make a folder in your projects folder called Snapshots
#
# Go down to the line where it says SnapShot_Key = Input::A
# You can change Input::A to any of the following
# Input::A - Usually the Shift Key
# Input::B - Usually the X or Escape key
# Input::C - Usually C, Enter, or Space
# Input::X - Usually the A Key
# Input::Y - Usually the S Key
# Input::Z - Usually the D Key
# Input::L - Usually the Q Key
# Input::R - Usually the W Key
# Input::SHIFT
# Input::CTRL
# Input::ALT
# Input::F5
# Input::F6
# Input::F7
# Input::F8
# Input::F9
#
# To take a snapshot with a script call use this
# GameGuy.snap thats it!
#
# Compatibility:
# Not tested with SDK. (Should work though)
# Will work with anything.
#
# Credits:
# game_guy ~ For making it
# Google ~ Searching up Win32Api tutorials
# Screenshot.dll ~ Whoever made this, made this script possible
#===============================================================================
module GameGuy
SnapShot_Key = Input::F8 # Shift Key
def self.snap
snp = Win32API.new('screenshot.dll', 'Screenshot', %w(l l l l p l l), '')
window = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
ini = (Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p),
'l')
game_name = "\0" * 256
ini.call('Game', 'Title', '', game_name, 255, '.\Game.ini')
game_name.delete!('\0')
win = window.call('RGSS Player', game_name)
dir = Dir.new("Snapshots/")
count = 0
dir.entries.each {|i| count += 1}
file_name = "Snapshots/snap_#{count}.png"
snp.call(0, 0, 640, 480, file_name, win, 2)
end
end
module Input
class << self
alias gg_update_input_snapshot_lat update
end
def self.update
if Input.trigger?(GameGuy::SnapShot_Key)
GameGuy.snap
end
gg_update_input_snapshot_lat
end
end
QuoteYou can use a slightly modified version of the screen capture method in the Transition Effects script to actually create the pic. Have it store in the Graphics/Pictures directory. It can then be loaded using a picture command.
Would it also work in the final game if you compress it with "create Encrypted Archive". Because than the graphic folder is replaced by a file.
And would the picture be saved with the save file so that you can load it later in the game?
If both are possible its just a perfect solution for me. But one thing remains. I have no idea how to modifie the capture method. I dont even find the Transition in the script.
I would be very thankful if someone could give me a instruction that is "noscripter"-friendly.
Thanks for the hint. :)
edit:
@ BlazEnigma: the game had to move the picture by themself. I cant ask the player for moving a picture in the right folder. It should be done automatically.
(http://images.icanhascheezburger.com/completestore/2008/12/3/128728169661355659.jpg)
I remember there being away to move files with ruby commands, but i dont remember what the code is...
Then again you could also change the script so that it saves in the picture directory
Change these lines in gg's script:
dir = Dir.new("Snapshots/")
count = 0
dir.entries.each {|i| count += 1}
file_name = "Snapshots/snap_#{count}.png"
to...
count = (Dir.entries('Graphics/Pictures') - ['.', '..']).size
file_name = "Graphics/Pictures/Snap_#{count}.png"
I haven't tested this, but it should work to have the pictures save in the Graphics/Pictures directory.
Thanks. But where can find the screenshot.dll? The link doesn´t work and the site in introduction doesn´t have the dll (at least i don´t find it). Google shows only "Websites Screenshot DLL" and you have to pay for it.
Sorry for bother you but i realy can´t find it.
You can find it in Fantasist's Transition Pack here:
http://forum.chaos-project.com/index.php/topic,1390.0.html (http://forum.chaos-project.com/index.php/topic,1390.0.html)
I also uploaded a copy for my Custom Resolution script. Here's the link for that. This is just the DLL:
http://www.sendspace.com/file/aiirus
Thank you very much. :D