Forum rules - please read before posting.

Puzzle Ideas

Hey there!
I want a little help, if is possible.
In my game there is some mini puzzle games inside to earn some secret items.
For exemple, the first one I did was a light switch that when you turn the lights on and off 4 times you achieve the secret. For this case specific was easy, each time I click on the switch hotspot I add a interger in the variable.
Since I am not the best logic or programmer guy, I want to achieve more complex puzzles for the game, but I am having some hard time creating them.
For exemple I had an idea for the next one, I have a bookshelf and you need to put the books in the alphabetic order, but I have no idea how to achieve this.
Initially I tried with the UI, but I think AC doesn't have the right tools to make it happen.
The idea is, you can click in a book and then you can click in a empty space slot so you move it, when you put the books in the right order a secret is unlocked.
Any ideas?image


  • This should be quite straightforward to be honest Somebody will no doubt have a more efficient way to do this with scripting and instantiating asset files, but a simple example follows: Have four hotspots named A B C and D. Then have four books named 1,2,3 and 4 in the exact same position behind A. Duplicate these behind all four hot spots. Then, when you pickup 1, you disable all four books behind slot A. Pickup 2, then disable all four books behind hotspot B. And so forth. When you then use 2 on D, you enable D2. Each "use" action should have a scene object check "check if 1a is enabled", "check if 2a is enabled" and so on, until all the correct sequence of objects are enabled to trigger the prize. Hope that helps? Kev
  • This could also be done with Inventory - since items can be categorised and then limited by category when displayed in Menus.

    In the Inventory Manager, create two new categories named "Regular" and "Books".  For each of the books above, create a new item and place it in the Books category.  Check Carry on start? for each of them so that the player always has them.

    Then go to your regular Inventory menu, and you'll see a new Limit by category? field, which you can use to limit it's display to the "Regular" set of items only - so that the "Books" don't appear.

    If you then create a new Menu, and an InventoryBox element inside that Menu, you can similarly limit it to the "Books" items.  Be sure to check Prevent interactions? so that it doesn't try to run any use/examine/combine interaction when clicking.

    Set the Menu's Appear type to During Gameplay, and check Start game locked off?.  When you're ready to begin the puzzle, use the Menu: Change state Action to unlock it.

    If you have Items can be re-ordered in Menu? checked in your Settings Manager (under "Inventory settings"), then items can be placed in empty menu slots and re-arranged.  You'll have to make sure you defined more slots in the InventoryBox element than you have items to re-arrange.  If you don't want this option to be enabled when using your regular Inventory menu, you can change this option's value at runtime:

    (Any Manager field can be changed at runtime - just right-click it's field label to get an API reference to it)

    Actually checking to see if all the "Books" are in the correct order is a little bit more involved, and relies on custom scripting.  You essentially need to hook into the OnInventoryDeselect custom event (which is called whenever you drop an item into an empty slot) to analyse the Menu and check the items are in the correct order.  Something like this, attached to an empty GameObject in the scene, should do it:

    Configure the inspector with the appropriate menu/element names, and create an array of the correct item IDs in order (an Item's ID is the number to the left of its name in the Inventory Manager list).  This'll only work if there's no empty space in between the items / the far left, but it could be adapted to allow for that too.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.