Re: Nanny, moving back one con state?

From: The Fungi (
Date: 07/12/02

On Fri, Jul 12, 2002 at 05:41:06AM -0700, Mathew Earle Reuther wrote:
> I'd like to go ahead and allow myself the opportunity to move from one con
> state back to the previous one.  Particularly for folks to move backwards
> out of race to sex, and out of class back to race.  I'm having trouble
> getting this to happen as parse_race and parse_class require returning a
> value.
[specifics snipped for brevity]

There is no "move forward" or "back up" with con states. They are
not in any particular linear order as far as the code is concerned.
When exiting any state in the nanny you can proceed to any other you
want simply bu altering the end of its case block. Just put a
conditional at the end to check the value of the previous input. If
it was your "back up" choice then re-print the text for the previous
state and switch to it. If it was anything else print the text for
the next con state and switch to it. Look at the character name
verification portion of the nanny to see similar code in action.

Now if you want to be clean about it you may need to move more of
the inline string constants to a header file so you don't have to
duplicate them within nanny. And if you really are careful to put
your states in numerical order you might consider incrementing and
decrementing. Of course this *will* mostly relegate you to a linear
step in either direction during the character creation sequence, but
it will also help organize your otherwise convoluted nanny.
{ IRL(Jeremy_Stanley); PGP(9E8DFF2E4F5995F8FEADDC5829ABF7441FB84657);
SMTP(; IRC(; ICQ(114362511);
AIM(dreadazathoth); YAHOO(crawlingchaoslabs); FINGER(;
MUD(; WWW(; }

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT