Re: Please Be Seated...
8 Jun 1995 20:32:36 GMT
In article <3r5o8j$8uo@ccshst05.cs.uoguelph.ca>,
Christopher Angelini <cangelin@uoguelph.ca> wrote:
> Hello! I've been developing a game in TADS, but I've become stuck on
>what should be a rather simple implementation. Please keep in mind that
>I'm new to TADS (although not to programming), so forgive me if I'm
>missing the obvious.
> I have a trap which sends the player into a chair, which s/he cannot
>immediately stand up from.(ie is strapped down). I'm trying to override
>doStand for the chair object, but I can't figure out how. I'm trying to
>write something like the following
[..]
>on the chair object. Should it go on the room? Or am I _really_ off base?
You're a little off-base. The verb "stand" is not one that requires a direct
object. As such, it wouldn't be attached to any object, just the action(actor)
in the verb itself. So you *could* modify standVerb to have its action check
if the player is in such and such a location, and if so, abort the stand
attempt. But looking at adv.t shows that the standverb actually calls
doUnboard on the object you're trying to leave. So, the best way to do things,
imo, would be to modify the verDoUnboard method for the chair in question, such
as:
verDoUnboard(actor) =
{
if (self.straps)
"You can\'t get up, you\'re strapped down!";
}
and then all the other code will default correctly.
>Thanks for the help,
>-Chris
--
------------------------------------------------+--------------
The Grim Reaper ** scythe@u.washington.edu |
Dan Shiovitz ** shiov@cs.washington.edu | Aude
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Sapere
_Music of the Spheres_ : Coming Nov '95 |
------------------------------------------------+--------------