daterre / Cradle

Play Twine stories in Unity.
MIT License
298 stars 32 forks source link

Dynamically generated (runtime) stories with Cradle #66

Open daterre opened 6 years ago

daterre commented 6 years ago

Question via email:

I wanted to ask you if in some way I will be able to modify Cradle in order to create stories at runtime and not only in the unity editor.

The core of Cradle, the Story class, was made with other story formats in mind other than Twine. It is usually used by scripts that are automatically generated from pre-written Twine files, but it can also be used directly in a C# script that generates story content any way it chooses, including dynamically.

The basic idea is that you derive your script from the Story class, populate the Story.Passages dictionary with passages, and give each of those passages some logic that generates StoryOutput objects.

I added an example to the wiki but am opening an issue in case anyone wants to raise any questions/ideas!