Frictional Games Forum (read-only)
Simple Puzzler (A Class for making puzzles) - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Resources (https://www.frictionalgames.com/forum/forum-42.html)
+---- Thread: Simple Puzzler (A Class for making puzzles) (/thread-16322.html)



Simple Puzzler (A Class for making puzzles) - Javist - 06-19-2012

Greetings Smile
After a long time, i've decided to return to amnesia scripting and give it a try again, just for fun.

So here i written a small class, which could be (or no? who cares.) handy for creating simple puzzles, for example, like a puzzle in the machine room (with levers).
Of course, maybe my class is ugly or redundant somewhere.. so keep it in mind Smile

HPL Source with example is here: http://pastebin.com/W3QhHr2d
And example map is here too: http://pastebin.com/BzKd6apq

So, all you need in order to use it is:
- Place the class somewhere in your .hpl script. (And may be amend it to your taste.)
- Write own function-callback which will be receiving a result (true/false).
- Pass to the constructor your data (Array with levers, array with correct lever positions, and func).
- Make a call from your ConnectionStateChangeCallBack to notifySwitch.
- Profit.

If you find it helpful - comments are welcome 8)