spawnzones.lua - Make your setups actually work

Share and discuss custom LunaLua code and content packs for SMBX2.
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8795
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

spawnzones.lua - Make your setups actually work

Postby Enjl » 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.
Ideas are useless if you can't make them real.
Image

User avatar
Eri7
Banned
Posts: 1772
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.

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

Re: spawnzones.lua - Make your setups actually work

Postby Enjl » 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"
Ideas are useless if you can't make them real.
Image

User avatar
MrCaves
Koopa Troopa
Koopa Troopa
Posts: 28
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?

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

Re: spawnzones.lua - Make your setups actually work

Postby Enjl » 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.
Ideas are useless if you can't make them real.
Image

User avatar
sammerbro
Lakitu
Lakitu
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!
Image
Image

User avatar
AndrewPixel
Bronze Yoshi Egg
Bronze Yoshi Egg
Posts: 402
Joined: Sun Mar 12, 2017 8:07 am
Flair: yeet
Contact:

Re: spawnzones.lua - Make your setups actually work

Postby AndrewPixel » 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
ImageImage

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

Re: spawnzones.lua - Make your setups actually work

Postby Enjl » 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.
Ideas are useless if you can't make them real.
Image

User avatar
Radiance
Level Reviewer
Level Reviewer
Posts: 1295
Joined: Thu Dec 10, 2015 7:53 am

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?

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

Re: spawnzones.lua - Make your setups actually work

Postby Enjl » 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.
Ideas are useless if you can't make them real.
Image

User avatar
hEllO tHerE
Spiny
Spiny
Posts: 59
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?
Spoiler: show
c-3 is the worst thing ever :evil:

I LIEK PIZZA N STUF :D

Image

User avatar
Murphmario
Larry Koopa
Larry Koopa
Posts: 2187
Joined: Fri Dec 20, 2013 7:07 pm

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.
Now taking graphics requests:
https://docs.google.com/forms/d/1urWpFq ... #responses

My graphics pack:
http://www.supermariobrosx.org/forums/v ... t=1960/url

Really tempted to just make a general graphics thread for all of my graphics instead of just making individual threads for each of them.

User avatar
Cedur
Toad
Toad
Posts: 6551
Joined: Tue Jun 28, 2016 10:14 am

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.
Image
More Supports: show

Image
Image

Still using the legacy editor? Get SMBX2 and PGE, it will improve your experience significantly. Here's why. And remember, Yoshis are tools to be used and discarded.

ShadowStarX (06/14/18) wrote: South Korea is easy deal

User avatar
DrMekar
Koopa Shell
Koopa Shell
Posts: 665
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
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

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

Re: spawnzones.lua - Make your setups actually work

Postby Enjl » 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?
Ideas are useless if you can't make them real.
Image

User avatar
DrMekar
Koopa Shell
Koopa Shell
Posts: 665
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.
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

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

Re: spawnzones.lua - Make your setups actually work

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

can i get some screenshots?
Ideas are useless if you can't make them real.
Image

User avatar
DrMekar
Koopa Shell
Koopa Shell
Posts: 665
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.
My Youtube Channel: https://www.youtube.com/channel/UC-8fzX ... subscriber

My Episodes & Projects:
ImageImage


If you want to support my Projects, put this in your signature. Thanks :)
Spoiler: show

Code: Select all

[url=https://www.supermariobrosx.org/forums/viewtopic.php?f=36&t=25110[/url]
Great Folks who support/ed my projects/in the past:

Suecra
jaf
Suckerman7 GM

Image

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

Re: spawnzones.lua - Make your setups actually work

Postby Enjl » 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.
Ideas are useless if you can't make them real.
Image

User avatar
Hammerless Penguin
Blooper
Blooper
Posts: 188
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?
Check out this big neat project coming soon to smbx2 beta4!
Image

Switch FC: SW-8458-1591-5797


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 6 guests