Adventure Game Studio

Community => General Discussion => Topic started by: limeTree on Mon 29/12/2008 19:08:10

Title: taking screenshots
Post by: limeTree on Mon 29/12/2008 19:08:10
Didn't know where to put this so i put it here.

Does anyone know have to take game screenshots on ags,i tryed loking at the index,it just says something about a code wich i did't cope right.
Title: Re: taking screenshots
Post by: Ryan Timothy B on Mon 29/12/2008 19:58:35

if (keycode==434) SaveScreenShot("scrnshot.pcx");  // F12


In other words... Press F12
Title: Re: taking screenshots
Post by: limeTree on Mon 29/12/2008 20:54:25
nope,doesnt work,tryed along with all the other buttons

is that code already in my script or i have to put it there?
and i which script?
Title: Re: taking screenshots
Post by: Ryan Timothy B on Mon 29/12/2008 21:13:44
It's in the Globalscript in the function  on_key_press


function on_key_press(int keycode) // called when a key is pressed. keycode holds the key's ASCII code
  {
  if (IsGamePaused()==1) keycode=0; // game paused, so don't react to keypresses
  if (keycode==17) QuitGame(1); // Ctrl-Q
  if (keycode==363) SaveGameDialog(); // F5
  if (keycode==365) RestoreGameDialog(); // F7
  if (keycode==367) RestartGame(); // F9
  if (keycode==434) SaveScreenShot("scrnshot.pcx");  // F12
  if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
  if (keycode==22) Debug(1,0); // Ctrl-V, version
  if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
  if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
  }


Sorry, and yes.  It should already be in your script.
It saves it in your documents folder, in My Saved Games, and the folder the game is called.
This is where it goes if the game is made with version 3 or higher.  Not sure if it does this with the other versions of ags.  Just check the documents folder either way.
Title: Re: taking screenshots
Post by: limeTree on Mon 29/12/2008 23:59:18
yes,it works!!

the problem was i tryed to take the screeshots during the action,during the run of the script
and i guess since the command comes from the script it can't react
we can get screenshots only when you are in control of the character
too bad...
i guess i'll use some seperate program to catch some more action  ;D
Title: Re: taking screenshots
Post by: Khris on Tue 30/12/2008 00:47:16
Just run the game without filters in a window and press the PrintScreen button on your keyboard.
The paste (press Ctrl-V) the screenshot into a graphics program, Paint will do I think.
Title: Re: taking screenshots
Post by: Ryan Timothy B on Tue 30/12/2008 01:20:09
That's all I do.  It's faster, and easier.
And if you find out the image wasn't good enough of a shot after you've pasted, you'd still have the game playing in the window. :P