In this tutorial we’ll set up schematics to animate (some) abilities and items.
This tutorial continues the sub-series for animating battles.
We’ll set up 3 variants of a schematic that’ll spawn a particle effect, play an audio clip and calculate the outcome of a battle action.
The difference is where we spawn the particle effect – either at the game object itself, it’s Center child object or it’s Top child object. Those child objects are already set up on our combatant prefabs – and if they’re not there, it’d just use the game object itself.
Calculate Effect Schematic #
First, we’ll set up the base variant for the calculate schematic. It’ll spawn a prefab, play an audio clip and calculate the outcome of the action.
We don’t need to handle destroying the prefabs in the schematic – we’ll use the Auto Destroy After Time setting when defining the prefabs in abilities and items to do this automatically for us.
Create a new schematic.
Settings #
We’ll add a prefab and audio clip to the schematic – however, we don’t select assets for them.
We’ll later use the asset override settings to set them depending on which item or ability they’re used in.
Prefabs #
Click on Add Prefab Resource.
Audio Clips #
Click on Add Audio Clip Resource.
Spawn Prefab #
Add Node > Game Object > Prefab > Spawn Prefab
We’ll spawn the prefab on the target (Starting Object).
- Prefab
Select Prefab 0. - Use Prefab Rotation
Enable this setting. - Target Type
Select Object. - Object (Target Object)
Select Starting Object. - Spawn At
Select All.
Play Sound #
Add Node > Audio > Audio > Play Sound
Play the audio clip on the target.
- Object (Play On)
Select Starting Object. - Audio Clip
Select 0: (the audio clip we set up). - Play One Shot
Enable this setting.
Wait #
Add Node > Base > Wait
We’ll wait for a short while to have the effect/audio do it’s thing before we calculte the outcome.
- Time
Select Value > Value.
Set the value to 0.5.
Calculate Action #
Add Node > Battle > Action Outcome > Calculate Action
This node is used to calculate the outcome of an action. See this documentation for more details.
We don’t need to make any changes to it’s settings.
Wait #
Add Node > Base > Wait
We’ll wait a second for the effect to continue before the action ends.
- Time
Select Value > Value.
Set the value to 1.
And that’s it for the schematic. Click on Save Schematic to save it, e.g. as CalculateEffect.
Calculate Effect Center Schematic #
We’ll simply change what we need to for this variation and use Save Schematic As to save it as a new schematic.
Spawn Prefab #
We’ll only change the Child Object we’re targeting with the prefab.
- On Child
Select Path. - Find Child
Set to Center.
And that’s it for the schematic. Click on Save Schematic As … to save it, e.g. as CalculateEffectCenter.
Calculate Effect Top Schematic #
And once more for the top.
Spawn Prefab #
- On Child
Select Path. - Find Child
Set to Cursor.
And that’s it for the schematic. Click on Save Schematic As … to save it, e.g. as CalculateEffectTop.
Abilities #
Next, we’ll set up the battle animations for some of our abilities.
Navigate to Status > Abilities and change the following abilities.
7: Drain #
Drain targets the Center with the particle effect.
Battle Animation #
Using the start/end animations for abilities should be the default:
- Use Start Animation
Enable this setting. - Use End Animation
Enable this setting.
Click on Add Battle Animation.
- Schematic Asset
Select the CalculateEffectCenter schematic.
We’ll replace the prefab in the Resource Overrides settings.
Click on Add Prefab Override.
- Auto Destroy After Time
Enable this setting. - Time
Set to 3. - Prefab
Select DrainEffect.
We’ll also override the audio clip. Click on Add Audio Clip Override.
- Audio Clip
Select zap2g.
8: Steal #
Stealing targets the Center.
Battle Animation #
Click on Add Battle Animation.
- Schematic Asset
Select the CalculateEffectCenter schematic.
We’ll replace the prefab in the Resource Overrides settings.
Click on Add Prefab Override.
- Auto Destroy After Time
Enable this setting. - Time
Set to 3. - Prefab
Select StealEffect.
We’ll also override the audio clip. Click on Add Audio Clip Override.
- Audio Clip
Select random6.
9: Heal #
Alright, I think you know how to set this up now.
I’ll just list which Schematic Asset, Prefab and Audio Clip to use. All prefabs use an Auto Destroy After Time setup with 3 seconds.
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select HealEffect. - Audio Clip
Select heal.
10: Cure #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select CureEffect. - Audio Clip
Select curse2.
11: Regeneration #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select RegenerationEffect. - Audio Clip
Select zap.
12: Faster #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select StarEffect. - Audio Clip
Select warp.
13: Slower #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select NegativeEffect. - Audio Clip
Select zap2f.
14: Shut Up! #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select NegativeEffect. - Audio Clip
Select zap13.
15: Keen Eye #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select StarEffect. - Audio Clip
Select enchant2.
16: Meditate #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select StarEffect. - Audio Clip
Select entrance.
17: Look At Me! #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select ProvokeEffect. - Audio Clip
Select magicdrop.
18: Defensive Mode #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select StarEffect. - Audio Clip
Select teleport.
19: Fortify #
- Schematic Asset
Select the CalculateEffect schematic. - Prefab
Select FortressEffect. - Audio Clip
Select explode2.
21: Fire #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffect schematic. - Prefab
Select FireEffect. - Audio Clip
Select flamethrower.
22: Water #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffectCenter schematic. - Prefab
Select WaterEffect. - Audio Clip
Select Splash.
23: Quake #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffectCenter schematic. - Prefab
Select QuakeEffect. - Audio Clip
Select explode3.
24: Wind #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffectCenter schematic. - Prefab
Select WindEffect. - Audio Clip
Select freeze2.
25: Light #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select LightEffect. - Audio Clip
Select zap8a.
26: Dark #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffect schematic. - Prefab
Select DarkEffect. - Audio Clip
Select disenchant.
27: Electro #
Don’t forget to set up the battle animation for all 3 levels.
- Schematic Asset
Select the CalculateEffect schematic. - Prefab
Select ElectroEffect. - Audio Clip
Select zap6a.
Items #
Next, we’ll set up battle animations for the items.
Navigate to Inventory > Items and change the following items.
0: Potion #
The potion targets the Top with the particle effect.
Battle Animation #
Click on Add Battle Animation.
- Schematic Asset
Select the CalculateEffectTop schematic.
We’ll replace the prefab in the Resource Overrides settings.
Click on Add Prefab Override.
- Auto Destroy After Time
Enable this setting. - Time
Set to 3. - Prefab
Select HealEffect.
We’ll also override the audio clip. Click on Add Audio Clip Override.
- Audio Clip
Select bottle.
1: High Potion #
As you can see, this setup works the same as for abilities.
I’ll continue with listing which Schematic Asset, Prefab and Audio Clip to use. All prefabs use an Auto Destroy After Time setup with 3 seconds.
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select HealEffect. - Audio Clip
Select bottle.
2: Magic Potion #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select StarEffect. - Audio Clip
Select bottle.
3: Super Potion #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select HealEffect. - Audio Clip
Select bubble3.
4: Revive Potion #
- Schematic Asset
Select the CalculateEffect schematic. - Prefab
Select ReviveEffect. - Audio Clip
Select blessing2.
5: Cure Potion #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select CureEffect. - Audio Clip
Select bubble2.
6: Antidote #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select CureEffect. - Audio Clip
Select bubble.
7: Eye Drops #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select CureEffect. - Audio Clip
Select bubble.
8: Cough Drops #
- Schematic Asset
Select the CalculateEffectTop schematic. - Prefab
Select CureEffect. - Audio Clip
Select bubble.
Save Changes #
And that’s it for the ability and item schematics!
Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.
Next, we’ll set up schematics for physical attacks.