Howdy, Stranger!

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

How do I edit Javascript in Sugarcube?

Preface: I have no idea what Javascript is, does or how to edit it.

What I want to to is disable the back button in Sugarcube. Simple as that.

I've put the question into Google and got a quick simple answer:
If using SugarCube, to disable the back button you put this in your Javascript area:

config.disableHistoryControls = true;

Brilliant! I thought.

I have since spent the last several hours trying to figure out where the hell my Javascript area is.

SugarCube's own wiki tells me this:
Properties on the configuration object (config) may be set within a script-tagged passage to control various aspects of SugarCube's behavior.

Which, to be honest, is utter gibberish to me.

I keep finding the same answer. That I need to use the "Edit Story JavaScript story menu item" Except I simply cannot find this menu, and nothing is helping me get to it.

Every answer I find is simply speaking a language I don't understand, literally. I'm sure that for anyone who knows what Java is and does this is plain simple, but I'm just out of patience and options so I'm posting this. Please help this idiot fix this thing and be as simplistic and patronising as you want! Thanks!

Comments

  • When you edit your story, there will be a menu in the lower right-hand corner which has the same name as your story. Open that menu and near the top of it will be menu item you're looking for.

    Also, if you're using SugarCube 2.x (as you've tagged the thread), then the property you're looking for is config.history.controls, which you'd use like so:
    config.history.controls = false;
    
  • KayKay
    edited October 2015
    Screenshot: http://imgur.com/nQEmoqH

    No such luck, I'm afraid. There is nothing in the lower right, not in the main screen, or in individual passages.

    Perhaps I should have specified that I'm using Windows?
  • I think I've just figure out what the problem is...

    brb downloading Twine 2.0.8

    *punchface*
  • Because you placed this question in the Help! with 2.0 trhead TheMadExile gave you the instructions for Twine 2.

    The instructions for Twine 1 are to right mouse button click on the Passage Map (the dark grey area containing all your passages) and select the New Script Here menu option.
    This will create a new Passage which is automatically given a script tag, you place all your Javascript settings and code into this new passage.
    note: You should only have one script tagged passage per story project.
  • greyelf is correct about me giving Twine 2 instructions, and why, and with his Twine 1 instructions. Though on the Twine 1 front, I'll go a bit further and note that the salient point which you should internalize is that the passage, however it's created, be tagged with script.
Sign In or Register to comment.