Turn-Based Battle - Keyboard Controls & Textboxes

14

Index

Features on these Courses

Attached Files

The following files have been attached to this tutorial:

.c3p

tb-battletextbox.c3p

Download now 169.34 KB

Stats

3,347 visits, 6,441 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 24 Mar, 2021.

We do need to make some tweaks to the functions to accommodate the new control system as well. The BeginAttackSequence function has been rebranded to TurnStart and adjusted slightly to hide the continue sprite:

The PlayerAttack and OppAttack functions have been updated:

PlayerAttack

Condition

On function PlayerAttack

Action

Function ▶︎ Call RandomNumberGen

Continue ▶︎ Set visibility to Visible

System ▶︎ Set CurState to "PlayerTurn"

Sub-event Condition

Player ▶︎ HP > 0

Sub-event Condition

System ▶︎ Is not PlayerMoved

Sub-event Action

System ▶︎ Set NextState to "PlayerTurn"

Sub-event Condition

System ▶︎ Compare two values ▶︎ RandomNumber ≤ Player.Acc

Sub-event Action

System ▶︎ Set NextState to "OppTurn"

System ▶︎ Set PlayerMoved to True

Opponent ▶︎ Flash ▶︎ Flash on 0.1s off 0.1s for 1 second

Opponent ▶︎ Set HP to Self.HP-Player.Attack

BattleText ▶︎ Typewriter text "Player attacked. Attack hit for " & Player.Attack & " damage!" over 2 seconds

Sub-event Condition

System ▶︎ Compare two values ▶︎ RandomNumber > Player.Acc

Sub-event Action

System ▶︎ Set NextState to "OppTurn"

System ▶︎ Set PlayerMoved to True

BattleText ▶︎ Typewriter text "Player attacked. Attack missed!" over 2 seconds

As before, the OppAttack function is mostly the same:

That about covers the changes needed to swap from mouse to keyboard controls. By no longer relying on timers, you should also be able to add in animations for example before the trigger to progress the turn becomes available. Give it a go!

  • 3 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Epic! Thanks for the cool update! Also, Please know that the Dark Mode on your website is 90% of the Reason I will support you guys forever. Its the small details that show you care. ;)

  • hey can you please make a tutorial for a final fantasy tactics grid system movement & attack , i can pay you please

  • nice :)