MissionsMissions are objects that incorporate information about the objectives Player has to pursue.
When you want to create a new mission you can create it as any other object (see Object Creation) and set the mission main parameters.
The mission main parameters are shown below:
When a mission is triggered its description is stored into the inventory.
There are 2 ways in which the mission is stored into the inventory depending on the game design:
SINGLE MISSION DESCRIPTION
When the game requires that Player must complete only one missions at time there are following UI elements you can set
If you use these elements to store current mission description you can delete (if exists) all the widgets hierarchy related to the missions list page.
This is what has been done in the FPS Template and in the Walking simulator template.
MULTIPLE MISSIONS DESCRIPTION
HOW MISSIONS WORK?
OPENING A NEW MISSIONBefore being completed, a mission must be "opened", in other words it must be set as (one of) the current mission(s) to complete.
When a mission is opened it is added to the list of missions to complete, so there could be more than one mission to complete at the same time or a mission could be completed only if a number of other missions are completed.
All depends by the design you choose for your game.
When a mission is completed it is removed from the list.
There are 3 kind of objects that can "open" a mission (or a list of missions):
The Player CharacterThe player character has the possibility to open the starting mission. You have to simply set the start Mission parameter.
Another MissionWhen a mission is completed it can "open" the next mission to complete. To do this you must set the nextMission parameter.
The mission counter is probably the most important object to create a structured mission system. This object has a list of missions and a counter set with the number of missions.
When a mission is completed the counter is decremented, when the counter reaches zero a new mission (or a list of new missions) is opened.
In this way only if the player completes all the missions in the counter list he can proceed with a new set of missions.
COMPLETING A MISSIONTo be completed (and open the nextMission, or, in case of MissionCounter, to inform the counter that it has been completed) a mission must receive the MISSION_COMPLETED message.
This mesage can be sent in one of the usual ways:
And in general using every object is capable of sending messages.
MISSION GOALS
A mission can contain a list of sub missions we call "Goals".
A goal is an additional text showed in the inventory mission description that is grayed when the goal is completed (see missions page).
There must be a maximum of 9 goals per mission.
Generally you can use goals for creating a list of items to collect.
For example you could create a mission for collecting all photos in a house adding to that mission a list of goals, one for every photo found, called "photo #1", "photo #2", "photo #3" and so on. When player found a photo the related goal is completed and the related text is grayed (so user knows he has found the right photo).
To complete a goal a GOAL_COMPLETED_0...9 message must be sent to the mission. When the mission receives this message the related goal text is grayed.
|