So if i want to store varibles like for example inventory arrays or anything i later would want to keep in one place for
easy save feature implementation later. is GameStateBase BP the way to go for a single player game or am i missunderstanding what its intended for? And if so what is a better place to store them? i Havent started on a actual save game feature yet, im still working on the inventory, but i want to avoid having to move stuff around later as that has caused me alot of problems presiously, so im trying to plan ahead.
Hey P19923,
If you want to store player-based information in your game, e.g. a players inventory like you’ve said, you can use PlayerState as a base class.
If it’s some sort of public information, visible for all players, GameState is the way to go. Maybe Game Mode and Game State | Unreal Engine Documentation and Unreal Architecture | Unreal Engine Documentation hint you in the right direction.
Since you mentioned that the game will be SinglePlayer, I think it doesnt make that much of a difference if you use Game- or PlayerState here. These base classes will store all your data as long as your level is played.
If you need some sort of inter-level persistent storage you should take a look at GameInstance class. Rama wrote a tutorial on it here A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums.
Hope that helps you to get started.
Thank you for the reply! Yeah most of the inventory will need to be accessible from all level in the game. Exept for a chest in the main “base” of the game.
I just realized i should have posted this under blueprint scripting. I looked into the GameInstance class and it seems it has to be done with real programming. Can i avoid that and do it with
blueprints. I only have some basic programming skill in java. So ill be on really thin ice if i start programming in C++
(Edit) I also realized im missing some very basic knowledge of how blueprints work. When i create a blueprint,i havent acutually
create a instance of that blueprint accessible thruout all levels? So if i store something in it on level A, then something on level B
i would have stored stuff in 2 completely different objects? i think things just got alot more complicated