User Tools

Site Tools


twine_1.3.5_bugs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
twine_1.3.5_bugs [2013/11/13 00:31]
l
twine_1.3.5_bugs [2017/10/09 20:39] (current)
Line 1: Line 1:
-All of the following **bugs** or otherwise deprecated behaviour apply only to **Twine 1.3.5**. They have been fixed in future versions.+All of the following **bugs** or otherwise deprecated behaviour apply only to **Twine 1.3.5**. They have been fixed in version 1.4.
  
 ==== Start passage problems ==== ==== Start passage problems ====
Line 10: Line 10:
  
 The inline-style syntax ( @@background-color:​ghostwhite;​like this@@ ) cannot be used at all. A script to fix this bug is available [[http://​www.glorioustrainwrecks.com/​node/​5063|here]]. The inline-style syntax ( @@background-color:​ghostwhite;​like this@@ ) cannot be used at all. A script to fix this bug is available [[http://​www.glorioustrainwrecks.com/​node/​5063|here]].
 +
 +==== The back button, <<​back>>,​ and non-deterministic macros ====
 +
 +Sugarcane, as a consequence of using [[https://​developer.mozilla.org/​en-US/​docs/​Web/​Reference/​Events/​hashchange|hashchanges]] whenever a new passage is visited, causes each passage visit to be registered in the browser'​s history. As a result, it is possible to use the "​back"​ button to undo the previous move, rewinding the game state. The <<​back>>​ macro in 1.3.5 functions by triggering ''​window.back()'',​ which performs the same action.
 +
 +But, what actually happens when this happens is that the entire game page is reloaded, and all the macros in every passage prior to this one are re-run, to re-compute the game state. As a result, a number of unsightly problems can occur.
 +
 + * Random or non-deterministic macros (that invoke ''​Math.random()''​) will return different results, thus changing the game state.
 +
 + * Player input macros (that call ''​prompt()''​) will all trigger again, showing their prompts and forgetting the old provided answers.
 +
 + * Sound macros will trigger again, playing all their sounds simultaneously.
 +
 +As a result, this behaviour is unsuited to rich Twine games.
 +
 +Two scripts exist that can fix this behaviour. [[http://​www.glorioustrainwrecks.com/​node/​5425|This one]] causes Sugarcane to use HTML5 History instead of hashchanges,​ thus permitting the browser Back button to continue its function as an '​undo'​ button. [[http://​www.glorioustrainwrecks.com/​node/​5094|This one]], however, eliminates the Back button functionality entirely, which many may find useful (and, in fact, was formerly replicated by the "​single-screen Jonah" format).
  
 ==== <<​print 0>> ==== ==== <<​print 0>> ====
Line 26: Line 42:
  
 A script to fix this bug is available [[http://​www.glorioustrainwrecks.com/​node/​5321|here]]. A script to fix this bug is available [[http://​www.glorioustrainwrecks.com/​node/​5321|here]].
 +
 +==== <<​remember>>​ ====
 +
 +Since this uses browser cookies to store the variables, it doesn'​t work if the game is played locally from disk - it has to be loaded from a web server. This makes testing somewhat difficult. (In future versions, it uses HTML5 History, and does not have this limitation.)
  
 ==== <<​if>>​ and whitespace ==== ==== <<​if>>​ and whitespace ====
twine_1.3.5_bugs.1384320698.txt.gz ยท Last modified: 2017/10/09 20:38 (external edit)