This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
harlowe:replace [2017/06/19 01:49] l |
harlowe:replace [2019/04/16 03:10] l |
||
---|---|---|---|
Line 44: | Line 44: | ||
place (replace:) commands in ''%%header%%'' tagged passages, if you want them to conditionally affect | place (replace:) commands in ''%%header%%'' tagged passages, if you want them to conditionally affect | ||
certain named hooks throughout the entire game, without them interfering with other passages. | certain named hooks throughout the entire game, without them interfering with other passages. | ||
+ | |||
+ | (replace:) (and its variations) cannot affects hooks or text that haven't been printed yet - if the (replace:) runs at the same time that the passage is appearing (as in, it isn't inside a hook that's delayed [[harlowe:live|(live:)]], [[harlowe:link|(link:)]], [[harlowe:show|(show:)]] or similar macros), and a hook or line of text appears after it in the passage, the macro won't replace its contents even if it's a valid target. For example: ''%%(replace: "cool")[hot] cool water%%'' won't work because the (replace:) runs immediately, but ''%%cool water (replace: "cool")[hot]%%'' and ''%%(event: when time > 5)[(replace: "cool")[hot]] cool water%%'' will. | ||
+ | |||
+ | As a result of the above, putting these in ''%%header%%'' tagged passages instead of ''%%footer%%'' tagged passages won't do much good, as they are printed before the rest of the passage. | ||
=== See also: === | === See also: === | ||
[[harlowe:append|(append:)]], [[harlowe:prepend|(prepend:)]], [[harlowe:show|(show:)]] | [[harlowe:append|(append:)]], [[harlowe:prepend|(prepend:)]], [[harlowe:show|(show:)]] |