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

Custom Subaction Event - Projectile/Item Spawn

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Custom Subaction Event - Projectile/Item Spawn (1.02) [Achilles]
Code:
Custom Subaction Event - Projectile/Item Spawn v1.0 (SSBM 1.02) [Achilles]

C207168C 00000031
80A40008 88A50001
2C0500FF 40820170
7C0802A6 90010004
3821FF80 93E1006C
DBC10070 DBE10078
80A40008 90A10068
38C50010 90C40008
7C250B78 38A5FFFC
38C00000 38E00000
94C50004 38E70004
2C070064 40A2FFF4
90610008 9061000C
8063002C 8083002C
90810040 80A10068
88850002 548407FF
41820010 80831974
2C040000 408200DC
88850003 90810010
A0850004 B0810018
C3C10018 C3E3002C
FFDF07B2 C3E300B0
FFDEF82A D3C1001C
D3C10028 A0850006
B0810018 C3C10018
C3E300B4 FFDEF82A
D3C10020 D3C1002C
A0850008 B0810018
C3C10018 C3E3002C
FFDF07B2 D3C10034
A085000A B0810018
C3C10018 D3C10038
3C608026 60638B18
7C6803A6 7C230B78
38630008 4E800021
8063002C 80810068
A0A4000C B0A10018
80A10018 90A30038
88A40002 54A507FF
41820020 3CA08009
60A548A8 7CA803A6
80830004 80630518
4E800021 48000014
A0A4000E B0A10018
80A10018 90A30D44
83E1006C CBC10070
CBE10078 38210080
80010004 7C0803A6
4E800020 7C0802A6
60000000 00000000
Inject this code into your ISO (I suggest using DRGN's Code Manager) and then you can start modifying subaction data to include this new command.

Custom Subaction Format (0x10 in length):

F4FFZZAA XXXXYYYY VVVVZZZZ SSSSTTTT

F4 = subaction command byte (always keep as 0xF4)
FF = flag for custom function (always keep as 0xFF)
ZZ = Flags
00 = launch created item
01 = give created item to player​
AA = article/projectile/item ID
XXXX = x-offset from player TopN [float]
YYYY = y-offset from player TopN [float]
VVVV = x-velocity [float]
ZZZZ = y-velocity [float]
SSSS = model scale [float]
TTTT = time to expire [float]



NOTES:
  • TopN is basically the base of your character. Use the x & y offset to move the starting location of the item/projectile.
  • Items labeled with [float] are values expressed as floating point numbers. BUT, only the first half of the floating point number. Use this website to convert your decimal number into floating point hex. Then chop off the last half of it.
  • Positive x-axis values are in front of the character. Positive y-axis values are up.
  • Model scale doesn't work for some things (Blastoise's water & Chikorita's leaf for example. It seems to work for regular items).
  • Time to expire, offsets, & velocities are ignored if the created item is given to a character
  • MANY of the items/projectiles that are not meant to be thrown/spawned in such a manner cause the game to freeze, especially character specific items. Some Pokemon can be spawned without problems. Experiment.
Code:
Items (decimal/hex/name)
-------------------------------
## 0x   Item
------------------
00 00    capsule
01 01    box
02 02    barrel
03 03    egg
04 04    partyball
05 05    cannon
06 06    bombomb
07 07    mr. saturn
08 08    heart
09 09    tomato
10 0A    star
11 0B    bat
12 0C    sword
13 0D    umbrella
14 0E    green shell
15 0F    red shell
16 10    gun
17 11    freezie
18 12    food
19 13    mine
20 14    bumper
21 15    super scope
22 16    star rod
23 17    lip stick
24 18    fan
25 19    fire flower
26 1A    big mushroom
27 1B    small mushroom
28 1C    hammer
29 1D    warp star
30 1E    screw attack
31 1F    rabbit hood
32 20    metal
33 21    cloak
34 22    pokeball
43 2B    goomba
44 2C    redead
45 2D    octarok
46 2E    otosea

2F Stone
30 Mario's fire
31 Dr.Mario's Capsule
32 Kirby's Cutter beam
33 Kirby's Hammer
34 Raygun beam
35
36 Fox's laser
37 ? Falco's Laser ?
38 Fox's shadow
39 Falco's shadow
3A Link's bomb
3B Young Link's bomb
3C Link's boomerang
3D Young Link's boomerang
3E Link's Hookshot
3F Young Link's Hookshot
40 Arrow
41 Fire Arrow
42 PK Fire
43 PK Flash
44 PK Flash
45 PK Thunder
46 PK Thunder
47 PK Thunder
48 PK Thunder
49 PK Thunder
4A Fox's Blaster
4B Falco's Blaster
4C ? Link's Arrow ?
4D Young Link's arrow
4E PK Flash (explosion)
4F Needle(thrown)
50 Needle
51 Pikachu's Thunder
52 Pichu's Thunder
53 Mario's cape
54 Dr.Mario's cape
55 Smoke (Sheik)
56 Yoshi's egg(thrown)
57
58 Yoshi's Star
59 Pikachu's thunder
5A Pikachu's thunder
5B Pichu's thunder
5C Pichu's thunder
5D Samus's bomb
5E Samus's chargeshot
5F Missile
60 Grapple beam
61 Sheik's chain
62
63 Turnip
64 Bowser's flame
65 Ness's bat
66 Yoyo
67 Peach's parasol
68 Toad
69 Luigi's fire
6A Ice(Iceclimbers)
6B Blizzard
6C Zelda's fire
6D Zelda's fire (explosion)
6E
6F Toad's spore
70 Mewtwo's Shadowball
71 Iceclimbers' Up-B
72 Pesticide
73 Manhole
74 Fire(G&W)
75 Parashute
76 Turtle
77 Sperky
78 Judge
79
7A Sausage
7B Milk (Young Link)
7C Firefighter(G&W)
7D Masterhand's laser
7E Masterhand's bullet
7F
80
81 Crazyhand's Bomb
82
83
84
85
86
87
88
89
8A
8B
8C
8D
8E
8F
90
91
92
93
94
95
96
97  (crashes with peach pulls out)
98
99
9A
9B
9C
9D
9E Coin
9F
A0 Null pokemon entry?
A1 Goldeen (Tosakinto)
A2 Chicorita
A3 Snorlax
A4 Blastoise
A5 Weezing (Matadogas)
A6 Charizard (Lizardon)
A7 Moltres
A8 Zapdos
A9 Articuno
AA Wobbuffet
AB Scizor
AC Unown
AD Entei
AE Raikou
AF Suicune
B0 Bellossom (Kireihana)
B1 Electrode (Marumine)
B2 Lugia
B3 Ho-oh
B4 Metamon
B5 Clefairy
B6 Togepi
B7 Mew
B8 Celebi
B9 Staryu (Hitodeman)
BA Chansey
BB Porygon2
BC Cyndaquil (Hinoarashi)
BD Marill
BE Venusaur (Fushigibana)
BF Chikorita's Leaf
C0 Blastoise's Water
C1 Weezing's Gas
C2 Weezing's Gas
C3 Burn ??? Fire something
C4 Burn ??? Fire something
C5 Charizard's Breath
C6 Charizard's Breath
C7 Unowns
C8 Lugia's Aeroblast
C9 Lugia's Aeroblast
CA Lugia's Aeroblast
CB Ho-oh's Flame
CC Staryu's Star
CD Healing Egg
CE Cyndaquil's Fire
CF ??? invisible
D0
D1 Target
D2 Shyguy (Heiho)
D3 Koopa(Green) (Nokonoko)
D4 Koopa(Red) (PataPata)
D5 Likelile
D6 (old-lead)
D7 (old-octa)
D8 (old-otto)
D9 White Bear (whitebea)
DA klap
DB Paratroopa (Green) (zgshell)
DC Paratroopa (Red) (zrshell)
DD
DE
DF
E0 (crashes with peach pulls out)
E1 Apple
E2
E3
E4
E5
E6 Tool
E7
E8
EA Arwing Laser
EB Wolfen Laser
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9 (crashes with peach pulls out)
FA
FB
FC
FD
FE
FF



Examples:
(Sorry for bad quality. For these tests, I was being lazy and just overwrote a GFX spawn subaction event on Fox's jump with the new projectile subaction.)

Blastoise's water (x-veloc = 2.00):

Electrode (0.5x scale):

Chikorita's Leaf:


Code:
0xF4 = subaction command = controlling function 8007168c

Inject @ 8007168C
- r3 = external data offset
- r4 = data offset subaction timer offset

DEFAULT_FUNCTION:
lwz    r3,0x8(r4)
addi    r0,r3,4
stw    r0,0x8(r4)
blr

--------------------------------
Custom Projectile Subaction v1.0

lwz    r5,0x8(r4)    # load current subaction RAM location
lbz    r5,1(r5)    # load second byte
cmpwi    r5,0xff        # 0xFF is flag for custom function
bne-    DEFAULT        # In case this function is used in vanilla

mflr    r0
stw    r0,0x4(sp)
subi    sp,sp,0x80    # push back stack
stw    r31,0x6c(sp)
stfd    f30,0x70(sp)
stfd    f31,0x78(sp)

UPDATE_SUBACTION_TIMER:
lwz    r5,0x8(r4)    # load current subaction location
stw    r5,0x68(sp)    # store this location in stack
addi    r6,r5,0x10    # custom subaction event is 0x10 in length
stw    r6,0x8(r4)    # store new subaction location


mr    r5,sp
subi    r5,r5,4
li    r6,0
li    r7,0
ZERO_LOOP:        # zero the entity struct in stack
stwu    r6,4(r5)
addi    r7,r7,4
cmpwi    r7,0x64
bne-    ZERO_LOOP

stw    r3,0x8(sp)    # store player pointer at entity (0x00)
stw    r3,0xc(sp)    # store player pointer at entity (0x04)
lwz    r3,0x2c(r3)    # r3 now holds internal data offset
lwz    r4,0x2c(r3)    # load facing direction
stw    r4,0x40(sp)    # store facing direction at entity (0x38)

lwz    r5,0x68(sp)    # load subaction location

#########
ITEM_HELD_CHECK:    # check only if giving item to player
lbz    r4,0x2(r5)    # load flags
rlwinm.    r4,r4,0,31,31    # does contain 01?
beq-    END_ITEM_HELD_CHECK
lwz    r4,0x1974(r3)    # load item held
cmpwi    r4,0
bne-    FINISH        # if not zero, then holding another item
END_ITEM_HELD_CHECK:
########

lbz    r4,0x3(r5)    # load item ID
stw    r4,0x10(sp)    # store item ID at entity (0x08)

lhz    r4,0x4(r5)    # load x-coord offset from TOPN
sth    r4,0x18(sp)    # this is free to use, set to 0 by SpawnEnt
lfs    f30,0x18(sp)    # load x-coord offset
lfs    f31,0x2c(r3)    # load facing direction
fmul    f30,f31,f30    # multiply facing direction by offset
lfs    f31,0xb0(r3)    # load TopN x-coord
fadd    f30,f30,f31
stfs    f30,0x1c(sp)    # store item x-coord at entity (0x14)
stfs    f30,0x28(sp)    # store item x-coord at entity (0x20)

lhz    r4,0x6(r5)    # load y-coord offset from TOPN
sth    r4,0x18(sp)    # this is free to use, set to 0 by SpawnEnt
lfs    f30,0x18(sp)    # load y-coord offset
lfs    f31,0xb4(r3)    # load TopN y-coord
fadd    f30,f30,f31
stfs    f30,0x20(sp)    # store item y-coord at entity (0x18)
stfs    f30,0x2c(sp)    # store item y-coord at entity (0x24)

lhz    r4,0x8(r5)    # load x-veloc
sth    r4,0x18(sp)
lfs    f30,0x18(sp)
lfs    f31,0x2c(r3)    # load facing direction
fmul    f30,f31,f30    # multiply facing direction by offset
stfs    f30,0x34(sp)    # store x velocity

lhz    r4,0xa(r5)    # load y-veloc
sth    r4,0x18(sp)
lfs    f30,0x18(sp)
stfs    f30,0x38(sp)    # store y velocity


lis    r3,0x8026
ori    r3,r3,0x8b18    # load EntityItemSpawn
mtlr    r3
mr    r3,sp
addi    r3,r3,8
blrl
lwz    r3,0x2c(r3)    # load item internal offset
lwz    r4,0x68(sp)    # load subaction location
lhz    r5,0xc(r4)    # load model scale
sth    r5,0x18(sp)
lwz    r5,0x18(sp)
stw    r5,0x38(r3)    # store model scale


lbz    r5,0x2(r4)    # load flags
rlwinm.    r5,r5,0,31,31    # does contain 01?
beq-    TIME_TO_EXPIRE
lis    r5,0x8009
ori    r5,r5,0x48a8    # load GiveItemToPlayer function
mtlr    r5
lwz    r4,0x4(r3)    # load item entity start
lwz    r3,0x518(r3)    # load item owner
blrl
b    FINISH

TIME_TO_EXPIRE:
lhz    r5,0xe(r4)    # time to expire
sth    r5,0x18(sp)
lwz    r5,0x18(sp)
stw    r5,0xd44(r3)    # store time to expire
TIME_TO_EXPIRE_END:


FINISH:
lwz    r31,0x6c(sp)
lfd    f30,0x70(sp)
lfd    f31,0x78(sp)
addi    sp,sp,0x80
lwz    r0,4(sp)
mtlr    r0
blr            # end new function

DEFAULT:
mflr    r0        # default code line

@Itaru Ampers Ampers Tater Tater @MagicScrumpy @TheDankbanker
 
Last edited:

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
oh well, now I know something to add to my minigame mod...

One thing I can't seem to find, how to I choose when an item appears?
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
oh well, now I know something to add to my minigame mod...

One thing I can't seem to find, how to I choose when an item appears?
It's meant to be used within subaction data, so similar to when you tell the game to display hitboxes.

I suppose the code could be modified in a way similar to Magus' FSM engine where it manually checks for action state frame numbers to execute things. Hadn't thought about doing that.
 

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
Achilles1515 Achilles1515 I thought the way of using that code is placing it somewhere in the code, then from any actions, I bl to that function with an adress of the table as parameter.

Do you have an example of how you made it with Fox's jump?
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Achilles1515 Achilles1515 I thought the way of using that code is placing it somewhere in the code, then from any actions, I bl to that function with an adress of the table as parameter.

Do you have an example of how you made it with Fox's jump?
It's use is similar to how you edit subactions with the Crazy Hand program. The custom format outlined above goes in the Pl__.dat files. So instead of having a GFX effect, SFX, or a hitbox or something come out on Frame X, you could zero out that data and change it to the custom one I created.

I can't post a specific example because I am laying in bed at the moment.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
You could probably do some cool things with animation swapping item throw animations, and then adding the item/projectile spawn.

Like switching Ftilt animation with forward item throw (of some sort) and then deleting the Ftilt hitboxes and adding in a projectile spawn.
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Holy cats, Achilles you are a god! I'd like to add support for this in CH if you don't mind. This is something I've really wanted to exist in melee for a long time now, I've just not had the skill to do it myself.

While I'm at it, I'm also going to add the "healing event" that you made a while back. Are there any other custom events that I should add?
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
Your ASM has "blrl" in it. Is there any particular reason for that? It looks equivalent to a "blr" though I can only find it in Apple's documentation.
 

flieskiller

Smash Journeyman
Joined
Jan 3, 2013
Messages
426
SinsOfApathy SinsOfApathy you can mtlr any adress, then it will act like a bl to the function used in the mtlr. It's similar to mtctr and bcrl(? I think it's that), but the link register is used instead of the condition register, allowing to not lose the condition register from a previous comparison.
 

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
Because I'm really bad at actually manually editing hex, it'd be cool if we could get Tater Tater to put this in Crazy Hand! Then again, this doesn't look difficult at all, but it'd still be cool to have it. And now that we can spawn projectiles, I imagine editing characters is gonna be a lot cooler from now on... Good job achilles!
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
Because I'm really bad at actually manually editing hex, it'd be cool if we could get Tater Tater to put this in Crazy Hand! Then again, this doesn't look difficult at all, but it'd still be cool to have it. And now that we can spawn projectiles, I imagine editing characters is gonna be a lot cooler from now on... Good job achilles!
I put in a quickie way for Crazy Hand to read the event, but I think Ampers Ampers is working on one more in-depth than that. :)

And yes, editing characters is a lot more fun. I'm working on a small mod that I think people will enjoy c:
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
I put in a quickie way for Crazy Hand to read the event, but I think Ampers Ampers is working on one more in-depth than that. :)

And yes, editing characters is a lot more fun. I'm working on a small mod that I think people will enjoy c:
Yes I'm gonna add support for it, but I'm still waiting for you to put the most up to date code on Github :3
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
I put in a quickie way for Crazy Hand to read the event, but I think Ampers Ampers is working on one more in-depth than that. :)

And yes, editing characters is a lot more fun. I'm working on a small mod that I think people will enjoy c:
Tater, will you plzzzz put the v1.30 code on Github haha. I've been waiting to get started on the projectile spawning event until then...
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
Tater, will you plzzzz put the v1.30 code on Github haha. I've been waiting to get started on the projectile spawning event until then...
Oh crap, I thought I put it up yesterday but I guess I forgot a step ;-; Uploading it as soon as github stops crashing...

EDIT: It's fixed now. I'm still syncing changes to the tater_prerelease branch because it's still buggy around the edges. Sorry it took so long :/
 
Last edited:

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
Tater, will you plzzzz put the v1.30 code on Github haha. I've been waiting to get started on the projectile spawning event until then...
Oh crap, I thought I put it up yesterday but I guess I forgot a step ;-; Uploading it as soon as github stops crashing...
Uh that reminds me, is it just me or is the latest updated thing on that github from 8 months ago...
http://prntscr.com/9nquzx
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Also would this conflict with your Self Damage/Self Heal modified subaction event in any way?
No.
Holy cats, Achilles you are a god! I'd like to add support for this in CH if you don't mind. This is something I've really wanted to exist in melee for a long time now, I've just not had the skill to do it myself.

While I'm at it, I'm also going to add the "healing event" that you made a while back. Are there any other custom events that I should add?
The only other event modification I have made was the one to have a random hitbox element. If you want to add the random hitbox element, I'll need to update that code just a bit I think. Although, I can make more custom events if you guys are looking for anything specific that isn't out of my league.

It would certainly make character editing more powerful to include these codes in Crazy Hand. But I must say, automatically adding codes to a user's ISO is tricky and the only good way that I would condone doing such is to give the supported code text to use with DRGN's DOL Manager, or to implement code management in a similar way. I highly recommend something like telling the user to use the Code Manager and then having your program check the injection lines of code to make sure they are branching somewhere instead of doing the default code instruction.

And some of the comments from the Crazy Hand thread lead me to believe that the default location of the FSM list needs to be changed to make room for more entries.
 

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
And some of the comments from the Crazy Hand thread lead me to believe that the default location of the FSM list needs to be changed to make room for more entries.
You'd be surprised, you'd think about 150 entries would be enough, (at least that's the amount that I think it is, from what I've looked at.) but I started off using FSM entries from SD Remix and I surprisingly hit the limit. I feel like I'd be fine with the limit if the program wouldn't just crash on the FSM page whenever you have an over abundance of entries. Then again, I shouldn't be one to complain, this is extremely tricky work here and it's not like I can make a program to do this :p . Glad you guys are all so nice and helpful to the hacking community, keep up the good work.
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Oh crap, I thought I put it up yesterday but I guess I forgot a step ;-; Uploading it as soon as github stops crashing...

EDIT: It's fixed now. I'm still syncing changes to the tater_prerelease branch because it's still buggy around the edges. Sorry it took so long :/
Thank you! Time to get crackin'



It would certainly make character editing more powerful to include these codes in Crazy Hand. But I must say, automatically adding codes to a user's ISO is tricky and the only good way that I would condone doing such is to give the supported code text to use with DRGN's DOL Manager, or to implement code management in a similar way. I highly recommend something like telling the user to use the Code Manager and then having your program check the injection lines of code to make sure they are branching somewhere instead of doing the default code instruction.
Yeah I've been trying to decide how I wanted to handle the code injection aspect, and I think I'm leaning towards a reliance on DRGN's program like you said. It would be awesome to have that handled natively in CH, but there's no reason to reinvent the wheel. I think what I'll do is include your code ready to import into DRGN's program along with the download for CH, and have a warning message that indicates you need to inject the code before using that event,




I can make more custom events if you guys are looking for anything specific that isn't out of my league.
Well, if you'd be interested I have a couple suggestions that come to mind. Bare in mind I have no idea if any of these are feasible because I'm still a dingus who knows nothing about melee modding:

-Event to change a character's state (metal,invisible,giant, etc...) mid game.
-Event to add/remove stocks mid game
-Event to allow jump cancels -- Okay, I feel like this one is pretty unreasonable, but that would be soooo cool. I'm thinking it could behave just like the "IASA" event, where when the event is reached it would just allow the player to jump out of the move.
-Event to change character's velocity? -- Again, no idea if this is feasible... but it would be cool if there was an event that would just allow you to update character's horizontal and vertical speed. You could do things like make a d-air that has the player shoot downward or something...

Those were just some thoughts that popped into my head, haha. Feel free to do whatever you want with these ideas.
 
Last edited:

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
-Event to change a character's state (metal,invisible,giant, etc...) mid game.
-Event to add/remove stocks mid game
-Event to allow jump cancels -- Okay, I feel like this one is pretty unreasonable, but that would be soooo cool. I'm thinking it could behave just like the "IASA" event, where when the event is reached it would just allow the player to jump out of the move.
-Event to change character's velocity? -- Again, no idea if this is feasible... but it would be cool if there was an event that would just allow you to update character's horizontal and vertical speed. You could do things like make a d-air that has the player shoot downward or something...

Those were just some thoughts that popped into my head, haha. Feel free to do whatever you want with these ideas.
I think all of these are really cool ideas! Seeing as how those can be done with regular attacks, I think it's feasable... however it'd probably be pretty difficult. Still, it'd be amazing.

Another thing: Yes, it'd be MUCH easier to have a code to work with the Melee Code Manager. Easier on you, that is. (or I assume) So it's probably best to go with that.

Edit: Another thing that would be nice to have would be installation for everything stated above, along with the Projectile code, and the self heal/self damage code but I think that's already what's planned.
 
Last edited:

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
423
No.

The only other event modification I have made was the one to have a random hitbox element. If you want to add the random hitbox element, I'll need to update that code just a bit I think. Although, I can make more custom events if you guys are looking for anything specific that isn't out of my league.

It would certainly make character editing more powerful to include these codes in Crazy Hand. But I must say, automatically adding codes to a user's ISO is tricky and the only good way that I would condone doing such is to give the supported code text to use with DRGN's DOL Manager, or to implement code management in a similar way. I highly recommend something like telling the user to use the Code Manager and then having your program check the injection lines of code to make sure they are branching somewhere instead of doing the default code instruction.

And some of the comments from the Crazy Hand thread lead me to believe that the default location of the FSM list needs to be changed to make room for more entries.
I just wanted to chime in and say this custom subaction event stuff is really swell.

I'm in the middle of (over)developing a code right now that sits in the SAevent_frame function. I really have no idea how it'll turn out, but it's being designed to take in (an arbitrary number of) inputs that can be used to specify sweeping changes to incoming subaction events. I've only prototyped a design for the data structure of the inputs, and it contains a few utility functions that will probably make it large enough to be unsuitable for anything besides a dol mod (still works as a code, just very large.)

It should allow for skipping subaction events, inserting subaction events (non-destructively,) and replacing subaction events (insert and skip.)

If it turns out like I want it to, then you should also be able to feed it an offset in the input that it can use to call a custom subroutine (similar to the way subaction event functions are called.) This would let you do anything you can program in ASM with subactions... like writing them in the stack using variables and inserting them in between other events. I have all sorts of silly goals with this in mind.

Anyway, I just wanted to mention that I started working on it as soon as I saw this post a week ago. I haven't got anything to show yet (unless you want to see some buggy code) but I suspect that when it's done it'll have no problem using custom subaction events like this.
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
I just wanted to chime in and say this custom subaction event stuff is really swell.

I'm in the middle of (over)developing a code right now that sits in the SAevent_frame function. I really have no idea how it'll turn out, but it's being designed to take in (an arbitrary number of) inputs that can be used to specify sweeping changes to incoming subaction events. I've only prototyped a design for the data structure of the inputs, and it contains a few utility functions that will probably make it large enough to be unsuitable for anything besides a dol mod (still works as a code, just very large.)

It should allow for skipping subaction events, inserting subaction events (non-destructively,) and replacing subaction events (insert and skip.)

If it turns out like I want it to, then you should also be able to feed it an offset in the input that it can use to call a custom subroutine (similar to the way subaction event functions are called.) This would let you do anything you can program in ASM with subactions... like writing them in the stack using variables and inserting them in between other events. I have all sorts of silly goals with this in mind.

Anyway, I just wanted to mention that I started working on it as soon as I saw this post a week ago. I haven't got anything to show yet (unless you want to see some buggy code) but I suspect that when it's done it'll have no problem using custom subaction events like this.
Dude, this sounds like it could be incredible if you can get it working.
When you say "skipping", do you mean like conditional statements? So something along the lines of "if something=true, skip the next event, else proceed normally"? That would be interesting. Certainly would open up a lot of possibilities.
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
Well, if you'd be interested I have a couple suggestions that come to mind. Bare in mind I have no idea if any of these are feasible because I'm still a dingus who knows nothing about melee modding:

-Event to change a character's state (metal,invisible,giant, etc...) mid game.
-Event to add/remove stocks mid game
-Event to allow jump cancels -- Okay, I feel like this one is pretty unreasonable, but that would be soooo cool. I'm thinking it could behave just like the "IASA" event, where when the event is reached it would just allow the player to jump out of the move.
-Event to change character's velocity? -- Again, no idea if this is feasible... but it would be cool if there was an event that would just allow you to update character's horizontal and vertical speed. You could do things like make a d-air that has the player shoot downward or something...

Those were just some thoughts that popped into my head, haha. Feel free to do whatever you want with these ideas.
I don't know if any of my knowledge will help, but I'll leave what I know here:

First off, thanks to the wonderful tool that @DRGN made, you can actually see the exact ASM code used for every function called in a character's move logic table. All you have to do is paste the value into the RAM Address Conversion box in Melee Code Manager.

Keep in mind I'm not cut out for working with ASM, so I don't know a great deal in regards to the exact requirements for programming in it.

-Event to change a character's state (metal,invisible,giant, etc...) mid game.

All of these were accomplished by editing Captain Falcon's move logic table(located at 0x3C42B8 in Start.dol). I only saved documentation on the first edit I did, but it should give you an idea of my thought process:

Grounded Falcon kick gives Falcon metal until death(texture+physics)(JC-able)
00 00 01 37 00 34 02 14 15 00 00 00 80 0C 83 48 80 0C AE D0 80 0D 10 5C 80 0E 46 B8 80 07 61 C8

80 0C AE D0 is a function that lets you jump-cancel a grounded move at any time.

80 0C 83 48 is the function used to apply metal to a character. (Found thanks to wParam's notes: http://wparam.com/ssbm/notes.html)

80 0D 10 5C is the function that applies metal physics to a character. (Once again, found with wParam's notes.)

Don't remember what 80 0E 46 B8 is; I think it's just part of falcon's down-B.

80 07 61 C8 is a generic camera behavior function. Used in most moves.


The function calls for other effects in the video(Growing/shrinking, invisibility) are also in wParam's notes.

Since we can find the actual ASM code for all of these with MCM, it may be easy to create custom events that use the same code.

-Event to allow jump cancels
This could be more doable than you think, actually. Since there's already function calls for enabling/disabling autocancels with aerials(4C 00 00 0X). My thought is if we can find the ASM for autocancel calls, we might be able to re-configure it for jump cancels. It's probably not as simple as I laid it out, but you never know.

-Event to change character's velocity
This one could also be pretty easy, actually. Since there are events inside captain falcon/ganondorf's aerial neutral-B that effect character velocity (I'd imagine that one function or another listed in the move logic for their aerial neutral-Bs handles the event calls) it may be as simple as making the game always listen for a custom event to be called and then re-using the function falcon/ganon use.
 

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
423
Dude, this sounds like it could be incredible if you can get it working.
When you say "skipping", do you mean like conditional statements? So something along the lines of "if something=true, skip the next event, else proceed normally"? That would be interesting. Certainly would open up a lot of possibilities.
Yeah! That's the idea, anyway. I'd be trying to fit it into a series of inputs that look ... well, a bit similar to actual subaction events. Here's a synopsis of the whole concept, to help better explain how I'm designing the data structure to implement programmable logic:

Each player has an event pointer at player.0x44C that tells the SAevent_frame function what subaction event to run next. It also uses player.0x444 to store timers from sync/async events, and uses that to know when to run them.

You can do some cool stuff with just simple manipulations of these two addresses. I did a lot of in my early Impossible Cancel experiments. Without manipulating the subaction timer, the cancel concept used in that code would cut out subaction events from after the point of the cancel; so I used these addresses to "flush" the events all in one frame before continuing with the cancel to have things like modelmod events and projectile flags to trigger properly.

These appear to be a part of several subaction-related memory addresses that start at player.0x444, and are referenced in functions as a base address for offsets:

0x444 | 0x00 - Subaction Event Timer
0x448 | 0x04 - Subaction Frame
0x44C | 0x08 - Subaction Event Pointer
0x450 | 0x0C - Subaction Loop count
0x454 | 0x10 - Subaction Loop Pointer

Addresses below these appear to be used for colored flashes, and I think I remember there being something that looked like another pointer that might be responsible for "auras;" I think like what's used in smash charges and the special falling flicker. I haven't looked into it, but it might be possible to use that to make "custom auras."

By placing a hook at any of the following locations, you can very easily take advantage of the above addresses:


@800732AC - once per player frame, and every subaction event (most inclusive)
@800732F8 - once per subaction event read (excludes frames where 0x444 timer is ticking)
@8007330C - once per non-control subaction (only when reading hitboxes, SFX, GFX, etc)
@80005b80 - on subaction control event reads (timers, gotos, subroutines, loops, etc)


I use this one in order to provide an ability to interrupt the subaction event timer, and deal with both control/non-control events.


So, to skip a subaction event, for example, you would just need to offset player.0x44C by the length of the event being skipped, so that the next one is read instead.

I should note that you can point this address to wherever you like and expect it to read subactions from there. You can test this by just setting the value in debug dolphin (try pointing it to parts of other moves~)

It might even be possible to take it a step further and use a fake base address for the player's 0x444 reference during subaction functions. This would let you keep things isolated from the actual event pointer. I'm not sure how this would be useful, but it might be possible to make non-destructive goTo, subroutine, and loop inserts in contexts where the loop pointer is already being used.

Inserting events is a bit trickier, and could be done in a number of ways. I mentioned that you could use a subroutine to write one in the stack (using variables, or immediates I guess) but I'd also like to provide the ability to just write them in as a part of the input line.

To insert something in this way, you can take the insert event's (specified) length and use it to back up the events behind it into the stack. After that, you can clobber the values with your insert event and construct the pointer for the event function like the SAevent frame normally would. I haven't tested this yet, but I believe this shortened snippet would work in the context of the hook:

Code:
IreadE:    rlwinm r3, r22, 30, 26, 29    #load "I" 4-bit value (as byte length)
    subf r4, r3, r4        #offset event pointer by I
    stw r4, 0x8(r29)    #update event pointer
    lbz r4, 0(r4)
    rlwinm r4, r4, 0, 24, 29    #load 6-bit Event id
    cmpwi r4, 40        #we're ready at this point to run our fake Event
    bge event        #if ID is < 0x28, then it is a control event, not a normal one

cEvent:    lis r3, 0x803c
    ori r3, r3, 0x67c0    #so construct pointer to control SAevent functions
    add r3, r3, r4        #
    mtlr r3            #
    mr r3, r29        #
    b readI

event:    subi r0, r4, 40        #else, r0 = 6-bit event ID - 10 (non-control event)
    add r3, r31, r0        #r31 holds pointer to control event functions (hook context)
    lwz r3, 0(r3)
    mtlr r3
    mr r4, r29        #move player.0x444 to r4 instead of r3
    subi r3, r29, 0x444    #creates pointer to player.0x0 in r3, for event functions

readI:    blrl            #read inserted subaction event
After the function returns, you then restore the original event lines from the stack, and everything should be peachy. If you put the two concepts together, you have a "replace" feature that works with mismatching event lengths. Take them apart, and they are their own respective functions.

---

So, I'm designing my code around this idea for a structure:

FF EE BB IS

FF - Function ID -- tells the input loop how to handle this input line. 00 = skip, 01 = normal, 02 = force only, 03 = end input loop

Eeefi - Event Search ID -- The first 6 bits make up the "command byte" to search for when inserting/skipping. The last 2 bits are for "forced" and "interrupt" options.

BB - Condition Function selector -- 8 individual bits that toggle extra (programmable) lines to be used in the input for a pipeline that specifies conditions beyond a simple "find and replace."

I - Insert length (as a unit of words)

S
- Skip length (as a unit of words)

BB lines would consist of lines of inputs that the input loop would recognize from the BB selection, and run special functions that interpret them as a series of conditions like (for example) action state IDs, character IDs, various character flags, hitlag, etc. I'm writing it so that BB lines can specify their own number of extra lines, so I'll probably just reserve BB lines 7 and 8 for conditions and subroutines respectively; freeing up 1-6 to be programmed by anyone else~

The last BB line would be used to specify what (if any) subroutine to run. I'm thinking it'd be helpful to also allow this line to specify a number of extra lines in the input space to be used as memory allocated just for the subroutine, so they could be really complex. You could then, for example, write subroutines that take inputs, and thus, for another example, specify more subroutines. This would of course also mean it'd be possible to create subroutines that store flags/timers/pointers/offsets between frames for their own functions.

There are some other spiffy features I've already implemented like an option to "force" an input to ignore conditions for a single read, or "interrupt" a subaction event timer for a single timer event; and then be able to toggle these options from a subroutine. Allocating the memory inline with the input lines would also let subroutines effect each other-- allowing people to orchestrate really massive modifications that span over multiple lines/events with many subroutines.

---

In the end, It's a lot of functionality to consider, and so it's also a pretty big piece of code. It's a lot of structure that can be reused however, so it's probably still quite practical as a utility library for DOL mods.

It's worth mentioning that I'm kind of an ambitious noob getting still getting used to all of this ASM stuff; so while I can tell you that all of this is possible, I can't really promise that everything in the code I'm dreaming up is an entirely sound concept until I've got it running ;p
 
Last edited:

Punkline

Dr. Frankenstack
Premium
Joined
May 15, 2015
Messages
423
I don't know if any of my knowledge will help, but I'll leave what I know here:

First off, thanks to the wonderful tool that @DRGN made, you can actually see the exact ASM code used for every function called in a character's move logic table. All you have to do is paste the value into the RAM Address Conversion box in Melee Code Manager.

Keep in mind I'm not cut out for working with ASM, so I don't know a great deal in regards to the exact requirements for programming in it.

-Event to change a character's state (metal,invisible,giant, etc...) mid game.

All of these were accomplished by editing Captain Falcon's move logic table(located at 0x3C42B8 in Start.dol). I only saved documentation on the first edit I did, but it should give you an idea of my thought process:

Grounded Falcon kick gives Falcon metal until death(texture+physics)(JC-able)
00 00 01 37 00 34 02 14 15 00 00 00 80 0C 83 48 80 0C AE D0 80 0D 10 5C 80 0E 46 B8 80 07 61 C8

80 0C AE D0 is a function that lets you jump-cancel a grounded move at any time.

80 0C 83 48 is the function used to apply metal to a character. (Found thanks to wParam's notes: http://wparam.com/ssbm/notes.html)

80 0D 10 5C is the function that applies metal physics to a character. (Once again, found with wParam's notes.)

Don't remember what 80 0E 46 B8 is; I think it's just part of falcon's down-B.

80 07 61 C8 is a generic camera behavior function. Used in most moves.


The function calls for other effects in the video(Growing/shrinking, invisibility) are also in wParam's notes.

Since we can find the actual ASM code for all of these with MCM, it may be easy to create custom events that use the same code.

-Event to allow jump cancels
This could be more doable than you think, actually. Since there's already function calls for enabling/disabling autocancels with aerials(4C 00 00 0X). My thought is if we can find the ASM for autocancel calls, we might be able to re-configure it for jump cancels. It's probably not as simple as I laid it out, but you never know.

-Event to change character's velocity
This one could also be pretty easy, actually. Since there are events inside captain falcon/ganondorf's aerial neutral-B that effect character velocity (I'd imagine that one function or another listed in the move logic for their aerial neutral-Bs handles the event calls) it may be as simple as making the game always listen for a custom event to be called and then re-using the function falcon/ganon use.
EDIT: The data sheet has gotten fatter since I last copied it to my docs. Just wanted to include a thanks to whoever has been filling it out~

EDIT AGAIN: I was in a hurry and totally rushed this post. Here's a little general info that might help anyone here who wants to make some suggestions for custom subaction ideas~ Ampers Ampers Tater Tater

First of all, just for anyone who might not be aware, the SSBM Data Sheet is an ongoing documentation of the memory addresses available in RAM, as well as a bunch of other goodies. It's hosted by @Dan Salvato , who's a pretty cool dude for making it possible.

If any of you might want to get a little acquainted with ASM, his primer on writing gecko codes was a gentle enough instruction to help someone like me (who I guess comes from more of a drawing/painting background than a programming one) feel right at home with this stuff.

If I can attest to one thing here, it's that ASM can be involved enough to make you want to pull your hair out sometimes, but in it's essence is no scarier than 3rd grade math and true/false questions with 6 extra numbers per digit.

Anyway, there are a ton of useful addresses on the Global Addresses page, but some point to other areas in the memory that are dynamically assigned; like the player data offsets:

0x80453130 P1 data pointer
0x80453FC0 P2 data pointer
0x80454E50 P3 data pointer
0x80455CE0 P4 data pointer


These addresses don't change, and are 0xE90 apart. They are a part of the player blocks in static memory, and these addresses hold values that are a record of the location of 0x0 on the Char Data Offsets table. There are some useful addresses in these static player blocks, but the most useful ones will probably be in these character data offsets pointed to by the player data pointers.

It's possible to look up any of these values from the context of a (custom) subaction event function, as the registers will hold a pointer to the appropriate player data offset as a passed value. In this manner, they're probably very convenient for writing custom subaction event functions.

A couple of examples relevant to your suggestions:

Character State timers
0x2000 Lip Stick Flower Remainder
0x2004 Starman Invincibility
0x2008 Super Mushroom Duration
0x2014 Bunny Hood Duration
0x2028 Metal Box Duration
0x2030 Cloaking Device Duration



Velocity/position/delta
0x80 Horizontal velocity (air, self-induced)
0x84 Vertical velocity (self-induced)
0x8C Horizontal velocity (attack-induced)
0x90 Vertical velocity (attack-induced)
0xB0 X (Horizontal) position
0xB4 Y (Vertical) position
0xB8 Z (Depth) position
0xBC X (Horizonal) position (Prev. Frame)
0xC0 Y (Vertical) position (Prev. Frame)
0xC4 Z (Depth) Position (Prev. Frame)
0xC8 X Delta (Curr - Prev Pos)
0xCC Y Delta (Curr - Prev Pos)
0xD0 Z Delta (Curr - Prev Pos)
0xE0 Ground/Air state
0xEC Horizontal velocity (ground, self-induced)


It's possible then even if you're not familiar with programming in ASM to use these offsets, a calculator, and the debug dolphin GUI to find and play with these places in memory. To do that, you just add the offset to the value in the appropriate player data pointer.

I take advantage of the fact that the game seems to place these player data offsets in the same way every time if you start up a match with the same settings and levels (characters can vary) and usually do all my debug dolphin stuff on Hyrule in Training mode, using a vanilla copy of 1.02, which seems to always have a BA of 0x80C6AB40. This way, I don't have to always look up the pointer.

---

There's an interesting area at (and around) 0x2278 that seems to store a bunch of fun little bitflags that subactions use. @Savestate and Achilles1515 Achilles1515 helped me out a few weeks ago by pointing out that the IASA bit is stored here. I've been staring at subaction event functions ever since Achilles showed me they contained useful function calls, and these flags are everywhere. I've only just started documenting them, but I think they can help us find some unidentified subactions in Crazy Hand.

For those who might not be familiar with binary and hexadecimal, this area looks really confusing. It's possible to store 4 "categories" in a number format by adding together any combination of 1, 2, 4, and 8 in hex. Each of these will result in a unique digit, and can then account for each bit as a toggleable category; like a checkbox.

So, while they are pretty confusing to look at in a compact series, they can still be manipulated in debug dolphin with "set value" and by using rlwinm/rlwimi, or other bitwise instructions in ASM.

As of right now, I only know of the IASA bit, the few flags that appear to be (loosely) referenced on the data sheet, and some of my best guesses:

Bitflags
0x2210 (0x80) - Projectile spawn? Just found this (go figure.) it spawns a projectile associated with the current move, then immediately unflags. Interesting to note that it can be reflagged on the next frame. EDIT: From a little more testing, this appears to just effect some character projectiles. The ones I tested successfully were Mario(s)/Luigi, Link Bombs/boomerang, and Samus bomb/missile.

0x2218 (0x80) - IASA flag, should allow for jump cancels (note that the IASA event function already flags this thing)
0x2218 (0x40) - "followup" flag? allows moves like jabs to be interrupted with their next move

0x2219 (0x10) - Htbox flag? appears to flag during active hitboxes. the terminate_collisions event unflags it
0x2219 (0x04) - Character Freeze? Also seems to break the BO timer when hit out of freeze
0x2219 (0x02) - ... unfreeze hitlag? Seems to allow the hitlag freeze (below) to unfreeze. Also messes up BO timer when hit.
0x2219 (0x01) - Hitlag freeze flag? Appears to freeze the character after attacking. Also messes up BO timer when hit.

0x2223 (0x01) - Metal state Toggle (doesn't rely on timer)

Note that the projectile spawn flag is like, the only thing that happens in the "60" subaction event, and the "followup" flag gets toggled in "74" event depending on its input (1 or 0,) or just turned on in the "78" event. FYI, each of these are currently "unknown" in Crazy Hand 1.30.
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Punkline Punkline Thanks for all of the information, that's amazing. You, Achilles and Tater have me pretty intrigued with this custom event stuff now. I really need to learn asm modding...


I do have a question that I hope somebody can help out though. Now that I added support for Achilles' projectile spawning event to CH, I want to add in support for editing the hitbox data for these projectiles. The problem is I don't know how to go from the dolphin memory to the location in melee's files. Is there any easy way to do this?
So for instance I've found the hitbox for Staryu's projectile (ID = 0xCC) is stored in memory starting at 0x8082454. I checked a few common places like Start.dol for matching data with no luck, but I wasn't about to ctrl+f search every single file melee has for the data I'm looking for.
So is there an easy way to find this out? Or alternatively, does anybody know what file(s) are likely to contain the hitbox data for projectiles? For projectiles spawned by players I know they're stored in their Pl**.dat file.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Punkline Punkline Thanks for all of the information, that's amazing. You, Achilles and Tater have me pretty intrigued with this custom event stuff now. I really need to learn asm modding...


I do have a question that I hope somebody can help out though. Now that I added support for Achilles' projectile spawning event to CH, I want to add in support for editing the hitbox data for these projectiles. The problem is I don't know how to go from the dolphin memory to the location in melee's files. Is there any easy way to do this?
So for instance I've found the hitbox for Staryu's projectile (ID = 0xCC) is stored in memory starting at 0x8082454. I checked a few common places like Start.dol for matching data with no luck, but I wasn't about to ctrl+f search every single file melee has for the data I'm looking for.
So is there an easy way to find this out? Or alternatively, does anybody know what file(s) are likely to contain the hitbox data for projectiles? For projectiles spawned by players I know they're stored in their Pl**.dat file.
ItCo.dat

Item Common
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
ItCo.dat

Item Common
Thanks! For future reference, is there a way determine what file it's gonna be in based off of dolphin's offsets? I know DRGN's program can help with this but only for Start.dol I believe
I think the answer is no.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Thanks! For future reference, is there a way determine what file it's gonna be in based off of dolphin's offsets? I know DRGN's program can help with this but only for Start.dol I believe
I think the answer is no.
No. But as far as I'm aware, the player files and ItCo.dat are the only ones that contain hitbox data. Stage related hitboxes might be in the stage files, idk.
 

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
No. But as far as I'm aware, the player files and ItCo.dat are the only ones that contain hitbox data. Stage related hitboxes might be in the stage files, idk.
Well there are some stages that have had hazards removed, only changing the stage files, so that must be true. Can't think of a good example but there's one in SD Remix somewhere I'm sure.

edit: OH WAIT I JUST THOUGHT OF IT. There's a version of Onett with no cars and unless I'm mistaken, those are hitboxes.
 
Last edited:

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
No. But as far as I'm aware, the player files and ItCo.dat are the only ones that contain hitbox data. Stage related hitboxes might be in the stage files, idk.
Fairly certain they are. Every single stage handler for objects (which again, changes from entity to article depending on the stage item) has a comment like, "Exception: grcorneria.c!" or something like that. So, I'd assume all that data got packed into the associated file.
 

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
Hmm, I'm having an odd problem with the projectile hitboxes in the ItCo.dat file. It seems like the values used in game aren't actually tied to these hitbox values?

For a couple of the projectile hitboxes, I found where they were in memory using Dolphin and I was able to verify this by changing values. I modified the value for "damage" in each respective hitbox and it would properly update the amount of damage the projectile should deal.

Then I went to find these values in ItCo.dat for use with Crazy Hand. For each of the projectiles I looked up, I was able to find a single hitbox exactly matching the one I found in Dolphin. However, when I tried to edit the damage value for the hitbox from within ItCo.dat, it had no effect when I ran the game. The projectile still did default damage.

I then went back and checked the value where I had found it in dolphin originally, and found that this value was still set to the default damage too.

So unless I'm just doing something wrong or I'm misunderstanding something, it seems that ItCo.dat contains duplicates of every projectile's hitbox, but the actual values are stored somewhere else? Does anybody know what might be going on? I'm very confused.
 

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
This code straight up isn't working for me. I injected the code @8007168c, made sure it was on, and then added the code
Code:
F4 FF 02 07 3F 80 3F 80 3F 80 3F 80 3F 80 3F 80
to a subaction. What that should do is spawn a Mr. Saturn in the characters hand. In all the cases I've tried it either
A.) Didn't work, nothing happened
or with Ness's taunt,
B.) Crashed the game but made the "item get" noise before crashing.

Can someone help?

Entered as an injection mod, I don't know if it should have been a static overwrite or something else.


Code:
Spawn Projectile/Item
[Achilles]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x8007168c --- 80640008 -> Branch

C207168C 00000031
80A40008 88A50001
2C0500FF 40820170
7C0802A6 90010004
3821FF80 93E1006C
DBC10070 DBE10078
80A40008 90A10068
38C50010 90C40008
7C250B78 38A5FFFC
38C00000 38E00000
94C50004 38E70004
2C070064 40A2FFF4
90610008 9061000C
8063002C 8083002C
90810040 80A10068
88850002 548407FF
41820010 80831974
2C040000 408200DC
88850003 90810010
A0850004 B0810018
C3C10018 C3E3002C
FFDF07B2 C3E300B0
FFDEF82A D3C1001C
D3C10028 A0850006
B0810018 C3C10018
C3E300B4 FFDEF82A
D3C10020 D3C1002C
A0850008 B0810018
C3C10018 C3E3002C
FFDF07B2 D3C10034
A085000A B0810018
C3C10018 D3C10038
3C608026 60638B18
7C6803A6 7C230B78
38630008 4E800021
8063002C 80810068
A0A4000C B0A10018
80A10018 90A30038
88A40002 54A507FF
41820020 3CA08009
60A548A8 7CA803A6
80830004 80630518
4E800021 48000014
A0A4000E B0A10018
80A10018 90A30D44
83E1006C CBC10070
CBE10078 38210080
80010004 7C0803A6
4E800020 7C0802A6
60000000 00000000
 
Last edited:

Ampers

Smash Journeyman
Joined
Feb 2, 2015
Messages
237
Location
St. Louis, MO
This code straight up isn't working for me. I injected the code @8007168c, made sure it was on, and then added the code
Code:
F4 FF 02 07 3F 80 3F 80 3F 80 3F 80 3F 80 3F 80
to a subaction. What that should do is spawn a Mr. Saturn in the characters hand. In all the cases I've tried it either
A.) Didn't work, nothing happened
or with Ness's taunt,
B.) Crashed the game but made the "item get" noise before crashing.

Can someone help?

Entered as an injection mod, I don't know if it should have been a static overwrite or something else.


Code:
Spawn Projectile/Item
[Achilles]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x8007168c --- 80640008 -> Branch

C207168C 00000031
80A40008 88A50001
2C0500FF 40820170
7C0802A6 90010004
3821FF80 93E1006C
DBC10070 DBE10078
80A40008 90A10068
38C50010 90C40008
7C250B78 38A5FFFC
38C00000 38E00000
94C50004 38E70004
2C070064 40A2FFF4
90610008 9061000C
8063002C 8083002C
90810040 80A10068
88850002 548407FF
41820010 80831974
2C040000 408200DC
88850003 90810010
A0850004 B0810018
C3C10018 C3E3002C
FFDF07B2 C3E300B0
FFDEF82A D3C1001C
D3C10028 A0850006
B0810018 C3C10018
C3E300B4 FFDEF82A
D3C10020 D3C1002C
A0850008 B0810018
C3C10018 C3E3002C
FFDF07B2 D3C10034
A085000A B0810018
C3C10018 D3C10038
3C608026 60638B18
7C6803A6 7C230B78
38630008 4E800021
8063002C 80810068
A0A4000C B0A10018
80A10018 90A30038
88A40002 54A507FF
41820020 3CA08009
60A548A8 7CA803A6
80830004 80630518
4E800021 48000014
A0A4000E B0A10018
80A10018 90A30D44
83E1006C CBC10070
CBE10078 38210080
80010004 7C0803A6
4E800020 7C0802A6
60000000 00000000
The original code Achilles posted is a gecko code and can be loaded as-is in Dolphin using the cheat manager. When in doubt, it's usually safest to test it out this way first, because you don't need to worry about getting the right offset or changing anything.

In order to hardcode it into Start.dol as an inject, you need to remove the first line "C207168C 00000031". This line is only needed if you are loading it as a gecko code, because the branching of the inject handles this for you. I think this will cause crashes if not removed.
And you were correct: this mod is only an injection, there are no static overwrites in it.

Also I see a problem in the event you tested it with:
F4 FF 02 07 3F 80 3F 80 3F 80 3F 80 3F 80 3F 80

For the 3rd byte you have 0x02, but that flag should only be a 0x01 or a 0x00.
To give the item to the player, you should set it to 0x01.
Everything else in there looks correct. I plugged that data into the new build of CH as a projectile event and I didn't see anything else wrong.
 

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
The original code Achilles posted is a gecko code and can be loaded as-is in Dolphin using the cheat manager. When in doubt, it's usually safest to test it out this way first, because you don't need to worry about getting the right offset or changing anything.

In order to hardcode it into Start.dol as an inject, you need to remove the first line "C207168C 00000031". This line is only needed if you are loading it as a gecko code, because the branching of the inject handles this for you. I think this will cause crashes if not removed.
And you were correct: this mod is only an injection, there are no static overwrites in it.

Also I see a problem in the event you tested it with:
F4 FF 02 07 3F 80 3F 80 3F 80 3F 80 3F 80 3F 80

For the 3rd byte you have 0x02, but that flag should only be a 0x01 or a 0x00.
To give the item to the player, you should set it to 0x01.
Everything else in there looks correct. I plugged that data into the new build of CH as a projectile event and I didn't see anything else wrong.
Sorry, that 02 was a typo. Had it right before. Anyway, thanks, cause I'm really bad at this :p
 

Tater

Smash Journeyman
Joined
Apr 10, 2014
Messages
201
Location
Socal
NNID
Taternater
3DS FC
2406-5307-2936
Whenever I give a character an item the game just crashes, but when I spawn it as a projectile, it works just fine. A bit weird, but hey if it works it works.
There are a lot of factors behind successful spawning-- If the subaction you're using is a special move, its move logic may be interfering with the item being spawned. I think even some animations can cause issues with spawning.
 

WinterWonter

Smash Apprentice
Joined
Sep 13, 2015
Messages
101
Location
Louisiana (I wish I wasn't here)
NNID
mikael72202
3DS FC
5241-2891-3126
There are a lot of factors behind successful spawning-- If the subaction you're using is a special move, its move logic may be interfering with the item being spawned. I think even some animations can cause issues with spawning.
Yeah I feel like taunts are gonna be an issue. Kinda ducks cause that's what I wanted to use item spawning for (special taunts) but eh there are plenty of work arounds. Besides, I can just set the item next to the player. It's no biggie, I'm just glad we can spawn items now!
 
Top Bottom