Cat, the code in the book is meant verbatim, so you should put it there in its entirety. In the book is written:
on "LeftClick"
{
Game.
Interactive =
false;
// We want our player to make more things at once and we don't want to be interrupted.
this.
Active =
false;
// We disable the door so the hotspot is not visible or active anymore. actor.
Talk("Oh no. The door is welded shut.");
}
You replaced the
keyword this with a word Door which is never declared before. That's why your code is not working. I'll try to explain to you the meaning of life err. the *this* keyword.
Imagine you have a pet dog, let's call him Slowey. Now think of your dog as of some WME entity, for example the image of a dog. We'd call this dog internally "object" because apart from his visual side (image of a dog) it also has some behavior - he walks around, waves his tail and bark. This behavior would have been defined in his script file, which is attached to the dog. So at the end of the day, your dog consists of an image and of a script (or more scripts) defining his behavior.
Now the script is internally part of a dog and if you want inside of this script refer to dog itself, you can conveniently refer to dog using the keyword
this.
Now back to your example - and how to correct it (if you really don't want to use my code):
#include "scripts\base.inc"
on "LeftClick"
{
var Door =
Scene.
GetNode("Door");
// we have to tell WME what the Door really is! So instead of using convenient this, we add extra line and define a useless variable. :)
actor.
Talk("Oh no. The door is welded shut.");
}
Hope this helps!