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.
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!
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:
( remember this updated it, doesn’t save it too ), becomes this:
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:
CheckSaveGame looks like this:
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:
See it uses CheckSaveGame to make sure it’s there first, no hassle. And WriteSaveGame:
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:
and WriteFirePoints:
Is this making sense? It’s probably good to also see a decent tuut on macros:
@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.
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.
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!
You’re welcome Once you get it, you’ll be streets ahead.