Lineguide.lua (Layer Attachment Now Works!)

This is the place for discussion and support for LunaLua and related modifications and libraries.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
User avatar
Sambo
Blooper
Blooper
Posts: 187
Joined: Fri Jan 24, 2014 6:43 pm
Current Project: SMBX2, Mario & the 7 Orbs

Lineguide.lua (Layer Attachment Now Works!)

Postby Sambo » Mon Jan 02, 2017 11:40 pm

I don't know about you guys, but I always thought the Line Guides that came with SMBX were kinda lame. There were only 4 line types, and if you tried to make zigzag patterns like in the original games, the platforms would just fall off the lines. So, I made this API. It adds all the Line Guides from SMW into SMBX, and it allows you to attach any NPC to a Line Guide, similar to what can be done in Super Mario Maker. I put it through loads of testing, including a real-use field test, and it can handle some pretty complicated line patterns. It has full support for layer movement and showing/hiding. It also includes all the graphics that are needed, complete with files to change the grid size and add a tileset to the PGE editor. I'm sure it has some bugs that I haven't found, so be sure to report any issues.

-- EDIT 11/16/17 --
Some of you noticed that layer attachment didn't work with this. Well, it does now! The link has been updated.

There's a lot of cool stuff going on with this API in SMBX2 B4, but I can't give it to you now because it wouldn't be compatible with what you have. In SMBX2, lineguide is gonna be built in and run automatically, plus there are a bunch of new NPCs to attach to the lines, like SMW saws and the rope thing. It may or may not be in B4, depending on how the development goes.

Video:


Wiki Page:
http://wohlsoft.ru/pgewiki/Lineguide.lua

Download
Last edited by Sambo on Thu Nov 16, 2017 10:30 pm, edited 2 times in total.
Projects I support:
Image Image Image Image
Current Project:
Image

User avatar
underFlo
Mario
Mario
Posts: 4481
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Current Project: actually nothing i lied to you
Chat Username: underFlo
Contact:

Re: Lineguide.lua

Postby underFlo » Tue Jan 03, 2017 6:41 am

Does an NPC automatically snap onto a line guide if they touch one? That may be a bit of an issue if that's not intended. Maybe there could be some way to at least prevent NPC IDs from snapping onto it, because doing it on a per-NPC basis may be kinda difficult.

That said, this looks really useful! There's 10 (I think) unused BGO slots currently so some of those could be used for the line guides + more whenever we can expand the BGO array. Maybe even make it so it uses the default BGOs for the lineguide that already exist, remove those upon starting the level and replace them with the new ones so one can use some of the old BGOs.
im a girl yo

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Lineguide.lua

Postby PixelPest » Tue Jan 03, 2017 8:53 am

This looks very useful. Definitely will try it out

User avatar
Snessy the duck
Ludwig von Koopa
Ludwig von Koopa
Posts: 2700
Joined: Sat Sep 20, 2014 6:04 am
Current Project: idk lol

Re: Lineguide.lua

Postby Snessy the duck » Tue Jan 03, 2017 12:32 pm

This looks super duper cool! I also thought that the lineguides in SMBX were kinda lame, and I would've much preferred if there were at least circular paths included, and now they are, and with much more! Now we'll be able to make much cooler linerider stages with all sorts of twists and turns! Definetly super usefull indeed!
Image

My Switch friend code: SW-5399-6466-3493

Image

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7608
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Lineguide.lua

Postby Enjl » Tue Jan 03, 2017 12:48 pm

the sprite is still black 0/10
ImageImageImageImage
ImageImageImageImageImageImage

User avatar
Sambo
Blooper
Blooper
Posts: 187
Joined: Fri Jan 24, 2014 6:43 pm
Current Project: SMBX2, Mario & the 7 Orbs

Re: Lineguide.lua

Postby Sambo » Tue Jan 03, 2017 1:23 pm

Spinda wrote:Does an NPC automatically snap onto a line guide if they touch one? That may be a bit of an issue if that's not intended. Maybe there could be some way to at least prevent NPC IDs from snapping onto it, because doing it on a per-NPC basis may be kinda difficult.
All NPCs don't automatically snap to the lines. Only NPCs that are platforms in vanilla SMBX do this by default, but any other NPC can be configured to do this, and it is based on ID. I may add an option to enable/disable individual NPCs from attaching to the lines in addition to this.
Spinda wrote:That said, this looks really useful! There's 10 (I think) unused BGO slots currently so some of those could be used for the line guides + more whenever we can expand the BGO array. Maybe even make it so it uses the default BGOs for the lineguide that already exist, remove those upon starting the level and replace them with the new ones so one can use some of the old BGOs.
This API uses 17 BGO slots; 16 for lines and 1 for the direction switch thing.
I could probably do this, but the config for 2.0 would allow placing them directly, so it seems a bit pointless. If it was possible to remove the original line guide behavior from the game, that would probably be the best way to make the old BGOs usable for something. I tried to do this before, but it seems that a platform's field for the current line it is on is set between onTick and onTickEnd, so I can't set it to 0 before it takes effect.
Enjl wrote:the sprite is still black 0/10
Sounds like a personal problem. :P
Projects I support:
Image Image Image Image
Current Project:
Image

User avatar
MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6122
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Current Project: http://www.supermariobrosx.org/forums/v ... 9&start=10
Chat Username: 鬼人 正邪
Contact:

Re: Lineguide.lua

Postby MECHDRAGON777 » Tue Jan 03, 2017 2:24 pm

Sambo wrote:
Enjl wrote:the sprite is still black 0/10
Sounds like a personal problem. :P
Not really, since they have always been hard to find in the editor since they all look the same, and they blend into the background. Simply a pitch black square, with the only real content is a mask that is pure white, (opposite of invisible graphics), except the graphic is drawn on the mask instead with white for the main thing. I hope this is understandable?

ImageImageImage

Image

User avatar
Sambo
Blooper
Blooper
Posts: 187
Joined: Fri Jan 24, 2014 6:43 pm
Current Project: SMBX2, Mario & the 7 Orbs

Re: Lineguide.lua

Postby Sambo » Tue Jan 03, 2017 2:46 pm

If you use this in PGE, this won't be a problem, since the backgrounds for them are all gray instead of black. I had forgotten about that issue because I haven't even used the legacy editor in ages. You wouldn't want to use the legacy editor for this anyway. There's the problem you mentioned, the fact that PNG custom graphics won't appear on the buttons in the editor, and the issue that the grid for them would be 32x32 when it needs to be 16x16. If someone wants to try using this in the legacy editor he is welcome to try, but I won't be supporting it (mainly because it isn't possible due to the grid size issue unless you want to try to go without a grid).
Projects I support:
Image Image Image Image
Current Project:
Image

Horikawa Otane
Lakitu
Lakitu
Posts: 485
Joined: Sun Jan 05, 2014 2:02 am

Re: Lineguide.lua

Postby Horikawa Otane » Tue Jan 03, 2017 4:18 pm

This is FANTASTIC. And if you're okay with it, I'd love to add this to 2.0. Obviously you'd be added to the credits as having written this.

User avatar
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7608
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Lineguide.lua

Postby Enjl » Tue Jan 03, 2017 4:51 pm

Sambo wrote:If you use this in PGE, this won't be a problem, since the backgrounds for them are all gray instead of black. I had forgotten about that issue because I haven't even used the legacy editor in ages. You wouldn't want to use the legacy editor for this anyway. There's the problem you mentioned, the fact that PNG custom graphics won't appear on the buttons in the editor, and the issue that the grid for them would be 32x32 when it needs to be 16x16. If someone wants to try using this in the legacy editor he is welcome to try, but I won't be supporting it (mainly because it isn't possible due to the grid size issue unless you want to try to go without a grid).
It's more the fact that most backgrounds in SMBX are on the dark side of things (especially many smb3 ones) and black line guides are hard to see against these backdrops.
ImageImageImageImage
ImageImageImageImageImageImage

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: Lineguide.lua

Postby PixelPest » Tue Jan 03, 2017 5:01 pm

It would be nice to have a dotted black and white one by default then, maybe?

User avatar
Sambo
Blooper
Blooper
Posts: 187
Joined: Fri Jan 24, 2014 6:43 pm
Current Project: SMBX2, Mario & the 7 Orbs

Re: Lineguide.lua

Postby Sambo » Tue Jan 03, 2017 8:19 pm

Horikawa wrote:This is FANTASTIC. And if you're okay with it, I'd love to add this to 2.0. Obviously you'd be added to the credits as having written this.
Yeah, go ahead and add it to 2.0. I was hoping it would get added, actually. I just got to messing with 2.0 today, and it looks pretty awesome. I'm not exactly sure what you guys are planning, but I'm looking forward to it.
PixelPest wrote:It would be nice to have a dotted black and white one by default then, maybe?
Ok, I think what I will do is add some solid white and some black and white dotted lines to the graphic folder that's in the download. I just had them as black because that's what they looked like in the original, but I can see how visibility could be an issue.
Projects I support:
Image Image Image Image
Current Project:
Image

User avatar
Snessy the duck
Ludwig von Koopa
Ludwig von Koopa
Posts: 2700
Joined: Sat Sep 20, 2014 6:04 am
Current Project: idk lol

Re: Lineguide.lua

Postby Snessy the duck » Wed Jan 04, 2017 12:53 pm

I think it would be a good idea to provide both the original and dotted graphics, since someone may want to use the original if they're going for a classic feel or something. Just be sure to do the dotted GFX like they're done in Sednaiur's SMB3 Expanded Pack.
Image

My Switch friend code: SW-5399-6466-3493

Image

User avatar
ivanmegafanboy
Hoopster
Hoopster
Posts: 174
Joined: Wed Aug 12, 2015 11:47 am
Current Project: Making levels casually. And University. And 1cc this thing called Touhou.

Re: Lineguide.lua

Postby ivanmegafanboy » Wed Jan 04, 2017 6:49 pm

This looks pretty exciting. This lua must be on 2.0.
I like editing levels
Check them out at: viewtopic.php?f=89&t=16926
Spoiler: show
Image
I support
Image
Also The Great Castle Adventure Remake
Spoiler: show
Image

User avatar
Natsu
Wart
Wart
Posts: 3011
Joined: Sat Dec 21, 2013 2:40 pm
Current Project: It's a secret to everybody ...
Chat Username: Kuma-san

Re: Lineguide.lua

Postby Natsu » Fri Jan 06, 2017 12:47 pm

This certainly looks interesting. Precisely what I needed for my episode, thank you so much Sambo.
Discord quotes
Trace: You're a capable boi

User avatar
Sambo
Blooper
Blooper
Posts: 187
Joined: Fri Jan 24, 2014 6:43 pm
Current Project: SMBX2, Mario & the 7 Orbs

Re: Lineguide.lua

Postby Sambo » Mon Jan 09, 2017 9:49 pm

ivanmegafanboy wrote:This looks pretty exciting. This lua must be on 2.0.
It is. Horikawa is adding it.
Intuition wrote:This certainly looks interesting. Precisely what I needed for my episode, thank you so much Sambo.
No problem. I enjoyed making this (except for the occasional hard-to-fix bug).

Added white and dotted lines to the graphics folder (the black ones are still included).
Projects I support:
Image Image Image Image
Current Project:
Image

User avatar
RudeGuy
Luigi
Luigi
Posts: 4972
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

Re: Lineguide.lua (Alternate Graphics Added)

Postby RudeGuy » Sat Apr 08, 2017 9:50 am

hey, sorry for bumping this topic, but i don't understand what to put in the lua file when you rename some bgos, and the page in the wiki doesn't say much about this. i've tried writing something like this:

Code: Select all

local lineHorizontal = 95;
but it doesn't work.
im bored

Westretroman
Nipper Plant
Nipper Plant
Posts: 703
Joined: Tue Mar 29, 2016 6:50 pm

Re: Lineguide.lua

Postby Westretroman » Sat Apr 08, 2017 11:12 am

Sambo wrote:
ivanmegafanboy wrote:This looks pretty exciting. This lua must be on 2.0.
It is. Horikawa is adding it.
Intuition wrote:This certainly looks interesting. Precisely what I needed for my episode, thank you so much Sambo.
No problem. I enjoyed making this (except for the occasional hard-to-fix bug).

Added white and dotted lines to the graphics folder (the black ones are still included).
It went from just a cool experiment to being put in 2.0, this will be really useful for my episode!

User avatar
Electriking
Posts: 4318
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Current Project: Something
Chat Username: ElectriKing
Contact:

Re: Lineguide.lua

Postby Electriking » Sat Apr 08, 2017 11:59 am

Westretroman wrote:
Sambo wrote:
ivanmegafanboy wrote:This looks pretty exciting. This lua must be on 2.0.
It is. Horikawa is adding it.
Intuition wrote:This certainly looks interesting. Precisely what I needed for my episode, thank you so much Sambo.
No problem. I enjoyed making this (except for the occasional hard-to-fix bug).

Added white and dotted lines to the graphics folder (the black ones are still included).
It went from just a cool experiment to being put in 2.0, this will be really useful for my episode!
You can already download it if you weren't aware of that already.
SMM2 ID: JJF-P7G-FSF

User avatar
Electriking
Posts: 4318
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Current Project: Something
Chat Username: ElectriKing
Contact:

Re: Lineguide.lua (Alternate Graphics Added)

Postby Electriking » Sat Apr 08, 2017 1:55 pm

I did the steps but my platform falls through the lines. Am I doing something wrong?
SMM2 ID: JJF-P7G-FSF


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests