With the way I am doing random getup options right now, I cannot specifically increase the chance of standing up in place or rolling left/right. This is because I am having them input a random joystick input while they are on the ground (or, instead, inputting the A button to do a getup attack).
It works like this.
Memory address 0x804d5f90 is the "random seed" address.
It's location in memory never changes and the value at this address changes every frame of the game.
(I think it might be partially influenced by stages / character actions....but for all intents and purposes, its random).
So for example, one frame it's value could be C53AF974 and then the next frame of the game it is A76A7B44 (these are actual values that I just copied to this post while playing the game on Dolphin).
So it's always changing.
The logic for the "random" getup options is like this:
(Your character is laying on the ground)
- Grab the first byte from that random seed address. So in that example I gave (the value of the first frame), my code would look at the first byte which is C5.
- Compare that value to F0. If it
less than F0 then input a random joystick direction (roll or standup). If it
greater than F0, input the A button (getup attack).
That byte can range from 00 to FF. So when looking at that range of values, the random byte should be below F0 a lot of the time, as there are many more possible values below it than possible values above it. (which is why I'm surprised the CPU was getup attacking "so much" in the first place).
So what I did to make the getup attack happen less is I changed that byte comparison (that you stated above) from F0 to F8. So now, the character will only getup attack if that random byte is above F8 instead of above F0 (which means it should happen less often, as there are now less values that will cause a character to hit the A button).
That's pretty much it.
And for the random joystick input, I take the first 16-bits of that random seed address (which would be a value of C53A in that first frame of the example above), and then just plugging that into P2's joystick input. So this will happen like every frame or whatever, and when the value input into the P2 joystick corresponds to a joystick direction, then they will perform that direction on-screen.
If I wanted to make "rates" for each specific direction, I would need to
not have the character input a random direction and instead have them input a specific direction of up, left, or right.
So it would be something like:
- Pull the random seed byte
- compare the random byte value to 0x3F.
- if its less than that value, input UP
- compare the random byte value to 0x7E
- if its less than that value, but greater than 3F, input LEFT
- compare the random byte value to 0xBD
- if its less than that value, but greater than 7E, input RIGHT
- compare the random byte value to 0xF8 (like it currently does)
- if its greater than that value, input A
So...idk..something like that. Pulling the random byte and splitting up it's available values to have a certian value range correspond to specific inputs. That way, you could adjust those comparison values to have specific actions happen more often than others.
and this would be a longer code....
Hopefully, this clears things up. And feel free to change the "F8" value to something else if you want to try a different "rate" at which they will getup attack.
As for turning
yellow during shield stun, I could change it to this, but I might have to add a couple lines of code (not exactly sure yet, need to experiment). This means I would have to make some [larger] changes in the DOL file and might have to move some stuff around. Like you said, yellow might be better, so I'll probably work on this right now and get your guys' feedback as to whether it should be a permanent change for the next 20XX version update.