How to implement combat turns

Sounds good!

Glad to hear it worked for you!

Hi, I’m a student who is currently learning how to work with the engine. I have been developing an isometric turn based rpg game, inspired by the first fallout games.
For now I have finished to implement the grid, the movement system, the inventory system and the dialogue system. All basic stuffs, they’re not pretty but works as intended.

But now I need help with the combat system. In particolar I can’t understand how to define turns of the pawns I’m using. I reached the defining of the combat order of my pawns, but then I don’t know how to define logically a turn.

I tried using events and event dispatchers, but I don’t know how to tell my turns manager to wait for the event “turn finished” of the pawn to resume the cycle of pawns and start the event “start turn” to another.

If some code is needed I can provide it right away.

You can give your pawns an EventDispatcher called OnTurnFinished, you can even give the dispatcher parameters, like… a reference to the pawn calling this.

Then, in the beginning of the game, the turn manager can bind an event to each of these Pawn’s Dispatcher.

In the Pawn… when the turn is finished, call the OnTurnFinished.

Here’s the turn manager setup:

Thank you, as soon as I get something done I’ll inform you.

I was finally be able to finish my turn based system, the basics at least.
I used an actor that keeps track of all the pawns in my level and get all their event dispatchers. When a battle begin, it makes an ordered list using a vector and disable input to all of those pawns and enables input only to the first.
When the first pawn finishes it’s turn it call the event dispatcher. The turn manager disable input from that pawn and enable to the second and so on.