User Tools

Site Tools


twine_1.4_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.4_bugs [2013/12/19 02:39]
l
twine_1.4_bugs [2017/10/09 20:39] (current)
Line 1: Line 1:
 The following are possible bugs or unintended backwards-compatibility breaks that have been reported for **Twine 1.4.0**. The following are possible bugs or unintended backwards-compatibility breaks that have been reported for **Twine 1.4.0**.
  
-====Sugarcane sidebar====+=====Windows VC++ runtime problem===== 
 + 
 +The Twine windows installer has an incorrect version of the Visual C++ runtime redistributable included. As a result, users who did not already have a correct version of the runtime installed may not be able to run 1.4. 
 + 
 +==Makeshift patch== 
 + 
 +Try to install [[http://​www.microsoft.com/​en-us/​download/​details.aspx?​id=26368|the VC++ 2008 Service Pack 1]]. Be sure to install the x86 version. 
 + 
 +=====Annotation colouration===== 
 + 
 +Annotation passages appear darker than intended when the "​Faster but rougher story map display"​ preference is off. 
 + 
 +=====Monospace font size===== 
 + 
 +When editing a passage, the monospace font uses the normal font's font size instead of its own. 
 + 
 +=====HTML tables===== 
 + 
 +Putting HTML tables in passages is currently bugged - when a <tr> is created, the browser automatically wraps it in a <​tbody>​ tag, and then puts the <​tr>'​s child code into the <​tbody>​ instead of the <​tr>​. 
 + 
 +== Recommendation == 
 + 
 +Use the TiddlyWiki table [[syntax]] instead of HTML. 
 + 
 +===== Importing from HTML ===== 
 + 
 +The "​import from HTML" feature sometimes reads passages incorrectly,​ creating correctly-named and tagged passages with no text. 
 + 
 +===== Jonah scrolling in IE 8 ===== 
 + 
 +The automatic scrolling in Jonah behaves incorrectly in IE 8. 
 + 
 +===== Accessing properties of variables ===== 
 + 
 +If a variable has object properties accessed through dot notation (such as an array with .length or .push) then the property will be incorrectly initialised to 0, making it inaccessible. 
 + 
 +== Makeshift patch == 
 + 
 +Access the property through index notation (for instance, $array["​push"​]() instead of the $array.push() notation) until the bug is fixed. 
 + 
 +=====Sugarcane sidebar=====
  
 The Sugarcane sidebar'​s CSS is missing "​left:​7.5em",​ thus placing it too far to the left of the screen. The Sugarcane sidebar'​s CSS is missing "​left:​7.5em",​ thus placing it too far to the left of the screen.
Line 9: Line 49:
 Put this CSS code in a stylesheet passage: ''#​sidebar { left:7.5em; }''​ Put this CSS code in a stylesheet passage: ''#​sidebar { left:7.5em; }''​
  
-====External link syntax highlighting ====+=====External link syntax highlighting ​=====
 The syntax highlighting for external links is broken - all external links are displayed as bad links even if they begin with "​http:​%%//​%%"​. The syntax highlighting for external links is broken - all external links are displayed as bad links even if they begin with "​http:​%%//​%%"​.
  
-==== Variable array indexes ====+===== Variable array indexes ​=====
  
 Due to a bug, you currently can't use variables as array indexes (such as $weapons[$hand]) unless you include extra padding whitespace. Due to a bug, you currently can't use variables as array indexes (such as $weapons[$hand]) unless you include extra padding whitespace.
Line 20: Line 60:
 Put a space between the array variable and the first square bracket: $weapons [$hand] Put a space between the array variable and the first square bracket: $weapons [$hand]
  
-==== <<​choice>>​ ====+===== <<​choice>> ​=====
  
 <<​choice>>​ ought to disable both itself and every other <<​choice>>​ macro in the passage - but in 1.4.0 it only disables itself. <<​choice>>​ ought to disable both itself and every other <<​choice>>​ macro in the passage - but in 1.4.0 it only disables itself.
  
-==== Shorthand <<​display>>​====+===== Shorthand <<​display>>​=====
  
 The shorthand [[<<​display>>​]] syntax sometimes gives a nonsensical error if no arguments are given - for instance, %%<<​Start>>​%% doesn'​t work. The shorthand [[<<​display>>​]] syntax sometimes gives a nonsensical error if no arguments are given - for instance, %%<<​Start>>​%% doesn'​t work.
Line 31: Line 71:
 Put a space between the passage'​s name and the ending %%>>: <<​Start >>%% Put a space between the passage'​s name and the ending %%>>: <<​Start >>%%
  
-==== <<​nobr>>​ errors ====+===== <<​nobr>>​ errors ​=====
  
 Due to a bug, <<​nobr>>​ produces an error message if any text at all follows the closing <<​endnobr>>​ tag, including whitespace. It also doesn'​t allow nesting <<​nobr>>​ tags (but admittedly, that's not really useful at all). Due to a bug, <<​nobr>>​ produces an error message if any text at all follows the closing <<​endnobr>>​ tag, including whitespace. It also doesn'​t allow nesting <<​nobr>>​ tags (but admittedly, that's not really useful at all).
Line 39: Line 79:
 Use the ''​\''​ line-continuation symbol in place of <<​nobr>>​ in situations where this would be an issue. Use the ''​\''​ line-continuation symbol in place of <<​nobr>>​ in situations where this would be an issue.
  
-==== <<textinput>> ====+===== <<nobr>> ​and multi-line macros =====
  
-This macro'​s absence is not actually a bug. <<​textinput>>,​ a macro that was added in the Twine 1.3.6 alpha, was removed from the Twine codebase by its author, as it was intended primarily for testing and was never meant for actual end-use. (In Twine 1.4.1, it may be possible to use raw HTML <​input>​ tags to replicate the original functionality of <<​textinput>>,​ with the advantage of allowing more input types than just text boxes.)+If a macro tag spans multiple lines (such as one declaring an object or array literal), and is inside a <<​nobr>>,​ the newlines will be converted to zero-width spaces, which are **not** considered whitespace in Javascript, and thus cause an error. 
 + 
 +===== Escaped line breaks vs. obfuscation===== 
 + 
 +If you use the obfuscation option, the ''​\''​ line-continuation symbol will be incorrectly changed to a backslash followed by a random letter, and the line will not continue. 
 + 
 +===== <<​textinput>>​ ===== 
 + 
 +This macro'​s absence is not actually a bug. <<​textinput>>,​ a macro that was added in the Twine 1.3.6 alpha, was removed from the Twine codebase by its author, as it was intended primarily for testing and was never meant for actual end-use. (In Twine 1.4.1, it may return by popular demand.)
  
 == Makeshift patch == == Makeshift patch ==
Line 48: Line 96:
 <​code>​macros.textinput={handler:​function(a,​b,​c){if(c[1]){var d=c[0].replace(/​\$/​g,""​);​el=document.createElement("​span"​);​var e="<​input id='"​+d+"'​ type='​text'​ onkeypress=\"​var charCode; if(event && event.which){charCode = event.which;​}else if(window.event){event = window.event;​charCode = event.keyCode;​}if(charCode == 13) {state.history[0].variables."​+d+"​ = this.value; state.display('"​+c[1]+"'​)}\"/>";​if(c[2]){e+="<​input type='​button'​ value='"​+c[2]+"'​ onclick=\"​state.history[0].variables."​+d+"​ = getElementById('"​+d+"'​).value;​ state.display('"​+c[1]+"'​);​\"/>"​}el.innerHTML=e;​a.appendChild(el)}else{throwError(a,'"​[PassageName]"​ parameter missing'​)}}};</​code>​ <​code>​macros.textinput={handler:​function(a,​b,​c){if(c[1]){var d=c[0].replace(/​\$/​g,""​);​el=document.createElement("​span"​);​var e="<​input id='"​+d+"'​ type='​text'​ onkeypress=\"​var charCode; if(event && event.which){charCode = event.which;​}else if(window.event){event = window.event;​charCode = event.keyCode;​}if(charCode == 13) {state.history[0].variables."​+d+"​ = this.value; state.display('"​+c[1]+"'​)}\"/>";​if(c[2]){e+="<​input type='​button'​ value='"​+c[2]+"'​ onclick=\"​state.history[0].variables."​+d+"​ = getElementById('"​+d+"'​).value;​ state.display('"​+c[1]+"'​);​\"/>"​}el.innerHTML=e;​a.appendChild(el)}else{throwError(a,'"​[PassageName]"​ parameter missing'​)}}};</​code>​
  
-==== <<​return>>​ and bookmarks ====+===== <<​back>>/​<<​return>>​ and bookmarks ​=====
  
 Just as in 1.3.5, the <<​back>>​ macro may not function correctly for game states loaded from a bookmark. If you bookmark a passage that contains a <<​back>>​ macro, then reload from the bookmark, the <<​back>>​ macro won't work because the loaded page is the only page in the browser history. However, the <<​return>>​ macro also suffers from this deficiency, for reasons Just as in 1.3.5, the <<​back>>​ macro may not function correctly for game states loaded from a bookmark. If you bookmark a passage that contains a <<​back>>​ macro, then reload from the bookmark, the <<​back>>​ macro won't work because the loaded page is the only page in the browser history. However, the <<​return>>​ macro also suffers from this deficiency, for reasons
Line 56: Line 104:
 Use ''​%%[[Return|previous()]]%%''​ instead of <<​return>>​. Use ''​%%[[Return|previous()]]%%''​ instead of <<​return>>​.
  
 +===== <<​back>>​ and Undo:off =====
 +
 +If the [[StorySettings]] option "​undo"​ is off, then <<​back>>​ may cause [[link]] [[variable]]s in preceding passages to be forgotten or incorrect.
 +
 +===== visited() and similar passage names =====
 +
 +The visited() [[function]] will incorrectly consider you having visited a passage if, in the past, you visited another passage whose name is a substring of the passage. (For example, visited("​Next 2") would incorrectly be 1 if you previously visited a passage titled "​Next"​.)
 +
 +===== a:link CSS selector =====
 +
 +In Twine 1.4, the "​href"​ attribute was removed from internal links, because it has no purpose (except to unwittingly clue the especially canny player into the fact that the link is //​specifically//​ an internal link, by the fact that hrefs are revealed by hovering over links - which may "tip the hand" of certain authors who, for instance, may try to disguise a macro link as an internal link). However, this inadvertently means that the "​a:​link"​ CSS selector [[http://​www.ashtonraze.com/?​p=387|promoted by Ashton Raze]] no longer selects internal links (since "​a:​link"​ is a synonym for "​a[href]"​).
 +
 +== Makeshift patch ==
 +
 +Use a more precise selector for passage links, such as "​.passage a", as described [[stylesheet|here]]. This selector has the advantage of not selecting links outside of the passage (for instance, in the Sugarcane sidebar).
  
-==== Scripts ====+===== Scripts ​=====
  
 Some old scripts, such as Leon Arnott'​s [[http://​www.glorioustrainwrecks.com/​node/​5084|Tag CSS]], contain a shim to get them to work with the Start passage in Twine 1.3.5, by using the state.history object. Unfortunately,​ the script (and presumably others like it) does not correctly check for the existence of state.history[0].passage,​ so it will crash in Twine 1.4. (If you are getting the error message ''​state.history[0].passage is null''​ or something similar, this is likely the reason.) Due to the popularity of this and other scripts, a counter-shim may be installed in Twine 1.4.1 to counteract this. Some old scripts, such as Leon Arnott'​s [[http://​www.glorioustrainwrecks.com/​node/​5084|Tag CSS]], contain a shim to get them to work with the Start passage in Twine 1.3.5, by using the state.history object. Unfortunately,​ the script (and presumably others like it) does not correctly check for the existence of state.history[0].passage,​ so it will crash in Twine 1.4. (If you are getting the error message ''​state.history[0].passage is null''​ or something similar, this is likely the reason.) Due to the popularity of this and other scripts, a counter-shim may be installed in Twine 1.4.1 to counteract this.
twine_1.4_bugs.1387438744.txt.gz · Last modified: 2017/10/09 20:38 (external edit)