|
|
« 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. 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. 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. 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. 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. 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 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
|