Re: Another Inform Question
Thu, 15 Jun 1995 11:22:48 GMT
In article <3rgk3k$j8c@PEAK.ORG>,
Even the losers get lucky <daye@PEAK.ORG> wrote:
>All the replies to my previous question were very helpful, so now I've
>got another one...
>
>I've got a seatbelt in a seat. It's concealed, so a player can examine
>it, but it doesn't appear in rooms descriptions or anything. I'd like
>the player to be able to type 'wear seatbelt' and it will put on the
>seatbelt. I've been able to do this using a before Take:, because the
>parser tries to take the belt before issuing a wear action. Is there a
>way to prevent it from saying (taking the safety belt first), such as a
>flag? It's not that big a deal, but it would look nicer if it didn't say
>it was taking the belt so players wouldn't check their inventories for it
>or spend hours wondering where it went.
>
>If that doesn't make sense, I can post a clarification (and a code
>snippet, which I don't have at this point...I'm dreadfully unprepared, it
>seems...)
>
The keep_silent flag can stop library routines from printing
their successfull message (unsuccessfull it will still print, like "you
can't..." so an so). The "(taking the safety belt first)" message is made
by the parser so this will probably not work. You could change the
parser so that it only prints when the keep_silent flag is false. Only
way I can see to do it...
I just checked the parser and, it will print regardless of the
keep_silent flag.
Of course you could do the wear action yourself. The seatbelt's
before routine-
before [;
wear :
if (parent(player) == seat) { ! Only wearable in the seat.
if (self has worn) "Already wearing it.";
give seatbelt worn;
move seatbelt to player; ! migth be able to get rid of this.
"You put on the seatbelt";
}
"You have to sit down first.";
}
remove :
if (self hasnt worn) "Your not wearing it";
give seatbelt ~worn;
move seatbelt to chair;
"You take the seatbelt off.";
],
Hope this helps...
-MRR