top of page

- Character State Module Tutorial -
- Taunt -

    Welcome! In this section we will be making our first State Module and make a call for it. It will be a very simple State Module that consists of only minimum requirements to make one and a great start to learn how things work. Later on we will get to more advanced stuff of course!

    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. Thankfully Ryu (Omen in this case) is a Fighter with almost zero character. He lacks personality so much that him adjusting his outfit can only be considered as "Taunt". Yes.

  • We will also be using Ken Masters as the other Fighter to mainly focus on one "MyOmen".

 1- Preparation

  • Let's start with getting our Folders ready for the State Module we will create. You don't have to create any folders like this but it is always a good idea to keep things tidy.

  • Then we will put a copy of "SM Template" and put it into our newly created Folder and rename it "MyOmen_Taunt_SM".

  • Reason we are having a "Self SMs" folder is that later on we will have one that shall be named "Attached_SMs" which will contain Attachment State Modules.

 2- State Definition

  • It's okay to just edit nodes that are already there, but for the sake of tutorial, we will do everything from the beginning.

  • Here we will be adding a Custom Event for beginning and name it "State 1050". It is strongly suggested to NOT use State IDs between 0-1000 and 5000-7000 as they are mostly used by the Main State Module that contains the base States for Characters.

PS: You can delete stuff with [DEL] button in your keyboard too!

  • Just so we don't have any misunderstandings, value 1050 is NOT a strict Taunt State ID by any means. You can have it 1100 if you so like.

  • Now let's add a New State Definition. Since we are having a "Standing" Stance and the its type is "Non-Attack", we don't need to fiddle with the properties much aside from changing the New State ID from "0" to "1050".

  • Never forget, the value of "New State ID" MUST match with the Custom Event's name, which is "State 1050" in this case.

  • While taunting, we need to make sure that Omen loses complete control. So neither Movement or Action Input will be allowed to be entered.

  • We also should make sure that once this State is triggered, any previous Movement should be stopped.

  • For these, we will use 2 State Components; Control and Movement Adjustments.

  • Character Stance Value is important to be correct as it is mostly used by Attack System to play the correct Animation when an impact occurs. And it is also used to prevent triggers. For example if your Stance Value is "Crouching", you may not want a "Standing Grab" attack to land on the Fighter.
     

  • State Type is important especially for "Attack Definitions" that we will be talking about later. This value lets everything in the fighting zone know what kind of position the Fighter has put itself into.
     

  • "Non-Attack" value, we are declaring that we are doing a basic State. "Attack" value means we are aiming to attack and that is the only way to make "Attack Definitions" work in a State. "Hit Receive" means we have been attacked.

  • PS: Where exactly Movement and Action Inputs are used will be revealed later in the "Input Definition" section. We will get to that soon!

  • Before we go into triggering an Animation, lets make sure our "Taunt" slot in "Standard Animation List" is filled.
     

  • We will not be making it from start but use what the regular Oman has!

  • For Taunt Animation, we will be using the Flipbook showcased at start. First we will need the Update Animation State Component.

 

  • The Extension we will use shall be "Standard" so we can use an animation from the Standard Animation List that FAnims contain. Let's update the animation variable while at it!

  • "Standard Animation List" already contains a Taunt slot we can use, however using a Unique Animation is also possible so don't think that you are forced to use one animation for one or more Taunt states you want to have. We will use "Unique Animations" in upcoming tutorials.

  • Last Component we want to add is called Addon Entry Gate. (1) states that there is one gate which is the default entry point for adding Addons to our State.

  • For this State, the basic properties are finished. However we still need to have at least one State Addon to be able to get out of the Taunt state. So let's handle that next!

 3- State Addons

  • For this State we will be only be using one Addon which is called "Addon - Change State - CD". This is where the important State ID comes into play!

  • This Addon is tagged with "CD", which means it is "Condition Dependent". We can trigger this Addon by setting its "Condition" boolean to TRUE. Since this is a basic Taunt State, we want to get out of this state when the animation is over.

  • "Information" node called "Animation Over" has a boolean that returns TRUE when the current animation is over, which is exactly what we need!

  • Our Target State is "State 0", which is the Idle / Standing State of every Character which is stored in "Main State Module"Remember, every Character has one which contains the basic states such as Standing, Jumping, Receiving Hit etc.

  • Notice that there is an input called "Target State Module". If we leave this input empty, UF2D will assume we are trying to trigger State 0 inside our Taunt State, which is wrong! What we need is a way to reach our "Main State Module" instead.

i1.PNG
  • In this case we already have a "Main State Module" so all we need to do is use the "Information" node and get its Return Value.

  • Default Value of "State to Call" is 0, which is what we need so we don't need to change it.

  • Now we got the State ready to get triggered by entering an input so lets get to it!
     

  • PS: State 0 in Main State Module belongs to Standing Idle Stance of all Fighters.

 4- Pre-Input Configuration

    Before we get into defining Inputs for State Modules, there is one more topic that we need to discuss. Which is Act System Bool List.

  • Every Character in UF2D has a variable array called "Act System Bool List". This is an optional list that contains Booleans that you can assign State(s) which makes combos (or preventing them) much easier.
     

  • For now our list will 20 items for future plans and we will use the 1st for TauntItem 3 will stay FALSE for a reason we will find out very later!

  • "Reset Act System" is an event that all Fighters has. It is triggered in many Main State Modules, such as in Idle State (State 0), Recovery States etc. As the name suggests, the purpose of the Event is to reset the Boolean List to its default values.

Capture.PNG
  • In this case, we want Taunt to be triggerable when the Fighter gets its control back from whatever it was doing, whether doing a move, or after receive hit state is over. For that to happen, we need to have our Boolean set to TRUE.

     Now you are probably wondering "Okay, we got one state that is Taunt, so we got one item in the Act System Array. But how do we use this thing?!" Before further due, let's see what the "Input State Definition" is!

 5- Input State Definition

    Input State Definitions allows us to have connection between the buttons you press and the States you want to trigger. They exist in Fighter Blueprints and demand certain Conditions to be met in order to trigger the said State.

    Once a button or combination of them is done to trigger a State, the Input is stored and Input State Definitions check each whether the input belongs to them or not. If the input is not related or conditions are not met, another Input State Definition is checked.

    It is strongly suggested to link Definitions via "Input Failure" output so that the chain goes on. All this information might be overwhelming at first but as the tutorials go on, we will be using more of this Definition so fear not! ^-^

    
    Some properties in this node is mostly for advanced users so  if I am not talking about certain properties, that means I am ignoring them on purpose. We will have a detailed documentation soon so just tag along for now!

i2.PNG
  • In our Fighter Blueprint "MyOmen_Char", we have a Graph called "Input System" which all Fighters in default, containing an event called "Check Player Action Input - Delayed".
     

  • This is the Event that triggers with one frame delay to account for double and triple button presses, hence the name. Most of our Input State Definitions will be linked to this Event.

  • Lets work on the "Condition" input! First we want to make sure that our "Character Stance" is Standing. But that alone is not enough.

 

  • Remember our "Act System Bool List" that contains one value? Now lets get that with a "Get" node with Array ID "0" which is the first value in the list and connect both this value and Stance we prepared with an "And" node.

  • Also we want the State to trigger only when we have both Movement and Action Inputs are enabled, aka Fighter is in full control. States such as Idle and Walking has Movement and Action Inputs enabled so as long as we are in such States, we can trigger our Taunt!
     

  • Of course we can override such states but that's a topic for another tutorial.

  • Now we should tell this Input Definition to trigger the Taunt State Module and its State ID!
     

  • All we need is setting "Target State Module" to "Omen2_Taunt_SM" and its "State to Trigger" to "1050", which is the value of the State that we want to get into!

  • Lastly we need to prepare the Input that Player needs to do to trigger this State if all other conditions are met. At the very below the "Input Combination" is the Array variable that we need to edit.
     

  • Since this State is only a Taunt we don't need anything complicated, a "Single Tap" of Taunt button shall do!

  • If you followed everything correctly, the moment you press "Taunt" button, it should work!
     

  • Feel free to select debug values to see how lines light up as we press the button!

    This is all for a Taunt State. I hope it was a good start up for State Module creation! Feel free to continue to next tutorial to where we talk about Intro and State Modules here. Thank you for your time!

bottom of page