ORK 4 RPG Framework Logo
  • ORK 4 GUIDE
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 GUIDE
    • Documentation
    • Tutorials
    • API
  • Support
  • Forum
  • Get ORK

ORK 4 Documentation

  • Getting Started
    • Welcome
    • First Steps (Unity)
  • Features
    • The Status System
    • Schematics
    • Schematic Nodes
    • Dialogue Importer
    • Variables
    • Selected Data
  • Components
    • Battle Components
    • Combatant Components
    • Control Components
    • Cursor Prefab Components
    • Game Starters
    • Interactable Components
    • Move AI Components
    • Scene Setup Components
  • Editor
    • The ORK 4 Editor
    • Sections & Sub-Sections
    • Node Editor
    • Schematic Editor
    • Asset Sources
    • Unity Overlay Toolbar
  • Section: System
    • System Settings
    • Languages
    • Organizer Types
    • Game States & Conditions
    • General Condition Templates
    • Object Pools
    • Prefab Savers
    • Scene Connections
  • Section: Controls
    • Game Controls
    • Interaction Settings
    • Player Controls
    • Camera Controls
    • Input Keys
    • Control Maps
    • Camera Positions
    • Battle Camera
  • Section: Gameplay
    • Game Settings
    • Formulas
    • Difficulties
    • Shortcut Slots & Settings
    • Custom Settings & Global Custom Settings
    • Global Machines
    • Machine Templates
  • Section: Status
    • Status Values
    • Status Effects
    • Attack Modifiers
    • Defence Modifiers
    • Abilities & Ability Developments
    • Status Developments
    • Research Trees
    • Damage Types
    • Status Bonuses & Templates
    • Status Condition Templates
  • Section: Inventory
    • Inventory Settings
    • Inventory Containers
    • Currencies
    • Items
    • AI Rulesets
    • Crafting Recipes
    • Equipment Slots & Slot Set Templates
    • Equipment & Available Equipment Templates
    • Shops
    • Loot
  • Section: Combatants
    • Combatants
    • Combatant Groups
    • Class Slots
    • Classes
    • Factions & Faction Benefits
    • Animations
    • Move AIs
    • Formations
    • Action Combos
  • Section: Battles
    • Battle Systems
    • Turn Based Battles
    • Active Time Battles
    • Real Time Battles
    • Phase Battles
    • Battle Spots
    • Battle AIs
    • Battle Actions Settings
    • Special Commands Settings
    • Target Settings
    • Target Selection Templates
    • Battle Range Templates
    • Battle Grid Settings
    • Battle Grid Highlights
    • Battle Grid Cell Types
    • Battle Grid Formations
  • Section: Content
    • Content Types
    • Music
    • Sound Templates
    • Areas
    • Teleports
    • Quests & Quest Tasks
    • Logs & Log Texts
    • Object Contents
  • Section: UI
    • UI Settings
    • UI Layers
    • UI Layouts
    • UI Boxes
    • HUDs
    • Notifications
    • Cursor Settings
  • Section: Menus
    • Start Menu
    • Save Game Settings
    • Option Categories
    • Menu Screens
    • Menu Requirements
    • Battle Menus
    • Loot Dialogues
    • Item Collection
    • Combatant Selections
    • Quantity Selections
    • Shop Layouts
  • Section: Texts
    • Text Settings
    • Formatting Settings
    • Flying Texts
    • Use Cost Display
    • Status Preview Display
    • Bonus Display
    • Status Change Display
    • Console Settings & Console Types
    • Text Codes
  • Sections: Editor
    • Editor Settings
    • Backups
    • Variables
    • Plugins
  • Scripting
    • Access Handler
    • Custom Nodes
    • Custom Save Data
    • Custom Component Save Data

ORK 4 Tutorials

  • ORK 4 Unity Quickstart Tutorials (3D)
    • ORK 4 Unity Quickstart 3D
    • 01 Initial ORK Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • Quickstart Extended
  • Battle Tutorials
    • Active Time Battles
    • Phase Battles
    • Real TT 01 Real Time Battles & Tab Targeting
    • Real TT 02 Control Map, Use Ranges & Battle Area
    • Real TT 03 Camera Control, Battle AI & Reuse Time
    • Real TT 04 Damage Detection, Action Animation & Player HUD
    • Real TT 05 Switch Player & Final Adjustments
    • Hit & Miss
    • Critical Hits
    • Cast Time
    • Reuse Time
    • Grid 01: Battle Grid Setup
    • Grid 02: Highlights
    • Grid 03: Cell Types
    • Grid 04: Move Command
    • Grid 05: Scene Grid Setup
    • Grid 06: Battle Ready
    • Grid 07 Use & Affect Ranges
    • Grid 08: Better Camera Control
  • Gameplay Tutorials
    • Multiple Interaction Controllers
    • Player Group Spawn & Follow
    • Spawn Hunting Enemies
    • Gamepad Controls (Unity Input System)
    • Combined Inputs
    • Control Map for Keyboard (Shortcuts)
    • Control Map for Gamepad (Shortcuts)
    • Quests 01: Menu Screen
    • Quests 02: Hunting
    • Quests 03: Collect Potion Materials
    • Quests 04: Collect Equipment Materials
    • Quests 05: Quest Mark HUDs
    • Crafting 01: Menu Screen
    • Crafting 02: Materials & Recipes
    • Crafting 03: Getting Materials
    • Crafting 04: Proficiency & Critical Outcome
    • Shop
    • Inventory Containers
  • Schematics Tutorials
    • UI Animation Schematics
    • Flying Text Animation Schematics
    • HUD Conditional Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Status Value UI Setup
    • Unity UI: Status Effect UI Setup
    • Unity UI: Shortcut UI Setup
    • Unity UI: Dragging Notification
    • Unity UI: Interaction HUD
    • Unity UI: Shortcut HUD
    • Unity UI: Turn Order HUD
    • Unity UI: Cast Time HUD
    • Unity UI: Quest HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Move Range HUD
    • Menus 01 UI Box Setup
    • Menus 02 Template HUDs
    • Menus 03 Menu Setup
    • Menus 04 Main Menu
    • Menus 05 Inventory
    • Menus 06 Equipment
    • Menus 07 Ability
    • Menus 08 Group
    • Menus 09 Quest
    • Menus 10 Crafting
  • Module 01: Status System
    • Introduction to Modular Tutorials
    • M01.1: Status Values
      • Introduction to Status Values
      • Health
      • Mana
      • Barrier
      • Base Experience
      • Class Experience
      • Spendable Experience
      • Normal Stats
    • M01.2: Modifiers
      • Introduction to Modifiers
      • Element
      • Attack Type
      • Size
      • Race
    • M01.3: Status Effects
      • Introduction to Status Effects
      • Buffs
      • Debuffs
      • Poison
      • Regeneration
      • Blind
      • Stun
      • Sleep
      • Silence
      • Enchants
      • Charm
      • Doom
      • Reflect
  • Module 02: Actions
    • Introduction to Actions
    • M02.1: Formulas
      • Introduction to Formulas
      • Physical Damage Formula
      • Magical Damage Formula
      • Hit Chance
      • Critical Chance
    • M02.2: Abilities
      • Introduction to Abilities
      • Base Attack
      • Elemental Magic Spells
      • Steal Ability
      • Drain
      • Healing Spell
      • Cure
      • Buff Abilities
      • Debuff Abilities

ORK 4 Extensions

  • Plugins
    • Save Game Compression Plugin
  • Schematic Nodes
    • Footstepper Nodes (Unity)
  • Scripts
    • A* Pathfinding Movement Component (Unity)
    • PolyNav 2D Movement Component (Unity)
    • Cinemachine Camera Control Type (Unity)
    • Rewired Input Key (Unity)
    • Unity Legacy Input Key (Unity)
    • Core GameKit Wrapper (Unity)
    • Pool Boss Wrapper (Unity)
View Categories
  • Guide
  • ORK 4
  • ORK 4 Tutorials
  • ORK 4 Unity Quickstart Tutorials (3D)

13 Animating Battle Start and End

0:00 / 11:51
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

In this tutorial we’ll set up schematics to animate the start and end of our battles.

Our battles take place in a separate battle scene – i.e. we need to remember the scene and position the player was before loading into the battle scene, or we can’t return there after the battle.

Additionally, which battle scene is used depends on the scene the player is in, so we’ll use a string variable that’ll contain the battle scene (we’ll set the variable later in our scenes, not in the schematics here).

We’ll set up:

  • game state
  • camera position
  • battle start schematic
  • battle end schematic for victory (collecting loot)
  • battle end schematic for lost (game over)

Since we don’t use escaping in this game, we don’t need to set up a separate battle end schematic for this battle outcome. Let’s get to it!

Game State #

We’ll set up a game state – we’ll use this later as a condition for displaying the player’s battle HUD. Our battle start/end schematics will change that game state, giving us exact control over when the HUD should be visible.

Navigate to System > Game States and add a new game state.

  • Name
    Set to: Show Battle HUD
  • Initial State
    Disable this setting.

Camera Position #

Camera positions are used to change a camera’s position, rotation or field of view based on a target, e.g. showing the front of an object. We’ll use one to zoom in at the start of a battle, before transitioning to the battle scene.

Navigate to Controls > Camera Positions, we’ll change the Default position.

0: Battle Intro Zoom #

We’ll use this camera position in a battle start schematic to zoom in (high field of view) and do a camera spin.

Camera Settings #

  • Name
    Set to: Battle Intro Zoom

Position #

  • Set Position
    Enable
  • Position Offset
    Set to: X=0, Y=0, Z=0
    We’ll zoom in directly on the target’s position.

Rotation #

  • Set Rotation
    Enable
  • Rotation
    Set to: X=0, Y=0, Z=180
    We’ll spin the camera on the Z-axis.
  • Look At
    Enable
  • Ignore Rotation
    Enable the Z axis.
    When using Look At, this’ll ignore the look rotation on the Z-axis and use the defined rotation.

Field of View #

  • Set Field of View
    Enable
  • Field of View
    Set to: 150

Save Changes #

Save the changes using the Save Settings button at the bottom of the editor.

Battle Start Schematic #

Now, we’ll set up the schematic animating our battle start.

We’ll remember the currently playing music (including it’s track position), the scene and position of the player and use the camera position to zoom in before loading into the battle scene.

Open the schematic editor.

Settings #

We’ll block player/camera controls during the start schematic.

  • Block Player Control
    Enable
  • Block Camera Control
    Enable

Actors #

We’ll add an actor to have access to the Battle Arena – we’ll use it to focus the camera on the battle instead of the player.

Click on Add Actor.

  • Actor Type
    Select: Battle Arena
    This’ll automatically use a currently ongoing battle’s object.

Store Music #

Add Node > Audio > Music > Store Music

We store the currently playing music to be able to resume playing it after the battle (i.e. in a battle end schematic).

The default setup of the node should usually already be what we need. Please note that this depends on which music channel your music is playing on.

  • Music Channel
    Set to: 0
  • Store ID
    Set to: 0

Play Sound (Channel) #

Add Node > Audio > Audio > Play Sound (Channel)

This node plays a sound on a sound channel instead of an object in the scene.

  • Audio Asset
    Select: Select Audio Clip
    This’ll let us directly define an audio clip in the node instead of setting one up in the Settings node.
  • Audio Asset
    Select: synthetic_explosion_1
  • Wait
    Disable
  • Play One Shot
    Enable

Store Scene #

Add Node > Game > Scene > Store Scene

Stores the current scene and player position.

No further settings needed.

Change Camera Position #

Add Node > Object > Camera > Change Camera Position

Now we’ll zoom in by fading to the camera position.

  • Camera Position
    Select: Battle Intro Zoom
  • Object (Target Object)
    Select: Player
  • Fade Position
    Enable
  • Time
    Select: Value > Value
    Set the value to: 1
  • Wait
    Disable
    We don’t wait for the fade to complete and instead continue immediately with the next node.
  • Interpolation
    Select: Quadratic > Quadratic In

Wait #

Add Node > Base > Wait

We’ll wait for a part of the zoom in before loading into the battle scene.

  • Time
    Select: Value > Value
    Set the value to: 0.5

Load Scene #

Add Node > Game > Scene > Load Scene

Now we’ll load the scene the battle should take place in.

As said above, we’ll use the value of a string variable to hold the scene name.

  • Keep Machine Object Alive
    Enable
    This’ll ensure the battle object (i.e. the machine object) alive during scene changes. Otherwise it’d be destroyed with the rest of it’s scene.
  • Spawn Machine Object
    Enable
    This will place the machine’s object instead of the player – in this case, this’ll place the battle object.

Target Scene 0 #

The Target Scene settings define the scene that will be loaded and where to spawn the machine (e.g. via spawn point).

  • Target Scene
    Select: Variable > String Variable
    Set the text to: battleScene
  • Variable Origin
    Select: Global
    We’ll have the scene’s name stored in a global string variable, i.e. it’s available everywhere.
  • Position Type
    Select: Spawn ID
    This’ll use a Spawn Point in the loaded scene to place the battle.
  • Spawn ID
    Select: Value > Value
    Set the value to: 0
    That’s the ID of the spawn point we already set up in the battle scenes.

Screen Fade Settings #

We handle fading out the screen here.

  • Own Screen Fade
    Enable
    If disabled, the scene change will use the default screen fade setup (defined in UI > UI Settings).

We’ll use the Screen Fade Out settings – we can stick with the default setup:

  • Fade Out
    Enable
  • Time
    Select: Value>Value
    Set the value to: 0.5
  • Start Color
    Set to a black color with no alpha (A=0).
  • End Color
    Set to a black color with full alpha (A=1 or A=255, depending on the color picker).

We don’t use the Screen Fade In settings, we’ll fade in later after handling some other things.

  • Fade In
    Disable

Place At Spots #

Add Node > Battle > Spawn > Place At Spots

This’ll place the already spawned combatants at their battle spots.

This is probably not needed in a this battle start schematic since no spawned combatants should be there – but it doesn’t hurt to have it.

  • Place All
    Enable

Spawn Battle Combatants #

Add Node > Battle > Spawn > Spawn Battle Combatants

This’ll spawn all combatants participating in battle.

  • Spawn All
    Enable

Change Music #

Add Node > Audio > Music > Change Music

Now we change the music to our battle music.

  • Play Type
    Select: Play
  • Music Clip
    Select: Battle

Change Game State #

Add Node > Game > Game > Change Game State

We’ll activate our new game states to show the battle HUD (which we’ll set up later).

Click on Add Game State.

  • Game State
    Select: Show Battle HUD
  • Set State
    Select: Active

Block Camera Control #

Add Node > Input > Block Camera Control

We’ll now unblock the camera control – we need to do this before we set the camera’s target, and also give the camera control time to update before fading in the screen.

  • Block/Unblock
    Disable
    I.e. the camera control will be unblocked.

Camera Control Target #

Add Node > Input > Camera Control Target

This node changes the current target of the camera control. We’ll target the Battle Arena actor.

Please note that this only works for the built-in controls or custom controls that are based on them.

  • Target Type
    Select: Object
  • Object (Target Object)
    Select: Actor 0: Battle Arena

Fade Screen #

Add Node > Animation > Fade > Fade Screen

And finally, we’ll fade in the screen.

  • Wait
    Enable
  • Time
    Select: Value > Value
    Set the value to: 0.5
  • Interpolation
    Select: Linear
  • Fade Alpha/Red/Green/Blue
    Enable

Click on Swap Colors, that’ll exchange the start and end color, which should now go from full alpha to no alpha.

  • Start Color
    Set to a black color with full alpha (A=1 or A=255, depending on the color picker).
  • End Color
    Set to a black color with no alpha (A=0).

And that’s it for the schematic. Click on Save Schematic to save it, e.g. as BattleStart.

Victory Schematic #

This battle end schematic is used when the player won the battle. We’ll play the victory music, collect our loot and return to the stored scene.

Create a new schematic using the +-button in the upper left corner of the schematic editor.

Settings #

  • Block Player Control
    Enable
  • Block Camera Control
    Enable

Change Music #

Add Node > Audio > Music > Change Music

Play the victory music.

  • Play Type
    Select Play.
  • Music Clip
    Select Victory.

Wait #

Add Node > Base > Wait

Wait a second.

  • Time
    Select: Value > Value
    Set the value to: 1

Collect Battle Gains #

Add Node > Battle > Gains > Collect Battle Gains

This node is used to collect experience and loot from a battle – we’ll also display the loot dialogue.

  • Show Gains
    Enable
  • Collect Loot
    Enable
  • Collect Experience
    Enable
  • Wait
    Enable

Wait #

Add Node > Base > Wait

We’ll wait a short time before returning to the stored scene.

  • Time
    Select: Value > Value
    Set the value to: 0.5

Change Music #

Add Node > Audio > Music > Change Music

Now we’ll fade back to the stored music (we stored it in the battle start schematic).

  • Play Type
    Select: Fade To
  • Play Stored Music
    Enable
  • Fade Time
    Set to: 1
  • Interpolation
    Select: Linear

Change Game State #

Add Node > Game > Game > Change Game State

We’ll inactivate the new game state to hide the HUD again.

Click on Add Game State.

  • Game State
    Select: Show Battle HUD
  • Set State
    Select: Inactive

Load Scene #

Add Node > Game > Scene > Load Scene

We’ll load the scene that was previously stored.

  • Keep Machine Object Alive
    Disable
    This time we spawn the player (the battle start schematic used this option to spawn the battle).
  • Scene Origin
    Select: Stored

And that’s it for the schematic. Click on Save Schematic to save it, e.g. as BattleEndVictory.

Defeat Schematic #

This battle end schematic is used when the player lost the battle. We’ll play the lost music and call game over.

Create a new schematic.

Settings #

  • Block Player Control
    Enable
  • Block Camera Control
    Enable

Change Music #

Add Node > Audio > Music > Change Music

Play the victory music.

  • Play Type
    Select: Fade Out Play
  • Music Clip
    Select: Lost
  • Fade Time
    Set to: 1
  • Interpolation
    Set to: Linear.

Change Game State #

Add Node > Game > Game > Change Game State

We’ll inactivate the new game state to hide the HUD again.

Click on Add Game State.

  • Game State
    Select: Show Battle HUD
  • Set State
    Select: Inactive

Wait #

Add Node > Base > Wait

We’ll wait for 3 seconds.

  • Time
    Select: Value > Value
    Set the value to: 3

Game Over #

Add Node > Game > Game > Game Over

This node will call game over according to the Game Over Settings (in Gameplay > Game Settings).

No further settings.

And that’s it for the schematic. Click on Save Schematic As … to save it, e.g. as BattleEndDefeat.

Using the Schematics #

With our battle start/end schematics set up, we’ll now return to our Turn Based battle system to use the schematics.

Navigate to Battles > Battle System and select the Turn Based battle system.

Base Settings > Battle Start/End Schematics #

We’ll use the schematics we’ve set up.

  • Start Schematic
    Select: BattleStart
  • Victory Schematic
    Select: BattleEndVictory
  • Defeat Schematic
    Select: BattleEndDefeat

Save Changes #

And that’s it!

Save the changes using the Save Settings button at the bottom of the editor.

 

Next, we’ll finally get to adding battles to our game.

Table of Contents
  • Game State
  • Camera Position
    • 0: Battle Intro Zoom
      • Camera Settings
      • Position
      • Rotation
      • Field of View
  • Save Changes
  • Battle Start Schematic
    • Settings
      • Actors
    • Store Music
    • Play Sound (Channel)
    • Store Scene
    • Change Camera Position
    • Wait
    • Load Scene
      • Target Scene 0
      • Screen Fade Settings
    • Place At Spots
    • Spawn Battle Combatants
    • Change Music
    • Change Game State
    • Block Camera Control
    • Camera Control Target
    • Fade Screen
  • Victory Schematic
    • Settings
    • Change Music
    • Wait
    • Collect Battle Gains
    • Wait
    • Change Music
    • Change Game State
    • Load Scene
  • Defeat Schematic
    • Settings
    • Change Music
    • Change Game State
    • Wait
    • Game Over
  • Using the Schematics
    • Base Settings > Battle Start/End Schematics
    • Save Changes
Sitemap
  • Showcase
  • ORK 4 Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (75)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (158)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!