extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Share and discuss custom LunaLua code and content packs for SMBX2.
MrDoubleA
Flurry
Flurry
Posts: 385
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?
Pronouns: he/him

extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby MrDoubleA » Mon Jun 21, 2021 4:35 pm

This is a library that adds a handful of extra settings for all NPC's. As a bonus, it also fixes the section index of out-of-bounds NPC's.

Image

Download
Last edited by MrDoubleA on Fri Jul 02, 2021 1:08 pm, edited 1 time in total.

Chilly14
Snifit
Snifit
Posts: 234
Joined: Thu Jul 18, 2019 10:28 pm
Flair: wash your hands and stay at home
Pronouns: he/him

Re: extraNPCProperties.lua - global NPC json files finally get used

Postby Chilly14 » Mon Jun 21, 2021 5:24 pm

Woohoo! Can't wait to use this!

Murphmario
Chargin' Chuck
Chargin' Chuck
Posts: 2382
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: extraNPCProperties.lua - global NPC json files finally get used

Postby Murphmario » Tue Jun 22, 2021 9:26 am

Looking at this, it seems really useful! Good job.

Sambo
Snifit
Snifit
Posts: 208
Joined: Fri Jan 24, 2014 6:43 pm

Re: extraNPCProperties.lua - global NPC json files finally get used

Postby Sambo » Tue Jun 22, 2021 1:58 pm

This looks pretty useful, especially the Tags and Max Generated NPCs settings. Nice work!

MrDoubleA
Flurry
Flurry
Posts: 385
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby MrDoubleA » Fri Jul 02, 2021 1:09 pm

Choccycon's devkit made me realise some tiny bugs were in here! So have v1.0.1.

ShadowLabrys101
Bit
Bit
Posts: 73
Joined: Thu Jan 09, 2014 3:14 pm

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby ShadowLabrys101 » Sat Jul 03, 2021 9:37 am

So, how do you add these to an episode?

MrDoubleA
Flurry
Flurry
Posts: 385
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby MrDoubleA » Sat Jul 03, 2021 10:20 am

ShadowLabrys101 wrote:
Sat Jul 03, 2021 9:37 am
So, how do you add these to an episode?
Unzip it in your episode/level folder and put this in your luna.lua file:

Code: Select all

local extraNPCProperties = require("extraNPCProperties")

ChunkyChimp
Spiny
Spiny
Posts: 26
Joined: Tue Sep 01, 2020 9:02 pm
Flair: I TAKE GFX FOR MY OWN LEVELS

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby ChunkyChimp » Fri Jul 16, 2021 4:41 pm

Where do I find this example screenshot ingame? I have the "local require" part in luna.lua done.

MrDoubleA
Flurry
Flurry
Posts: 385
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby MrDoubleA » Fri Jul 16, 2021 9:42 pm

ChunkyChimp wrote:
Fri Jul 16, 2021 4:41 pm
Where do I find this example screenshot ingame? I have the "local require" part in luna.lua done.
Right click any NPC in the editor and scroll down. If you have it installed correctly, you should see the options there.

ChunkyChimp
Spiny
Spiny
Posts: 26
Joined: Tue Sep 01, 2020 9:02 pm
Flair: I TAKE GFX FOR MY OWN LEVELS

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby ChunkyChimp » Fri Jul 16, 2021 9:52 pm

MrDoubleA wrote:
Fri Jul 16, 2021 9:42 pm
ChunkyChimp wrote:
Fri Jul 16, 2021 4:41 pm
Where do I find this example screenshot ingame? I have the "local require" part in luna.lua done.
Right click any NPC in the editor and scroll down. If you have it installed correctly, you should see the options there.
ok then i must have it installed incorrectly. i will reinstall and try again

TheGameyFireBro105
Eerie
Eerie
Posts: 742
Joined: Thu Jan 09, 2020 6:09 pm
Flair: Good at remakes
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby TheGameyFireBro105 » Tue Jul 20, 2021 3:50 pm

Could you add an option to make an NPC spawn like a Projectile Cheep Cheep?

Chilly14
Snifit
Snifit
Posts: 234
Joined: Thu Jul 18, 2019 10:28 pm
Flair: wash your hands and stay at home
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby Chilly14 » Sat Jun 04, 2022 10:19 pm

What is the exact method for using tags in Lua? As in getting all NPCs with a specific tag.

MrDoubleA
Flurry
Flurry
Posts: 385
Joined: Mon Aug 20, 2018 7:02 am
Flair: How much munchers?
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby MrDoubleA » Fri Jun 10, 2022 6:59 pm

Chilly14 wrote:
Sat Jun 04, 2022 10:19 pm
What is the exact method for using tags in Lua? As in getting all NPCs with a specific tag.
You can do:

Code: Select all

for _,v in ipairs(extraNPCProperties.getWithTag("myTag")) do
	-- my code here
end

Chilly14
Snifit
Snifit
Posts: 234
Joined: Thu Jul 18, 2019 10:28 pm
Flair: wash your hands and stay at home
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby Chilly14 » Fri Jun 10, 2022 8:24 pm

MrDoubleA wrote:
Fri Jun 10, 2022 6:59 pm
Chilly14 wrote:
Sat Jun 04, 2022 10:19 pm
What is the exact method for using tags in Lua? As in getting all NPCs with a specific tag.
You can do:

Code: Select all

for _,v in ipairs(extraNPCProperties.getWithTag("myTag")) do
	-- my code here
end
Ah, thanks!

mariobrigade2018
Spike
Spike
Posts: 275
Joined: Wed May 24, 2023 7:00 pm
Flair: Normie in coding who dreams of making a Mario game
Pronouns: he/him

Re: extraNPCProperties.lua (v1.0.1) - global NPC json files finally get used

Postby mariobrigade2018 » Fri Mar 08, 2024 12:12 am

MrDoubleA wrote:
Fri Jun 10, 2022 6:59 pm
Chilly14 wrote:
Sat Jun 04, 2022 10:19 pm
What is the exact method for using tags in Lua? As in getting all NPCs with a specific tag.
You can do:

Code: Select all

for _,v in ipairs(extraNPCProperties.getWithTag("myTag")) do
	-- my code here
end
Where would I put this piece of code?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 4 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari