SplitUp.lua: NPCs that split upon death

Share and discuss custom LunaLua code and content packs for SMBX2.
User avatar
The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Current Project: Currently unnamed

SplitUp.lua: NPCs that split upon death

Postby The Dwarven Digger » Sun Jan 06, 2019 1:13 pm

This is something I've been playing with and I thought I'd share it on here. You can use it to make any NPC split into any other NPC (even itself!) upon death. Probably not the most useful library but definitely fun to play with. You could use it to replicate the SMM big goombas, or just be evil and make a coin split into 100 rinkas. Whatever you feel like doing.

Screenshots
Spoiler: show
Image
How to use
Spoiler: show
Copy into your level or episode file and add the following to your lunadll.lua file (or lunaworld.lua for episode-wide use)

Code: Select all

local SplitUp = API.load("SplitUp")

Code: Select all

SplitUp.addEntries{{a, b, c},{a, b, c}...}
Each entry {a, b, c} has three (or two) numbers:
a: The ID of the NPC you want to split when killed
b: The ID of the NPC you want NPC a to split into
c (optional): The number of new NPCs you want it to split into (default is 2)
You can add multiple entries separated by commas
Download
Clicky clicky

Documentation is provided within the lua file.
Last edited by The Dwarven Digger on Fri Mar 22, 2019 2:22 pm, edited 2 times in total.
I support: show
Image
Image
Due to a problem with my laptop, all my projects and levels have been lost. But fear not, for new ones will be arriving! (and hopefully completed)
Spoiler: show
rockythechao wrote:Image

User avatar
FlatKiwi
Blooper
Blooper
Posts: 180
Joined: Sat Aug 12, 2017 10:10 pm
Flair: i can touch my nose with my tongue how cool is tha
Current Project: SMB: Super Missing Bros.
Chat Username: FlatKiwi
Contact:

Re: SplitUp.lua: an API for NPCs that split upon death

Postby FlatKiwi » Sun Jan 06, 2019 2:06 pm

it's not an API, it's a helper library. Lunalua is the API.

User avatar
The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Current Project: Currently unnamed

Re: SplitUp.lua: an API for NPCs that split upon death

Postby The Dwarven Digger » Sun Jan 06, 2019 2:49 pm

FlatKiwi wrote:
Sun Jan 06, 2019 2:06 pm
it's not an API, it's a helper library. Lunalua is the API.
Oh, I thought it was called an API because of the API.load function.
I support: show
Image
Image
Due to a problem with my laptop, all my projects and levels have been lost. But fear not, for new ones will be arriving! (and hopefully completed)
Spoiler: show
rockythechao wrote:Image

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

Re: SplitUp.lua: an API for NPCs that split upon death

Postby Enjl » Sun Jan 06, 2019 3:07 pm

The Dwarven Digger wrote:
Sun Jan 06, 2019 2:49 pm
FlatKiwi wrote:
Sun Jan 06, 2019 2:06 pm
it's not an API, it's a helper library. Lunalua is the API.
Oh, I thought it was called an API because of the API.load function.
The Lunalua API is what does the loading.
ImageImageImageImage
ImageImageImageImageImageImage

User avatar
Eri7
Banned
Posts: 1653
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Hard work pays off sooner or later
Current Project: SMNZ (38A) + SMNP1 (38A) + MKA(2.0) + TNV (2.0/38A) + TNVL (2.0/38A) + SMNP2 (2.0) + SMNR (2.0)
Chat Username: Eri7
Contact:

Re: SplitUp.lua: NPCs that split upon death

Postby Eri7 » Sun Jan 06, 2019 3:24 pm

Oh cool, this might be useful for me.
Image
Image
Image
Image

User avatar
IttaBaby
Koopa Troopa
Koopa Troopa
Posts: 25
Joined: Sat Apr 08, 2017 8:19 pm
Chat Username: IttaBaby

Re: SplitUp.lua: NPCs that split upon death

Postby IttaBaby » Fri Feb 22, 2019 3:16 pm

I'm much too stupid to figure this out? I learn best by example, could someone make like a one room level with 1 npc who uses this? Maybe? Please?

User avatar
Scroll
Boom Boom
Boom Boom
Posts: 1737
Joined: Fri Apr 20, 2018 9:28 pm
Flair: Press Start
Current Project: The Quest of the Dark Stars and something else I think
Chat Username: Scroll#6292
Contact:

Re: SplitUp.lua: NPCs that split upon death

Postby Scroll » Fri Feb 22, 2019 3:41 pm

IttaBaby wrote:
Fri Feb 22, 2019 3:16 pm
I'm much too stupid to figure this out? I learn best by example, could someone make like a one room level with 1 npc who uses this? Maybe? Please?
The main post has a GIF example, did you realize?

User avatar
IttaBaby
Koopa Troopa
Koopa Troopa
Posts: 25
Joined: Sat Apr 08, 2017 8:19 pm
Chat Username: IttaBaby

Re: SplitUp.lua: NPCs that split upon death

Postby IttaBaby » Sat Feb 23, 2019 8:06 am

VanillaDude wrote:
Fri Feb 22, 2019 3:41 pm
The main post has a GIF example, did you realize?
I meant an example of the luna.lua, so I could pick apart the code

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: SplitUp.lua: NPCs that split upon death

Postby PixelPest » Sat Feb 23, 2019 9:06 am

IttaBaby wrote:
Sat Feb 23, 2019 8:06 am
VanillaDude wrote:
Fri Feb 22, 2019 3:41 pm
The main post has a GIF example, did you realize?
I meant an example of the luna.lua, so I could pick apart the code
It's all documented in the file according to the OP. Also you can't use luna.lua files until Beta4 (there's a slightly different naming scheme in Beta3). You could probably also PM the creator and ask if they could send you the code used in the GIF

User avatar
TheTrueMarioMaster
Bit
Bit
Posts: 139
Joined: Mon Mar 19, 2018 11:58 pm
Chat Username: TheTrueMarioMaster

Re: SplitUp.lua: NPCs that split upon death

Postby TheTrueMarioMaster » Tue Feb 26, 2019 1:18 am

PixelPest wrote:
Sat Feb 23, 2019 9:06 am
IttaBaby wrote:
Sat Feb 23, 2019 8:06 am
VanillaDude wrote:
Fri Feb 22, 2019 3:41 pm
The main post has a GIF example, did you realize?
I meant an example of the luna.lua, so I could pick apart the code
It's all documented in the file according to the OP. Also you can't use luna.lua files until Beta4 (there's a slightly different naming scheme in Beta3). You could probably also PM the creator and ask if they could send you the code used in the GIF
Guess I'll have to wait until Beta 4 since this and your enemy stacking .lua could be useful to me in a future episode.
Other places to find me at.
PureZC
MarioFanGameGalaxy

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: SplitUp.lua: NPCs that split upon death

Postby PixelPest » Wed Feb 27, 2019 11:14 am

TheTrueMarioMaster wrote:
Tue Feb 26, 2019 1:18 am
PixelPest wrote:
Sat Feb 23, 2019 9:06 am
IttaBaby wrote:
Sat Feb 23, 2019 8:06 am

I meant an example of the luna.lua, so I could pick apart the code
It's all documented in the file according to the OP. Also you can't use luna.lua files until Beta4 (there's a slightly different naming scheme in Beta3). You could probably also PM the creator and ask if they could send you the code used in the GIF
Guess I'll have to wait until Beta 4 since this and your enemy stacking .lua could be useful to me in a future episode.
Neither of those will be in Beta4, nor will Beta4 make it easier to use either of them

User avatar
TheTrueMarioMaster
Bit
Bit
Posts: 139
Joined: Mon Mar 19, 2018 11:58 pm
Chat Username: TheTrueMarioMaster

Re: SplitUp.lua: NPCs that split upon death

Postby TheTrueMarioMaster » Sat Mar 02, 2019 9:05 pm

PixelPest wrote:
Wed Feb 27, 2019 11:14 am
TheTrueMarioMaster wrote:
Tue Feb 26, 2019 1:18 am
PixelPest wrote:
Sat Feb 23, 2019 9:06 am


It's all documented in the file according to the OP. Also you can't use luna.lua files until Beta4 (there's a slightly different naming scheme in Beta3). You could probably also PM the creator and ask if they could send you the code used in the GIF
Guess I'll have to wait until Beta 4 since this and your enemy stacking .lua could be useful to me in a future episode.
Neither of those will be in Beta4, nor will Beta4 make it easier to use either of them
I know they are not in default Beta 4 but would setting up lua scripts be that hard in Beta 4?
Other places to find me at.
PureZC
MarioFanGameGalaxy

User avatar
PixelPest
Link
Link
Posts: 7118
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Current Project: Boom Boom Evolution
Chat Username: PixelPest
Contact:

Re: SplitUp.lua: NPCs that split upon death

Postby PixelPest » Sat Mar 02, 2019 9:10 pm

TheTrueMarioMaster wrote:
Sat Mar 02, 2019 9:05 pm
PixelPest wrote:
Wed Feb 27, 2019 11:14 am
TheTrueMarioMaster wrote:
Tue Feb 26, 2019 1:18 am

Guess I'll have to wait until Beta 4 since this and your enemy stacking .lua could be useful to me in a future episode.
Neither of those will be in Beta4, nor will Beta4 make it easier to use either of them
I know they are not in default Beta 4 but would setting up lua scripts be that hard in Beta 4?
No different than Beta3

User avatar
The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Current Project: Currently unnamed

Re: SplitUp.lua: NPCs that split upon death

Postby The Dwarven Digger » Sun Mar 03, 2019 8:30 am

The code used in the gif is the same as that provided in the download link. If it helps clarify things I could put some installation & use instructions in the OP.
I support: show
Image
Image
Due to a problem with my laptop, all my projects and levels have been lost. But fear not, for new ones will be arriving! (and hopefully completed)
Spoiler: show
rockythechao wrote:Image


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest