• 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

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
I got non-destructive subaction event inserts to work last night and had some fun with your subaction event Achilles1515 Achilles1515 . I made Unown (pokemon, not the projectile) spawn before every hitbox, and it would pretty easily freeze the game; but sometimes not before the end of the world happened:


I think characters have a hitbox event when they take damage? sometimes? It causes a funny feedback loop that felt a bit like the gray goo scenario. Of course, this is REALLY easy to freeze the game with

Anyway, I think I've just figured out how to make event skips work smartly with this insert code, and have a prototype code you guys can use to play around with Achilles' code really easily @WinterWonter :

$SAevent Scheduler v0.0.1 [Punkline]
C20732AC 0000004E
48000004 38000000
48000029 7F0802A6
3B18000C 480000D8
012C0045 F4FF002F
40004010 3F804000
3F804348
03000000
2C000000 40820024
7C000026 3821FFDC
D8010000 D8210008
D8410010 90010018
9061001C 90810020
3821FFF0 92A10000
92C10004 92E10008
9301000C 4E800020
2C000000 82A10000
82C10004 82E10008
8301000C 38210010
40820020 C8010000
C8210008 C8410010
80010018 8061001C
80810020 38210024
4E800020 80040000
3884FFFC 90010000
3821FFFC 3863FFFF
2C030000 4181FFE8
4E800020 80010000
38210004 90040000
38840004 3863FFFF
2C030000 4181FFE8
4E800020 7F17C378
3AA00000 88170000
2C000000 41820158
2C000003 41820158
C01D0000 C0228874
FC000840 88770001
40810014 5460039D
4082000C 3AA00002
48000040 546003DF
5463041A 98770001
4182000C 3AA00001
48000028 88170000
2C000002 4182FFD8
809D0008 88840000
5484063A 88770001
7C032000 4082FFC0
3AC00004 2C150002
7EC3B378 82D70000
7EE3BA14 418200CC
56C3E73F 4182009C
809D0008 3884FFFC
4BFFFF1D 38840004
7C350B78 7EE1BB78
56C3E73E 4BFFFF29
7EA1AB78 3821FFFC
56C3F6BA 7C832050
909D0008 88840000
5484F6BE 2C04000A
5484103E 4080001C
3C60803C 606367C0
7C632214 7C6803A6
7FA3EB78 4800001C
3804FFD8 7C7F0214
80630000 7C6803A6
7FA4EB78 387DFBBC
4E800021 38210008
56C3F6BA 809D0008
7C832050 5463F03E
4BFFFEB5 3821FFFC
56C316BB 41820024
809D0008 7C832214
909D0008 88840000
5484063A 56C3863A
7C032000 4182FEA8
56C3F6BA 7EE3BA14
4BFFFEA0 3AF70004
4BFFFE98 38000000
4BFFFE11 7C0FF120
801D0008 00000000

I've highlighted the insert event in red, so just use Achilles' specifications in his OP to play around with it. This is kind of a chopped up version of a bigger code I'm working on that will give this programmable logic and the ability to run programmable subroutines. At the moment it uses the input line (highlighted in yellow) to determine what event to search for, how big of an event to insert, and how big of an event to skip.

If you're feeling brave, you can use the specifications from my earlier post without the BB features to explore this a bit, but keep in mind I'm still debugging it and it's not capable of any filtering as it is. Things as simple as non-existent bone IDs in hitbox inserts will cause the game to crash. I'll be making a development thread for it soon, where I'll be adding features that make dealing with such problems very trivial.

You can make edits to this input line mid-game to experiment with different projectile IDs, behaviors when holding/launching, and velocities/offsets for Achilles' projectile subaction by following the branch that the c2 code here makes at 0x800732AC, copying the address you land at, and entering it into the memory panel. From there you can find "F4FF002F" in the hex and just alter it with the "set value" button. I actually prefer using cheat engine's Memory Viewer, because it resembles a hex editor and makes edits a lot faster @Ampers @Tater

Alternatively, you can do this to Crazy Hand edits by following the pointer at player.0x44C during a subaction that you've edited

---

Also, it'd be pretty sweet if we could figure out this projectile hitbox business. I have about ZERO experience with the .dat files, though Achilles was trying to give me a tasty hint in another thread about functions sometimes referencing an area in memory that apparently matches an offset from the PlCo.dat... Feel free to suggest any reading material if you think I could help. I've already got my eye on a few threads I've been meaning to read through.
 
Last edited:

tatatat0

Smash Journeyman
Joined
Jan 28, 2015
Messages
412
Nice work. Does anyone have where Link and Young link's boomerang hitbox offsets are?
 
Last edited:

Gun.Rugger

Smash Cadet
Joined
Jan 2, 2016
Messages
26
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.
Hey, all. Sorry for the necro-post here on this quiet thread, but can someone please give me the ELI5 on this post? Also, disclaimer: I am super noob :p

I have been messing with crazy hand and have successfully gotten the self healing sub-action to work (used it for Young Link's taunt)
Now I am trying to get Mario's taunt to give him a power mushroom. So far using the Custom Subaction Event - Projectile/Item Spawn I can give my opponent the mushroom effect (which is pretty hilarious) even when using the "launch projectile". It makes a mushroom, I grab that mushroom, and the opponent gets buffed haha.

For science I am trying to use the code posted by @Tater to activate the metal effect (I figure that will get me one step closer to the desired effect). Following this logic, I have put the following codes in as subaction data:
80 0C 83 48 - 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 - The function that applies metal physics to a character. (Once again, found with wParam's notes.)

I have tried putting the values into crazy hand like so:
http://imgur.com/3FsYRwR
I have tried using the hex editor, clearing out the attack data and putting only the code in like so:
http://imgur.com/JZNz38m
I have tried using the converter in the Melee Code Manager, but I don't really know what I'm doing, and I presume that that converter is used for making gecko codes out of memory addresses somehow. Not confirmed. Any help on this would be rad.
 
Last edited:

The Cape

Smash Master
Joined
May 16, 2004
Messages
4,478
Location
Carlisle, PA
So I looked at this and made Ganon summon a sword into his hand during his taunt. Is there a way to make the item disappear as soon as Ganon lets go of it, so he can't throw it? Tried the duration to no avail.
 

PikaSwag

Smash Rookie
Joined
Dec 26, 2016
Messages
16
I Inserted the gecko code and added a subaction that spawned a projectile (Chikorita's leaf) on luigi's neutral b. Melee loads but the game crashes as soon as i use neutral b. did i do something wrong?
 

AAAAAA

Smash Cadet
Joined
Aug 24, 2016
Messages
49
Hey, all. Sorry for the necro-post here on this quiet thread, but can someone please give me the ELI5 on this post? Also, disclaimer: I am super noob :p

I have been messing with crazy hand and have successfully gotten the self healing sub-action to work (used it for Young Link's taunt)
Now I am trying to get Mario's taunt to give him a power mushroom. So far using the Custom Subaction Event - Projectile/Item Spawn I can give my opponent the mushroom effect (which is pretty hilarious) even when using the "launch projectile". It makes a mushroom, I grab that mushroom, and the opponent gets buffed haha.

For science I am trying to use the code posted by @Tater to activate the metal effect (I figure that will get me one step closer to the desired effect). Following this logic, I have put the following codes in as subaction data:
80 0C 83 48 - 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 - The function that applies metal physics to a character. (Once again, found with wParam's notes.)

I have tried putting the values into crazy hand like so:
http://imgur.com/3FsYRwR
I have tried using the hex editor, clearing out the attack data and putting only the code in like so:
http://imgur.com/JZNz38m
I have tried using the converter in the Melee Code Manager, but I don't really know what I'm doing, and I presume that that converter is used for making gecko codes out of memory addresses somehow. Not confirmed. Any help on this would be rad.
I dont think you need a gecko code. i put 800D170C into falcons down b in 'action physics'. did you try putting it there?
 

Gun.Rugger

Smash Cadet
Joined
Jan 2, 2016
Messages
26
I dont think you need a gecko code. i put 800D170C into falcons down b in 'action physics'. did you try putting it there?

Thanks, AAAAAA AAAAAA .

That totally worked for Capon Falctain's Down-B. Thank you. Do you have any ideas on how to apply this same general effect to mario's taunt? Move logic for mario is not available (see: https://smashboards.com/threads/cra...-editing-program.389500/page-30#post-21463988), and I can't seem to find a subaction event that will accomplish it. Thanks again for the help.
 

AAAAAA

Smash Cadet
Joined
Aug 24, 2016
Messages
49
Thanks, AAAAAA AAAAAA .

That totally worked for Capon Falctain's Down-B. Thank you. Do you have any ideas on how to apply this same general effect to mario's taunt? Move logic for mario is not available (see: https://smashboards.com/threads/cra...-editing-program.389500/page-30#post-21463988), and I can't seem to find a subaction event that will accomplish it. Thanks again for the help.
While i didnt find an answer for this, i found something that might help. If you open up start.dol in a hex editor, you can find a characters move logic, but you would need to know what the flags are for a move. The porblem here is is that you dont know any of that for mario's taunt.
 

Sour-Slug

Smash Rookie
Joined
Jan 22, 2018
Messages
10
Hey I have been trying to get this to work for a while, new to this sort of thing. (also sorry if I should have asked this somewhere else). (using dolphin with fresh iso)

I finally got some things to spawn, but most projectiles crash or freeze the game. for example, I just edited Fox's jab for testing and had it set to spawn his laser. one spawns in fine (has no hitbox) and when attempting to spawn in another the game crashes. trying to spawn Samus's charge-shot also causes a freeze. even when she is in the game, which I would assume it loads her data in.

Just wanted to know if I did something wrong or if it is just finicky. also a note, most things spawned in seem to not have any hitboxes, have not tried with everything.
 

TheSocialZombie

Smash Cadet
Joined
Jun 25, 2017
Messages
49
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 @Tater @MagicScrumpy @TheDankbanker
Where is the homerun bat?
 

Master Kirby

Smash Rookie
Joined
Nov 24, 2018
Messages
10
Location
Venezuela
I got non-destructive subaction event inserts to work last night and had some fun with your subaction event Achilles1515 Achilles1515 . I made Unown (pokemon, not the projectile) spawn before every hitbox, and it would pretty easily freeze the game; but sometimes not before the end of the world happened:


I think characters have a hitbox event when they take damage? sometimes? It causes a funny feedback loop that felt a bit like the gray goo scenario. Of course, this is REALLY easy to freeze the game with

Anyway, I think I've just figured out how to make event skips work smartly with this insert code, and have a prototype code you guys can use to play around with Achilles' code really easily @WinterWonter :

$SAevent Scheduler v0.0.1 [Punkline]
C20732AC 0000004E
48000004 38000000
48000029 7F0802A6
3B18000C 480000D8
012C0045 F4FF002F
40004010 3F804000
3F804348
03000000
2C000000 40820024
7C000026 3821FFDC
D8010000 D8210008
D8410010 90010018
9061001C 90810020
3821FFF0 92A10000
92C10004 92E10008
9301000C 4E800020
2C000000 82A10000
82C10004 82E10008
8301000C 38210010
40820020 C8010000
C8210008 C8410010
80010018 8061001C
80810020 38210024
4E800020 80040000
3884FFFC 90010000
3821FFFC 3863FFFF
2C030000 4181FFE8
4E800020 80010000
38210004 90040000
38840004 3863FFFF
2C030000 4181FFE8
4E800020 7F17C378
3AA00000 88170000
2C000000 41820158
2C000003 41820158
C01D0000 C0228874
FC000840 88770001
40810014 5460039D
4082000C 3AA00002
48000040 546003DF
5463041A 98770001
4182000C 3AA00001
48000028 88170000
2C000002 4182FFD8
809D0008 88840000
5484063A 88770001
7C032000 4082FFC0
3AC00004 2C150002
7EC3B378 82D70000
7EE3BA14 418200CC
56C3E73F 4182009C
809D0008 3884FFFC
4BFFFF1D 38840004
7C350B78 7EE1BB78
56C3E73E 4BFFFF29
7EA1AB78 3821FFFC
56C3F6BA 7C832050
909D0008 88840000
5484F6BE 2C04000A
5484103E 4080001C
3C60803C 606367C0
7C632214 7C6803A6
7FA3EB78 4800001C
3804FFD8 7C7F0214
80630000 7C6803A6
7FA4EB78 387DFBBC
4E800021 38210008
56C3F6BA 809D0008
7C832050 5463F03E
4BFFFEB5 3821FFFC
56C316BB 41820024
809D0008 7C832214
909D0008 88840000
5484063A 56C3863A
7C032000 4182FEA8
56C3F6BA 7EE3BA14
4BFFFEA0 3AF70004
4BFFFE98 38000000
4BFFFE11 7C0FF120
801D0008 00000000

I've highlighted the insert event in red, so just use Achilles' specifications in his OP to play around with it. This is kind of a chopped up version of a bigger code I'm working on that will give this programmable logic and the ability to run programmable subroutines. At the moment it uses the input line (highlighted in yellow) to determine what event to search for, how big of an event to insert, and how big of an event to skip.

If you're feeling brave, you can use the specifications from my earlier post without the BB features to explore this a bit, but keep in mind I'm still debugging it and it's not capable of any filtering as it is. Things as simple as non-existent bone IDs in hitbox inserts will cause the game to crash. I'll be making a development thread for it soon, where I'll be adding features that make dealing with such problems very trivial.

You can make edits to this input line mid-game to experiment with different projectile IDs, behaviors when holding/launching, and velocities/offsets for Achilles' projectile subaction by following the branch that the c2 code here makes at 0x800732AC, copying the address you land at, and entering it into the memory panel. From there you can find "F4FF002F" in the hex and just alter it with the "set value" button. I actually prefer using cheat engine's Memory Viewer, because it resembles a hex editor and makes edits a lot faster @Ampers @Tater

Alternatively, you can do this to Crazy Hand edits by following the pointer at player.0x44C during a subaction that you've edited

---

Also, it'd be pretty sweet if we could figure out this projectile hitbox business. I have about ZERO experience with the .dat files, though Achilles was trying to give me a tasty hint in another thread about functions sometimes referencing an area in memory that apparently matches an offset from the PlCo.dat... Feel free to suggest any reading material if you think I could help. I've already got my eye on a few threads I've been meaning to read through.
How did you do it?! I also want that the same as you did but with Moltres, and the only question is how is it done? How do I put it? Where do I add it?

PSD: I am using Crazy Hand v1.31 and it has the Custom Spawn Projectile option and I was going to add that in Kirby's 'Jab 1' in "Subactions (attacks only)" so add it and replace the Hitbox (20 bytes) with Spawn Projectile (16 bytes) then Crazy Hand revealed it to me with several reports such as: launch projectile, size scaling, X and Y Velocity, X and Y Offset and Duration.

So there add: A7 Moltres, Duration: 250, X and Y Velocity: 1, X and Y Offset: 5 and "launch projectile" (occasionally there is the option to 'give projectile to player' but I don't know what it means but anyway I also tried that method).

Once I finished all that in 'jab 1' in Kirby I saved and closed Crazy Hand because I already gave it the 'save' option then I opened the Dolphin and opened my ISO and it turns out when I select Kirby and I do with Jab 1, NO DOES NOTHING! OR NOTHING COMES OUT, what's more, if I edited everything necessary for Moltres to come out in that mov. attack for Kirby but it turns out Moltres doesn't appear on stage! And not only that I tried with more attacks that Kirby uses as 'Forward Smash', 'Forward Tilt', 'Dash Attack', 'Up Smash', 'Down Smash' among others and IT IS THE SAME STILL NOT THE PROJECTILE I ADDED, But I still need a lot of help on how to add a projectile to each character move (100% EXPLAINED). If someone does, I would appreciate it VERY MUCH for this explanation and very hard work they have done. Good Luck!

--------------------------------------------------------------------

2022 Edit:

At the end of 2021, I now know how that code works, I was totally wrong. Sorry for my emotions, at that time (2020) I was very nervous about how to program...

But well, that thing is learned little by little XD
 
Last edited:
Top Bottom