Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[TADS 2] Indistinguishable Objects and Plurals

12 views
Skip to first unread message

Jim Aikin

unread,
Aug 4, 2002, 1:57:00 AM8/4/02
to
Thanks for the answer to my previous query, Dan. I'm still grappling
with the same intractable situation -- a group of objects that need to
be referrable to with either the plural or singular noun, and out of
which the user needs to be able to pick up and use a single object.

I decided to try a different approach, but it doesn't work any better
than my first attempt. Here's what I'm doing now, and the problem that
ensues:

For testing, I've created a simple class, and seven instances of the
class, like this:

class smurf: item, floatingItem
noun = 'smurf'
adjective = 'purple' 'fat'
sdesc = "smurf"
ldesc = "It's a fat purple smurf. "
;

smurf1: smurf
location = startroom
isEquivalent = true
;
// etc. for smurf2 through smurf7

This works fine, as long as the player is content to refer to one smurf
at a time (while the parser is pleased to refer to them en masse when
appropriate). But as all seven smurfs are starting out in the same room,
the player may very logically wish to refer to them en masse
him/herself. Which causes this:

> l
You see seven smurfs here.

> take smurfs
I don't know the word "smurfs".

I can, of course, add the word 'smurfs' to the class's noun list, but
that won't help a bit. It gives me this:

> take smurfs
Taken.

> i
You have a smurf.

> l
You can see six smurfs here.

No, no, no! I just picked them all up! Except of course that I didn't,
because the parser thinks 'smurfs' is a synonym for 'smurf', not a
plural term indicating the whole class. So the question is, how can I
convince TADS that 'smurfs' is a word that refers to all of the nearby
instances of the class **as a group**? I've looked through adv.t, but
the thing class doesn't appear to have a suitable widget. (It doesn't
seem to declare the noun and adjective properties at all, let alone
allow you to declare a pluralnoun list.)

Not only that, but the class would need a plural_ldesc, which would be
displayed if the user typed 'x smurfs' rather than 'x smurf'. This
appears so basic to me that I can't help thinking there must be an easy
solution, but I haven't found it in the manual.

The manual, in fact, bails on this subject. In Chapter Ten there's a
discussion of how to let the player take one match from a matchbook.
After describing the technique, the manual says this: "Note one flaw in
this implementation: the player might not have the match, but still
can't take another until the first is destroyed. This could be
confusing. For example, the player may take a match, then later drop it
because his hands are full, then move to a different room. As far as the
player is concerned, no match is present - he left the match in another
room, and may not even remember where. However, he won't be able to take
another match, because the first match is still in the game. There's no
easy way to fix this."

Chapter Ten then goes on to refer the reader to the discussion of
Indistinguishable Objects in Chapter Five. But there's nothing in
Chapter Five that solves the problem.

I can create a group_of_smurfs object, as if it were the matchbook
described in the manual. I can add a single_smurf object so the
player can pick up a single smurf and take it elsewhere. After which,
she might inconsiderately drop the smurf (they're smelly, and they
squirm a lot), come back to where she started, and try to take another.
Okay, so let's say I create seven singular smurfs and a group_of_smurfs,
and when she comes back to Smurf Hall she can pick up another, because
somehow I've deployed it there without making a mess. So she carries the
second smurf off to the place where she dropped the first one, and drops
the second one beside the first one. All seems to be going well ... but
then this happens:

> l
You can see two smurfs here.

> take smurfs
I don't see any smurfs here.

There simply HAS to be a way to get this situation to work
properly. Granted, it's a deep logic problem, but I can't quite believe
a fully developed IF language doesn't have any way to handle it. I
*like* TADS, damn it! And at this point I've got 300+K of code already
written, so I'd really rather not have to convert it all to TADS 3
<<whimper>>, assuming TADS 3 solves the problem. (Does it? Tell me it does.)

Suggestions humbly welcomed....

--Jim Aikin

************************************
"Those instances of it which lack
the quality referred to as 'swing'
are meaningless." --Duke Ellington
************************************

Ally M.

unread,
Aug 4, 2002, 6:08:12 AM8/4/02
to
Jim Aikin <kill_spammers@kill_spammers.org> wrote in
news:3D4CC253.6030708@kill_spammers.org:

Sure it does, but until then you might try something like this:

class smurf: item, floatingItem // uhm, what's the floatingItem for?


noun = 'smurf'
adjective = 'purple' 'fat'

plural = 'smurfs'

sdesc = "smurf"
pluraldesc = "smurfs"

ldesc = "It's a fat purple smurf. "
;

// (Being lazy, I created but five instances of class smurf here...)

>l
Some Room
You see five smurfs here.

>get smurfs
smurf: Taken.
smurf: Taken.
smurf: Taken.
smurf: Taken.
smurf: Taken.

>drop 3 smurfs
smurf: Dropped.
smurf: Dropped.
smurf: Dropped.

>get a smurf
Taken.

>i
You have three smurfs.

>l
Some Room
You see two smurfs here.


Good luck,

~Ally

Jim Aikin

unread,
Aug 4, 2002, 3:36:50 PM8/4/02
to
Ally M. wrote:


> class smurf: item, floatingItem // uhm, what's the floatingItem for?
> noun = 'smurf'
> adjective = 'purple' 'fat'
> plural = 'smurfs'
> sdesc = "smurf"
> pluraldesc = "smurfs"
ldesc = "It's a fat purple smurf. "
> ;


Aha! Somehow I missed the fact that a plural wordlist could be declared.
And here I've just spent the whole morning creating a much more
convoluted method involving a plural_smurfs object that's located in the
player (but invisible). My method is kind of cute, but I'll test the
basic version and see if I'm actually adding any useful functionality.

Thanks!

--Jim Aikin

Jim Aikin

unread,
Aug 4, 2002, 4:48:46 PM8/4/02
to
Ally M. wrote:


> class smurf: item, floatingItem
> noun = 'smurf'
> adjective = 'purple' 'fat'

> plural = 'smurfs'
> sdesc = "smurf"
> pluraldesc = "smurfs"
> ldesc = "It's a fat purple smurf. "
> ;


Turns out my hand-coded method is quite a bit nicer. If anybody wants to
try it, put a message in this thread and I'll post the code. My approach
intelligently distinguishes between descriptions for plural and
singular, so you can get this type of output:

> x smurfs
The smurfs are fat and purple.

It also restricts the player to using a plural only when it's
appropriate, and reports the results in a concise manner:

> drop smurfs
You're only holding one at the moment.

> take smurfs
You gather up the smurfs.

This is much tidier than what you get with the default behavior for
indistinguishables:

>take smurfs


smurf: Taken.
smurf: Taken.
smurf: Taken.

...or this (shudder):

> drop smurfs
smurf: You're not carrying the smurf.
smurf: You're not carrying the smurf.
smurf: You're not carrying the smurf.
smurf: You're not carrying the smurf.
smurf: You're not carrying the smurf.
smurf: You're not carrying the smurf.
smurf: You're not carrying the smurf.

--Jim Aikin

Ally M.

unread,
Aug 4, 2002, 6:07:15 PM8/4/02
to
Jim Aikin <kill_spammers@kill_spammers.org> wrote in news:3D4D9356.8020206
@kill_spammers.org:

> Turns out my hand-coded method is quite a bit nicer. If anybody wants to
> try it, put a message in this thread and I'll post the code. My approach
> intelligently distinguishes between descriptions for plural and
> singular, so you can get this type of output:

[neat transcript snipped]

I hope I'll be using T3 by the time I make my overdue comeback, but this
sounds like something that could be pretty useful to others if it's
reusable enough. Either way, I'd like to take a look.

~Ally

--
kitzapoo at gmx dot co dot uk
when all else fails, meow

Jim Aikin

unread,
Aug 4, 2002, 7:04:02 PM8/4/02
to
Ally M. wrote:


> I hope I'll be using T3 by the time I make my overdue comeback, but this
> sounds like something that could be pretty useful to others if it's
> reusable enough. Either way, I'd like to take a look.


Here 'tis. Some editing required.

--JA

/**************************************************************************************

The idea of this module (or mockup, or whatever you want to call it) is that there's a
plural object (in this case, plural_smurfs) and a bunch of indistinguishable singular objects
(smurfs). The plural_smurfs object is in fact ALWAYS IN SCOPE, because it's located on
the Me object. (If you're planning to switch player characters at any point, you'll need to
modify the code accordingly.)

Because it's always in scope, it needs to pretend not to be there except when more than one
smurf is in the vicinity. Thus the laborious but vital overriding of ALL of the verification
methods. For instance, if the user types "throw smurfs," the plural_smurfs object will
intelligently reply, "I don't see any smurfs here" if there are no smurfs about, or
"There's only one smurf in the vicinity. You'll need to refer to it in the singular form"
if only one is in view (whether or not it's in hand),
or "You'll need to pick them up first" if there are several in view but none is being held,
or "You're only holding one at the moment" if there are several in view but only one is in
hand.

I've alpha-tested the algorithm, but if you spot any bugs, please email me (jaikin at
sbcglobal dot net) and let me know. In order to use it, you will of course need to replace
all of the instances of "smurf" (etc.) with the type of object you're using.

(c) 2002 Jim Aikin, but feel free to use or adapt it in your own game at no cost.

****************************************************************************************/

plural_smurfs: fixeditem
location = Me
noun = 'smurfs'
adjective = 'purple' 'fat'
isThem = true
sdesc = "smurfs"
ldesc =
{
if (self.check_for_smurfs) "The smurfs are fat and purple. ";
}
number_of_smurfs = 8 /* ONE MORE THAN THE ACTUAL NUMBER OF INDISTINGUISHABLE OBJECTS */
smurf_list = [smurf1 smurf2 smurf3 smurf4 smurf5 smurf6 smurf7]
// In this implementation, smurfs_in_room does not provide valid information if
// the player is in a closed container in the room.
smurfs_in_room =
{
local count := 0;
local i := 1;
local loc;
for (i:=1; i<self.number_of_smurfs; i++)
{
loc := self.smurf_list[i].location;
if ((loc = Me.location) || (loc = Me.location.location)) count += 1;
}
return count;
}
smurfs_being_held =
{
local count := 0;
local i := 1;
for (i:=1; i<self.number_of_smurfs; i++)
{
if (self.smurf_list[i].location = Me) count += 1;
}
// "In smurfs_being_held, count is <<count>>.\n";

return count;
}
// Beware: The smurfs_in_open_containers method only checks one level of nested containers.
// However, it will work correctly whether the container is in the room or the player is
// carrying the container. Note that Me is an open container, and so must be explicitly
// disallowed.
smurfs_in_open_containers =
{
local loc;
local count := 0;
local i := 1;
local container_visible := nil;
for (i:=1; i<self.number_of_smurfs; i++)
{
loc := self.smurf_list[i].location;
if (isclass (loc, container) && (loc <> Me) && loc.contentsVisible)
{
if (loc.location = Me.location) container_visible := true;
if (loc.location.location = Me.location) container_visible := true;
if (loc.location = Me) container_visible := true;
if (loc.location.location = Me) container_visible := true;
if (loc.location = Me.location.location) container_visible := true;
if (loc.location.location = Me.location.location) container_visible := true;
if (container_visible) count += 1;
}
container_visible := nil;
}
return count;
}
count_smurfs_silently =
{
local count := 0;
count += self.smurfs_in_room;
count += self.smurfs_being_held;
count += self.smurfs_in_open_containers;
// "In count_smurfs_silently, count is <<count>>.\n";
return count;
}
// The check_for_smurfs method is used by verb verify routines. It will print
// an error message if there are fewer than 2 smurfs in the vicinity, and then return
// nil, but if there are 2 or more, it will return true and print nothing.
check_for_smurfs =
{
local count := 0;
count := self.count_smurfs_silently;
if (count = 0)
{
"I don't see any smurfs here. ";
return nil;
}
if (count = 1)
{
"There's only one smurf in the vicinity. You'll need to refer to it
in the singular form. ";
return nil;
}
return true;
}
// The find_a_takeable_smurf method is, at present, not smart enough to tell whether a smurf
// is visible but out of reach. It returns the object reference pointer for a takeable smurf.
find_a_takeable_smurf =
{
local i := 1;
local loc;
for (i:=1; i<self.number_of_smurfs; i++)
{
loc := self.smurf_list[i].location;
if (loc = Me.location) return self.smurf_list[i];
if (loc = Me.location.location) return self.smurf_list[i];
if ((loc.location = Me.location) && (loc <> Me)) return self.smurf_list[i];
}
return nil;
}
find_a_droppable_smurf =
{
local i := 1;
local loc;
for (i:=1; i<self.number_of_smurfs; i++)
{
loc := self.smurf_list[i].location;
if (loc = Me) return self.smurf_list[i];
}
return nil;
}
// Overridden by a custom method in my game:
//verDoPush (actor) =
//{
// if (self.check_for_smurfs) "Pushing the smurfs doesn't do anything. ";
//}
verDoAttachTo (actor, iobj) =
{
if (self.check_for_smurfs) pass verDoAttachTo;
}
verIoAttachTo (actor) =
{
if (self.check_for_smurfs) pass verIoAttchTo;
}
verDoDetach (actor) =
{
if (self.check_for_smurfs) pass verDoDetach;
}
verDoDetachFrom (actor) =
{
if (self.check_for_smurfs) pass verDoDetachFrom;
}
verIoDetachFrom (actor) =
{
if (self.check_for_smurfs) pass verIoDetachFrom;
}
verDoWear (actor) =
{
if (self.check_for_smurfs) "You can't wear smurfs. ";
}
verDoUnwear(actor) =
{
if (self.check_for_smurfs) "You're not wearing any smurfs. ";
}
verIoPutIn(actor) =
{
if (self.check_for_smurfs) "You can't put anything in the smurfs. ";
}
verIoPutOn(actor) =
{
if (self.check_for_smurfs) "There's no good surface on the smurfs. ";
}
// Some of the error conditions for the next two will be caught by doTake and doDrop;
// it's less messy that way.
verDoTake (actor) =
{
self.check_for_smurfs;
}
verDoDrop (actor) =
{
self.check_for_smurfs;
}
// We'll only reach the doTake and doDrop methods if there are at least 2 smurfs
// in the vicinity -- but we don't, at this stage, know how many are being held.
doTake (actor) =
{
local count := 0;
local held := 0;
local took_some := 0;
local totbulk, totweight;
local smurf_to_take := nil;
totbulk := addbulk(actor.contents);
totweight := addweight (actor.contents);

count := self.count_smurfs_silently;
held := self.smurfs_being_held;
// "In doTake, held is <<held>> and count is <<count>>.\n";
if (held = count)
{
"You're already holding them all. ";
return;
}
if (held + 1 = count)
{
"I only see one that you're not currently holding. ";
return;
}
// Now we know at least two smurfs are takeable, but we don't yet know which ones.
while (self.find_a_takeable_smurf <> nil)
{
smurf_to_take := self.find_a_takeable_smurf;
totweight := totweight + smurf_to_take.weight;
totbulk := totbulk + smurf_to_take.bulk;
if ((totweight > actor.maxweight) || (totbulk > actor.maxbulk)) goto too_much;
smurf_to_take.moveInto(Me);
took_some += 1;
}
"You gather up the smurfs. ";
return;
too_much:
if (took_some > 1) "You pick up some smurfs, but now you're ";
if (took_some = 1) "You pick up a smurf, but now you're ";
if (took_some = 0) "You're ";
"carrying too much stuff. ";
}
doDrop (actor) =
{
local held := 0;
local smurf_to_drop := nil;

held := self.smurfs_being_held;
if (held = 0)
{
"You aren't holding any of them. ";
return;
}
if (held = 1)
{
"You're only holding one at the moment. ";
return;
}
// Now we know you're holding at least two, but we don't yet know which ones.
while (self.find_a_droppable_smurf <> nil)
{
smurf_to_drop := self.find_a_droppable_smurf;
smurf_to_drop.moveInto (Me.location);
}
"You drop the smurfs. ";
}
verDoPutIn (actor, iobj) =
{
self.check_for_smurfs;
}
doPutIn (actor, iobj) =
{
local held := 0;
local smurf_to_put := nil;

if (iobj = nil) return;
if ((isclass (iobj, smurf)) || (iobj = self))
{
"That makes no sense whatever. ";
return;
}
held := self.smurfs_being_held;
if (held = 0)
{
"You aren't holding any of them. ";
return;
}
if (held = 1)
{
"You're only holding one at the moment. ";
return;
}
// Now we know you're holding at least two, but we don't yet know which ones.
while (self.find_a_droppable_smurf <> nil)
{
smurf_to_put := self.find_a_droppable_smurf;
smurf_to_put.moveInto (iobj);
}
"You put the smurfs in <<iobj.thedesc>>. ";
}
verIoTakeOut (actor) =
{
if (self.check_for_smurfs) "There's nothing in the smurfs. ";
}
verIoTakeOff (actor) =
{
if (self.check_for_smurfs) "There's nothing on the smurfs. ";
}
verDoTakeOff (actor, iobj) =
{
self.check_for_smurfs;
}
doTakeOff (actor, iobj) =
{
// To start with, we know there's more than one smurf around, but they may or may not
// be on the specified surface. Or one may be, while others aren't.

local count := 0;
local i := 1;

for (i:=1; i<self.number_of_smurfs; i++)
{
if (self.smurf_list[i].location = iobj) count += 1;
}
if (count = 0)
{
"There aren't any smurfs on <<iobj.thedesc>>. ";
return;
}
if (count = 1)
{
"There's only one smurf on <<iobj.thedesc>> -- you'll need to refer to the smurf
in the singular. ";
return;
}
// Okay, now we know there are at least two smurfs on iobj, so we're ready to rumble.
for (i:=1; i<self.number_of_smurfs; i++)
{
if (self.smurf_list[i].location = iobj)
self.smurf_list[i].moveInto(actor);
}
"You pick up the smurfs. ";
}

verIoPlugIn (actor) =
{
if (self.check_for_smurfs) "You can't plug anything into smurfs. ";
}
verDoPlugIn (actor, iobj) =
{
if (self.check_for_smurfs) "You can't plug smurfs into anything. ";
}
verIoUnplugFrom (actor) =
{
if (self.check_for_smurfs) "Nothing is plugged into the smurfs. ";
}
verDoUnplugFrom(actor, iobj) =
{
if (self.check_for_smurfs)
{
if (iobj <> nil)
{ "There are no smurfs plugged into <<iobj.thedesc>>. "; }
else "I don't know how to do that. ";
}
}
verDoLookin (actor) =
{
if (self.check_for_smurfs) "There's nothing in the smurfs. ";
}
verDoLookthru(actor) =
{
if (self.check_for_smurfs) "Smurfs are opaque. ";
}
verDoLookunder(actor) =
{
if (self.check_for_smurfs) "There's nothing hidden under the smurfs. ";
}

verDoRead(actor) =
{
if (self.check_for_smurfs) "I don't know how to read "; self.thedesc; ". ";
}
verDoLookbehind(actor) =
{
if (self.check_for_smurfs) "There's nothing noteworthy behind "; self.thedesc; ". ";
}
verDoTurn(actor) =
{
if (self.check_for_smurfs) "Turning the smurfs doesn't have any effect. ";
}
verDoTurnWith(actor, io) =
{
if (self.check_for_smurfs) "Turning <<self.thedesc>> doesn't have any effect. ";
}
verDoTurnTo(actor, io) =
{
if (self.check_for_smurfs) "Turning <<self.thedesc>> doesn't have any effect. ";
}
verIoTurnTo(actor) =
{
if (self.check_for_smurfs) "I don't know how to do that. ";
}
verDoTurnon(actor) =
{
if (self.check_for_smurfs) "The smurfs are not electrically operated. ";
}
verDoTurnoff (actor) =
{
if (self.check_for_smurfs) "I don't know how to turn "; self.thedesc; " off. ";
}
verDoScrew (actor) =
{if (self.check_for_smurfs) "I don't think the smurfs would appreciate that"; }
verDoScrewWith (actor, iobj) = {if (self.check_for_smurfs) "I can see no way to do that.";}
verIoScrewWith (actor) = {if (self.check_for_smurfs) "You can't use smurfs like that."; }
verDoUnscrew (actor) =
{if (self.check_for_smurfs) "The smurfs are not screwed into anything."; }
verDoUnscrewWith (actor, iobj) =
{if (self.check_for_smurfs) "Please try to be more sensible. "; }
verIoUnscrewWith (actor) = {if (self.check_for_smurfs) "You can't use smurfs like that."; }

verDoAskAbout (actor, io) =
{
if (self.check_for_smurfs) "Surely, you can't think the smurfs know anything
about it. ";
}
verDoTellAbout (actor, io) =
{
if (self.check_for_smurfs) "It doesn't look as though the smurfs are interested. ";
}
verDoUnboard (actor) =
{
if (self.check_for_smurfs) "You're not on the smurfs. ";
}

verDoAttackWith (actor, io) =
{
if (self.check_for_smurfs) "Attacking <<self.thedesc>> doesn't appear productive. ";
}
verIoAttackWith (actor) =
{
if (self.check_for_smurfs) "It's not very effective to attack with <<self.thedesc>>. ";
}
verDoEat (actor) =
{
if (self.check_for_smurfs) "The smurfs don't appear appetizing. ";
}
verDoDrink (actor) =
{
if (self.check_for_smurfs) "You can only drink liquids. ";
}
verDoGiveTo (actor, io) =
{
local count := 0;
if (self.check_for_smurfs)
{
count := self.smurfs_being_held;
if (count = 0) { "You'd need to be holding them to do that. "; }
if (count = 1) { "You're only holding one. "; }
}
}
// When we arrive at doGiveTo, we know the actor is holding at least 2 smurfs, but
// we don't know which ones they are.
doGiveTo (actor, io) =
{
local i := 1;
for (i:=1; i<self.number_of_smurfs; i++)
{
if (self.smurf_list[i].location = actor)
self.smurf_list[i].moveInto(io);
}
"Done. ";
}
verDoPull (actor) =
{
if (self.check_for_smurfs) "Pulling "; self.thedesc; " doesn't have any effect. ";
}
verDoThrowAt (actor, io) =
{
local count := 0;
if (self.check_for_smurfs)
{
count := self.smurfs_being_held;
if (count = 0)
{
"You'll need to pick them up first. ";
return;
}
if (count = 1)
{
"You're only holding one at the moment. ";
return;
}
// Now we know the actor is holding two, so we're happy to let them be thrown.
}
}
doThrowAt (actor, io) =
{
local smf := nil;
local i := 1;

for (i:=1; i<self.number_of_smurfs; i++)
{
if (self.smurf_list[i].location = actor)
self.smurf_list[i].moveInto (actor.location);
}
"You hurl the smurfs, but miss. ";
}
verIoThrowAt (actor) =
{
local count := 0;
if (self.check_for_smurfs)
{
count += self.smurfs_in_open_containers;
count += self.smurfs_in_room;
if (count < 2) "You'll need to drop some smurfs in order to do that. ";
}
}
verDoThrowTo (actor, io) =
{
local count := 0;

if (self.check_for_smurfs)
{
count := self.smurfs_being_held;
if (count = 0)
{
"You're not holding any smurfs. ";
return;
}
if (count = 1)
{
"You're only holding one smurf. ";
return;
}
}
}
doThrowTo (actor, io) =
{
local i := 1;
for (i:=1; i<self.number_of_smurfs; i++)
{
self.smurf_list[i].moveInto(actor.location);
}
"You hurl the smurfs, but miss. ";
}
verDoThrow(actor) =
{
local count := 0;
if (self.check_for_smurfs)
{
count := self.smurfs_being_held;
if (count = 0)
{
"You're not holding any smurfs. ";
return;
}
if (count = 1)
{
"You're only holding one smurf. ";
return;
}
}
}
doThrow (actor) =
{
local i := 1;
for (i:=1; i<self.number_of_smurfs; i++)
{
self.smurf_list[i].moveInto(actor.location);
}
"You hurl the smurfs. ";
}
verDoShowTo (actor, io) = { self.check_for_smurfs; }

verIoShowTo (actor) =
{
if (self.check_for_smurfs) "The smurfs aren't impressed. ";
}
verDoClean (actor) =
{
if (self.check_for_smurfs) "The smurfs look a bit cleaner now. ";
}
verDoCleanWith (actor, io) = { self.check_for_smurfs; }
doCleanWith (actor, io) =
{
"The smurfs look a bit cleaner now. ";
}
verDoMove (actor) =
{
if (self.check_for_smurfs) "Moving the smurfs doesn't reveal anything. ";
}
verDoMoveTo (actor, io) =
{
if (self.check_for_smurfs) "Moving the smurfs doesn't reveal anything. ";
}
verIoMoveTo (actor) =
{
if (self.check_for_smurfs) "That won't get you anywhere. ";
}
verDoMoveWith (actor, io) =
{
if (self.check_for_smurfs) "Moving the smurfs doesn't reveal anything. ";
}
verIoMoveWith (actor) =
{
if (self.check_for_smurfs) "You're not accomplishing much. ";
}
verDoTouch (actor) =
{
if (self.check_for_smurfs) "Touching the smurfs doesn't seem to have any effect. ";
}
verDoPoke (actor) =
{
if (self.check_for_smurfs) "Poking the smurfs doesn't seem to have any effect. ";
}
verDoBreak(actor) = {if (self.check_for_smurfs) "Smurfs are unbreakable. ";}
;

class smurf: item, floatingItem
noun = 'smurf'
adjective = 'purple' 'fat'

sdesc = "smurf"


ldesc = "It's a fat purple smurf. "

weight = 5
bulk = 5
;

smurf1: smurf
location = startroom
isEquivalent = true
;

smurf2: smurf


location = startroom
isEquivalent = true
;

// Etc. -- add more smurfs and adjust value of number_of_smurfs accordingly.


Stephen L Breslin

unread,
Aug 5, 2002, 2:35:31 AM8/5/02
to
Hi Jim,

Please upload your nice plurals module to the ifarchive. I wouldn't
argue that this isn't the place for over 25 lines of code (some
would), but I would like to see your module next time I look at the
list of modules in the ifarchive. That's the place I'll think to look
when I'm looking for something like that.

Thanks much, and thanks for the module,
Steve Breslin

Jim Aikin

unread,
Aug 5, 2002, 12:53:47 AM8/5/02
to
Stephen L Breslin wrote:


> Please upload your nice plurals module to the ifarchive.


I'm still debugging it. There are a couple of embarrassing snarfles in the version I posted.
Unhappily, the cleaned-up version has a lot of stuff that's very specific to my
work-in-progress (like, you can't take the fungi if they're on the wall, though
you can take them if they're in a container), so I'd have to backtrack to take
that stuff out.

The concept, I think, is sound. If I have time, I'll create a general-purpose
module and upload it, but even aside from my game-specific code, there are
so many possible wrinkles that I'm not sure how general-purpose a module could be.
I'm hard-coding the fact that the Me object is always the player, for instance.
I could replace that with ParserGetMe(), but who knows what else is lurking in there?

--JA

0 new messages