# How to implement combat turns

**URL:** <https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787>\
**Category:** Audio\
**Tags:** rpg, turn, turn-based, unreal-engine, implementation, question\
**Created:** [June 15, 2017, 1:42pm UTC](https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787 "2017-06-15T13:42:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_aa967a7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_aa967a7a](https://forums.unrealengine.com/u/anonymous_user_aa967a7a)\
**Post date:** [June 15, 2017, 1:42pm UTC](https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787/1 "2017-06-15T13:42:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BenVlodgi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benvlodgi/32/1194567_2.png) [@BenVlodgi](https://forums.unrealengine.com/u/BenVlodgi)\
**Post date:** [June 15, 2017, 3:50pm UTC](https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787/2 "2017-06-15T15:50:10Z")

</div>

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:

 ![200653-ue_answerpic8a.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/9/ac925bc91b85896919680262589cc673251fe789.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_aa967a7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_aa967a7a](https://forums.unrealengine.com/u/anonymous_user_aa967a7a)\
**Post date:** [June 15, 2017, 4:09pm UTC](https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787/3 "2017-06-15T16:09:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_aa967a7a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_aa967a7a](https://forums.unrealengine.com/u/anonymous_user_aa967a7a)\
**Post date:** [June 26, 2017, 11:58am UTC](https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787/4 "2017-06-26T11:58:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BenVlodgi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/benvlodgi/32/1194567_2.png) [@BenVlodgi](https://forums.unrealengine.com/u/BenVlodgi)\
**Post date:** [June 26, 2017, 3:35pm UTC](https://forums.unrealengine.com/t/how-to-implement-combat-turns/398787/5 "2017-06-26T15:35:50Z")

</div>

Sounds good!

Glad to hear it worked for you!
