EliteMasterEric / EnigmaEngine

A fork of FNF's Kade Engine that combines its QoL features with true mod support and new gameplay enhancements
https://enigmaengine.github.io/
Other
12 stars 1 forks source link

Enhancement: Tree-Based Dialog Engine #34

Open EliteMasterEric opened 2 years ago

EliteMasterEric commented 2 years ago

See Shaggy v2.5

isakube commented 2 years ago

haha funny "tree" get it because shaggy likes saying tree

it's visual novel time. Friday Night Fever, eat your heart out.

EliteMasterEric commented 2 years ago

Train-Based Dialog Engine

Seriously though, Thunderstorm is fucking dope and the means to access the secret level is amazing

One hurdle is that we want to define a flexible format for defining the trees in.

It needs to be able to support dialog branches that loop back to earlier in the tree, displaying whether certain branches have been read, dialog branches that perform special actions, the text of the dialog should be separate from the tree structure for later localization support (#12), add the ability to define the dialog stage and display sprites/play animations, and add the ability to perform a code action when certain dialog branches are reached.

Code actions should likely use the hscript scripting API (currently in developmen), and would provide an action ID as an argument. A script might look something like this:

// File: _append/scripts/onDialogAction.txt
// File should be in _append to prevent one mod from overriding another mod's dialog actions.

if (actionID == "zephyr_acceptQuest") {
    FlxG.save.data.zephyrQuestAccepted = true;
    AwardManager.grantAward("journey_begins");
    FlxG.save.data.songsUnlocked["adventure"] = true;
}

There should also be an ability to return which dialog branch to resume at based on the script result. A special action which loads a specific song or playlist of songs in story mode should also be provided for convenience, since that will be the most common result of a given set of dialog.

The Zephyr mask piece collectibles would also be a cool test to ensure the scripting API has all the desired functionality. In onCreateStage, check for if the stage is in a certain difficulty and in story mode, and if so initialize a sprite. In onUpdatePlayState, animate or translate the sprite as desired. Something to allow for a script to run when the sprite is clicked or hovered over? And a script for onCompleteSong that checks if the condition set in the sprite click script was set, and if so, sets a value in FlxG.save.data. Then later, the dialog code action checks that parameter of your save data.

isakube commented 2 years ago

~Seriously though, Thunderstorm is fucking dope and the means to access the secret level is amazing~

I like the way you get to Talladega but man I hate playing the song. It's somehow harder than Campaign Final Destination which I don't fuckin understand

~More notes = harder chart~