Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Screenshot for Savegames #279475
07/17/09 19:35
07/17/09 19:35
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
hey there

I want to have preview screenshots for my saving system.

I have a Savepoint like in various rpg's like final fantasy.

when i "talk" to this savepoint I want to save the current screen into a temporary BMAP*.
then i call the save menu, the player can choose in which file he wants to save his game and not till then the bmap should be saved under a certain name fitting to the savegame.


the problem is when i use the file_for_screen command, the screenshot is saved at once. thats not what i want. I want to check in which save_state the player wants to save, then i set a variable to that save_state e.g. "3". now , when the player accepts the savingprocess the screenshot should be saved in a file e.g. "prev_3.jpg"

so that when i load the game i can use the screenshot for previewing where the game currently's at

i know theres another command called bmap_for_screen, but it says me "invalid" all the time. and i read in the manual that the file is only readable by the command "bmap_load"

is there any other way to capture a screen, hold it temporary in the cache and saved later on?

cheers.
Roxas

Last edited by Roxas; 07/17/09 19:36.
Re: Screenshot for Savegames [Re: Roxas] #279483
07/17/09 20:01
07/17/09 20:01
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Problem solved


If someone ever should've trouble with something like this:

Code:
...
file_delete("temp0.jpg");
file_for_screen("temp.jpg",0);
wait(1);
...
str_cpy(preview,"prev_");
str_for_num(sstate, save_state);
str_cat(preview,sstate);
str_cat(preview,".jpg");
file_delete(preview);
file_rename("temp0.jpg",preview);
file_delete("temp0.jpg");
...



if there is a temp0.jpg file in the save directory i delete it first than i save a screenshot of the current screen into the save folder called temp0.jpg.

... this is where the save menu will be called and where the player can choose where he wants to save his game.

now i build a string which starts with "prev_"
then i add a number which depends on the savestate which was chosen. and then the extension .jpg

"prev_1.jpg" for example.

first, if there is such a file in the savedir, it will be deleted. then i rename my newly captured temp0.jpg file to prev_[savestate].jpg and if the engine should do a mistake with the temp0.jpg file i delet it again at the end.

all what should be left is a screenshot called "prev_[number of the savestate].jpg" which could be used in the game.

cheers
Roxas


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1