2015-02-15 15:11:31 +00:00
|
|
|
local global = require( "global" )
|
|
|
|
if(global.triggeredOpenFirstDoor == nil) then
|
|
|
|
global.triggeredOpenFirstDoor = false
|
2015-02-13 18:24:57 +00:00
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
if(global.triggeredOpenFirstDoorUndo == nil) then
|
|
|
|
global.triggeredOpenFirstDoorUndo = true
|
|
|
|
end
|
|
|
|
|
2015-03-15 17:46:44 +00:00
|
|
|
function trigger(objectToChange, printDebug)
|
2015-02-15 15:11:31 +00:00
|
|
|
if(global.triggeredOpenFirstDoor == false) then
|
2015-02-13 18:24:57 +00:00
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local strength = 100
|
2015-02-27 15:53:46 +00:00
|
|
|
local xPos = 17.5
|
2015-03-04 17:10:49 +00:00
|
|
|
local yPos = 33.0
|
2015-02-27 15:53:46 +00:00
|
|
|
local zPos = 81.5
|
2015-02-13 18:24:57 +00:00
|
|
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
|
|
|
|
2015-02-15 15:11:31 +00:00
|
|
|
global.triggeredOpenFirstDoorUndo = false
|
2015-02-13 18:24:57 +00:00
|
|
|
|
2015-02-15 15:11:31 +00:00
|
|
|
global.triggeredOpenFirstDoor = true
|
2015-03-15 17:46:44 +00:00
|
|
|
if (printDebug) then
|
|
|
|
print("openFirstDoor")
|
|
|
|
end
|
2015-02-13 18:24:57 +00:00
|
|
|
end
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
|
2015-03-15 17:46:44 +00:00
|
|
|
function triggerUndo(objectToChange, printDebug)
|
2015-03-04 13:35:14 +00:00
|
|
|
if(global.triggeredOpenFirstDoorUndo == false) then
|
|
|
|
if(not level) then
|
|
|
|
print("No level found in Lua!")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local strength = 100
|
|
|
|
local xPos = 17.5
|
2015-03-04 17:10:49 +00:00
|
|
|
local yPos = 25.0
|
2015-03-04 13:35:14 +00:00
|
|
|
local zPos = 81.5
|
|
|
|
level:moveObject(objectToChange, strength, xPos, yPos, zPos)
|
|
|
|
|
|
|
|
global.triggeredOpenFirstDoor = false
|
|
|
|
|
|
|
|
global.triggeredOpenFirstDoorUndo = true
|
2015-03-15 17:46:44 +00:00
|
|
|
if(printDebug) then
|
|
|
|
print("openFirstDoorUndo")
|
|
|
|
end
|
2015-03-04 13:35:14 +00:00
|
|
|
end
|
|
|
|
end
|