Make a custom block spawn a new block instead of the default one?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

Nate-O
Spiny
Spiny
Posts: 25
Joined: Fri Aug 25, 2017 9:02 pm
Flair: Yo
Contact:

Make a custom block spawn a new block instead of the default one?

Postby Nate-O » Sun Aug 22, 2021 11:34 am

I am trying to make a custom question mark block that isnt limited by the 4 frames of animation. I want to know if their is a way to make it so it uses a different, custom block instead of the default smb3 block?

MrDoubleA
Ripper II
Ripper II
Posts: 394
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?

Re: Make a custom block spawn a new block instead of the default one?

Postby MrDoubleA » Sun Aug 22, 2021 12:48 pm

Any block can be given contents and thus made to act just like a ?-block. So, the easiest solution would probably be to reskin an X2 block and give it more frames.

Nate-O
Spiny
Spiny
Posts: 25
Joined: Fri Aug 25, 2017 9:02 pm
Flair: Yo
Contact:

Re: Make a custom block spawn a new block instead of the default one?

Postby Nate-O » Sun Aug 22, 2021 1:01 pm

MrDoubleA wrote:
Sun Aug 22, 2021 12:48 pm
Any block can be given contents and thus made to act just like a ?-block. So, the easiest solution would probably be to reskin an X2 block and give it more frames.
Alright, thank you so much for the answer, though do you know how to make it so when you hit the block, it doesn't use the default SMB3 Block and instead uses a custom one?

MrDoubleA
Ripper II
Ripper II
Posts: 394
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?

Re: Make a custom block spawn a new block instead of the default one?

Postby MrDoubleA » Sun Aug 22, 2021 1:10 pm

NateMon wrote:
Sun Aug 22, 2021 1:01 pm
MrDoubleA wrote:
Sun Aug 22, 2021 12:48 pm
Any block can be given contents and thus made to act just like a ?-block. So, the easiest solution would probably be to reskin an X2 block and give it more frames.
Alright, thank you so much for the answer, though do you know how to make it so when you hit the block, it doesn't use the default SMB3 Block and instead uses a custom one?
That is unfortunately quite difficult to do. You'd need some rather messy lua code to do it.

Nate-O
Spiny
Spiny
Posts: 25
Joined: Fri Aug 25, 2017 9:02 pm
Flair: Yo
Contact:

Re: Make a custom block spawn a new block instead of the default one?

Postby Nate-O » Sun Aug 22, 2021 1:13 pm

MrDoubleA wrote:
Sun Aug 22, 2021 1:10 pm
NateMon wrote:
Sun Aug 22, 2021 1:01 pm
MrDoubleA wrote:
Sun Aug 22, 2021 12:48 pm
Any block can be given contents and thus made to act just like a ?-block. So, the easiest solution would probably be to reskin an X2 block and give it more frames.
Alright, thank you so much for the answer, though do you know how to make it so when you hit the block, it doesn't use the default SMB3 Block and instead uses a custom one?
That is unfortunately quite difficult to do. You'd need some rather messy lua code to do it.
im willing to know how to do it, or if you have something pre made I can use, could you send it?

MrDoubleA
Ripper II
Ripper II
Posts: 394
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?

Re: Make a custom block spawn a new block instead of the default one?

Postby MrDoubleA » Sun Aug 22, 2021 1:29 pm

NateMon wrote:
Sun Aug 22, 2021 1:13 pm
im willing to know how to do it, or if you have something pre made I can use, could you send it?
I don't have any code for it, but it'd involve detecting that it was hit in onPostBlockHit, putting it into a list, and then transforming all the blocks in that list in onTickEnd.

Nate-O
Spiny
Spiny
Posts: 25
Joined: Fri Aug 25, 2017 9:02 pm
Flair: Yo
Contact:

Re: Make a custom block spawn a new block instead of the default one?

Postby Nate-O » Sun Aug 22, 2021 1:30 pm

MrDoubleA wrote:
Sun Aug 22, 2021 1:29 pm
NateMon wrote:
Sun Aug 22, 2021 1:13 pm
im willing to know how to do it, or if you have something pre made I can use, could you send it?
I don't have any code for it, but it'd involve detecting that it was hit in onPostBlockHit, putting it into a list, and then transforming all the blocks in that list in onTickEnd.
Ah. That does sound messy


Return to “LunaLua Help”

Who is online

Users browsing this forum: Petal [Bot] and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari