I am making custom save/load menus.
I have been reading through the manual and cannot work out how to make the game save muliple times or how to load it back again.
I have used GetTextBoxText to get a name for the file.
SaveGameSlot needs this input so i am using that but it also asks for a slot to save it to.
Does this mean that i have to do this multiple times each with a different slot number? perhaps using boxes to represent different slot (like playstaion memory cards)
Also the RestoreGameSlot asks for a single integer, do I have to do this multiple times also?
I hope to have this all triggered by pressing a Save or Load button on the gui like in proffesional games.
If it helps this is what i have so far
if (interface == SAVE)
{
if (button == 0){
SetTextBoxText (SAVE, 3, 1,"");
GUIOff (3);}
else if (button == 1){
string input
GetTextBoxText (SAVE, 1, input);
also a Text box and a list box (is this what is required?
thanks alot Gem
Look at this tutorial about Save/Load GUIs in the GAC page:
http://atticwindow.adventuredevelopers.com/tutorials.php?id=1
Hope it helps :)
Thanks that helped a bit (is there a page where tutorials are stored?)
i'm still stuck. my save gui won't save and load gui won't cancel. heres the script.
if (interface == SAVE)
{
if (button == 0){
SetTextBoxText (SAVE, 1,"");
GUIOff (3);}
else if (button == 1){
string text;
int index;
SetTextBoxText (3,1,"");
ListBoxSaveGameList (3,1); //Count how many save games there Are
index=ListBoxGetNumItems (3,1);
if (index>4){
Display ("You have too many save files, you must overwrite a previous saved game");
index=ListBoxGetSelected (3,1);
SaveGameSlot (savegameindex[index],text);
}
else if (index<5){
GetTextBoxText (3,1,text);
SaveGameSlot (index+1,text);
Display ("Your game has been saved.");}
}
if (interface == LOAD)
{
if (button == 1){
GUIOff (4);}
else if (button == 0){
char index;
index=ListBoxGetSelected(4,2);
RestoreGameSlot (savegameindex[index]);}
}
}
see i've done that script i had done to the others to turn the gui off., by the way 0 is cancel button and 1 is save/load button.
Hmm, are you sure the buttons left click option is set to Run Script?
Quoteby the way 0 is cancel button and 1 is save/load button.
Looking at the load code it is the button number 0 that triggers the load process. Be sure it is supposed to.
~Cheers
oh how silly of me, anyway i've sorted out the numbers and is still funny.
It displays your game has been saved but when i try to load it i cannot see it.
what command makes them appear in the list box?
is there another command to make one game delete so i can overwright when i run out of space.?
QuoteIt displays your game has been saved but when i try to load it i cannot see it.
what command makes them appear in the list box?
It's the ListBoxSaveGameList ():
when displaying the LOAD GUI:ListBoxSaveGameList (LOAD, 2); // fill listbox with saved games
GUIOn(LOAD); // display LOAD gui
Quoteis there another command to make one game delete so i can overwright when i run out of space.?
Yep, DeleteSaveSlot(). You can have a button to delete the selected slot:
if (interface == SAVE) {
....
if (button == _DELETE_SAVE_BUTTON) {
int del_slot = ListBoxGetSelected (SAVE,1);
DeleteSaveSlot(del_slot);
}
....
}
~Cheers
Oh i'm having another problem, sorry guys, thanks scorpious
I got my list box to come up with a scrolling bar, i think this means it is on, i can now select different items but they are invisable, the writing does not show up.
It tells me i have too many save games when i try to save but i cannot load them.
Oh and
if (button == 1) //cancil button
GuiOff (3); // my load gui
for some reason doesn't turn off my load gui
QuoteI got my list box to come up with a scrolling bar, i think this means it is on, i can now select different items but they are invisable, the writing does not show up.
ListBoxSaveGameList (LOAD, 2); //fill the listbox with saved games
GUIOn(LOAD); //showing the load GUI
have you done it?
if you have, are you able to load a saved game (with that blank description)?
EDIT:
if (interface == SAVE)
{
if (button == 0){
SetTextBoxText (SAVE, 1,"");
GUIOff (3);}
else if (button == 1){
string text;
int index;
//
SetTextBoxText (3,1,""); // <-- comment that out
ListBoxSaveGameList (3,1); //Count how many save games there Are
index=ListBoxGetNumItems (3,1);
if (index>4){
Display ("You have too many save files, you must overwrite a previous saved game");
index=ListBoxGetSelected (3,1);
SaveGameSlot (savegameindex[index],text);
}
else if (index<5){
GetTextBoxText (3,1,text);
SaveGameSlot (index+1,text);
Display ("Your game has been saved.");}
}
Quote
Oh and
if (button == 1) //cancil button
GuiOff (3); // my load gui
for some reason doesn't turn off my load gui
Check whether button's action is set to Run Script.
~Cheers
Thank you, so much !
Just the loading and the cancil button to go.
The cancil button is set to the right one (button ==cancil), thats done, the button on click function is set to run script the gui i've set to turn off is the right one. I've chacked a dozen times, i can't see anything wrong with it. Oh and it is under the correct if gui == load thingy.
I'll work on the loading and try again later.
Try putting a Display("blah blah"); command just before the GUIOff. Thereby you'll know whether your gui-off script is running at all.
I tried that and found that it is not working at all, how odd.
if (interface == LOAD){
{
if (button == 0){
Display ("something");
GUIOff (4);}
else if (button == 1){
index=ListBoxGetSelected(4,2);
RestoreGameSlot (savegameindex[index]);}
heres my scrpt for the load gui
Please post the whole interface_click function :P