User Tools

Site Tools


writing_your_own_macros

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision Both sides next revision
writing_your_own_macros [2013/11/13 00:38]
klembot created
writing_your_own_macros [2014/01/15 03:45]
l
Line 1: Line 1:
-===== Writing Your Own Macros =====+===== Custom ​Macros =====
  
-It's possible to write your own macros for use in your stories. Doing so will require knowledge of both JavaScript ​and the [[http://​gimcrackd.com/​etc/​api/​|Twee API]], but fortunately,​ Twee macros are written in almost the same format as TiddlyWiki ones. +It's possible to write your own macros for use in your stories. Doing so will require knowledge of both Javadcript ​and the Twine engine.
- +
-TiddlyWiki macros extend the config.macros object; Twee macros extend an object named macros directly. This is the only difference in how macros are created.+
  
 Here's an example passage that creates a macro named ''<<​hello>>''​ that, when invoked in another passage, displays an alert that greets the reader. Here's an example passage that creates a macro named ''<<​hello>>''​ that, when invoked in another passage, displays an alert that greets the reader.
Line 21: Line 19:
 </​code>​ </​code>​
  
-If you're curious how a built-in macro works, browsing the [[http://code.google.com/p/​twee/​source/​browse/#​svn/trunk|source code repository]] may be helpful, too.+If you're curious how a built-in macro works, browsing the [[https://github.com/tweecode/twine|source code repository]] may be helpful, too.
writing_your_own_macros.txt · Last modified: 2017/10/09 20:39 (external edit)