If you like the !adventure command, and your chat does, you may have a desire to make some changes to that system. This guide will attempt to walk you through creating new and unique adventures for your stream.
Make a Custom Copy of the Language File
The adventure system is driven by a language file in PhantomBot. As during each release, if you upgrade, you may end up overwriting your changes, it is recommended to copy the file from scripts/lang/english/games/games-adventureSystem.js to scripts/lang/custom. PhantomBot will always load the normal language files first, but will then load the custom files, overwriting any settings previously configured.
Creating your own Stories
With your ideas fresh in hand, you can work out new stories. Some things to consider:
- What will your adventure be about?
- You should have at least three parts written for your adventure. A opening scene, a scene for the victims, and a scene for the survivors.
- How many parts for your adventure do you want beyond the required three?
- What types of adventures fit into your chat? Perhaps you have a specific theme. Perhaps not.
Editing the Language File
You will want to use a specific type of text editor to modify the file. If you use Windows, do not use Notepad. Also, do not use a word processor. For Windows, we recommend Notepad++. For macOS, the built-in TextEdit or using vi or emacs from the Terminal is fine. In Linux, use your favorite text editor.
The File Contents
Upon first glance of the games-adventureSystem.js file, you may feel a little confused. Don’t be! Let’s walk you through a sample adventure and tell you what you need to do.
First, you can remove all of the adventures if you want, just be sure to write at least four adventures to overwrite the current ones, or some of them will be sucked into your bot if you decided to make a custom copy of the script and leave the stock PhantomBot version in place. If you are editing the file in place, then it doesn’t matter. You can also leave all of the stock adventures in place and just create your own.
Now, there is a format to adding an adventure:
$.lang.register('adventuresystem.stories.X.chapter.Y', 'Text for the chapter of the story...');
This is used to add a new entry to the language data store. You will use this method call to add your new adventure. X represents which story you are defining and Y defines which chapter. As mentioned before, you must have a minimum of three chapters.
First, start the adventure:
$.lang.register('adventuresystem.stories.1.chapter.1', 'Our brave adventurers set out on their quest to slay the dragon in the cave of despair.');`
This is the first story, and the first chapter of the story that is used when the adventure begins. We let chat know that a new adventure has begun.
Second, announce the victims:
$.lang.register('adventuresystem.stories.1.chapter.2', '(caught) are seen limping down the road, smoldering from being roasted by the dragon.');
This is the first story, and the second chapter of the story that is used when people lose, which are represented by the tag (caught) in the text. Use this to describe what happened to the losers.
Third, announce the survivors:
$.lang.register('adventuresystem.stories.1.chapter.3', 'Drinking mead and chanting the victory march of Amun Grool, (survivors) skip along, celebrating their victory!');
This is the first story, and the third chapter of the story that is used when people win, which are represented by the tag (survivors) in the text. Use this to describe what happened to the winners.
You may of course add in fillers as well. For example:
$.lang.register('adventuresystem.stories.1.chapter.1', 'Our brave adventurers set out on their quest to slay the dragon in the cave of despair.'); $.lang.register('adventuresystem.stories.1.chapter.2', 'The minstrels of Brave Sir Robin sing a happy tune.'); $.lang.register('adventuresystem.stories.1.chapter.3', 'Sick of the happy tune, the adventurers slay the minstrels.'); $.lang.register('adventuresystem.stories.1.chapter.4', '(caught) are seen limping down the road, smoldering from being roasted by the dragon.'); $.lang.register('adventuresystem.stories.1.chapter.5', 'Drinking mead and chanting the victory march of Amun Grool, (survivors) skip along, celebrating their victory!');
Note that if you use a quote (’) in your description, that you will need to enter it as ’ rather than just ’ for the language parser.
Also, be sure to pick a unique story number for each of your adventures. Otherwise you will just overwrite an adventure!
Have fun and let us know if you have any questions!