Added scripts and triggers to open the second door.
This commit is contained in:
parent
319ef672df
commit
9ba15227c2
@ -714,18 +714,18 @@
|
||||
<strength>12.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
<yPosition>0</yPosition>
|
||||
<zPosition>0</zPosition>
|
||||
<name>openSecondDoor1</name>
|
||||
<xPosition>-6.5</xPosition>
|
||||
<yPosition>22.0</yPosition>
|
||||
<zPosition>51.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>1.0</distance>
|
||||
<isBiggerThan>false</isBiggerThan>
|
||||
<distance>0.2</distance>
|
||||
<isBiggerThan>true</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>-</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>0</toChangeIdBlue>
|
||||
<luaScript>openSecondDoor1.lua</luaScript>
|
||||
<toChangeIdGreen>1</toChangeIdGreen>
|
||||
<toChangeIdBlue>8</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
</composition>
|
||||
@ -750,18 +750,18 @@
|
||||
<strength>12.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
<yPosition>0</yPosition>
|
||||
<zPosition>0</zPosition>
|
||||
<name>openSecondDoor3</name>
|
||||
<xPosition>-6.5</xPosition>
|
||||
<yPosition>22.0</yPosition>
|
||||
<zPosition>29.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>1.0</distance>
|
||||
<isBiggerThan>false</isBiggerThan>
|
||||
<distance>0.2</distance>
|
||||
<isBiggerThan>true</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>-</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>0</toChangeIdBlue>
|
||||
<luaScript>openSecondDoor3.lua</luaScript>
|
||||
<toChangeIdGreen>1</toChangeIdGreen>
|
||||
<toChangeIdBlue>8</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
</composition>
|
||||
@ -2410,18 +2410,18 @@
|
||||
<strength>12.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
<yPosition>0</yPosition>
|
||||
<zPosition>0</zPosition>
|
||||
<name>openSecondDoor4</name>
|
||||
<xPosition>-53.5</xPosition>
|
||||
<yPosition>22.0</yPosition>
|
||||
<zPosition>51.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>1.0</distance>
|
||||
<isBiggerThan>false</isBiggerThan>
|
||||
<distance>0.2</distance>
|
||||
<isBiggerThan>true</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>-</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>0</toChangeIdBlue>
|
||||
<luaScript>openSecondDoor4.lua</luaScript>
|
||||
<toChangeIdGreen>1</toChangeIdGreen>
|
||||
<toChangeIdBlue>8</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
</composition>
|
||||
@ -2475,18 +2475,18 @@
|
||||
<strength>12.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
<yPosition>0</yPosition>
|
||||
<zPosition>0</zPosition>
|
||||
<name>openSecondDoor2</name>
|
||||
<xPosition>-53.5</xPosition>
|
||||
<yPosition>22.0</yPosition>
|
||||
<zPosition>29.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>1.0</distance>
|
||||
<isBiggerThan>false</isBiggerThan>
|
||||
<distance>0.2</distance>
|
||||
<isBiggerThan>true</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>-</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>0</toChangeIdBlue>
|
||||
<luaScript>openSecondDoor2.lua</luaScript>
|
||||
<toChangeIdGreen>1</toChangeIdGreen>
|
||||
<toChangeIdBlue>8</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
</composition>
|
||||
@ -6153,14 +6153,14 @@
|
||||
<positionConstraint>
|
||||
<objectNum>0</objectNum>
|
||||
<xPosition>17.5</xPosition>
|
||||
<yPosition>22.0</yPosition>
|
||||
<yPosition>21.8</yPosition>
|
||||
<zPosition>159.5</zPosition>
|
||||
<strength>12.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>openFirstDoor</name>
|
||||
<xPosition>17.5</xPosition>
|
||||
<yPosition>22</yPosition>
|
||||
<yPosition>21.8</yPosition>
|
||||
<zPosition>159.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
@ -6175,7 +6175,7 @@
|
||||
<trigger>
|
||||
<name>openFirstDoorUndo</name>
|
||||
<xPosition>17.5</xPosition>
|
||||
<yPosition>22</yPosition>
|
||||
<yPosition>21.8</yPosition>
|
||||
<zPosition>159.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<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