Page 1 of 1

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

Posted: Sun Mar 31, 2024 9:45 pm
by Max Flower
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)
Download: show
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!

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

Posted: Mon Apr 01, 2024 8:34 am
by Pixelated_Perfection
the funniest part of this is i could see this actually getting use in a more story-driven episode too

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

Posted: Mon Apr 01, 2024 8:34 am
by DeviousQuacks23
w h a t

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

Posted: Mon Apr 01, 2024 11:13 am
by Pixelated_Perfection
Image

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

Posted: Mon Apr 01, 2024 1:50 pm
by Just_Thomas
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).

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

Posted: Fri Apr 05, 2024 4:26 pm
by lugiaTheAntarticLord
Literally 1984