01 Status System Setup

In this tutorial we’ll set up a simple status system for our game.

Our game will use these status values:

  • HP and Max HP
  • Stamina and Max Stamina
  • ATK
  • RATK (for ranged attacks)

The default setup of a new project already got us covered with enough status values, we’ll adjust them to our needs. We’ll also set up the flying texts for HP refresh and damage, so make sure you already followed the flying text UI setup and flying text mover schematic tutorials.

Additionally, we’ll set up 2 status effects for handling stamina regeneration:

  • stamina regeneration over time
  • blocking positive stamina changes for a short time when stamina was reduced

This setup will recover stamina over time, but also block recovering when the player consumed stamina (e.g. by attacking or sprinting) for a short time. We’ll need to set up a (very simple) schematic and use it as a status value’s change schematic for this to work.

Finally, we’ll handle some general settings, setting up some sound types, animation types and input keys we’ll use later.

Let’s get to it.

Status Values #

We’ll start with the status value setup. Learn more about status values in this documentation.

Open the Makinom editor and navigate to Status > Status Values, we’ll change the already existing status values.

0: Max HP #

We can keep this status value as it is.

This defines the maximum HP a combatant can have.

1: HP #

The base setup for HP is already as we need it (using Max HP as maximum value and killing the combatant when reaching 0, i.e. the minimum value).

We’ll set up some UI Settings, counting to a new value over time and showing flying texts.

UI Settings > Count To Value #

Our value bars will show the portion of the status value that changed in a different color, so we’ll animate the change by counting to the new value, as well as add a short delay to it.

This allows the UI to accumulate multiple changes (e.g. hitting an enemy multiple times) before the damage highlight on the value bar begins to change.

  • Count to Value
    Enable this setting.
  • Interpolation
    Select Quadratic > Quadratic In + Out.
  • Time
    Set to 1.
  • Delay
    Set to 0.5.
  • Smooth Value Bars
    Enable this setting.

UI Settings > Flying Text Settings #

We’ll set up different flying texts for the player (red damage) and non-player combatants (white damage).

Click on Add Flying Text.

  • Player
    Enable this setting.
  • Ally/Enemy
    Disable these settings.

We’ll display a Refresh flying text, i.e. when healing HP.

  • Show Flying Text (Refresh)
    Enable this setting.
  • Text (Refresh > Content)
    Set to: <color=#00FF00FF>+<value></color>
  • Schematic Asset
    Select the FlyingTextScaleMover schematic from the flying text mover tutorial.

We’ll display a Damage flying text, i.e. when HP is reduced.

  • Ignore 0 Damage
    Enable this setting.
    Damage of 0 will not display a flying text.
  • Show Flying Text (Damage)
    Enable this setting.
  • Text (Damage > Content)
    Set to: <color=#FF0000FF><value></color>
  • Schematic Asset
    Select the FlyingTextScaleMover schematic from the flying text mover tutorial.

We’ll also flash the game object red when taking daamge.

  • Use Flash (Damage > Flash Settings)
    Enable this setting.
  • Flash Children
    Enable this setting.
  • Time
    Set to 0.2.
  • Fade Alpha/Red/Green/Blue
    Enable these settings.
  • From Current
    Enable this setting.
  • End Color
    Select a red color with full alpha (i.e. A=255 or 1, depending on your color picker).

That’s it for the player’s flying text – since the enemy flying text is basically the same, we’ll copy the player flying text and adjust it.

Copy the player flying text setup, i.e. scroll back up to it’s start and click on Copy.

Scroll down to the newly added setup.

  • Player
    Disable this setting.
  • Ally/Enemy
    Enable these settings.

We’ll only adjust the text for the Damage flying text.

  • Text (Damage > Content)
    Set to: <value>

2: Max Stamina #

We’ll change the Max MP to our Max Stamina, we only have to change the name.

  • Name
    Set to Max Stamina.

3: Stamina #

We’ll change the MP to our Stamina, we’ll change the name and add counting to a new value.

  • Name
    Set to Stamina.

UI Settings > Count To Value #

  • Count to Value
    Enable this setting.
  • Interpolation
    Select Linear.
  • Time
    Set to 0.1.
  • Delay
    Set to 0.
  • Smooth Value Bars
    Enable this setting.

We’ll return to the stamina after setting up the status effects and schematic for the regneration handling.

4: EXP #

We don’t need this status value, but we can keep it in case you want to add leveling and experience gains at a later time.

5: ATK #

We can keep this status value as it is.

This’ll be used for melee attack damage.

6: RATK #

We’ll change the DEF to our RATK, we only have to change the name.

This’ll be used for ranged attack damage.

  • Name
    Set to RATK.

That’s it for the status values for now.

Status Effects #

We’ll continue with the stamina status effects. Learn more about status effects in this documentation.

Navigate to Status > Status Effects, we’ll adjust the Default effect and add another effect.

0: Stamina Regen #

This status effect will regenerate stamina over time, regenerating 2 stamina every 0.1 seconds (the player’s maximum stamina will be 100, so it’ll take 5 seconds to fully recover).

We’ll add it as an auto effect to our player combatant, i.e. it’ll always be active.

  • Name
    Set to Stamina Regen.

Change Settings > Status Value Changes #

Scroll down to the change settings, that’s all we need to set up here.

Click on Add Status Value Change.

  • Status Value
    Select Stamina.
  • Set On
    Select Time.
  • Set Every
    Select Value > Value.
    Set the value to 0.1.
  • Change Value
    Select Value > Value.
    Set the value to 2.
  • Operator
    Select Add.
  • Set In
    Select Value.

1: Stamina Regen Block #

Add a new status effect. This’ll block positive stamina changes (i.e. the stamina regen effect) for a short time.

We’ll add the effect using a schematic when stamina receives damage (i.e. is reduced).

  • Name
    Set to Stamina Regen Block.

End Settings #

The effect ends after 1 second, i.e. each time we use stamina, regeneration is blocked for 1 second before it kicks back in.

  • End After
    Select Time.
  • Turn/Time Duration
    Select Value > Value.
    Set the value to 1.

Change Settings > Status Value Changes #

We’ll add blocking positive changes to stamina.

Click on Add Status Value Change.

  • Status Value
    Select Stamina.
  • Change Block
    Select Positive.

Save Changes #

That’s it for the status setup for now.

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Stamina Regen Block Schematic #

Next, we’ll set up a schematic that adds the Stamina Regen Block effect to it’s user (Machine Object). This schematic will be used as the stamina status value’s Change Schematic., i.e. we’ll automatically start it when stamina is changed (limited to negative changes).

Navigate to Schematics and start working on a new schematic.

Change Status Effect #

Add Node > Combatant > Status > Change Status Effect

This node is used to change status effects on combatants.

  • Object (Combatant)
    Select Machine Object.
    When used as a status value’s change effect, the combatant who’s status value is changed is the Machine Object of the schematic.

There’s already a Status Effect Change added for us.

  • Change
    Select Add.
  • Status Effect
    Select Stamina Regen Block.

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

I usually save all my schematics in Assets/Schematics/ and sub folders of it.

Update Stamina Status Value #

We’ll now add the schematic as a Change Schematic to our stamina status value.

Navigate back to Status > Status Values and select the Stamina status value.

Change Schematics #

Click on Add Schematic.

  • Schematic Asset
    Select the StaminaRegenBlock schematic we just created.

This mechanic will only be used by the player, so only enable it for the player.

  • Player
    Enable this setting.
  • Ally/Enemy
    Disable these settings.

We’ll also limit using it to negative changes via the Value Change Check settings.

  • Use Change Check
    Enable this setting.
  • Check Type
    Select Is Less.
  • Check Value
    Select Value > Value.
    Set the value to 0.

Sound Types #

We’ll use sound types on our combatants to play sounds (e.g. damage or attack) on them.

Navigate to Base/Control > Sound Types, we’ll change the Default type and add additional types.

0: Damage #

  • Name
    Set to Damage.

1: Attack #

  • Name
    Set to Attack.

2: Death #

  • Name
    Set to Death.

Animation Types #

Animation types are used to play animations on combatants, using their own animation setup. E.g. we can play an Attack animation type on a combatant, while each combatant has it’s unique attack animation setup.

Navigate to Base/Control > Animation Types, we’ll add additional types to the already set up types (which we’ll mostly not use).

13: Attack 2 #

  • Name
    Set to Attack 2.

14: Attack 3 #

  • Name
    Set to Attack 3.

15: Attack 4 #

  • Name
    Set to Attack 4.

16: Healing #

  • Name
    Set to Healing.

17: Roll #

  • Name
    Set to Roll.

Input Keys #

A new project already comes with some inputs set up, we’ll add some additional inputs for sprinting, rolling, attacking, throwing grenades and using potions.

Navigate to Base/Control > Input Keys, we’ll add new input keys.

6: Sprint #

Holding down shift will allow the player to sprint.

  • Name
    Set to Sprint.

Input ID Setting 0 #

  • Input Origin
    Select Key Code.
  • Positive Key
    Select Left Shift.
  • Input Handling
    Select Hold.
    I.e. the input is recognized while holding the key.

7: Roll #

Pressing space will use a roll ability (we’ll set it up later).

  • Name
    Set to Roll.

Input ID Setting 0 #

  • Input Origin
    Select Key Code.
  • Positive Key
    Select Space.

8: Attack #

The player will attack when using the left mouse button (we’ll set up the attacks later).

  • Name
    Set to Attack.

Input ID Setting 0 #

  • Input Origin
    Select Mouse.
  • Mouse Button
    Set to 0.

9: Grenade #

Pressing E will throw a grenade (we’ll set that up later).

  • Name
    Set to Grenade.

Input ID Setting 0 #

  • Input Origin
    Select Key Code.
  • Positive Key
    Select E.

10: Potion #

Pressing Q will throw a grenade (we’ll set that up later).

  • Name
    Set to Potion.

Input ID Setting 0 #

  • Input Origin
    Select Key Code.
  • Positive Key
    Select Q.

Save Changes (Again) #

And that’s it for now – our simple status system setup is complete.

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

 

Next, we’ll set up our player combatant, animations and controls.