Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

Alter passage text before it is rendered?

$
0
0
@TheMadExile Yes, I know you already could not fathom it, but hear me out.

I'm a lazy bastard who has a list of things I'd like to replace with a styled version.
<<set _replaceList to []>>

<<set _replaceList["ADept"] = "@@aStyle;ADept@@">>
<<set _replaceList["BDept"] = "@@bStyle;BDept@@">>
<<set _replaceList["CDept"] = "@@cStyle;CDept@@">>
}>>

I may add/delete/change the department names and styles of each of them, and I don't want to hunt through all my Passages for each of them. Really, it's just like Harlowe's replace, instead on a particular String instead of a hook.

So, what's this crazy method you spoke of? Does it use postrender/predisplay?

Also, is there a better way to define the replaceList array?

Viewing all articles
Browse latest Browse all 1844

Trending Articles