SugarCube includes polyfills for virtually all JavaScript (ECMAScript) 5 & 6 native object methodsvia the es5-shim and es6-shim polyfill libraries (shims only, no shams)so they may be safely used even if your project will be played in ancient browsers that do not natively support them. See the Save.onLoad.add() method for its replacement. When a saved story is loaded, the state loaded from the save replaces the current state. Returns the number of times that the given member was found within the array, starting the search at position. This means that some code points may span multiple code unitse.g., the character is one code point, but two code units. If you click the link that sets the variable to 2, and then save the story, the $var variable will still be saved as 1, because a new moment has not yet been created. Twine2: Not special. This section offers a list of SugarCube-specific events, triggered at various points during story operation. The array-like object stored in the _args variable should be treated as though it were immutablei.e., unable to be modifiedbecause in the future it will be made thus, so any attempt to modify it will cause an error. Divides the current value on the left-hand side of the operator by the value on the right-hand side and assigns the remainder to the left-hand side. That's not going to work because the onclick content attribute is executed within the global scope, rather than within SugarCube's. Selects the passage element. As you are aware, all javascript See Passage API for more information. Divides the current value on the left-hand side of the operator by the value on the right-hand side and assigns the result to the left-hand side. Any passage may be chosen as the starting passage by selecting it via the Start Story Here passage context-menu itemn.b. The (execution) context object of the macro's parent, or null if the macro has no parent. Determines whether outgoing passage transitions are enabled. Returns the last member from the array. There are a few ways to resolve both parts. For accessibility reasons, it's recommended that you wrap each <> and its accompanying text within a