spawnzones.lua - Make your setups actually work

Share and discuss custom LunaLua code and content packs for SMBX2.
Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

spawnzones.lua - Make your setups actually work

Postby Emral » Mon May 06, 2019 8:52 am

While working on my SLAM level I got frustrated at how NPCs only start spawning once the player comes onscreen so I wrote a quick thing to turn the SMB3 blue block sizeable (ID 27) into a marker for custom spawn regions. While the player is inside one of those regions, all NPCs inside that region will remain "onscreen".

Only whipped up in a moment so it's not 2 player compatible in this iteration, but that wouldn't be too hard to add if anyone really needs it.

Download:
https://pastebin.com/fr8cYLAW

Demo:
https://i.imgur.com/HWoAjfg.mp4
Notice how the generator loop for the Rammerheads already is in full motion once Mario comes onscreen.

How to use:
Load the library and place Block ID 27 to define a spawn region.

Eri7
Banned
Posts: 1770
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby Eri7 » Mon May 06, 2019 2:02 pm

Well this is really nice and useful, i too hate how npcs despawn so thank you for this script Enjl.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Mon May 06, 2019 6:50 pm

Serves me right to upload something slapped together in an hour... little update to the pastebin that...
-adds spawnzones.block which you can customize in your lua file to easily change what id the spawn zone block is
-fixes a bug where npcs would respawn while they'd still be considered "onscreen"

MrCaves
Fighter Fly
Fighter Fly
Posts: 49
Joined: Sat Jun 08, 2019 12:51 pm

Re: spawnzones.lua - Make your setups actually work

Postby MrCaves » Sat Aug 03, 2019 6:47 pm

Can this be used for levels outside of slam?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Sat Aug 03, 2019 7:05 pm

MrCaves wrote:
Sat Aug 03, 2019 6:47 pm
Can this be used for levels outside of slam?
Go nuts.

sammerbro
Buster Beetle
Buster Beetle
Posts: 404
Joined: Sat Sep 22, 2018 9:53 am
Flair: playing and making SMBX stuff
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby sammerbro » Sat Aug 03, 2019 7:07 pm

MrCaves wrote:
Sat Aug 03, 2019 6:47 pm
Can this be used for levels outside of slam?
Of course it can!

Akromaly
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 425
Joined: Sun Mar 12, 2017 8:07 am
Flair: anemoia
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby Akromaly » Mon Mar 09, 2020 4:38 pm

These spawnzones are really amazing, is there a way to specify which NPCs are affected by them? It would really improve the whole thing

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Mon Mar 09, 2020 4:44 pm

AndrewPixel wrote:
Mon Mar 09, 2020 4:38 pm
These spawnzones are really amazing, is there a way to specify which NPCs are affected by them? It would really improve the whole thing
Not at the moment, no. I've never thought of that since I haven't needed it.

Radiance
Boomerang Bro
Boomerang Bro
Posts: 1335
Joined: Thu Dec 10, 2015 7:53 am
Pronouns: he/him

Re: spawnzones.lua - Make your setups actually work

Postby Radiance » Tue Apr 07, 2020 4:46 am

Are platforms that uses lineguides supported by this?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Tue Apr 07, 2020 6:39 am

Radiance wrote:
Tue Apr 07, 2020 4:46 am
Are platforms that uses lineguides supported by this?
Should be.

hEllO tHerE
Bit
Bit
Posts: 61
Joined: Mon Jul 22, 2019 4:53 pm
Flair: totally dont liek pizza n stuf

Re: spawnzones.lua - Make your setups actually work

Postby hEllO tHerE » Fri Apr 10, 2020 8:58 am

Is this a Chinese bootleg ripoff version of the spawnzones in the Devkit?


EDIT: Also, what is a .lua.lua? An enhanced version of .lua?

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

Re: spawnzones.lua - Make your setups actually work

Postby Murphmario » Fri Apr 10, 2020 9:11 am

hEllO tHerE wrote:
Fri Apr 10, 2020 8:58 am
Is this a Chinese bootleg ripoff version of the spawnzones in the Devkit?


EDIT: Also, what is a .lua.lua? An enhanced version of .lua?
I'm pretty sure this is the same as the devkit version of the spawnzones. If not, then this came first.

Also, that's just the filename.

Cedur
Raccoon Mario
Raccoon Mario
Posts: 7073
Joined: Tue Jun 28, 2016 10:14 am
Flair: I'm gone, for chess and minesweeper
Pronouns: he/him

Re: spawnzones.lua - Make your setups actually work

Postby Cedur » Fri Apr 10, 2020 9:28 am

hEllO tHerE wrote:
Fri Apr 10, 2020 8:58 am
Is this a Chinese bootleg ripoff version of the spawnzones in the Devkit?]

errrrm ... just the fact that it's called .lua in this thread also implies that this is in no way related to 1.4.

DrMekar
Eerie
Eerie
Posts: 779
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby DrMekar » Sat Jul 11, 2020 5:50 pm

May I ask how to load this?

I tried the basic loadfunction

Code: Select all

local spawnzones= API.load("spawnzones");
Though it shows this Error:
Image

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Sun Jul 12, 2020 2:48 am

DrMekar wrote:
Sat Jul 11, 2020 5:50 pm
May I ask how to load this?

I tried the basic loadfunction

Code: Select all

local spawnzones= API.load("spawnzones");
Though it shows this Error:
Image
Where did you place spawnzones.lua relative to the level or episode folder?

DrMekar
Eerie
Eerie
Posts: 779
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby DrMekar » Sun Jul 12, 2020 5:35 am

Enjl wrote:
Sun Jul 12, 2020 2:48 am
DrMekar wrote:
Sat Jul 11, 2020 5:50 pm
May I ask how to load this?

I tried the basic loadfunction

Code: Select all

local spawnzones= API.load("spawnzones");
Though it shows this Error:
Image
Where did you place spawnzones.lua relative to the level or episode folder?
I tried out both. The Error Message from the Image appeared when it was the Episode Folder.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Sun Jul 12, 2020 6:23 am

can i get some screenshots?

DrMekar
Eerie
Eerie
Posts: 779
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby DrMekar » Sun Jul 12, 2020 8:03 am

Enjl wrote:
Sun Jul 12, 2020 6:23 am
can i get some screenshots?
On a Level or Episode Base? I'd only need the spawnzones.lua for a single Boss right now.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9737
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: spawnzones.lua - Make your setups actually work

Postby Emral » Sun Jul 12, 2020 8:11 am

DrMekar wrote:
Sun Jul 12, 2020 8:03 am
Enjl wrote:
Sun Jul 12, 2020 6:23 am
can i get some screenshots?
On a Level or Episode Base? I'd only need the spawnzones.lua for a single Boss right now.
Any screenshots that would help provide further context so I would have a chance at figuring out what the current situation even is. If you don't know what this entails just zip up the level with all required files and pm it to me.
E: The error was that the file was called spawnzones.lua.lua. Please when downloading this make sure the filename is correct.

Hammerless Penguin
Snifit
Snifit
Posts: 203
Joined: Sat Sep 22, 2018 6:17 am
Flair: Just kicking that kirby to the curb!
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby Hammerless Penguin » Sun Aug 23, 2020 5:14 pm

Sorry if this sounds like a dumb question but how do you use this? I placed the blue sizable block where I want my npcs to stay onscreen but nothing happens. Can you give a better example how to use this like how it is used in the editor?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari