Home Gallery Resources The Team Rules chat Login Register
Pages: [1]
Author Topic: How to Make a Counter  (Read 3213 times)
0 Members and 1 Guest are viewing this topic.
KingJigglypuff
Meme Machine
Moderator
****
Offline Offline

Posts: 7206


  • Awards RAGE!! >9000 Hyperactive Contributor Heart Container

  • View Profile Awards
    « on: December 13, 2015, 10:56:35 AM »


    Unlike the last tutorial I made, making a counter is fairly simple to make and shouldn't eat up too much file size.

    For a counter, this tutorial will be split into three parts: Counter, Counter Attack, and Misc.

    Requirements:
    -Two open Special Actions and four open Sub Actions.
    -Three LA Float variables. (Check this link to see which variables you're able to use. http://forums.kc-mm.com/index.php?topic=74266.0 )

    Let's begin now.

    Note: The coding previews will be using BrawlBox/Decimal previews.

    Part 1: Counter.
    1a) Actions.
    In a sense, you could code the main Action for the Counter for whichever Special you please. The initial coding is fairly simple, as it's basically your standard Action coding, alongside a few additional commands.

    A = Float 1
    X = Action to change to when the Counter is activated.
    Y = Ground Sub Action.
    Z = Air Sub Action.

    Quote
    Change Action action=0, requirement=Animation End
    Additional Change Action Requirement On Ground
    Change Action action=14, requirement=Animation End
    Additional Change Action Requirement In Air
    Float Variable Set: LA-Float[A] = IC-Basic[2]
    Float Variable Add: LA-Float[A] += 1
    Change Action action=X, requirement=Compare: IC-Basic[2] >= LA-Float[A]
    Set Loop Infinite
       If On Ground:
          Set Air/Ground: On Ground
          Set Edge Slide: Can drop off side of stage
          If Bit is Set: RA-Bit[16]
             Change Subaction: sub action=Y, pass frame=true
          Else
             Change Subaction: sub action=Y
             Bit Variable Set: RA-Bit[16] = true
          End If
          Additional Subaction Change Requirement: In Air
       Else
          Set Air/Ground: In Air
          Set Edge Slide: In Air; Can leave stage vertically
          If Bit is Set: RA-Bit[16]
             Change Subaction: sub action=Z, pass frame=true
          Else
             Change Subaction: sub action=Z
             Bit Variable Set: RA-Bit[16] = true
          End If
          Additional Subaction Change Requirement: On Ground
       End If
       Loop Rest
    Execute Loop


    What this will do is set a Float, based on your current damage and add one to it, as I believe it has to do with something about the float being stored as one damage less. Once the float is set, the Action will change if your current damage changes without taking knockback (Super Armor needed).

    1b) Sub Actions.

    This is fairly simple, all you need to do is in the Main Tab, set the Frame in which the Counter activates and how long you want the Counter to last for. Though rather than intangibility, you use Super Armor. You can do anything you want in the other tabs.

    X=Frame to begin the Counter on.
    Y=Frame to end the Counter on.

    Quote
    Asynchronous Timer: frames=X
    Super/Heavy Armor: State=Super Armor, Tolerance=0
    Asynchronous Timer: frames=Y
    Super/Heavy Armor: State=None, Tolerance=0


    Since the Change Action command changes when damage increases without flinching, using Super Armor is essential. For the aerial Sub Action, just insert a GoTo command and have it reference the ground Sub Action.

    Part 2: Counter Attack
    2a) Actions

    Like Part 1, the Action coding of the Counter Attack is straightforward with additional commands.

    A=Float 1.
    E=Float 2.
    X=Ground Sub Action.
    Y=Air Sub Action.
    Quote
    Float Variable Set: LA-Float[E] = IC-Basic[2]
    Float Variable Subtract: LA-Float[E] -= LA-Float[A]
    Change Action action=0, requirement=Animation End
    Additional Change Action Requirement On Ground
    Change Action action=14, requirement=Animation End
    Additional Change Action Requirement In Air
    Set Loop Infinite
       If On Ground:
          Set Air/Ground: On Ground
          Set Edge Slide: Can drop off side of stage
          If Bit is Set: RA-Bit[16]
             Change Subaction: sub action=X, pass frame=true
          Else
             Change Subaction: sub action=X
             Bit Variable Set: RA-Bit[16] = true
          End If
          Additional Subaction Change Requirement: In Air
       Else
          Set Air/Ground: In Air
          Set Edge Slide: In Air; Can leave stage vertically
          If Bit is Set: RA-Bit[16]
             Change Subaction: sub action=Y, pass frame=true
          Else
             Change Subaction: sub action=Y
             Bit Variable Set: RA-Bit[16] = true
          End If
          Additional Subaction Change Requirement: On Ground
       End If
       Loop Rest
    Execute Loop

    What this does is apply your new damage to a new float and subtracts the damage you used to have from the damage you have now.

    2b) Sub Actions.

    Again, this is rather straightforward, except with a few additional commands.

    E=Float 2
    C=Float 3
    *You do not need to make your Offensive Collision match the one used in the example. You only need to set your damage as variable and have the variable be Float E.
    X=Frame hitboxes start on.
    Y=Frame to terminate hitboxes on.

    Quote
    Body Collision: status=Intangible No Flashing
    Float Variable Set: LA-Float[C] = 0
    Float Variable Subtract: LA-Float[C] -= LA-Float[E]
    Float Variable Subtract: LA-Float[C] -= 1
    Add/Subtract Damage: LA-Float[C]
    Asynchronous Timer: frames=X
    Body Collision: status=Normal
    *Offensive Collision: Id=0, Bone=10, Damage=LA-Float[E], ShieldDamage=0, Direction=361, BaseKnockback=50, WeightKnockback=0, KnockbackGrowth=85, Size=10, Z Offset=0, Y Offset=0, X Offset=0, TripRate=0%, HitlagMultiplier=x1.5, SDIMultiplier=x1, Flags=813892736
    Synchronous Timer: frames=Y
    Terminate Collisions
    What the coding on the top does is set Float C to 0, so Float E can subtract from it in order to subtract damage via Add/Subtract Damage command. The hitbox just has the damage parameter set to Variable. Make sure to apply a Goto command into the aerial Sub Action.

    Take note that this coding will make your counter attack do the same amount of damage from the attack you took. Though it can be changed, alongside a threshold.

    Part 3: Misc
    This part will show a few misc things to do to make your counter more authentic. This is all done in the Sub Action section we went over in Part 2.

    3a) Minimum/Maximum Damage Threshold.
    This will show you what to do in order to apply a minimum/maximum threshold for your counter attack.

    X=Minimum damage you want your counter attack to do.
    Y=Maximum damage you want your counter attack to do.
    Quote
    If Compare: LA-Float[E] <= X
       Offensive Collision: Id=0, Bone=10, Damage=X, ShieldDamage=0, Direction=361, BaseKnockback=50, WeightKnockback=0, KnockbackGrowth=85, Size=10, Z Offset=0, Y Offset=0, X Offset=0, TripRate=0%, HitlagMultiplier=x1.5, SDIMultiplier=x1, Flags=813892736
    Else
       If Compare: LA-Float[E] >= Y
          Offensive Collision: Id=0, Bone=10, Damage=Y, ShieldDamage=0, Direction=361, BaseKnockback=50, WeightKnockback=0, KnockbackGrowth=85, Size=10, Z Offset=0, Y Offset=0, X Offset=0, TripRate=0%, HitlagMultiplier=x1.5, SDIMultiplier=x1, Flags=813892736
       Else
          Offensive Collision: Id=0, Bone=10, Damage=LA-Float[E], ShieldDamage=0, Direction=361, BaseKnockback=50, WeightKnockback=0, KnockbackGrowth=85, Size=10, Z Offset=0, Y Offset=0, X Offset=0, TripRate=0%, HitlagMultiplier=x1.5, SDIMultiplier=x1, Flags=813892736
       End If
    End If
    This shows the minimum damage threshold coding. If an attack does less than or equal to X, then it'll do X damage. If an attack does more than or equal to Y, then it'll do Y damage. Otherwise, it'll do damage equal to Float E. If your counter attack won't have a maximum threshold, then you can remove the coding related to Y damage.

    3b) Damage multiplier.

    This will show you how to add a multiplier to your counter attack's damage output. Make sure you put this coding after the Add/Subtract Damage command, but before the hitboxes.

    E=Float 2.
    X=Multiplier.
    Y=How much to add to Float E after Float E is multiplied by X
    *=In some instances, the damage will be less than the actual output, so that's what the Float Variable Add command does.

    Add the following commands to the counter attack Sub Action
    Quote
    Float Variable Multiply: LA-Float[E] *= X
    *Float Variable Add: LA-Float[E] += Y

    What this does does is multiple Float E by X before adding Y to it. In some cases, you might not need Y, so if you don't, then you can remove the Float Variable Add command.

    This should cover the essentials of making a Counter. If you come across any issues or have any questions, then ask away. I hope this tutorial will aid others for their projects
    « Last Edit: June 19, 2019, 07:49:40 PM by KingJigglypuff » Logged

    I don't take requests.

    My PSA Thread

    Large Leader
    I'm shocked I'm allowed to still have this.
    Angel Kitten
    ***
    Offline Offline

    Posts: 3036


  • Awards Active Contributor Renowned Hacker Diamond in the Rough Super Saiyan Topic

  • View Profile Awards
    « Reply #1 on: December 13, 2015, 10:58:32 AM »


    About time you made this.

    0/10, took too long. Even though it's actually a 10/10 tutorial.
    Logged



    Quote from: Miacis
    In other words, LURK MORE.
    Quote from: LC-DDM
    In other news, birds fly, sun shines, fishes swim, and the sky is [censored]ing BLUE.
    Quote from: Miacis
    3. ... You seriously don't know who Clinton is?
    Quote from: Haseyo
    If only hacking Brawl paid bills.
    Quote from: Nanobuds
    O snap
    Quote from: DrPanda
    But you are in a Smash Bros. thread.
    You can't have an opinion here.

    Alexarah2014
    Intermediate Kitten
    **
    Offline Offline

    Posts: 10


    View Profile Awards
    « Reply #2 on: December 14, 2015, 08:50:21 PM »


    Great tutorial KingJigglyPuff! By the way do I need to give a character a new animation slot in Brawlbox for the counterattack or do I simply use a GoTo subaction command?
    Logged

    KingJigglypuff
    Meme Machine
    Moderator
    ****
    Offline Offline

    Posts: 7206


  • Awards RAGE!! >9000 Hyperactive Contributor Heart Container

  • View Profile Awards
    « Reply #3 on: December 15, 2015, 08:18:04 AM »


    What do you mean by animation slot?
    Logged

    I don't take requests.

    My PSA Thread

    Alexarah2014
    Intermediate Kitten
    **
    Offline Offline

    Posts: 10


    View Profile Awards
    « Reply #4 on: December 15, 2015, 04:04:25 PM »


    Sorry I wasn't clear when I said animation slot I actually meant Animation Data in a character's motion pac file. Basically I saw an option in Brawlbox to make a new animation for the character motion pac that I opened which in this case was Mario. I was wondering if I needed to make a new animation in Brawlbox and reference the counter attack to that or simply reference the counter attack to a preexisting animation.
    Logged

    KingJigglypuff
    Meme Machine
    Moderator
    ****
    Offline Offline

    Posts: 7206


  • Awards RAGE!! >9000 Hyperactive Contributor Heart Container

  • View Profile Awards
    « Reply #5 on: December 15, 2015, 04:23:17 PM »


    Oh. All you need to do is just add model animations.
    Logged

    I don't take requests.

    My PSA Thread

    Alexarah2014
    Intermediate Kitten
    **
    Offline Offline

    Posts: 10


    View Profile Awards
    « Reply #6 on: December 16, 2015, 05:18:50 PM »


    Hmm I'm having trouble with adding new Action Groups with Brawlbox because it freezes every time I try to save after adding a new Action. Any thoughts as to why this is happening? Oh yeah the reason for me trying to add a new Action Group is I'm not sure if I should use the Actions that are below the Final Smash Action of a character or make a new Action in Brawlbox. I'm quite stuck on this one bro.
    Logged

    KingJigglypuff
    Meme Machine
    Moderator
    ****
    Offline Offline

    Posts: 7206


  • Awards RAGE!! >9000 Hyperactive Contributor Heart Container

  • View Profile Awards
    « Reply #7 on: December 16, 2015, 05:27:45 PM »


    Oh. You're trying to add an Action? That's not possible. I thought you were talking about the animations themselves.
    Logged

    I don't take requests.

    My PSA Thread

    Alexarah2014
    Intermediate Kitten
    **
    Offline Offline

    Posts: 10


    View Profile Awards
    « Reply #8 on: December 16, 2015, 05:53:53 PM »


    Earlier I was talking about the animations but I just thought I needed to add more Actions to make a counter but since it's impossible to make new Actions I see I have to just edit the Actions that are below a character's Final Smash Action like Mario's Final Smash Action is 278. I also see that Mario has 2 Actions below his Final Smash. There's 279 and 280 so I assume those are the ones that I have to edit to make the Counter Attack right? I know how to handle the Sub Actions by the way it was the Actions part I was stuck on since I've never looked into those before.
    Logged

    KingJigglypuff
    Meme Machine
    Moderator
    ****
    Offline Offline

    Posts: 7206


  • Awards RAGE!! >9000 Hyperactive Contributor Heart Container

  • View Profile Awards
    « Reply #9 on: December 16, 2015, 06:26:06 PM »


    Actions 279 and 280 are used for Mario's FLUDD. If you're not using FLUDD, then you can straight up replace the Actions.

    If you are, then you're gonna have to set LA-Bits before entering the Action and clearing them after.

    Use this guide to check which variables you can use. http://forums.kc-mm.com/index.php?topic=74266.0

    Example:

    If: Bit is Set: LA-Bit[X]
    *Counter Action Coding*
    Else
    *Normal Action Coding*
    EndIf

    For when to set or clear the Bit, set the Bit on the Sub Action before you enter the next Action, clear the Bit during the Sub Action the associated Bit uses, and also clear the Bit on the non associated Sub Actions that use the same Action after as well.
    Logged

    I don't take requests.

    My PSA Thread

    Pages: [1]
    Print
    Jump to: