Is re mapping the superform possible?

I have been trying my hardest, but I can't seem to do it, spin makes it through, and my remapping ventures don't seem to change anything, any ideas on how to do this?
 
I have been trying my hardest, but I can't seem to do it, spin makes it through, and my remapping ventures don't seem to change anything, any ideas on how to do this?
When the player meets the Superform emeralds condition, disable the SF_SUPER skin flag. Once the player has enough rings and presses the desired button in its jump state, re-add the previously mentioned flag and use P_DoSuperTransformation(player_t) to transform the player.

Here's a bit of code made by me, which remaps the button to TOSS FLAG just for Sonic and, as an extra, requires you to collect 25 rings instead of 50. Literally everything has comments so you can understand every line!
Super edits:
local skin_name = "sonic" // The name of the character! Use "all" to affect any skin.
local super_rings = 25 // How many rings we need to be Super?
local super_button = BT_TOSSFLAG // What button we'll use to go Super?

addHook("PlayerThink", function(player) // PlayerThink runs every frame as long as there's at least one player in the level
    if player.mo        // Do we exist?
    and player.mo.valid //
    and player.mo.health // Are we alive?
    and not (player.pflags & PF_THOKKED) // We aren't using any ability?
    and not player.powers[pw_super] // No Super Saiyans!
    and skins[skin_name].flags & SF_SUPER // Can go Super?
    and All7Emeralds(emeralds) // We have all the 7 funny rocks? (Singleplayer/Co-op)

    and ((skin_name != "all" // If we setted an specific character...
    and player.mo.skin == skin_name) // ...check if we're using that character
    or skin_name == "all") // Else, if we setted "all", this will affect any character

        player.charflags = $ & ~SF_SUPER // Can't be Super :knuxsmug:

        if player.pflags & PF_JUMPED // We've jumped?
        and player.cmd.buttons & super_button // Pressing our Super button?
        and not P_IsObjectOnGround(player.mo) // We are NOT on grounded?
        and player.rings >= super_rings // We have the required amount of rings?
            player.charflags = $|SF_SUPER // u can be supah :>
            P_DoSuperTransformation(player) // SUPERRRR TRANSFORMATIONNNN!!!!!!!!
        end
    end
end)

If you have any trouble with my little code, notify me. Good luck with your project!
 
Last edited:

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

Back
Top