intfiction.org

The Interactive Fiction Community Forum
It is currently Thu May 23, 2013 4:09 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Feb 25, 2012 4:28 pm 
Offline

Joined: Fri Feb 24, 2012 11:44 am
Posts: 14
I honestly have no idea where to start on this. But let's say I have the following:
Code:
Test room is a room.
Bob is a man.
Anne is a woman.
Jim is a man.
Bob, Anne, and Jim are in test room.

Watch is a kind of thing. Ring is a kind of thing.
Bob's watch is a watch. Bob's watch is a part of Bob.
Anne's watch is a watch. Anne's watch is a part of Anne.
Anne's ring is a ring. Anne is holding Anne's ring.
Jim's ring is a ring. Jim's ring is in test room.
Understand "band", "circlet", "loop", or "ringlet" as ring.

Instead of examining a man:
   say "His name is [printed name of item described]."
Instead of examining a woman:
   say "Her name is [printed name of item described]."
Instead of examining player:
   say "Your name is [printed name of item described]."

Body switcher is a device.
Instead of switching on body switcher:
   if player is Bob:
      now player is Anne;
      now anne is holding the body switcher;
   otherwise:
      now player is Bob;
      now bob is holding the body switcher.

The player is bob. Bob is holding the switcher.


Now I want a way to understand that "my watch" means "bob's watch" when I'm bob, and "Anne's watch" when I'm anne, but also that "my ring" or "my circlet" means "anne's ring" when I'm anne. Is this possible without creating a huge understanding list of "understand "my ring", "my circlet", "my ringlet", "my loop" or "my band" as Anne's ring when player is Anne"? Because that's going to get unwieldy fast.


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 4:36 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 2128
Location: Burlington, VT
Does something like this work? This is pretty much pseudocode, as I haven't checked the syntax at all, but hopefully it's clear how to make it work.

Code:
Ownership relates one person to many things. The verb to own [conjugations etc.] implies the ownership relation.
When play begins:
   repeat with item running through things enclosed by a person:
       now a random person enclosing item owns item;
   now Jim owns Jim's ring. [and any other special cases you need, including anything where more than one person encloses an item at startup.]

Understand "my" as a thing when the player owns the item described.


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 5:02 pm 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 986
Location: Gothenburg, Sweden
Or try editing the player's command:
Code:
After reading a command when the player is not yourself:
   if the player's command includes "my", replace the matched text with "[the printed name of the player in lower case][']s".

(Apparently the internal name of the player is always "yourself", no matter what the printed name is; and, again apparently, the command line parser converts all letters to lower case.)

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 5:13 pm 
Offline

Joined: Fri Feb 24, 2012 11:44 am
Posts: 14
That's awesome, I like it.

I just wonder why "x my car" produces "I only understood you as far as wanting to examine Bob's watch", but that's not a problem with this technique as it does the same thing if I do "x bob's car".


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 5:21 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 2128
Location: Burlington, VT
"x bob's" would be a valid command on its own, because "bob's" is part of the name of bob's watch. (Just as you're allowed to type "x silver" instead of "x silver dish.") So, if I'm not mistaken, it understand "x bob's car" as "x bob's [watch]" with something extra on the end; just as "jump up" is understood as "jump" with something extra on the end and gives you a similar error.


Top
 Profile Send private message  
 
PostPosted: Sat Feb 25, 2012 5:38 pm 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 986
Location: Gothenburg, Sweden
Felix wrote:
(Apparently the internal name of the player is always "yourself", no matter what the printed name is …)

On closer scrutiny that's mere appearance. The default player is internally called yourself in I7 and selfobj in I6 and any other player is internally called whatever they were created as. The appearance was due to the standard name printing rule, which slyly prefers "yourself" to any printed name when the game is asked to say "[ the player]" (as opposed to "[the printed name of the player]").

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group