Page 1 of 1

How do I put other NPCs on Line Guides?

Posted: Tue Jun 28, 2022 11:04 am
by Deltom
I wanted to give my level a bit of a Super Mario Maker feel, and I feel Line Guides would be perfect for that. The problem is, I can't put enemies, coins or other NPCs on them. When I test them in-game, they just fall and don't stick to the Line Guides.

Re: How do I put other NPCs on Line Guides?

Posted: Tue Jun 28, 2022 12:43 pm
by deice
placing arbitrary npcs on line guides is not possible in vanilla smbx. you can use the following lua code (make a file called "luna.lua" inside your level folder and place the code in there) to change the properties of given npcs and make them follow line guides:

Code: Select all

local lineguide = require("lineguide")

local npcList = { 1, 2 } -- insert the ids of the npcs you want to put on line guides here

lineguide.registerNpcs(npcList)
for instance, this code makes the brown and red smb3 goombas follow line guides when placed on them.
do note however that this is a pretty hacky solution and will invariably cause issues with some npcs for which this behavior is not normally intended.

Re: How do I put other NPCs on Line Guides?

Posted: Tue Jun 28, 2022 1:26 pm
by Deltom
deice wrote:
Tue Jun 28, 2022 12:43 pm
placing arbitrary npcs on line guides is not possible in vanilla smbx. you can use the following lua code (make a file called "luna.lua" inside your level folder and place the code in there) to change the properties of given npcs and make them follow line guides:

Code: Select all

local lineguide = require("lineguide")

local npcList = { 1, 2 } -- insert the ids of the npcs you want to put on line guides here

lineguide.registerNpcs(npcList)
for instance, this code makes the brown and red smb3 goombas follow line guides when placed on them.
do note however that this is a pretty hacky solution and will invariably cause issues with some npcs for which this behavior is not normally intended.
Thanks a lot, man!
I'll try this out in a bit