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: 8541
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.
The ABC of Creation
________________________________________________________
Image

User avatar
Eri7
Banned
Posts: 1772
Joined: Sat Jan 28, 2017 4:48 pm
Flair: Good Foundation allows for strong Execution
Current Project: Producer of the Novaverse
Chat Username: Eri7
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: 8541
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"
The ABC of Creation
________________________________________________________
Image

User avatar
MrCaves
Koopa Troopa
Koopa Troopa
Posts: 26
Joined: Sat Jun 08, 2019 12:51 pm
Chat Username: MrCaves

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: 8541
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.
The ABC of Creation
________________________________________________________
Image

User avatar
sammerbro
Lakitu
Lakitu
Posts: 404
Joined: Sat Sep 22, 2018 9:53 am
Flair: playing and making SMBX stuff
Current Project: Sam Lev Boss Rush 5
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: 395
Joined: Sun Mar 12, 2017 8:07 am
Flair: yeet
Current Project: Super Mario Khroma
Chat Username: AndrewPixel#2486
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: 8541
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.
The ABC of Creation
________________________________________________________
Image

User avatar
Radiance
Level Reviewer
Level Reviewer
Posts: 1295
Joined: Thu Dec 10, 2015 7:53 am
Current Project: viewtopic.php?t=16308

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: 8541
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.
The ABC of Creation
________________________________________________________
Image

User avatar
hEllO tHerE
Spiny
Spiny
Posts: 59
Joined: Mon Jul 22, 2019 4:53 pm
Flair: totally dont liek pizza n stuf
Current Project: hEllO tHerE World and 5 Levels of Hell (on hiatus)
Chat Username: hEllO tHerE

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: 2163
Joined: Fri Dec 20, 2013 7:07 pm
Current Project: Project planned; waiting for SMBX2 Beta 4

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: 6365
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: 652
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
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: 8541
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?
The ABC of Creation
________________________________________________________
Image

User avatar
DrMekar
Koopa Shell
Koopa Shell
Posts: 652
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
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: 8541
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?
The ABC of Creation
________________________________________________________
Image

User avatar
DrMekar
Koopa Shell
Koopa Shell
Posts: 652
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Current Project: Mario Heroes: The First Chapter Remade (MH1.5)
Chat Username: Doc
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: 8541
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.
The ABC of Creation
________________________________________________________
Image


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests