PDA

View Full Version : Ending a game...



delta
18-02-07, 03:55 PM
ok i'm stuck with a bit of coding, i want to call the end of game menu, with the options to restart, goto the website, or exit, as in Emerald Eye. what i want to know, is there a pre-set menu hidden somewhere in the depths of the scripts, or do i have to write my own?

if there is, can someone tell me where it is? cause i've just spent the last 20 mins looking for it! :p

it's not been a complete waste of time tho, i've found other stuff too....!

Peter
18-02-07, 08:14 PM
The end dialog your on about is contained within dialogs.gs. In the default template it is called OpenDialogFinish, here is the code from the emerald eye for a finish dialog.../////////////////////////////////////////////////////////////////////////////////
// Opens the Finish dialog
// Uses DialogFinish function for dialog creation.
/////////////////////////////////////////////////////////////////////////////////
func OpenDialogFinish()
{
GamePause(1);
select = RunDialogSelect( gs_fid("DialogFinish"), 3, 0, 1 );
if(select==0)
{
gs_shell("http://www.theosgrotto.co.uk");
GameCommand(CMD_START);
}
if(select==1)
{
GameCommand(CMD_START);
}
else
if(select==2)
{
GameCommand(CMD_EXIT);
}
GamePause(0);
}

// IN: int(default selection)
// Dialog creation function used by OpenDialogFinish.
func DialogFinish( select )
{
text = "{a:center}GAME COMPLETED\n\n{c:0xff0000}";
if(select==0) text += "{f:1}VISIT WEBSITE{f:0}\n"; else text += "VISIT WEBSITE\n";
if(select==1) text += "{f:1}RESTART {f:0}\n"; else text += "RESTART \n";
if(select==2) text += "{f:1}EXIT {f:0}"; else text += "EXIT ";
DialogPush();
DialogSetText(text);
DialogSetColor(COLOR_MENUBORDER);
DialogFitCenter();
}

delta
18-02-07, 08:38 PM
oh my god how did i miss that?!?

the dialogue file was the one i looked in the most, but i completely missed that....!

thank you very much! :tup:

delta
18-02-07, 09:53 PM
wooo i now have a game that can be completed! i might do a complete run-through later this week, see how long it takes me.....

EDIT: i forgot i haven't placed all the diamonds yet... ah well, do that, THEN do a run through... :p

thanks again peter for drawing my attention to that bit of code! :tup:

xelanoimis
19-02-07, 08:23 PM
Nice!
About the total count of diamonds remember to set the MAXCOINS define, from def.gs It is used by the default template to show a different message when the last coin/diamond is picked: "YOU HAVE FOUND ALL THE COINS"
But, since you use diamonds instead of coins, you probably have seen and edit the messages and the MAXCOINS too :)
Good luck with the game, and when the beta is ready, I can look over it give you some advices if necessary.

delta
19-02-07, 10:18 PM
yeah thanks alex!

it annoyed me that it told me i'd found all the coins after the 4th one (i've used a copy of the tutorial docs), so i found the code and changed both the amount of diamonds (MAXCOINS) and the text it displays...

i'm *hoping* to have it ready by the end of this week.... but that's probably just a pipedream, and it may take a bit longer.

one thing that is annoying me is how i change the window title? it still says DizzyAGE Default Template.

i'm guessing that as i can't find it in any script file, it's changed when the game is packed....

on the other hand, it could be that i've just missed something in the scripts again!

Peter
20-02-07, 07:35 AM
one thing that is annoying me is how i change the window title? it still says DizzyAGE Default Template.

To change the name open handlers.gs and on line 17 you will find


GameSetName("DizzyAGE Default Template");


just change the text in the quotation marks. It is a simple as that! :v2_dizzy_clapping:

delta
20-02-07, 06:12 PM
gahhh! thank you!

the words 'needle' and 'haystack' spring to mind.... :p