Invalid R_SkinUsable doesn't work for Players

[10:46 AM] HUE: @Zipper if i want to include the unlockable chars, i would need to check some flag for such thing?
[10:47 AM] Zipper: see that's the part where I can't help you
[10:47 AM] Zipper: cause I don't know
[10:47 AM] HUE: oof
[10:47 AM] Zipper: :lizPain:
[10:47 AM] HUE: let's go to wiki yey
[10:47 AM] HUE: oh wait
[10:47 AM] Zipper: the wiki doesnt have it
[10:47 AM] Zipper: that's why I don't know yet
[10:48 AM] Cassie (DerpyBubblez): You can't detect unlockable characters
[10:48 AM] Cassie (DerpyBubblez): You're supposed to be able to do so, but it doesn't work
[10:48 AM] HUE: it has to have some type of "unlocked thing flag" to be checked to do so
[10:48 AM] HUE: but we don't know what that is
[10:48 AM] SteelT: You can actually
[10:49 AM] HUE: oh rly?
[10:49 AM] HUE: could you gimme some help then?
[10:51 AM] Cassie (DerpyBubblez): SteelT: I sure would love to see how that works, because not even the character randomizer can detect unlockable characters
[10:51 AM] HUE: wait
[10:51 AM] HUE: not even RANDOMIZER?
[10:51 AM] HUE: oh boy
[10:51 AM] SteelT: The way it works is that you use R_SkinUsable(player_t player, int/string skin) to check if the skin is usable.
[10:51 AM] SteelT: Returns a boolean
[10:51 AM] Cassie (DerpyBubblez): That doesn't work
[10:51 AM] Cassie (DerpyBubblez): That will only work IF you select an unlockable character before hand
[10:52 AM] Cassie (DerpyBubblez): Even after unlocking ALL THREE, you still can't choose the character
[10:52 AM] HUE: i didn't even try cause this is 2.2, so i didn't know if it was working or not
[10:52 AM] Cassie (DerpyBubblez): I actually ran the randomizer from start up, and went to CEZ, and never got Fang Amy or Metal
[10:53 AM] HUE: that seems i've got a big problemo here
[10:53 AM] SteelT: What randomizer did you use
[10:53 AM] Cassie (DerpyBubblez): https://mb.srb2.org/showthread.php?t=45617
[10:54 AM] Cassie (DerpyBubblez): From what I understand, the check for unlockables is always false, until you select one
[10:55 AM] Cassie (DerpyBubblez): With my quick shitty character swap lua, it returned an error when attempting to switch to Amy, until I loaded an unlockable
[10:55 AM] Cassie (DerpyBubblez): Then I could switch to any of them
[10:58 AM] HUE: i can't have the smallest idea of what the problem is here
[10:59 AM] SteelT: that doesn't sound right
[10:59 AM] Cassie (DerpyBubblez): It does detect that I haven't unlocked Metal on a custom gamedata at least
[10:59 AM] SteelT: what's loaded an unlockable though
[11:00 AM] Cassie (DerpyBubblez): Select Amy/Fang/Metal on the Character Selection Screen
[11:01 AM] Cassie (DerpyBubblez): https://cdn.discordapp.com/attachments/357946927477948417/657990933291466784/quickswap.lua
[11:01 AM] HUE: so, let me get this straight
[11:01 AM] Cassie (DerpyBubblez): This is my bad lua that's supposed to switch between all characters
[11:01 AM] Cassie (DerpyBubblez): It barely works
[11:01 AM] HUE: it doesn't switch to any unlockable UNLESS you start the game with one
[11:02 AM] Cassie (DerpyBubblez): Yes
----------
[11:12 AM] SteelT: wait
[11:12 AM] SteelT: quickswap isn't even using R_SkinUsable
[11:12 AM] Cassie (DerpyBubblez): It's not
[11:12 AM] Cassie (DerpyBubblez): Character Randomizer is though
[11:12 AM] Zipper: nice
[11:13 AM] Cassie (DerpyBubblez): It rarely chooses Amy, but only for the Tails bot
[11:13 AM] Cassie (DerpyBubblez): Otherwise it's the original 3
----------
[11:23 AM] Cassie (DerpyBubblez): https://cdn.discordapp.com/attachments/357946927477948417/657996556519211029/srb20501.png
[11:23 AM] Cassie (DerpyBubblez): I think R_SkinUsable doesn't even apply to the bot actually
[11:24 AM] Cassie (DerpyBubblez): Amy/Fang/Metal show up on the bot in the randomizer, but not the player
[11:26 AM] Cassie (DerpyBubblez): https://cdn.discordapp.com/attachments/357946927477948417/657997235371376650/srb20502.png
[11:26 AM] Cassie (DerpyBubblez): R_SkinUsable properly applies to the bot, but not the player
[11:26 AM] Cassie (DerpyBubblez): So there's the root of the bug I guess


tl;dr "R_SkinUsable" works on the Single Player Bot, but not Players.
Edit: R_SkinUsable will ONLY run for the Bot in Sonic & Tails, so the Player is assumed to not have unlocked characters.
 
Last edited:
I don't wanna be the kind of dinkbutt that says "it works for me", but Character Diceroll v2.0 (which is mentioned in the discord log) was the test case for R_SkinUsable's exposure to Lua, and it doesn't fail there like what you're describing. To help track down the cause of this bug, it would be helpful if you could compare the mechanics of how the skin is set in your script with mine - preferably with a public exposure of your code?
 
Last edited:
If you look at the gif I have provided, there is not even a single frame where the Player turns ito an unlockable chaacter.
The Bot does change into unlockable characters.
If the player selects an unlockable character (before choosing a regular character), then the randomizer will allow you to switch into an unlockable character.


I don't want to be a dinkbutt either, but this is my conclusion based on my experience.
 

Attachments

  • srb20032.gif
    srb20032.gif
    1.3 MB · Views: 153
Does not behave like that for me with an all-characters-but-not-100%-savedata. The only parameter I can think of as different on my end to yours - have you set a default skin/colour in the multiplayer character select menus? If not, set one and try again. If that parameter causes things to behave as they do in my copy of the game, that narrows things down a little.
 
I have Amy with the color Rosy set in multiplayer.
Edit: I checked with the non-100% save I have, and achieved the same result.


Edit 2: Okay, I've actually figured out the issue. R_SkinUsable will ONLY run for the Bot in Sonic & Tails, so the Player is assumed to not have unlocked characters.
 
Last edited:
Again, that doesn't make sense; I was the one who wrote both the Unlockable Character code for the game and Character Diceroll, and there's nothing that checks for bots in R_SkinUsable directly. Are you saying that the script you've been working on didn't check R_SkinUsable for non-bots?
 
Last edited:
If I load the diceroll script with Sonic & Tails, then only the bot can be one of the unlockable characters (without selecting one previously).
If I load the diceroll script with Sonic alone, then it can choose one of the unlockable characters.
 
Please upload your gamedata.dat and config file, because I cannot recreate this issue on my own.
 
gamedata.dat is all characters

gamedata.dat.new is 100%
windows.cfg is the config.cfg


Windows.cfg is being used with th "-config windows.cfg" parameter.
I have tried with both ficklecam and unmodified SRB2, so that should be a non-issue.
 

Attachments

  • Requested.zip
    3 KB · Views: 115
Using both windows.cfg and your gamedata.dat, I cannot recreate this issue, even when using a launcher.
 
Update: I ran SRB2 on my Chromebook (my final option) and it works. No "Error skin 6 not found" and diceroll selects the unlockables.
This happened on two of three computers and they were all under the same ruleset.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top