by Sandsquish » Wed Apr 13, 2005 3:59 pm
Sandsquish wrote:verbroutine will do it.
What I should have said was, verbroutine should do it, but it didn't. The compiler doesn't seem to like the "complex property block heading: if" in a before routine.
Here's the relevant sections of the code. If you remove the mirror, so that this will compile, you'll notice that platforms won't allow the chess piece to be put on them. Help, please.
Code: Select all
room drawingRoom "Drawing Room"
{
noun "snow"
long_desc
"The gentle sound of snow against the window pane suggests that
it's cold outside, and you're glad to be here in the warmth.
The drawing-room is reflected in the large looking-glass on the
wall above the mantelpiece, and a very comfortable room it is
too, with a warm hearth, a soft rug, and an arm-chair that you
can curl up and sleep in."
}
object redQueen "red queen"
{
noun "queen"
adjective "red"
article "the"
long_desc
"She's a fierce little chess piece."
in drawingRoom
}
object chessBoard "chess board"
{
nouns "board", "chessboard"
adjectives "chess", "checker", "chequer"
article "the"
initial_desc
"An abandoned chess board lies on the floor."
long_desc
"It's left here from the game you were playing just now, but the
pieces are all missing - the kittens will insist on playing
with them."
is platform ! But you can't put anything
in drawingRoom ! on it, there's "no room"
}
attribute nearMantel ! Is the chair near the mantel?
object armchair "armchair"
{
nouns "chair", "armchair"
adjective "arm"
article "the"
long_desc
"It's a huge armchair, the perfect place for a kitten or a
little girl to curl up in and doze."
before
{
object DoMove, DoPush, DoPull
{
! Check for the kittens here
if self is nearMantel
{
self is not nearMantel
"You push the armchair away from the hearth."
}
else
{
self is nearMantel
"You push the armchair over to the hearth."
}
}
}
is hidden, static, platform, enterable, not nearMantel
in drawingRoom
}
object mantelpiece "mantelpiece"
{
nouns "mantelpiece" "mantel"
article "the"
long_desc
"It's higher off the ground than your head, but it looks wide
enough and sturdy enough to support you."
before
{
object DoEnter, DoClimb
{
if player not in armchair
"The mantelpiece is much too high to climb
up onto."
elseif armchair is not nearMantel
"You can't reach the mantelpiece from here."
elseif WhatsIn(player) > 0
"Your hands are too full."
else
return false ! The library wants the player
} ! to exit the armchair first
xobject DoPutIn, DoTakeOff
{
if player not in self and
(player not in armchair or
armchair is not nearMantel)
"The mantelpiece is so high that you
can't reach."
else
return false ! The library says "no room"
}
}
is hidden, static, platform, enterable
in drawingRoom
}
object mirror "looking glass"
{
nouns "mirror" "glass"
adjectives "looking"
article "the"
long_desc
{
if player in mantelpiece
"Strangely, the glass is beginning to melt away, just like
a bright silvery mist."
elseif player in armchair
"In the looking glass you can see the drawing room of the
looking-glass house. What you can see is very much the
same as this drawing room, only all reversed, left for
right. But you are sure that out of the corners of the
glass, where you can't see, the looking-glass world is
quite different from yours."
else
"In the looking-glass you can see the ceiling of the
drawing room of the looking-glass house. It looks much
the same as the ceiling of your drawing room."
}
before
{
if verbRoutine ~= DoLook and player not in mantelpiece
"You can't reach the looking glass from where you're
standing."
object DoTouch, DoMove, DoPush, DoPull
{
"Your hand goes right through the silvery mist!"
}
object DoEnter
{
"Your hand goes right through the silvery mist, and
in another moment the rest of you follows, and you
are through the glass ..."
endFlag = 1
}
}
is hidden, static
in drawingRoom
}
[quote="Sandsquish"]verbroutine will do it.[/quote]
What I should have said was, verbroutine should do it, but it didn't. The compiler doesn't seem to like the "complex property block heading: if" in a before routine.
Here's the relevant sections of the code. If you remove the mirror, so that this will compile, you'll notice that platforms won't allow the chess piece to be put on them. Help, please.
[code]
room drawingRoom "Drawing Room"
{
noun "snow"
long_desc
"The gentle sound of snow against the window pane suggests that
it's cold outside, and you're glad to be here in the warmth.
The drawing-room is reflected in the large looking-glass on the
wall above the mantelpiece, and a very comfortable room it is
too, with a warm hearth, a soft rug, and an arm-chair that you
can curl up and sleep in."
}
object redQueen "red queen"
{
noun "queen"
adjective "red"
article "the"
long_desc
"She's a fierce little chess piece."
in drawingRoom
}
object chessBoard "chess board"
{
nouns "board", "chessboard"
adjectives "chess", "checker", "chequer"
article "the"
initial_desc
"An abandoned chess board lies on the floor."
long_desc
"It's left here from the game you were playing just now, but the
pieces are all missing - the kittens will insist on playing
with them."
is platform ! But you can't put anything
in drawingRoom ! on it, there's "no room"
}
attribute nearMantel ! Is the chair near the mantel?
object armchair "armchair"
{
nouns "chair", "armchair"
adjective "arm"
article "the"
long_desc
"It's a huge armchair, the perfect place for a kitten or a
little girl to curl up in and doze."
before
{
object DoMove, DoPush, DoPull
{
! Check for the kittens here
if self is nearMantel
{
self is not nearMantel
"You push the armchair away from the hearth."
}
else
{
self is nearMantel
"You push the armchair over to the hearth."
}
}
}
is hidden, static, platform, enterable, not nearMantel
in drawingRoom
}
object mantelpiece "mantelpiece"
{
nouns "mantelpiece" "mantel"
article "the"
long_desc
"It's higher off the ground than your head, but it looks wide
enough and sturdy enough to support you."
before
{
object DoEnter, DoClimb
{
if player not in armchair
"The mantelpiece is much too high to climb
up onto."
elseif armchair is not nearMantel
"You can't reach the mantelpiece from here."
elseif WhatsIn(player) > 0
"Your hands are too full."
else
return false ! The library wants the player
} ! to exit the armchair first
xobject DoPutIn, DoTakeOff
{
if player not in self and
(player not in armchair or
armchair is not nearMantel)
"The mantelpiece is so high that you
can't reach."
else
return false ! The library says "no room"
}
}
is hidden, static, platform, enterable
in drawingRoom
}
object mirror "looking glass"
{
nouns "mirror" "glass"
adjectives "looking"
article "the"
long_desc
{
if player in mantelpiece
"Strangely, the glass is beginning to melt away, just like
a bright silvery mist."
elseif player in armchair
"In the looking glass you can see the drawing room of the
looking-glass house. What you can see is very much the
same as this drawing room, only all reversed, left for
right. But you are sure that out of the corners of the
glass, where you can't see, the looking-glass world is
quite different from yours."
else
"In the looking-glass you can see the ceiling of the
drawing room of the looking-glass house. It looks much
the same as the ceiling of your drawing room."
}
before
{
if verbRoutine ~= DoLook and player not in mantelpiece
"You can't reach the looking glass from where you're
standing."
object DoTouch, DoMove, DoPush, DoPull
{
"Your hand goes right through the silvery mist!"
}
object DoEnter
{
"Your hand goes right through the silvery mist, and
in another moment the rest of you follows, and you
are through the glass ..."
endFlag = 1
}
}
is hidden, static
in drawingRoom
}
[/code]