airshipScroll.lua (SMM-Like Airship Camera)

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

Murphmario
2025 Egg Hunter
2025 Egg Hunter
Posts: 2389
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

airshipScroll.lua (SMM-Like Airship Camera)

Postby Murphmario » Fri Dec 03, 2021 6:48 pm

This is a library that replicates the effect of an airship scrolling up and down seen in games such as Super Mario Bros. 3 and Super Mario Maker.
Image
Additionally, this has some values that should be applied to the level's .lua file. Listed here are the values plus their defaults:

Code: Select all

airshipScroll.sections = {0} --What sections the effect should be applied to. Note that this is a table.
airshipScroll.intensity = .01 --What speed should the effect should scroll at.
airshipScroll.movementLimit = 1 --How long should the effect should scroll for.
airshipScroll.movingLayer = "shipWater" --Whatever layer is here will scroll up and down with the screen, allowing you to have stuff like the water in SMB3's World 8-Ship.
NOTE: Doesn't work 100% the best with autoscroll.lua. Both libraries do work with one-another, but the screen might snap into position once it's done autoscrolling vertically. If anyone wants to fix this feel free.

Edit: Fixed an issue where "shipWater" misaligns if a section that has airship scrolling is disabled.

Download:
https://pastebin.com/7tZPVMpq
Last edited by Murphmario on Sat Feb 24, 2024 8:36 am, edited 2 times in total.

MegaDood
Charged Spiny
Charged Spiny
Posts: 1831
Joined: Wed Nov 01, 2017 2:43 am

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby MegaDood » Mon Dec 06, 2021 7:14 am

This is great! I've always wanted to do airship levels with this effect and I'm so glad I now can.

Murphmario
2025 Egg Hunter
2025 Egg Hunter
Posts: 2389
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby Murphmario » Sun Jan 02, 2022 1:29 am

Quick update to this that fixes airshipScroll.movingLayer pausing when the player is powering up or down, thus desyncing it.

TheGameyFireBro105
Eerie
Eerie
Posts: 747
Joined: Thu Jan 09, 2020 6:09 pm
Flair: Good at remakes
Pronouns: he/him

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby TheGameyFireBro105 » Tue Jan 04, 2022 6:23 pm

Now 3-3 from SMB3 is fully possible in SMBX2!

Sonya Sanchez
Rinka
Rinka
Posts: 666
Joined: Fri May 10, 2019 3:05 pm
Flair: Robotic
Pronouns: They/Them

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby Sonya Sanchez » Wed Jan 05, 2022 1:03 am

TheGameyFireBro105 wrote:
Tue Jan 04, 2022 6:23 pm
Now 3-3 from SMB3 is fully possible in SMBX2!
3-3 doesn’t use the airship camera?? The tiles just move up and down which was always possible by using layers and events since they got into smbx.

And no the background isn’t moving in the level it’s a illusion created by the background objects such as clouds and bushes that are also set on the layer to move up and down.

In short: 3-3 was always possible since the level never did the airship camera.

Chuchu370
Koopa
Koopa
Posts: 17
Joined: Tue Feb 15, 2022 11:36 am
Pronouns: He/Him

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby Chuchu370 » Sat Apr 02, 2022 9:16 pm

How does this work, exactly?

VortexGX
Goomba
Goomba
Posts: 2
Joined: Fri Feb 14, 2020 9:58 pm
Flair: Bruh

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby VortexGX » Sun May 29, 2022 9:27 pm

Chuchu370 wrote:
Sat Apr 02, 2022 9:16 pm
How does this work, exactly?
I did in that in the local level .lua and it'll work as long as you have a layer named "shipWater"

Code: Select all

local airshipScroll = require("airshipScroll")
airshipScroll.sections = {1}

Cognition
Buster Beetle
Buster Beetle
Posts: 83
Joined: Sun Oct 05, 2014 10:13 pm

Re: airshipScroll.lua (SMM-Like Airship Camera)

Postby Cognition » Sun Aug 28, 2022 6:37 pm

I know this is a bit of an old post, but I do not have coder brain and need some help getting this to work. I dropped the downloaded file into the levels folder and changed what was needed but nothing has happened. Am I missing something and if so what? XD


Return to “LunaLua”

Who is online

Users browsing this forum: Petal [Bot] and 8 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari