Scrolling works incorrect

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

DrMekar
Eerie
Eerie
Posts: 787
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Scrolling works incorrect

Postby DrMekar » Mon Jun 08, 2020 9:56 am

So I decided to add a Boss to World 2 of MH1.5 using Scrolling, though
somehow it doesn't work right.

This is how the Code looks. Should be fine..

Code: Select all

local autoscroll = require("autoscroll") 
function onEvent(p) 
    if p == "Boss Fight" then 
        autoscroll.scrollLeft(0.7, (0.2))
    end
    if p == "Boss Start" then
        Audio.MusicChange(3, ("(MUSIC)/Boss - Locust.mp3"))
    end
end
..though it does that:
Image

I really have no idea why it scrolls to the right, since the Events do Nothing, but activating the Lua Code with
a 1 Second Delay.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Scrolling works incorrect

Postby Emral » Mon Jun 08, 2020 10:05 am

What is the (0.2) for?

DrMekar
Eerie
Eerie
Posts: 787
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Re: Scrolling works incorrect

Postby DrMekar » Mon Jun 08, 2020 10:10 am

Enjl wrote:
Mon Jun 08, 2020 10:05 am
What is the (0.2) for?
That's a good Question. I remember that it was necessary to make the Gore Battle work.
One moment.

Added in 2 minutes 47 seconds:
Nevermind. It works correct now.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Scrolling works incorrect

Postby Emral » Mon Jun 08, 2020 10:14 am

Okay. Just for reference, the arguments for the scroll functions are: speed, boundary, section. Boundary in this case is the left edge where the scrolling ends. I can imagine that 0.2 breaking things because x=0.2 was the ending coordinate of the scroll. boundary and section are both optional and default to the default end of the section in the scrolling direction.

DrMekar
Eerie
Eerie
Posts: 787
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Re: Scrolling works incorrect

Postby DrMekar » Mon Jun 08, 2020 10:50 am

Enjl wrote:
Mon Jun 08, 2020 10:14 am
Okay. Just for reference, the arguments for the scroll functions are: speed, boundary, section. Boundary in this case is the left edge where the scrolling ends. I can imagine that 0.2 breaking things because x=0.2 was the ending coordinate of the scroll. boundary and section are both optional and default to the default end of the section in the scrolling direction.
Okay, Thanks. I also know again for what I used it. It was used to slow the Scrolling down near the End.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 9 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari