• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Request Projectile Iteration(?)

tatatat0

Smash Journeyman
Joined
Jan 28, 2015
Messages
412
I was wondering, since each projectile(spawned ingame) is likely its own object, could you say, edit a certain type of projectiles attributes on a systematic basis. Like for example, making all currently spawned mario's fireballs horizontal velocity reverse on a trigger like falcon taunting (or really anything). Pretty much what would happen
for each projectile in projectiles
if projectile.id == fireball_id
projectile.reverse()
Iterating through each projectile, checking if it is mario's fireball, and changing its attribute if it is.
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
We don't know of a function to walk the entity structs for item pointers. We can only get item pointers when they're spawned, which would mean we have to maintain a list of literally every move that uses them, then destroy them when the item is destroyed.

Otherwise, it's trivial to flip the velocity, I literally did it 5 minutes ago trying to figure this out.
 

tatatat0

Smash Journeyman
Joined
Jan 28, 2015
Messages
412
We don't know of a function to walk the entity structs for item pointers. We can only get item pointers when they're spawned, which would mean we have to maintain a list of literally every move that uses them, then destroy them when the item is destroyed.

Otherwise, it's trivial to flip the velocity, I literally did it 5 minutes ago trying to figure this out.
What if you placed their pointers somewhere ON spawning? ;)
 
Last edited:

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
What if you placed their pointers somewhere ON spawning? ;)
If we could do that, we could make any entity. It's really not possible, because the game allocates that at runtime plus it's referenced at least 5 other locations.

80BDA4A0 is always P1's entity struct in-game.
80BDA4A4 is always the first active item struct, like a Fireball. So we'd be walking the daisy chain of entity structs -> item data structs to do this. It's set to 00000000 when no struct is active. If any new structs are added, they're put in the daisy chain.

That's all someone needs to do this. It shouldn't be too awful, but I probably won't write the code.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
We don't know of a function to walk the entity structs for item pointers. We can only get item pointers when they're spawned, which would mean we have to maintain a list of literally every move that uses them, then destroy them when the item is destroyed.

Otherwise, it's trivial to flip the velocity, I literally did it 5 minutes ago trying to figure this out.
lwz r4, -0x3e74(r13)
lwz r26, 0x24(r4)

If zero, no projectiles/items/articles or whatever on screen.

If not zero, it's a pointer to item #1 on screen and every subsequent item on screen is daisy chained to item #1 by

lwz r27,0x8(r26)

If zero, then you're at the last spawned item on screen.
-------------

Same basic thing for characters.


lwz r4, -0x3e74(r13)
lwz r26,0x20(r4)

r26 holds pointer to first spawned character. Follow the 0x8 daisy chain until this value equals zero an you're at the last spawned character.

This is powerful.
@Punkline
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
80BDA4A0 is going to be the first allocated player. So, if you don't have P1, it's Pn.

I may've just discovered the most useful address ever.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
lwz r4, -0x3e74(r13)
lwz r26, 0x24(r4)

If zero, no projectiles/items/articles or whatever on screen.

If not zero, it's a pointer to item #1 on screen and every subsequent item on screen is daisy chained to item #1 by

lwz r27,0x8(r26)

If zero, then you're at the last spawned item on screen.
-------------

Same basic thing for characters.


lwz r4, -0x3e74(r13)
lwz r26,0x20(r4)

r26 holds pointer to first spawned character. Follow the 0x8 daisy chain until this value equals zero an you're at the last spawned character.

This is powerful.
@Punkline
If you look at the functions I labeled "Hitbox_...", you can see the game pulling these pointers at the beginning. It walks through these structs every frame of the game to check for collisions.
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
474
NNID
Psion312
If you look at the functions I labeled "Hitbox_...", you can see the game pulling these pointers at the beginning. It walks through these structs every frame of the game to check for collisions.
Ahh, I see that now.

I was just doing it with a RAM dump, since I'm probably going to write something to help me determine the remaining use of most of our Entity Structs.
 
Top Bottom