Howdy, Stranger!

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

Reloadng a custom passage in SugarCube

edited July 2016 in Help! with 1.x
I think this is a bit of a noob question, but I am after a way to reload a custom passage on a button click. Currently I reload custom passages after rendering a main passage:
postrender["updateTitles"] = function () {
	setPageElement("titles", "Titles");
};

How would I wrap similar code in a <<script>> macro to reload the passage on command, without reloading the main passage?

Eg I'd like it to fire on specific interactions the player makes in a passage, not just visiting a passage.

Comments

  • I am assuming that your setPageElement function knows how to locate an ID'ed element and then inject the contents of the named passage into it.

    Without testing I would think the following would work.
    <<click "refresh titles">><<run setPageElement("titles", "Titles")>><</click>>
    
  • That unfortunately didn't work.
  • Nevermind, I figured out a better solution.
Sign In or Register to comment.