- Character State Module Tutorial -
- Spawn Projectile -
Welcome! In this section we will be making our first State Module that spawns a Projectile. It is extremely easy compared to other State Modules so let's get to it right away!
Before we start, I assume that you have checked all the previous documentation and tutorials, got an "MyOmen" Fighter going on already as almost all Tutorials will be related to him.
-
Video to the right is a demonstration on the State Module we will be creating. Basically Omen will trigger a simple State that also Spawns Projectile.
-
We will also be using Ken Masters as the other Fighter to mainly focus on one "MyOmen".
1- Preparation
-
Previously we made a Taunt State Module. Just to make things easier, we shall duplicate and change the blueprint's name to "MyOmen_SpawnProj_SM".
-
While at it, let's change the Custom Event's name to "State 1900" and set the ID value of State Definition to the same number and change State Type to "Attack".
-
Control and Movement Adjustments can stay same but of course we need to change the Animation!
-
Meanwhile let's change the Flipbook to a Hadouken throwing one. One thing you might notice is, this Flipbook got a "Socket" named "HadoSpawn" so let's talk about it a bit.
-
Sockets are places that we can define on sprites. Here in this Flipbook, Sprites that named "Omen_SHado_Spr3 / 4 / 5" have one socket right at Omen's palms named "HadoSpawn".
-
In the video I showcase how to remove and add a Socket on your own. Pretty easy as you see, and even easier to use it!
-
Before we move on to using the said Socket, lets add 2 "Addon - Play Sound - CD" to our State.
-
One will be Omen's Voice and the other one will be Hadouken's spawn sound! Also our conditions to trigger shall be "Animation Element" as "3".
-
Now it is time to finally spawn our Projectile. For what we need is an Addon called "Spawn Projectile - CD".
-
Our "Condition" will be "Element >= 3" as this will make sure the Projectile will be spawned in one of those sprites that are bigger or equal to 3. Normally it would immediately trigger at 3 so this is just for failsafe really. Feel free to use "= 3" if you like!
-
With "New Attack Type" value, we can give our Fighter a new Attack Type to let the other objects know. This is the same property that Attack Definition has. We need this variable as despite not trigger an Attack Definition, what we are doing is still an attack, albeit with a Projectile.
-
"Projectile" defines the Projectile BP that we want to spawn.
-
"Use Unique Parameters" will allow us to select a State Module we want while by default it uses only the "Main State Module" of the Projectile. Generally stays toggled on.
-
"Target State Module" is the State Module we prepared for Our Projectile to be in when it is spawned.
-
"State to Trigger" is for triggering which State ID for the State Module mentioned above. Which we prepared in previous tutorial as well, that is "State 100" in PROJECTILE State Module!
-
Now what we need is the "Socket Location" that we named "HadoSpawn". To do that, once again we use the variable name "Character Owner" drag out "Character FB Main" out of it.
-
This is the exact same name of a Character's Main Flipbook as the video showcases!
-
Finally let's drag out from our "Character FB Main" variable and fetch "Get Socket Location".
-
Enter the name that we gave which was "HadoSpawn" and there we go. It is all ready!
-
It is time to trigger this State Module that we just finished preparing.
-
First of all, let's copy one of the Hurricane States we have and start editing it out!
-
Now what we need is is a way to dictate an input in combination of "Down + Down-Forward + Forward + Light Punch".
-
If you have followed up correctly, doing the motion should trigger a Hadouken event!