Page 1 of 1

poof.lua: One-by-one layer transitions [v0.2a]

Posted: Sat Nov 26, 2016 4:22 pm
by The0x539
Inspired by SMW overworld transitions, and surprisingly not by Yoshi's Island, I give you poof.lua, for use in levels, in-engine level selects, or wherever else:



https://gist.github.com/The0x539/d8b617 ... 31ce2a4362

Use is as simple as:

Code: Select all

local poof = API.load("poof")

function toggleLayer()
	poof.startPoof("layer")
end
Delay between blocks, as well as whether time is frozen or player input is just locked, can be specified by optional second and third arguments.

Though it's quite general-purpose, its intended purpose was for SMW-style transitions in SMBX platformer level selects, as seen in this proof of concept:


https://ptpb.pw/-sNM.ziphttps://ptpb.pw/EFl4.zip

Roadmap?
  • Poof queue, so calling poof.startPoof() twice in a row poofs the layers sequentially, and without stopping at the player position
  • Particle effects
  • 2-player support
  • Options for different camera behavior, teleport to be centered on each tile, don't move at all, move gradually if the structure is bigger than the camera
  • Different ways of sorting the blocks, maybe even manual sorting for particularly fancy stuff

Re: poof.lua: Block-by-block layer transitions [v0.1a]

Posted: Sun Nov 27, 2016 7:43 am
by Quantix
This actually looks like it could be useful for some decent effects. Well job!
Now make one for the world map

Re: poof.lua: Block-by-block layer transitions [v0.1a]

Posted: Sun Nov 27, 2016 7:53 am
by Super Mario Channel
Quantix wrote:Now make one for the world map
Pretty sure you could do that in 2.0... er, was it 1.4.2? I dunno, I just remember you could do it somewhere...

Re: poof.lua: Block-by-block layer transitions [v0.1a]

Posted: Sun Nov 27, 2016 8:28 am
by ElectriKong
I am pretty sure this sort of thing is possible without the API by using events and multiple layers.

Re: poof.lua: Block-by-block layer transitions [v0.1a]

Posted: Sun Nov 27, 2016 9:47 am
by The0x539
King of Eterity wrote:I am pretty sure this sort of thing is possible without the API by using events and multiple layers.
Yes, it is possible. Very possible. It's just as tedious as it is possible, though. You'd have to use a layer for each block, and an event for each layer. This lets you put everything used in one transition into one layer, and set it into motion with just one line of code, maybe 5-10 lines per transition (of basically the same code) if you're looking to make permanent level select transitions like in the second video.

Re: poof.lua: Block-by-block layer transitions [v0.1a]

Posted: Sun Nov 27, 2016 1:10 pm
by Quantix
Super Mario Channel wrote:
Quantix wrote:Now make one for the world map
Pretty sure you could do that in 2.0... er, was it 1.4.2? I dunno, I just remember you could do it somewhere...
You could do it in 1.4.2 and above actually.

Re: poof.lua: Block-by-block layer transitions [v0.1a]

Posted: Sun Jan 01, 2017 10:44 pm
by The0x539
Poof v0.2a:
  • Removed the "out" argument, poof now determines whether a layer is hidden, and poofs it accordingly, as a toggle.
  • BGOs and NPCs are now treated identically to blocks.
  • Support for off-grid or oversized things substantially improved.
THIS UPDATE IS GUARANTEED NOT BACKWARDS COMPATIBLE, but just remove the "out" argument and you're good.



Download link in OP.

Re: poof.lua: One-by-one layer transitions [v0.2a]

Posted: Thu Jan 05, 2023 12:24 pm
by MarioChallengerX2
Hey, which link do I use? In the main forum post, the second apparently has an unsecure connection. (Unsafe)