Page 1 of 1

[LunaLua] Peach Flying

Posted: Thu May 28, 2015 12:55 pm
by DarkShadeX
Found this old code while removing stuff from my hard drive.
This Script basically allows Peach to fly while she's in her racoon form like Mario and Co.
Before i remove this code from the hard drive,i aswell just release it here.

Code: Select all

-- SMBX - Peach flying Script by DarkShadeX
 
-- 0x1C = Princess hover timer
-- 0x16E = Is flying
-- 0xF0 = Player identity index (0 = nothing! don't use, 1 = demo, 2 = iris, 3 = princess, 5 = sheath)
local fly_lenght = 80 -- How long you can fly,adjust it so its perfect for you ;)
local remaining_fly = fly_lenght
 
function onLoop()
 
        printText("RUNNING "..tostring(remaining_fly).." FRAMES", 30, 60)
 
        -- If you Hover,prevent that you can fly:
        if( player:mem(0x1C,FIELD_WORD) >= 1 )then
                remaining_fly = 0
        end
 
        -- Check if Stuff ... :
        if( player:mem(0x1C,FIELD_WORD) == 0 and player.speedY ~= 0 and remaining_fly >= 0 and player:mem(0xF0,FIELD_WORD) == 3 and player.speedX >= 5.55 and player.powerup == PLAYER_LEAF)then
                player:mem(0x16E,FIELD_WORD,-1) -- LET THE FLY BEGIN :>
                remaining_fly = remaining_fly - 0.25  -- Reduce our flying timer.
        end
        -- Check if Stuff ... LEFT :
        if( player:mem(0x1C,FIELD_WORD) == 0 and player.speedY ~= 0 and remaining_fly >= 0 and player:mem(0xF0,FIELD_WORD) == 3 and player.speedX <= -5.55 and player.powerup == PLAYER_LEAF)then
                player:mem(0x16E,FIELD_WORD,-1) -- LET THE FLY BEGIN :>
                remaining_fly = remaining_fly - 0.25  -- Reduce our flying timer.
        end
        -- End the Flying:
        if( remaining_fly <= 1 )then -- If you don't have any flying timer anymore...
                player:mem(0x16E,FIELD_WORD,0) -- Stop the Flying.
        end
 
        -- Extra Fixes:
        if( remaining_fly <= fly_lenght and player:mem(0x16E,FIELD_WORD) == -1 )then -- So the counter doesnt stop if you change the direction ;)
                remaining_fly = remaining_fly - 0.25
        end
end
 
function onJumpEnd()
        remaining_fly = fly_lenght -- Reset the counter if you fall.
end

Re: [LunaLua] Peach Flying

Posted: Thu May 28, 2015 1:11 pm
by h2643
So that hidden flying Peach frame can finally be used with this code... thank you!

Re: [LunaLua] Peach Flying

Posted: Thu May 28, 2015 9:11 pm
by MECHDRAGON777
h2643 wrote:So that hidden flying Peach frame can finally be used with this code... thank you!
Should I also release he fixed Peach Sprite that goes with this? [that hidden frame is broken. it is the exact same thing three times...] I used this code in a contest!

Re: [LunaLua] Peach Flying

Posted: Fri May 29, 2015 3:55 am
by Wohlstand
If you will use cheat code "wingman", Peach will fly like Mario natively (but with unlimited time due this cheat code), even will be used special frames! The purpose is make this thing available even without cheat

Re: [LunaLua] Peach Flying

Posted: Fri May 29, 2015 11:24 am
by FanofSMBX
I hope you make more awesome codes like this. :)

Re: [LunaLua] Peach Flying

Posted: Sat May 30, 2015 9:09 pm
by MECHDRAGON777
Wohlstand wrote:If you will use cheat code "wingman", Peach will fly like Mario natively (but with unlimited time due this cheat code), even will be used special frames! The purpose is make this thing available even without cheat
Yeah! And the fact that the sprites is the same is not fun either! (I have the fixed version of the default Peach)

Re: [LunaLua] Peach Flying

Posted: Thu Jun 16, 2016 2:48 pm
by Creepermon
Is it possible to give her a spinjump as well?

Re: [LunaLua] Peach Flying

Posted: Thu Jun 16, 2016 4:07 pm
by MECHDRAGON777
Creepermon wrote:Is it possible to give her a spinjump as well?
I did it in my Kaizo contest level that got fourth place. The episode comes out soon by PixelPest. Ask
bossedit8 wrote:
to give you the code since I gave it to him a while ago.

Edit: looking through my sent PMs to bossedit, I found this.

Peach Spin-jump

Code: Select all

function onInputUpdate()
    if player.altJumpKeyPressing == true and player:mem(0x12E, FIELD_WORD) == 0 and (player:mem(0x146, FIELD_WORD) ~= 0 or player:mem(0x48, FIELD_WORD) ~= 0 or player:mem(0x176, FIELD_WORD) ~= 0) then
        player:mem(0x50, FIELD_WORD, -1)
        local myTailSound = Audio.SfxOpen("tail.ogg")
        Audio.sounds[1].sfx = myTailSound
    end
    if player.jumpKeyPressing == true then
        Audio.sounds[1].sfx = nil
    end
end

Re: [LunaLua] Peach Flying

Posted: Fri Jun 17, 2016 2:09 am
by Julia Pseudo
Moved to LunaLua, since this thread is about LunaLua.