• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

The Official How-To Fighter.Pac Injection Thread

shanus

Smash Hero
Joined
Nov 17, 2005
Messages
6,055
Fighter.pac injections follow a simple protocol:

STRATEGY

Say we have an action in fighter.pac, such as taunts. Say we want to make a code for taunt canceling a la 64 where you can cancel the taunt by entering the "teeter" animation at the edge. What I want to do is the following:

-Overwrite a safe location inside of taunt action in fighter.pac with a Go to line.
-This Go to line points to a data parameter in my code whose offset points to the start of my PSA commands to inject.
-At the end of my PSA commands, I write another Go to line which points back to fighter.pac to return to the next command after what I wrote over (or commands later in the same action)

Now for the structure of fighter.pac injections:

HEADER
DATA
COMMANDS
FOOTER

The header describes where in memory you overwrite.

The data section is what the PSA commands refer to in memory.

The commands section is a sequential list, in order, which refer to the data section (IF THEY HAVE parameters).

The footer section is where you overwrite in fighter.pac with a go to line.


SECTION 1. Commands

1. In PSA, write out the code you wish to inject for ALL characters. You need to make sure this code is finalized, as writing these codes requires significant structure control and rewriting it can be a pain and time consuming.

So for taunt canceling, I want to do the following simple code.
Change Action: 7C, req=3A
Or in command language:

02010200 XXXXXXXX where XXXXXXXX will be the data section we point to in memory.

Note the number of parameters this code calls for, 2. If this number is 0, replace the X's with ALL ZEROES.

SECTION 2. DATA

Writing the data is very simple. As I described before, i wanted to write:
Code:
Change Action: 7C, req=3A
So we call the change action, but need the data to tell it 7C, req 3A.

The data format for each parameter is as follows:

Code:
0000000V DATADATA
V is the format the data takes.
0 - Value
1- Scalar
2- Pointer
3- Boolean
4 - ???
5- Variable
6- Requirement

DATADATA is the actual data you wish to write.

So for our code:
Code:
Change Action: 7C, req=3A
The data would be:
Code:
00000000 0000007C
00000006 0000003A
But, let us not forget that we also need to have data for the two "Go to" statements this code uses.

So, we neeed two data sets which are pointers such as:

Code:
00000002 YYYYYYYY
00000002 ZZZZZZZZ
That brings our total data section up to:

Code:
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
So now we need to begin constructing the code.

We have the following:
Code:
---DATA---
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
---Commands---
02010200 XXXXXXXX
To keep progressing, we need to choose an area in memory to write to, and also figure out our injection point.

SECTION 3. FOOTER


Within fighter.pac, viewable through OpenSA2 [download: http://opensa.dantarion.com/wiki/Main_Page]

Step 1: Find the action of interest for your code. A very rough (some of these are wrong) list of action IDs are located here: http://www.smashboards.com/showthread.php?t=239768

Step 2: Find a safe injection point for your code. What happens is that a line in fighter.pac must be replaced with a Go To line. As such, when you are choosing your area to inject, you don't want to overwrite an Else statement and break the flow of l]ogic. It's best to overwrite something simple, especially when you are learning.

Step 3: After you know the line you wish to replace, note its "command offset" in OSA2. This is going to be the point in memory that you wish to overwrite.

Fighter.pac starts at offset: 80F9FC20 in RAM. So to find the true memory location you wish to overwrite, you ADD your command offset to 80F9FC20. A good tool to do this quickly: http://www.csgnetwork.com/hexaddsubcalc.html


So for the case of our code, I choose to inject over the very first line
07020000 of action 10C. This is a nice choice because it has no additional requirements and is not an if statement or else or anything else like that. Its command offset is 23AE0. So, doing the math on it, its true location in memory is: 80F9FC20 + 23AE0 = 80FC3700.

So because we will be replacing that line, 07020000, we need to put it back in our commands within our injection. So our injection code now looks like:
Code:
---DATA---
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
---Commands---
07020000 00000000
02010200 XXXXXXXX
Now we have a bit more work to do. We need to put a Go to command at the end of our commands to instruct to go back to fighter.pac:

Code:
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 XXXXXXXX
00090100 AAAAAAAA
Now, here is an important stepping point. Count how many lines we have here: 7. Each line takes up 8 bytes of memory. So to calculate a byte count, take 7*8, then convert to hex. Our byte count would be 0x38.

Now, I'm going to cheat a little and show you a tip on how to save memory. In a specific portion of fighter.pac, 0xBA6C, I found a line which already has Change Action: 7C, req=3A. I can use the parameters called by that command already, and save two lines of memory! The params as listed in OSA2 are at 0xBA2C, so doing the classic math gets me the following command:
02010200 80FAB64C

So now, our code:

Code:
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA
With a new byte count of: 0x28

SECTION 4. HEADER

So now, lets keep pressing. We need to make the HEADER, and FOOTER. So I happened to know that 9019A500 was free in memory for at least 28 bytes (I'll post free areas in memory later).

So to go to 9019A500, I use the following command:
4A000000 DDDDDDDD
16EEEEEE 000000FF

DDDDDDDD is the initial pointer. You instruct it to point to 90000000.
EEEEEE is what you add to the pointer, in this case 19A500.
FF is the byte count.

So, the result:
Code:
4A000000 90000000
1619A500 00000028
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA
Now we need to add in the footer. Remember that area in memory I told you to remember where the command 07020000 was? 80FC3700.

We remove the first two numbers with a pointer to 80, 06.

The result:
06FC3700 000000FF

Where FF is the byte count of how many lines we are replacing in fighter.pac (in this case, 1, with a Go to command).

The result:
Code:
06FC3700 00000008
00090100 GGGGGGGG
Now, lets add it all together:

Code:
4A000000 90000000
1619A500 00000028
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA
06FC3700 00000008
00090100 GGGGGGGG
So now for the part where good organization pays off. I strongly recommend you this in excel as long codes need good organization.

I did this already, so please observe:
Our first data line sits at 9019A500 which happens to be one of our go to commands parameters.

Code:
		                Taunt Canceling v2.1 [Shanus,Camelot,WindOwl]		
IGNORE00		4A000000 90000000		
IGNORE00		1619A500 00000028		
9019A500		00000002 [COLOR="SeaGreen"]80FC3708[/COLOR]		Area to return
9019A508		[COLOR="Orange"]00000002 9019A510[/COLOR]		Start of code
9019A510		07020000 00000000		Line I overwrote
9019A518		02010200 80FAB64C		Change Act: 7C, req=3A
9019A520		00090100 [COLOR="SeaGreen"]9019A500[/COLOR]		Go to return
IGNORE00		06FC3700 00000008		
IGNORE00		00090100 [COLOR="Orange"]9019A508[/COLOR]		Go to start
So, notice that I populated memory addresses and color coded. My Go to return in fighter.pac is where I overwrote + 8 bytes since I want to return 1 line later than I overwrote. My other go to location points to the parameter which points to the START OF THE COMMANDS.

So to make it clear, here is how this code truly works:

Taunt action is called when you press taunt.

At the beginning, instead of running 07020000, we overwrote it with the orange Go to line. This points to our parameter which says to go to the start of our commands. From there, it runs 07020000 and the change action command when near edge. Then it runs the green Go to command to return back to the line after I replaced in fighter.pac.


So now that we know how long our code will take in memory, we need to find an area which is unoccupied.



Yes, that code works for taunt cancels. However, you'll need codes to allow taunts during dashes and runs to make it behave like 64 smash. You'll need to wait for Project M for those ;-)


Free memory:
93573000 - 935E0000
 

Marth175

Smash Apprentice
Joined
Aug 14, 2009
Messages
144
This is good stuff, this I didnt know about, Ill do a bit of testing and see what I can do with this
 

shanus

Smash Hero
Joined
Nov 17, 2005
Messages
6,055
Note, this isn't just something to throw around. Certain characters it simply doesn't seem to work on: (Ness, Lucas, Yoshi). Others, it seems to ignore once in a while.

This takes -a lot- of work.
 

superyoshi888

Smash Lord
Joined
Apr 8, 2008
Messages
1,026
Hmm. So, basically, you write the code you want to apply to all characters in PSA. Once you've gotten it working properly with your test character(like, I know you guys were coding moon walking on Captain Falcon), you then start to actually write the fighter pac injection.

And the fighter.pac changes can be loaded up by the File Patch code, right?

Of course, I'll need to reread that a few times to grasp what exactly this requires, but it sounds interesting and useful.
 

[TSON]

Hella.
Joined
May 7, 2008
Messages
3,422
Location
Macomb, MI
NNID
oTSONo
No. What you're doing is making codes. You aren't editing fighter.pac because file patch doesn't support it.
 

superyoshi888

Smash Lord
Joined
Apr 8, 2008
Messages
1,026
Well okay then. This is why I stick to making textures and stages most of the time. ;>_>
 

Dantarion

Smash Champion
Joined
May 21, 2007
Messages
2,492
Location
Santa Barbara, CA
Shanus, it does work for all characters. Certain characters have unique things for certain actions, like Ness. Lucas, and Yoshi having a animation-based second jump instead of a physics based one.

This is a technique I invented, and its pretty much too complex for 80% of people that use PSA.
Even if you are good at using PSA, this requires a lot more work then using PSA.
 

shanus

Smash Hero
Joined
Nov 17, 2005
Messages
6,055
Shanus, it does work for all characters. Certain characters have unique things for certain actions, like Ness. Lucas, and Yoshi having a animation-based second jump instead of a physics based one.

This is a technique I invented, and its pretty much too complex for 80% of people that use PSA.
Even if you are good at using PSA, this requires a lot more work then using PSA.
Well, whats weird is that its always the same characters. For example, Ness, Lucas and Yoshi are also immune to the L-canceling code so it needs to be installed manually for them, too. More options to list, but I'm lazy.
 

pokelover980

Smash Ace
Joined
Oct 4, 2007
Messages
905
This is very useful and should not fall to the second page.
Nor should it fall on the third page.

But that's not the reason I bumped this. I need help. I made, or rather, tried to make, a simple code with this method, meant to make a character go into their dash attack after guarding (don't ask why, I just thought it would be a good starter to help me learn this method). Sadly, I did something wrong somewhere, and the character remains in their guard stance, except without a shield, until they are hit. This is the code:
4A000000 93000000
165E0000 00000038
00000000 00000026
00000006 00000001
00000002 80F9FC20
00000002 93598038
0D000200 00000000
02010200 80FB10AC
00090100 93598028
06FB1064 00000008
00090100 93598030

I don't really have an idea where I went wrong, but it's very obvious I did something wrong if it doesn't work. Any help on what I need to do to fix it?

EDIT: And yes, I did test this on a character and thought this out before I made it. I tested on Captain Falcon and it worked perfectly (almost perfectly, at least, he teleported backwards afterward but it didn't bother me).
 

shanus

Smash Hero
Joined
Nov 17, 2005
Messages
6,055
I dont have much time to look through it, but it looks like your memory addresses for your variables are wrong.

Your first two lines defined your memory location as 935E0000 yet you point to 93598038. Your first data line with your current header would be 935E0000

Additionally, why do you have 0D000200 with no parameters?
 

pokelover980

Smash Ace
Joined
Oct 4, 2007
Messages
905
I dont have much time to look through it, but it looks like your memory addresses for your variables are wrong.

Your first two lines defined your memory location as 935E0000 yet you point to 93598038. Your first data line with your current header would be 935E0000

Additionally, why do you have 0D000200 with no parameters?
Ah, I knew I had something in the locations mixed up! I just didn't know if I was right about it, so I was without a clue after that.

And I'm not sure about the 0D000200, I'll look back in my notes and see what I did to make it get there without parameters. I'll rebuild the code later and see what happens, and see what I did if I can't find it in my notes.
 

NAMQ_DrunkeNFeasT

Smash Journeyman
Joined
Dec 28, 2007
Messages
429
Location
Puerto Rico
[collapse=Fighter.pac injections follow a simple protocol:]

STRATEGY

Say we have an action in fighter.pac, such as taunts. Say we want to make a code for taunt canceling a la 64 where you can cancel the taunt by entering the "teeter" animation at the edge. What I want to do is the following:

-Overwrite a safe location inside of taunt action in fighter.pac with a Go to line.
-This Go to line points to a data parameter in my code whose offset points to the start of my PSA commands to inject.
-At the end of my PSA commands, I write another Go to line which points back to fighter.pac to return to the next command after what I wrote over (or commands later in the same action)

Now for the structure of fighter.pac injections:

HEADER
DATA
COMMANDS
FOOTER

The header describes where in memory you overwrite.

The data section is what the PSA commands refer to in memory.

The commands section is a sequential list, in order, which refer to the data section (IF THEY HAVE parameters).

The footer section is where you overwrite in fighter.pac with a go to line.


SECTION 1. Commands

1. In PSA, write out the code you wish to inject for ALL characters. You need to make sure this code is finalized, as writing these codes requires significant structure control and rewriting it can be a pain and time consuming.

So for taunt canceling, I want to do the following simple code.
Change Action: 7C, req=3A
Or in command language:

02010200 XXXXXXXX where XXXXXXXX will be the data section we point to in memory.

Note the number of parameters this code calls for, 2. If this number is 0, replace the X's with ALL ZEROES.

SECTION 2. DATA

Writing the data is very simple. As I described before, i wanted to write:
Code:
Change Action: 7C, req=3A
So we call the change action, but need the data to tell it 7C, req 3A.

The data format for each parameter is as follows:

Code:
0000000V DATADATA
V is the format the data takes.
0 - Value
1- Scalar
2- Pointer
3- Boolean
4 - ???
5- Variable
6- Requirement

DATADATA is the actual data you wish to write.

So for our code:
Code:
Change Action: 7C, req=3A
The data would be:
Code:
00000000 0000007C
00000006 0000003A
But, let us not forget that we also need to have data for the two "Go to" statements this code uses.

So, we neeed two data sets which are pointers such as:

Code:
00000002 YYYYYYYY
00000002 ZZZZZZZZ
That brings our total data section up to:

Code:
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
So now we need to begin constructing the code.

We have the following:
Code:
---DATA---
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
---Commands---
02010200 XXXXXXXX
To keep progressing, we need to choose an area in memory to write to, and also figure out our injection point.

SECTION 3. FOOTER


Within fighter.pac, viewable through OpenSA2 [download: http://opensa.dantarion.com/wiki/Main_Page]

Step 1: Find the action of interest for your code. A very rough (some of these are wrong) list of action IDs are located here: http://www.smashboards.com/showthread.php?t=239768

Step 2: Find a safe injection point for your code. What happens is that a line in fighter.pac must be replaced with a Go To line. As such, when you are choosing your area to inject, you don't want to overwrite an Else statement and break the flow of l]ogic. It's best to overwrite something simple, especially when you are learning.

Step 3: After you know the line you wish to replace, note its "command offset" in OSA2. This is going to be the point in memory that you wish to overwrite.

Fighter.pac starts at offset: 80F9FC20 in RAM. So to find the true memory location you wish to overwrite, you ADD your command offset to 80F9FC20. A good tool to do this quickly: http://www.csgnetwork.com/hexaddsubcalc.html


So for the case of our code, I choose to inject over the very first line
07020000 of action 10C. This is a nice choice because it has no additional requirements and is not an if statement or else or anything else like that. Its command offset is 23AE0. So, doing the math on it, its true location in memory is: 80F9FC20 + 23AE0 = 80FC3700.

So because we will be replacing that line, 07020000, we need to put it back in our commands within our injection. So our injection code now looks like:
Code:
---DATA---
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
---Commands---
07020000 00000000
02010200 XXXXXXXX
[/collapse]
Now we have a bit more work to do. We need to put a Go to command at the end of our commands to instruct to go back to fighter.pac:

Code:
00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 XXXXXXXX
00090100 AAAAAAAA
Now, here is an important stepping point. Count how many lines we have here: 7. Each line takes up 8 bytes of memory. So to calculate a byte count, take 7*8, then convert to hex. Our byte count would be 0x38.

Now, I'm going to cheat a little and show you a tip on how to save memory. In a specific portion of fighter.pac, 0xBA6C, I found a line which already has Change Action: 7C, req=3A. I can use the parameters called by that command already, and save two lines of memory! The params as listed in OSA2 are at 0xBA2C, so doing the classic math gets me the following command:
02010200 80FAB64C

So now, our code:

Code:
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA
With a new byte count of: 0x28


[collapse=SECTION 4. HEADER]

So now, lets keep pressing. We need to make the HEADER, and FOOTER. So I happened to know that 9019A500 was free in memory for at least 28 bytes (I'll post free areas in memory later).

So to go to 9019A500, I use the following command:
4A000000 DDDDDDDD
16EEEEEE 000000FF

DDDDDDDD is the initial pointer. You instruct it to point to 90000000.
EEEEEE is what you add to the pointer, in this case 19A500.
FF is the byte count.

So, the result:
Code:
4A000000 90000000
1619A500 00000028
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA
Now we need to add in the footer. Remember that area in memory I told you to remember where the command 07020000 was? 80FC3700.

We remove the first two numbers with a pointer to 80, 06.

The result:
06FC3700 000000FF

Where FF is the byte count of how many lines we are replacing in fighter.pac (in this case, 1, with a Go to command).

The result:
Code:
06FC3700 00000008
00090100 GGGGGGGG
Now, lets add it all together:

Code:
4A000000 90000000
1619A500 00000028
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA
06FC3700 00000008
00090100 GGGGGGGG
So now for the part where good organization pays off. I strongly recommend you this in excel as long codes need good organization.

I did this already, so please observe:
Our first data line sits at 9019A500 which happens to be one of our go to commands parameters.

Code:
		                Taunt Canceling v2.1 [Shanus,Camelot,WindOwl]		
IGNORE00		4A000000 90000000		
IGNORE00		1619A500 00000028		
9019A500		00000002 [COLOR="SeaGreen"]80FC3708[/COLOR]		Area to return
9019A508		[COLOR="Orange"]00000002 9019A510[/COLOR]		Start of code
9019A510		07020000 00000000		Line I overwrote
9019A518		02010200 80FAB64C		Change Act: 7C, req=3A
9019A520		00090100 [COLOR="SeaGreen"]9019A500[/COLOR]		Go to return
IGNORE00		06FC3700 00000008		
IGNORE00		00090100 [COLOR="Orange"]9019A508[/COLOR]		Go to start
So, notice that I populated memory addresses and color coded. My Go to return in fighter.pac is where I overwrote + 8 bytes since I want to return 1 line later than I overwrote. My other go to location points to the parameter which points to the START OF THE COMMANDS.

So to make it clear, here is how this code truly works:

Taunt action is called when you press taunt.

At the beginning, instead of running 07020000, we overwrote it with the orange Go to line. This points to our parameter which says to go to the start of our commands. From there, it runs 07020000 and the change action command when near edge. Then it runs the green Go to command to return back to the line after I replaced in fighter.pac.


So now that we know how long our code will take in memory, we need to find an area which is unoccupied.



Yes, that code works for taunt cancels. However, you'll need codes to allow taunts during dashes and runs to make it behave like 64 smash. You'll need to wait for Project M for those ;-)


Free memory:
93573000 - 935E0000[/collapse]
How can I skip the step in red, idk how to use that method of saving lines, and I think it should matter to save lines, as, with have more than 8,000 lines of code for ourselves

plz shanus, help me with this one :(

00000000 0000007C
00000006 0000003A

this was on the code, but after that step, it was gone, and that was the data for the code to go to the change action to teether animation

the code was like this:

00000000 0000007C
00000006 0000003A
00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 XXXXXXXX
00090100 AAAAAAAA

after the step it went to be like this:

00000002 YYYYYYYY
00000002 ZZZZZZZZ
07020000 00000000
02010200 80FAB64C
00090100 AAAAAAAA

EDIT:

you said we needed to count the lines and do (#of lines)*8 but, idk what can I do if I skip that step on decreasing the lines

I hope you can understand this, I want to implement something, but I need to understand on how to skip this step if in fighter.pac what I want is not in memory

and another thing, that example is great shanus, and you also labeled the code in the final part of the post, which is awsome :)

But what if, I don't have a change action only? how would I add more, like, an IF: command, along with a change action and an Else IF?

here is what I want to make:

Cancelable Smash Charge with Shield and Opposide direction than the one facing

Code:
IF: Button is Pressed: 0
[LIST]
[*]Change Action: 20 = Requierement IF Button Press 3
[*]Additional Requierement: Compare: IC-Basic[243] >= IC-Basic[77][/LIST]
End if:
How would I code that? if you can help me man, I can atleast start making my own codes for public

EDIT 2:

the code will be something like

IF: stuff
---DATA---
00000006 00000030
00000000 00000000
---Command---
000A0200 XXXXXXXX
Change action stuff
---DATA---
00000000 00000020
00000006 00000030
00000000 00000003
---Commands---
02010300 XXXXXXXX
Additional Requierement stuff
----DATA----
00000006 00000007
00000005 (no idea here, as it needs to be memory type "Internal Constant". Type "Basic". Variable # " 1011")
00000000 00000004
00000005 (Same as the second line, only that the Variable # is now "3149")
---Commands---
02040400 XXXXXXXX
End If:
---DATA---
00000000 00000000
---Commands---
000F0000 XXXXXXXX
 

standardtoaster

Tubacabra
Joined
Nov 26, 2009
Messages
9,253
Location
Eau Claire, Wisconsin
NAMQ, here is an example of the smash charge cancel thing you wanted to do. In this one, I only overrode the first line of AttackS4SHold. Because you want this to affect all smash charges, you would just do the 06 command again to overwrite the first line of AttackHi4Hold and AttackLw4Hold with a subroutine like in the code below. I hope this helps.

Code:
		4A000000 90000000	Sets area to write things to 90000000			
		1619A500 00000058	Write at 9019A500			
9019A500	00000006 00000032	If button pressed A			
9019A508	00000000 00000000	If button pressed A			
9019A510	00000000 00000020	Change action: ID = 0x20, req = button press			
9019A518	00000006 00000030	Change action: ID = 0x20, req = button press			
9019A520	00000002 9019A528	Pointer to start of code			
9019A528	02010200 80FB2A9C	Change action: ID = 0xE, req = in air		Used parameters from the line we will be replacing (80F9FC20 + 12E7C = 80FB2A9C)	
9019A530	000A0200 9019A500	If button pressed A @9019A500 are its parameters			
9019A538	02010200 9019A510	Change action: ID = 0x20, req = button press @9019A510 are its parameters			
9019A540	02040200 80FB0894	Additional req: IC-Basic[1012] >= IC-Basic[3149]			Used parameters from backward shield rolling
9019A548	000F0000 00000000	End if			
9019A550	00080000 00000000	Return			
		06FC2540 00000008	Overwrite original Change action: ID = 0xE, req = in air with subroutine			
		00070100 9019A520	Subroutine pointing to the pointer to start of code
 

NoAh MenQui

Smash Apprentice
Joined
Feb 5, 2011
Messages
107
Teching Grab and Teching Throws (5 Frame Window)

[COLLAPSE="My Older post"]
That code in there, is for Grab tech / Throw tech, like you do in Street Fighter 4 / MvC3

How does that work?
Code:
- You have a  5 frame window to grab tech and/or throw tech
- Input joystickback + Shield To tech the grab pull animation and prevent your opponent from throwing you.
---> Note that opponent can buffer the throw and making the throw window 1 frame for you.
- If Opponent Buffered the throw and you couldn't Grab tech it:
---> Joystickbackwards + Shield and then Jump. If done right, you should Jump of of the thrownb/f/u/d animations.
Such a code would bring great results for Vbrawl bringing great balance for alot of the cast.

I made this for fighter.pac injection, but I don't know how to skip the step of decreasing code lines, so, I shared this with you all to see if someone can make this code happen.


I'm atm porting it to every character.pac for a mod I'm working on. Well, c ya all later.[/COLLAPSE]

Thank you StandardToaster :)

now I'll be doing this, with your example I might aswell do it without the need of the step that confused me :)


TY very much :D


Now to make this a code :)

[COLLAPSE="If: On ground"]
Code:
---DATA---
00000006 00000003

---Commands---
000A0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If: Commparison Compare: IC-Basic[243] < IC-Basic [77]"]
Code:
---DATA---
00000006 00000007
00000005 000003F3
00000000 00000000
00000005 00000C4D

---Command---
000A0400 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Set Loop 5 times"]
Code:
---DATA---
00000000 00000005

---Command---
00040100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If button Press: 3 (Shield)"]
Code:
---DATA---
00000006 00000030
00000000 00000003

---Command---
000A0200 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Allow Specific interrupt (RollBack)"]
Code:
---DATA---
00000000 00000005

---Command---
020A0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Synchronous Timer 1"]
Code:
---DATA---
00000001 0000EA60

---Command---
00010100 00000000
[/COLLAPSE]

[COLLAPSE="Execute Loop"]
Code:
---Command---
00050000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If: Commparison Compare: IC-Basic[244] < IC-Basic [77]"]
---DATA---
00000006 00000007
00000005 000003F4
00000000 00000000
00000005 00000C4D

---Command---
000A0400 xxxxxxxx[/COLLAPSE]

[COLLAPSE="Set Loop 5 times"]
Code:
---DATA---
00000000 00000005

---Command---
00040100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If button Press: 3 (Shield)"]
Code:
---DATA---
00000006 00000030
00000000 00000003

---Command---
000A0200 xxxxxxxx
[/COLLAPSE]


[COLLAPSE="Change Action: *Rollback* Req. Commparison Compare: IC-Basic[244] < IC-Basic [77] *Holding forward*"]
---DATA---
00000006 00000007
00000005 000003F4
00000000 00000000
00000005 00000C4D

---Command---
02010500 xxxxxxxx[/COLLAPSE]

[COLLAPSE="Allow Specific interrupt (RollBack)"]
Code:
---DATA---
00000000 00000005

---Command---
020A0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Synchronous Timer 1"]
Code:
---DATA---
00000001 0000EA60

---Command---
00010100 00000000
[/COLLAPSE]

[COLLAPSE="Execute Loop"]
Code:
---Command---
00050000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]


[COLLAPSE="Else:"]
Code:
---Command---
000E0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If: in Air"]
Code:
---DATA---
00000006 00000004

---Command---
000A0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If: Commparison Compare: IC-Basic[243] < IC-Basic [77]"]
Code:
---DATA---
00000006 00000007
00000005 000003F3
00000000 00000000
00000005 00000C4D

---Command---
000A0400 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Set Loop 5 times"]
Code:
---DATA---
00000000 00000005

---Command---
00040100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If button Press: 3 (Shield)"]
Code:
---DATA---
00000006 00000030
00000000 00000003

---Command---
000A0200 xxxxxxxx
[/COLLAPSE]


[COLLAPSE="Change Action: *Air Jump/Second Jump* Req: Jump button input"]
---DATA---
00000000 0000000C
00000006 00000030
00000000 00000002

---Command---
02010300 xxxxxxxx[/COLLAPSE]

[COLLAPSE="Allow Specific interrupt (Air Jump)"]
Code:
---DATA---
00000000 00000012

---Command---
020A0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If: Commparison Compare: IC-Basic[244] < IC-Basic [77]"]
---DATA---
00000006 00000007
00000005 000003F4
00000000 00000000
00000005 00000C4D

---Command---
000A0400 xxxxxxxx[/COLLAPSE]

[COLLAPSE="Set Loop 5 times"]
Code:
---DATA---
00000000 00000005

---Command---
00040100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="If button Press: 3 (Shield)"]
Code:
---DATA---
00000006 00000030
00000000 00000003

---Command---
000A0200 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Change Action: *Air Jump/Second Jump* Req: Jump button input"]
---DATA---
00000000 0000000C
00000006 00000030
00000000 00000002

---Command---
02010300 xxxxxxxx[/COLLAPSE]

[COLLAPSE="Allow Specific interrupt (Air Jump)"]
Code:
---DATA---
00000000 00000012

---Command---
020A0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Synchronous Timer 1"]
Code:
---DATA---
00000001 0000EA60

---Command---
00010100 00000000
[/COLLAPSE]

[COLLAPSE="Execute Loop"]
Code:
---Command---
00050000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="End If:"]
Code:
---Command---
000F0000 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Synchronous Timer 1"]
Code:
---DATA---
00000001 0000EA60

---Command---
00010100 00000000
[/COLLAPSE]

[COLLAPSE="Dissallow Specific Interrupt (Air jump)"]
Code:
---DATA---
00000000 00000012

---Command---
020B0100 xxxxxxxx
[/COLLAPSE]

[COLLAPSE="Return:"]
Code:
---Command---
00080000 xxxxxxxx
[/COLLAPSE]

EDIT:

Up-to-date PSA stuff for the code:



Uploaded with ImageShack.us
 

Foxfan12

Smash Rookie
Joined
Feb 18, 2013
Messages
18
So I'm trying to understand exactly what's going on here. So from what I've gathered, the run order seems to be header (allocate space in memory for code, then how many lines of code there are), footer (specify which line we want our code to go "over", how many bytes we overwrite, then a goto line), line footer goto points at, then sequential ordering, go to return - return runs and tells us where in memory to pick back up again.

But there are a few things I don't get. Why are 4A000000 and 16000000 in the Header? What do they do?
Secondly why replace our 80 with 06 in the first instruction at the header? I mean I got the codes to work, but I don't understand why certain things work the way they do.
 
Top Bottom