ainslec / adventuron-issue-tracker

Adventuron Issues Tracker
4 stars 0 forks source link

Add support for him and her and them substitution for nouns #497

Open ainslec opened 2 years ago

ainslec commented 2 years ago

Currently adventuron supports IT substitution for substituting the previous noun into the sentence, but this does not work for using words such as HIM and HER to refer to people referred to previously.

ainslec commented 2 years ago

Workaround pending proper solution

start_at = my_location

locations {
   my_location : location "You are in a room.";
}
objects {
   sandra : scenery "sandra" at = "my_location" ;
}
strings {
   previous_noun : string "";
}
on_command {
   : mask {
      : if ((verb_is "examine" || verb_is "ask" || verb_is "talk")) {
         : if (noun1_is "her" && previous_noun != "") {
            : set_noun1 (previous_noun);
            : disambiguate_s1 "present";
         }
      }
      : if (original "noun1" != "her") {
         : set_string var = "previous_noun"  value -> (original "noun1") ;
      }
   }

   : match "talk sandra"  {
      : if (is_present "sandra") {
         : print "Sandra says hello.";
      }
   }

}