Condition Question

Forums 💬 NodeCanvas 🗨️ General Discussion Condition Question

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #14408
    atmuc
    Participant

      I have a custom condition that listens drag event of InputTouches asset. i subscribe this condition to InputTouches event. i want this condition to listen only it is candidate to run like it is connected to the active state. OnInit runs when it will be used for the first time. is there any other method that runs once and just before OnCheck?

      #14420
      atmuc
      Participant

        with this code i can subscribe and unsubscribe. if there are 2 conditions on a state. i miss one subscription. i need a function like ActivatingCondition, DeActivatingCondition.

        #14419
        Gavalakis
        Keymaster

          Hey,

          Yeah. Such a method is missing. It’s a nice request. I will add in the next version.
          I can walk you through into quickly and temporary adding this now if you want, but chances are that the implementation will change.

          Let me know if you want.
          Cheers

          #14418
          atmuc
          Participant

            it would be nice to add such feature. it will useful for resource consuming processes.

            i could not understand about what you ask about what i want? sorry for my English 🙂

            #14417
            Gavalakis
            Keymaster

              Hey,

              Sure I will add this. It would be very usefull in the case of conditions.
              I simply asked you if you want to tell you how to change the source code to make this, instead of waiting for the update to come in the asset store 🙂

              #14416
              atmuc
              Participant

                yes i would like to know it now 🙂

                #14415
                Gavalakis
                Keymaster

                  Sure. So here what you need to do in the source code:

                  1) Open up ConditionTask.cs and add this code:

                  2) Open up FSMState.cs and add this code in line #104 just before the OnEnter(); call:

                  3) Also in FSMState.cs add this code in line #158 just before the OnExit(); call:

                  So now you can override OnEnable and OnDisable in your condition tasks to handle what you are after 🙂

                  Cheers!

                  #14414
                  atmuc
                  Participant

                    thanks 🙂 will you also add this to the next release?

                    #14413
                    Gavalakis
                    Keymaster

                      Hey,

                      Sorry for late reply.
                      Yes this will exist in the next release 🙂

                      #14412
                      atmuc
                      Participant

                        At OnEnable Method i cannot get Blackboard values. when i debug at OnEnable i can see there are variables at GlobalBlackboard. but result belove is null. it cannot evaluate $Global/MyReference at OnEnable.

                        #14411
                        Gavalakis
                        Keymaster

                          Hey,

                          Really sorry for the late reply. I missed it somehow.
                          I just tried this out and it really works as expected. The variable value resolves correctly from the GlobalBlackboard. What is your setup?
                          Could you please send me a reproduction project to check this out?

                          Thanks

                          #14410
                          atmuc
                          Participant

                            i will check it with bounded FSM. have you tried it with FSM as Asset?

                            #14409
                            Gavalakis
                            Keymaster

                              Hey,

                              Please check your other post where I think it answers for this post as well 🙂

                              Let me know.
                              Cheers!

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • You must be logged in to reply to this topic.