Page 1 of 1
SplitUp.lua: NPCs that split upon death
Posted: Sun Jan 06, 2019 1:13 pm
by The Dwarven Digger
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
How to use
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.
Re: SplitUp.lua: an API for NPCs that split upon death
Posted: Sun Jan 06, 2019 2:06 pm
by squp
it's not an API, it's a helper library. Lunalua is the API.
Re: SplitUp.lua: an API for NPCs that split upon death
Posted: Sun Jan 06, 2019 2:49 pm
by The Dwarven Digger
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.
Re: SplitUp.lua: an API for NPCs that split upon death
Posted: Sun Jan 06, 2019 3:07 pm
by Emral
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.
Re: SplitUp.lua: NPCs that split upon death
Posted: Sun Jan 06, 2019 3:24 pm
by Eri7
Oh cool, this might be useful for me.
Re: SplitUp.lua: NPCs that split upon death
Posted: Fri Feb 22, 2019 3:16 pm
by IttaBaby
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?
Re: SplitUp.lua: NPCs that split upon death
Posted: Fri Feb 22, 2019 3:41 pm
by TheNightingale
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?
Re: SplitUp.lua: NPCs that split upon death
Posted: Sat Feb 23, 2019 8:06 am
by IttaBaby
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
Re: SplitUp.lua: NPCs that split upon death
Posted: Sat Feb 23, 2019 9:06 am
by PixelPest
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
Re: SplitUp.lua: NPCs that split upon death
Posted: Tue Feb 26, 2019 1:18 am
by TheTrueMarioMaster
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.
Re: SplitUp.lua: NPCs that split upon death
Posted: Wed Feb 27, 2019 11:14 am
by PixelPest
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
Re: SplitUp.lua: NPCs that split upon death
Posted: Sat Mar 02, 2019 9:05 pm
by TheTrueMarioMaster
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?
Re: SplitUp.lua: NPCs that split upon death
Posted: Sat Mar 02, 2019 9:10 pm
by PixelPest
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
Re: SplitUp.lua: NPCs that split upon death
Posted: Sun Mar 03, 2019 8:30 am
by The Dwarven Digger
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.