Creating an Alternate Start Scenario - KrisV-777/Alternate-Perspective GitHub Wiki
The menu system in Alternate Perspective is dynamically generated, enabling third-party mod authors to seamlessly add new starting options by simply placing .json files into the designated folder.
Prerequisites
Alternate Perspective utilizes quests to create its alternate starting scenarios. Each starting option hence requires a dedicated quest, which must include a start fragment script to manage the specific behavior of that option. In particular, calling Quest.Start() should port the player to the required location, with all needed gear, start the required quests and scenes and anything else necessary to make the scenario playable. It is assumed that you have already created such a quest for your start.
The menu system relies on .json files for configuration and provides a schema file to validate the structure. It is highly recommended to use a text editor like VSCode or any other tool capable of validating .json files against the schema to streamline your workflow. The schema in question is part of the repository, you can view it here. There is also an settings.json file in the .vscode folder which can be used to setup the validation in VSCode.
Creating the json
To add a new starting option to the Alternate Perspective menu, you must create a .json file that complies with the provided schema. This file specifies details such as the associated mod, quest ID, and the descriptions that will appear in the menu. In your working directory, create a new file at Data\\SKSE\\AlternatePerspective\\MyStart.json.
A basic .json structure is as follows:
[
{
"mod": "MyMod.esp",
"text": "Example Start",
"id": "0x123ABC",
}
]
This entry creates a new starting option in the menu under the name "Example Start." When this option is selected and the player attempts to exit the starting room, the quest with ID 0x123ABC in MyMod.esp will be started.
The text field should contain a short name (1-3 words) for the start option. Since this isn't a lot of space, I recommend to always include a description field to provide more context regarding the start option's functionality:
[
{
"mod": "MyMod.esp",
"text": "Example Start",
"description": "This example start will turn you into a rabbit.",
"id": "0x123ABC",
}
]
Furthermore, the menu can list an unlimited number of starting options, so to make your option more distinguishable, it is helpful to choose a unique color code to highlight your option. This can be done using the color field, allowing the option to stand out more:
[
{
"mod": "MyMod.esp",
"text": "Example Start",
"description": "This example start will turn you into a rabbit.",
"id": "0x123ABC",
"color": "0x00FF00"
}
]
This structure is sufficient for creating a simple start option with one quest. Note that the root object is an array, hence you are able to define multiple quests in a single file. This is recommended, as the menu cannot parse more than 128 individual files.
Lastly, there may be instances where you want to create multiple, thematic similar scenarios. Instead of making a new main-option for each event, you can also group them together using sub options. Simply replace the id key field with an suboptions array:
[
{
"mod": "MyMod.esp",
"text": "Example Start",
"description": "This example start will turn you into a cute animal.",
"color": "0x00FF00",
"suboptions": [
{
"text": "$AltPersp_Random",
"id": 0
},
{
"text": "Rabbit!",
"id": "0x123ABC"
},
{
"text": "Deer!",
"id": "0x159EFA"
},
{
"text": "Bird!",
"mod": "ExampleBirds.esp",
"id": "0xDEF987",
"color": "0x0000FF"
},
],
}
]
This is a more advanced configuration, so let's break the suboptions array down a little:
- The first suboption is a random option, defined by setting the
idfield to0. - The second and third suboptions behave as expected, inheriting the
modfrom the main option if the mod field is omitted. - The last suboption includes a
modfield, meaning that the quest with ID0xDEF987will be loaded fromExampleBirds.esprather thanMyMod.esp.
Additionally, this suboption has a uniquecolorfield, which changes the color of the selection indicator when chosen. If the color is not specified, it will inherit the highlight color defined in the main option.
Once you are done, save your file. Ensure it validates against the provided schema. Starting up the game with Alternate Perspective installed, you should be able to see your newly created option in Alternate Perspective's menu.