visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Share and discuss custom LunaLua code and content packs for SMBX2.
Max Flower
Rex
Rex
Posts: 32
Joined: Mon Apr 22, 2019 11:30 pm
Pronouns: He/Him

visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Postby Max Flower » Sun Mar 31, 2024 9:45 pm

Happy April First :)

Image

visualNovel.lua completely changes how a level is controlled from being a side-scroller to being a 2D "Ace Attorney-like" Visual Novel, allowing for talking to npcs with a visual sprite of the npc, there's a lot to cover so hopefully it all makes sense.
Credits: show
- Mario sprites ripped from Puzzles & Dragons: Super Mario Bros Edition by Ploaj
- Gumshoe sprites ripped from Phoenix Wright: Ace Attorney Trilogy by Ploaj
- Nagito sprites ripped from Danganronpa 2: Goodbye Despair by kendotlibero
- SFX ripped from Phoenix Wright: Ace Attorney by Alkraid
Script Structure: show
The luna.lua file includes an example for how to structure your script but I'll also explain it here.
This is very much based on tables, there are two tables that you need, your message set and your script. Your message set contains all the information for a set of messages while your script is the collection of all your message sets, you can even trigger functions inside of your script.
The way your message sets should be organized should be like this:

Code: Select all

-- The name of the message set can be anything.
messageSet = {
-- All the variables you  see here NEED to be in the message set.
    Name = "Mario",
    ImageFolder = "Mario",      	-- The name of the folder the graphics are in, must be in the level's Graphics folder.
    x = 70,                     	-- The position of the main character image.
    y = 10,                   		-- The position of the main character image.
    Messages = {                	-- All the lines of the message set, "Emotion" is any image found in the character folder, "Message" is what the character will actually say.
        {Emotion = "happy", Message = "Howdy! It's a me, a Mario!"},
        {Emotion = "ready", Message = "Or should I say.... Chris Pratt???"},
        {Emotion = "ready", Message = "Or should I say.... Garfield???"},
        {Emotion = "happy", Message = "Anyway, welcome to visualNovel.lua!"},
    }
}
The way your scripts should be organized is like this:

Code: Select all

-- The collection of message sets in one big script, can be named anything
Script = {
-- Place each message set into here.
    messageOne,
    messageTwo,
    messageThree,
    messageFour,
    {function() SFX.play(19) end},                       -- You can have functions in your script, it HAS to be surrounded by curly brackets.
    "end"                                                -- Each script has to end with end.
}
One last thing, you can trigger your script at any time you want and the game will pause while it's running, so nothing distracts from the script.
In order to trigger the script you need to run this anywhere within your code.

Code: Select all

visualNovel.loadScript(Script)
How To Install: show
  1. Drag the contents of the visualNovel folder into your level or episode folder.
  • You're all done! The luna.lua file comes with an example for how to use visualNovel.lua
  • If there's already a luna.lua file in your level folder and don't want to override it, add

    Code: Select all

    visualNovel = require("visualNovel")
    to luna.lua and it will work the same.
One last thing, if you're using visualNovel.lua in your episode please let me know, I'd love to see what other people do with this!

Pixelated_Perfection
Bob-Omb
Bob-Omb
Posts: 21
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: He/They

Re: visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Postby Pixelated_Perfection » Mon Apr 01, 2024 8:34 am

the funniest part of this is i could see this actually getting use in a more story-driven episode too

DeviousQuacks23
Spiny
Spiny
Posts: 27
Joined: Tue Apr 11, 2023 9:29 am
Pronouns: him

Re: visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Postby DeviousQuacks23 » Mon Apr 01, 2024 8:34 am

w h a t

Pixelated_Perfection
Bob-Omb
Bob-Omb
Posts: 21
Joined: Fri Feb 25, 2022 1:23 pm
Pronouns: He/They

Re: visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Postby Pixelated_Perfection » Mon Apr 01, 2024 11:13 am

Image

Just_Thomas
Spike
Spike
Posts: 260
Joined: Sat Dec 16, 2023 3:32 am
Pronouns: he/him

Re: visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Postby Just_Thomas » Mon Apr 01, 2024 1:50 pm

Kudos you released something real but still funny on that day instead to annoy people with lame jokes (like most people and website hosts do ...).
SOMEBODY will make a use of it (not necessarily just one person, you know what I mean).

lugiaTheAntarticLord
Cheep-Cheep
Cheep-Cheep
Posts: 13
Joined: Wed Jun 10, 2020 3:24 pm

Re: visualNovel.lua v1.0 - 2D Visual Scenes! (JUST LIKE ACE ATTORNEY!)

Postby lugiaTheAntarticLord » Fri Apr 05, 2024 4:26 pm

Literally 1984


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari