Announcement

Collapse
No announcement yet.

Game Instance and Game Save and Game StateVR Game

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

    #16
    Originally posted by ClockworkOcean View Post

    Just use the the save chunk of code I gave you there... when you change it, save it.
    What I'm getting hung up on is that I don't know where to put it.

    My points are being displayed and counted on my HUD from game instance, do I do it in my HUD? Do I save it in the BP of the item that's getting me points? Or do I do it in my game mode? I hate to bug you lol. Just new to some of this is all

    Comment


      #17
      Originally posted by Patrick_000 View Post

      What I'm getting hung up on is that I don't know where to put it.

      My points are being displayed and counted on my HUD from game instance, do I do it in my HUD? Do I save it in the BP of the item that's getting me points? Or do I do it in my game mode? I hate to bug you lol. Just new to some of this is all
      Show me you point update code.

      Comment


        #18
        Originally posted by ClockworkOcean View Post

        Show me you point update code.
        First two are the points being collected after overlapping them (more points will be added to the game eventually)

        The third photo is the function in the Widget adding them together to string them into a value.

        Fourth photo is just the HUDBP
        Attached Files

        Comment


          #19
          Originally posted by Patrick_000 View Post

          First two are the points being collected after overlapping them (more points will be added to the game eventually)

          The third photo is the function in the Widget adding them together to string them into a value.

          Fourth photo is just the HUDBP
          Click image for larger version  Name:	save fire points.JPG Views:	0 Size:	110.7 KB ID:	1813021

          You see, but it's getting messy.

          It would be easier in this case to drop using the GI for these point and just use the save game. It's up to you.
          Last edited by ClockworkOcean; 09-18-2020, 02:54 PM.

          Comment


            #20
            Originally posted by ClockworkOcean View Post

            Click image for larger version Name:	save fire points.JPG Views:	0 Size:	110.7 KB ID:	1813021

            You see, but it's getting messy.

            It would be easier in this case to drop using the GI for these point and just use the save game. It's up to you.
            **** that's what I was thinking as well. I'm assuming I would just delete them in the instance and re-do it in the game save. If that's the case, do I need to re-wire my HUD bp to game save as well rather than instance?

            Comment


              #21
              Originally posted by Patrick_000 View Post

              **** that's what I was thinking as well. I'm assuming I would just delete them in the instance and re-do it in the game save. If that's the case, do I need to re-wire my HUD bp to game save as well rather than instance?
              Hold on, might have a clean way of doing it in the GI - don't change anything yet...

              Comment


                #22
                Originally posted by ClockworkOcean View Post

                Hold on, might have a clean way of doing it in the GI - don't change anything yet...
                I'm crying right now. You're a saint.

                Comment


                  #23
                  Originally posted by Patrick_000 View Post

                  I'm crying right now. You're a saint.
                  No, sorry, I had a look. You have to put so much code in the GI, you might as well use save game macros, which is what I do.

                  And if you're going to the trouble of reading and writing these variables to the SG you might as well just use the SG instead of the GI for them.

                  I can show you how to do it with the SG and macros if you like. It will mean you can drop all the GI code ( for this variable 'fire points' ).

                  ( tell me if you want to know, coz i have to make picces etc )

                  Comment


                    #24
                    Originally posted by ClockworkOcean View Post

                    No, sorry, I had a look. You have to put so much code in the GI, you might as well use save game macros, which is what I do.

                    And if you're going to the trouble of reading and writing these variables to the SG you might as well just use the SG instead of the GI for them.

                    I can show you how to do it with the SG and macros if you like. It will mean you can drop all the GI code ( for this variable 'fire points' ).

                    ( tell me if you want to know, coz i have to make picces etc )
                    If it cleans it up and makes more sense I'd rather learn that way. So if you don't mind than it would be greatly appreciated!

                    Comment


                      #25
                      Originally posted by Patrick_000 View Post

                      If it cleans it up and makes more sense I'd rather learn that way. So if you don't mind than it would be greatly appreciated!
                      Right, might be a bit of a rough ride, but you already know how the GI works and can use it to pass stuff around. Might as well learn about what the SG can do now.

                      Once you bother to sort out the right macros, this:

                      Click image for larger version

Name:	GI.JPG
Views:	39
Size:	35.0 KB
ID:	1813042

                      ( remember this updated it, doesn't save it too ), becomes this:

                      Click image for larger version

Name:	macro.JPG
Views:	31
Size:	32.1 KB
ID:	1813043

                      This little set of nodes, does all the stuff the GI does, AND it persists between games.

                      You have to make a macro library. Right click in the content browser -> blueprints -> blueprint macro library. It will ask what type, you choose Actor.

                      I have made 5 macros. Three of them you will use all the time, the other 2 are for the variable FirePoints:

                      Click image for larger version

Name:	macros.JPG
Views:	28
Size:	11.7 KB
ID:	1813044

                      CheckSaveGame looks like this:

                      Click image for larger version

Name:	check save game.JPG
Views:	28
Size:	178.5 KB
ID:	1813045

                      See it's the same stuff you already did, but you only have to do it ONCE. After that, you can use the macro.

                      In the details panel, you can add Exec type parameters as well as integers etc. That's how you make the execute pins.

                      ReadSaveGame:

                      Click image for larger version

Name:	read save game.JPG
Views:	31
Size:	139.5 KB
ID:	1813046

                      See it uses CheckSaveGame to make sure it's there first, no hassle. And WriteSaveGame:

                      Click image for larger version

Name:	write save game.JPG
Views:	29
Size:	114.0 KB
ID:	1813047

                      So now, you don't have to worry about all that casting rubbish etc, you have macros for any time you come near the save game.

                      Now it's easy to do ReadFirePoints:
                      Click image for larger version

Name:	read fire points.JPG
Views:	30
Size:	96.2 KB
ID:	1813048

                      and WriteFirePoints:

                      Click image for larger version

Name:	write fire points.JPG
Views:	30
Size:	160.3 KB
ID:	1813049

                      Is this making sense? It's probably good to also see a decent tuut on macros:

                      https://www.youtube.com/watch?v=GMB8SPnB9sM

                      Comment


                        #26
                        ClockworkOcean
                        ​​​​​​​
                        Well, hot darn. I have a bunch to sink my teeth in over the next couple days. This looks amazing and as long as I figure it out, it looks easier.
                        ​​​​
                        Where will I be constructing most of this? Would fire and grass points will be in their respected blueprints and as everything else is concerned will it be in the macro blueprints actor? And can I still get the points to show up on my widget the same way even if I delete the GI?

                        *To clarify, when I mean where will I write the rest of it, I mean if I should write in the widget BP, Game Mode, or Save Game


                        *Update:

                        I created a Macro Library. I created all that script. I just don’t know how to get the item that I destroy (Fire point) to call on that Save Macro and save that content. Unless I create that in all of the objects I destroy for points? And still a little confused about what I put in the GameSave directly and how to get it to show up on my widget hud

                        THANK YOU A MILLION. Seriously. I can't even begin to tell you how much you have helped.
                        Last edited by Patrick_000; 09-19-2020, 09:37 AM. Reason: Updated

                        Comment


                          #27
                          Originally posted by Patrick_000 View Post
                          ClockworkOcean
                          ​​​​​​​
                          Well, hot darn. I have a bunch to sink my teeth in over the next couple days. This looks amazing and as long as I figure it out, it looks easier.
                          ​​​​
                          Where will I be constructing most of this? Would fire and grass points will be in their respected blueprints and as everything else is concerned will it be in the macro blueprints actor? And can I still get the points to show up on my widget the same way even if I delete the GI?

                          *To clarify, when I mean where will I write the rest of it, I mean if I should write in the widget BP, Game Mode, or Save Game


                          *Update:

                          I created a Macro Library. I created all that script. I just don’t know how to get the item that I destroy (Fire point) to call on that Save Macro and save that content. Unless I create that in all of the objects I destroy for points? And still a little confused about what I put in the GameSave directly and how to get it to show up on my widget hud

                          THANK YOU A MILLION. Seriously. I can't even begin to tell you how much you have helped.
                          One slight wrinkle with the system. You can't call that macro library from a widget, so you have to write that bit longhand.

                          Where will you construct it? Anyway you change the value of fire points, you need to save it using the macro.

                          Comment


                            #28
                            Originally posted by ClockworkOcean View Post

                            One slight wrinkle with the system. You can't call that macro library from a widget, so you have to write that bit longhand.

                            Where will you construct it? Anyway you change the value of fire points, you need to save it using the macro.
                            got it! So if I’m understanding correctly I’ll be creating a Game Save with my point variables and Read/Write/andCheck saving, then inside my points blueprints create the macros for reading and writing the particular points.

                            Comment


                              #29
                              Originally posted by Patrick_000 View Post

                              got it! So if I’m understanding correctly I’ll be creating a Game Save with my point variables and Read/Write/andCheck saving, then inside my points blueprints create the macros for reading and writing the particular points.
                              You can manage the manipulation of points in any way you like, but..., when you change anything, you have to copy it to the save game ( using the macros ).

                              So, often, you might was well just let the points variable live in the save game for convenience, rather than somewhere else. Because if the points variable is somewhere else, you have to remember to load and save it.

                              I think the only time you wouldn't want to do this would be on tick.

                              Comment


                                #30
                                Originally posted by ClockworkOcean View Post

                                You can manage the manipulation of points in any way you like, but..., when you change anything, you have to copy it to the save game ( using the macros ).

                                So, often, you might was well just let the points variable live in the save game for convenience, rather than somewhere else. Because if the points variable is somewhere else, you have to remember to load and save it.

                                I think the only time you wouldn't want to do this would be on tick.
                                ooo okay. Starting to click a little more I think. Won’t be able to mess with it till Monday. But I think I’m starting to get it. if I havnt said it a million times, thank you!

                                Comment

                                Working...
                                X