Page 1 of 2
spawnzones.lua - Make your setups actually work
Posted: Mon May 06, 2019 8:52 am
by Emral
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Mon May 06, 2019 2:02 pm
by Eri7
Well this is really nice and useful, i too hate how npcs despawn so thank you for this script Enjl.
Re: spawnzones.lua - Make your setups actually work
Posted: Mon May 06, 2019 6:50 pm
by Emral
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"
Re: spawnzones.lua - Make your setups actually work
Posted: Sat Aug 03, 2019 6:47 pm
by MrCaves
Can this be used for levels outside of slam?
Re: spawnzones.lua - Make your setups actually work
Posted: Sat Aug 03, 2019 7:05 pm
by Emral
MrCaves wrote: ↑Sat Aug 03, 2019 6:47 pm
Can this be used for levels outside of slam?
Go nuts.
Re: spawnzones.lua - Make your setups actually work
Posted: Sat Aug 03, 2019 7:07 pm
by sammerbro
MrCaves wrote: ↑Sat Aug 03, 2019 6:47 pm
Can this be used for levels outside of slam?
Of course it can!
Re: spawnzones.lua - Make your setups actually work
Posted: Mon Mar 09, 2020 4:38 pm
by Akromaly
These spawnzones are really amazing, is there a way to specify which NPCs are affected by them? It would really improve the whole thing
Re: spawnzones.lua - Make your setups actually work
Posted: Mon Mar 09, 2020 4:44 pm
by Emral
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Tue Apr 07, 2020 4:46 am
by Radiance
Are platforms that uses lineguides supported by this?
Re: spawnzones.lua - Make your setups actually work
Posted: Tue Apr 07, 2020 6:39 am
by Emral
Radiance wrote: ↑Tue Apr 07, 2020 4:46 am
Are platforms that uses lineguides supported by this?
Should be.
Re: spawnzones.lua - Make your setups actually work
Posted: Fri Apr 10, 2020 8:58 am
by hEllO tHerE
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?
Re: spawnzones.lua - Make your setups actually work
Posted: Fri Apr 10, 2020 9:11 am
by Murphmario
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Fri Apr 10, 2020 9:28 am
by Cedur
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Sat Jul 11, 2020 5:50 pm
by DrMekar
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:

Re: spawnzones.lua - Make your setups actually work
Posted: Sun Jul 12, 2020 2:48 am
by Emral
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:
Where did you place spawnzones.lua relative to the level or episode folder?
Re: spawnzones.lua - Make your setups actually work
Posted: Sun Jul 12, 2020 5:35 am
by DrMekar
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:
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Sun Jul 12, 2020 6:23 am
by Emral
can i get some screenshots?
Re: spawnzones.lua - Make your setups actually work
Posted: Sun Jul 12, 2020 8:03 am
by DrMekar
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Sun Jul 12, 2020 8:11 am
by Emral
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.
Re: spawnzones.lua - Make your setups actually work
Posted: Sun Aug 23, 2020 5:14 pm
by Hammerless Penguin
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?