Howdy, Stranger!

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

[Harlow]How to Update a variable without loading the whole page again

i'v made a game who is full of interactives things but it need to refresh the page again and again every times and the position of the scroll is not even saved , the easyest way to resolve my problem will be to update the specific code who need to be refresh... for exemple , when i take an item , the page need to reload to take it in my hand , and then , when i click in the slot , it need to reload AGAIN to put it down ...

(im french , sorry for my bad english)

Comments

  • note: Because the next release of the Twine 2 application will include two versions of Harlowe (1.2.3 and 2.0.0) it would help if you also included the story format version (currently 1.2.2) when asking a question, as answers can be different for each version.

    (im french , sorry for my bad english)
    I'm Australian, and you could say the same thing about my English. *smile*

    Assuming I have understood your question correctly you can use a named hook combined with the (replace: ) macro to achieve what you want.
    (set: $chapter to 1)\
    Chapter: [$chapter]<chapter|
    
    (link-repeat: "Change Chapter")[
    	(set: $chapter to it + 1)
    	(replace: ?chapter)[$chapter]
    ]
    
    note: The name of the named hook and the name of the variable do not need to be the same for the above code to work.
  • wow thanks :smiley: !!!
    (and yeah im in 1.2.2 :blush:
Sign In or Register to comment.