StoryScript

StoryScript Reference

Use this reference to quickly find the create commands, code snippets and concepts available in StoryScript.

Create a new game and switching between games

To create a new game, run this command in your IDE's terminal:

npm run create-game GameName

To switch between games, open the currentGameName.js file in your repository's root and change the gameName constant to the name of the game you want to work on.

Create commands

These commands create new entities for your games. Run them in the terminal of your IDE. They will be added to the mentioned folder in your game's directory. You can get an idea on how to work with the entities in the tutorial shown.

Create Command Folder Tutorial
Location
npm run scl LocationName
locations tutorial 2, tutorial 8
Feature (standalone)
npm run scf FeatureName
features tutorial 4
Map
npm run scm MapName
maps tutorial 3
Item
npm run sci ItemName
items tutorial 4, tutorial 9
Key
npm run sck KeyName
items tutorial 10
Enemy
npm run sce EnemyName
enemies tutorial 10
Person
npm run scp PersonName
persons tutorial 11
Quest
npm run scq QuestName
quests tutorial 11
Action (standalone)
npm run sca ActionName
actions tutorial 8

Code snippets

These snippets are available to create additional properties for your entities quickly. Run them inside of the file type specified using your IDE's autocomplete functionality.

Context File type Snippet Purpose
Locations .ts ssdestination Adds a new destination to the location's destinations array
Locations .ts ssbarriers Adds a new barriers array to a location's destination with one barrier
Locations .ts ssbarrier Adds a new barrier to a location's destination's barriers array
Locations .ts ssfeature-inline Adds a new inline feature to a location's features array
Maps .ts ssmaplocation Adds a new map location to a map's locations array
Combinations .ts sscombinationaction Adds a combination action to your game's getCombinationActions method of your setup rules
Combinations .ts sscombination Adds combinations to a feature (remember that items, enemies etc. are also features!)
Combinations .ts sscombine Adds a new combine option to a feature's combinations array
Conversations .ts ssconversationaction Adds a new conversation action to a person's conversation
(Multiple) .ts ssaction Adds a new StoryScript action
(Multiple) .ts ssfunction Adds a new StoryScript function
Character creation .ts ssattributes Adds a new StoryScript attributes step
Character creation .ts ssattribute Adds a new attribute list
Character creation .ts ssattributeentry Adds a new attribute entry
Character creation .ts ssquestions Adds a new questions step
Character creation .ts ssquestion Adds a new question
Character creation .ts ssquestionentry Adds a new question entry
Locations, Persons .ts sstrade Adds a new trade option to a location or a person
Persons .html ssconversation Adds a new conversation
Persons .html ssnode Adds a new conversation node
Persons .html ssreply Adds a new conversation reply
Locations, Items, Enemies, Persons .html ssdescription Adds a new description
Locations .html ssfeature Adds a new text feature
Locations .html ssvisualfeatures Adds a new visual features collection
Locations .html ssarea Adds a new visual feature
Any description or conversation node .html ssaudio Add a new audio element