Easily communicate between maps

Hey.
I’m just trying to do a battle system like Pokémon. For this I need to open a battle map and then return to the old map.
The problem is it’s really long to pass all variables I need between maps. So I’m just wondering if they isn’t an easy way to do that ?
If you don’t understand what I want to do, check this between 7:14 and 7:26 : Let's Play Pokemon: FireRed - Part 1 - A new start! - YouTube

Have a good day :).

Only the GameInstance has persistent Data throughout the game.

When a battle occurs, save the current Map and your position in the Game Instance.
Call the Battle Map. After the Battle is finished, load the saved Map and move your character to the saved location.

Hum, that’s would be quite long to save all the variables I need but I think there isn’t any other way.
Thanks for the reply :slight_smile: !

what exactly do you need to save?

About 15 variables for each Pokémon (= x6) and 10 for the Trainer.

UE4 is quite quick with parsing variables I don’t think that would take more than a second to save

Yeah, I know this would be quickly ingame but save all this variables with blueprint will be quite long to do and this would be a big mess x).

You probably want to make a single player game.
Why don’t you store the variables and currently “equipped” Pokémon in the GameInstance, too?

It’s okay, I just created a save game blueprint and store the variables inside. So now, I did map transition like I wanted but I found too a way to save my game easily.
Thanks a lot for the help !

What about creating all levels in one level? Far away from each other… i know its not clean solution but if you want to have limited maps, it may work…

  • as someone mentioned, you can create event in game instance where you can pass all variables…