Combining Status Value Flying Texts

Use schematics to combine multiple status value changes into a single flying text.

The flying texts you can add to status values are displayed for each individual change. However, you can use Change Schematics of the status value to combine multiple changes into a single flying text.

In this tutorial we’ll create a schematic to collect the changes to an experience status value (but this can be used for any status value) and handle the setup on the status value (and combatants). The change schematic works like this:

  • adds the change value (provided as local int variable) to an object variable on the combatant
  • waits a bit
  • checks if the object variable on the combatant still has a change value (i.e. not being 0)
  • displays a flying text
  • resets the object variable on the combatant to 0

I.e. beside the schematic, we also need to set up object variables for the combatants.

This tutorial is based on the 3D RPG Playground series, but you can use this for any kind of project.

Combined Flying Text Schematic #

We’ll start with the schematic we’re using as the change schematic on the status value.

The combatant the status value change happens on is available as the Starting Object of the schematic – in case the change came from another combatant (e.g. via an ability), the attacker is available as the Machine Object.

The status value change information is available as local int variables in the schematic, it has the change value via the variable key change, the old value (before the change) as oldValue and the new value (after the change) as newValue.

Open the Makinom editor, navigate to Schematics and start working on a new schematic.

 

You can download the finished schematic here:

Download Schematic

Change Variables #

Add Node > Value > Variable > Change Variables

We’ll add the local int variable change (holding the status value change) to an object variable on the combatant (Starting Object).

Click on Add Variable.

  • Change Type
    Select Variable.
  • Variable Key
    Set to combinedExp.
  • Variable Origin
    Select Object.
  • Object
    Select Starting Object.
  • Type
    Select Int.
  • Operator
    Select Add.
  • Float Value
    Select Variable > Int Variable.
  • Variable Key (Float Value)
    Set to change.
  • Variable Origin (Float Value)
    Select Local.

Wait #

Add Node > Base > Wait

Add a short wait time to collect some experience changes.

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

Check Variables #

Add Node > Value > Variable > Check Variables

We check if the combinedExp has a value, or if it was already reset to 0 by another change displaying the flying text.

Click on Add Variable.

  • Condition Type
    Select Variable.
  • Variable Key
    Set to combinedExp.
  • Variable Origin
    Select Object.
  • Object
    Select Starting Object.
  • Type
    Select Int.
  • Check Type
    Select Not Equal.
  • Check Value
    Select Value > Value.
    Set the value to 0.

Show Flying Text #

Add Node > UI > Dialogue > Show Flying Text

If there is a combined change, we’ll show it’s value in a flying text on the combatant (Starting Object).

This node is connected to the Success slot of the Check Variables node.

  • Object
    Select Starting Object.
  • Show Number
    Enable this setting.
  • Number
    Select Variable > Int Variable.
  • Variable Key
    Set to combinedExp.
  • Variable Origin
    Select Object.
  • Object
    Select Starting Object.

The Content defines what’s displayed in the flying text – we can add the number via the text code <value>. Let’s display it in a yellow text.

  • Text
    Set to: <color=#FFFF00FF>+<value> EXP</color>

The rest of the flying text setup is as we know it from other settings.

  • UI Prefab
    Leave this empty to use the default flying text prefab defined in UI > UI Settings.
    In case you want to use a different prefab to create the flying text, define it here.
  • Schematic Asset
    Select the schematic you want to use to animate the flying text.
    I’m using the FlyingTextScaleMover schematic, see this tutorial for details.
  • Destroy Time
    In case you don’t use a schematic, this setting defines how long the flying text is displayed.

Change Variables #

Add Node > Value > Variable > Change Variables

Finally, we’ll reset the combinedExp variable to 0.

Copy the first Change Variables node and change the following settings.

  • Operator
    Select Set.
  • Float Value
    Select Value > Value.
    Set the value to 0.

And that’s it for the schematic – save it, e.g. as CombinedExpFlyingText.

Status Value Settings #

With our schematic ready, we can now add the change schematic settings to the Experience status value.

Navigate to Status > Status Values and select the Experience status value (or any other you want to use this on).

Change Schematics #

The change schematics can be executed each time a change happens on a status value. You can also optionally limit it to defined sources (e.g. only from abilities), change values (e.g. only for damages by checking for negative values) and use other conditions.

We’ll just play our schematic for whatever change happens (on the player only).

Click on Add Schematic.

  • Schematic Asset
    Select the CombinedExpFlyingText schematic we just created.
  • Player
    Enable this setting.
  • Allies, Enemies
    Disable these settings.
    Only combatants of the player group should display this (for our exp changes).
    Please note that other status values (e.g. HP) most likely should be displayed for all.
  • From Ability/Item/Status Effect/Schematic
    Set all to Ignore.
    This’ll not limit where the change comes from.

UI Settings > Flying Text Settings #

Since the 3D RPG Playground’s experience doesn’t show any flying texts, there’s nothing to do for us here.

However, if you’re e.g. using this for a status value that’s already displaying flying texts, you might want to remove them. The change schematic doesn’t stop the regular flying texts from appearing, so this’ll lead to double flying texts.

Combatant Object Variables #

Finally, we’ll set up object variables for all combatants – they’ll be used as local object variables, i.e. each combatant has their own unique variables instead of sharing them via an object ID.

Navigate to Combatants > Combatants > General Settings.

Base Settings > Object Variable Settings #

  • Use Object Variables
    Enable this setting.
  • Local Variables
    Enable this setting.

Save Changes #

And that’s it for the setup.

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

Testing #

Hit play and test the status value changes.

You can quickly test flying texts of status values by selecting a combatant’s game object – the Combatant Component in the inspector allows you to change status values. E.g. add 11 exp and click on Add multiple times in a short time to combine the changes.

Tip: Multiple Combining Flying Texts #

If you have multiple status values that should combine changes in flying texts, make sure to use a unique variable key for each of them.

I.e. you have to set up an individual change schematic for each status value, or rather, for each combined change.

E.g. to combine positive changes with positive changes and negative changes with negative changes, you need a schematic and change schematic setup for each one, also limiting when they’re used via the Value Change Check settings.