Allow mods to add characters and palettes to the player menu, more#1120
Allow mods to add characters and palettes to the player menu, more#1120EmeraldLoc wants to merge 20 commits intocoop-deluxe:devfrom
Conversation
…reset palette, and name immutable
…cy, made `CT_MAX` deprecated
|
having an issue where when a player other than oneself attempts to use a character with custom sfx, when those sfx should play the console gets spammed with errors: |
|
Uh oh, that doesn't sound good! What does your implementation look like? |
i used your example as a base and just repurposed this character i already had for a test |
|
Your implementation looks good. What's being printed to the console? Are you hosting with any other mods? |
|
I was able to reproduce the issue, and it's quite an annoying one. Will take a bit to fix, but have an idea in mind for doing so. |
|
Issue should be fixed now |
|
the issue is fixed but a new observation: when a character plays custom sounds they dont cancel out the previous character sound when the next one plays (as mario himself typically does) so the previous sound will continue playing and the new sound will play over the previous. if you fix this, likely you will then run into the classic issue of it being impossible to initialize individual unique miniaudio sounds. consequently, any two people playing the same character will kill eachothers samples when they begin new actions since you cant make unique instances of existing loaded modaudio |
|
It's so peak |
|
K, this is pretty much feature complete for the most part. Any recommendations, requests, or bug reports are welcomed here still. Did a lot of testing today and everything appears to be working good.
As you point out later in your comment, yea, this is one hell of a "bug" to fix. I won't be fixing it in this pr unless it doesn't get merged because of it, as it'll require a LOT of work to get it working properly, and a lot of refactoring, so it's kind of outside the scope of this pr (but technically within scope). |
|
As of writing I'm on latest commit and I can't seem to get |
|
I don't see Character Select as necessary as it once was anymore with this new PR for a built-in character API. |
|
Try staying on topic next time |
Characters
Characters can now be added and modified. You can view more details about the functions I'm about to outline in the documentation.
character_allocate(const char* name), which takes in a name, and returns aCharacterand character index.character_get_first_allocated_index(),character_get_first_unallocated_index(),character_get_first_allocated(), andcharacter_get_first_unallocated()get_allocated_character_from_index(int i), which will attempt to get the allocated character at the index, but if it fails, it gets the first allocated character usingcharacter_get_first_allocated().get_character(struct MarioState* m), which gets the character that the passed inMarioStateis usingget_modded_character_anim_string, which gets the current name of the animation used if the animation is moddedcharacter_set_namecharacter_set_cap_enemy_gfx_name, for the cap on a enemy head like ukikicharacter_set_cap_enemy_decal_gfx_name, same above but for decalcharacter_set_hud_head_texturecharacter_add_soundcharacter_remove_soundscharacter_set_animationcharacter_remove_animationCT_MAXin favor ofCT_COUNTMarioState'scharacterPalettes
Palettes can now be added to the selector!
preset_palette_allocate, which takes in a name, and returns aPresetPalette.preset_palette_set_name, which sets the name of aPresetPalettepreset_palette_set_color_of_part, which sets the part of aPresetPaletteMisc Changes
convert_structs.pyto use the*symbol to make multiple fields immutable, mutable, invisible, etc.smlua_anim_util_animation_existssmlua_anim_util_animation_exists_using_indexsmlua_anim_util_get_index_from_namesmlua_anim_util_get_name_from_indexAnd of course, there's a lot more stuff under the hood not documented here. I tried to get it all, but some things may be missing. Any and all suggestions and/or critiques are welcomed.
Tons of testing still needs to be done, and some syncing stuff still needs to be addressed.