Making a battle event

Hi i am trying to make a pokemon like battle event where a monster has a chance to spawn when the player walks over a certain tile and if one does then the player is taken to a battle scene. I have followed a tutorial to make the random spawn chances of the monsters but i do not know how to get the monsters data from their data table, or how to start a battle with them. Any help would be very appreciated.

basically to start the battle you are going to want to open a new level (battle level). in this level the game mode will be overwritten so that your turn based battle system is the game mode. from there the actual battle part is easy: decide who goes first: enemy turn → attack → player turn → player action input → repeat til one person wins.

for the monster data i would create a struct with all the needed information ( name, mesh, stats, attacks, etc). then make a data table off that so you can create a entry for each monster type ( one for: pikachu, charmander, squirtle). then create a pawn or character class and have all the logic for doing attacks, health, and taking damage. then just use a get data table row node to get the information.

now for the last important but. before any of this can be done you will need to save some variables to the game instance while in the main world right when the encounter happens but before opening the battle level. you will want to save the players location in the world for when you send them back after the fight, the monster type that was encountered so that you can use that to set which data table row to use when the fight begins, and possible other variables that you may want.

basically when you encounter a monster you will save its type to the game instance, then load a level that contains two characters already placed in it. upon loading the level have the enemy character get the enemy type and use it as a variable to tell the data table what to set the mesh, hp, and attacks to. then repeat for the players monster.

This may sound a bit confusing and i may not have explained it well but just think of what needs to happen step by step and im sure youll figure it out. also the way i explained here is just one way that ive used to accomplish this same kind of thing.