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

Request Custom Action State Subaction

omegagmaster

Smash Cadet
Joined
Dec 20, 2015
Messages
44
Hi,

I'm wondering if anybody could write a code that allows you to write a custom subaction. This subaction can change your character's "action state" I'm unsure if I should be referring to this. Examples include tumble, fall, freefall, etc. If there already exists a subaction where this can be done I would appreciate it if somebody could point it out to me.

Also if somebody could explain to me how some Up B's send characters to free fall I would be grateful for this as well.

Thanks!
 

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
I was curious about forcing action states too, awhile back. I dug up this post.

I read it a fairly long time ago, before I knew how to really look into it. I'm just going to post the contents of the doc here:

InternetExplorer’s Action State Code
Code:
0x20: Action state to force (ID or memory address)
0x24: Frame number to force (float)

Part 1: Hooks into the AS handler and branches to this instead of IASA.

#If 0x20 is 0, branch to regular function and goto END
lwz r31,0x20(r24)
cmpwi r31,0
bne 0xC
blrl
b END

#If >0, goto ID; if <0 (0x80000000 range), branch to address and end
cmpwi r31,0
bgt ID
mtlr r31
blrl
b END

#Move AS ID to r4 and branch to aerial initiation (which takes any AS ID)

ID:
mr r4,r31
lis r31, 0x8008
ori r31,r31,0xCFAC
mtlr r31
blrl

#Write 0 back to 0x20 and 0x24, branch back up

END:
li r31,0
stw r31,0x20(r24)
stw r31,0x24(r24)
b 0xCA5204


Part 2: Hooks into SIG4 (AS loader) and inserts frame number into f1.

mflr r0
lwz r14,0x24(r3)
cmpwi r14,0
beq 0x10
lfs f1,0x24(r3)
li r14,0
stw r14,0x24(r3)
b 0xCA2D88

C206B808 0000000A
83F80020 2C1F0000
4082000C 4E800021
4800002C 2C1F0000
41810010 7FE803A6
4E800021 48000018
7FE4FB78 3FE08008
63FFCFAC 7FE803A6
4E800021 3BE00000
93F80020 93F80024
60000000 00000000
C20693AC 00000004
7C0802A6 81C30024
2C0E0000 41820010
C0230024 39C00000
91C30024 00000000

It seems like it'd be possible, if potentially unstable; which would be pretty interesting.

I vaguely remember some funky things happening while trying to modify player.0x904 and player.0x908 from within the player SAevent parsing loop; and those I think are closely related to action state frames.

---

At the time of writing this, I don't quite know what @achilles1515's plans are for custom events; as the next available slot is the last ID that can be parsed before overflowing the byte range they are limited to.

I think the last event could just be dedicated as a special event that uses a different byte in its input for creating an entirely new index for more custom events. Again though, I don't know what his plans are, and he's the one pioneering custom events--so I'd wait to see what he has to say.

---

I'm going to play around with this action state code a bit, though. I'll test it from a hook in the SAevent parsing loop to make sure it behaves correctly.

Edit: also, I'm pretty sure there are a number of ways to force "special falling," which I believe is the name of the freefall action state. I'll see if there's a really simple way and edit this post again later with some more info.
 
Last edited:
Top Bottom