Howdy, Stranger!

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

Is there a way to force the sidebar to update via click/link/timed macros?

I'm using StoryCaption to display some character stats such as $PC.strength and have a clock variable in StoryBanner.
I want to make it so that those update when I make changes that don't trigger a passage transition. (such as via <<replace>>)

What I have is something like this
<<click|link|timed "do push ups">> /% obviously timed wouldn't apply to pushups but you get the idea %/
 <<set $PC.strength += 1>>
 <<replace>> ... /% the section of multiple passages that show you what exercises you can do %/ ... <</replace>>
 <<clockAdvance 15>> /% adds 15 minutes to the clock and thus triggers various hourly/daily/weekly changes as appropriate %/
<</click|link|timed>>

The replacements work fine, but the clock and stats in StoryBanner and StoryCaption don't update until I do something that changes passages.

In my searching the closest I've found to an answer was part of something 'Liz England' posted over on intfiction.org:
In order to have separate panes within the tool, I've always hijacked the StoryTitle and used it to display in-game information. You can put variables in the StoryTitle passage, but since that area doesn't refresh each time you click a link you also need to add <<update>> to your passages every time you want it to update.

But as far as I can tell <<update>> does not seem to be an actual thing? or atleast adding it to my code threw a macro does not exist error. Maybe I just used it incorrectly?

What I've seen of State.??? while implementing keypress listeners seemed promising, but I can only seem to get changes to affect the main passage.

Does anyone know how to do this? I'm sort of expecting it to either be forehead slappingly simple, or the sort of thing that gets answered with lots of links to various coding wikis (either is fine)

Comments

  • The former. I'm only going to link what I always do, the official documentation.

    An easy thing you could to do to force an update of the elements populated from the StoryBanner and StoryCaption would be to create a widget like the following: (create a new passage, tag it with widget)
    <<widget "updatebar">><<silently>>
    <<replace "#story-banner">><<display "StoryBanner">><</replace>>
    <<replace "#story-caption">><<display "StoryCaption">><</replace>>
    <</silently>><</widget>>
    
    Usage:
    <<updatebar>>
    
  • ::Facepalms::

    Thank you.
Sign In or Register to comment.