I am unable to get an adv3Lite Scene to work.
Harry the player character starts out in his bed. For that one appearance, I want the descriptive text for the Room (his bedroom) to focus on Harry waking up. Then, once he’s out of bed, I want the descriptive text to just tell about the room.
So I have defined the Room to have specialDesc text that is to be used only when the introScene is happening…
harrysBedroom: Room
'<font color=green>Harry\'s Bedroom</font>' 'bedroom'
"To the west was a door to the bathroom, to the east the living room."
specialDesc = "Harry's eyes opened with difficulty. They were red, dry
and nearly glued shut with hangover-induced gunk."
useSpecialDesc = (introScene.isHappening)
;
The introScene is to start when Harry is in bed and end when he is no longer in bed…
introScene: Scene
startsWhen = (harry.isIn(harrysBed))
endsWhen = (!harry.isIn(harrysBed))
whenStarting()
{
"Intro is starting.";
}
;
He’ll never be allowed to get back into the bed, so the wake-up text should only appear once. The text defined in the whenStarting() method is just marker text for my benefit during development, just an indicator that the scene is underway.
The game begins with Harry in bed…
// harry, main character
harry: Actor 'Harry;;man' @harrysBed
""
contType = Carrier
globalParamName = 'harry'
isFixed = true
isHim = true
isInitState = true
ownsContents = true
person = 3
proper = true
;
But the introScene never kicks in…
No indicator text, and the specialDesc text is never displayed.
What am I doing wrong? Is it that Harry never explicitly gets into bed, but rather is there when the game begins? Do I need to explicitly trigger the startsWhen property?
Here’s the complete source…
[code]#charset “us-ascii”
#include <tads.h>
#include “advlite.h”
versionInfo: GameID
IFID = ‘47ca87f1-2d0e-4b54-a776-2bc128e30927’
name = ‘TADS 3 Lite Test Bed’
byline = ‘by Jerry Ford’
htmlByline = ‘by
Jerry Ford’
version = ‘1’
authorEmail = ‘Jerry Ford jerry.o.ford@gmail.com’
desc = ‘Test bed for experimenting with TADS 3 Lite.’
htmlDesc = ‘Test bed for experimenting with TADS 3 Lite.’
;
gameMain: GameMainDef
initialPlayerChar = harry
;
// harry, main character
harry: Actor ‘Harry;;man’ @harrysBed
“”
contType = Carrier
globalParamName = ‘harry’
isFixed = true
isHim = true
isInitState = true
ownsContents = true
person = 3
proper = true
;
harrysBedroom: Room
‘Harry's Bedroom’ ‘bedroom’
“To the west was a door to the bathroom, to the east the living room.”
specialDesc = “Harry’s eyes opened with difficulty. They were red, dry
and nearly glued shut with hangover-induced gunk.”
useSpecialDesc = (introScene.isHappening)
;
- harrysBed: Thing, Container ‘bed;;bed’
“Harry’s Bed”
;
introScene: Scene
startsWhen = (harry.isIn(harrysBed))
endsWhen = (!harry.isIn(harrysBed))
whenStarting()
{
“Intro is starting.”;
}
;
[/code]