-
Notifications
You must be signed in to change notification settings - Fork 0
how to call a passage with parameters
Sometimes you would like to reuse a passage in a way that requires to hand it over some parameters, f.e. a character-inspector-passage that you want to reuse for different characters.
There is no built-in way to call passages with parameters.
A simple approch is to create window.story.state.args = [] on initGame and use it to store data there just before the passage is called:
:: PartyScreen
<a href='javascript:void(0)' onclick='window.story.state.args=["Eric"];window.story.show(CharScreen);'> Eric </a> </br>
<a href='javascript:void(0)' onclick='window.story.state.args=["Detlev "];window.story.show(CharScreen);'> Detlev </a> </br>
:: CharScreen
<%=window.story.state.args[0]%>'s Health is <%=window.story.state.[window.story.state.args[0]].health%>
<!--this should print "Eric's Health is 40" and requires window.story.state.Eric.health to exist-->
What is twine and interactive fiction
Exampl. SuperSimpleStory
What are storyformats
Why snowman
Setup tweego and snowman
Switching between Tweego and Twine
Snowman template methods
Snowman markup
javascript usage
debugging your story
Common issues with template methods and scripting
Story Telling in general
General concepts for IF
Scenes & Sequels
Designing Puzzles
See here about my js-framework running in snowman:
==> problems & solutions <==