Home Gallery Resources The Team Rules chat Login Register
Pages: [1]
Author Topic: Extra details on Mawootad's codes from Brawl Minus  (Read 157 times)
0 Members and 1 Guest are viewing this topic.
Smash Boy
Newbie Kitten
*
Offline Offline

Posts: 3


View Profile Awards
« on: July 26, 2017, 07:50:45 PM »


For references, read this post by KingJigglyPuff regarding on the topic: http://forums.kc-mm.com/index.php?topic=75336.0

What I'll do here is elaborate on extra details that was not clarified nor pointed out in the above thread. I personally DM'ed Mawootad for numerous insights and the information below is a collection of knowledge during our discussion regarding his codes. I also talked to KingJigglyPuff himself regarding some of the codes so I'll include his insights as well.

Independent Subroutines

So as per the thread above, these are just subroutines that are not affected by any action changes. The following line of coding should always be placed in Wait1 (doesn't matter which tab, but usually Mains and Other are ideal):

Code:
If Thread is Null: *Thread ID in Hex*
            Set Thread Type: (Thread ID in Hex): *Thread Type in Hex[usually 10]*
            Independent Subroutine: (*Thread ID in Hex*): @*subroutine's offset*
         End If:
Now then, from here on, you can do practically whatever you want with the subroutine so long as codings in that subroutine are in the same thread. Disclaimer: Using two or more independent subroutines won't work unless they are in totally different places. Even so, the safest code above should always stay in Wait1 and if you want two codes to work in an independent subroutine it's wise to use the same subroutine with the same thread (And I'll get into that in a moment).

Now for the format of the independent subroutine itself. Usually, for regular subroutines, you had to insert a Set Loop X iterations and the rest of your personal coding for stuff like graphic effects or hitboxes, that's not necessary with independent subroutines. All you need is a Synchronous Timer and a Goto command at the end of the coding, since the independent subroutine does the looping for you.

Let's say, you want to give Zero Suit Samus a buff move when she down taunts. That and have it run for a limited time, well in her down taunt, you would set this code (in any frame):

Code:
If Compare: LA-Float[70]<=0
            Float Variable Set: LA-Float[70]= X frames (scalar)
         End If:
What this code is saying is literally, set the timer if the Float is lesser or equal o zero. If she downtaunts, the timer will be set and start counting. Now, for the buffs, you simply pick any subaction with a collision data and modified with comparison statements:

Code:
If Compare: LA-Float[70]>0
           *modified collisions*
         Else:
            *default collisions
         End If:
You can even do this with graphic effects and sound effects.

In the subroutine, you can set this standard coding:

Code:
If Compare: LA-Float[70]>0
           Float Variable Subtract: LA-Float[70] -1
         Else:
           Float Variable Set: LA-Float[70]=0
         End If:
         Synchronous Timer: frames=1
         Goto 0x*your subroutine's offset*

This is the coding for the countdown of the timer after she down taunted.

Or, if you want to differentiate between default and buffed ZSS easily, simply add an External Graphic Effect from the common GFX file in the subroutine and with your desired number of frames. You'll need to set the anchor to False if you want the GFX to last throughout the timer. I'll use six frames per second as an example:

Code:
If Compare: LA-Float[70]>0
           Float Variable Subtract: LA-Float[70] -1
           External Graphic Effect: (...) anchored=false
           Synchronous Timer: frames=1
           Float Variable Subtract: LA-Float[70] -1
           External Graphic Effect: (...) anchored=false
           Synchronous Timer: frames=1
           Float Variable Subtract: LA-Float[70] -1
           External Graphic Effect: (...) anchored=false
           Synchronous Timer: frames=1
           Float Variable Subtract: LA-Float[70] -1
           External Graphic Effect: (...) anchored=false
           Synchronous Timer: frames=1
           Float Variable Subtract: LA-Float[70] -1
           External Graphic Effect: (...) anchored=false
           Synchronous Timer: frames=1
           Float Variable Subtract: LA-Float[70] -1
           External Graphic Effect: (...) anchored=false
           Synchronous Timer: frames=1
         Else:
           Float Variable Set: LA-Float[70]=0
         End If:
         Synchronous Timer: frames=1
         Goto 0x*your subroutine's offset*

What this does is, as the buff is set, and the timer runs, the graphic effect lingers for six frames. The number of frames you want the graphic to run should be equal to the total amount of Float Variable subtractions. As the timer needs to countdown per each frame the graphic lingers.

One last thing, set this line of coding in your character's wait1 in the Main tab:

Code:
Set Loop Infinite
           If Compare: IC-Basic [20001]==190
             Float Variable Set: LA-Float[70]=0
           End If:
           Synchronous Timer: frames=1
          Execute Loop
What this does is to check if your character has respawned, if so, the timer is set to 0 and the buff is cancelled. This coding is very important because it prevents the character from being in the buff even after death.

So that's basically pretty much it for independent subroutines in itself.

Limited Specials

Here comes the meat. According to the thread regarding these codes, the 2718XXYY is in binary format DDUUSSNN, D for down specials, U for up specials and you get the idea. Mawootad gave me a simple method to translate that to the hex format, basically, this is the mathematical formula:

4 x (4 x (4 x down specials+up specials)+side specials)+neutral specials

However, I myself realized this gives ambiguous results if you want to give, for example either 2 side specials or 2 down specials alone, instead, you can use this method (which is exactly how it was done for hitbox flags):
Code:
Enter [b]2718[/b] in your calculator as Hex. Then convert to binary. Copy that format. Press [i]CE[/i] to reset to 0. Then in binary format, paste the binary you copied previously, and with the format DDUUSSNN in mind,
 start typing either these numbers:
[b]00=0
    01=1
    10= 2
    11=3[/b]
Because the code was made to allow only a maximum of 3 specials, 3 in binary is as far as you'd go. After that,
 convert the resultant binary to hex and that should be your desired 2718XXYY you'll write in LA-Basic[71].

Now for ways to use this code:

Just the limits

If you only want purely the Limitations, simply add
Code:
Basic Variable Set: LA-Basic[71]=2718XXYY
in Wait1 of your character. That's it.

Cooldowns

This was the part I had to deal a lot with Mawootad. I personally did not have successful results with the example he provided in the linked thread, however, he did guide me to another way, a few ones actually that we discussed together, so I'll share the formats below *I'll use [70 as an example]:

Code:
In your specials set
         If Not On Ground
           Float Variable Set: LA-Float[70]= X frames (scalar)
         End If:

Then in the independent subroutine:
         If Compare: LA-Float[70]<=0
           Basic Variable Set: LA-Basic[71]=2718XXYY
         Else If Compare: LA-Float[70]>0
           Float Variable Subtract: LA-Float[70] -1
         End If:
         Synchronous Timer: frames=1
         Goto 0x*your subroutine's offset*
What this code means in-game is, if your character is not on the ground, the timer is set. If that same character not on the ground, performs the specials, the limits are set and so the variable will start counting how many you have used. When the currently available reaches 0 or you have used all your limits, the timer starts counting since the last usage. Once the timer reaches 0, the limits are set back. It's important to always keep the comparison checking if the float is lesser or equal to 0 because that's when the Basic variable sets the limitations as long as you are not on the ground. If the comparison checks otherwise for greater than zero, what will basically happen is, you start doing the specials, and the limits are disabled. And you don't want that for the code.

NOTE: Usually, you'd set XX=YY, but that depends how fast the character's special behaves or how it's coded in the Actions. Though XX and YY are usually the same because you'd want the max number to equal the currently available, but thing is, the code reads as soon as you perform the special to begin with, so that's one down already, so in practice, you'd set YY<XX by one unit. If you only want specials limited to one use only, XX and YY should be the same, and the variable counts those uses down.

In Water resets

Mawootad filled me in on the case if the character lands in water and in swimming action, this case is coded inside the subroutine the following manner:

Code:
If Is in Water
           Float Variable Set: LA-Float[70]=0
         End If:
What this code checks is if your character is swimming, the limits are refreshed and the timer is set to zero. Alternatively, you can have the character run out of limits with this:

Code:
If Is in Water
           Basic Variable Set: LA-Basic[71]=2718XX00
         End If:
What this does is, if your character is swimming, it won't have any more specials to perform unless he/she grabs a ledge or lands on ground.

Hitstun

Mawootad also filled me in on this and you use a comparison statement to check if LA-Basic[56]>0, then set the Basic Variable. If you want to refresh when damaged, set it to 2718XXYY, if you don't, then 2718XX00 works or simply set the Basic Variable[71]=0 (value).

All cases

You simply combine all the commands. The case of in water and hitstun should be separate and above the cooldown coding.

And that's it for limited specials.

On-The-Fly-Attributes

This was personally my hardest code to deal with Mawootad, but after discussions, basically, the code uses variables from 3000-3116; and you count the Attributes down excluding the asterisked ones in the Attribute table of your character's PSA. Starting from 0. So, say, you want to change your character's Ground Friction, you use IC-Basic [3] (it can be any variable, but IC Basic is the default and easiest to use here). Now, discussing with Mawootad, the guy advises to stick with the Attribute Range Set command over the others. Reason is, as I tested, was that if the characters' attributes are modified with arithmetic factors (add, subtract, multiply, divide), it will be risky and might cause the character to either glitch the screen graphically or freeze the game. So automatically setting the value with the Attribute Range Set is the safest route to take. Another reason is the Attribute Range Divide. Depending on the attribute and what value it has, dividing it's risky and especially if you multiply by, say, 3 and then in another frame, divide by same said number. So again, it is recommended you stick with command 12200200 (Attribute Range Set) if your attribute values are sufficiently greater than the default ones. If you want to use the others, I would recommend to use very small numbers, and in the Attribute Range Divide's case; greater numbers. These variables can be set anywhere, you can even set it in ZSS's up taunt, and everytime she up taunts, her attributes changes until she is KO'ed or dies.

NOTE: If you want to do timers with Independent Subroutines in conjunction with the On The Fly Attributes, apparently it won't work since the code was made to automatically reset upon death. I haven't personally figured out how to get it working around that still. When I do and discuss it with Mawootad I'll update the thread with some examples how.



And that's pretty much all there is to share about Mawootad's codes. Codes are in the linked thread above along with some initial insights by Mawootad and KJP. Any questions or doubts, feel free to message Mawootad himself or KJP.


~Credits:
  KingJigglyPuff (for the insight on the independent subroutines, and the coding to check if character has respawned as well as graphic effect PSA coding)

  Mawootad (for his amazing codes and for insight on the limited specials and the On The Fly Attributes and guiding me on the information gathered to make this thread possible)

*This thread will be updated if any errors need correction or additional information is in need to be implemented to this thread provided by either KJP or Mawootad himself.
Logged

Pages: [1]
Print
Jump to: