GithubHelp home page GithubHelp logo

Comments (1)

astrochili avatar astrochili commented on August 23, 2024

The call story:continue() returns the next paragraph, this is correct and the only way to get paragraphs. If you start the story, it will return the first paragraph, then the second, then the third, etc.

Ink's paradigm is that continue() outputs paragraph after paragraph, and when the paragraphs end, gives you a list of options to choose from. In other words, there are only two states of the framework:

  1. The framework has paragraphs that the game should get itself.
  2. The framework has run out of paragraphs and now has options and is waiting to choose.

After continue() the story no longer stores outputted text, this is the responsibility of the host game to keep the resulting paragraphs that the story produces. The framework is a more low-level solution. As far as I know, the official C# APIs for Unity and JS for the web have a similar interface.

The easiest solution is to save the output to your local variable, either in an array of paragraphs or solid text, as desired. This allowed you to work with paragraphs further as you want.

When I implemented my game, I made my own variable where I put the paragraphs output from the story and saved them along with saving the game. When the game is loaded, it displays this "already printed text" and prompt the player to "continue". There is no need to call continue() immediately after loading the game if we want to restore the player's saved state.

Could this solution help you?

from narrator.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.