Is it possible to change passages by javascript instead of clicked link? A function to call when (for example) a timer runs out?
Thanks.
It's definitely possible. I have a similar thing going on in my current story, though, unfortunately, I feel is implemented in a very poor and crude way.
You can use Leon's Macro's (I think TimedCycle is to me, the most useful), and TimedGoTo, which redirects the player to a specified passage at a specified time. You can find all of them http://www.glorioustrainwrecks.com/node/5108.
As far as a function call as a passage-changer (I don't know what else to call it, lol) I personally just call a function and set it's return to a string version of whatever macro I want to run. Here's a quick example.
<<print PassageFunction("Start", "Press This To Test My Function!">>
I'm using SugarCube and this works (and I don't see any reason it shouldn't on any other header). But I must stress that this is a very elementary way to handle stuff like that, and can get kind of messy depending on how big your story is and how dynamic you want the link system to be. If it's not a big deal, it works. But I wouldn't make a habit of it until you get TheMadExile's opinion on it, which you most likely will.
Comments
It's definitely possible. I have a similar thing going on in my current story, though, unfortunately, I feel is implemented in a very poor and crude way.
You can use Leon's Macro's (I think TimedCycle is to me, the most useful), and TimedGoTo, which redirects the player to a specified passage at a specified time. You can find all of them http://www.glorioustrainwrecks.com/node/5108.
As far as a function call as a passage-changer (I don't know what else to call it, lol) I personally just call a function and set it's return to a string version of whatever macro I want to run. Here's a quick example.
Example: Usage: I'm using SugarCube and this works (and I don't see any reason it shouldn't on any other header). But I must stress that this is a very elementary way to handle stuff like that, and can get kind of messy depending on how big your story is and how dynamic you want the link system to be. If it's not a big deal, it works. But I wouldn't make a habit of it until you get TheMadExile's opinion on it, which you most likely will.