Hub Generator! (quickHub.lua)

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Hub Generator! (quickHub.lua)

Postby PixelPest » Sat Nov 26, 2016 2:20 pm

quickHub.lua is an easy-to-use API that generates an entire hub level and allows for quick gameplay of multiple levels through the editor. It also supports hubs through the normal engine as episodes, however a .wld file must be added with the hub level as the start. It also allows for some customisable features, more of which will be made available in the future. Pretty much all that you need is a player start position and a list of levels, then quickHub.lua does the rest! Shout-out to Horikawa who wrote the level loading script for Mario Challenge which is also used in this.

The download includes all of the needed assets plus a test world which can be played through the editor or the normal engine as a world.
How it looks: show
Image
Image
Image
How to use in 10 easy steps: show
  1. Download the files for quickHub.lua (as a .zip file) here: https://www.dropbox.com/s/qvanoeb0s5o0y ... a.zip?dl=0
  2. Extract the .zip file. Go into Assets and copy the quickHub.lua file and the folder titled quickHub.lua into your LuaScriptsLib folder.
    Image
  3. Put as many levels you want into a single folder. Example:
    Image
  4. Create a new level file. Name it "Hub". (Or you can skip steps 4 and 5 and copy it out of the Assets folder.)
    Image
  5. Go into the editor and place the player start position anywhere you want in the level file you created in step 4.
    Imagehttp://i.imgur.com/04NWWf9.jpg[/rimg]
  6. Create a lunaworld.lua file in the same folder.
    Image
  7. Open the file and write the following as the first line:

    Code: Select all

    local quickHub = API.load("quickHub");
  8. Write the following on the next line:

    Code: Select all

    quickHub.levelsList = {};
  9. List your levels inside the curly braces in quotation marks separated by commas, including the extensions. Example:

    Code: Select all

    quickHub.levelsList = {"Golden Crabs.lvl", "Rockin' Kamikaze Woods.lvl", "PTSL.lvl"};
  10. On the next line, write the following:

    Code: Select all

    quickHub.hubLevelName = "Hub.lvl";
    Now you can open your hub level through the editor. Hit test to play!
How to use other customisable features: show
  • quickHub.levelNamesList
    • Allows for levels to be named differently than their original filenames.
    • Desired names can be listed in a table as strings and their positions in the table MUST correspond to those in quickHub.levelsList.
    • Example:

      Code: Select all

      quickHub.levelNamesList = {[1] = "Dungeonous Gold Crab", [3] = "Pear Tree Snow Land"};
  • quickHub.powerups:
    • Allows for the player to collect power-ups at the beginning of the hub each time they enter it.
    • The following are the values it accepts:
      • Mushroom: 2 or POWERUP_MUSHROOM
      • Fire flower: 3 or POWERUP_FIREFLOWER
      • Leaf: 4 or POWERUP_LEAF
      • Tanooki: 5 or POWERUP_TANOOKI
      • Hammer suit: 6 or POWERUP_HAMMER
      • Ice flower: 7 or POWERUP_ICEFLOWER
    • Example:

      Code: Select all

      quickHub.powerups = {2, 3, 7};
  • quickHub.items
    • Similar to quickHub.powerups except instead it accepts items that the player can collect at the beginning of the hub each time they enter it.
    • The following are the values it accepts:
      • Yoshi: 1 or ITEM_YOSHI
      • Green boot: 2 or ITEM_GREENBOOT
      • Red boot: 3 or ITEM_REDBOOT
      • Blue boot: 4 or ITEM_BLUEBOOT
    • Example:

      Code: Select all

      quickHub.powerups = {2, 3, 7};
  • quickHub.musicPath
    • Sets the music for the hub.
    • By default this is:

      Code: Select all

      quickHub.musicPath = Misc.resolveFile("quickHub/default-music.mp3");
  • quickHub.doorImg
    • Sets the image used for the door in the hub (at this time must be 32x64).
    • By default this is:

      Code: Select all

      quickHub.doorImg = Graphics.loadImage(Misc.resolveFile("quickHub/background-92.png"));
Download: https://www.dropbox.com/s/qvanoeb0s5o0y ... a.zip?dl=0

Please tell me what you think and give me some ideas of what I should add to it, as well as mention any issues you find with it. Enjoy!

Snessy the duck
Mouser
Mouser
Posts: 2699
Joined: Sat Sep 20, 2014 6:04 am

Re: Hub Generator! (quickHub.lua)

Postby Snessy the duck » Sun Nov 27, 2016 6:28 am

Hey, this looks pretty darn cool! Could definetly be useful if you just wanna play some levels, or create a quick hub in general! Just a suggestion, it could be cool if you added the other yoshi colors to the quickHub items list!

Alagirez
Ludwig von Koopa
Ludwig von Koopa
Posts: 3616
Joined: Tue Dec 02, 2014 2:28 am
Flair: Legalize Awooo!
Pronouns: He/Him/That wolf
Contact:

Re: Hub Generator! (quickHub.lua)

Postby Alagirez » Wed Jan 18, 2017 1:33 am

Ok so i testes this cool stuff and i must say it's Pawsome, but i didn't know there is a character limit... (Max character : 25)


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari