Lineguide.lua (Layer Attachment Now Works!)

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

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?
Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

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.

underFlo
Wart
Wart
Posts: 4456
Joined: Mon Jul 14, 2014 10:44 am
Flair: sup im lesbiab
Pronouns: They/She
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.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Lineguide.lua

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

This looks very useful. Definitely will try it out

Snessy the duck
Mouser
Mouser
Posts: 2699
Joined: Sat Sep 20, 2014 6:04 am

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!

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

Re: Lineguide.lua

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

the sprite is still black 0/10

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

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

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
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?

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

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).

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

Re: Lineguide.lua

Postby Emral » 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.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
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?

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

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.

Snessy the duck
Mouser
Mouser
Posts: 2699
Joined: Sat Sep 20, 2014 6:04 am

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.

ivanmegafanboy
Flurry
Flurry
Posts: 175
Joined: Wed Aug 12, 2015 11:47 am

Re: Lineguide.lua

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

This looks pretty exciting. This lua must be on 2.0.

Fuyu
Fry Guy
Fry Guy
Posts: 3137
Joined: Sat Dec 21, 2013 2:40 pm
Pronouns: He/Him

Re: Lineguide.lua

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

This certainly looks interesting. Precisely what I needed for my episode, thank you so much Sambo.

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

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).

RudeGuy
Bowser
Bowser
Posts: 4994
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

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.

Westretroman
Eerie
Eerie
Posts: 704
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!

ElectriKong
Bowser
Bowser
Posts: 4652
Joined: Mon Jun 06, 2016 4:32 pm
Pronouns: he/him
Contact:

Re: Lineguide.lua

Postby ElectriKong » 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.

ElectriKong
Bowser
Bowser
Posts: 4652
Joined: Mon Jun 06, 2016 4:32 pm
Pronouns: he/him
Contact:

Re: Lineguide.lua (Alternate Graphics Added)

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

I did the steps but my platform falls through the lines. Am I doing something wrong?

Sambo
Snifit
Snifit
Posts: 211
Joined: Fri Jan 24, 2014 6:43 pm

Re: Lineguide.lua (Alternate Graphics Added)

Postby Sambo » Sat Apr 08, 2017 3:51 pm

Clearly, if it isn't working. I can't help you if you don't show me your code.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari