Creating the Main Menu

From The Official Visionaire Studio: Adventure Game Engine Wiki

Introduction

Menu creation in Visionaire Studio is probably one of the most difficult & time consuming things, you will come across - regardless of what glenfx said about it being easy, in his tutorial. The reason being is that there are a lot of things to consider when developing the menu for your game, like: do you want to create a professional menu like those seen in commercial games? or are you just wanting to create something simple & basic? do you want it to remember the players configuration choices for each session? do you want to create an achievement or bonus content system? or maybe both? do you want to create a bug free save, load & delete system? how about an interactive button/icon that pops open the players default web browser & loads an url of your choice? or how about true new game &/or resume game buttons? what about confirmation boxes that pop up after clicking the quit, save, load or delete buttons? the list is endless & thus you can see why creating a game menu takes time to develop/plan.


I will try to cover as much of the menu creation as possible in this page, but please bear in mind that there are multiple ways to go about creating your menu & well pretty much everything else in Visionaire Studio can be approached in this fashion. Also I would like to point out that this is a guide for creating a menu of commercial caliber & should you want something a little simpler, then you should check out Glenfx's menu tutorial, here.


Initial Setup

First things first: you want to click on the scene tab & then create a new scene menu, which we will use to add our option buttons to. Next you want to click on the new menu scene, rename it to something that makes sense to you & then you want to click on it's properties tab & add a background image to it; remember that the background image will define the width & height of the menu, so as a general rule it should be the same height & width as your default game resolution - unless, of course, you are planning on making a scrollable menu scene. You also want to select the mouse cursor to be used for the menu & the background music, if you plan on adding some.

Additional Information

It is possible to create your menu on a single menu scene or you can break it down into multiple menu scenes. It is common practice to add the save game menu to it's own menu scene.


New Game/Resume Game Buttons

Both the new game & the resume game buttons require the use of if queries & the quicksave system to check if the game should be resumed from the scene of the current character or by loading a previously saved game. I will quickly explain how to setup both of these buttons.


You need to decide which quicksave slot you want to use for your new game option & which you want to use for your resume game option; in general I would recommend using quicksave slot #0 for the new game option & quicksave slot #1 for the resume game option.* What you want to do is create an at begin of scene action on your first playable scene & add an if query inside of this: condition, if, value > if savegame/autosave exists...

if autosave #0 exists
else
 execute autosave #0
end if

This query will create an autosave on the first time you launch a new game; providing the autosave doesn't already exist. This means we can now run an if query inside of the new game button. Inside of the new game buttons actions tab you want to create a left click action in which we will add an if query...

if autosave #0 exists
 load autosave #0
else
 change to scene of character 'current character'
end if

This checks if autosave #0 exists & if it does then it will load from autosave #0 & if it doesn't exist then it will change to the scene of the current character; current character being the currently assigned playable character.


Creating the autosave system for your resume game option is a little more time consuming as you need to add an action inside of an at begin of scene & at end of scene action for every playable scene; playable scene being scenes that your character can interact with. You also want to create a condition (in_session) that determines that the game is currently in session.

execute autosave #1
change condition 'in_session' to true

This will automatically save the game every time a playable scene is opened, closed or you open a menu scene which means that the players current progress will always be saved. You could alternatively have it save after important actions, dialog choices or every x amount of time passed. Back to the tutorial. Next you want to create the if query for the resume game button in exactly the same method, you used for the new game button.

if condition 'in_session' is true
 change to scene of character 'current character'
else
 if autosave #1 exists
  load autosave #1
 end if
end if

Here we are checking if a game is currently in session (by default it will be set as false on game launch) & if so we change to scene of the currently playable character & if not then we load from autosave #1; providing it exists.

Additional Information

* Coincidentally, this slot will/can also be used for the autosave system.