content/hifi-content/jedon/SpawnCastle/trigger.js
2022-02-13 23:57:50 +01:00

770 lines
20 KiB
JavaScript

(function(){
var _this = this;
var check1;
var check2;
var check3;
var check4;
var check5;
var check6;
var check7;
var check8;
var check9;
var check10;
var check11;
_this.preload = function(entityID)
{
var props = Entities.getEntityProperties(entityID);
print("Loading properties");
print("Entering entity!!!");
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_4.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.1000,
y: -1.4394,
z: 11.6724
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check1 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_3.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.1214,
y: 1.4672,
z: 11.7165
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check2 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_2.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.2172,
y: 4.4017,
z: 11.8790
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check3 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_1.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.2442,
y: 6.3386,
z: 12.0708
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check4 = Entities.addEntity(pos);
//NEW
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_4.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.6530,
y: -1.7845,
z: 11.7178
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check5 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_3.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.6918,
y: 1.2170,
z: 11.6260
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check6 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_2.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.7903,
y: 4.1446,
z: 11.7839
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check7 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_1.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.9158,
y: 6.0839,
z: 12.0364
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check8 = Entities.addEntity(pos);
//new
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_middle_3.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -8.8903,
y: -2.0476,
z: 11.1028
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check9 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_middle_2.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -8.7981,
y: -0.6599,
z: 11.8766
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check10 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_middle_1.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -8.9196,
y: 2.3931,
z: 11.8024
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check11 = Entities.addEntity(pos);
}
function BuildWall()
{
print("Loading properties");
print("Entering entity!!!");
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_4.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.1000,
y: -1.4394,
z: 11.6724
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check1 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_3.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.1214,
y: 1.4672,
z: 11.7165
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check2 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_2.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.2172,
y: 4.4017,
z: 11.8790
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check3 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_left_1.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -6.2442,
y: 6.3386,
z: 12.0708
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check4 = Entities.addEntity(pos);
//NEW
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_4.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.6530,
y: -1.7845,
z: 11.7178
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check5 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_3.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.6918,
y: 1.2170,
z: 11.6260
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check6 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_2.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.7903,
y: 4.1446,
z: 11.7839
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check7 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_right_1.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -11.9158,
y: 6.0839,
z: 12.0364
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check8 = Entities.addEntity(pos);
//new
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_middle_3.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -8.8903,
y: -2.0476,
z: 11.1028
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check9 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_middle_2.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -8.7981,
y: -0.6599,
z: 11.8766
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check10 = Entities.addEntity(pos);
var pos = {
"name": "AnimatedModel",
"type": "Model",
collidesWith: "static,kinematic",
shapeType: "box",
gravity: {
x: 0,
y: -9.8,
z: 0
},
modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/sets/bitGem/polygon_knights/castle_gate/gate_middle_1.fbx",
dynamic: false,
collisionsWillMove: 1,
"position": {
x: -8.9196,
y: 2.3931,
z: 11.8024
},
"dynamic": false,
"rotation": {
pitch: -.0017,
yaw: -.0017,
roll: -.0017
},
"collisionless": false
};
check11 = Entities.addEntity(pos);
}
Script.setInterval(function() {
print("hey");
Entities.deleteEntity(check1);
Entities.deleteEntity(check2);
Entities.deleteEntity(check3);
Entities.deleteEntity(check4);
Entities.deleteEntity(check5);
Entities.deleteEntity(check6);
Entities.deleteEntity(check7);
Entities.deleteEntity(check8);
Entities.deleteEntity(check9);
Entities.deleteEntity(check10);
Entities.deleteEntity(check11);
BuildWall();
}, 30000)
})