Added lua scripts and triggers for the third door.
This commit is contained in:
parent
cb538cb9ff
commit
80df2aac41
@ -435,7 +435,7 @@
|
||||
<yRot>0.0</yRot>
|
||||
<zRot>0.0</zRot>
|
||||
<scale>1.5</scale>
|
||||
<mass>0.0</mass>
|
||||
<mass>100.0</mass>
|
||||
</object>
|
||||
</composition>
|
||||
|
||||
|
@ -3671,18 +3671,33 @@
|
||||
<strength>12.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
<yPosition>0</yPosition>
|
||||
<zPosition>0</zPosition>
|
||||
<name>openThirdDoor</name>
|
||||
<xPosition>-161.5</xPosition>
|
||||
<yPosition>21.7</yPosition>
|
||||
<zPosition>67.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>1.0</distance>
|
||||
<distance>0.2</distance>
|
||||
<isBiggerThan>true</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>openThirdDoor.lua</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>178</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
<trigger>
|
||||
<name>openThirdDoorUndo</name>
|
||||
<xPosition>-161.5</xPosition>
|
||||
<yPosition>21.7</yPosition>
|
||||
<zPosition>67.5</zPosition>
|
||||
<targetIdGreen>-</targetIdGreen>
|
||||
<targetIdBlue>-</targetIdBlue>
|
||||
<distance>0.2</distance>
|
||||
<isBiggerThan>false</isBiggerThan>
|
||||
<objectNum>0</objectNum>
|
||||
<luaScript>-</luaScript>
|
||||
<luaScript>openThirdDoorUndo.lua</luaScript>
|
||||
<toChangeIdGreen>0</toChangeIdGreen>
|
||||
<toChangeIdBlue>0</toChangeIdBlue>
|
||||
<toChangeIdBlue>178</toChangeIdBlue>
|
||||
<toChangeObjNum>0</toChangeObjNum>
|
||||
</trigger>
|
||||
</composition>
|
||||
@ -8571,6 +8586,13 @@
|
||||
<idGreen>1</idGreen>
|
||||
<idBlue>8</idBlue>
|
||||
<typeID>221</typeID>
|
||||
<positionConstraint>
|
||||
<objectNum>0</objectNum>
|
||||
<xPosition>-81.5</xPosition>
|
||||
<yPosition>25.0</yPosition>
|
||||
<zPosition>4.5</zPosition>
|
||||
<strength>100.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
@ -10514,6 +10536,13 @@
|
||||
<idGreen>0</idGreen>
|
||||
<idBlue>178</idBlue>
|
||||
<typeID>221</typeID>
|
||||
<positionConstraint>
|
||||
<objectNum>0</objectNum>
|
||||
<xPosition>-172.5</xPosition>
|
||||
<yPosition>25.0</yPosition>
|
||||
<zPosition>58.5</zPosition>
|
||||
<strength>100.0</strength>
|
||||
</positionConstraint>
|
||||
<trigger>
|
||||
<name>-</name>
|
||||
<xPosition>0</xPosition>
|
||||
|
@ -11,7 +11,7 @@ function trigger(objectToChange)
|
||||
|
||||
local strength = 100
|
||||
local xPos = 17.5
|
||||
local yPos = 35
|
||||
local yPos = 33
|
||||
local zPos = 81.5
|
||||
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||
|
||||
|
23
data/levels/scripts/openThirdDoor.lua
Normal file
23
data/levels/scripts/openThirdDoor.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenThirdDoor == nil) then
|
||||
global.triggeredOpenThirdDoor = false
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(global.triggeredOpenThirdDoor == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
local strength = 100
|
||||
local xPos = -172.5
|
||||
local yPos = 33
|
||||
local zPos = 58.5
|
||||
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||
|
||||
global.triggeredOpenThirdDoorUndo = false
|
||||
|
||||
global.triggeredOpenThirdDoor = true
|
||||
print("openThirdDoor")
|
||||
end
|
||||
end
|
23
data/levels/scripts/openThirdDoorUndo.lua
Normal file
23
data/levels/scripts/openThirdDoorUndo.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local global = require( "global" )
|
||||
if(global.triggeredOpenThirdDoorUndo == nil) then
|
||||
global.triggeredOpenThirdDoorUndo = true
|
||||
end
|
||||
function trigger(objectToChange)
|
||||
if(global.triggeredOpenThirdDoorUndo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
|
||||
local strength = 100
|
||||
local xPos = -172.5
|
||||
local yPos = 25
|
||||
local zPos = 58.5
|
||||
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
||||
|
||||
global.triggeredOpenThirdDoor = false
|
||||
|
||||
global.triggeredOpenThirdDoorUndo = true
|
||||
print("openThirdDoorUndo")
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user