Help with simple puzzle :)

  • #1, by luismendozaTuesday, 27. February 2018, 15:44 6 years ago
    hello, 

    how to make this simple puzzle works? i tryed a lot of things making it and interface or scene but i have no idea how to make it work maybe is so simple for you guys. here is: there is an electrical box  the character click on it and its open to a new scene or interface (close up) there is 3 fussibles each have a color and only can in their color matching slot. at first there is one green fussible in the purple slot and player have to take the green fussible from the floor so you have to move the purple fussible to purple slot and put the green one in the green slot to make a something work!.. 

    any idea how to approach to this? an image worth more than thousand words 

    thanks in advace and plz sorry for my english

    Newbie

    3 Posts


  • #2, by shicoWednesday, 28. February 2018, 00:15 6 years ago
    Is the inventory available during this puzzle? 


    Newbie

    21 Posts

  • #3, by luismendozaWednesday, 28. February 2018, 06:03 6 years ago
    yes is available

    Newbie

    3 Posts

  • #4, by shicoWednesday, 28. February 2018, 09:20 6 years ago
    If your inventory is always in the scene, easy to access, like a bar at the bottom for example then you can make it that when you left click a fuse it will be added to inventory and then you can drag it again from there to use place it in different slot.
    Otherwise if you need to bring up the inventory everytime you want to use an item, it wouldn't be the most convenient to the player. In that case I suggest you do it this way:
    First make a cursor for each fuse.
    Now according to what you said, you want to move the green fuse from the purple slot and switch it with the purple fuse. When you left click the green fuse, add actions:
    Change condition 'greenfuse selected' to True (attach greenfuse scene
    object to a condition called greenfuse_selected and set to be active when the condition is false.) and now the purple slot is empty

    Set the cursor to the 'green fuse cursor'(so it will look like you picked it up) 
    Then when you left click on the purple fuse , repeat the actions above but to pick up the purple fuse and in the same time you want to add an action to check if you have a fuse selected already:
    if condition 'greenfuse_selected' is True  
      Change condition greenfuse_selected to False (to make the greenfuse visible again)  
      Move object "greenfuse" to (x,y) - add coordinates to move the green fuse to the empty slot
    End if
    You can also add conditions to each slot ( Example: slot1_full) and set it to true/false depending on whether there is a fuse in it then add an action to check which one is empty to move the green fuse into it, in that case:
    if condition 'greenfuse_selected' is true 
       Change condition 'greenfuse_selected' to False 
       If condition 'slot1_full' is False
         Move object 'greenfuse' to (x,y) - add coordinates of slot1 
       End if
    End if 
    When you place a fuse in an empty slot, add an action to set your default cursor back.
    Ofcourse I didn't include everything above but it should be good as a start.
    That's basically the direction that I would go with this, it will be easier for the player not to have to go to the inventory to switch between fuses.
    I did something similar but instead of having the items already in the slots, I made a shelf were I had to pick up the items from, and clicking right click would drop the item to it's original place. But that was more suitable for my puzzle design.
    I'm sure it must be easier with Lua scripts, unfortunately I am not the right guy for the job... still a beginner with scripting.
    Hope this is helpful to you.

    Newbie

    21 Posts

  • #5, by afrlmeWednesday, 28. February 2018, 11:59 6 years ago
    Alternatively if it's a scene instead of an interface then they could use values instead of conditions assigned to the slots.

    You would need 3 values & 4 scene objects per slot. Values 0 to 3 to represent empty, fuse color 1, fuse color 2, fuse color 3. You would add an action for each fuse item dropped for each scene object that should take the currently inserted fuse back to your inventory & insert the new one. After this you would check all 3 values equal certain values to determine if the puzzle has been solved.

    Imperator

    7278 Posts

  • #6, by luismendozaFriday, 02. March 2018, 17:38 6 years ago
    ohh thank you for help guys i will try them! @shico! omg nice explanation very elaborated thank you!

    Newbie

    3 Posts