I've tried working on the advise you gave me, Ashen, but I keep getting a parse error. This is the firs global variable I've created, so I put the whole script here, in case you can find out what it keeps complaining about. I've been changing bits and pieces of this for the last hour and something, and am gettin a little bit frustrated. ^^ This might, again, be just something I missed 'cause I lack experience, but heck!
//This is the room script for the door
#sectionstart region1_a // DO NOT EDIT OR REMOVE THIS LINE
function region1_a() {
// script for Region 1: Player walks onto region
if (doorsopen == false) {
SetObjectView(0, 3);
AnimateObject(0, 1, 3, false);
// this opens the door
//the next line has an error(?)
doorsopen == true;
}
}
#sectionend region1_a // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart region1_b // DO NOT EDIT OR REMOVE THIS LINE
function region1_b() {
// script for Region 1: Player walks off region
if (doorsopen == true) {
SetObjectView(0, 4);
AnimateObject(0, 1, 3, false);
// this closes the door
doorsopen == false;
}
}
//This is the global script used to create the bool
bool doorsopen;
export doorsopen;
Elsewhere in the game I have door that are opened bu pushing a switch, and I have the doors remain open as you enter/exit the door, but now the script is on a region near the door, as you can see. This poses a totally different challenge, as in the current situation, when the player enters the next room, he is already standing on the region that opens the door, and triggering the door opening animation. I cant disable the region and activate it later, because it would not close the door then, as the player get further away from the door.
Hope you're still following me here.
//This is the room script for the door
#sectionstart region1_a // DO NOT EDIT OR REMOVE THIS LINE
function region1_a() {
// script for Region 1: Player walks onto region
if (doorsopen == false) {
SetObjectView(0, 3);
AnimateObject(0, 1, 3, false);
// this opens the door
//the next line has an error(?)
doorsopen == true;
}
}
#sectionend region1_a // DO NOT EDIT OR REMOVE THIS LINE
#sectionstart region1_b // DO NOT EDIT OR REMOVE THIS LINE
function region1_b() {
// script for Region 1: Player walks off region
if (doorsopen == true) {
SetObjectView(0, 4);
AnimateObject(0, 1, 3, false);
// this closes the door
doorsopen == false;
}
}
//This is the global script used to create the bool
bool doorsopen;
export doorsopen;
Elsewhere in the game I have door that are opened bu pushing a switch, and I have the doors remain open as you enter/exit the door, but now the script is on a region near the door, as you can see. This poses a totally different challenge, as in the current situation, when the player enters the next room, he is already standing on the region that opens the door, and triggering the door opening animation. I cant disable the region and activate it later, because it would not close the door then, as the player get further away from the door.
Hope you're still following me here.