Announcement

Collapse
No announcement yet.

Help me about Question system blueprint.

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

    Help me about Question system blueprint.

    I want to decrease energy value when click button.

    Energy Blueprint ( Hud Widget)


    I want this blueprint decrease energyT value when click on button. ( Question Widget)


    This is Wrong Widget


    //Sorry my bad english
    Last edited by Buddy6; 09-14-2015, 05:10 AM.

    #2
    Hey there, from what you show, it doesnt make any sense to me.

    You have a Delay within the widgets tick event, where i assume it is never triggered since the delay (or Timer) will be reset every frame.

    Then you have a "Character" and a "Energy(float)" variable which seem to be indepenedent from each other.

    Then you show us a widget which creates an other widget when you click some button "Wrong Widget".

    You should provide us some more information with what should happen in your logic flow, by the way there are many tutorials out there showing how to create healthbar (or any kind of progress bar) where they show you how
    to set up a communication between widgets and character stats

    So what you should do:

    - be more precise

    regards
    Wallhalla
    Live long and prosper.

    Comment


      #3
      Originally posted by Wallhalla View Post
      Hey there, from what you show, it doesnt make any sense to me.

      You have a Delay within the widgets tick event, where i assume it is never triggered since the delay (or Timer) will be reset every frame.

      Then you have a "Character" and a "Energy(float)" variable which seem to be indepenedent from each other.

      Then you show us a widget which creates an other widget when you click some button "Wrong Widget".

      You should provide us some more information with what should happen in your logic flow, by the way there are many tutorials out there showing how to create healthbar (or any kind of progress bar) where they show you how
      to set up a communication between widgets and character stats

      So what you should do:

      - be more precise

      regards
      Wallhalla


      Please help why wrong widget not decrease energy value from (My energy value are in Hud Widget)

      This is Wrong Widget
      Last edited by Buddy6; 09-14-2015, 05:06 AM.

      Comment


        #4
        Help me it make me very confuse.

        Comment


          #5
          That delay on tick is a little scary.. I wouldn't recommend that. On top of that, you're creating the widget and then a second later destroying it. I have no idea what's going on in that last screenshot. You have some widget type variable that only has a reference to self that doesn't do anything. And you're setting it twice to nothing.
          Columbus Ohio Unreal Meetup
          @OCGameStudio | Sphere Complex | twitch.tv/WFMOz

          Comment


            #6
            Originally posted by TheFoyer View Post
            That delay on tick is a little scary.. I wouldn't recommend that. On top of that, you're creating the widget and then a second later destroying it. I have no idea what's going on in that last screenshot. You have some widget type variable that only has a reference to self that doesn't do anything. And you're setting it twice to nothing.
            Okay i'll try again.

            Comment


              #7
              Well what shall he reduce when you give him a nullreference (-Energy) to get the actual Energy(float) value out of it?

              You will need to get the right reference of the object containing such an energy value.

              You should start at the blueprint where you call the node "Create Widget" get the reference of that widget and save it.
              Provide a function in your widget blueprint (f.e. SetEnergy which has a float as input).
              Then inside the blueprint where you created and saved the reference, take that reference and call SetEnergy.

              The function now wants a float as input from you, so you will need to do something like this:

              1. GetPlayerController (in case you arent inside a Playercontrollerblueprint)
              2. GetPawn/Character ->Cast to CharacterClass which has the energy property
              3. GetEnergy and take the output into your SetEnergy call.

              Inside your widget you will have a variable of floattype "f.e. CurrentEnergyRatio".
              Inside your SetEnergy function take the input map the float between 0 and 1 and set CurrentEnergyRatio with that value.
              Create a binding for your progressbar value.
              This will create a Getter Function for you where you take your CurrentEnergyRatio value and drag it into the output of the Return node.

              cheers
              Live long and prosper.

              Comment


                #8
                Originally posted by Wallhalla View Post
                Well what shall he reduce when you give him a nullreference (-Energy) to get the actual Energy(float) value out of it?

                You will need to get the right reference of the object containing such an energy value.

                You should start at the blueprint where you call the node "Create Widget" get the reference of that widget and save it.
                Provide a function in your widget blueprint (f.e. SetEnergy which has a float as input).
                Then inside the blueprint where you created and saved the reference, take that reference and call SetEnergy.

                The function now wants a float as input from you, so you will need to do something like this:

                1. GetPlayerController (in case you arent inside a Playercontrollerblueprint)
                2. GetPawn/Character ->Cast to CharacterClass which has the energy property
                3. GetEnergy and take the output into your SetEnergy call.

                Inside your widget you will have a variable of floattype "f.e. CurrentEnergyRatio".
                Inside your SetEnergy function take the input map the float between 0 and 1 and set CurrentEnergyRatio with that value.
                Create a binding for your progressbar value.
                This will create a Getter Function for you where you take your CurrentEnergyRatio value and drag it into the output of the Return node.

                cheers
                Thankyou. I'll try.

                Comment


                  #9
                  Originally posted by Wallhalla View Post
                  Well what shall he reduce when you give him a nullreference (-Energy) to get the actual Energy(float) value out of it?

                  You will need to get the right reference of the object containing such an energy value.

                  You should start at the blueprint where you call the node "Create Widget" get the reference of that widget and save it.
                  Provide a function in your widget blueprint (f.e. SetEnergy which has a float as input).
                  Then inside the blueprint where you created and saved the reference, take that reference and call SetEnergy.

                  The function now wants a float as input from you, so you will need to do something like this:

                  1. GetPlayerController (in case you arent inside a Playercontrollerblueprint)
                  2. GetPawn/Character ->Cast to CharacterClass which has the energy property
                  3. GetEnergy and take the output into your SetEnergy call.

                  Inside your widget you will have a variable of floattype "f.e. CurrentEnergyRatio".
                  Inside your SetEnergy function take the input map the float between 0 and 1 and set CurrentEnergyRatio with that value.
                  Create a binding for your progressbar value.
                  This will create a Getter Function for you where you take your CurrentEnergyRatio value and drag it into the output of the Return node.

                  cheers
                  Now we can do it!!! Thank you very much you very genius guy. I own you one.

                  Thread Closed

                  Comment

                  Working...
                  X