Added scripts and triggers to open the second door.
This commit is contained in:
parent
d5771f8eea
commit
e043fe482a
@ -714,18 +714,18 @@
|
|||||||
<strength>12.0</strength>
|
<strength>12.0</strength>
|
||||||
</positionConstraint>
|
</positionConstraint>
|
||||||
<trigger>
|
<trigger>
|
||||||
<name>-</name>
|
<name>openSecondDoor1</name>
|
||||||
<xPosition>0</xPosition>
|
<xPosition>-6.5</xPosition>
|
||||||
<yPosition>0</yPosition>
|
<yPosition>22.0</yPosition>
|
||||||
<zPosition>0</zPosition>
|
<zPosition>51.5</zPosition>
|
||||||
<targetIdGreen>-</targetIdGreen>
|
<targetIdGreen>-</targetIdGreen>
|
||||||
<targetIdBlue>-</targetIdBlue>
|
<targetIdBlue>-</targetIdBlue>
|
||||||
<distance>1.0</distance>
|
<distance>0.2</distance>
|
||||||
<isBiggerThan>false</isBiggerThan>
|
<isBiggerThan>true</isBiggerThan>
|
||||||
<objectNum>0</objectNum>
|
<objectNum>0</objectNum>
|
||||||
<luaScript>-</luaScript>
|
<luaScript>openSecondDoor1.lua</luaScript>
|
||||||
<toChangeIdGreen>0</toChangeIdGreen>
|
<toChangeIdGreen>1</toChangeIdGreen>
|
||||||
<toChangeIdBlue>0</toChangeIdBlue>
|
<toChangeIdBlue>8</toChangeIdBlue>
|
||||||
<toChangeObjNum>0</toChangeObjNum>
|
<toChangeObjNum>0</toChangeObjNum>
|
||||||
</trigger>
|
</trigger>
|
||||||
</composition>
|
</composition>
|
||||||
@ -750,18 +750,18 @@
|
|||||||
<strength>12.0</strength>
|
<strength>12.0</strength>
|
||||||
</positionConstraint>
|
</positionConstraint>
|
||||||
<trigger>
|
<trigger>
|
||||||
<name>-</name>
|
<name>openSecondDoor3</name>
|
||||||
<xPosition>0</xPosition>
|
<xPosition>-6.5</xPosition>
|
||||||
<yPosition>0</yPosition>
|
<yPosition>22.0</yPosition>
|
||||||
<zPosition>0</zPosition>
|
<zPosition>29.5</zPosition>
|
||||||
<targetIdGreen>-</targetIdGreen>
|
<targetIdGreen>-</targetIdGreen>
|
||||||
<targetIdBlue>-</targetIdBlue>
|
<targetIdBlue>-</targetIdBlue>
|
||||||
<distance>1.0</distance>
|
<distance>0.2</distance>
|
||||||
<isBiggerThan>false</isBiggerThan>
|
<isBiggerThan>true</isBiggerThan>
|
||||||
<objectNum>0</objectNum>
|
<objectNum>0</objectNum>
|
||||||
<luaScript>-</luaScript>
|
<luaScript>openSecondDoor3.lua</luaScript>
|
||||||
<toChangeIdGreen>0</toChangeIdGreen>
|
<toChangeIdGreen>1</toChangeIdGreen>
|
||||||
<toChangeIdBlue>0</toChangeIdBlue>
|
<toChangeIdBlue>8</toChangeIdBlue>
|
||||||
<toChangeObjNum>0</toChangeObjNum>
|
<toChangeObjNum>0</toChangeObjNum>
|
||||||
</trigger>
|
</trigger>
|
||||||
</composition>
|
</composition>
|
||||||
@ -2410,18 +2410,18 @@
|
|||||||
<strength>12.0</strength>
|
<strength>12.0</strength>
|
||||||
</positionConstraint>
|
</positionConstraint>
|
||||||
<trigger>
|
<trigger>
|
||||||
<name>-</name>
|
<name>openSecondDoor4</name>
|
||||||
<xPosition>0</xPosition>
|
<xPosition>-53.5</xPosition>
|
||||||
<yPosition>0</yPosition>
|
<yPosition>22.0</yPosition>
|
||||||
<zPosition>0</zPosition>
|
<zPosition>51.5</zPosition>
|
||||||
<targetIdGreen>-</targetIdGreen>
|
<targetIdGreen>-</targetIdGreen>
|
||||||
<targetIdBlue>-</targetIdBlue>
|
<targetIdBlue>-</targetIdBlue>
|
||||||
<distance>1.0</distance>
|
<distance>0.2</distance>
|
||||||
<isBiggerThan>false</isBiggerThan>
|
<isBiggerThan>true</isBiggerThan>
|
||||||
<objectNum>0</objectNum>
|
<objectNum>0</objectNum>
|
||||||
<luaScript>-</luaScript>
|
<luaScript>openSecondDoor4.lua</luaScript>
|
||||||
<toChangeIdGreen>0</toChangeIdGreen>
|
<toChangeIdGreen>1</toChangeIdGreen>
|
||||||
<toChangeIdBlue>0</toChangeIdBlue>
|
<toChangeIdBlue>8</toChangeIdBlue>
|
||||||
<toChangeObjNum>0</toChangeObjNum>
|
<toChangeObjNum>0</toChangeObjNum>
|
||||||
</trigger>
|
</trigger>
|
||||||
</composition>
|
</composition>
|
||||||
@ -2475,18 +2475,18 @@
|
|||||||
<strength>12.0</strength>
|
<strength>12.0</strength>
|
||||||
</positionConstraint>
|
</positionConstraint>
|
||||||
<trigger>
|
<trigger>
|
||||||
<name>-</name>
|
<name>openSecondDoor2</name>
|
||||||
<xPosition>0</xPosition>
|
<xPosition>-53.5</xPosition>
|
||||||
<yPosition>0</yPosition>
|
<yPosition>22.0</yPosition>
|
||||||
<zPosition>0</zPosition>
|
<zPosition>29.5</zPosition>
|
||||||
<targetIdGreen>-</targetIdGreen>
|
<targetIdGreen>-</targetIdGreen>
|
||||||
<targetIdBlue>-</targetIdBlue>
|
<targetIdBlue>-</targetIdBlue>
|
||||||
<distance>1.0</distance>
|
<distance>0.2</distance>
|
||||||
<isBiggerThan>false</isBiggerThan>
|
<isBiggerThan>true</isBiggerThan>
|
||||||
<objectNum>0</objectNum>
|
<objectNum>0</objectNum>
|
||||||
<luaScript>-</luaScript>
|
<luaScript>openSecondDoor2.lua</luaScript>
|
||||||
<toChangeIdGreen>0</toChangeIdGreen>
|
<toChangeIdGreen>1</toChangeIdGreen>
|
||||||
<toChangeIdBlue>0</toChangeIdBlue>
|
<toChangeIdBlue>8</toChangeIdBlue>
|
||||||
<toChangeObjNum>0</toChangeObjNum>
|
<toChangeObjNum>0</toChangeObjNum>
|
||||||
</trigger>
|
</trigger>
|
||||||
</composition>
|
</composition>
|
||||||
@ -6153,14 +6153,14 @@
|
|||||||
<positionConstraint>
|
<positionConstraint>
|
||||||
<objectNum>0</objectNum>
|
<objectNum>0</objectNum>
|
||||||
<xPosition>17.5</xPosition>
|
<xPosition>17.5</xPosition>
|
||||||
<yPosition>22.0</yPosition>
|
<yPosition>21.8</yPosition>
|
||||||
<zPosition>159.5</zPosition>
|
<zPosition>159.5</zPosition>
|
||||||
<strength>12.0</strength>
|
<strength>12.0</strength>
|
||||||
</positionConstraint>
|
</positionConstraint>
|
||||||
<trigger>
|
<trigger>
|
||||||
<name>openFirstDoor</name>
|
<name>openFirstDoor</name>
|
||||||
<xPosition>17.5</xPosition>
|
<xPosition>17.5</xPosition>
|
||||||
<yPosition>22</yPosition>
|
<yPosition>21.8</yPosition>
|
||||||
<zPosition>159.5</zPosition>
|
<zPosition>159.5</zPosition>
|
||||||
<targetIdGreen>-</targetIdGreen>
|
<targetIdGreen>-</targetIdGreen>
|
||||||
<targetIdBlue>-</targetIdBlue>
|
<targetIdBlue>-</targetIdBlue>
|
||||||
@ -6175,7 +6175,7 @@
|
|||||||
<trigger>
|
<trigger>
|
||||||
<name>openFirstDoorUndo</name>
|
<name>openFirstDoorUndo</name>
|
||||||
<xPosition>17.5</xPosition>
|
<xPosition>17.5</xPosition>
|
||||||
<yPosition>22</yPosition>
|
<yPosition>21.8</yPosition>
|
||||||
<zPosition>159.5</zPosition>
|
<zPosition>159.5</zPosition>
|
||||||
<targetIdGreen>-</targetIdGreen>
|
<targetIdGreen>-</targetIdGreen>
|
||||||
<targetIdBlue>-</targetIdBlue>
|
<targetIdBlue>-</targetIdBlue>
|
||||||
|
38
data/levels/scripts/openSecondDoor1.lua
Normal file
38
data/levels/scripts/openSecondDoor1.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
local global = require( "global" )
|
||||||
|
if(global.triggeredOpenSecondDoor1 == nil) then
|
||||||
|
global.triggeredOpenSecondDoor1 = false
|
||||||
|
end
|
||||||
|
function trigger(objectToChange)
|
||||||
|
if(global.triggeredOpenSecondDoor1 == false) then
|
||||||
|
if(not level) then
|
||||||
|
print("No level found in Lua!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if(global.openSecondDoorCounter == nil) then
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
end
|
||||||
|
if(global.openSecondDoorCounter == 0) then
|
||||||
|
global.openSecondDoorCounter = global.openSecondDoorCounter + 1
|
||||||
|
end
|
||||||
|
global.triggeredOpenSecondDoor1 = true
|
||||||
|
|
||||||
|
if(global.triggeredOpenSecondDoor1 == true and global.triggeredOpenSecondDoor2 == true and global.triggeredOpenSecondDoor3 == true and global.triggeredOpenSecondDoor4 == true) then
|
||||||
|
if(global.openSecondDoorCounter == 4) then
|
||||||
|
local strength = 100
|
||||||
|
local xPos = -81.5
|
||||||
|
local yPos = 33
|
||||||
|
local zPos = 4.5
|
||||||
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||||
|
else
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
global.triggeredOpenSecondDoor1 = false
|
||||||
|
global.triggeredOpenSecondDoor2 = false
|
||||||
|
global.triggeredOpenSecondDoor3 = false
|
||||||
|
global.triggeredOpenSecondDoor4 = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
print("openSecondDoor1")
|
||||||
|
end
|
||||||
|
end
|
38
data/levels/scripts/openSecondDoor2.lua
Normal file
38
data/levels/scripts/openSecondDoor2.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
local global = require( "global" )
|
||||||
|
if(global.triggeredOpenSecondDoor2 == nil) then
|
||||||
|
global.triggeredOpenSecondDoor2 = false
|
||||||
|
end
|
||||||
|
function trigger(objectToChange)
|
||||||
|
if(global.triggeredOpenSecondDoor2 == false) then
|
||||||
|
if(not level) then
|
||||||
|
print("No level found in Lua!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if(global.openSecondDoorCounter == nil) then
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
end
|
||||||
|
if(global.openSecondDoorCounter == 1) then
|
||||||
|
global.openSecondDoorCounter = global.openSecondDoorCounter + 1
|
||||||
|
end
|
||||||
|
global.triggeredOpenSecondDoor2 = true
|
||||||
|
|
||||||
|
if(global.triggeredOpenSecondDoor1 == true and global.triggeredOpenSecondDoor2 == true and global.triggeredOpenSecondDoor3 == true and global.triggeredOpenSecondDoor4 == true) then
|
||||||
|
if(global.openSecondDoorCounter == 4) then
|
||||||
|
local strength = 100
|
||||||
|
local xPos = -81.5
|
||||||
|
local yPos = 33
|
||||||
|
local zPos = 4.5
|
||||||
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||||
|
else
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
global.triggeredOpenSecondDoor1 = false
|
||||||
|
global.triggeredOpenSecondDoor2 = false
|
||||||
|
global.triggeredOpenSecondDoor3 = false
|
||||||
|
global.triggeredOpenSecondDoor4 = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
print("openSecondDoor2")
|
||||||
|
end
|
||||||
|
end
|
38
data/levels/scripts/openSecondDoor3.lua
Normal file
38
data/levels/scripts/openSecondDoor3.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
local global = require( "global" )
|
||||||
|
if(global.triggeredOpenSecondDoor3 == nil) then
|
||||||
|
global.triggeredOpenSecondDoor3 = false
|
||||||
|
end
|
||||||
|
function trigger(objectToChange)
|
||||||
|
if(global.triggeredOpenSecondDoor3 == false) then
|
||||||
|
if(not level) then
|
||||||
|
print("No level found in Lua!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if(global.openSecondDoorCounter == nil) then
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
end
|
||||||
|
if(global.openSecondDoorCounter == 2) then
|
||||||
|
global.openSecondDoorCounter = global.openSecondDoorCounter + 1
|
||||||
|
end
|
||||||
|
global.triggeredOpenSecondDoor3 = true
|
||||||
|
|
||||||
|
if(global.triggeredOpenSecondDoor1 == true and global.triggeredOpenSecondDoor2 == true and global.triggeredOpenSecondDoor3 == true and global.triggeredOpenSecondDoor4 == true) then
|
||||||
|
if(global.openSecondDoorCounter == 4) then
|
||||||
|
local strength = 100
|
||||||
|
local xPos = -81.5
|
||||||
|
local yPos = 33
|
||||||
|
local zPos = 4.5
|
||||||
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||||
|
else
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
global.triggeredOpenSecondDoor1 = false
|
||||||
|
global.triggeredOpenSecondDoor2 = false
|
||||||
|
global.triggeredOpenSecondDoor3 = false
|
||||||
|
global.triggeredOpenSecondDoor4 = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
print("openSecondDoor3")
|
||||||
|
end
|
||||||
|
end
|
38
data/levels/scripts/openSecondDoor4.lua
Normal file
38
data/levels/scripts/openSecondDoor4.lua
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
local global = require( "global" )
|
||||||
|
if(global.triggeredOpenSecondDoor4 == nil) then
|
||||||
|
global.triggeredOpenSecondDoor4 = false
|
||||||
|
end
|
||||||
|
function trigger(objectToChange)
|
||||||
|
if(global.triggeredOpenSecondDoor4 == false) then
|
||||||
|
if(not level) then
|
||||||
|
print("No level found in Lua!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if(global.openSecondDoorCounter == nil) then
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
end
|
||||||
|
if(global.openSecondDoorCounter == 3) then
|
||||||
|
global.openSecondDoorCounter = global.openSecondDoorCounter + 1
|
||||||
|
end
|
||||||
|
global.triggeredOpenSecondDoor4 = true
|
||||||
|
|
||||||
|
if(global.triggeredOpenSecondDoor1 == true and global.triggeredOpenSecondDoor2 == true and global.triggeredOpenSecondDoor3 == true and global.triggeredOpenSecondDoor4 == true) then
|
||||||
|
if(global.openSecondDoorCounter == 4) then
|
||||||
|
local strength = 100
|
||||||
|
local xPos = -81.5
|
||||||
|
local yPos = 33
|
||||||
|
local zPos = 4.5
|
||||||
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||||
|
else
|
||||||
|
global.openSecondDoorCounter = 0
|
||||||
|
global.triggeredOpenSecondDoor1 = false
|
||||||
|
global.triggeredOpenSecondDoor2 = false
|
||||||
|
global.triggeredOpenSecondDoor3 = false
|
||||||
|
global.triggeredOpenSecondDoor4 = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
print("openSecondDoor4")
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user