Save F5/F7

Started by Peegee, Fri 01/12/2023 08:28:50

Previous topic - Next topic

Peegee

Hello, I would like to make a simplified backup.

There is by default the F5 key that leads to a GUI, but I want to avoid it going through there. I would just like it to save directly, on one location, with just a reminder on the game screen "Saved Game". And that it loads directly when we press F7.

Anyone know how to do that?

Peegee

I found a simple solution:

SaveGameSlot(1, "save game");
RestoreGameSlot(1);

Only remains to find how to display a reminder on the screen "Game saved".

RootBound

Just put
Code: ags
Display("Game saved!");
as the line right before SaveGameSlot (otherwise it will display after a save game is loaded as well).
They/them. Here are some of my games:

Peegee

"Display", yes, but it's a very ugly display... How to put only the text in transparent, and not necessarily in the middle?

RootBound

DisplayAt allows you to put the text wherever you want:

https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Message.html#displayat

You can also change the default text window by creating your own GUI and then in the General Settings list selecting "Text Windows use GUI"

https://adventuregamestudio.github.io/ags-manual/EditorGUI.html#customized-text-windows

Honestly, just browsing the manual's index and clicking on whatever looks useful has yielded a lot of insight for me since I started.  :)
They/them. Here are some of my games:

Peegee

Ok, thanks, I think I'll go for this solution.   PG

Khris

There are various ways to display a message like that. A GUI is the most suitable, because you can easily fade it in and out, easily put text on it using a label and you can use an arbitrary sprite as background image.

eri0o

#7
There is also the event eEventRestoreGame which can be usually to conditionally automatically skip something - like the Game Saved message that you will show later.

In 3.6.1 there is also the event eEventGameSaved which can be used to be the thing that actually shows it - or not.

(And a bit early in development, but I started a module for messages that disappear that may or may not be useful)

SMF spam blocked by CleanTalk