ORK Framework Logo - RPG Editor for Unity
  • ORK 4 BETA
  • Features
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • 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
    • Adding Active Time Battles
    • Adding Phase Battles
    • Hit & Miss
    • Critical Hits
    • Cast 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
    • 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

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)

09 First Abilities

In this tutorial we’ll set up our first abilities.

The regular/base attack will deal physical damage to HP using a formula, which we’ll also set up. We’ll also set up a poison attack, that does reduced damage and adds poison to the target.

All abilities we’ll set up in this tutorial series (both physical and magical) will be very simple, we don’t use any hit chance or critical hit calculations – each attack will hit and deal regular damage.

We’ll also take a look at target selection templates – they’re used by abilities and items to define the targets that are available, e.g. targeting a single enemy or ally, a group of enemies, etc.

We’ll set up

  • damage formulas
  • target selection templates (only look at them)
  • content types for abilities
  • 2 abilities

Let’s get to it!

Formulas #

We’ll start with setting up 2 formulas, one for physical and one for magical damage.

Formulas work as a steb-by-step calculation, calculating each node at a time to the current formula result. We’ll use sub-calculations (via Begin Sub Calculation and End Sub Calculation nodes) to make sure the math is still correct.

Open the ORK editor and navigate to Gameplay > Formulas. We’ll change the already added Default formula and add an additional formula. You can optionally use organizer types for organizing them in the editor, but it’s not required (and isn’t part of this tutorial series).

Calculating Damage #

The physical damage is calculated like this:

User.ATK / ((50 + Target.DEF) / 50)

It uses the following values:

  • User.ATK
    The user’s ATK status value.
  • Target.DEF
    The target’s DEF status value.

Due to how formulas work, we’ll pack the 2nd half of the formula ((50+Target.DEF) / 50) into a sub-calculation.

For magical damage, just replace ATK with MATK and DEF with MDEF.

0: Physical Damage #

This formula calculates the physical damage, using a sub calculation for the defence part of the formula.

Formula Settings #

  • Name
    Set to: Physical Damage

Status Value #

Add Node > Combatant > Status Value

Add the user’s ATK.

Using the formula uses an initial value (a starting value passed to the formula), the ATK is added to that value, increasing the used ATK value.

  • Operator
    Select: Add
  • Status Origin
    Select: User
  • Status Value
    Select: ATK

Begin Sub Calculation #

Add Node > Base > Begin Sub Calculation

This node starts a sub calculation.

The result of the sub calculation (ending using an End Sub Calculation node) is added to the current formula result using this node’s operator.

We’ll divide the current formula result by the sub calculation’s result. We’ll also immediately set the sub calculation’s current value to 50.

  • Operator
    Select: Divide
  • Initial Value
    Select: Value > Value
    Set the value to: 50

Tip! You can also have sub calculations within your sub calculations!

Status Value #

Add Node > Combatant > Status Value

Add the target’s DEF.

  • Operator
    Select: Add
  • Status Origin
    Select: Target
  • Status Value
    Select: DEF

Value #

Add Node > Value > Value

Divide by 50.

  • Operator
    Select: Divide
  • Value
    Select: Value > Value
    Set the value to: 50

End Sub Calculation #

Add Node > Base > End Sub Calculation

This ends our sub calculation, using it’s Begin Sub Calculation node’s operator to change the formulas value.

Any open sub calculation is closed at the end of a formula, i.e. we don’t really need to add this node, but it’s better to keep things clean and organized – every Begin Sub Calculation node should have an End Sub Calculation node.

No further settings needed.

1: Magical Damage #

This formula calculates the magical damage and works exactly like the physical damage formula, just with different status values.

So, we’ll copy the Physical Damage formula and change the status values.

Formula Settings #

  • Name
    Set to: Magical Damage

Status Value #

Change the 1st Status Value node’s status value to MATK.

  • Status Value
    Select: MATK

Status Value #

Change the 2nd Status Value node’s status value to MDEF.

  • Status Value
    Select: MDEF

Target Selection Templates #

As said, target selection templates define the target selection that is used by abilities and items.

We’ll mainly use them in the form of the default target selections, which define templates that are used for e.g. Enemy Single or Ally Single selections.

A new project already has a wide range of templates set up and used for the default target selections – we don’t need to do any setup for our tutorial, but we’ll check out 2 of them to see how they work.

Navigate to Battles > Target Selection Templates and select the Enemy Single template.

Enemy Single #

This template is used for abilities and items that target a single enemy. Our tutorial project is pretty simple and doesn’t use any advanced setup like use ranges or affect ranges, so the target selections are mainly using 2 settings – Target Type (e.g. enemy or ally) and Target Range (e.g. single or group).

Target Settings #

  • Target Type
    Select: Enemy
  • Target Range
    Select: Single

Ally Single #

Select the Ally Single template.

This template uses the Ally target type to target a single ally instead of an enemy.

Target Settings #

  • Target Type
    Select: Ally
  • Target Range
    Select: Single

Default Target Selections #

The default target selections are set up in Battles > Target Settings.

A new project already uses the default templates that are created for the corresponding default target selections, e.g. Enemy Single and Ally Single.

We don’t need to change anything here, just remember that you can change them here. Also, content types can override the default target selections with custom templates for all abilities/items of their type.

Damage Type #

The damage type manages which animations will be used on targets to animate damage, evade, etc.

A new ORK project already has a damage type set up using the Damage and Evade organizer types.

Navigate to Status > Damage Types and check if the Default type is set up correctly.

  • Use Damage Animation
    Enable
  • Damage
    Select: Damage
  • Use Critical Animation
    Enable
  • Critical Damage
    Select: Damage
  • Use Evade Animation
    Enable
  • Evade
    Select: Evade

Content Types #

We’ve already set up content types for status effects – now we’ll add more for our abilities.

Content types can also define the target selection settings for abilities and items using them – i.e. if enemies or allies are targeted, single or group, use range, etc.

Each ability and item can define their own setup, though. We’ll set up the target selection settings in the content types and have the abilities (and later items) use them.

Navigate to Content > Content Types, we’ll change the Attack and Magic type and add an additional type.

2: Attacks #

Physical attacks will be using this content type.

Content Information #

  • Name
    Set to: Skills

Base Settings #

  • Damage Type
    Select: Default

The Target Selection Settings define which targets are available to abilities and items of this type.

  • Target Selection Type
    Select: Default Enemy > Enemy Single

1: Magic #

Magical attacks will be using this content type.

Content Information #

  • Name
    Set to: Spells

Base Settings #

  • Damage Type
    Select: Default

The Target Selection Settings define which targets are available to abilities and items of this type.

  • Target Selection Type
    Select: Default Enemy > Enemy Single

7: Support #

Support abilities will be using this content type.

Copy the Spells content type and change the following settings.

Content Information #

  • Name
    Set to: Support

Base Settings > Target Selection Settings #

Support abilities will target allies, not enemies.

  • Target Selection Type
    Select: Default Ally > Ally Single

Feel free to move up the Support content type to place it after the Spells type.

Attack Ability #

Our first ability will be the base attack of our combatants. We’ll set up more physical and magical abilities (also adding status effects) in a later tutorial.

Navigate to Status > Abilities, we’ll change the Default ability.

Content Information #

  • Name
    Set to: Attack
  • Sprite (Icon)
    Select: icons_332

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings #

  • Content Type
    Select Skills.
  • Useable In
    Select: Battle
    The attack is only available in battles.

Target Settings #

The target settings handle status changes on targets.

Target Selection Settings #

These settings define who can be targeted by the ability. The default setup will target a single enemy – we’ll change it to use the ability’s content type setup instead (which is also single enemy).

  • Use Content Type
    Enable

Target Changes #

Click on Add Target Change.

  • Use Organizer Type
    Enable
    We’ll play an organizer type on the target when the attack hits (i.e. when it’s outcome is calculated).
  • Organizer Type
    Select: Damage

Click on Add Status Change. We’ll deal damage to HP.

  • Change Type
    Select: Status Value
  • Status Value
    Select: HP
  • Operator
    Select: Sub
  • Change Value
    Select: Value > Formula
    Select formula: Physical Damage

Poison Attack Ability #

The poison attack ability is very similar to the attack, but it’ll cost 3 MP to use it. The ability will be used by enemies.

Copy the Attack ability and change some settings.

Content Information #

  • Name
    Set to: Poison Attack
  • Sprite (Icon)
    Select: icons_311

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Use Costs > Status Changes #

Using the ability costs 3 MP.

Click on Add Status Change.

  • Change Type
    Select: Status Value
  • Status Value
    Select: MP
  • Operator
    Select: Sub
  • Change Value
    Select: Value > Value
    Set the value to: 3

Target Settings > Target Changes > Target Change 0 > Status Change 0 #

We’ll reduce the damage by changing the efficiency of the status change.

The poison attack should only do half the damage of the regular attack.

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

Target Settings > Target Changes > Target Change 0 > Status Change 1 #

However, we add another status change to add the Poison effect to the target.

Click on Add Status Change and change the following settings in the new Status Change 1.

  • Change Type
    Select: Status Effect
  • Change Type
    Select: Add
  • Status Effect
    Select: Poison

Save Changes #

And that’s it for now – we’ll later return to those abilities to set up how they’re animated in battles (using schematics).

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

 

Next, we’ll continue the player’s setup.

Table of Contents
  • Formulas
    • Calculating Damage
    • 0: Physical Damage
      • Formula Settings
      • Status Value
      • Begin Sub Calculation
      • Status Value
      • Value
      • End Sub Calculation
    • 1: Magical Damage
      • Formula Settings
      • Status Value
      • Status Value
  • Target Selection Templates
    • Enemy Single
      • Target Settings
    • Ally Single
      • Target Settings
    • Default Target Selections
  • Damage Type
  • Content Types
    • 2: Attacks
      • Content Information
      • Base Settings
    • 1: Magic
      • Content Information
      • Base Settings
    • 7: Support
      • Content Information
      • Base Settings > Target Selection Settings
  • Attack Ability
    • Content Information
    • Base Settings
    • Target Settings
      • Target Selection Settings
      • Target Changes
  • Poison Attack Ability
    • Content Information
    • Use Costs > Status Changes
    • Target Settings > Target Changes > Target Change 0 > Status Change 0
    • Target Settings > Target Changes > Target Change 0 > Status Change 1
  • Save Changes
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
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!