ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Having a Hints Menu within your game

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Having a Hints Menu within your game

Postby Denk » Fri Mar 27, 2020 1:18 pm

I have been looking into how to make a Help Menu with sub-menus and hints, so I have made a demo showing how I would do it.

The problem can be divided into:
A) How to create menus within menus
B) How to pause events while the Help Menu is running

Problem B) is important because you might e.g. be chased by some animal or something controlled by an event. If the player then enters the Help Menu, the player would expect that time isn't passing while the player is in the Help Menu. It is possible to pause events while the player is inside the Help Menu. However, no matter how many turns the player spends inside the Help Menu, one turn will pass once you leave the Help Menu. To my knowledge this is unavoidable.

Example: You are chased by a dog and you have five turns to reach a safe location. If you instead of playing type HELP, the help menu appears. You may spend several turns inside the Help Menu. Then you leave the Help Menu. Now you only have four turns to reach a safe location.

The demo is here:
HintMenu.taf
(24.92 KiB) Downloaded 14 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 445
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Having a Hints Menu within your game

Postby Denk » Mon Mar 30, 2020 12:13 pm

I just realized that you can avoid losing a turn when you exit the help menu. Unfortunately, things get slightly more complicated.

I have demonstrated it in this demo:
HintMenuV2.taf
(25.37 KiB) Downloaded 15 times

Before, the task which is used to exit the help menu would trigger all events to resume, thus causing all events to continue one turn.

Now, the task which is used to exit the help menu will not trigger this. Instead, it will set a variable called "SoonResume" to 2 (initially it was zero). I have made a system-task called "ResumeAllEvents". All normal events should be set to Resume when this task runs and all normal events should be set to Suspend when starting the help menu.

But a special event should keep running. In the demo, this special event is called "ThisEventIsAlwaysRunning". It takes one turn and keeps repeating. Every turn it reduces the variable "SoonResume" by one, and every turn it tries to run the task "ResumeAllEvents". But "ResumeAllEvents" has the restriction that the variable "SoonResume" must be equal to 1 for it to run. As a consequence, "ResumeAllEvents" first runs one turn after leaving the help menu and the player will therefore not lose a turn when exiting the help menu.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 445
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Having a Hints Menu within your game

Postby P/o Prune » Tue Mar 31, 2020 7:26 am

Great Work, Denk.
I've been looking for a usable hint system for my games. :bravo:
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 97kb
User avatar
P/o Prune
Site Admin
 
Posts: 4594
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 93

Re: Having a Hints Menu within your game

Postby rovarsson » Wed Apr 01, 2020 6:24 pm

Thank you Denk.

I was thinking of incorporating a Help-menu in TT. I wasn't thinking about all the repercussions like you did though. What I had in mind was a very laid back take-all-the-time-you-want menu. I was going to create a location 'Help' with a friendly wizard-type character that you could ASK ABOUT all the puzzles in the game (Or just an empty location with a bunch of general tasks.)
I didn't even stop to think that time/turns would pass while the player was in there.
On the other hand, what I just explained would be all that's needed for my game. I am grateful that you made me think about the consequences of just doing it so naively as I was planning.
rovarsson
 
Posts: 79
Joined: Mon Dec 23, 2019 10:37 pm
Location: Belgium
Points: 15

Re: Having a Hints Menu within your game

Postby Denk » Thu Apr 02, 2020 9:42 pm

I am glad someone finds it useful ;)
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 445
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests

cron