Announcement

Collapse
No announcement yet.

[HELP] Saving widget store data?

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

    [HELP] Saving widget store data?

    Hello!
    I am setting up a store you can use with the coins you got through the game... It's supposed to disable the button once you buy the powerup, but if you exit the store, and re enter it, you can buy it again... How can I save the disabled button so it remains disabled? I'll leave the button blueprint just in case



    Click image for larger version

Name:	Untitled.png
Views:	40
Size:	102.2 KB
ID:	1803193


    Click image for larger version

Name:	Untitled2.png
Views:	63
Size:	91.2 KB
ID:	1803192

    #2
    Originally posted by LeddaqPony View Post
    Hello!
    I am setting up a store you can use with the coins you got through the game... It's supposed to disable the button once you buy the powerup, but if you exit the store, and re enter it, you can buy it again... How can I save the disabled button so it remains disabled? I'll leave the button blueprint just in case



    Click image for larger version

Name:	Untitled.png
Views:	40
Size:	102.2 KB
ID:	1803193


    Click image for larger version

Name:	Untitled2.png
Views:	63
Size:	91.2 KB
ID:	1803192
    It's hard to say exactly where your system is going wrong there because some parts are missing ( is there a save game load somewhere? ), and some of it doesn't make sense ( why deduct 0 from coins and player coins? ).

    But generally speaking the problem will be one of two things:

    1) Somehow you are not saving the fact the user has purchased the coins

    2) You are saving this fact, but elsewhere in your code you are updating the save game without loading it first, which will wipe anything that was stored there.

    Number 2 is a common problem with using a save game variable.
    Check out Zof ( puzzle game ) on Steam:

    https://store.steampowered.com/app/1414480/Zof/

    Comment


      #3
      Hi ClockworkOcean
      the load is made when the game is first opened (there also checks if it exists and creates one it it doesn't)
      and it deducts 0 because I was testing it (real cost is 300)

      To check if they purchase, do I create a boolean variable to save?

      In the code there I'm saving only the coins used, not the fact that it was purchased

      Comment


        #4
        Originally posted by LeddaqPony View Post
        Hi ClockworkOcean
        the load is made when the game is first opened (there also checks if it exists and creates one it it doesn't)
        and it deducts 0 because I was testing it (real cost is 300)

        To check if they purchase, do I create a boolean variable to save?

        In the code there I'm saving only the coins used, not the fact that it was purchased
        You could just save a bool. If they have already done this, the button just wont work.
        Check out Zof ( puzzle game ) on Steam:

        https://store.steampowered.com/app/1414480/Zof/

        Comment


          #5
          Originally posted by ClockworkOcean View Post

          You could just save a bool. If they have already done this, the button just wont work.
          I only saved numbers so far (integer) is saving a boolean the same? or do I need to add aditional info?
          Im sorry if this sounds dumb, I'm still learning UE4 and i​​​​​​​ have very little knowledge of coding

          Comment


            #6
            Originally posted by LeddaqPony View Post

            I only saved numbers so far (integer) is saving a boolean the same? or do I need to add aditional info?
            Im sorry if this sounds dumb, I'm still learning UE4 and i​​​​​​​ have very little knowledge of coding
            Saving a bool is exactly the same as saving a float or integer. It's just a variable
            Check out Zof ( puzzle game ) on Steam:

            https://store.steampowered.com/app/1414480/Zof/

            Comment


              #7
              Originally posted by ClockworkOcean View Post

              Saving a bool is exactly the same as saving a float or integer. It's just a variable
              Oh, I'll try that then!
              Thanks!

              Comment

              Working...
              X