Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!newsserver.jvnc.net!news.ge.com!ctrlnews.erie.ge.com!news.crd.ge.com!news.sprintlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!usenet.ucs.indiana.edu!news.cs.indiana.edu!shulick@guava.ucs.indiana.edu
From: "Sam Hulick" <shulick@guava.ucs.indiana.edu>
Subject: Inform: Stuck with expandable menus w/ DoMenu..
Message-ID: <1995Oct1.143933.292@news.cs.indiana.edu>
Organization: Vallen Software
Date: Sun, 1 Oct 1995 14:39:28 -0500
Lines: 50


Well.. I applied the ZRegion() check in DoMenu so I can pass a routine
in.  Now I've run into another problem.  First, here is my code so far:

[ HintRoutine;
   if (hintflags == $0) "Work a little bit on your own first.";
   DoMenu(#r$HDetermine, #r$HintMenu, #r$HintInfo);
];

[ HDetermine;
   print "Pick an area you're having problems with.^^";

   if (hintflags & $1 ~= 0) print "      What the heck is blocking my \
door?^";
   if (hintflags & $2 ~= 0) print "      How do I open the fishtank?^";
   if (hintflags & $4 ~= 0) print "      Can I stop the fish from \
biting my finger off?^";
];

[ HintMenu;
   item_name = "Hints";
   item_width = 2;
   if (menu_item == 0) return hintcount;
];

[ HintInfo;
   print "Press H for another clue, or hit any other key to exit this area.^^";
 .....

Basically, hintcount starts at 0 and increments every time the player
might do something like discover the fishtank, or whatever.  Every time
a new puzzle is discovered, I add in a flag# into hintflags..
So in this case, discovering you can't open the fishtank will do
'hintflags = hintflags | $2;'  Once the player gets his finger bitten
off, that part does 'hintflags = hintflags | $4;' and increases hintcount
so the player can get a hint on it.  The problem is, I can't use
menu_item to check which hint they picked, because what if they don't go
in the natural order?  What if they figure out on their own what's
blocking their door?  AND they open the fishtank up?  But then the fish
bites the player's finger off, so now hintcount is 1 and hintflags
equals $4.  If they choose that third hint, menu_item will equal 1.  But
even if all three hints are there, then menu_item will be 3 if they
choose the finger-biting hint.  So how exactly should I handle this
problem?

-- 
--- Sam Hulick ------------- shulick@indiana.edu ---------------------
Systems Consultant        | Homepage:
Indiana College Placement |    http://copper.ucs.indiana.edu/~shulick/
  and Assessment Center   | PGP public key available on request
