top of page

- Projectile State Modules -

i1.PNG
i1.PNG

  Welcome! In this section we will be talking shortly about Projectile State Modules themselves and the actual big dive will be in tutorials themselves.

    I assume that you have been into Character State Modules and progressed through the tutorials as it would be rather rebellious of you to check anything related to Projectiles before Characters themselves!

    Projectile State Modules are much simpler than Character ones. However, as due to obvious differences of what Projectiles do compared to Characters, it is normal to find different properties to fiddle with. So let's start!

 1- Basics

  • Firstly, let's see how we can check if a BP is a Projectile State Module or not. It is easy as checking if the Parent Class is "P State Module Base" or not. "P" here is standing for Projectile.

  • There are a few ways of creating a State Module, but the easiest and safest one is finding the Template Blueprint Asset named "Proj_Temp_SM".

  • Feel free to duplicate this actor and move the newly created one somewhere else. It is strongly suggested to have a "_SM" tag for State Modules to find them easier when the amount of your files increase!

i3.PNG
  • Projectile State Modules can contain more than one State Definition. You can actually contain your entire State System in one file, but that would be kind of unwise. When Unreal compiles a Blueprint, it checks the entire visual code itself which increases the time it takes to compile.

i2.PNG

 2- State Definition / Components

    As the title implies, State Definitions are the beginning and main visual codes for a State we want our Projectile to be in. A State Definition consists of a "Custom Event", a "New State Definition" and optional "State Components". So let's check what they are about!

  • Custom Events are the starters and the Events that are called for to trigger a State Definition and set Character's state to a new one.

  • Each Custom Event MUST have a name as "State [Integer]", such as "State 100" as the picture to the right shows or else UF2D can't trigger it via various ways which will be talking about later.

Capture.PNG
  • If there is more than one Custom Event, same IDs are not allowed. However you can have Custom Events with no limitations name-wise if they are in different State Modules. For example, you can have one "State 100" in a SM Blueprint "A" while having the same name in SM Blueprint "B". However, it is STRONGLY suggested to have different State IDs for every unique State Definition you want to have.

 

  • UF2D Framework has internal fail-safes to avoid problems that might occur, but you will get false positives if you are wanting to trigger something depending on a State ID if more than one same ID is present for a Projectile.

  • Creating a Custom Event is very easy. Just [RMB] click in Event Graph of a State Module BP and select "Add Custom Event..."

  • Make sure the name Starts with "State" and ends with an Integer that will define the ID of the State the Fighter will be in!

  • PS: You can edit the name after creating the node, by selecting it and pressing [F2] and with a double click on the name with a small delay in-between!

  • New State Definition nodes are for kickstarting the first values for a State we want our Characters to get in.

  • To Create a State Definition, [RMB] click in Event Graph of a State Module BP and type "New State Definition" to search for the Node and then select it.

----------------------- Inputs -----------------------

  • "State Entry" is the execution input. You will mostly see a Custom Event linked to here so the State starts.

  • "State Name" is an optional variable and has no functionality. Can be left empty.

       ----- Parameters -----

  • "New State ID" defines the ID of the State Definition it belongs to. It MUST be unique for a Prjectile and have the same ID number that the Custom Event mentioned above to avoid confusion.

i4.PNG
  • "Projectile Health" is used when a Projectile meets with an Enemy's Projectile, reducing each other's health.
     

  • For example when "Projectile A with 1 Health" clashes with a "Projectile B with 1 Health", both will get destroyed. However if A has 2 Health, only B will be destroyed while A will lose 1 Health. It will take another Projectile B or another projectile that has higher health to destroy A.
     

  • "Dominant" allows a Projectile to not lose health when gets into contact with another Projectile. Mainly used for Beam and Exlosion attacks.

  • "Projectile Health" is also reduced when Projectile attacks a Character Target. State Component "Collision Responses" defines the amount of the "Health Reduction" per hit.
     

  • For example a Projectile with Health Value of 1 that has Health Reduction value of 1 will get destroyed in 1 hit. If Health Value is 5, it will take 5 total amount of hits to be destroyed.

i5.PNG
  • State Component nodes are for kickstarting the first values for a State we want our Projectiles to get in.

  • State Components are optional (with one exception) and can be used at will. Also a State Definition should NOT have more than one of the same Component type.

i6.PNG
  • To Create a State Component, [RMB] click in Event Graph of a State Module BP and type "State Component - [Name]" to search for the Node and then select it.

  • We will not be talking about all Components in this section but will do so shortly about them in Tutorials and eventually make a huge Library containing data about them.

  • "State Component Entry Gate" node is  the one MUST be there before State Addons are started to be used.

  • This little guy is an exception for State Components, as the rest of them are optional, while this one isn't.

i7.PNG

 3- State Addons

  • State Addons are extra nodes that have their own set of rules to trigger. They are in blue colors and optional tasks that you want to trigger with a certain condition while a State is active.

  • We will not be talking about all Addons in this section but will do so shortly about them in Tutorials and eventually make a huge Library containing data about them.

i8.PNG
  • To Create a State Addon, [RMB] click in Event Graph of a State Module BP and type "Addon - [Name]" to search for the Node and then select it.

  • Unlike State Components, Addons don't need to be unique and we can have more than one with different condition requirements.

i9.PNG

       One different thing to note is that Addons have tags at the end of their titles; "CD - CT - IT".

  • CD stands for "Condition Dependent". Once the State this Addon belongs to gets activated, it will start making a check per condition to see if the "Condition" is met. Addon will become offline after the condition is met once.

  • CT stands for "Constant Trigger". Similar to a CD tagged Addon, this one also checks for a condition. However it continues to check per trigger even after the condition is met once.

  • IT stands for "Instant Trigger". This Addon does NOT check for a Condition and it will get called instantly. Mostly used in conjunction with other Addons to trigger simultaneously.

 4- State Extensions

  • Extensions are helpers and nodes that are needed to be there for some Components and Addons that need additional data to be inputted in.

AnimEx2_Stan.PNG
  • To Create a State Extension, [RMB] click in Event Graph of a State Module BP and type "Extension" to search for the Node and then select it.

  • Unreal Engine's search tab may come up with too many options sometimes. So it is better to drag with [LMB] from an input/output to get the node we need!

  • Just like State Components and Addons, we will not be talking about all extensions in this section but will do so shortly about them in Tutorials and eventually make a huge Library containing data about them.

 4- State Informations

  • Informations are extra helpers that provides data from other places possible. They are mostly used for setting Conditions on and can be used in conjunction with each other.

i11.PNG
  • To Create an State Information, [RMB] click in Event Graph of a State Module BP and type the name of data to search for the Node and then select it.

  • Unreal Engine's search tab may come up with too many options sometimes. So it is better to drag with [LMB] from an input/output to get the node we need!

  • To check the complete list of what you can use in Projetctile State Modules, search for "P_StateModule_ML". This is the Macro Library that contains all the nodes that you can use! (All the nodes you have seen so far are macros.)

    Our short entry of Projectile State Modules end here. However the best way to understand them is seeing them function runtime so let's create a Projectile here!

bottom of page