Share and discuss custom LunaLua code and content packs for SMBX2.
|
|
|
|
-
Enjl
- Cute Yoshi Egg

- Posts: 9021
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Orphion Egamalenitar Osmos IV, Esq.
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://drive.google.com/file/d/19g-JMP ... sp=sharing
Screenshot:
New in v2:
- Can alter the RNG seed from external code
- NEW: Can register BGOs to be replaced by other BGOs
- NEW: Can register Blocks to have randomized BGOs attached (pseudo-bgos, not real bgos) that move with the block and get hidden with it.
- NEW: Can add chance and pivot to all registrations
- Incompatible with v1
A usage example is included:
Code: Select all local tr2 = require("tileRandomizer2")
-- Sets the RNG seed. Guaranttes that the randomization is consistent across runs. Change number for different seed.
tr2.rng = RNG(12)
-- Registers block 3 to gain BGOs 1 or 37 at a 50% chance. The BGOs are offset by 32 pixels upwards.
-- Also registers block 272 to gain 84 or 85 at 25% chance. While there is no y-offset, the pivot is set so that this coordinate corresponds to the bottom center of the bgo, and that the block fixation point is the top center of the block.
tr2.registerBlockBGOPairs(
{{3}, {1, 37}, {chance = 0.5, yOffset = -32}},
{{272}, {84, 85}, {chance = 0.25, yOffset = 0, blockpivot = vector(0.5, 0), bgopivot=vector(0.5, 1)}}
)
-- Tells block 16 that it can become any block in the list at a 50% chance
-- Also tells block 3 to transform into block 272.
-- Block transformation happens before BGO registration, meaning the new 272 blocks will get pseudo BGOs as per the above registration.
tr2.registerBlockBlockPairs(
{{16}, {602, 603, 1111, 1112, 1113, 1114}, {chance = 0.5}},
{{3}, {272}, {chance = 0.5}}
)
-- BGO 128 may transform into any of the given IDs at a 75% chance. The pivot is set so that the bottom center is kept the same.
tr2.registerBgoBgoPairs(
{{128}, {84, 85, 127}, {chance = 0.75, pivot = vector(0.5, 1)}}
)
The general pattern is:
Code: Select all registrationCall(
{first registration},
{second registration},
...
)
And each registration is a table like:
Code: Select all {{list of object ids to apply this to}, {list of target IDs to transform into/spawn}, {settings table for chance, pivot...}}
Last edited by Enjl on Wed Dec 30, 2020 4:44 am, edited 2 times in total.
Ideas are useless if you can't make them real.
All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.
Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC
|
|
|
|
|
|
|
|
|
-
Eri7
- Banned
- Posts: 1770
- Joined: Sat Jan 28, 2017 4:48 pm
- Flair: Good Foundation allows for strong Execution
-
Contact:
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.
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Boomerang Bro

- Posts: 1311
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
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:
|
|
|
|
|
|
|
|
|
-
Enjl
- Cute Yoshi Egg

- Posts: 9021
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Orphion Egamalenitar Osmos IV, Esq.
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:
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.
Ideas are useless if you can't make them real.
All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.
Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Boomerang Bro

- Posts: 1311
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
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.
|
|
|
|
|
|
|
|
|
-
Eri7
- Banned
- Posts: 1770
- Joined: Sat Jan 28, 2017 4:48 pm
- Flair: Good Foundation allows for strong Execution
-
Contact:
Postby Eri7 » Wed May 08, 2019 1:03 pm
IIRC he did state he likes watching CarlSagan42 who is mario maker focused youtuber.
|
|
|
|
|
|
|
|
|
-
Rhosty
- Birdo

- Posts: 2632
- Joined: Sun Dec 11, 2016 8:02 pm
- Flair: person who constantly changes their avatar
- Pronouns: She/Her
Postby Rhosty » Wed May 08, 2019 11:22 pm
omg zoom is absolute trash, why does my school still use it
selective mutism is a nuisance
|
|
|
|
|
|
|
|
|
-
AndrewPixel
- Bronze Yoshi Egg

- Posts: 414
- Joined: Sun Mar 12, 2017 8:07 am
-
Contact:
Postby AndrewPixel » Thu May 09, 2019 8:26 am
Eureka wrote: ↑Wed May 08, 2019 11:22 pm
Don't we all?
definitely lol
|
|
|
|
|
|
|
|
|
-
Harmon
- Shy Guy

- Posts: 6
- Joined: Wed Nov 25, 2020 8:42 am
- Flair: Wahoo
- Pronouns: he/him
-
Contact:
Postby Harmon » Sun Nov 29, 2020 1:42 pm
When I try to use this, I get this error, regardless of which tiles I use. Could just be me being a newbie but I have no idea what this means.

signature
Don't use the email attached to my account to contact me.
|
|
|
|
|
|
|
|
|
-
Shocken Studios
- Spiny

- Posts: 27
- Joined: Fri Jul 19, 2019 6:02 pm
- Flair: Hi
Postby Shocken Studios » Tue Dec 22, 2020 12:38 pm
Harmon wrote: ↑Sun Nov 29, 2020 1:42 pm
When I try to use this, I get this error, regardless of which tiles I use. Could just be me being a newbie but I have no idea what this means.
i also get this
|
|
|
|
|
|
|
|
|
-
Enjl
- Cute Yoshi Egg

- Posts: 9021
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Orphion Egamalenitar Osmos IV, Esq.
Postby Enjl » Tue Dec 22, 2020 12:49 pm
Shocken Studios wrote: ↑Tue Dec 22, 2020 12:38 pm
Harmon wrote: ↑Sun Nov 29, 2020 1:42 pm
When I try to use this, I get this error, regardless of which tiles I use. Could just be me being a newbie but I have no idea what this means.
i also get this
Did you load the library?
local tileRandomizer = require("tileRandomizer")
Can't use a library that's not loaded!
Ideas are useless if you can't make them real.
All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.
Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC
|
|
|
|
|
|
|
|
|
-
Harmon
- Shy Guy

- Posts: 6
- Joined: Wed Nov 25, 2020 8:42 am
- Flair: Wahoo
- Pronouns: he/him
-
Contact:
Postby Harmon » Tue Dec 22, 2020 7:39 pm
Enjl wrote: ↑Tue Dec 22, 2020 12:49 pm
Shocken Studios wrote: ↑Tue Dec 22, 2020 12:38 pm
Harmon wrote: ↑Sun Nov 29, 2020 1:42 pm
When I try to use this, I get this error, regardless of which tiles I use. Could just be me being a newbie but I have no idea what this means.
i also get this
Did you load the library?
local tileRandomizer = require("tileRandomizer")
Can't use a library that's not loaded!
Ah my mistake lmao, works like a charm. Thanks!
signature
Don't use the email attached to my account to contact me.
|
|
|
|
|
|
|
|
|
-
Enjl
- Cute Yoshi Egg

- Posts: 9021
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Orphion Egamalenitar Osmos IV, Esq.
Postby Enjl » Wed Dec 30, 2020 4:44 am
Updated to version 2.0, a rewrite from scratch that I used in Subzero Heroes:
Download:
https://drive.google.com/file/d/19g-JMP ... sp=sharing
Screenshot:
New in v2:
- Can alter the RNG seed from external code
- NEW: Can register BGOs to be replaced by other BGOs
- NEW: Can register Blocks to have randomized BGOs attached (pseudo-bgos, not real bgos) that move with the block and get hidden with it.
- NEW: Can add chance and pivot to all registrations
- Incompatible with v1
For more info see the first post.
Ideas are useless if you can't make them real.
All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.
Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Boomerang Bro

- Posts: 1311
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Wed Dec 30, 2020 10:21 am
Now make a blue noise version.
|
|
|
|
|
|
|
|
|
-
Enjl
- Cute Yoshi Egg

- Posts: 9021
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Orphion Egamalenitar Osmos IV, Esq.
Postby Enjl » Thu Jan 07, 2021 10:46 am
Replace RNG(...) in line 3 with RNG.new(...)
Ideas are useless if you can't make them real.
All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.
Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC
|
|
|
|
|
|
|
|
|
-
Enjl
- Cute Yoshi Egg

- Posts: 9021
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Orphion Egamalenitar Osmos IV, Esq.
Postby Enjl » Thu Jan 07, 2021 12:36 pm
Ugh I forgot to push one change to this when I first uploaded it it seems.
Change all instances of "ls.rng." to "ls.rng:" in the file.
Ideas are useless if you can't make them real.
All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.
Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC
|
|
|
|
|
Return to “LunaLua”
Who is online
Users browsing this forum: No registered users and 0 guests
|