tileRandomizer.lua - Rudimentary aestheticizer

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

tileRandomizer.lua - Rudimentary aestheticizer

Postby Enjl » Mon May 06, 2019 8:51 am

Ever worked with a tileset that has multiple options for fill tiles or other shenanigans? Don't feel like placing all those SMB2 LEGOs yourself?
Well...

Download:
https://pastebin.com/eu4t5EWT

Screenshot:
Spoiler: show
Image
Image
How to use:
tileRandomizer.register(98, {68, 70, 71})
First argument is the source ID, second is a list of possible transformations. There's, by default, a 1/5 chance that the block gets transformed at all. You can edit the file directly to
-change the chance
-change the seed

Seed, you ask? Oh yeah. This library uses a standalone instance of rng.lua to ensure your level doesn't magically look different on repeat playthroughs. The seed can be any number, so feel free to experiment until you find something that suits your level.
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: tileRandomizer.lua - Rudimentary aestheticizer

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

Well damn, i didn't believe this was possible but you just made our lives way, way easier, thanks Enjl.

User avatar
Hoeloe
Kamikaze Koopa
Kamikaze Koopa
Posts: 1210
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Current Project: A2XT Episode 2

Re: tileRandomizer.lua - Rudimentary aestheticizer

Postby Hoeloe » Mon May 06, 2019 7:45 pm

Enjl wrote:
Mon May 06, 2019 8:51 am
Seed, you ask? Oh yeah. This library uses a standalone instance of rng.lua to ensure your level doesn't magically look different on repeat playthroughs.
This is unnecessary. The version of RNG.lua that exists in the maglx3 build lets you generate RNG objects for precisely this purpose.

You don't even need to load any libraries, it's just:

Code: Select all

RNG.new(seed)

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

Re: tileRandomizer.lua - Rudimentary aestheticizer

Postby Enjl » Mon May 06, 2019 7:48 pm

Hoeloe wrote:
Mon May 06, 2019 7:45 pm
Enjl wrote:
Mon May 06, 2019 8:51 am
Seed, you ask? Oh yeah. This library uses a standalone instance of rng.lua to ensure your level doesn't magically look different on repeat playthroughs.
This is unnecessary. The version of RNG.lua that exists in the maglx3 build lets you generate RNG objects for precisely this purpose.

You don't even need to load any libraries, it's just:

Code: Select all

RNG.new(seed)
Didn't know about that. I presume this returns the rng object and that object can then be used just like the library itself? myRngObject.irandomEntry, for example.
The ABC of Creation
________________________________________________________
Image

User avatar
Hoeloe
Kamikaze Koopa
Kamikaze Koopa
Posts: 1210
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Current Project: A2XT Episode 2

Re: tileRandomizer.lua - Rudimentary aestheticizer

Postby Hoeloe » Mon May 06, 2019 7:49 pm

Enjl wrote:
Mon May 06, 2019 7:48 pm
Didn't know about that. I presume this returns the rng object and that object can then be used just like the library itself? myRngObject.irandomEntry, for example.
Yep. It's a useful feature.

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: tileRandomizer.lua - Rudimentary aestheticizer

Postby AndrewPixel » Wed May 08, 2019 9:14 am

Image
ImageImage

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: tileRandomizer.lua - Rudimentary aestheticizer

Postby Eri7 » Wed May 08, 2019 1:03 pm

AndrewPixel wrote:
Wed May 08, 2019 9:14 am
Image
IIRC he did state he likes watching CarlSagan42 who is mario maker focused youtuber.

Rhosty
Larry Koopa
Larry Koopa
Posts: 2454
Joined: Sun Dec 11, 2016 8:02 pm
Flair: All toasters toast toast
Current Project: Nothing
Chat Username: practical

Re: tileRandomizer.lua - Rudimentary aestheticizer

Postby Rhosty » Wed May 08, 2019 11:22 pm

AndrewPixel wrote:
Wed May 08, 2019 9:14 am
Image
Don't we all?

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: tileRandomizer.lua - Rudimentary aestheticizer

Postby AndrewPixel » Thu May 09, 2019 8:26 am

Eureka wrote:
Wed May 08, 2019 11:22 pm
AndrewPixel wrote:
Wed May 08, 2019 9:14 am
Image
Don't we all?
definitely lol
ImageImage


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests