mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:17:24 +02:00
Fix issues in several tutorial scripts
This commit is contained in:
parent
e58cd53fe5
commit
97fbdc7c20
4 changed files with 24 additions and 7 deletions
|
@ -11,7 +11,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
Script.include('utils.js');
|
Script.include('utils.js');
|
||||||
|
|
||||||
var DEBUG = false;
|
var DEBUG = true;
|
||||||
function debug() {
|
function debug() {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
var args = Array.prototype.slice.call(arguments);
|
var args = Array.prototype.slice.call(arguments);
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
Script.setTimeout(function() {
|
Script.setTimeout(function() {
|
||||||
debug("Setting fuse to inactive");
|
debug("Setting fuse to inactive");
|
||||||
active = false;
|
active = false;
|
||||||
}, 10000);
|
}, 14000);
|
||||||
},
|
},
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
debug("Preload");
|
debug("Preload");
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var DEBUG = false;
|
var DEBUG = true;
|
||||||
function debug() {
|
function debug() {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
print.apply(self, arguments);
|
print.apply(this, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
print("TutorialStartZone | Parent ID is: ", parentID);
|
print("TutorialStartZone | Parent ID is: ", parentID);
|
||||||
if (parentID) {
|
if (parentID) {
|
||||||
print("TutorialStartZone | Sending start");
|
print("TutorialStartZone | Sending start");
|
||||||
Entities.callEntityMethod(parentID, 'start');
|
Entities.callEntityMethod(parentID, 'onEnteredStartZone');
|
||||||
} else {
|
} else {
|
||||||
print("TutorialStartZone | ERROR: No parent id found on tutorial start zone");
|
print("TutorialStartZone | ERROR: No parent id found on tutorial start zone");
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,12 @@
|
||||||
if (this.sendStartIntervalID) {
|
if (this.sendStartIntervalID) {
|
||||||
Script.clearInterval(this.sendStartIntervalID);
|
Script.clearInterval(this.sendStartIntervalID);
|
||||||
}
|
}
|
||||||
|
var parentID = Entities.getEntityProperties(this.entityID, 'parentID').parentID;
|
||||||
|
print("TutorialStartZone | Parent ID is: ", parentID);
|
||||||
|
if (parentID) {
|
||||||
|
print("TutorialStartZone | Sending onLeftStartZone");
|
||||||
|
Entities.callEntityMethod(parentID, 'on');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,11 +59,13 @@ if (!Function.prototype.bind) {
|
||||||
print("TutorialZone | Preload");
|
print("TutorialZone | Preload");
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
},
|
},
|
||||||
start: function() {
|
onEnteredStartZone: function() {
|
||||||
print("TutorialZone | Got start");
|
print("TutorialZone | Got onEnteredStartZone");
|
||||||
var self = this;
|
var self = this;
|
||||||
if (!this.token) {
|
if (!this.token) {
|
||||||
print("TutorialZone | Creating token");
|
print("TutorialZone | Creating token");
|
||||||
|
// The start zone has been entered, hide the overlays immediately
|
||||||
|
Menu.setIsOptionChecked("Overlays", false);
|
||||||
this.token = new OwnershipToken(Math.random() * 100000, this.entityID, {
|
this.token = new OwnershipToken(Math.random() * 100000, this.entityID, {
|
||||||
onGainedOwnership: function(token) {
|
onGainedOwnership: function(token) {
|
||||||
print("TutorialZone | GOT OWNERSHIP");
|
print("TutorialZone | GOT OWNERSHIP");
|
||||||
|
@ -91,6 +93,15 @@ if (!Function.prototype.bind) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLeftStartZone: function() {
|
||||||
|
print("TutorialZone | Got onLeftStartZone");
|
||||||
|
|
||||||
|
// If the start zone was exited, and the tutorial hasn't started, go ahead and
|
||||||
|
// re-enable the HUD/Overlays
|
||||||
|
if (!self.tutorialManager) {
|
||||||
|
Menu.setIsOptionChecked("Overlays", true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
enterEntity: function() {
|
enterEntity: function() {
|
||||||
print("TutorialZone | ENTERED THE TUTORIAL AREA");
|
print("TutorialZone | ENTERED THE TUTORIAL AREA");
|
||||||
|
|
Loading…
Reference in a new issue