Page 1 of 1

Problem with autoscroll.lua

Posted: Fri Feb 18, 2022 10:40 am
by Frust
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?

Re: Problem with autoscroll.lua

Posted: Fri Feb 18, 2022 4:58 pm
by SuperAlex
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

Re: Problem with autoscroll.lua

Posted: Fri Feb 18, 2022 9:08 pm
by Frust
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.