Page 1 of 1

Puzzle involving a route

Posted: Sat Oct 06, 2012 2:12 pm
by crisman
I want to share my "wonderful" script (because it really saved me tons of work :mrgreen: ), for a 'route' puzzle, like the... uhm, the secret on level 6 (I don't remember the name that secret has a name like roundabout or something like that) which you have to walk around some pillars in a certain way, and then some items (and a monster!) will spawn.
Since my route has almost 20 hidden pressure plate to be pressed in a certain order (I have to say this clearly, WITHOUT passing twice on a same spot, otherwise this script won't work), and doing them with
if pressupreplate0:isUp and counter:getvalue() == 0 then increment
if pressupreplate1:isUp and counter:getvalue() == 1 then increment, I used a index.
You need to call your plates like plate0, plate1, plate2 and so on. Place a counter, which I'll call counterRoute, and connect all the plates to the script to the function route().
The script is written in this way.
SpoilerShow
function route()

i = counterRoute:getValue()
if findEntity("plate"..i):isUp() then
counterRoute:reset()
else
counterRoute:increment()
end
end

function reset()

counterRoute:reset()

end
Of course, you can place some plates that they just reset your counterRoute. No deviations! :mrgreen:
I've omitted the check script (for my puzzle the player must press a button at the end of the route and see if it was done right), but I'm sure it's not a problem for you ;)
Oh, the hard part is... naming correctly the plate (the first time I forgot to rename a plate... and I could not figure out why the script wasn't working :lol: )

Re: Puzzle involving a route

Posted: Sat Oct 06, 2012 2:32 pm
by Komag
thank you for this, it's helpful :)

Re: Puzzle involving a route

Posted: Mon Oct 29, 2012 12:22 pm
by Komag
The level 6 walkabout puzzle ended up needing something quite different due to stepping on the same plates multiple times, but something very close to your script worked pretty well for the level 9 pillared hallway :)

Re: Puzzle involving a route

Posted: Mon Oct 29, 2012 1:39 pm
by crisman
I think you can use the same script, just add another counter and increment it when the party steps on the third plate (I remember there are three main spot to step on).
the spawning prize will depend on the value of this counter. :)

Re: Puzzle involving a route

Posted: Wed Nov 14, 2012 3:02 am
by akroma222
Nice one Crisman!