Share and discuss custom LunaLua code and content packs for SMBX2.
|
|
|
|
-
Benial
- Fighter Fly

- Posts: 46
- Joined: Thu Dec 15, 2016 4:28 pm
- Pronouns: He/Him
Postby Benial » Mon Aug 23, 2021 9:41 pm
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!
Many aspects of the spout can be customised in order to create the behaviour you want:
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)
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
Last edited by Benial on Sun Aug 29, 2021 12:06 pm, edited 4 times in total.
|
|
|
|
|
|
|
|
|
-
Alucard648
- Hoopster

- Posts: 114
- Joined: Sun Aug 16, 2015 3:45 am
Postby Alucard648 » Mon Aug 23, 2021 11:57 pm
Gif fails to work.
|
|
|
|
|
|
|
|
|
-
Marioman2007
- Buster Beetle

- Posts: 401
- Joined: Tue Aug 25, 2020 3:19 am
- Pronouns: He/Him
Postby Marioman2007 » Tue Aug 24, 2021 1:16 am
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!
|
|
|
|
|
|
|
|
|
-
MegaDood
- Torpedo Ted

- Posts: 1650
- Joined: Wed Nov 01, 2017 2:43 am
Postby MegaDood » Tue Aug 24, 2021 2:06 am
Very awesome work! It's great to finally see a release of the geyser NPCs from NSMBW.
|
|
|
|
|
|
|
|
|
-
Halzk
- Cheep-Cheep

- Posts: 12
- Joined: Tue Apr 16, 2019 10:20 am
Postby Halzk » Tue Aug 24, 2021 10:28 am
Really cool NPC pack but I think I broke it :')

|
|
|
|
|
|
|
|
|
-
Marioman2007
- Buster Beetle

- Posts: 401
- Joined: Tue Aug 25, 2020 3:19 am
- Pronouns: He/Him
Postby Marioman2007 » 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?
|
|
|
|
|
|
|
|
|
-
Novarender
- Monty Mole

- Posts: 145
- Joined: Sat Aug 06, 2016 6:59 pm
- Flair: Whoa
Postby Novarender » Tue Aug 24, 2021 9:40 pm
Very cool!
|
|
|
|
|
|
|
|
|
-
KKaruch
- Shy Guy

- Posts: 8
- Joined: Sun Jan 03, 2021 6:07 am
- Pronouns: he/him
Postby KKaruch » Thu Aug 26, 2021 4:05 pm
What's the problem?
|
|
|
|
|
|
|
|
|
-
Benial
- Fighter Fly

- Posts: 46
- Joined: Thu Dec 15, 2016 4:28 pm
- Pronouns: He/Him
Postby Benial » Sun Aug 29, 2021 12:20 pm
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:
What's the problem?

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:
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
|
|
|
|
|
|
|
|
|
-
Marioman2007
- Buster Beetle

- Posts: 401
- Joined: Tue Aug 25, 2020 3:19 am
- Pronouns: He/Him
Postby Marioman2007 » Tue Aug 31, 2021 12:59 pm
Oh yeah, NPC flags are a thing.
btw playerblocktop works but npcblocktop is a misnomer.
|
|
|
|
|
|
|
|
|
-
MaximalCuboid
- Shy Guy

- Posts: 8
- Joined: Sun Nov 08, 2020 1:47 pm
Postby MaximalCuboid » Thu Sep 16, 2021 4:03 pm
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.

|
|
|
|
|
Return to “LunaLua”
Users browsing this forum: No registered users and 2 guests
|