Howdy, Stranger!

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

Using an http query string (SugarCube/Twine)

Is there any reason to be wary of using a url query string to pass a setting into a project? E.g.:
http://mystory.com/story.html?cheatcode=1234
I get the impression that Twine may manipulate the URL and want to be sure that using a url string wouldn't cause problems. I'm using SugarCube (standard history, not hashed), and would read in and process the data from the query string during the StoryInit passage, assigning to variables/option store as appropriate.

Comments

  • Actually, both because it will make this thread more useful and because I may need to switch later, what would be the potential ramifications of using a url query string with hashed URLs. (I'm assuming that the SugarCube setting config.historyMode = modes.hashTag; enables a mode like SugarCane's hashed passage urls, e.g. story.html#2q.4y -- I could be wrong about that.)
  • Off-hand, I don't think there's any reason to be wary or potential ramifications to watch out for.  At present, my thoughts are that it should be okay, so if it's not, then that should be considered lossage.  Try it out.

    As to SugarCube's hashTag mode.  Yes, it's just like the old vanilla headers hash system (no state beyond the path taken).  It's still included solely for legacies/compatibilities sake.  I strongly recommend against using it.
  • Thanks. I finally tried the url query string and it seems to work fine. Which is awesome.

    I've also come up with a way to provide the functionality I was thinking I might need from url hashtags without switching over to that mode (thankfully).
Sign In or Register to comment.