• 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!

Completed Disable Container Spawn

Ohsm

Smash Apprentice
Joined
Jul 26, 2011
Messages
175
Location
Germany
Hello everyone,

I recently rediscovered the fun you can have with items in this game but the thing that annoys me a bit is that you can't disable the container spawn.

Does someone have a code at hand that disables all the cargos including capsules?

I know item codes are rather uncommon here but maybe someone can point me in the right direction.
 
Last edited:

V_D_X

Smash Cadet
Joined
May 16, 2015
Messages
29
Hello everyone,

I recently rediscovered the fun you can have with items in this game but the thing that annoys me a bit is that you can't disable the container spawn.

Does someone have a code at hand that disables all the cargos including capsules?

I know item codes are rather uncommon here but maybe someone can point me in the right direction.
These are options in the 20XX hack pack, so there's definitely a code for them floating around somewhere. I'll do some looking around now and see if I find anything.
 

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
Dunno about any existing codes, but I was curious about the way the entity was spawned and took a gander. Found some cool stuff, like some tables that get passed for in-container item spawns and normal stage item spawns. The two are essentially the same, except that the in-container spawns seems to cut out all containers from the spawn pool.

Since they’re both static addresses (804A0E34 = stage spawns, 804A0E50 = in-container spawns) you can conditionally swap them at the beginning of the chooseRandomItem function and expect containers to be eliminated from the spawn pool.

Only briefly tested, so let me know if there are any issues:

$Disable Container Spawns [Punkline]
C226C784 00000003
609C0E34 7C03E040
40820008 60830E50
7C7C1B78 00000000


Code:
    -==-


Disable Container Spawns
Prevents capsules, boxes, barrels, and eggs from spawning randomly.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x8026C784 --- 7C7C1B78 -> Branch

609C0E34 7C03E040
40820008 60830E50
7C7C1B78 00000000
Code:
#$Disable Container Spawns [Punkline]
#@ 8026C784 : mr r28, r3        (saving passed itemspawn table)
#r3 = passed itemspawn table (can be normal itemspawn from stage or container)
#r4 = "0x804A0000" (safe to use)
#r5 = static address of stage item information? (804A0C64)
#--the code forces the itemspawn table used for breaking containers in place of stage spawns
#---This makes container spawns impossible
ori r28, r4, 0x0E34      #r28 = static address to itemspawns from stage

cmplw r3, r28
bne- return            #if this isn't a normal stage itemspawn, then proceed as normal

ori r3, r4, 0x0E50      #else, change passed itemspawn table to 804A0E50 (container itemspawns)

return:
mr r28, r3
I tried a different approach last night by playing with the call to this function (8026c530)

It appears to do something with an RNG generated seed and the item pool referenced from the itemspawn tables mentioned above. With a breakpoint here, it’s possible to see the returned ID (from pool) and identify containers in r3.

From there it’s possible to branch to (8026c7bc) or (8026c868) in order to have the chooseRandomItem function return “-1” which aborts the item spawn. Doing this however has a dramatic effect on item spawn frequency, so I didn’t settle on this.

---

The static addresses I’ve seen the game load with immediates while looking at these functions:

804A0C64 - table related to items currently on the stage (like quantity)
804A0E34 - table related to item pool for random item spawns on stage
804A0E50 - table related to item pool for random item spawns in containers
 

Ohsm

Smash Apprentice
Joined
Jul 26, 2011
Messages
175
Location
Germany
Thank you very much Punkline Punkline , you helped me a lot <3
I quickly tested your code on dolphin, seems to work perfectly fine.
 
Last edited:

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,178
Location
Sacramento, CA
Awesome. (I wish people in my area liked to play with items once in a while.)

@Achilles1515, Might want to take a peek at this. I seem to remember that the option in 20XX to do this (and/or the option to turn off explosions from containers; it might have just been the latter) doesn't work.

Alternatively, I think it could also be fun to allow containers to spawn from containers.
 

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
Alternatively, I think it could also be fun to allow containers to spawn from containers.
omg, lol genius. Just gotta swap the immediates:

$Containers spawn containers [Punkline]
C226C784 00000003
609C0E50 7C03E040
40820008 60830E34
7C7C1B78 00000000


Code:
    -==-


Containers spawn containers
Containers can contain more containers.
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ------ 0x269364 ---- 7C7C1B78 -> Branch

609C0E50 7C03E040
40820008 60830E34
7C7C1B78 00000000
 
Last edited:
Top Bottom