MultiPlayer Tutorial Part IX

In Part IX we will examine the ingame ingame, instart and inaddbot menus to see any special features they may contain.

The ingame Menu

This menu is the first menu opened when you press the ESC key while playing the game. Like any ingame menu it does not have to be set to fullscreen and can use the rect command to set the window area. Because this is a multiplayer game we won't make our ingame menus to fill the whole screen, so we can see what is happening with the game.

The ingame menu consistes of the background item, which provides a graphic background for the menu, and a number of button items, used to perform various tasks such as quitting the game or opening other menus. These button items are as follows.

The joinbutton item is used to open another ingame menu that will allow us some options for joining the game. It's action script closes this menu and opens the instart menu.

The botbutton item is used to open another ingame menu to allow us to add bots to the game. Since bots can not be added to a single player game we check if we are in a single player game using the cvarTest "ui_singlePlayerActive" command and disable this item, using the disableCvar { "1" } command, if it is true. This item's action script closes this menu and opens the inaddbot menu.

The setupbutton item is used to open a menu allowing us to change the setup of the system. It's action script closes this menu and opens the insetup and the inplayer menus. The reason we open two menus here is due to the use of overlay menus by the insetup menu. This is explained more fully in the section that deals with the non-ingame setup menu.

The controlbutton item is used to open a menu allowing us to change the configuration of the controls. It's action script closes this menu and opens the incontrols and inlook menus. The reason we open two menus here is due to the use of overlay menus by the incontrols menu. This is explained more fully in the section that deals with the non-ingame controls menu.

The infobutton item is used to open a menu showing the details about the server we are currently on. It's action script closes this menu and opens the inserverinfo menu.

The restartbutton item is used to restart the game we are currently playing. It's action script accomplishes this by running the exec "map_restart 0" command and then returning to the game with the uiScript "closeingame" command.

The resumebutton item is used to allow us to close out the menu system and return to playing the game. It's action script does this using the uiScript "closeingame" command.

The leavebutton item is used to quit the game and reopen the non-ingame main menu. It's action script uses the uiScript "leave" command to do this.

The quitbutton item is used to open a popup menu that allows us to exit the program completely. It's action script opens the inquit popup menu so we can confirm our desire to quit the program.

 

The instart Menu

This menu is used when we wish to join a team, switch teams or become a spectator. It is opened from the JOIN button in the ingame menu. Like any other ingame menu this is not a fullscreen menu and the background item provides the graphical background. Other than this, the menu consists of four button items.

The joinredbutton item is used when we wish to join the Red team. It's action script uses the exec "cmd team red" command to accomplish this. Since the exec command executes the following string as if it was typed at the console, this is the same as typing cmd team red at the console. It then closes the menu using the uiScript "closeingame" command.

The joinbluebutton item is used when we wish to join the Blue team. It's action script uses the exec "cmd team blue " command to accomplish this. Since the exec command executes the following string as if it was typed at the console, this is the same as typing cmd team blue at the console. It then closes the menu using the uiScript "closeingame" command.

The jointeambutton item is used when we wish to join the smallest/loosing team. It's action script uses the exec "cmd team free " command to accomplish this. Since the exec command executes the following string as if it was typed at the console, this is the same as typing cmd team free at the console. It then closes the menu using the uiScript "closeingame" command.

The spectatebutton item is used when we wish to be a spectator in the game. It's action script uses the exec "cmd team spectator " command to accomplish this. Since the exec command executes the following string as if it was typed at the console, this is the same as typing cmd team spectator at the console. It then closes the menu using the uiScript "closeingame" command.

 

The inaddbot Menu

This menu is used when you want to add bots to the game. It is only active when the game is not a single player team game. Like any other ingame menu this is not a fullscreen menu and the background item provides the graphical background.

The botname item uses the ownerdraw UI_BOTNAME command to allow you to step through the list of bots that are avalible to be added to the game. The bots that are avalible depends on the game type. See the Adding Bots to the Game section for more details.

The botteam item is used to assign the bot to a team. It uses the ownerdraw UI_REDBLUE command to allow you to choose between Red or Blue for the team. Since the team is only valid in a team game, we check the game type using the cvarTest "g_gametype" command and use the disableCvar { "0" ; "1" } command to disable this item if the game type is not a team game.

The botskill item is used to set the skill level of the bot. It uses the ownerdraw UI_BOTSKILL command to allow you to step through the different skill levels. The bot skill level does not have to match the skill level of the game when they are added using this menu.

The addbutton item is a button item that is used to actually add the bot to the game. It's action script executes the uiScript addBot command to do the deed. It then cloes the menu and returns to the game using the uiScript closeingame command.

 

Part X : Inserverinfo, Insetup and Incontrols 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