[inform] player has pockets

3 views
Skip to first unread message

Jim Aikin

unread,
Apr 18, 1999, 3:00:00 AM4/18/99
to
Here's a little conundrum I haven't been able to solve. Suggestions
welcome!

For the sake of realism, I want the player object to have pockets, into
which small objects can be put. That's easy. I've fixed it so the
Pockets object isn't actually a container, which prevents the otherwise
annoying behavior of your needing to open the pockets, or, if they're
open, the ability to examine the stuff that's in the pockets without
taking it OUT of the pockets. I created my own Search routine to
inventory the contents of the pockets. And of course, trying to Drop the
Pockets object only gives you an error message.

So far, so good.

My game also includes a SACK_OBJECT, which uses the perfectly delightful
default Inform behavior that little-used objects will be tucked away
into the SACK_OBJECT when you try to pick up more things than you can
carry. Works like a charm.

The problem is, when I pick up too many things, Inform insists on
putting the Pockets object into the SACK_OBJECT!

What I've tried so far: Giving the SACK_OBJECT a line like this:

before [; Receive: if (noun == Pockets) rtrue;

This does indeed prevent the Pockets object from being tucked into the
SACK_OBJECT automatically. But it also prevents your actually picking up
whatever it is you're trying to pick up, because the rtrue aborts the
ENTIRE process, not just the <PutIn Pockets Sack> action.
(smmgggllffrrdddwwggll...)

What I may need to do is hack the library mechanism so that anything
with user-declared Attribute pock is skipped by the SACK_OBJECT routine.
Has anybody tried this? An alternative that might be a lot easier: Can I
give the player object an add_to_scope routine that would make the
Pockets object available? Tonight I'll try that, using some syntax like

player.add_to_scope = #r$PocketScope;

[PocketScope; return Pockets;];

Might work.... Thanks for everybody's help, past, present, and future!

--Jim Aikin (

Jim Aikin

unread,
Apr 18, 1999, 3:00:00 AM4/18/99
to
Solved my own problem. In verblibm.h is the following line:

objectloop (k in player)
if (k~=SACK_OBJECT && k hasnt worn && k hasnt light) j=k;

...whose utility is pretty obvious. I created an Attribute is_pocket and
edited the line like this:

objectloop (k in player)
if (k~=SACK_OBJECT && k hasnt worn && k hasnt light && k hasnt
is_pocket) j=k;

Works perfectly -- and anything I don't want the program to put into the
sack (such as a stepladder) can be given is_pocket.

I wish they were all that easy....

--Jim Aikin

Dan Schmidt

unread,
Apr 19, 1999, 3:00:00 AM4/19/99
to
On Sun, 18 Apr 1999 18:21:59 -0700, Jim Aikin <jaikin....@pacbell.net>
wrote:

Yay! I would suggest two things:

1) Use the 'Replace' functionality of Inform, so you can put your new
implementation of AttemptToTakeObject in your game file instead of
stomping over the library file.

2) 'is_pocket' is a weird name. You're not really testing whether
something is a pocket; you're testing whether it can be put in the
sack. Seeing 'give stepladder is_pocket' makes me wanna hurl. How
about 'unsackable' or 'unstashable'?

--
Dan Schmidt -> df...@thecia.net, df...@alum.mit.edu
Honest Bob & the http://www2.thecia.net/users/dfan/
Factory-to-Dealer Incentives -> http://www2.thecia.net/users/dfan/hbob/
Gamelan Galak Tika -> http://web.mit.edu/galak-tika/www/

Gunther Schmidl

unread,
Apr 19, 1999, 3:00:00 AM4/19/99
to
> :Here's a little conundrum I haven't been able to solve. Suggestions

> :welcome!
> :
> :For the sake of realism, I want the player object to have pockets
>
>
Nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!!!
>
>
> somebody hiding under his bed.

Gunther says, "EEEAGH! BAR!"
<Gunther> has disconnected.
<Gunther> has connected.

--
+------------------------+----------------------------------------------+
+ Gunther Schmidl + "I couldn't help it. I can resist everything +
+ Ferd.-Markl-Str. 39/16 + except temptation" -- Oscar Wilde +
+ A-4040 LINZ +---------------+------------------------------+
+ Tel: 0732 25 28 57 + ICQ: 22447430 + IF: http://sgu.home.dhs.org/ +
+------------------------+---+-----------+------------------------------+
+ gschmidl (at) gmx (dot) at + please remove the "xxx." before replying +
+----------------------------+------------------------------------------+

Joanna Marie Delaune

unread,
Apr 19, 1999, 3:00:00 AM4/19/99
to
Dan Schmidt (df...@thecia.net) wrote:

: | Works perfectly -- and anything I don't want the program to put into the


: | sack (such as a stepladder) can be given is_pocket.

: Yay! I would suggest two things:

: 1) Use the 'Replace' functionality of Inform, so you can put your new
: implementation of AttemptToTakeObject in your game file instead of
: stomping over the library file.

: 2) 'is_pocket' is a weird name. You're not really testing whether
: something is a pocket; you're testing whether it can be put in the
: sack. Seeing 'give stepladder is_pocket' makes me wanna hurl. How
: about 'unsackable' or 'unstashable'?

I just have an idea to contribute; I'm not sure how you'd deal with the
failure of putting something like a stepladder in the pocket when you are
trying to take something else-- but maybe it would be neat if you had the
player automatically drop the thing-to-put-away on the ground if it
wouldn't fit in the pocket, and then pick up the new object.

Of course maybe that would just be a pain in the rear.

but anyway!

Joanna M. DeLaune
jdel...@ocean.otr.usm.edu

Doeadeer3

unread,
Apr 19, 1999, 3:00:00 AM4/19/99
to
>Subject: Re: [inform] pockets: solution
>From: jdel...@ocean.otr.usm.edu (Joanna Marie Delaune)
>Date: 4/19/99 9:22 AM Pacific Daylight Time

>I just have an idea to contribute; I'm not sure how you'd deal with the
>failure of putting something like a stepladder in the pocket when you are
>trying to take something else-- but maybe it would be neat if you had the
>player automatically drop the thing-to-put-away on the ground if it
>wouldn't fit in the pocket, and then pick up the new object.

Here is my findobject routine that does basically that. I include it in every
game I write:

! When player searches and finds a hidden object, this automatically
! puts it in the player's "hands", if hands are full it puts a
! carried object in the sack object to make room for the new object in
! the player's hands (if sack is carried and has room) or it just puts
! the new object in the location.
[ FindObject item j k;
k = NCarried();
if ((k+1) > player.capacity)
{ if (SACK_OBJECT notin player){
move item to location;
rtrue; }
k = 0;
objectloop (j in player)
if ((j ~= SACK_OBJECT && j hasnt worn && j hasnt light) &&
((j provides size) && (j.size <= 5)))
k = j;
if (k ~= 0){
if (SACK_OBJECT hasnt open) give SACK_OBJECT open;
keep_silent=1; <Insert k SACK_OBJECT>; keep_silent=0;
if (k in SACK_OBJECT){
give item moved;
move item to player;
rtrue; }
}
move item to location;
rtrue;
}
give item moved;
move item to player;
rtrue;
];

I also make a sack object restricted as to size. I.E. Big things won't fit in
it. This routine doesn' treplace a library routine, is used when the player
searches (or something) and finds a hidden object, but would be easily to
modify for other uses.

HTH HAND

Doe :-)


Doe doea...@aol.com (formerly known as FemaleDeer)
****************************************************************************
"In all matters of opinion, our adversaries are insane." Mark Twain

Jim Aikin

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to

Anson Turner wrote:

> :Here's a little conundrum I haven't been able to solve. Suggestions
> :welcome!
> :
> :For the sake of realism, I want the player object to have pockets
>
Noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo!!!

Gee, Anson -- Should I assume you're not as devoted to the cause of
interactive realism as I am, or that you have some kind of issue around
pockets? Be glad I didn't give the player teeth....

The screams are so loud your teeth are beginning to hurt.

>x teeth
That's funny. Two of your molars seem to have little tiny hatch covers
in their sides.

>open tooth
Do you want to open the left molar, or the right molar?

>open left molar
There is a tiny radio receiver in the left molar. Doubtless that's where
all the ghostly voices have been coming from.

>open right molar
Oh, no! That's the one with the cyanide capsule in it!

*** You have died. ***

--Jim Aikin

Reply all
Reply to author
Forward
0 new messages