Chaining a Mission
Sometimes we want to start a new mission after the player completes the current mission. For that case, we use the <OnGetNextScreen>
event:
...
<OnGetNextScreen>
(switch
; After a mission-success debrief, we start a new mission.
(= aScreenType 'SuccessFollowUp)
(block (
(missionObj (msnCreate ...))
)
; If we successfully created the next mission, then
; navigate to the mission screen. Otherwise, we return
; Nil, which means do nothing.
(if missionObj
{
nextScreen: &dsRPGMission;
nextScreenData: { missionObj:missionObj }
}
)
)
)
</OnGetNextScreen>
...