Version 2 of Object Response Tests by Juhana Leinonen begins here. "A development tool for testing all actions on any given object - or one acton on all objects - at once to see whether the game's responses are sensible." Book 0 - Testing actor - Not for release The test-actor is a person that varies. This is the set testing actor rule: change test-actor to the player. The set testing actor rule is listed last in the when play begins rulebook. Test-actor changing is an action out of world applying to one visible thing. Understand "actor is [any person]" as test-actor changing. Carry out test-actor changing (this is the change testing actor rule): change test-actor to the noun; say "Object Response Tests now uses [the noun] as the actor." Book 1 - Testing rules - Not for release This is the test taking rule: say "[italic type]taking [the noun]: [roman type]"; try the test-actor trying taking the noun. This is the test eating rule: say "[italic type]eating [the noun]: [roman type]"; try the test-actor trying eating the noun. This is the test dropping rule: say "[italic type]dropping [the noun]: [roman type]"; try the test-actor trying dropping the noun. This is the test entering rule: say "[italic type]entering [the noun]: [roman type]"; try the test-actor trying entering the noun. This is the test getting off rule: say "[italic type]getting off [the noun]: [roman type]"; try the test-actor trying getting off the noun. This is the test examining rule: say "[italic type]examining [the noun]: [roman type]"; try the test-actor trying examining the noun. This is the test looking under rule: say "[italic type]looking under [the noun]: [roman type]"; try the test-actor trying looking under the noun. This is the test searching rule: say "[italic type]searching [the noun]: [roman type]"; try the test-actor trying searching the noun. This is the test switching on rule: say "[italic type]switching on [the noun]: [roman type]"; try the test-actor trying switching on the noun. This is the test switching off rule: say "[italic type]switching off [the noun]: [roman type]"; try the test-actor trying switching off the noun. This is the test opening rule: say "[italic type]opening [the noun]: [roman type]"; try the test-actor trying opening the noun. This is the test closing rule: say "[italic type]closing [the noun]: [roman type]"; try the test-actor trying closing the noun. [for some reason if it's called "test wearing rule" the extension refuses to compile in some situations. Don't ask me why.] This is the test clothing rule: say "[italic type]wearing [the noun]: [roman type]"; try the test-actor trying wearing the noun. This is the test taking off rule: say "[italic type]taking off [the noun]: [roman type]"; try the test-actor trying taking off the noun. This is the test giving to rule: if the noun is a person: if the test-actor is not carrying something: say "[italic type](no inventory items; can't test giving to.)[roman type]"; rule succeeds; let give-object be a random thing carried by the test-actor; say "[italic type]giving [the give-object] to [the noun]: [roman type]"; try the test-actor trying giving the give-object to the noun; rule succeeds; if the test-actor is not carrying the noun: rule succeeds; if the test-actor can not see a person who is not the test-actor: say "[italic type](no persons in the location; can't test giving.)[roman type]"; rule succeeds; let give-target be a random visible person who is not the test-actor; say "[italic type]giving [the noun] to [the give-target]: [roman type]"; try the test-actor trying giving the noun to the give-target. This is the test showing to rule: if the noun is a person: if the test-actor is not carrying something: say "[italic type](no inventory items; can't test showing to.)[roman type]"; rule succeeds; let show-object be a random thing carried by the test-actor; say "[italic type]showing [the show-object] to [the noun]: [roman type]"; try the test-actor trying showing the show-object to the noun; rule succeeds; if the test-actor is not carrying the noun: rule succeeds; if the test-actor can not see a person who is not the test-actor: say "[italic type](no persons in the location; can't test showing.)[roman type]"; rule succeeds; let show-target be a random visible person who is not the test-actor in the location of the test-actor; say "[italic type]showing [the noun] to [the show-target]: [roman type]"; try the test-actor trying showing the noun to the show-target. This is the test throwing at rule: if the noun is a person: if the test-actor is not carrying something: say "[italic type](no inventory items; can't test throwing at.)[roman type]"; rule succeeds; let throw-object be a random thing carried by the test-actor; say "[italic type]throwing [the throw-object] at [the noun]: [roman type]"; try the test-actor trying throwing the throw-object at the noun; rule succeeds; if the test-actor is not carrying the noun: rule succeeds; if the test-actor can not see a person who is not the test-actor: say "[italic type](no persons in the location; can't test throwing at.)[roman type]"; rule succeeds; let throw-target be a random visible person who is not the test-actor in the location of the test-actor; say "[italic type]throwing [the noun] at [the throw-target]: [roman type]"; try the test-actor trying throwing the noun at the throw-target. This is the test waking rule: if the noun is not a person: rule succeeds; say "[italic type]waking [the noun]: [roman type]"; try the test-actor trying waking the noun. This is the test attacking rule: say "[italic type]attacking [the noun]: [roman type]"; try the test-actor trying attacking the noun. This is the test kissing rule: if the noun is not a person: rule succeeds; say "[italic type]kissing [the noun]: [roman type]"; try the test-actor trying kissing the noun. This is the test touching rule: say "[italic type]touching [the noun]: [roman type]"; try the test-actor trying touching the noun. This is the test waving rule: say "[italic type]waving [the noun]: [roman type]"; try the test-actor trying waving the noun. This is the test pulling rule: say "[italic type]pulling [the noun]: [roman type]"; try the test-actor trying pulling the noun. This is the test pushing rule: say "[italic type]pushing [the noun]: [roman type]"; try the test-actor trying pushing the noun. This is the test turning rule: say "[italic type]turning [the noun]: [roman type]"; try the test-actor trying turning the noun. Definition: a direction is push-to-possible if the room it from the location of the test-actor is a room. This is the test pushing to rule: let push-direction be a random push-to-possible direction; if the push-direction is nothing: say "[italic type](no exits; can't test pushing to.)[roman type]"; rule succeeds; say "[italic type]pushing [the noun] to [push-direction]: [roman type]"; try the test-actor trying pushing the noun to push-direction. This is the test squeezing rule: say "[italic type]squeezing [the noun]: [roman type]"; try the test-actor trying squeezing the noun. This is the test burning rule: say "[italic type]burning [the noun]: [roman type]"; try the test-actor trying burning the noun. This is the test smelling rule: say "[italic type]smelling [the noun]: [roman type]"; try the test-actor trying smelling the noun. This is the test listening to rule: say "[italic type]listening to [the noun]: [roman type]"; try the test-actor trying listening to the noun. This is the test tasting rule: say "[italic type]tasting [the noun]: [roman type]"; try the test-actor trying tasting the noun. This is the test cutting rule: say "[italic type]cutting [the noun]: [roman type]"; try the test-actor trying cutting the noun. This is the test tying to rule: let tie-target be a random visible thing that is not the noun in the location of the test-actor; say "[italic type]tying [the noun] to [the tie-target]: [roman type]"; try the test-actor trying tying the noun to the tie-target; This is the test drinking rule: say "[italic type]drinking [the noun]: [roman type]"; try the test-actor trying drinking the noun. This is the test swinging rule: say "[italic type]swinging [the noun]: [roman type]"; try the test-actor trying swinging the noun. This is the test rubbing rule: say "[italic type]rubbing [the noun]: [roman type]"; try the test-actor trying rubbing the noun. This is the test setting to rule: say "[italic type]setting [the noun] to 1: [roman type]"; try the test-actor trying setting the noun to "1". This is the test buying rule: say "[italic type]buying [the noun]: [roman type]"; try the test-actor trying buying the noun. This is the test climbing rule: say "[italic type]climbing [the noun]: [roman type]"; try the test-actor trying climbing the noun. Book 2 - Analyzing action - Not for release Table of analyzing actions topic testing rule "examining" test examining rule "looking under" test looking under rule "searching" test searching rule "listening to" test listening to rule "smelling" test smelling rule "attacking" test attacking rule "buying" test buying rule "climbing" test climbing rule "pulling" test pulling rule "pushing" test pushing rule "turning" test turning rule "pushing to" test pushing to rule "opening" test opening rule "entering" test entering rule "getting off" test getting off rule "closing" test closing rule "taking" test taking rule "switching on" test switching on rule "switching off" test switching off rule "wearing" test clothing rule "taking off" test taking off rule "throwing at" test throwing at rule "showing to" test showing to rule "giving to" test giving to rule "waking" test waking rule "attacking" test attacking rule "kissing" test kissing rule "touching" test touching rule "rubbing" test rubbing rule "waving" test waving rule "squeezing" test squeezing rule "burning" test burning rule "cutting" test cutting rule "tying to" test tying to rule "swinging" test swinging rule "tasting" test tasting rule "drinking" test drinking rule "eating" test eating rule "dropping" test dropping rule Object-analyzing is an action applying to one visible thing. Understand "analyze [something]" as object-analyzing. Understand "analyse [something]" as object-analyzing. Carry out object-analyzing (this is the go through all analyzing rules rule): repeat with x running from 1 to the number of rows in the table of analyzing actions: follow the testing rule in row x of the table of analyzing actions. All-encompassing analyzing is an action applying to nothing. Carry out all-encompassing analyzing (this is the analyze everything in the location rule): repeat with x running through things enclosed by the location of the test-actor: if the test-actor can see x: try object-analyzing x. Understand "analyze all" as all-encompassing analyzing. Book 3 - Trying actions - Not for release Test-verb-trying is an action applying to one topic. Understand "try [text]" as test-verb-trying. Check test-verb-trying (this is the unknown verb test label rule): if the topic understood is not a topic listed in the Table of analyzing actions: say "Unknown verb test." instead. Carry out test-verb-trying (this is the repeat an action with all objects rule): if the topic understood is a topic listed in the Table of analyzing actions: repeat with x running through things enclosed by the location of the test-actor: if the test-actor can see x: change the noun to x; follow the testing rule entry. Object Response Tests ends here. ---- DOCUMENTATION ---- Chapter: Basic usage Object Response Tests adds new testing commands ANALYZE and TRY. ANALYZE can be used to execute all available commands on a single object to see whether all the messages make sense. TRY is similar but in 'reverse': it tests one verb with all the objects currently in the location. The syntax is TRY , for example TRY PUSHING. There's also an ANALYZE ALL command for those who are feeling adventurous. It runs all the tests on all the objects currently in the location. It is mainly useful for locations with not that many objects to test. For testing the default library actions, just include the extension in your project and both these commands will become available. Actions related to speaking with persons (saying, telling, asking) are excluded because of the various ways different games handle conversation. Chapter: Removing and adding tests Some games may disable some of the standard library actions. To avoid confusion it might be better to skip testing these actions altogether. Probably the easiest way to do this is to use a procedural rule to ignore the rules that run the individual tests. Procedural rule: ignore the test burning rule; ignore the test pushing to rule. Of course, most games have custom actions that are not defined in the standard library. They can be included in the tests by making testing rules for them and adding those rules in the Table of analyzing actions. They will then be available for both ANALYZE and TRY commands. This is the test swimming in rule: say "[italic type]swimming in [the noun]: [roman type]"; try swimming in the noun. This is the test kicking rule: say "[italic type]kicking [the noun]: [roman type]"; try kicking the noun. Table of analyzing actions (continued) topic testing rule "swimming in" test swimming in rule "kicking" test kicking rule Chapter: Changing the actor It is possible to run the tests as someone other than the player character. The test-actor variable holds the person who will be the actor in the tests. This can be changed during the game with the command ACTOR IS; for example ACTOR IS BOB. If the test-actor is not the player character any failed actions (that would usually give the "Bob is unable to do that" response) will not print anything at all. Also, the tests will not abide by the persuasion rules. In other words, if you run the tests as Bob, he will respond as if the game's source code read "try Bob trying shaving the yak", not as if the player had commanded BOB, SHAVE YAK which is by default blocked by the standard library ("Bob has better things to do."). Note that the test-actor variable is set when the play begins. If the game changes the player character, the test-actor variable doesn't change automatically (that is, if you change the player character mid-game, the tests will be run as the original player character if not instructed otherwise). Chapter: Note on releasing The extension automatically disables itself in release versions. Any abovementioned modifications to its behavior should therefore be written in a section that has "Not for release" in the title (see chapter 2.9 "Material not for release" in the I7 manual) to avoid errors in compiling the final product. Chapter: Version history Section: Version 2 (2008-12-23) - added the command TRY for testing a single verb with all items in the location (thanks to Taleslinger for the idea). - added the command ANALYZE ALL for running all tests on every single item in the location (thanks to Emily Short for the inspiration). - added the possibility to change the actor for the tests. - changed the analyzing action's name to object-analyzing to avoid collisions with other code. It's likely that people might have an action called "analyzing" in their work. - added a not-for-release chapter heading to example B, just because that's what's recommended in the documentation (thanks to the person in ifMUD whose name I didn't write down and have blissfully forgotten). Section: Version 1 (2008-11-18) - initial release Example: * Camp Fire - An example of basic use of the extension. *: "Camp Fire" Include Object Response Tests by Juhana Leinonen. The Camp is a room. The bonfire is in the Camp. It is fixed in place. The description is "The bonfire is blazing hot." Alice is a woman in the Camp. Instead of touching the bonfire: say "Ow! You almost burn your fingers." Test me with "analyze bonfire/try touching/actor is Alice/analyze all". When we run the test, we notice that at least the response to "taste bonfire" should be changed to something more appropriate. Example: ** Porcelain - Skipping tests that destroy or alter the object. *: "Porcelain" Include Object Response Tests by Juhana Leinonen. The Porcelain shop is a room. The Ming dynasty vase is in the porcelain shop. The description is "It looks very delicate and fragile." Instead of taking the Ming dynasty vase: say "You're afraid that you might drop it." After pushing or touching the Ming dynasty vase: say "Whoops! The vase falls off its pedestal and shatters into thousand pieces."; remove the Ming dynasty vase from play. Chapter Tests - Not for release Procedural rule while the noun is the Ming dynasty vase: ignore the test pushing rule; ignore the test touching rule. Test me with "analyze vase/push vase".