Announcement

Collapse
No announcement yet.

How to link "complete" puzzle to door?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to link "complete" puzzle to door?

    Hello everyone

    I'm trying to link this puzzle to a door that when it is complete the door will then open.


    I just want the door to open once the puzzle is complete (Yellow tabs) -

    I've attached 4 pictures to help explain with my blueprints

    Overall, I just want my complete puzzle to open the door once all the pads are yellow. I'm not sure how to do this? if anyone could explain the most simple and easiest way to open the door, I'd be very grateful.

    Thanks

    Oscar
    Last edited by OscarPullin; 04-09-2018, 06:00 AM.

    #2
    first of all for the sake of good practices, i won't do any action inside Tick for the puzzle management, but only for door opening animation

    Make a new actor i would call it "PuzzleSolver" I has a List of your EndgamePuzzleBP and a door.

    Your EndGamePuzzle bp would only have the overlap event, it would Toogle the IsOn bool if its a player (like now), call a "UpdateMaterial" function (copy past your ontick code), and fire and event "PuzzleStateChanged"

    Inside your puzzle solver, in begin play, subscribe to all EndgamePuzzleBP from it's list, that would call a check on all item from list (local variable "AllOn" set to true, foreach item in list, if item.IsOn == false then AllOn = false, OnForeach complete, check if AllOn == true then call OpenDoor method on the door

    if my pseudo code isn't clear i can expend it a bit

    doing like that maximize the modularity and allow you good reusability for various puzzle. Plus it doesn't polute you level blueprint

    Comment


      #3
      Originally posted by Firefly74 View Post
      first of all for the sake of good practices, i won't do any action inside Tick for the puzzle management, but only for door opening animation

      Make a new actor i would call it "PuzzleSolver" I has a List of your EndgamePuzzleBP and a door.

      Your EndGamePuzzle bp would only have the overlap event, it would Toogle the IsOn bool if its a player (like now), call a "UpdateMaterial" function (copy past your ontick code), and fire and event "PuzzleStateChanged"

      Inside your puzzle solver, in begin play, subscribe to all EndgamePuzzleBP from it's list, that would call a check on all item from list (local variable "AllOn" set to true, foreach item in list, if item.IsOn == false then AllOn = false, OnForeach complete, check if AllOn == true then call OpenDoor method on the door

      if my pseudo code isn't clear i can expend it a bit

      doing like that maximize the modularity and allow you good reusability for various puzzle. Plus it doesn't polute you level blueprint
      Thank you, I'll try this.

      Comment


        #4
        Originally posted by Firefly74 View Post
        first of all for the sake of good practices, i won't do any action inside Tick for the puzzle management, but only for door opening animation

        Make a new actor i would call it "PuzzleSolver" I has a List of your EndgamePuzzleBP and a door.

        Your EndGamePuzzle bp would only have the overlap event, it would Toogle the IsOn bool if its a player (like now), call a "UpdateMaterial" function (copy past your ontick code), and fire and event "PuzzleStateChanged"

        Inside your puzzle solver, in begin play, subscribe to all EndgamePuzzleBP from it's list, that would call a check on all item from list (local variable "AllOn" set to true, foreach item in list, if item.IsOn == false then AllOn = false, OnForeach complete, check if AllOn == true then call OpenDoor method on the door

        if my pseudo code isn't clear i can expend it a bit

        doing like that maximize the modularity and allow you good reusability for various puzzle. Plus it doesn't polute you level blueprint
        Are you able to explain a little more clear, maybe step by step? maybe for example

        1 - do this
        2 - do this
        3 - do this

        Thanks

        Comment


          #5
          I still can't figure out how to do this and this is making me want to give up. I've tried so many options.

          If anyone can help me, then please just put simple steps

          1
          2
          3
          4
          5
          6
          images are useful.

          thank you.

          Comment


            #6
            Ok, so here you go :

            right now you have 2 blueprints : Endgame_PuzzleBP and your DoorBP

            1) step cleanup Endgame_PuzzleBP :
            open Endgame_PuzzleBP and delete tick node then select all nodes it was calling -> right click -> collapse to Function. give the new function "UpdateMaterial"

            then remove most of the code to the overlap event and keep a "set isOn to true" and call Update material.

            2) Add an event dispatcher to Endgame_PuzzleBP named PuzzleStateChanged and call that

            your bp should looks like screen1 and 2



            3) now we are going to create a solver actor

            create a new blueprint class and choose "actor" as parent class, name it "PuzzleSolverBP"

            Add 2 variable, one name Door and type of "DoorBP" and an array of type Endgame_PuzzleBP
            Add one function and name it "CheckPuzzle

            Check Screen 3 and 4 to see how it's build


            Then, in map editor, drop all your EndGame_PuzzleBP, and one PuzzleSolverBP, select the PuzzleSolverBP and add all your "EndGame_PuzzleBP" actors into the "PuzzleItems" list

            Comment

            Working...
            X