Problem with autoscroll.lua

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

Frust
Koopa
Koopa
Posts: 17
Joined: Fri Jan 16, 2015 1:58 pm

Problem with autoscroll.lua

Postby Frust » Fri Feb 18, 2022 10:40 am

Hello! I'm trying to use the autoscroll.lua instead of the traditional from smbx. It works, but there is a problem I can't resolve.
If a player gets a powerup or take damage, the autoscroll was supose to stop for the powerup or shrinking animation. But the scroll does not stop.

Here an example why this is a problem:
When you get a powerup or take damage you can't move for a moment because of the animation, and this can cause some unfair deaths in an autoscroll level as it already happened to me.

How can I make the scroll stop for the animation so it functions exactly the same as the traditional from smbx?
NOTE: I could use the vanilla one, but what if I wanted to do an autoscroll in other sections of a level?

SuperAlex
2025 Egg Hunter
2025 Egg Hunter
Posts: 226
Joined: Mon Nov 02, 2020 3:02 pm
Flair: Spriting
Pronouns: He/Him
Contact:

Re: Problem with autoscroll.lua

Postby SuperAlex » Fri Feb 18, 2022 4:58 pm

MmM I think that seems a problem from autoscroll
Use this code in your luna file to solve the problem. THERE'S ONLY WAY

Code: Select all

local reset = nil
function onTick()
	if player:mem(0x122, FIELD_WORD) > 0 then
		Defines.levelFreeze = true
		reset = true
	elseif reset then
		Defines.levelFreeze = false
		reset = false
	end
end

Frust
Koopa
Koopa
Posts: 17
Joined: Fri Jan 16, 2015 1:58 pm

Re: Problem with autoscroll.lua

Postby Frust » Fri Feb 18, 2022 9:08 pm

SuperAlex wrote:
Fri Feb 18, 2022 4:58 pm
MmM I think that seems a problem from autoscroll
Use this code in your luna file to solve the problem. THERE'S ONLY WAY

Code: Select all

local reset = nil
function onTick()
	if player:mem(0x122, FIELD_WORD) > 0 then
		Defines.levelFreeze = true
		reset = true
	elseif reset then
		Defines.levelFreeze = false
		reset = false
	end
end
Thanks for the help.
This works fine with npcs and moving platforms, but the autoscroll is still moving even when the player is freezed by an animation.
I think a better way is to make only the autoscroll to stop instead of the level itself.


Return to “Help and Support”

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari