NPC Implicit Actions by Eric Eve Search for other extensions by this author Approved for the Public Library


Download version 4/150410For Inform 7 6L38



A basic extension of the Implicit Actions extension into actions carried out by NPCs. This extension automatically includes Implicit Actions.

Tags actions npcs


This extension provides a basic mechanism for NPCs to use the same implicit actions as the Implicit Actions extension provides for the player character (for details of which, see the Implicit Actions documentation). The mechanism is basic because, although NPCs will carry out the same implicit actions as the player character, there is no attempt to tidy up or group the implicit reaction reports. We'll just see things like: >bob, lock cabinet Bob picks up the silver key. Bob closes the glass cabinet. Bob locks the glass cabinet. In the above example, Bob obviously knows what key to use. We keep track of this via the key-knowledge relation, which is expressed through the verb to be key-cognizant of. For example "Bob is key-cognizant of the glass cabinet" would mean the Bob knows which key to use to lock and unlock the glass cabinet. By default the extension keeps track of which actors are key-cognizant of which lockable items by making them so whenever they witness a key being successfully used to lock or unlock a cabinet or door. If we wanted Bob to start with some knowledge of what keys fit some locks, we could do so with statements like: Bob is key-cognizant of the gold chest. Bob is key-cognizant of the front door. Likewise, if someone (the player character, say) tells Bob what key unlocks the gold chest in the course of the game, we could reflect that gain in knowledge with: Now Bob is key-cognizant of the gold chest. Example:* Bossing Bob - An NPC who carries out implicit actions in the course of obeying commands. This is the same scenario as the first example in Implicit Actions, except that here we get Bob to do most of the work. *: "Bossing Bob" Include NPC Implicit Actions by Eric Eve. Use full-length room descriptions. The Study is a Room. "A large wooden table stands to one side of the room, opposite a glass cabinet. An oak door leads south." The chair is an enterable scenery supporter in the Study. The player is on the chair. The large wooden table is a scenery supporter in the Study. The red box is a closed openable container. It is on the table. In the red box is a key called the silver key. A keyring called the gold keyring is on the table. The glass cabinet is a closed locked openable lockable transparent scenery container. It is in the study. The matching key of the glass cabinet is the silver key. A key called the brass key is in the glass cabinet. The oak door is a closed locked scenery door. It is south of the Study and north of the Hall. The matching key of the oak door is the brass key. Bob is a man. Bob is in the Study. The description is "Bob is looking unusually obedient. He is currently carrying [the list of things carried by Bob]." Rule for writing a paragraph about Bob: say "Bob is standing here, waiting for instructions." Persuasion rule for asking Bob to try doing something: persuasion succeeds. The Hall is a Room. "This room is quite bare, but an oak door leads north, and a pine door east." The pine door is a closed locked scenery door. It is east of the Hall and west of the Closet. The matching key of the pine door is no-key. The Closet is a Room. "This small closet is little more than a broom-cupboard (though there is not a broom in sight). A pine door leads out to the west." Instead of exiting in the Closet, try going west. Test me with "bob, s/bob, look in red box/bob, unlock glass cabinet with silver key/bob, unlock oak door with brass key/bob, s/s/bob, n/n/bob, lock door/bob, drop all/close red box/bob, put silver key in red box/bob, put brass key in cabinet/bob, lock cabinet/bob, drop silver key/bob, sit on chair/bob, s"