Post by triball101 on Oct 15, 2017 8:08:26 GMT
not sure if these are of any help to anyone, theyre in lua and I'm new to c# lol. if this is posted in an in the wrong place let me know and ill move them.
3 levers with 2 animations a piece, have the first required to be up, the second down, and the third up to open 1 door with both its animation
function firelevertrap()
if lever_5.lever:isActivated() and
lever_6.lever:isDeactivated() and
lever_7.lever:isActivated() then
castle_door_wood_9.door:open()
else
castle_door_wood_9.door:close()
end
end
this is an alcove with a rigid bottom, its to designed to eat food, I had a Face with an open mouth, but you could make it anything.
function checkItems(alcove)
local count = 0
for v,i in alcove:contents() do
if i :hasTrait("consumable") then
count = count + 1
end
end
if count >= 3 then
dungeon_door_wooden_1.door:open()
else
dungeon_door_wooden_1.door:close()
end
end
this is a lever puzzle that you need to activate them in a specific order. I tied it to a counter setup from 0-4. itd be easy to make it longer.
function pullFirst()
if counterPuzzle_1.counter:getValue() == 4 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function pullSecond()
if counterPuzzle_1.counter:getValue() == 3 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function pullThird()
if counterPuzzle_1.counter:getValue() == 2 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function pullFourth()
if counterPuzzle_1.counter:getValue() == 1 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function resetAll()
counterPuzzle_1.counter:reset()
end
Each "pull" is a checking a different lever, i.e. pullFirst checks lever1, etc. the counter is tied to the door. You pull a lever if it's the correct one the counter decreases, if not the counter resets to 4. Every pull in the right order decreases the counter until reaching zero, and the door opens. For every pull out of order the counter resets to 4 (because math), and the door stays shut.
I used normal door and lever animations and scripts for open and shut/up and down on all these. If you need them I can post them but they're in lua too
If these are of any help let me know, (and maybe translate a little) ive got lots of them.
3 levers with 2 animations a piece, have the first required to be up, the second down, and the third up to open 1 door with both its animation
function firelevertrap()
if lever_5.lever:isActivated() and
lever_6.lever:isDeactivated() and
lever_7.lever:isActivated() then
castle_door_wood_9.door:open()
else
castle_door_wood_9.door:close()
end
end
this is an alcove with a rigid bottom, its to designed to eat food, I had a Face with an open mouth, but you could make it anything.
function checkItems(alcove)
local count = 0
for v,i in alcove:contents() do
if i :hasTrait("consumable") then
count = count + 1
end
end
if count >= 3 then
dungeon_door_wooden_1.door:open()
else
dungeon_door_wooden_1.door:close()
end
end
this is a lever puzzle that you need to activate them in a specific order. I tied it to a counter setup from 0-4. itd be easy to make it longer.
function pullFirst()
if counterPuzzle_1.counter:getValue() == 4 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function pullSecond()
if counterPuzzle_1.counter:getValue() == 3 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function pullThird()
if counterPuzzle_1.counter:getValue() == 2 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function pullFourth()
if counterPuzzle_1.counter:getValue() == 1 then
counterPuzzle_1.counter:decrement()
else
resetAll()
end
end
function resetAll()
counterPuzzle_1.counter:reset()
end
Each "pull" is a checking a different lever, i.e. pullFirst checks lever1, etc. the counter is tied to the door. You pull a lever if it's the correct one the counter decreases, if not the counter resets to 4. Every pull in the right order decreases the counter until reaching zero, and the door opens. For every pull out of order the counter resets to 4 (because math), and the door stays shut.
I used normal door and lever animations and scripts for open and shut/up and down on all these. If you need them I can post them but they're in lua too
If these are of any help let me know, (and maybe translate a little) ive got lots of them.