how do you make a custom character

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Knitted_Egg
Bit
Bit
Posts: 68
Joined: Mon Aug 22, 2022 5:13 pm
Flair: i am better obviously
Pronouns: he/him

how do you make a custom character

Postby Knitted_Egg » Sun Sep 18, 2022 3:54 pm

hello I want to make a character that is similar to mario but is slower and can do a double jump but how do I make a custom character? I know there is custom character blocks but I just want to make a custom character.

deice
Volcano Lotus
Volcano Lotus
Posts: 549
Joined: Fri Jul 23, 2021 7:35 am

Re: how do you make a custom character

Postby deice » Sun Sep 18, 2022 4:11 pm

if you just want mario but slower and with a double jump, you actually don't need a completely custom character.
the player's speed cap can be controlled by "Defines.player_runspeed" and "Defines.player_walkspeed" (though the latter cap won't apply to any manual speed boosts that the player receives)
as for double jump, i believe there's a library for it on the wohsoft forums but it might be outdated. in any case, it shouldn't be too hard to implement if you know how to use events and player memory offsets; also maybe taking a look at the source code would help with figuring the physics out. (at any rate it's much much easier to do than creating an entire new character)

LooKiCH
Tweeter
Tweeter
Posts: 159
Joined: Tue Jun 13, 2017 11:28 am
Pronouns: he/him
Contact:

Re: how do you make a custom character

Postby LooKiCH » Sun Sep 18, 2022 4:17 pm

for double jump create local variable and use "function onKeyDown(k)", "player.speedY", "SFX.play(1)" and "if k == KEY_JUMP or k == KEY_SPINJUMP then"

Marioman2007
Lakitu
Lakitu
Posts: 466
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: how do you make a custom character

Postby Marioman2007 » Sun Sep 18, 2022 9:29 pm

LooKiCH wrote:
Sun Sep 18, 2022 4:17 pm
for double jump create local variable and use "function onKeyDown(k)", "player.speedY", "SFX.play(1)" and "if k == KEY_JUMP or k == KEY_SPINJUMP then"

A better approach would be:

Code: Select all

function onInputUpdate()
    if player.keys.jump == KEYS_PRESSED or player.keys.altJump == KEYS_PRESSED then
        -- do stuff
    end
end


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari