-- hints.ala -- by stephen griffiths -- for skipbrek.ala -- ($included in source code via help.i file) --The hints in Skipbrek are 'adaptive.' That is the hint shown when the player --requests a hint depends both on what problem the player is currently facing --and on how much of the problem the player has already solved. --So the game has to keep track of three things to select the right hint --to show : -- - what problem the player is facing (In other games the player could -- face multiple puzzles at one time so the game must ask the player to -- select which puzzle they want hints on.) -- - what hints for the current problem the player has already seen -- - which hints for the current problem are 'stale' - meaning the player -- hasn't seen the hint but has already seen/solved/done/whatever the hint -- is talking about. --The adaptive hints in Skipbrek aren't implemented in the most general way --that would work for all games. Skipbrek has a very simple puzzle structure --(eg: the player is always faced with only one puzzle at a time; that puzzle --is always solvable with the resources currently available to the player.) --There is excellent documentation included with the TADS adaptive hints --module by David Allen and Stephen Granade which describes the daunting range --of possibilities the designer has to consider when designing hints for a --game more complicated than this one. If you want to work on hints for a --complicated Alan game I suggest reading adhint.doc in the IF Archive file -- ftp://ftp.gmd.de/if-archive/programming/tads/examples/adhint.zip --for some useful background information. OBJECT ATTRIBUTES NOT shown. -- ie hint not yet displayed on screen NOT stale. -- only used for hint objects -- ('stale' hints not shown to player) -- events and verbs in the game need -- to make hint objects 'stale' as required OBJECT hint_1_1 DESCRIPTION "You can't get yourself out of the rope." END OBJECT. OBJECT hint_1_2 DESCRIPTION "Look at the rope." END OBJECT. OBJECT hint_1_3 DESCRIPTION "Talk to the rope." END OBJECT. OBJECT hint_1_4 DESCRIPTION "Say ok to the rope when it offers a deal." END OBJECT. OBJECT hint_1_5 DESCRIPTION "Talk to the rope until it offers a deal and then say ok." END OBJECT. OBJECT hint_2_1 DESCRIPTION "The rope can't untie itself" END OBJECT. OBJECT hint_2_2 DESCRIPTION "You need to stand on something to reach the knot." END OBJECT. OBJECT hint_2_3 DESCRIPTION "Stand on the stones" END OBJECT. OBJECT hint_2_4 DESCRIPTION "You need to move the stones under the tree before you stand on them." END OBJECT. OBJECT hint_2_5 DESCRIPTION "Stand on stones under tree and untie the knot." END OBJECT. OBJECT hint_3_1 DESCRIPTION "You can't leave without taking the rope." END OBJECT. OBJECT hint_3_2 DESCRIPTION "You can't walk out of the clearing." END OBJECT. OBJECT hint_3_3 DESCRIPTION "You have to go up." END OBJECT. OBJECT hint_3_4 DESCRIPTION "Examine the cliff." END OBJECT. OBJECT hint_3_5 DESCRIPTION "Throw the rope over the outcrop." END OBJECT. OBJECT hint_3_6 DESCRIPTION "Climb the rope." END OBJECT. VERB hint DOES DECREASE Turns OF Hero. MAKE hero in_help. SCHEDULE not_in_help AFTER 1. IF hero IS NOT seen_hint_warning THEN "$iSpoiler Warning! $iThe HINT command displays a hint for the current puzzle. If you're sure you want such help enter the command HINT again." MAKE hero seen_hint_warning. ELSE -- in this simple game the player's points figure reliably -- signals which puzzle the player is facing IF points OF hero = 0 THEN IF hints_seen OF hero = 0 THEN -- if player hasn't seen this hint but its 'stale' try -- the next hint. If that's not stale too it'll be -- displayed instead IF hint_1_1 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_1_1. MAKE hint_1_1 shown.-- flag that this hint has now been -- displayed so the game won't make -- the hint stale if the player -- performs the action suggested by -- this hint later. -- That would make the hint invisible -- from 'review' command which only -- shows non-stale hints. END IF. END IF. IF hints_seen OF hero = 1 THEN IF hint_1_2 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_1_2. MAKE hint_1_2 shown. END IF. END IF. IF hints_seen OF hero = 2 THEN IF hint_1_3 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_1_3. MAKE hint_1_3 shown. END IF. END IF. IF hints_seen OF hero = 3 THEN IF hint_1_4 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_1_4. MAKE hint_1_4 shown. END IF. END IF. IF hints_seen OF hero = 4 THEN IF hint_1_5 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_1_5. MAKE hint_1_5 shown. END IF. END IF. IF hints_seen OF hero > 4 THEN "You have seen all the hints available at present. You can review the previous hints with the REVIEW command." END IF. ELSIF points OF hero = 1 THEN IF hints_seen OF hero = 0 THEN IF hint_2_1 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_2_1. MAKE hint_2_1 shown. END IF. END IF. IF hints_seen OF hero = 1 THEN IF hint_2_2 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_2_2. MAKE hint_2_2 shown. END IF. END IF. IF hints_seen OF hero = 2 THEN IF hint_2_3 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_2_3. MAKE hint_2_3 shown. END IF. END IF. IF hints_seen OF hero = 3 THEN -- most of the setting of hint 'staleness' -- is done in the main game file. This check is -- here in the hints file for no particular reason -- really except that the stone's placement could -- change several times before the player gets to this -- particular hint. IF placement OF stones = "tree" THEN MAKE hint_2_4 stale. END IF. IF hint_2_4 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_2_4. MAKE hint_2_4 shown. END IF. END IF. IF hints_seen OF hero = 4 THEN IF hint_2_5 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_2_5. MAKE hint_2_5 shown. END IF. END IF. IF hints_seen OF hero > 4 THEN "You have seen all the hints available at present. You can review the previous hints with the REVIEW command." END IF. ELSIF points OF hero = 2 THEN IF hints_seen OF hero = 0 THEN IF hint_3_1 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_3_1. MAKE hint_3_1 shown. END IF. END IF. IF hints_seen OF hero = 1 THEN IF hint_3_2 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_3_2. MAKE hint_3_2 shown. END IF. END IF. IF hints_seen OF hero = 2 THEN IF hint_3_3 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_3_3. MAKE hint_3_3 shown. END IF. END IF. IF hints_seen OF hero = 3 THEN IF hint_3_4 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_3_4. MAKE hint_3_4 shown. END IF. END IF. IF hints_seen OF hero = 4 THEN IF hint_3_5 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_3_5. MAKE hint_3_5 shown. END IF. END IF. IF hints_seen OF hero = 5 THEN IF hint_3_6 IS stale THEN INCREASE hints_seen OF hero. ELSE DESCRIBE hint_3_6. MAKE hint_3_6 shown. END IF. END IF. IF hints_seen OF hero > 5 THEN "You have seen all the hints available at present. You can review the previous hints with the REVIEW command." END IF. END IF. INCREASE hints_seen OF hero. END IF. END VERB. SYNTAX review = review. VERB review DOES DECREASE Turns OF Hero. MAKE hero in_help. SCHEDULE not_in_help AFTER 1. IF hints_seen OF hero = 0 THEN "No current hints seen. Use the HINT command to view new hints." ELSE IF points OF hero = 0 THEN IF hints_seen OF hero > 0 THEN IF hint_1_1 IS NOT stale THEN DESCRIBE hint_1_1. "$n" END IF. END IF. IF hints_seen OF hero > 1 THEN IF hint_1_2 IS NOT stale THEN DESCRIBE hint_1_2. "$n" END IF. END IF. IF hints_seen OF hero > 2 THEN IF hint_1_3 IS NOT stale THEN DESCRIBE hint_1_3. "$n" END IF. END IF. IF hints_seen OF hero > 3 THEN IF hint_1_4 IS NOT stale THEN DESCRIBE hint_1_4. "$n" END IF. "$i(No more hints available at present.)" END IF. ELSIF points OF hero = 1 THEN IF hints_seen OF hero > 0 THEN IF hint_2_1 IS NOT stale THEN DESCRIBE hint_2_1. "$n" END IF. END IF. IF hints_seen OF hero > 1 THEN IF hint_2_2 IS NOT stale THEN DESCRIBE hint_2_2. "$n" END IF. END IF. IF hints_seen OF hero > 2 THEN IF hint_2_3 IS NOT stale THEN DESCRIBE hint_2_3. "$n" END IF. END IF. IF hints_seen OF hero > 3 THEN IF hint_2_4 IS NOT stale THEN DESCRIBE hint_2_4. "$n" END IF. END IF. IF hints_seen OF hero > 4 THEN IF hint_2_5 IS NOT stale THEN DESCRIBE hint_2_5. "$n" END IF. "$i(No more hints available at present.)" END IF. ELSIF points OF hero = 2 THEN IF hints_seen OF hero > 0 THEN IF hint_3_1 IS NOT stale THEN DESCRIBE hint_3_1. "$n" END IF. END IF. IF hints_seen OF hero > 1 THEN IF hint_3_2 IS NOT stale THEN DESCRIBE hint_3_2. "$n" END IF. END IF. IF hints_seen OF hero > 2 THEN IF hint_3_3 IS NOT stale THEN DESCRIBE hint_3_3. "$n" END IF. END IF. IF hints_seen OF hero > 3 THEN IF hint_3_4 IS NOT stale THEN DESCRIBE hint_3_4. "$n" END IF. END IF. IF hints_seen OF hero > 4 THEN IF hint_3_5 IS NOT stale THEN DESCRIBE hint_3_5. "$n" END IF. END IF. IF hints_seen OF hero > 5 THEN IF hint_3_6 IS NOT stale THEN DESCRIBE hint_3_6. "$n" END IF. "$i(No more hints available at present.)" END IF. END IF. END IF. END VERB.