How to realize a way to record / load game with an engraved image of the game?.

Started by Mariano Cirigliano, Fri 10/07/2009 05:23:16

Previous topic - Next topic

Mariano Cirigliano

Hello, my name is Mariano and I am a creator of graphical adventures.
I have a question, how can I make way record / load game with an image of the game?.
I hope that my question is understood since my Englishman is not very good.
Thank you very much. ;D

cosmicr

Hi there if I understand you correctly you want to search for "save game with screenshot"

TerranRich

You have an evil Englishman too? I thought m0ds was exlusively mine.

Sorry. Yes, there is an option in the game's settings, as cosmicr said.
Status: Trying to come up with some ideas...

Mariano Cirigliano

Quote from: cosmicr on Fri 10/07/2009 06:06:43
Hi there if I understand you correctly you want to search for "save game with screenshot"

Hello, thank you very much for his your response. How is it the code of programming or the steps to continuing to achieve it?. Thank you very much again.

Ghost

In "General Settings", section "Save Games", set the option "save screenshots in savegames" to "true".

After that you need a GUI, create one that has
- a button btnSlot1 (to hold that savegame)
- a button btnPreview(to hold the preview image)
- a button btnLoad and a button btnSave

Create on_click functions for all these buttons.

And here's some simple code that works, but isn't very sophisticated...

Top of global script:
Code: ags

DynamicSprite *screenie;
int selectedSlot = 0;


Code: ags

function btnSave_OnClick(GUIControl *control, MouseButton button)
{
    SaveGameSlot(1, "savegame1");
  }
}


Code: ags

function btnSlot1_OnClick(GUIControl *control, MouseButton button)
{
  selectedSlot = 1;
  if (Game.GetSaveSlotDescription(selectedSlot)!=null)
  {
    screenie = DynamicSprite.CreateFromSaveGame(selectedSlot, 128, 96);
    btnPreview.NormalGraphic = screenie.Graphic;
  }
}


Code: ags

function btnLoad_OnClick(GUIControl *control, MouseButton button)
{
    if (Game.GetSaveSlotDescription(selectedSlot) != null)
    {
      RestoreGameSlot(selectedSlot);
    }
    else
    {
      Display("There is no saved game in that lobe."); // ;)
    }
}

Mariano Cirigliano

Quote from: Ghost on Fri 10/07/2009 10:40:44
In "General Settings", section "Save Games", set the option "save screenshots in savegames" to "true".

After that you need a GUI, create one that has
- a button btnSlot1 (to hold that savegame)
- a button btnPreview(to hold the preview image)
- a button btnLoad and a button btnSave

Create on_click functions for all these buttons.

And here's some simple code that works, but isn't very sophisticated...

Top of global script:
Code: ags

DynamicSprite *screenie;
int selectedSlot = 0;


Code: ags

function btnSave_OnClick(GUIControl *control, MouseButton button)
{
    SaveGameSlot(1, "savegame1");
  }
}


Code: ags

function btnSlot1_OnClick(GUIControl *control, MouseButton button)
{
  selectedSlot = 1;
  if (Game.GetSaveSlotDescription(selectedSlot)!=null)
  {
    screenie = DynamicSprite.CreateFromSaveGame(selectedSlot, 128, 96);
    btnPreview.NormalGraphic = screenie.Graphic;
  }
}


Code: ags

function btnLoad_OnClick(GUIControl *control, MouseButton button)
{
    if (Game.GetSaveSlotDescription(selectedSlot) != null)
    {
      RestoreGameSlot(selectedSlot);
    }
    else
    {
      Display("There is no saved game in that lobe.");
    }
}


Hello, thank you very much for his your prompt response. I am going to try to do as you he  says. Later I comment on him if it he gave me proved. Luck and thank you very much.

Mariano Cirigliano

Quote from: marianuchy22 on Fri 10/07/2009 12:23:37
Quote from: Ghost on Fri 10/07/2009 10:40:44
In "General Settings", section "Save Games", set the option "save screenshots in savegames" to "true".

After that you need a GUI, create one that has
- a button btnSlot1 (to hold that savegame)
- a button btnPreview(to hold the preview image)
- a button btnLoad and a button btnSave

Create on_click functions for all these buttons.

And here's some simple code that works, but isn't very sophisticated...

Top of global script:
Code: ags

DynamicSprite *screenie;
int selectedSlot = 0;


Code: ags

function btnSave_OnClick(GUIControl *control, MouseButton button)
{
    SaveGameSlot(1, "savegame1");
  }
}


Code: ags

function btnSlot1_OnClick(GUIControl *control, MouseButton button)
{
  selectedSlot = 1;
  if (Game.GetSaveSlotDescription(selectedSlot)!=null)
  {
    screenie = DynamicSprite.CreateFromSaveGame(selectedSlot, 128, 96);
    btnPreview.NormalGraphic = screenie.Graphic;
  }
}


Code: ags

function btnLoad_OnClick(GUIControl *control, MouseButton button)
{
    if (Game.GetSaveSlotDescription(selectedSlot) != null)
    {
      RestoreGameSlot(selectedSlot);
    }
    else
    {
      Display("There is no saved game in that lobe.");
    }
}


Hello, thank you very much for his your prompt response. I am going to try to do as you he  says. Later I comment on him if it he gave me proved. Luck and thank you very much.

Hello, I have just proved the code that you me sent and though the image is captured, one does not see centered and there are two buttons that I do not understand in order that they are in use. For example, the button: Slot serves to record the game, then in order that there is in use the button Save?.
Well, I hope that I could help since I cannot make it work.
Thank you very much.

Ghost

Yes, the "slot" is the savegame. You need to click it in order to set "selectedSlot" to any value (you can then add a lot of buttons for a lot of savegames, or create a listbox). Once a slot is selected (by clicking it), you can press load (to run RestoreGameSlot) and save (to run SaveGameSlot).

I don't quite get what's your problem... can you rephrase a bit? What's your native language, maybe it's more comfortable for you to describe your problem in that? (I'm german, but we're very multilingual here).

If it is any help, I can send you a small "example game" where you can see the code in action. Sometimes that's the best way to learn things.

Mariano Cirigliano

Quote from: Ghost on Fri 10/07/2009 13:00:44
Yes, the "slot" is the savegame. You need to click it in order to set "selectedSlot" to any value (you can then add a lot of buttons for a lot of savegames, or create a listbox). Once a slot is selected (by clicking it), you can press load (to run RestoreGameSlot) and save (to run SaveGameSlot).

I don't quite get what's your problem... can you rephrase a bit? What's your native language, maybe it's more comfortable for you to describe your problem in that? (I'm german, but we're very multilingual here).

If it is any help, I can send you a small "example game" where you can see the code in action. Sometimes that's the best way to learn things.

Hello, I am from Argentina and do not manage in English well. I speak Spanish. If it he can send a game of sample I will be grateful for it to him you.
My mail is: mariano_elartecriollo@hotmail.com
Thank you very much!.  :)

Ghost

Here it is- maybe someone else can get some use out of this too ;)
http://www.mediafire.com/download.php?gmwfbgmmzzz

The code's fully documented, and I kept things simple. Let me know if you get it to work.
It's the full game folder- unzip, load it into AGS, and then run it.

Here's a screenie:


Mariano Cirigliano

Quote from: Ghost on Fri 10/07/2009 13:39:38
Here it is- maybe someone else can get some use out of this too ;)
http://www.mediafire.com/download.php?gmwfbgmmzzz

The code's fully documented, and I kept things simple. Let me know if you get it to work.
It's the full game folder- unzip, load it into AGS, and then run it.

Here's a screenie:



Hello, it he does not leave me to prove it, I cannot load the file that you me sent.
Me a mistake appears saying that it is not the same AGS's version. You that version has?.
Regards.

Ghost


Mariano Cirigliano

Quote from: Ghost on Fri 10/07/2009 14:01:22
I'm using 3.1.2 SP1, the last (?) official release. You can get it directly here: http://www.adventuregamestudio.co.uk/acdload.htm

Might I explain use like stepwise the file that he me sent?.
How the inserted thing in AGS?.
Thank you.

Mariano Cirigliano

Quote from: Ghost on Fri 10/07/2009 14:01:22
I'm using 3.1.2 SP1, the last (?) official release. You can get it directly here: http://www.adventuregamestudio.co.uk/acdload.htm

I it could load now that I unloaded AGS's new version. Thank you very much for everything. I wait to learn to use it since I am accustomed to the most ancient version. A question, is programming the same in the ancient version that in the new one?.
A greeting.

Ghost

The scripting has changes a bit since 3.0, so if your version was 2.72 or even below, there will be some changes. Nothing too much though, and the manual has its own section that describes the changes. Best of luck and happy game-making!


Khris

Marianuchy22, there's a "Reply" link below the bottom post, no need to always quote the complete previous one.

SMF spam blocked by CleanTalk