Hello!
I'm using twine 1.4.2 with Sugarcane and have been trying to use ROT13 to... well, obfuscate spoilers in the HTML source code. After clicking StorySettings -> checkbox with ROT13, test plays from then on refuse to run and instead give the following error message:
"
Traceback (most recent call last):
File "storyframe.pyo", line 907, in rebuild
File "tiddlywiki.pyo", line 188 in toHtml
File "tiddlywiki.pyo", line 507 intoHtml
File "tiddlywiki.pyo", line 495, in applyRot13
File "encodings/rot_13.pyo", line 20, in decode
UnicodeEncodeError: 'ascii'codec can't encode character u'\u2019' in position 409: ordinal not in range (128)
"
Any ideas on how to work around it? Thanks!
Comments
There is no real benefit obfuscating your story because it is a trivial process for the Reader to undo but if you really want to do it then you will need to replace all unicode characters with their ASCII equivalents.
I was trying to make a lock requiring a password, but I realized that the answer could be found in the source code..
1. Place the following in the passage you use to story your Javascript, if you don't have one yet then right click on the Passage Map and select the New Script Here option.
You can give the new passage whatever title you want, I name mine Scripts.
note: There are bound to be better hash functions, but for this purpose this one will do.
2. You need to determine what the hash is for your master password because you will need to hard-code that into your story. Use the following to generate a hash your master password, the master password of this example will be banana.
note: Once you have done this you can (and should) remove the code in point 2 from the story.
3. You need to store the hash from point 2 into a variable in your StoryInit passage, you will use this variable later to compare the Reader's password.
note: the hash of my master password was -1396355227, yours will be a different value.
4. Ask the Reader what they think the password is in one of your passages:
note: In this example you will need to enter banana to be correct.
5. Check the Reader's $password against the $masterPassword in the Check Password passage, you can change the passage title but remember to also change it in the code in point 4. Also remember that the Reader may not of entered a value before clicking on the button in point 4.