Page 1 of 1

[NPC Pack] Spouts - Flexible Rising Platforms (v1.1b)

Posted: Mon Aug 23, 2021 9:41 pm
by Benial
Have you ever wanted a platform that waits for a fixed number of frames, rises until it reaches a Terminus BGO or a given height, waits another fixed number of frames, and slowly disappears from the bottom upwards? Then your oddly specific wish has come true!

Image

Many aspects of the spout can be customised in order to create the behaviour you want:
Customization: show
Below is a list of the unique config values for a spout that can be added to a .txt file. The regular speed property will effect the spout's movement speed, as well as the speed it moves NPCs and the player at.
  • bool lava: If enabled, the shaft instakills the player and vulnerable NPCs.
  • bool hurt: If enabled, the shaft hurts the player.
  • bool forcerise: If enabled, the shaft makes the player and solid NPCs rise to the top.
  • float heavylift: When "heavy" objects are rising in the shaft, the speed applied is divided by this value. Set to 0 to make them unliftable, or to 1 for regular speed.
  • float resistance: When objects are rising in the shaft, their speedX is divided by this value. ≤ 0 means no resistance.
  • bool fall: If enabled, the top sinks down rather than the bottom rising up.
  • float fallaccel: The acceleration that the spout falls at, if fall is enabled.
  • int effectID: ID of the effect to display continuously before rising.
  • float effectoffset: Allows manual adjustment for the spawn height of effects.
The spout's graphic is divided into 3 sections: Head, Shaft and Tail. Use the following values to control how they appear:
  • int headoffset: Offset of the head graphic. (first section, uses regular gfxheight)
  • int shaftheight: Height of the shaft graphic. (second section)
  • int tailoffset: Offset of the tail graphic. (third section)
  • int tailheight: Height of the tail graphic. (third section)
You can also multiply the speed, set the length of each pause and maximum rise height, disable the effects or offset where the effects appear on an per-instance level within the editor.
By default, spouts can effect any non-coin gravity-effected or bouyant NPC, but you can allow or prevent any NPC from being lifted by a spout using a pair of functions in your luna.lua file:

Code: Select all

spout.whitelistNPC(ids)
spout.blacklistNPC(ids)
Where ids represents a table of NPC IDs
Included are the example configurations shown above - a sand spout that only acts as a platform, a water spout that lifts the player and NPCs, and a lava geyser that are dangerous to touch.

Feel free to use this in any level or episode, but please give credit if you do.

Download (v1.1b)
Changelog: show
v1.1
  • Added a new "Maximum height" field to the in-editor settings, which will force the spout to stop rising after a given distance even if no Terminus was reached
  • Podobo's Shoe will now protect the player when standing on a spout with "lava" enabled
  • Spouts can now be properly moved by and attatched to layers
  • Cleaned up the AI script, removing leftover debug messages and better organizing states
v1.1b
  • Fixed an error when the spout is disappearing

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Mon Aug 23, 2021 11:57 pm
by Alucard648
Gif fails to work.

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Tue Aug 24, 2021 1:16 am
by Marioman2007
Alucard648 wrote:
Mon Aug 23, 2021 11:57 pm
Gif fails to work.
That's the Fault of SMBX2's GIFs.
Btw, Really nice NPC Pack!

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Tue Aug 24, 2021 2:06 am
by MegaDood
Very awesome work! It's great to finally see a release of the geyser NPCs from NSMBW.

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Tue Aug 24, 2021 10:28 am
by Halzk
Really cool NPC pack but I think I broke it :')
Image

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Tue Aug 24, 2021 11:33 am
by Marioman2007
Sorry for my double post, but do you think that I can make the top part act like a platform and when the player collides with the spout sideways, he gets killed?

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Tue Aug 24, 2021 9:40 pm
by Novarender
Very cool!

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Thu Aug 26, 2021 4:05 pm
by KKaruch
Image

What's the problem?

Re: [NPC Pack] Spouts - Flexible Rising Platforms (v1.1)

Posted: Sat Aug 28, 2021 6:29 am
by Marioman2007
Benial wrote: Ping
Weird behavior:
Spoiler: show
Image

Re: [NPC Pack] Spouts - Flexible Rising Platforms

Posted: Sun Aug 29, 2021 12:20 pm
by Benial
marioman2007 wrote:
Tue Aug 24, 2021 11:33 am
Sorry for my double post, but do you think that I can make the top part act like a platform and when the player collides with the spout sideways, he gets killed?
You can, set the playerblock, npcblock etc. configs in your .txt file and it'll only apply them to the top section
KKaruch wrote: Image

What's the problem?
Image
Make sure you've placed a terminus BGO above the spout, or set the max height in it's settings, otherwise it'll rise forever. If you already have, I can't tell what's causing this
marioman2007 wrote: Weird behavior:
Spoiler: show
Image
Working on a fix for this at the moment, vanilla NPCs don't have harm types so I have to find another way to make it immune

Re: [NPC Pack] Spouts - Flexible Rising Platforms (v1.1b)

Posted: Tue Aug 31, 2021 12:59 pm
by Marioman2007
Oh yeah, NPC flags are a thing.
btw playerblocktop works but npcblocktop is a misnomer.

Re: [NPC Pack] Spouts - Flexible Rising Platforms (v1.1b)

Posted: Thu Sep 16, 2021 4:03 pm
by MaximalCuboid
1) Is there any way to make the spout have infinite hold time?
2) Is there any way to change the horizontal offset of the spawn effect of an NPC? In general the spawn effect seems to be noticeably 16 pixels to the right of the center, which makes sense for some effects, but not all.
Image