Title/menu screen?

Started by Gs92, Sun 24/08/2008 16:48:27

Previous topic - Next topic

Gs92

Hi all, I'm about to start out my second AGS game and I have a small problem.

I'd like to make a "main menu" (a menu where you can choose start game/load game etc) for my game, and I dont really know how.

I started by making a room, and adding the background I wanted for the menu and changing the character view so that you can't see him. From here I dont really know what to do :P I mean, I figured I gotta do like hotspots as buttons for the "start game/load game/quit game" buttons but it's the script I need help with.
Also, if possible i'd like to add a title song while you are in the menu.

Appreciate any help.
Thanks

Buckethead

It's quite simple really:

new game: Player.changeroom(2,160,160);<-----just change rooms to the room where your game begins.
Load game: This kinda depends on wether you use the default save/load system or that you have your own gui. I'll just assume you have the default one: RestoreGameDialog();
Quit game: Quitgame(1); <---- the 1 states that a window pops up to ask you if you really want to quit. If you want to make the game quit at once just use a 0.

This should do for a basic start up screen. If you want some more fancy stuff, just aks!

Makeout Patrol

For the music, you can either modify the value in the room settings or do it with script. The easiest way is probably to go to the room's window in the editor, and look in the menu on the bottom right (by default); there will be an option that reads something like "play music on room load" or something like that. Change the value to the number of the song you want to play (remember that all of the music in your game needs to be placed in the music folder and renamed musicX.ABC where X is the number of the song and ABC is its extension (probably .mid, .ogg, .mp3, or .wav).

If you want to do it with script, click the lightning bolt icon, click in the 'Before fade in' or 'on room load' or whatever it is field, and click on the '...' button. This will insert a room_load() function into your script and take you to it. Add this line:

playMusic(X);

again, where X is the number of your song.

Keep in mind that I don't have the documentation handy, so some of the buttons or function names or whatever might be incorrect.

Lt. Smash

For the menu you just create a new gui, make some buttons on it, double click them and write the code Buckethead posted in the new functions.

Gs92

Hey thanks for the replies. The menu thingy worked out fine for me, the only thing that's bugging me is how to put the music in. I did what you said; changed the name of the musicfile to music1.mp3 and added it to the "Music" folder in the folder of my game, but the music does not play when i test the game. Help please :P

Also, how do I make the game full-screen and how do I make it an .exe-file? (so I don have to start it up via AGS all the time)

Thanks!

Khris

Make sure it isn't called "music1.mp3.mp3".

As for the other questions, build the game (select that option from the menu), then look inside the Compiled folder. Run the winsetup.exe to play it full-screen.

Gs92

#6
Thx for that, though I'm still having trouble with the music thingy, I checked the name and its right. Please help me it's a pretty vital thing for this game :P

EDIT:
Sorry bout that, it was the name after all xD Thx so much for ur help everyone!

Gs92

#7
Hi again :P everything worked out and all, just one more button i'd like in my menu.

You know the default menu? (the question sign on the "gIconbar") well when you go in there and press "save" you get up a little window you can type in the name of your game and click save.
I've been trying to make my save game button on my menu so that window pops up when you click it. Know how I mean?

Also, how do I remove the all the cursors except the mousepointer for this room?

Khris

1. http://www.adventuregamestudio.co.uk/manual/SaveGameDialog.htm

2. In the menu room's before fade-in event, add "mouse.Mode = eModePointer;"
In the room's "Leaves room" event, add "mouse.Mode = eModeWalk;"

Inside on_mouse_click, look for:
Code: ags
  else if (button == eMouseRight || button == eMouseWheelSouth){
    // right-click our mouse-wheel down, so cycle cursor
    mouse.SelectNextMode();
  }


Replace it with:
Code: ags
  else if (button == eMouseRight || button == eMouseWheelSouth){
    // right-click our mouse-wheel down, so cycle cursor
    if (player.Room != 1) mouse.SelectNextMode();
  }

(Assuming that the menu room is room 1.)


SMF spam blocked by CleanTalk