Lets walk around the Altar

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Lets walk around the Altar

Post by Mysterious »

Hi again another puzzle from DesperateGames. This time we will take a walk around the block about 16 times. A room 3 x 3 big with a Altar in the middle, why so the player has to walk around the Altar a certain way to open the door yeah. Ok i dont know how this works really code wise but it does.
You will need:

a = Altar.

Plates order:
enter
* * *
* a *
* * *
exit

1 x Script Entity called: What you like. paste the code below into it.
1 x door: like mine in the code below or what you have just rename it.

8 x Pressure plates: Called what you like eg: plate_1, plate_2 etc...
Join each plate to one of the functions eg:

plate_1 function roundtrip1()
plate_2 function roundtrip2()
plate_3 function roundtrip3()
plate_4 function roundtrip4()
plate_5 function roundtrip5()
plate_6 function roundtrip6()
plate_7 function roundtrip7()
plate_8 function roundtrip8()

Till all 8 plates are joined to the 8 functions.

Code: Select all

count=0
previous=0

function roundtrip1()
if previous==8 then
count=count+1
else
count=0
end
previous=1
checkOpen()
end

function roundtrip2()
if previous==1 then --plate 1 joins to this function and so on--
count=count+1
else
count=0
end
previous=2
checkOpen()
end

function roundtrip3()
if previous==2 then
count=count+1
else
count=0
end
previous=3
checkOpen()
end

function roundtrip4()
if previous==3 then
count=count+1
else
count=0
end
previous=4
checkOpen()
end

function roundtrip5()
if previous==4 then
count=count+1
else
count=0
end
previous=5
checkOpen()
end

function roundtrip6()
if previous==5 then
count=count+1
else
count=0
end
previous=6
checkOpen()
end

function roundtrip7()
if previous==6 then
count=count+1
else
count=0
end
previous=7
checkOpen()
end

function roundtrip8()
if previous==7 then
count=count+1
else
count=0
end
previous=8
checkOpen()
end


function checkOpen() --- When you walk on the plate for the 16 the door will open--
if count==15 then
dungeon_door_iron_5.door:open()

playSound("draco_laughing")
hudPrint("VOICE:  You are a smart one yes...")
hudPrint("Hope your not to dizzy?")
hudPrint("")
hudPrint("You gain 55 XP")
party.party:getChampion(1,4):gainExp(50)
end
end
Ok I hope you can make this work if not give me a call yeah :)
Post Reply