Tutorial 1–3 - BLKTower/TestWiki GitHub Wiki

In this tutorial, we will be improving our weapon with actors. This tutorial will be a bit heavier than our previous ones as actors are a bit more involved.

This tutorial will cover:

1. Creating An Action Actor

You may have noticed at the end of the last tutorial that the missiles were launching from the hero's feet and impacted at the enemy's feet. This is less than ideal. We can fix this with action actors. While most actors represent a single model, VFX, or sound, action actors are special actors that configure how other actors are created, as well as adjusting the launch and impact positions of launch missile effects.

To get started, go to the Actor tab and create a new actor. Let's name it "Hero IceMage Weapon Attack FX". Set the Parent to "_FX Attack SingleTarget." Then set the Actor Type to "Action Actor."

In this Action Actor you just created, in Effect, select your weapon's launch missile effect (Hero IceMage Weapon Launch).

1 Action Actor

The thing to pay attention to here is the Launch Site and Target Site of the action actor (set to SiteWeapon and SiteHit from our parent actor, respectively). The action actor tells the launch missile effect to use these sites for its Launch and Target positions. So when the Hero IceMage Weapon Launch effect fires, it will look for a "SiteWeapon" on the caster unit and a "SiteHit" on the target unit.

2. Host Sites

So what are these Sites? These sites are arbitrary attachments that can be added to unit actors. If you look at your hero actor and scroll down to its "unitActor.hostSites" you can see that it already has a "SiteHit" and "SiteStatus" that it's inheriting from its parent actors (our enemy units have these same sites as well). The action actor we created looks for a "SiteWeapon" on the caster... but our hero doesn't have one yet. So let's add one.

2 Host Sites

Click the "Add" button next to the unitActor.hostSites and name the new site "SiteWeapon" (this name is important, since it's what our action actor is currently looking for).

3 new host site

Set the new site's Forward and Up properties to "0.5". These values mean that this site will be 0.5 forward and 0.5 up from the hero's origin position, which is about where the tip of the mage's wand is during the attack animation.

4 new host site values

PRO TIP: You can use actor events to quickly test/debug your own host sites. Don't sweat if you're not familiar with actor events BUT IF YOU ARE, the psuedo events would be:

Hit Plus for new Event > ActorCreate > Create > Actor:"Some Actor" HostSite:"SiteWeapon"

5 pro tip actor events

...which looks like this in-game!

5b gif


3. Impact FX

Okay, now our missile no longer launches from/targets feet. An improvement for sure, but it's still missing impact VFX. So let's add that now.

Create a new actor and name it "Hero IceMage Weapon Impact FX". Keep the Actor Type set to "Model Actor" and set the Parent type to "_FX OneShot SelfRemoving." This parent type is useful for VFX as it tells the asset to play its default animation and destroy itself when finished. Again, you may want to collapse the events so the actor data is more readable. Set the Resource Type to "ParticleAnimation" (where most VFX live) and Resource Name to "vfx_icemage_frostbolt_impact".

6b impact fx

Now we can add our new impact fx to our action actor. Select the action actor and set the Impact Model to the new impact FX.

7 action again

4. Let There Be Sound

The last thing we'll add in this tutorial is a sound effect when the missile is launched.

Create a new actor and name it "Hero IceMage Weapon Launch SFX". Set the Parent type to "_SFX OneShot SelfRemoving" (note that it's _SFX and not _FX). Keep the Actor Type as "Model Actor" and click Add.

Set the Resource Type to "Sound" and the Resource Name to "ice_mage_missile_launch".

8 sfx

Then head back over to the action actor and set its Launch Model to the sound actor you just created (Is a sound really a model? Yes).

9 action again AGAIN

And that's all! Now our weapon looks and sounds nicer!

12b gif


Tutorial Map: Tutorial 1–3 Actors

Next Up: Tutorial 1–4: Writing Triggers In Lua

⚠️ **GitHub.com Fallback** ⚠️