
www.Usenet.com
Group Index
Rec Thread Archive from Usenet.com
[T2] darkroom: making certain things visible
- __From__: David
- __Subject__: [T2] darkroom: making certain things visible
- __Date__: Thu, 04 Dec 2003 10:53:25 -0600
Well, I've started writing a little game to familiarise myself with tads
and i've come up against my first problem. yay!
The general context for the game is this: ever the explorer, our
protagonist, out on a mini potholing adventure, has forgotten to look
before he leaps and has fallen down a 30 foot well. When he comes too
he finds himself in a dark and musty cave.
So the puzzle is, pick up your torch and switch it on so that you can
see around you. I figured this would be a nice easy problem to start on.
Well, I made a darkroom and that's where my trouble began, because dark
means dark, not mostly dark. So I need to do two things, firstly
describe the room when it's dark as being "not entirely dark" and then
make the torch always visible so that I can bend down and pick it up.
Here's what I've managed so far:
startroom: darkroom
sdesc = "Spring Room"
ldesc = {
if(not self.lightsOn){ //this did say *if(not torch.islit)*
"You are standing in a dark, empty space. The air is moist and
odourless. There is no sense of this space having a begining or end and
if it weren't for the firmness of the ground under your feet and the
shaft of light that provides some immediate (but little) illumination,
you could be forgiven for thinking you had fallen off the edge of the
world itself, into an endless oblivion.";
}
else if(self.lightsOn){
"Shining your torch around you can see that you are inside what
appears to be a semi-mined cave. It's actually quite small and gives
you a sense of claustrophobia, which amuses you slightly, since not long
ago you were feeling uneasy about being in the depths of some vast
chasm.... etc, etc, blah, blah.";
}
}
north = summerRoom
east = winterRoom
;
---------
My lightsource is working fine so I won't bother posting the code for
that here. The source compiles but if I try to do anything all I get is
a message telling me "it's pitch black."
I was hoping the above code would let me bypass the "it's pitch black"
description for my own but since it didn't, I'm not sure how to proceed.
lightsOn == nil so I would expect the *if* statement to return my
desc. I think I'm on the right lines but I'm obviously missing a point
here somewhere.
As for making the torch visible, I haven't got a clue. I browsed these
newsgroups and found an old post titled, "[TADS] TIP OF THE DAY: Looking
into Visibility" which, although is very descriptive, I don't think was
intended for newbies like myself. Much of it made little sense to me.
Any help on these two points would be much appreciated.
PS. Thanks mjr for writing such a complete piece of software. My
imagination is running wild as I assess the possibilities! =D
- [T2] darkroom: making certain things visible,
David