Ball 'N' Chain NPC

Share and discuss custom LunaLua code and content packs for SMBX2.
User avatar
Smibbix
Spiny
Spiny
Posts: 59
Joined: Fri Apr 06, 2018 10:47 pm
Current Project: I can't tell you just yet, but let's just say it's pretty funkatronic...
Chat Username: Smibbix

Ball 'N' Chain NPC

Postby Smibbix » Sun May 31, 2020 7:41 pm

So I've been learning how to use LunaLua, and now that I've gotten pretty okay (I think?) at it, I wanted to actually make and post something for other people to see. I noticed that, as far as I know, nobody has made an NPC of the ball and chain things from SMW. So I changed that!

This NPC is actually split into three different NPCs. One for the chain links, one for the spike ball, and one for the actual whole object.

I wanted to make these really useful, so I added some extra options for them in the editor. You can configure each Ball 'N' Chain's speed, its length, its direction, the angle it starts at, and how many spike balls there are. I also implemented it being able to be friendly, to not move, and to move with its layer.

Here's some gifs of the NPC in action:
Spoiler: show
Image
Image
Image
Image
If you just want to download the NPC, get it here:
Download

If you want a demonstration level for them also, see my level thread over here:
My Levels

edit: Oh yeah, and please give me credit if you use it in one of your projects
ah

I Support:
Spoiler: show
Everything I supported got cancelled
Great Quotes:
Spoiler: show
Pop Yoshi Bros wrote: These used other people levels withouth their permission? I don't know if it's wrong if the big heads of the forums make it
Enjl wrote:
Sun Jul 15, 2018 8:27 am
The only palette people care about is the SMB3 palette.
smbx GaMERDoG wrote:
Thu Jul 12, 2018 1:30 am
These tomatoes weren't debugged properly!

King Mario
Koopa Troopa
Koopa Troopa
Posts: 25
Joined: Sun Nov 19, 2017 2:13 pm
Chat Username: Guardian

Re: Ball 'N' Chain NPC

Postby King Mario » Sun May 31, 2020 8:10 pm

Smibbix wrote: So I've been learning how to use LunaLua, and now that I've gotten pretty okay (I think?) at it, I wanted to actually make and post something for other people to see. I noticed that, as far as I know, nobody has made an NPC of the ball and chain things from SMW. So I changed that!

This NPC is actually split into three different NPCs. One for the chain links, one for the spike ball, and one for the actual whole object.

I wanted to make these really useful, so I added some extra options for them in the editor. You can configure each Ball 'N' Chain's speed, its length, its direction, the angle it starts at, and how many spike balls there are. I also implemented it being able to be friendly, to not move, and to move with its layer.

Here's some gifs of the NPC in action:
Spoiler: show
Image
Image
Image
Image
If you just want to download the NPC, get it here:
Download

If you want a demonstration level for them also, see my level thread over here:
My Levels

edit: Oh yeah, and please give me credit if you use it in one of your projects
Oh Wow! These are so amazing! Definitely using this, and I also credit you in advance. Thanks, dude!

TheTrueMarioMaster
Hoopster
Hoopster
Posts: 156
Joined: Mon Mar 19, 2018 11:58 pm
Chat Username: TheTrueMarioMaster

Re: Ball 'N' Chain NPC

Postby TheTrueMarioMaster » Mon Jun 01, 2020 12:07 am

This reminds me of 1AmPlayer's firebars with all the different options. Also to make a suggestion how about doing the Pendulum Ball N' Chain from SMWC since it is related.
Other places to find me at.
PureZC
MarioFanGameGalaxy

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8522
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Ball 'N' Chain NPC

Postby Enjl » Mon Jun 01, 2020 2:05 am

Looks awesome, keep it up!

After a quick look through the code, a few things I noticed that might be good to take in account for for the future:
- Having the ball permanently spawned might lead to some overhead in large sections, so it might be good to find an alternative. Orbits internally handles despawning as something that starts happening when all pieces of the orbit are offscreen. Since the ball has authority over the chain, it's always going to be the last object to despawn already (as long as a full rotation takes less than 3 seconds).
- Orbits itself has some funky attach to layer compatibility, it might be worth to test through some of the combinations (ball on moving layer, moving layer attached to ball) and test through some edge cases with layer movement (Player powering up, player entering warp, Green P-Switch enabled. Important to note is that layers attached TO npcs don't usually pause during a player forced state change).
- Speaking of testing, the empty if-statement about grabbed, thrown and contained state has me wondering if the NPC acts as expected in those situations. The first 2 can be tested by putting a ball n chain into diggable grass, and the latter can be tested in many ways, like putting it into a block, or setting the ball as the player's reservePowerup in onStart.
The ABC of Creation
________________________________________________________
Image

User avatar
Hammerless Penguin
Blooper
Blooper
Posts: 185
Joined: Sat Sep 22, 2018 6:17 am
Flair: Just kicking that kirby to the curb!
Current Project: Super Mario And The 10 Golden Elements
Chat Username: Hammerless penguin
Contact:

Re: Ball 'N' Chain NPC

Postby Hammerless Penguin » Wed Jul 29, 2020 7:40 am

Image
Attaching the ball to layers with moving NPCs and then getting hit or getting a power up will cause the ball to dislocate from the attached layer instead of staying in sync
Image
They also don't disappear when they are on layers that shouldn't be visible until an event takes place.
Check out this big neat project coming soon to smbx2 beta4!
Image

Switch FC: SW-8458-1591-5797

User avatar
Smibbix
Spiny
Spiny
Posts: 59
Joined: Fri Apr 06, 2018 10:47 pm
Current Project: I can't tell you just yet, but let's just say it's pretty funkatronic...
Chat Username: Smibbix

Re: Ball 'N' Chain NPC

Postby Smibbix » Wed Jul 29, 2020 3:02 pm

Hammerless Penguin wrote:
Wed Jul 29, 2020 7:40 am
Image
Attaching the ball to layers with moving NPCs and then getting hit or getting a power up will cause the ball to dislocate from the attached layer instead of staying in sync
Image
They also don't disappear when they are on layers that shouldn't be visible until an event takes place.
Hmmm... Yeah there are definitely some things I've been meaning to fix about this, along with some of the stuff Enjl said above. I'll get working on a bugfix update, also probably including the grey rotating platforms as a bonus
ah

I Support:
Spoiler: show
Everything I supported got cancelled
Great Quotes:
Spoiler: show
Pop Yoshi Bros wrote: These used other people levels withouth their permission? I don't know if it's wrong if the big heads of the forums make it
Enjl wrote:
Sun Jul 15, 2018 8:27 am
The only palette people care about is the SMB3 palette.
smbx GaMERDoG wrote:
Thu Jul 12, 2018 1:30 am
These tomatoes weren't debugged properly!


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests