by Roody_Yogurt » Thu Jun 06, 2013 1:37 am
Last year, I volunteered to betatest this guy's Inform implementation of the ICOM game, The Uninvited.
In the first room (a car), I was dismayed to get this response:
>OPEN GLOVE COMPARTMENT
Opened.
(notice the lack of a content-listing)
Now, part of the problem was that the glove compartment
was empty, but any suggestion that I have to LOOK IN a container right after opening it just sends me into a fury (I don't know why).
For a long while, I've been meaning to take a closer look at how Hugo handles it. It turns out that if the container has children, Hugo will list them if the container is not set quiet (so, not until you have LOOKed IN it).
Here is an alternative behavior, where the container lists its children (or lack thereof) on the first opening regardless- but does not list them again:
Code: Select all
replace DoOpen
{
if not CheckReach(object): return false
if object is not openable
{
VMessage(&DoOpen, 1) ! "You can't open that."
return
}
elseif object is open
VMessage(&DoOpen, 2) ! "It's already open."
elseif object is locked
VMessage(&DoOpen, 3) ! "It's locked."
else
{
object is open
if not object.after
{
VMessage(&DoOpen, 4) ! "Opened."
FindLight(location) ! in case the light source
! has been revealed
if object is not moved
{
""
Perform(&DoLookIn, object)
}
}
object is moved
}
return true
}
Now, this code will only really work with non-takeable containers, as objects are also given the moved attribute when taken. Still, I think I am happier with this than the default, and I have not landed on anything that would work well for everything.
Last year, I volunteered to betatest this guy's Inform implementation of the ICOM game, The Uninvited.
In the first room (a car), I was dismayed to get this response:
[quote]>OPEN GLOVE COMPARTMENT
Opened.[/quote]
(notice the lack of a content-listing)
Now, part of the problem was that the glove compartment [i]was[/i] empty, but any suggestion that I have to LOOK IN a container right after opening it just sends me into a fury (I don't know why).
For a long while, I've been meaning to take a closer look at how Hugo handles it. It turns out that if the container has children, Hugo will list them if the container is not set quiet (so, not until you have LOOKed IN it).
Here is an alternative behavior, where the container lists its children (or lack thereof) on the first opening regardless- but does not list them again:
[code]replace DoOpen
{
if not CheckReach(object): return false
if object is not openable
{
VMessage(&DoOpen, 1) ! "You can't open that."
return
}
elseif object is open
VMessage(&DoOpen, 2) ! "It's already open."
elseif object is locked
VMessage(&DoOpen, 3) ! "It's locked."
else
{
object is open
if not object.after
{
VMessage(&DoOpen, 4) ! "Opened."
FindLight(location) ! in case the light source
! has been revealed
if object is not moved
{
""
Perform(&DoLookIn, object)
}
}
object is moved
}
return true
}[/code]
Now, this code will only really work with non-takeable containers, as objects are also given the moved attribute when taken. Still, I think I am happier with this than the default, and I have not landed on anything that would work well for everything.