**(undo: ////) -> //[[harlowe:Command|Command]]//** This [[harlowe:Command|Command]] stops passage code and "undoes" the current turn, sending the player to the previous visited passage and forgetting any variable changes that occurred in this passage. === Example usage: === ''%%You scurry back whence you came... (live:2s)[(undo:)]%%'' will undo the current turn after 2 seconds. === Rationale: === You can attach [[harlowe:changer|changers]] like [[harlowe:t8n-depart|(t8n-depart:)]] and [[harlowe:t8n-arrive|(t8n-arrive:)]] to this to alter the transition animation used when (undo:) activates. Other kinds of changers won't do anything, though. The [[harlowe:go-to|(go-to:)]] macro sends players to different passages instantly. But, it's common to want to send players back to the passage they previously visited, acting as if this turn never happened. (undo:) provides this functionality. By default, Harlowe offers a button in its sidebar that lets players undo at any time, going back to the beginning of the game session. However, if you wish to use this macro, and only permit undos in certain passages and occasions, you may remove the button by using [[harlowe:replace|(replace:)]] on the ?sidebar in a header tagged passage. === Details: === If this is the first turn of the game session, (undo:) will produce an error. You can check which turn it is by examining the ''%%length%%'' of the [[harlowe:history|(history:)]] [[harlowe:Array|Array]]. Just like [[harlowe:go-to|(go-to:)]], (undo:) will "halt" the passage and prevent any macros and text after it from running. === See also: === [[harlowe:go-to|(go-to:)]], [[harlowe:link-undo|(link-undo:)]]