Advertisement
Shadowolf3400

Possession and Ownership (version 4) for Inform7

Jun 18th, 2013
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Version 4/130619 of Possession and Ownership by Shadow Wolf begins here.
  2.  
  3. "Allows the player to refer to items via either legal ownership or physical possession, e.g. X ALICE'S NECKLACE or ENTER GEORGE'S HOUSE."
  4.  
  5. "based on code from vaporware on r.a.i.f (6 Jan 2008)"
  6.  
  7. Section 1 - Reparsing possessives
  8.  
  9. After reading a command (this is the mangle possessives in the players command rule):
  10. let N be indexed text;
  11. let N be the player's command;
  12. replace the regular expression "(\w)[']s" in N with "\1 [']s";
  13. replace the regular expression "s['](\W)" in N with "s [']s\1"; [Cheat to handle possessives]
  14. change the text of the player's command to N.
  15.  
  16. Section 2 - Possession
  17.  
  18. Understand "[something related by reversed possession] 's" as a thing.
  19. Understand "[something related by reversed incorporation] 's" as a thing.
  20. Understand "my" as a thing when the player is holding the item described. Understand "your" as a thing when the person asked is holding the item described.
  21.  
  22. Section 3 - Ownership
  23.  
  24. [Sometimes items are permanently associated with a person, even if they are currently held by someone else, or not held at all (a building, for example). Ownership handles this.]
  25.  
  26. Ownership relates one person (called the owner) to various things. The verb to own (he owns, they own, he owned, he is owned) implies the ownership relation.
  27. Understand "my" as a thing when the player owns the item described. Understand "your" as a thing when the person asked owns the item described.
  28. Understand "[something related by reversed ownership] 's" as a thing.
  29.  
  30. Possession and Ownership ends here.
  31.  
  32. ---- DOCUMENTATION ----
  33.  
  34. "Possession and Ownership" allows the player to use possessives to refer to items which are either physically held by a particular individual, or notionally owned by an individual.
  35.  
  36. The original idea, which only covered physical possession, originated on a r.a.i.f thread, archived here: http://rec.arts.int-fiction.narkive.com/dBgGlsLL/possessives-in-inform-7
  37.  
  38. With this extension, a player can automatically use commands like "EXAMINE BOB'S PANTS" or "DROP MY PENCIL" or "ALICE, GIVE ME YOUR NECKLACE" - as long as the appropriate person (Bob, the player, and Alice respectively) is holding the item in question.
  39.  
  40. Some items may be notionally owned by a particular individual, even if they are currently held by someone else, or are fixed in place (and thus not holdable at all.) The ownership relation handles this.
  41.  
  42. Bob carries a gun. The gun is owned by Annie. [or "Annie owns the gun."]
  43.  
  44. This allows:
  45.  
  46. > EXAMINE ANNIE'S GUN [even though it's held by Bob]
  47. > BOB, DROP ANNIE'S GUN
  48. > ANNIE, GET YOUR GUN
  49.  
  50. (Who didn't see that last line coming?)
  51.  
  52. Naturally, ownership of an item can change during play:
  53.  
  54. Oak Street is a room. The red house is scenery on Oak Street. The house is owned by Bob.
  55.  
  56. Signing the Deed is a scene. When Signing the Deed ends: Now the house is owned by the player.
  57.  
  58. Section - Caveats and Issues
  59.  
  60. Version 3 is a near-total rewrite. Instead of manually updating an indexed text property every turn, we mangle the player's command (so that apostrophe-s is a separate word), and use the "[something related by reversed relation]" construct. The game will understand items related by possession or incorporation, which covers assemblies, and also ownership.
  61.  
  62. The alteration of the player's command also tries to handle plural possessives (e.g. WITCHES' ) - S followed by apostrophe becomes S-space-apostrophe-S.
  63.  
  64. Avoid setting ownership relations in which one person owns an assembly that's part of another person - this will cause disambiguation issues. (e.g. don't try "A nose is part of every person. George owns Bob's nose.", or X GEORGE'S NOSE won't be able to tell which one you mean.)
  65.  
  66. If an actor only has a single thing (via possession or incorporation), then a command like "X LOIS'S GLASSES" (where Lois does not have the glasses) will result in the parser error "I only understood you as far as wanting to examine Lois." As a workaround, you can define two assemblies so that every person has at least two items at all times. (e.g "An xxxx is a kind of thing. A yyyy is a kind of thing. An xxxx and a yyyy are part of every person .") Ideally, of course, these should be assemblies that are actually of use in the game.
  67.  
  68. It has been suggested that possession-by-enclosure should be available as an option (allowing "Lois is wearing a hat. A tassel is part of the hat. Test me with 'x Lois's tassel'. ") This may become available in a future version, but currently I don't wish to add the necessary option test on every "Understand" line. If a future version of Inform allows sections to be conditionally incorporated (similar to "For use with Extension X"), then I will definitely add this.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement