How can I have an item be invisible in the room description (no “An item is here.”) but when I take it it’s visible from that moment on? (I only mention the item in the room description so I don’t want it to be mentioned twice.)
1 Like
Use the Hidden
class on the object and use discover()
to reveal it.
A simple but complete example:
#charset "us-ascii"
#include <adv3.h>
#include <en_us.h>
startRoom: Room 'Void'
"This is a featureless void with a patch of grass. "
;
+me: Person;
+grass: Decoration '(patch) grass' 'grass'
desc() {
"It's a patch of grass. ";
if(!pebble.discovered) {
"You spot a pebble hiding in the grass. ";
pebble.discover();
}
}
;
+pebble: Thing, Hidden 'small round pebble' 'pebble'
"A small, round pebble. "
;
versionInfo: GameID
name = 'sample'
byline = 'nobody'
authorEmail = 'nobody <foo@bar.com>'
desc = '[This space intentionally left blank]'
version = '1.0'
IFID = '12345'
;
gameMain: GameMainDef
initialPlayerChar = me
;
Transcript:
Void
This is a featureless void with a patch of grass.
>take pebble
You see no pebble here.
>x grass
It's a patch of grass. You spot a pebble hiding in the grass.
>l
Void
This is a featureless void with a patch of grass.
You see a pebble here.
>take pebble
Taken.
2 Likes
You can also sometimes get away with something as simple as
isListed = inherited && moved
1 Like