Hitboxes Affecting All Characters With Same BaseID

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

ByTheBookGames
Fighter Fly
Fighter Fly
Posts: 36
Joined: Tue Jun 04, 2019 8:35 pm

Hitboxes Affecting All Characters With Same BaseID

Postby ByTheBookGames » Mon Oct 21, 2019 3:00 pm

I've come across this problem while testing in 2player mode. If a custom character uses the same baseID as the other player's character, and if that custom character's hitbox and/or offsets are different than the base character, then the other character's hitboxes and offsets are changed as well. I'm trying to figure out how to fix that, if it's fixable.

Here's an example. For a custom character "koopatroopa" that uses baseID 1, if player 1 is koopatroopa and player 2 is mario this happens:

Image
Mario's hitboxes have been unintentionally changed because the character ID "1" has been changed when koopatroopa was loaded.

I've combed through the "playermanager" and "character" scripts (note I'm using SMBX2, not PAL), but it looks like there isn't any way of altering an individual character's hitbox without altering the hitbox of the base character. I'm guessing that creating new baseIDs is impossible because they aren't in the original game, correct? Ideally, I'd be able to have custom characters still use those 5 bases for their physics, etc., but have their .ini files only apply to themselves. I also thought that I could just manually change the height/width of custom characters in their scripts using player.height/player.width, but this wouldn't fix the offsets and it glitches when I try that anyway (changing the height causing the character to skyrocket upwards).

Any ideas on a solution for this? Help is appreciated but not expected. Thanks

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Hitboxes Affecting All Characters With Same BaseID

Postby Emral » Mon Oct 21, 2019 3:14 pm

yeah 2 player mode with new characters is currently not supported

ByTheBookGames
Fighter Fly
Fighter Fly
Posts: 36
Joined: Tue Jun 04, 2019 8:35 pm

Re: Hitboxes Affecting All Characters With Same BaseID

Postby ByTheBookGames » Mon Oct 21, 2019 4:50 pm

Enjl wrote:
Mon Oct 21, 2019 3:14 pm
yeah 2 player mode with new characters is currently not supported
Thanks for your response. Would you mind explaining a bit of how the custom characters work within Lua? I don't mind developing support for this myself if I have enough direction to work with. Am I right in assuming that custom characters are basically standard characters with graphic changes and extra code? I.e., in the above example, koopatroopa changes mario's hitboxes because in reality they're both mario? There's no way to actually create a new character beyond the original five, which is why custom characters automatically share the same hitbox as the original ones, right?

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Hitboxes Affecting All Characters With Same BaseID

Postby Hoeloe » Mon Oct 21, 2019 7:18 pm

It's unfortunately not a lua-side issue. It's to do with how SMBX internally handles hitboxes, and yes currently every new character is tied to one of the original five such that they share a hitbox. This is something we're planning to fix in beta 5.

ByTheBookGames
Fighter Fly
Fighter Fly
Posts: 36
Joined: Tue Jun 04, 2019 8:35 pm

Re: Hitboxes Affecting All Characters With Same BaseID

Postby ByTheBookGames » Mon Oct 21, 2019 8:02 pm

Hoeloe wrote:
Mon Oct 21, 2019 7:18 pm
It's unfortunately not a lua-side issue. It's to do with how SMBX internally handles hitboxes, and yes currently every new character is tied to one of the original five such that they share a hitbox. This is something we're planning to fix in beta 5.
Let me know if this is outside the scope of a forum like this, but how do you go about changing internal aspects of the game like that? This has come up elsewhere in discussions, like changing the input system to allow for more than 2 players. Don't internal changes to the game mess with the memory addresses, too?

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Hitboxes Affecting All Characters With Same BaseID

Postby Hoeloe » Mon Oct 21, 2019 10:01 pm

The internal changes are mostly done via ASM hooks and C++ code, which patches in the Lua environment. Most of the behavioural changes occur in C++, and since the rest is direct ASM hacking, it doesn't require recompiling the code which means memory addresses stay the same.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 30 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari