MultiPlayer Tutorial Part II

In Part II we will examine the non-ingame main, credits, quit and play menus to see any special features they may contain.

The main Menu

The important feature of this menu's onOpen script is the setcvar "ui_q3model" 1 command. The Freeze Tag mod is a Quake 3 mod, not a Team Arena mod, so it uses the Quake 3 player models. By setting this cvar to 1 we ensure that the Quake 3 player models are used throughout the menu system and in the game.

One thing done only in this menu is to preload the player model. This avoids a loading delay the first time the model is drawn.

      itemDef
{
name modelselection
ownerdraw UI_PLAYERMODEL
rect 0 0 0 0
decoration
visible MENU_TRUE
}

This is special case of the ownerdraw UI_PLAYERMODEL command. If the item window area is set using rect 0 0 0 0 then the model will be loaded but not drawn. The accomplishes the model preload we wanted. This item should be included in the main menu of any scripted menu system that will display the player model at some point.

This menu contains five buttons, PLAY, SETUP, CONTROLS, CREDITS and QUIT, which are used to access other menus. These button items are standard shader items that display a different graphic when the mouse is over them and revert to the original graphic when the mouse leaves. The differences between the buttons is in their action command.

The PLAY button closes the main menu and opens the play menu. The SETUP button closes the main menu and opens two other menus, the setup and the player menus. This is required because the setup menu uses overlay menus and the first overlay menu (play in this case) must be opened by the calling menu. You cannot open the first overlay menu from the onOpen command of the setup menu. The CONTROL button also closes the main menu and opens two other menus, in this case the controls and look menus. The reason for this is the same as for the SETUP button - the controls menu uses overlay menus and the first overlay menu must be loaded here.

The CREDITS button and the QUIT button simply open another menu, the credits and the quit menus respectively. These menus are popup menus and are displayed overtop of the main menu, so we cannot close the main menu or display problems will arise.

 

The credits Menu

This menu is a popup menu, meant to be displayed overtop of another menu. For that reason, we include the popup command in the Overall Menu Information section. The background for the menu is displayed using the background item, which is a shader item displaying a graphic. The actual credits are displayed by the two text items, which place text inside the background box. The backbutton item is a button used to close this menu and open the main menu again. This is the way a popup menu must be used - when it is closed the menu that opened the popup must be opened itself. Since the credits menu is only opened from the main menu, when we exit this menu we open main, the calling menu.

 

The quit Menu

This menu is another popup menu, opened only from the main menu. For that reason, we include the popup command in the Overall Menu Information section. The background for this menu is provided by the background item, which displays a graphic. There are two button items in this menu, one to allow quiting and one to cancel the exit. The acceptbutton item is used to quit the program and it's action script executes the uiScript "quit" command to do this. The cancelbutton item is used to cancel quitting and it's action script closes the quit menu and opens the main menu.

 

The play Menu

The play menu is opened from the main menu and is a fullscreen menu. It contains four buttons that allow you to select another submenu that is connected to playing a game. These buttons are SINGLE PLAYER, MULTIPLAYER, MODS and DEMOS. Each of these button items are standard shader items that display a different graphic when the mouse is over them and revert to the original graphic when the mouse leaves. The differences between the buttons is in their action command, which closes the play menu and opens another menu. There is also a BACK button whose action command closes the play menu and opens the main menu.

 

Part III : Multi, Demo, Mod, Connect and Error_Popmenu Menus

 

[Part I] [Part II] [Part III] [Part IV] [Part V] [Part VI] [Part VII] [Part VIII] [Part IX] [Part X]

 

Return to Home Page