Skip to content

[SUGOI] Remove skin->availability, add SECRET_SKIN

Sal requested to merge TehRealSalt/SRB2:skin-unlocks-sanity into next

Locked skins now are a unlockable type, instead of being tied to the skin's properties.

This has plagued custom gamedata mods since 2.2 launch. It's extremely obnoxious having to set aside random numbers as dummy unlockables just to ensure that Amy Fang & Metal are unlocked from the start in a custom map pack. Additionally, this now lets you lock Sonic Tails & Knuckles for mods. ADDITIONALLY, it lets you lock custom characters without fear of destroying things for other gamedata.

Other changes made to accommodate this:

  • R_GetSkinAvailabilities is now created from the list of unlockables set to skin type. (1st skin unlockable defined is (1), 2nd skin unlockable defined is (1 << 1), etc...)
  • The "Added skin x" print shows up when loading addons but not at all for the base game. The previous behavior of hiding based on if the skin was locked would now require iterating unlockables, which felt wrong to me to try and do during that stage of the loading process.
  • I noticed in my test wad that Sonic&Tails would give you Sonic&Sonic out if Tails was locked. I fixed that by making both skins required to show the character select option.

What this means for compatibility:

  • Vanilla SOC_SECR will need to change Amy Fang & Metal's unlockable types to "Skin", and var to the appropriate character name. The S_SKINs will need to be updated to remove the availability line.
  • Mods that reserved empty dummy unlockables for Amy Fang & Metal will remain compatible with no changes. This is what a majority of mapsets tend to do. They can safely remove these unlockables, but they also won't hurt anything.
  • Mods that accidentally went on top of Amy Fang & Metal's unlockables will pretty much receive a bug-fix, and no longer have the characters seemingly come from no-where.
  • Mods that intentionally wanted to re-lock Amy Fang & Metal behind different requirements using the specific unlockables will have to simply change their unlockable type & var.

EXE: srb2win_skin-unlocks-sanity.exe

Edited by Sal

Merge request reports

Loading