Achilles1515
Smash Master
Dual 1v1 Mode (1.02) [Zauron, Achilles]
------> Video of code <--------
From Zauron:
Dual 1v1 Mode:
In my normal Smash group of 4 players, we have limited time and no one wants to wait out matches, yet we prefer 1v1-style fights. This code allows this by letting all 4 players play at once, but each "set" of 1v1 players can't directly interfere with the other fight (beyond things like messing with the camera or edge hogging). Once each pair has a winner, the two winners can battle it out for the overall winner of the match!
The only downside is that you can no longer play team matches with Friendly Fire turned off - but no one worth their salt plays Teams without Friendly Fire turned on anyway. Also, a side effect is that most stage hazards will no longer affect players - there is information in the hacking section below on how to fix this if you really want stage hazards to still work.
To use:
For the currently released version of 20XX (v3.02), I was using this "ported" version, but a few of those lines are just straight up wrong. That is why projectiles still hit all players in FFA mode after setting teams in 20XX 3.02.
A few weeks ago I re-ported the Dual 1v1 code to 1.02 myself, by running both versions of the game at once and analyzing the ASM side-by-side. So I fixed all the bugs with the code, and just needed to add a couple ASM injects to finish it.
[COLLAPSE="ASM Notes"]
[/COLLAPSE]
Code:
04078AA4 60000000
04078d10 60000000
042707A8 60000000
042707c0 60000000
042707cc 60000000
040792EC 60000000
040792CC 88780020
040792D0 2C0300FF
00078AC0 00000040
00078D50 00000040
000792FC 00000040
002707DC 00000040
C216C094 00000004
7C1FE850 2C000003
40800010 38000001
3DC08047 980EDB69
381DFFFF 00000000
C216E5B4 00000005
3DE08046 8A0FBF19
2C100000 40820010
61EFDB69 9A0F0000
9A0F0007 38210060
60000000 00000000
From Zauron:
Dual 1v1 Mode:
In my normal Smash group of 4 players, we have limited time and no one wants to wait out matches, yet we prefer 1v1-style fights. This code allows this by letting all 4 players play at once, but each "set" of 1v1 players can't directly interfere with the other fight (beyond things like messing with the camera or edge hogging). Once each pair has a winner, the two winners can battle it out for the overall winner of the match!
The only downside is that you can no longer play team matches with Friendly Fire turned off - but no one worth their salt plays Teams without Friendly Fire turned on anyway. Also, a side effect is that most stage hazards will no longer affect players - there is information in the hacking section below on how to fix this if you really want stage hazards to still work.
To use:
- Turn Friendly Fire to OFF.
- Switch to Team mode and set the team colors so that each set of players that should fight each other are the same color. Players will only be able to hurt other players set to the same team color.
- (Optional) Switch Team mode back off so players can switch to whatever costume they want.
- Start the match
- When the match is over, re-shuffle team colors as desired.
For the currently released version of 20XX (v3.02), I was using this "ported" version, but a few of those lines are just straight up wrong. That is why projectiles still hit all players in FFA mode after setting teams in 20XX 3.02.
A few weeks ago I re-ported the Dual 1v1 code to 1.02 myself, by running both versions of the game at once and analyzing the ASM side-by-side. So I fixed all the bugs with the code, and just needed to add a couple ASM injects to finish it.
[COLLAPSE="ASM Notes"]
Code:
Dual 1v1 SSBM v1.02
- Original code by Zauron, port by Achilles
#Make sure FF (Friendly Fire) is checked for grabs even with Team mode off
04078AA4 60000000
#Make sure FF is checked for melee attacks even with Team mode off
04078d10 60000000
#Make sure FF is checked for projectile vs projectile even with Team mode off
042707A8 60000000
#Make sure team id's are compared for self-damaging projectiles (Link's bombs)
042707c0 60000000
042707cc 60000000
040792EC 60000000
#Check Team of Projectile attacks
040792CC 88780020
#Compare Projectile team to "Neutral"
040792D0 2C0300FF
#Skip attacks from "Neutral" team (leave out this line to make "Neutral" attacks like stage hazards work!)
040792D4 418207B4
#Swap FF logic for grabs (ONLY grab teammates)
00078AC0 00000040
#Swap FF logic for melee attacks (ONLY attack teammates)
00078D50 00000040
#Swap FF logic for projectiles (ONLY hit teammates)
000792FC 00000040
#Swap FF logic for projectile vs projectile attacks (ONLY hit teammate's projectiles)
002707DC 00000040
-------------------------
INGAME: IF NUMBER OF PLAYERS LEFT = 2, SWITCH FF ON
Injection Code @ 8016c094
- r28 looks to always be 8046b0fc at this point
sub r0,r29,r31 # subtract number of dead players from total number of players
cmpwi r0,3 # if 3 or more alive, ignore custom code
bge- DEFAULT
li r0,1
lis r14,0x8047
stb r0,-0x2497(r14) # turn ingame FF to on at 8046db69
DEFAULT:
subi r0,r29,1 #default line
--------------------------
MATCH START: IF FF IS OFF IN MENU, TURN FF AND TEAMS OFF
Inject @ 8016e5b4 - addi sp,sp,96
lis r15,0x8046
lbz r16,-0x40E7(r15) #load menu FF flag
cmpwi r16,0 #is FF off?
bne- END
ori r15,r15,0xdb69
stb r16,0(r15) #turn ingame FF off
stb r16,0x7(r15) #turn Teams off
END:
addi sp,sp,96 #default code line
----------------
FINAL CODE (disregarding the line about neutral attacks):
04078AA4 60000000
04078d10 60000000
042707A8 60000000
042707c0 60000000
042707cc 60000000
040792EC 60000000
040792CC 88780020
040792D0 2C0300FF
00078AC0 00000040
00078D50 00000040
000792FC 00000040
002707DC 00000040
C216C094 00000004
7C1FE850 2C000003
40800010 38000001
3DC08047 980EDB69
381DFFFF 00000000
C216E5B4 00000005
3DE08046 8A0FBF19
2C100000 40820010
61EFDB69 9A0F0000
9A0F0007 38210060
60000000 00000000
Last edited: