Skip to content

Creating A Scene Config

Logodaedalus edited this page Nov 26, 2018 · 26 revisions

Summary

The scene config file is where you put all the information that tells StoryAssembler the details of how to use your content file to tell a story. Characters, goals, content libraries, even how characters are displayed is all set here.

If you're trying this for the first time, your best bet is to open up the example.json file in js/StoryAssembler/data/scene-configs and see how it works, and even just duplicate it and change the values (but be careful you step through each one and update it for your scene, as forgetting to change one may result in strange bugs that are hard to trace).

Because we use HanSON to parse it, you can use // to comment the file (as in example.json).

File Components

id

This is the id your scene has in the game, and the value you'll put into Coordinator.js to hook it up

characters

A character is a collection of custom template values and avatar states, packaged together under an id

  • Id: The unique identifier for your character
  • AvatarStates: This tells StoryAssembler when to display a particular avatar for your character.
    • The easiest one is done by just putting default in the array, which tells StoryAssembler to use that picture as the default one for the character, if no other avatars are valid.
    • They use the same state format as conditions in fragments, i.e. tension gte 2, which means "the state variable tension is greater than or equal to 2".
    • They're in an array, so ["tension gte 2", "friendliness lt 5"] means that particular avatar will only display if both are true
    • the arrays are "anded" together (so if even one state condition isn't true in them, the avatar won't display)

wishlist

A wishlist is a list of state conditions StoryAssembler will pick fragments to meet. Their basic format is [state variable] [comparison operator] [value] (for example, tension gt 4)

  • state variable: any word that doesn't contain special characters or spaces. Valid example: tension, char1Anger, possessesSecretPlotItem
  • comparison operator: gt (>) lt (<) gte (>=) lte (<=) eq (==)
  • value: any string or number

Advanced

  • You can add "persistent": true as a property, which means storyAssembler will constantly pick fragments to satisfy that. Keep in mind such wishlist items won't gate scenes from finishing, as they're never technically "satisfied".
    *Ex: { "condition": "friendly eq true", "persistent": true } (always prefer content with effects that set "friendly" to true)
  • You can force a wishlist item to be evaluated first or last using "order" : "first" or "order" : "last". Since wishlist items are evaluated in order (although it will satisfy out of order if, for example, item 1 2 and 3 aren't satisfiable but 4 is) you can use this as a bit of a cludge to make sure wishlist items that are towards the end of the scene don't get satisfied at the very beginning. *Ex: { "condition": "outro eq true", "order" : "last" } (_after checking to see if any other wishlist items are true, check to see if you can pick something that sets "outro" to true)

dataFiles

startState

sceneBackground

UIvars

mode

fallbackText

introText

descriptionText

Clone this wiki locally