Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Question on debugging

When debugging, is there any way to keep track of declared variables and their values? I'm finding that as my project expands, spot checks that code is running properly are becoming increasingly difficult to manage.

Comments

  • The debugging features available to a story Author when using the Test option of Twine 2 are what ever the Creator of the selected Story Format has implemented, which is why the Debug View option is only available when using Harlowe.

    SugarCube allows anyone familiar with the browser's Javascript console to inspect a story's variables and their current / previous values via its Story APIs. There are a number of previous posts on this forum related to this subject.

    Snowman 2 allows anyone familiar with the browser's Javascript console to inspect a story's state via the "story.state" array. This variable will only have values in it if the Author has either: 1) been using the 's' accessor available to passages when they are rendered, or 2) the Author has been manually appending their variables to "story.state" directly. Otherwise it is up to the Author to know where they have been storing their variables.

    Harlowe: One of the javascript experts may have a suggestion on how to track/debug this story format's variables.
  • Thanks for the advice! I'm using Harlowe, but depending on what things end up looking like, I might switch to something else, depending on what I find.
Sign In or Register to comment.