Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Function or macro inside a macro

Its posible to use a macro or a function inside an if macro?
Currently I have to repeat a check on a lot of ifs and if i could a macro or a function of this comprobation it would be great.

The idea is something like this
add.macro("checkXP",....

<<if <<chekXP>> >>...<<endif>>
function checkXP (){...}

<<if chekXP()>>...<<endif>>

Comments

  • You could try making your own macro using a script passage, as outlined on the twine wiki here.
  • You may call functions within expression-type macros, of which <<if>> is one, yes. To define the function, you'll have to put something like the following in your Story JavaScript:
    window.checkXP = function () {
    	/* code */
    };
    
Sign In or Register to comment.