Lineguide.lua
This library adds all the Line Guides from SMW to SMBX, with full support for layer movement/showing/hiding. It also allows the user to attach any NPC to a Line Guide like in Super Mario Maker.
Requires the Colliders library.
Installation
- Download the API here
- Drop lineguide.lua into your LuaScriptsLib folder.
- Move the "lineguide gfx" folder to any location of your choice. It contains:
- All the needed custom graphics, set to overwrite the BGOs with the default IDs used in this API.
- txt files to change the grid size for the line BGOs to 16x16 in PGE
- A tileset file for PGE.
Use
To use this API in a level:
- Copy the files from the "lineguide gfx" folder into your level's folder. Be sure to change the names of the images so there are no conflicts. (If you are using GIFs for CGFX in your level, make sure the new graphics don't have the same name as any existing. Your OS won't report this if this is the case.) Make note of any ID changes made to the line BGOs.
- Place this at the top of the level's lunadll.lua file:
local lineguide = API.load("lineguide")
- Set the line ID variables to match the IDs of any line BGOs you needed to rename to prevent a conflict.
- Start using better Line Guides in SMBX!
Variables
These are variables the user can access and set. They are all part of the lineguide namespace, so you must put "lineguide." before each.
General
| Name | Type | Description |
|---|---|---|
| debug | bool | Set to true for debug mode, which will display the various collider objects used in this API. |
| properties | table of properties | Contains the properties of the NPCs that have been configured to connect to lines. See the section labelled "Properties" for more information. |
| lineNpcs | table of IDs | Contains the IDs of all NPCs that will attach to Line Guides. NPCs that are platforms in vanilla SMBX need not be added by the user. |
Line BGO IDs
These variables contain the IDs of the BGOs that are being used as Line Guides. Since these values are loaded in initialization, setting them anywhere other than in the top of your Luna.lua file will have no effect. DO NOT use vanilla SMBX Line Guides anywhere in a level where this API is used, as they will interfere with this API's functionality, not to mention that they will behave very strangely. Any BGO can be used, provided it has the right dimensions (You can use bgofix.lua to change the dimensions of any BGO!) and it is not a vanilla Line Guide.
Properties
These variables contain the properties of the NPCs which control their behavior relating to this API. They are accessed using the format "properties[ID].PROPERTY."
For example, to access the "lineSpeed" property of the SMB3 Goomba, you would use:
lineguide.properties[1].lineSpeed
| Name | Type | Default | Description |
|---|---|---|---|
| lineSpeed | double | 2 | The speed, in pixels per tick, at which the NPC travels on a line. |
| jumpSpeed | double | 4 | The speed, in pixels per tick, at which the NPC moves when it "jumps" off the end of a line. This only applies if there is any upward movement when the end of the line is reached. |
Notes/Issues
- When placing Line Guides in a level, the grid should be 16x16. The background-* txts provided in the graphics download will give these BGOs a 16x16 grid in the PGE editor.
- Vanilla Line Guides will not work with this API. They interfere with platform movement, and they behave strangely when this API is loaded. It is best to avoid using them altogether in a level that uses this API.



