Console

version 1 by Aaron Reed

  • Home page
  • Beginning
  • Previous



  • Example: * Character Monitoring - Use the console to display information about NPC movements.

        "Character Monitoring"

        Include Flexible Windows by Jon Ingold. Include Console by Aaron Reed.

        Hallway is north of Foyer and south of Ballroom. Dining Room is east of Ballroom. Stage is west of Ballroom.

        A guest is a kind of person. Alec, Betty, Cecil, Deidre, and Emile are guests in the Hallway.

        A mood is a kind of value. The moods are petulant, nonchalant, blase, and keen. A person has a mood. A person is usually petulant.

        Every turn:
            in the console say "*** Beginning NPC processing";
            repeat with NPC running through guests:
                now NPC is a random mood;
                if NPC is keen:
                    let spot be location of NPC;
                    let route be the best route from spot to a random room which is adjacent to spot;
                    if route is a direction, try NPC going route;
                in the console say "[NPC] is [mood of NPC][if mood of NPC is keen], so moves to[otherwise]; in[end if] [location of NPC]."

        test me with "console / z / z".